Class: RSpec::Core::ProjectInitializer
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb
Overview
Generates conventional files for an RSpec project.
Constant Summary collapse
- DOT_RSPEC_FILE =
'.rspec'
- SPEC_HELPER_FILE =
'spec/spec_helper.rb'
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#template_path ⇒ Object
readonly
Returns the value of attribute template_path.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ ProjectInitializer
constructor
A new instance of ProjectInitializer.
- #run ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ ProjectInitializer
Returns a new instance of ProjectInitializer.
13 14 15 16 17 18 19 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb', line 13 def initialize(opts={}) @destination = opts.fetch(:destination, Dir.getwd) @stream = opts.fetch(:report_stream, $stdout) @template_path = opts.fetch(:template_path) do File.("../project_initializer", __FILE__) end end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
8 9 10 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb', line 8 def destination @destination end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
8 9 10 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb', line 8 def stream @stream end |
#template_path ⇒ Object (readonly)
Returns the value of attribute template_path.
8 9 10 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb', line 8 def template_path @template_path end |
Instance Method Details
#run ⇒ Object
21 22 23 24 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb', line 21 def run copy_template DOT_RSPEC_FILE copy_template SPEC_HELPER_FILE end |