iron-settings 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- == 1.0.0 / 2013-09-XX
1
+ == 1.0.1 / 2013-09-09
2
+
3
+ * Clarify that <owner>.group.entry? returns true if any non-nil value is present, default or explicitly set
4
+
5
+ == 1.0.0 / 2013-09-05
2
6
 
3
7
  * Initial revision
4
8
  * Working class and instance level settings definition
data/README.rdoc CHANGED
@@ -76,8 +76,8 @@ configuration info.
76
76
 
77
77
  def initialize
78
78
  # The bound file will be loaded automatically if present on first access.
79
- # Verify we have what we need - interrogative version of keys tests for the
80
- # presence of a non-default value.
79
+ # Verify we have what we need - interrogative version of keys test for the
80
+ # presence of a non-nil value.
81
81
  unless MyTool.settings.api_key?
82
82
  raise "You must define your API key in your ~/.mytool settings file!"
83
83
  end
@@ -104,6 +104,10 @@ on loading prior values.
104
104
  In addition, they are not intended for storing hundreds of thousands of values! Like any key/value
105
105
  store, they are a tool suited for certain tasks.
106
106
 
107
+ Settings files are full Ruby files, and evaluated during settings load. This means they must be
108
+ carefully managed to avoid the potential for security issues. By default, settings files must
109
+ be owned by the user running the current process, and they must NOT be world-writable.
110
+
107
111
  == REQUIREMENTS
108
112
 
109
113
  Depends on the iron-extensions gem, and optionally requires ActiveRecord to support db-backed
data/Version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -108,8 +108,8 @@ class Settings
108
108
 
109
109
  elsif item.entry?
110
110
  if query
111
- # Return true if the given item has a (non-default) value
112
- return item_has_value?(item)
111
+ # Return true if the given item has a non-nil value
112
+ return !item_value(item).nil?
113
113
  else
114
114
  if args.empty?
115
115
  # No args means return the current value (or default if none)
@@ -28,6 +28,7 @@ describe Settings::Cursor do
28
28
  end
29
29
 
30
30
  it 'should test for value presence using interogator' do
31
+ CursorTest.settings.val1?.should be_true
31
32
  CursorTest.settings.val2?.should be_false
32
33
  CursorTest.settings.val2 100
33
34
  CursorTest.settings.val2?.should be_true
@@ -84,9 +85,7 @@ describe Settings::Cursor do
84
85
  end
85
86
 
86
87
  it 'should return keys relative to its bound group' do
87
- CursorTest.settings.top.middle.entry_keys.should match_array([
88
- 'bottom.leaf', 'bottom.lamby'
89
- ])
88
+ CursorTest.settings.top.middle.entry_keys.should match_array(['bottom.leaf', 'bottom.lamby'])
90
89
  end
91
90
 
92
91
  it 'should eval lambda defaults in the context of the root cursor' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
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: 2013-09-05 00:00:00.000000000 Z
12
+ date: 2013-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron-extensions