Skip to content

Commit

Permalink
Added/fixed some RDoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Aug 29, 2008
1 parent 3f17498 commit e3c0844
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README
Expand Up @@ -37,13 +37,13 @@ The question that should be on your lips is what I need to have namespaced confi

configatron do |config|
config.website_url = "http://www.mackframework.com"
config.email do |email|
email.pop do |pop|
config.namespace(:email) do |email|
email.namespace(:pop) do |pop|
pop.address = "pop.example.com"
pop.port = "110"
# etc ...
end
email.smtp do |smtp|
email.namespace(:smtp) do |smtp|
smtp.address = "smtp.example.com"
smtp.port = "25"
# etc ...
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -13,7 +13,7 @@ require 'pathname'

@gem_spec = Gem::Specification.new do |s|
s.name = "configatron"
s.version = "1.0.0"
s.version = "1.0.1"
s.summary = "A powerful Ruby configuration system."
s.description = "Configatron was developed by: markbates"
s.author = "markbates"
Expand Down
2 changes: 1 addition & 1 deletion lib/configuration.rb
Expand Up @@ -68,7 +68,7 @@ def revert(step = 1)
reload
end

def method_missing(sym, *args)
def method_missing(sym, *args) # :nodoc:
handle_missing_parameter(sym)
end

Expand Down
6 changes: 5 additions & 1 deletion lib/helpers.rb
@@ -1,18 +1,22 @@
module Configatron
module Helpers

# Checks whether or not configuration parameter exists.
def exists?(name)
self.respond_to?(name)
end

def handle_missing_parameter(param)
def handle_missing_parameter(param) # :nodoc:
if configatron.nil_for_missing
return nil
else
raise NoMethodError.new(param.to_s)
end
end

# Retrieves the specified config parameter. An optional second
# parameter can be passed that will be returned if the config
# parameter doesn't exist.
def retrieve(name, default_value = ArgumentError)
return self.send(name) if exists?(name)
return default_value unless default_value == ArgumentError
Expand Down
1 change: 1 addition & 0 deletions lib/store.rb
Expand Up @@ -26,6 +26,7 @@ def method_missing(sym, *args)
end
end

# Checks whether or not configuration parameter exists.
def exists?(name)
return true unless @parameters[name.to_sym].nil?
super(name)
Expand Down

0 comments on commit e3c0844

Please sign in to comment.