nifty_settings 1.1.3 → 1.1.4

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: 027269b16af0f027d079732f8d1c367e4b9b6290
4
- data.tar.gz: 086be73a4982fc80b6b62d4d5e65303a86458e2a
3
+ metadata.gz: 4769207c5a5afe5bcba387f6858936a134d2b1d9
4
+ data.tar.gz: cb1571fb5dc785f311787cd16f4d3a846a69755e
5
5
  SHA512:
6
- metadata.gz: 97bf3f6f449614dc71b5986d89b3271ae89484e0839206f875aa2ea3e91750780e20c06b7d59a05854429fe8ba23ec4d19c405c3bd8806b1530961f9a71d3481
7
- data.tar.gz: 5e6e851acd5d6cbf49695ea9da486023d2ee410d34288b6c715ef9ed7a4918c5b0f57042dab0671bf6d0a682b86ba9bfe9cea031adb9a23d33e37cb73bd28400
6
+ metadata.gz: 882d6a1b7ffbc6fbe4755d03ede06d3764b1b7dd96ece26094e79f42366094b2b43913281b97f61de2d54cd5bca5761229a39b1c8cf2a81346f6e41fff0d6745
7
+ data.tar.gz: a39a48c1284ffd85aecdeb1d94fed0d38b0570e3f50ec596e41b86efe565cdc3c147ebb7c0ec0f3da1561cba60163f4cc21240e5cced056b1b864b68f729e663
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
- - 1.9.3
5
- - 2.0.0
6
- - 2.1.0
3
+ - 1.9
4
+ - 2.0
5
+ - 2.1
7
6
  - jruby
@@ -58,7 +58,7 @@ module NiftySettings
58
58
  key, modifier = name[0..-2], name[-1, 1]
59
59
  case modifier
60
60
  when '?'
61
- has?(key)
61
+ has?(name) ? self[name] : has?(key)
62
62
  when '='
63
63
  send(:[]=, key, *args)
64
64
  else
@@ -1,3 +1,3 @@
1
1
  module NiftySettings
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4'
3
3
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.name = 'nifty_settings'
8
8
  gem.version = NiftySettings::VERSION
9
9
  gem.platform = Gem::Platform::RUBY
10
- gem.authors = ['Manuel Meurer']
10
+ gem.author = 'Manuel Meurer'
11
11
  gem.email = 'manuel@krautcomputing.com'
12
12
  gem.summary = 'Settings'
13
13
  gem.description = 'Settings'
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe NiftySettings::Settings do
4
4
  let(:nested_settings_hash) { { pelle: 'fant', shnoo: 'shnaa' } }
5
- let(:settings_hash) { { foo: 'bar', nested: nested_settings_hash } }
5
+ let(:settings_hash) { { foo: 'bar', nested: nested_settings_hash, really?: true, not_really?: false, nothing?: nil } }
6
6
  let(:settings) { NiftySettings::Settings.new(settings_hash) }
7
7
  let(:empty_settings) { NiftySettings::Settings.new }
8
8
 
@@ -61,6 +61,20 @@ describe NiftySettings::Settings do
61
61
  end
62
62
  end
63
63
 
64
+ context 'when the settings has key ending with ?' do
65
+ it 'returns true' do
66
+ expect(settings.really?).to eq(true)
67
+ end
68
+
69
+ it 'returns false' do
70
+ expect(settings.not_really?).to eq(false)
71
+ end
72
+
73
+ it 'returns nil' do
74
+ expect(settings.nothing?).to be_nil
75
+ end
76
+ end
77
+
64
78
  context 'when the setting has nested values' do
65
79
  it 'returns true' do
66
80
  expect(settings.nested?).to eq(true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nifty_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Meurer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-21 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake