mooconfig 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,26 +2,31 @@
2
2
  Doing configuration with MongoDB
3
3
 
4
4
  - - -
5
+ #Install gem?
6
+ gem install mooconfig
7
+
5
8
  #The how?
6
9
 
7
10
  ##Preliminaries
8
- >MongoDB (http://www.mongodb.org/)
9
- >See Gemfile for dependancies
11
+ MongoDB (http://www.mongodb.org/)
12
+ See Gemfile for dependancies
10
13
 
11
14
  ##Usage
12
- >host = 'localhost'; port = 21017; db='foo'
15
+ host = 'localhost'; port = 21017; db='foo'
13
16
 
14
17
  ###Init
15
- >mconf = MooConfig::Config.new( host, port, db )
18
+ mconf = MooConfig::Config.new( host, port, db )
16
19
  ###Set configuration
17
- >mconf.set!( { "a" => true, "b" => { "b1" => "1", "b2" => 1234, "b3" => [ "z", 3, "e" ] }, "c" => "asdf" } ) # default config
18
- >mconf.set!( { "a" => false, "b" => { "b1" => "1", "b2" => 1234, "b3" => [ "z", 3, "e" ] }, "c" => "asdf" }, "production" )
20
+ mconf.set!( { "a" => true, "b" => { "b1" => "1", "b2" => 1234, "b3" => [ "z", 3, "e" ] }, "c" => "asdf" } ) # default config
21
+
22
+ mconf.set!( { "a" => false, "b" => { "b1" => "1", "b2" => 1234, "b3" => [ "z", 3, "e" ] }, "c" => "asdf" }, "production" )
23
+
19
24
  ###Get configuration
20
- >puts "production configuration: #{mconf.get( "production" )['a']} \n default configuration: #{mconf.get['a']}"
25
+ puts "production configuration: #{mconf.get( "production" )['a']} \n default configuration: #{mconf.get['a']}"
21
26
 
22
27
  ##Test
23
- > via guard and guardminitest
24
- > see test folder
28
+ via guard and guardminitest
29
+ see test folder
25
30
 
26
31
  #License
27
32
  ##The MIT License
@@ -1,3 +1,3 @@
1
1
  module MooConfig
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/mooconfig.rb CHANGED
@@ -4,8 +4,8 @@ module MooConfig
4
4
 
5
5
  class Config
6
6
  DEFAULT_CONFIG_ID = 'default'
7
- def initialize( host, port, db )
8
- @cCollection = Mongo::Connection.new( host, port ).db( db ).collection( 'config' )
7
+ def initialize( host, port, db, conf_collection='config' )
8
+ @cCollection = Mongo::Connection.new( host, port ).db( db ).collection( conf_collection )
9
9
  rescue => err
10
10
  puts "Config::initialize something is wrong with mongo details [host:#{host}, port:#{port}, db:#{db}]"
11
11
  raise err
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mooconfig
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - ronbee
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-11 00:00:00 Z
13
+ date: 2011-07-29 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: Keeping and managing configuration via MongoDB. Light implementation.
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  requirements: []
55
55
 
56
56
  rubyforge_project: mooconfig
57
- rubygems_version: 1.8.5
57
+ rubygems_version: 1.8.6
58
58
  signing_key:
59
59
  specification_version: 3
60
60
  summary: Doing config with mongodb