confoog 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86a1fc3255701acf14e97a271e943b09e52470fa
4
- data.tar.gz: 5447360f3f74e8ffbd85d7fe8d8aa5e680717e5e
3
+ metadata.gz: e4336bba436a680049e0f664d3160f0be3089664
4
+ data.tar.gz: 026279c492238be89eba517417e884e9dc992109
5
5
  SHA512:
6
- metadata.gz: 1215deb16939c2171a4081a667535cbe87b0bc26b54d1a9d399b265651ab36150d92e6e1c49aac3c83dd266657398170463148a25e3787e454ae1647cfe5bd01
7
- data.tar.gz: cc05a4f69c21098d16a2276a370192bb5ea572231eeb9dcb8512604fc9201ca8d17db4bce6fef8d3fe3f0c3962e6c77164836be20b4cc00f017e8f60faa93005
6
+ metadata.gz: d961c0d7fd8e277ff37a903d5cda39e229aa46bdaa2bb3eddb8f5dfee833c09a7aaf2001d2796fa070c9ed168bdc7df22824e4d1253fb1ab47f4f10afa7fd689
7
+ data.tar.gz: af619574ceedd1841ee0ce75665344ff959613068b6286ada339695d31df2562a67230700558bc472b80aec36cf6b67a88e006ce663742ac99184bfcca01ad2c
data/README.md CHANGED
@@ -79,6 +79,9 @@ prefix: 'My Application'
79
79
 
80
80
  # Should we avoid outputting errors to the console? (ie in a GUI app)
81
81
  quiet: true | false
82
+
83
+ # Should we automatically load the configuration file when the class is created?
84
+ auto_load: true | false
82
85
  ```
83
86
  If these are not specified, Confoog will use the following defaults :
84
87
 
@@ -88,6 +91,7 @@ filename: '.confoog'
88
91
  create_file: false
89
92
  prefix: 'Configuration'
90
93
  quiet: false
94
+ auto_load: false
91
95
  ```
92
96
 
93
97
  Confoog will set the following error constants which will be returned in the `.status['errors']` variable as needed :
@@ -2,5 +2,5 @@
2
2
  module Confoog
3
3
  # Version of this Gem, using Semantic Versioning 2.0.0
4
4
  # http://semver.org/
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
data/lib/confoog.rb CHANGED
@@ -46,7 +46,8 @@ module Confoog
46
46
  quiet: false,
47
47
  prefix: 'Configuration',
48
48
  location: '~/',
49
- filename: DEFAULT_CONFIG
49
+ filename: DEFAULT_CONFIG,
50
+ auto_load: false
50
51
  }
51
52
 
52
53
  # Provide an encapsulated class to access a YAML configuration file.
@@ -106,6 +107,9 @@ module Confoog
106
107
  status_set(errors: ERR_NO_ERROR)
107
108
  # make sure the file exists or can be created...
108
109
  check_exists(options)
110
+
111
+ # if auto_load is true, automatically load from file
112
+ load unless @options[:auto_load] == false
109
113
  end
110
114
 
111
115
  # Return the value of the 'quiet' option.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confoog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seapagan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-06 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler