Class: CreateRubyApp::Actions::GenerateFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/create_ruby_app/actions/generate_files.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#callObject



17
18
19
# File 'lib/create_ruby_app/actions/generate_files.rb', line 17

def call
  generate_files
end

#gemfileObject



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_fileObject



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_fileObject



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_fileObject



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_fileObject



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