123456789_123456789_123456789_123456789_123456789_

Class: Rspec::Generators::Base Private

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Rspec::Generators::ChannelGenerator, Rspec::Generators::ControllerGenerator, Rspec::Generators::FeatureGenerator, Rspec::Generators::GeneratorGenerator, Rspec::Generators::HelperGenerator, Rspec::Generators::IntegrationGenerator, Rspec::Generators::JobGenerator, Rspec::Generators::MailboxGenerator, Rspec::Generators::MailerGenerator, Rspec::Generators::ModelGenerator, Rspec::Generators::RequestGenerator, Rspec::Generators::ScaffoldGenerator, Rspec::Generators::SystemGenerator, Rspec::Generators::ViewGenerator
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Rails::Generators::NamedBase
Instance Chain:
self, ::RSpec::Rails::FeatureCheck, Rails::Generators::NamedBase
Inherits: Rails::Generators::NamedBase
  • Object
Defined in: rspec-rails/lib/generators/rspec.rb

Class Method Summary

Instance Method Summary

Class Method Details

.configuration

Load configuration from ::RSpec to ensure ‘–default-path` is set

[ GitHub ]

  
# File 'rspec-rails/lib/generators/rspec.rb', line 25

def self.configuration
  @configuration ||=
    begin
      configuration = RSpec.configuration
      options = RSpec::Core::ConfigurationOptions.new({})
      options.configure(configuration)
      configuration
    end
end

.source_root(path = nil)

[ GitHub ]

  
# File 'rspec-rails/lib/generators/rspec.rb', line 15

def self.source_root(path = nil)
  if path
    @_rspec_source_root = path
  else
    @_rspec_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'rspec', generator_name, 'templates'))
  end
end

Instance Method Details

#target_path(*paths)

[ GitHub ]

  
# File 'rspec-rails/lib/generators/rspec.rb', line 35

def target_path(*paths)
  File.join(self.class.configuration.default_path, *paths)
end