Class: BackRack::NewApp
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- BackRack::NewApp
- Includes:
- Thor::Actions
- Defined in:
- lib/backrack/generators.rb
Class Method Summary collapse
Instance Method Summary collapse
- #boot_file ⇒ Object
- #config_javascript ⇒ Object
- #gemfile ⇒ Object
- #javascripts ⇒ Object
- #rack ⇒ Object
- #rakefile ⇒ Object
- #router ⇒ Object
- #statics ⇒ Object
- #structure ⇒ Object
- #stylesheets ⇒ Object
Class Method Details
.source_root ⇒ Object
7 8 9 |
# File 'lib/backrack/generators.rb', line 7 def self.source_root File.join File.dirname(__FILE__), 'templates' end |
Instance Method Details
#boot_file ⇒ Object
51 52 53 |
# File 'lib/backrack/generators.rb', line 51 def boot_file template 'boot.js.coffee', "#{name}/src/javascripts/boot.js.coffee" end |
#config_javascript ⇒ Object
47 48 49 |
# File 'lib/backrack/generators.rb', line 47 def config_javascript template 'config.js.coffee', "#{name}/src/javascripts/config.js.coffee" end |
#gemfile ⇒ Object
11 12 13 |
# File 'lib/backrack/generators.rb', line 11 def gemfile template 'Gemfile', "#{name}/Gemfile" end |
#javascripts ⇒ Object
23 24 25 |
# File 'lib/backrack/generators.rb', line 23 def javascripts template 'application.js', "#{name}/src/javascripts/application.js" end |
#rack ⇒ Object
15 16 17 |
# File 'lib/backrack/generators.rb', line 15 def rack template 'config.ru', "#{name}/config.ru" end |
#rakefile ⇒ Object
34 35 36 |
# File 'lib/backrack/generators.rb', line 34 def rakefile template 'Rakefile', "#{name}/Rakefile" end |
#router ⇒ Object
55 56 57 |
# File 'lib/backrack/generators.rb', line 55 def router template 'router.js.coffee', "#{name}/src/javascripts/router.js.coffee" end |
#statics ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/backrack/generators.rb', line 38 def statics copy_file 'index.html', "#{name}/public/index.html" %w{jquery-1.7.2.js json2.js backbone.js underscore.js}.each do |static| copy_file static, "#{name}/src/javascripts/vendor/#{static}" end copy_file '../../../bin/backrack', "#{name}/scripts/backrack" FileUtils.chmod 0755, "#{name}/scripts/backrack", verbose: false end |
#structure ⇒ Object
27 28 29 30 31 32 |
# File 'lib/backrack/generators.rb', line 27 def structure %w{javascripts/collections javascripts/models javascripts/views javascripts/templates stylesheets/vendor}.each do |directory| copy_file '.gitkeep', "#{name}/src/#{directory}/.gitkeep" end end |
#stylesheets ⇒ Object
19 20 21 |
# File 'lib/backrack/generators.rb', line 19 def stylesheets template 'application.css', "#{name}/src/stylesheets/application.css" end |