citrusbyte-settings 0.0.1 → 0.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/README.markdown CHANGED
@@ -13,7 +13,7 @@ New instances of `SettingsHash` are readonly -- any attempt to write to the
13
13
  Hash after initialization will fail with a `TypeError`.
14
14
 
15
15
  Any attempt to read a key which is not set will raise a
16
- `SettingsHash::SettingMissing` error.
16
+ `SettingsHash::SettingNotFound` error.
17
17
 
18
18
  `SettingsHash` supports an optional namespace which can be used to define
19
19
  multiple groups of settings within a single .yml file. For example, "test" and
data/lib/settings_hash.rb CHANGED
@@ -2,7 +2,7 @@ require 'readonly_hash'
2
2
  require 'yaml'
3
3
 
4
4
  class SettingsHash < ReadonlyHash
5
- class SettingMissing < StandardError;end;
5
+ class SettingNotFound < StandardError;end;
6
6
 
7
7
  def initialize(path, namespace=nil)
8
8
  raise "No settings file found: #{path}" unless File.exists?(path)
@@ -17,7 +17,7 @@ class SettingsHash < ReadonlyHash
17
17
  end
18
18
 
19
19
  def [](key)
20
- raise SettingMissing.new("No setting found for #{key}") unless has_key?(key)
20
+ raise SettingNotFound.new("No setting found for #{key}") unless has_key?(key)
21
21
  super
22
22
  end
23
23
  end
@@ -31,7 +31,7 @@ class SettingsTest < Test::Unit::TestCase
31
31
  end
32
32
 
33
33
  test "should raise if key is not set" do
34
- assert_raise SettingsHash::SettingMissing do
34
+ assert_raise SettingsHash::SettingNotFound do
35
35
  @settings[:bar]
36
36
  end
37
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citrusbyte-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Alavi