Class: Deano::NameCommand
- Defined in:
- lib/deano/commands/name_command.rb
Direct Known Subclasses
AppDestroyer, AppGenerator, ModelDestroyer, ModelGenerator, NewProjectGenerator
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #classified ⇒ Object
- #clean_string(f) ⇒ Object
-
#initialize(args) ⇒ NameCommand
constructor
A new instance of NameCommand.
- #underscored ⇒ Object
Methods inherited from Command
#app_path, #cmd, command, commands, #rm, #rm_r, #template_path
Constructor Details
#initialize(args) ⇒ NameCommand
Returns a new instance of NameCommand.
18 19 20 21 22 |
# File 'lib/deano/commands/name_command.rb', line 18 def initialize(args) self.args = args self.name = ARGV[1] @app_dir = File.(FileUtils.pwd) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
4 5 6 |
# File 'lib/deano/commands/name_command.rb', line 4 def args @args end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/deano/commands/name_command.rb', line 4 def name @name end |
Class Method Details
Instance Method Details
#classified ⇒ Object
14 15 16 |
# File 'lib/deano/commands/name_command.rb', line 14 def classified self.name.classify end |
#clean_string(f) ⇒ Object
24 25 26 |
# File 'lib/deano/commands/name_command.rb', line 24 def clean_string(f) f.gsub(Deano.template_dir, @app_dir).gsub("template_app", self.underscored).gsub("TemplateApp", self.classified) end |
#underscored ⇒ Object
10 11 12 |
# File 'lib/deano/commands/name_command.rb', line 10 def underscored self.name.underscore end |