Class: Lanes::Command::App
- Inherits:
-
NamedCommand
- Object
- Thor::Group
- NamedCommand
- Lanes::Command::App
- Defined in:
- lib/lanes/command/app.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Attributes inherited from NamedCommand
#class_name, #client_dir, #identifier, #namespace, #spec_dir
Instance Method Summary collapse
- #create_client_files ⇒ Object
- #create_files ⇒ Object
- #create_screen_base ⇒ Object
- #create_spec_helpers ⇒ Object
-
#load_namespace ⇒ Object
override.
- #set_variables ⇒ Object
Methods inherited from NamedCommand
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/lanes/command/app.rb', line 9 def title @title end |
Instance Method Details
#create_client_files ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/lanes/command/app.rb', line 42 def create_client_files self.class.source_root.join('client').children.each do | path | next unless path.directory? empty_directory "#{client_dir}/#{path.basename}" create_file "#{client_dir}/#{path.basename}/.gitkeep" end template "client/models/BaseModel.coffee", "#{client_dir}/models/Base.coffee" template "client/components/BaseComponent.coffee", "#{client_dir}/components/Base.coffee" template "client/index.js", "#{client_dir}/index.js" template "client/Extension.coffee", "#{client_dir}/Extension.coffee" template "client/styles.scss", "#{client_dir}/styles.scss" end |
#create_files ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lanes/command/app.rb', line 22 def create_files ["Gemfile", "Rakefile", "Guardfile", "config.ru", "config/database.yml"].each do | file | template file end template "lib/namespace.rb", "lib/#{identifier}.rb" template "lib/namespace/version.rb", "lib/#{identifier}/version.rb" template "lib/namespace/extension.rb", "lib/#{identifier}/extension.rb" template "lib/namespace/base_model.rb", "lib/#{identifier}/model.rb" template "../coffeelint.json", "coffeelint.json" template "../.rubocop.yml", ".rubocop.yml" template "config/screens.rb" template "config/routes.rb" template "config/lanes.rb" template "gitignore",".gitignore" create_file "log/.gitkeep","" create_file "tmp/.gitkeep","" create_file "db/.gitkeep", "" end |
#create_screen_base ⇒ Object
62 63 64 65 |
# File 'lib/lanes/command/app.rb', line 62 def create_screen_base = self..dup template "client/screens/BaseScreen.coffee", "#{client_dir}/screens/Base.coffee" end |
#create_spec_helpers ⇒ Object
55 56 57 58 59 60 |
# File 'lib/lanes/command/app.rb', line 55 def create_spec_helpers template "spec/client/helpers/ClientHelpers.coffee", "#{spec_dir}/helpers/#{namespace}Helpers.coffee" template "spec/server/spec_helper.rb", "spec/server/spec_helper.rb" end |
#load_namespace ⇒ Object
override
11 12 13 14 |
# File 'lib/lanes/command/app.rb', line 11 def load_namespace # override @namespace = name.underscore.camelize @identifier = @namespace.underscore.dasherize end |
#set_variables ⇒ Object
16 17 18 19 20 |
# File 'lib/lanes/command/app.rb', line 16 def set_variables super @title = [:title] || @namespace self.destination_root = [:directory] || name end |