Class: Lanes::Command::GenerateScreen
- Inherits:
-
NamedCommand
- Object
- Thor::Group
- NamedCommand
- Lanes::Command::GenerateScreen
- Defined in:
- lib/lanes/command/generate_screen.rb
Constant Summary collapse
- OPTIONS =
{ title: '', description: '', icon: '', group_id: '', model_class: '', namespace: nil }
Instance Attribute Summary
Attributes inherited from NamedCommand
#class_name, #client_dir, #namespace
Instance Method Summary collapse
Methods inherited from NamedCommand
#load_namespace, #set_variables, source_root
Instance Method Details
#create_screen ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/lanes/command/generate_screen.rb', line 21 def create_screen template "lib/namespace/screen.rb", "lib/#{namespace}/#{name}_screen.rb" template "client/screens/index.js", "#{client_dir}/screens/#{name}/index.js" template "client/screens/styles.scss", "#{client_dir}/screens/#{name}/index.scss" template "client/screens/Screen.coffee", "#{client_dir}/screens/#{name}/#{name.classify}.coffee" template "client/screens/layout.html", "#{client_dir}/screens/#{name}/layout.html" end |
#set_defaults ⇒ Object
17 18 19 |
# File 'lib/lanes/command/generate_screen.rb', line 17 def set_defaults [:title] = name.titleize if [:title].blank? end |