class Renamespace

Constants

Paths
VERSION

Attributes

can_omit_prefixes_count[R]
no_superclass_prefixing[R]
paths[R]

Public Class Methods

new(source_file_path:, destination_file_path:, can_omit_prefixes_count:, no_superclass_prefixing:) click to toggle source
# File lib/renamespace.rb, line 17
def initialize(source_file_path:, destination_file_path:, can_omit_prefixes_count:, no_superclass_prefixing:)
  @paths = Renamespace::Paths.new(
    source: source_file_path,
    destination: destination_file_path,
  )
  @can_omit_prefixes_count = can_omit_prefixes_count
  @no_superclass_prefixing = no_superclass_prefixing
end

Public Instance Methods

call() click to toggle source
# File lib/renamespace.rb, line 26
def call
  move_and_renamespace_source_file
  move_spec_file
  expand_relative_requires_within_all_files
  rename_within_all_files
  remove_empty_dirs
end

Private Instance Methods

expand_relative_requires_within_all_files() click to toggle source
# File lib/renamespace.rb, line 49
def expand_relative_requires_within_all_files
  Renamespace::ExpandRelativeRequiresWithinAllFiles.new.call
end
move_and_renamespace_source_file() click to toggle source
# File lib/renamespace.rb, line 38
def move_and_renamespace_source_file
  Renamespace::MoveAndRenamespaceSourceFile.new(
    paths: paths,
    no_superclass_prefixing: no_superclass_prefixing,
  ).call
end
move_spec_file() click to toggle source
# File lib/renamespace.rb, line 45
def move_spec_file
  Renamespace::MoveSpecFile.new(paths: paths).call
end
remove_empty_dirs() click to toggle source
# File lib/renamespace.rb, line 57
def remove_empty_dirs
  Renamespace::Directories.remove_empty_dirs
end
rename_within_all_files() click to toggle source
# File lib/renamespace.rb, line 53
def rename_within_all_files
  Renamespace::RenameWithinAllFiles.new(paths: paths, can_omit_prefixes_count: can_omit_prefixes_count).call
end