Class: Gitnesse::Config
- Inherits:
-
Object
- Object
- Gitnesse::Config
- Includes:
- Singleton
- Defined in:
- lib/gitnesse/config.rb
Defined Under Namespace
Classes: ConfigStruct
Constant Summary collapse
- @@config =
Config Options:
repository_url - URl to remote git-based wiki. features_dir - directory for local features. Defaults to “features” branch - git branch of remote git-based wiki to use. Defaults to
'master'
annotate_results - boolean, determines if Gitnesse will annotate cucumber
results to wiki pages. Defaults to false
identifier - if annotate_results is checked, an identifier to use
to indicate who ran the cukes. e.g. "Uncle Bob's MacBook Air"
ConfigStruct.new
Class Method Summary collapse
-
.config {|@@config| ... } ⇒ Object
Allows external configuration of the ConfigStruct using a block.
Instance Method Summary collapse
-
#method_missing(method, *args, &block) ⇒ Object
Method_missing used to make it easier to access ConfigStruct values.
-
#to_h ⇒ Object
Converts the current configuration option to a hash.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/gitnesse/config.rb', line 60 def method_missing(method, *args, &block) if @@config.respond_to?(method) @@config.send(method, *args, &block) else raise NoMethodError end end |
Class Method Details
.config {|@@config| ... } ⇒ Object
43 44 45 46 |
# File 'lib/gitnesse/config.rb', line 43 def self.config yield @@config if block_given? Hash[@@config.each_pair.to_a] end |
Instance Method Details
#to_h ⇒ Object
Converts the current configuration option to a hash
Returns a hash
51 52 53 |
# File 'lib/gitnesse/config.rb', line 51 def to_h Hash[@@config.each_pair.to_a] end |