Class: Reflection::Command::Base
- Inherits:
-
Object
- Object
- Reflection::Command::Base
- Defined in:
- lib/reflection/command/base.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(new_config) ⇒ Base
constructor
A new instance of Base.
- #validate ⇒ Object
- #verify_that_target_is_not_a_repository(target_directory) ⇒ Object
Constructor Details
#initialize(new_config) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/reflection/command/base.rb', line 12 def initialize(new_config) self.config = new_config end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/reflection/command/base.rb', line 4 def config @config end |
Class Method Details
.run!(config) ⇒ Object
6 7 8 9 10 |
# File 'lib/reflection/command/base.rb', line 6 def self.run!(config) command = self.new(config) command.validate! if command.respond_to?(:validate!) command.run! end |
Instance Method Details
#validate ⇒ Object
16 17 18 |
# File 'lib/reflection/command/base.rb', line 16 def validate Reflection::Validations end |
#verify_that_target_is_not_a_repository(target_directory) ⇒ Object
20 21 22 23 24 |
# File 'lib/reflection/command/base.rb', line 20 def verify_that_target_is_not_a_repository(target_directory) if Repository.exists?(target_directory.path) Support.exit_with_error "The specified --directory is a repository. Reflection is afraid of breaking something, so it won't touch it. Pleace specify another one.." end end |