Class: Spiker::Generators::Simple
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Spiker::Generators::Simple
- Includes:
- Thor::Actions
- Defined in:
- lib/spiker/generators/simple.rb
Overview
Generates a single spike file, with supporting infrastructure. For simpler spikes that don’t need a ton of organization.
Class Method Summary collapse
Instance Method Summary collapse
- #create_env_file ⇒ Object
- #create_gem_file ⇒ Object
- #create_guard_file ⇒ Object
- #create_spike_directory ⇒ Object
- #create_spike_file ⇒ Object
- #run_bundler ⇒ Object
Class Method Details
.source_root ⇒ Object
15 16 17 |
# File 'lib/spiker/generators/simple.rb', line 15 def self.source_root "#{File.dirname(__FILE__)}/templates/simple" end |
Instance Method Details
#create_env_file ⇒ Object
36 37 38 |
# File 'lib/spiker/generators/simple.rb', line 36 def create_env_file template("../common/basic.env", "#{name}/.env") end |
#create_gem_file ⇒ Object
32 33 34 |
# File 'lib/spiker/generators/simple.rb', line 32 def create_gem_file template("gemfile.rb", "#{name}/Gemfile") end |
#create_guard_file ⇒ Object
28 29 30 |
# File 'lib/spiker/generators/simple.rb', line 28 def create_guard_file template("guardfile.rb", "#{name}/Guardfile") end |
#create_spike_directory ⇒ Object
19 20 21 |
# File 'lib/spiker/generators/simple.rb', line 19 def create_spike_directory empty_directory(name) end |
#create_spike_file ⇒ Object
23 24 25 26 |
# File 'lib/spiker/generators/simple.rb', line 23 def create_spike_file opts = { name_as_class: Spiker.classify(name) } template("app.rb.erb", "#{name}/app.rb", opts) end |
#run_bundler ⇒ Object
40 41 42 43 44 |
# File 'lib/spiker/generators/simple.rb', line 40 def run_bundler inside(name) do run("bundle install") end end |