configru 3.2.0 → 3.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0e43a0f04efab82159aa7a8bfce6965514e297f
4
- data.tar.gz: 2c3ca705fca4c7ebe13dc08517c6d163ec8a30e5
3
+ metadata.gz: ae318028efd8fe15be837da4b7d380b37b56f45f
4
+ data.tar.gz: 999d480761041c6f44a84e9439e64ee787824fed
5
5
  SHA512:
6
- metadata.gz: 6ff4b868839bc60a86e4841873ff3f456e5f8db673982053ba217aa4f79712713d630fce62a7413b4a40a3dda95e3dc2a3c17ffb458d3bee9bd81c0bea5181af
7
- data.tar.gz: e20b5336317db72005c6e15b34fe8f4bdf76ca488c522ff35ce0c40f5867ed2926e3e142bf37635fd0ac8d8b9fbeaa7230fe4aa5935ee5aa0a51ce35281d6ce9
6
+ metadata.gz: b37ecee87d6bb651b311c32c615a7f7c3ba33677dc8290c846884282d6e08402e2b24ed5bc24f25fca440e568ecf9b4d24a15244917d22f15ec1786c28df1a99
7
+ data.tar.gz: c7fe3787326ad36674a8db13af1f0b7739ee94175285a809884a17baef3e7613d2fa35726b2b887b0115ce1fe8192bbf2b887e4bb5c87952aa896a6266ceb3ff
data/ChangeLog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.3.0 (24 September 2013)
4
+
5
+ * Added boolean options
6
+
3
7
  ## 3.2.0 (25 May 2013)
4
8
 
5
9
  * Validate values against arrays using `include?`
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
- gem "rake", "~> 10.0.0"
5
- gem "rspec", "~> 2.12.0"
4
+ gem "rake", "~> 10.1.0"
5
+ gem "rspec", "~> 2.14.0"
6
6
  gem "simplecov", "~> 0.7.0"
7
7
  end
8
8
 
data/Gemfile.lock CHANGED
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- configru (3.2.0)
4
+ configru (3.3.0)
5
5
 
6
6
  GEM
7
- remote: http://rubygems.org/
7
+ remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.1.3)
9
+ diff-lcs (1.2.4)
10
10
  multi_json (1.3.6)
11
- rake (10.0.2)
12
- rspec (2.12.0)
13
- rspec-core (~> 2.12.0)
14
- rspec-expectations (~> 2.12.0)
15
- rspec-mocks (~> 2.12.0)
16
- rspec-core (2.12.0)
17
- rspec-expectations (2.12.0)
18
- diff-lcs (~> 1.1.3)
19
- rspec-mocks (2.12.0)
11
+ rake (10.1.0)
12
+ rspec (2.14.1)
13
+ rspec-core (~> 2.14.0)
14
+ rspec-expectations (~> 2.14.0)
15
+ rspec-mocks (~> 2.14.0)
16
+ rspec-core (2.14.5)
17
+ rspec-expectations (2.14.3)
18
+ diff-lcs (>= 1.1.3, < 2.0)
19
+ rspec-mocks (2.14.3)
20
20
  simplecov (0.7.1)
21
21
  multi_json (~> 1.0)
22
22
  simplecov-html (~> 0.7.1)
@@ -27,6 +27,6 @@ PLATFORMS
27
27
 
28
28
  DEPENDENCIES
29
29
  configru!
30
- rake (~> 10.0.0)
31
- rspec (~> 2.12.0)
30
+ rake (~> 10.1.0)
31
+ rspec (~> 2.14.0)
32
32
  simplecov (~> 0.7.0)
data/README.md CHANGED
@@ -6,7 +6,7 @@ YAML configuration file loader
6
6
 
7
7
  ```ruby
8
8
  # Gemfile
9
- gem "configru", "~> 3.1.0"
9
+ gem "configru", "~> 3.3.0"
10
10
  ```
11
11
  ### Example
12
12
 
@@ -25,12 +25,13 @@ Configru.load('config.yml') do
25
25
  validate {|x| File.directory?(x) }
26
26
  end
27
27
  option_array :channels, String, ['foo', 'bar']
28
+ option_bool :force, false
28
29
  end
29
30
 
30
31
  example = Example.new(Configru.connection.server, Configru.connection.port)
31
32
  example.login(Configru.username, Configru.token)
32
33
  Configru.channels.each do |x|
33
- example.sync(x, Configru.path)
34
+ example.sync(x, Configru.path, :force => Configru.force)
34
35
  end
35
36
  ```
36
37
 
@@ -45,11 +46,12 @@ path: ~
45
46
  channels:
46
47
  - foo
47
48
  - bar
49
+ force: false
48
50
  ```
49
51
 
50
52
  # License
51
53
 
52
- Copyright (c) 2011-2012, Curtis McEnroe <programble@gmail.com>
54
+ Copyright © 2011-2013, Curtis McEnroe <programble@gmail.com>
53
55
 
54
56
  Permission to use, copy, modify, and/or distribute this software for any
55
57
  purpose with or without fee is hereby granted, provided that the above
data/lib/configru/dsl.rb CHANGED
@@ -16,6 +16,10 @@ module Configru
16
16
  @options[name.to_s] = option
17
17
  end
18
18
 
19
+ def option_bool(name, default, &block)
20
+ option(name, Object, default, [true, false], &block)
21
+ end
22
+
19
23
  def option_required(name, type = Object, validation = nil, &block)
20
24
  option = Configru::RequiredOption.new(type, validation, nil)
21
25
  RequiredOption.new(option, &block) if block
@@ -1,3 +1,3 @@
1
1
  module Configru
2
- VERSION = "3.2.0"
2
+ VERSION = "3.3.0"
3
3
  end
data/spec/dsl_spec.rb CHANGED
@@ -78,6 +78,19 @@ describe Configru::DSL::OptionGroup do
78
78
  group.options.should have_key('example')
79
79
  end
80
80
 
81
+ it 'creates a boolean option' do
82
+ group = described_class.new do
83
+ option_bool 'example', true
84
+ end
85
+
86
+ group.options.should have_key('example')
87
+ group.options['example'].should be_a(Configru::Option)
88
+ group.options['example'].type.should == Object
89
+ group.options['example'].default.should == true
90
+ group.options['example'].validation.should == [true, false]
91
+ group.options['example'].transformation.should be_nil
92
+ end
93
+
81
94
  it 'creates a required option' do
82
95
  group = described_class.new do
83
96
  option_required 'example'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configru
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Curtis McEnroe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-26 00:00:00.000000000 Z
11
+ date: 2013-09-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: YAML configuration file loader
14
14
  email:
@@ -63,21 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  requirements: []
65
65
  rubyforge_project:
66
- rubygems_version: 2.0.0
66
+ rubygems_version: 2.0.2
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: YAML configuration file loader
70
- test_files:
71
- - spec/configru_spec.rb
72
- - spec/dsl_spec.rb
73
- - spec/example_files/example_a.yml
74
- - spec/example_files/example_b.yml
75
- - spec/example_files/example_c.yml
76
- - spec/example_files/example_d.yml
77
- - spec/example_files/example_e.yml
78
- - spec/example_files/example_f.yml
79
- - spec/example_files/example_g.yml
80
- - spec/example_files/example_h.yml
81
- - spec/example_files/example_i.yml
82
- - spec/spec_helper.rb
83
- - spec/structhash_spec.rb
70
+ test_files: []