Class: Nrb::Commands::Script
- Defined in:
- lib/nrb/commands/script.rb
Instance Method Summary collapse
- #boot ⇒ Object
- #bundle_install ⇒ Object
- #config_nrb ⇒ Object
- #db_config ⇒ Object
- #gemfile ⇒ Object
- #gitignore ⇒ Object
- #initialize_repo ⇒ Object
- #rakefile ⇒ Object
- #readme ⇒ Object
- #resources ⇒ Object
- #script_file ⇒ Object
Methods inherited from Base
Instance Method Details
#boot ⇒ Object
51 52 53 |
# File 'lib/nrb/commands/script.rb', line 51 def boot template 'templates/config/boot.rb.tt', target('config/boot.rb'), opts end |
#bundle_install ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/nrb/commands/script.rb', line 74 def bundle_install return unless [:bundle_install] inside target, opts do Bundler.with_clean_env do Nrb.silently verbose: [:verbose] do run 'bundle install' end end end end |
#config_nrb ⇒ Object
40 41 42 43 |
# File 'lib/nrb/commands/script.rb', line 40 def config_nrb template 'templates/config/nrb.rb.tt', target('config/nrb.rb'), opts.merge({ resources: Nrb.config.resources }) end |
#db_config ⇒ Object
55 56 57 58 |
# File 'lib/nrb/commands/script.rb', line 55 def db_config template 'templates/db/config.yml.tt', target('db/config.yml'), opts.merge({ db: name }) end |
#gemfile ⇒ Object
31 32 33 34 |
# File 'lib/nrb/commands/script.rb', line 31 def gemfile template 'templates/Gemfile.tt', target('Gemfile'), opts.merge({ nrb_gem: nrb_gem }) end |
#gitignore ⇒ Object
22 23 24 |
# File 'lib/nrb/commands/script.rb', line 22 def gitignore template 'templates/.gitignore.tt', target('.gitignore'), opts end |
#initialize_repo ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/nrb/commands/script.rb', line 64 def initialize_repo return unless [:init_repo] inside target, opts do Nrb.silently verbose: [:verbose] do run 'git init' end end end |
#rakefile ⇒ Object
36 37 38 |
# File 'lib/nrb/commands/script.rb', line 36 def rakefile template 'templates/Rakefile.tt', target('Rakefile'), opts end |
#readme ⇒ Object
26 27 28 29 |
# File 'lib/nrb/commands/script.rb', line 26 def readme template 'templates/README.md.tt', target('README.md'), opts.merge({ title: name, version: Nrb::VERSION }) end |
#resources ⇒ Object
45 46 47 48 49 |
# File 'lib/nrb/commands/script.rb', line 45 def resources Nrb.config.resources.each do |dir| create_file target("#{dir}/.keep"), opts end end |
#script_file ⇒ Object
60 61 62 |
# File 'lib/nrb/commands/script.rb', line 60 def script_file template 'templates/script.rb.tt', "#{target(name)}.rb", opts end |