Module: RSpec::Generator::Configure

Defined in:
lib/generator_spec/rspec_generator/configure.rb

Class Method Summary collapse

Class Method Details

.debug=(bool) ⇒ Object



15
16
17
# File 'lib/generator_spec/rspec_generator/configure.rb', line 15

def debug= bool
  RSpec::Generator.debug = bool
end

.default_rails_root(path, options = {}) ⇒ Object



19
20
21
# File 'lib/generator_spec/rspec_generator/configure.rb', line 19

def default_rails_root path, options = {} 
  configure_root_dir path, options
end

.lib=(path) ⇒ Object



27
28
29
# File 'lib/generator_spec/rspec_generator/configure.rb', line 27

def lib= path
  RSpec::Generator::Require.lib = path
end

.logger=(type) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/generator_spec/rspec_generator/configure.rb', line 31

def logger= type
  case type
  when Symbol          
    raise ArgumentError, "Unknown logger type #{type}" if ![:stdout, :file].include?(type)            
    RSpec::Generator.logger = type
  when Hash
    RSpec::Generator.logger = type
  else 
    raise ArgumentError, "Unknown logger type #{type.inspect}, must be set as Symbol :stdout, :file or Hash (for advanced configuration)"
  end        
end

.rails_root=(path, options = {}) ⇒ Object



23
24
25
# File 'lib/generator_spec/rspec_generator/configure.rb', line 23

def rails_root= path, options = {} 
  configure_root_dir path, :custom
end

.remove_temp_dir=(bool) ⇒ Object



11
12
13
# File 'lib/generator_spec/rspec_generator/configure.rb', line 11

def remove_temp_dir= bool
  RSpec::Generator.remove_temp_dir = bool
end