kb-config 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # Usage
2
2
 
3
- #### Open command prompt
3
+ ## Open command prompt
4
4
 
5
5
  $> gem install kb-config
6
6
  $> irb
7
7
 
8
- #### From irb
8
+ ## From irb
9
9
 
10
10
  $> require 'config'
11
11
  $> CONFIG = Config::Base.load_config(<path to settings file>, <array of overrides>)
12
12
 
13
- ##### Example calls and expected results
13
+ ## Example calls and expected results
14
14
 
15
15
  $> CONFIG.common.paid_users_size_limit
16
16
  # returns 2147483648
17
17
 
18
18
  $> CONFIG.ftp.name
19
- # returns hello there, ftp uploading
19
+ # returns "hello there, ftp uploading"
20
20
 
21
21
  $> CONFIG.http.params
22
- # returns [array”, of”, values]
22
+ # returns ["array", "of", "values"]
23
23
 
24
24
  $> CONFIG.ftp.lastname
25
25
  # returns nil
@@ -28,7 +28,7 @@
28
28
  # returns false
29
29
 
30
30
  $> CONFIG.ftp[:path]
31
- # returns “/etc/var/uploads
31
+ # returns "/etc/var/uploads"
32
32
 
33
33
  $> CONFIG.ftp
34
- # returns {:name => “http uploading”, :path => “/etc/var/uploads”, :enabled => false}
34
+ # returns {:name => "hello there, ftp uploading", :path => "/etc/var/uploads", :enabled => false}
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'rake/testtask'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new('spec')
5
+
6
+ desc "Run tests"
7
+ task :default => :spec
@@ -1,3 +1,3 @@
1
1
  module Config
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/settings.conf CHANGED
@@ -18,4 +18,4 @@ name = "http uploading"
18
18
  path = /tmp/
19
19
  path<production> = /srv/var/tmp/
20
20
  path<staging> = /srv/uploads/; This is another comment
21
- params = array,of,value
21
+ params = array,of,values
data/spec/.gitkeep ADDED
File without changes
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe Config do
4
+ before :all do
5
+ CONFIG = Config::Base.load_config(File.join(File.dirname(__FILE__), '../', 'settings.conf'), ["ubuntu", :production])
6
+ end
7
+
8
+ it 'should return "2147483648" for "CONFIG.common.paid_users_size_limit"' do
9
+ CONFIG.common.paid_users_size_limit.should == "2147483648"
10
+ end
11
+
12
+ it 'should return "hello there, ftp uploading" for "CONFIG.ftp.name"' do
13
+ CONFIG.ftp.name.should == "hello there, ftp uploading"
14
+ end
15
+
16
+ it 'should return ["array", "of", "values"] for "CONFIG.http.params"' do
17
+ CONFIG.http.params.should == ["array", "of", "values"]
18
+ end
19
+
20
+ it 'should return "nil" for "CONFIG.ftp.lastname"' do
21
+ CONFIG.ftp.lastname.should == nil
22
+ end
23
+
24
+ it 'should return "nil (nil == false)" for "CONFIG.ftp.enabled"' do
25
+ CONFIG.ftp.enabled.should == nil
26
+ end
27
+
28
+ it 'should return "/etc/var/uploads" for "CONFIG.ftp[:path]"' do
29
+ CONFIG.ftp[:path].should == "/etc/var/uploads"
30
+ end
31
+
32
+ it 'should return "{:name => "hello there, ftp uploading", :path => "/etc/var/uploads", :enabled => false}" for "CONFIG.ftp"' do
33
+ CONFIG.ftp.should == { :name => "hello there, ftp uploading", :path => "/etc/var/uploads", :enabled => false }
34
+ end
35
+ end
@@ -0,0 +1,7 @@
1
+ require 'rspec'
2
+ require 'config'
3
+
4
+ RSpec.configure do |c|
5
+ c.color_enabled = true
6
+ c.formatter = 'documentation'
7
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kb-config
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.0.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kyle Bolton
@@ -25,6 +25,7 @@ extra_rdoc_files: []
25
25
 
26
26
  files:
27
27
  - README.md
28
+ - Rakefile
28
29
  - config.gemspec
29
30
  - lib/config.rb
30
31
  - lib/config/base.rb
@@ -33,6 +34,9 @@ files:
33
34
  - lib/config/parser.rb
34
35
  - lib/config/version.rb
35
36
  - settings.conf
37
+ - spec/.gitkeep
38
+ - spec/config_spec.rb
39
+ - spec/spec_helper.rb
36
40
  has_rdoc: true
37
41
  homepage: http://github.com/kb/config
38
42
  licenses: []
@@ -61,5 +65,6 @@ rubygems_version: 1.6.2
61
65
  signing_key:
62
66
  specification_version: 3
63
67
  summary: Library to hold configuration items for your application
64
- test_files: []
65
-
68
+ test_files:
69
+ - spec/config_spec.rb
70
+ - spec/spec_helper.rb