iron-settings 1.0.1 → 1.0.2
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/History.txt +4 -0
- data/Version.txt +1 -1
- data/lib/iron/settings/class_level.rb +1 -1
- data/lib/iron/settings/static_store.rb +4 -1
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/Version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -33,7 +33,7 @@ class Settings #:nodoc:
|
|
33
33
|
Settings::DbStore.new(@settings_class_root, @settings_class_options)
|
34
34
|
end
|
35
35
|
|
36
|
-
# Force a settings reload (from db or file(s) depending on settings)
|
36
|
+
# Force a settings reload (from db or file(s) depending on settings) regardless
|
37
37
|
# of need to reload automatically. Useful for testing, but not generally needed in production use
|
38
38
|
def reload_settings
|
39
39
|
@settings_values.load
|
@@ -43,7 +43,6 @@ class Settings
|
|
43
43
|
end
|
44
44
|
|
45
45
|
# Loads a single settings file, verifying its existence, ownership/security, etc.
|
46
|
-
#
|
47
46
|
def load_file(path)
|
48
47
|
# Ensure we have the file, if so required
|
49
48
|
raise RuntimeError.new("Missing settings file #{path} - this file is required") unless @ignore_missing || File.exists?(path)
|
@@ -75,6 +74,10 @@ class Settings
|
|
75
74
|
# Not requiring security? File doesn't exist? Then everything is fine...
|
76
75
|
return unless (File.exists?(path) && @secure)
|
77
76
|
|
77
|
+
# Root can read all files, useful for backups and of course no security lost
|
78
|
+
return if Process.uid == 0
|
79
|
+
|
80
|
+
# Check file ownership
|
78
81
|
stat = File::Stat.new(path)
|
79
82
|
raise RuntimeError.new("Cannot load settings file #{path} - file must be owned by the user this program is running as (UID #{Process.uid})") unless stat.owned?
|
80
83
|
raise RuntimeError.new("Cannot load settings file #{path} - file cannot be world-writable") if stat.world_writable?
|
data/spec/spec_helper.rb
CHANGED
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.2
|
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-
|
12
|
+
date: 2013-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: iron-extensions
|