Class: CreateRubyApp::Actions::GenerateFiles
- Inherits:
-
Object
- Object
- CreateRubyApp::Actions::GenerateFiles
- Defined in:
- lib/create_ruby_app/actions/generate_files.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
- #gemfile ⇒ Object
-
#initialize(app) ⇒ GenerateFiles
constructor
A new instance of GenerateFiles.
- #lib_file ⇒ Object
- #ruby_version_file ⇒ Object
- #script_file ⇒ Object
- #spec_helper_file ⇒ Object
Constructor Details
#initialize(app) ⇒ GenerateFiles
Returns a new instance of GenerateFiles.
9 10 11 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 9 def initialize(app) @app = app end |
Class Method Details
.call(app) ⇒ Object
13 14 15 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 13 def self.call(app) new(app).call end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 17 def call generate_files end |
#gemfile ⇒ Object
40 41 42 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 40 def gemfile generate_file(file: "Gemfile.erb", locals: { gems: app.gems.sort }) end |
#lib_file ⇒ Object
25 26 27 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 25 def lib_file generate_file(file: "lib_file.erb", locals: { app: app.classify_name }) end |
#ruby_version_file ⇒ Object
33 34 35 36 37 38 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 33 def ruby_version_file generate_file( file: "ruby-version.erb", locals: { version: app.version } ) end |
#script_file ⇒ Object
21 22 23 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 21 def script_file generate_file(file: "script_file.erb", locals: {}) end |
#spec_helper_file ⇒ Object
29 30 31 |
# File 'lib/create_ruby_app/actions/generate_files.rb', line 29 def spec_helper_file generate_file(file: "spec_helper.erb", locals: { app: app.name }) end |