cushion_defaults 0.0.2 → 0.0.3

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: 9a1104ccff1b2c54e13c350d175df3c351c85571
4
- data.tar.gz: 20fbda4deff85972a3d067e77609af2e649a4211
3
+ metadata.gz: 6be31769619d31078b95f3ce90c4dbe1e23948d0
4
+ data.tar.gz: 0f883a5d3b1721e29abc6588ee4fc5be86d9a7a2
5
5
  SHA512:
6
- metadata.gz: 1a76e6db1d44d2713889d3f7bfe17b5a9e49ec2964493d6dca4b9a5d76efbcb33005b29b95fc5344c19d683efe5d2b2b1a916e7d2f15115b208d282196f1b5fd
7
- data.tar.gz: e505feac28cf55c9b4716f35fa960c75a162fc804ca4057d1ec5959a0a4816f36e455e70f4dfdc80830a44557701c4a08456a6f80546383b7afbd012595b9c41
6
+ metadata.gz: f71ace7a7cd19e962f49333ad57192acf18fa82752e93bab345ce5f89321091e4df00cb8c7778d4da650b19632e238d57a2bd38364fe5acf299fbbee043ca92d
7
+ data.tar.gz: f65b07dfb5c5d58e8220c16c0d47fa1968b19269d9fdcf923d94ccc7f0d988afae8fe426452c2dd6132d4e7d8e3fe4516c8179f215a1b2bb2545682f8443b4f1
@@ -19,7 +19,7 @@ class Configuration # :nodoc:
19
19
  # +loaded_config+ :: hash from which options will be derived
20
20
  def from_hash(loaded_config)
21
21
  loaded_config.each do |key, val|
22
- instance_variable_set(key.to_sym, val) if instance_variable_defined? key.to_sym
22
+ instance_variable_set("@#{key.to_sym}", val) if instance_variable_defined? "@#{key.to_sym}"
23
23
  end
24
24
  end
25
25
 
@@ -10,15 +10,15 @@ require 'cushion_defaults/defaults_hash'
10
10
  # +Klass+.
11
11
  module CushionDefaults
12
12
 
13
- VERSION = '0.0.2'
13
+ VERSION = '0.0.3'
14
14
 
15
15
  # CONFIG
16
16
 
17
17
  # Location CushionDefaults looks for (optional) config file
18
- CONFIG_LOCATION = 'config/cushion_defaults.yaml'
19
-
20
18
  CALLING_PATH = File.expand_path(File.dirname($0)) + '/'
21
19
 
20
+ CONFIG_LOCATION = CALLING_PATH + 'config/cushion_defaults.yaml'
21
+
22
22
  # If set to true, will automatically look at +YAML_PATH+ for each class that includes +CushionDefaults+ to try to
23
23
  # load defaults from yaml file located at the result of +YAML_PROC+. By default, this would be 'config/klass.yaml'.
24
24
 
@@ -64,13 +64,13 @@ module CushionDefaults
64
64
 
65
65
  if File.exists?(CONFIG_LOCATION)
66
66
  t = File.open(CONFIG_LOCATION)
67
- elsif File.exists?(configuration.yaml_source_folder + 'cushion_defaults.yaml')
68
- t = File.open(configuration.yaml_source_folder + 'cushion_defaults.yaml')
67
+ elsif File.exists?(CALLING_PATH + configuration.yaml_source_folder + 'cushion_defaults.yaml')
68
+ t = File.open(CALLING_PATH + configuration.yaml_source_folder + 'cushion_defaults.yaml')
69
69
  else
70
70
  t = nil
71
71
  end
72
72
 
73
- config.from_hash(YAML::load(t)) if t
73
+ conf.from_hash(YAML::load(t)) if t
74
74
 
75
75
  # Add class methods and set up +DefaultsHash+ when the module is included in a class.
76
76
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cushion_defaults
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mitchell