Class: Museo::Configuration
- Inherits:
-
Object
- Object
- Museo::Configuration
- Defined in:
- lib/museo.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#generation_disabled ⇒ Object
Returns the value of attribute generation_disabled.
-
#rspec ⇒ Object
Returns the value of attribute rspec.
Instance Method Summary collapse
- #clear_stubs! ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #stub(name, value = nil) ⇒ Object
- #stubbed_methods ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
48 49 50 51 52 |
# File 'lib/museo.rb', line 48 def initialize @formatter = Museo::Formatter.new @rspec = File.directory?(Museo.rails_root.join("spec")) @generation_disabled = !!ENV["CI"] end |
Instance Attribute Details
#formatter ⇒ Object
Returns the value of attribute formatter.
44 45 46 |
# File 'lib/museo.rb', line 44 def formatter @formatter end |
#generation_disabled ⇒ Object
Returns the value of attribute generation_disabled.
46 47 48 |
# File 'lib/museo.rb', line 46 def generation_disabled @generation_disabled end |
#rspec ⇒ Object
Returns the value of attribute rspec.
45 46 47 |
# File 'lib/museo.rb', line 45 def rspec @rspec end |
Instance Method Details
#clear_stubs! ⇒ Object
64 65 66 |
# File 'lib/museo.rb', line 64 def clear_stubs! @stubbed_methods = {} end |
#stub(name, value = nil) ⇒ Object
58 59 60 61 62 |
# File 'lib/museo.rb', line 58 def stub(name, value = nil) value = block_given? ? Proc.new : value stubbed_methods[name] = value end |
#stubbed_methods ⇒ Object
54 55 56 |
# File 'lib/museo.rb', line 54 def stubbed_methods @stubbed_methods ||= {} end |