Class: Relocator::CLI::Files
- Inherits:
-
Object
- Object
- Relocator::CLI::Files
- Defined in:
- lib/relocator/cli/files.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(class_name, glob: "**/*.rb") ⇒ Files
constructor
A new instance of Files.
Constructor Details
#initialize(class_name, glob: "**/*.rb") ⇒ Files
6 7 8 9 |
# File 'lib/relocator/cli/files.rb', line 6 def initialize(class_name, glob: "**/*.rb") self.class_name = class_name self.glob = glob end |
Class Method Details
.call(*args) ⇒ Object
2 3 4 |
# File 'lib/relocator/cli/files.rb', line 2 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/relocator/cli/files.rb', line 11 def call Dir[glob].reject do |filename| File .open(filename) .grep(class_name_regexp) .empty? end end |