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 +5 -1
- data/README.rdoc +6 -2
- data/Version.txt +1 -1
- data/lib/iron/settings/cursor.rb +2 -2
- data/spec/settings/cursor_spec.rb +2 -3
- metadata +2 -2
data/History.txt
CHANGED
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
|
80
|
-
# presence of a non-
|
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.
|
1
|
+
1.0.1
|
data/lib/iron/settings/cursor.rb
CHANGED
@@ -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
|
112
|
-
return
|
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.
|
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-
|
12
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: iron-extensions
|