configa 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/configa.rb CHANGED
@@ -99,7 +99,11 @@ module Configa
99
99
  data[k]
100
100
  end
101
101
  if hash
102
- Hash[ [res].flatten.map{ |r| [args.shift, r]} ]
102
+ if args.any?
103
+ Hash[ [res].flatten.map{ |r| [args.shift, r]} ]
104
+ else
105
+ res
106
+ end
103
107
  else
104
108
  res
105
109
  end
@@ -1,3 +1,3 @@
1
1
  module Configa
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -102,6 +102,7 @@ describe Configa do
102
102
  path = File.expand_path("../../config.yml", __FILE__)
103
103
  @config = Configa.new(path)
104
104
  @config.production.mysql(:username, :database, hash: true).must_equal({ username: "admin", database: "mysql_prod" })
105
+ @config.production.mysql(hash: true).must_equal({"adapter"=>"mysql", "encoding"=>"utf8", "host"=>"localhost", "username"=>"admin", "database"=>"mysql_prod", "password"=>"strongone"})
105
106
  end
106
107
  end
107
108
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-28 00:00:00.000000000 Z
12
+ date: 2013-01-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: YAML configuration file parser
15
15
  email: