figleaf 0.2.1 → 0.2.2

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: 9841086802b8e6f8a51794765e1a4fd0dcac3085
4
- data.tar.gz: f7e3db8d939768fa7e475053c15986d62f996f55
3
+ metadata.gz: 951df2c46006c5d93efc112929498b6eee98b782
4
+ data.tar.gz: 3c0717008c7398cfa244f02fc164054a32c3c7ac
5
5
  SHA512:
6
- metadata.gz: 1e97e7740878b4f531a65659d8d4a95872ca1b1d7a4637892a7876b503eb32e91d4e3fd968f8c0e16a8978a7d29215a8fcca7e66659f0c7ca4cf39d7a9847607
7
- data.tar.gz: 6979ffad434537b6cb5c6a18dd4fb5935ddd1bde219718accc38afbcc062c5fdbbe7cddd059ba6de5de811c34fa669099d39901543142642d58ed50080958f21
6
+ metadata.gz: 7ebb682d19e0e914cff04a313200fb5c9d6471d97a13b77b3d790ddca890d781c3e63d2018709c468ddd57af02df31be0d380ec38d66e124e41f8c15347825dc
7
+ data.tar.gz: f3f075b639288a879ec5a787f126f60f8814c641b7550a0c77f1ad3af7a192ff9c5f19ed07ffb762636ee938aaaa273d84eb9e1ff11a79d8a78a1e124604680f
data/.travis.yml CHANGED
@@ -2,9 +2,9 @@
2
2
  language: ruby
3
3
  bundler_args: --without development
4
4
  rvm:
5
- - 1.9.3
6
- - 2.0.0
7
5
  - 2.1.6
6
+ - 2.2.3
7
+ - 2.4.0
8
8
  notifications:
9
9
  email:
10
- - tech@challengepost.com
10
+ - jcmuller@gmail.com
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ ## 0.2.2 (2017/03/08)
4
+ Report what file failed loading on startup
5
+
6
+ ## 0.2.1
7
+ Fixes for rails 4
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Figleaf
2
- [![Build Status](https://secure.travis-ci.org/challengepost/figleaf.png?branch=master)](http://travis-ci.org/challengepost/figleaf)
2
+ [![Build Status](https://secure.travis-ci.org/jcmuller/figleaf.png?branch=master)](http://travis-ci.org/jcmuller/figleaf)
3
3
 
4
4
  YAML based DRY settings manager.
5
5
 
data/figleaf.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["jcmuller@gmail.com"]
7
7
  gem.description = %q{YAML based DRY settings manager.}
8
8
  gem.summary = %q{YAML based DRY settings manager.}
9
- gem.homepage = "http://github.com/challengepost/figleaf"
9
+ gem.homepage = "http://github.com/jcmuller/figleaf"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,5 +1,7 @@
1
1
  module Figleaf
2
2
  class Settings
3
+ InvalidYAML = Class.new(RuntimeError)
4
+
3
5
  class_attribute :auto_define
4
6
  self.auto_define = false
5
7
 
@@ -60,6 +62,8 @@ module Figleaf
60
62
  property = YAML.load(ERB.new(IO.read(file_path)).result)
61
63
  property = property[env] if env
62
64
  use_hashie_if_hash(property)
65
+ rescue Psych::SyntaxError
66
+ raise InvalidYAML, "#{file_path} has invalid YAML"
63
67
  end
64
68
 
65
69
  def root
@@ -1,3 +1,3 @@
1
1
  module Figleaf
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -46,7 +46,7 @@ describe Figleaf::Settings do
46
46
  end
47
47
 
48
48
  described_class.another_fictional_feature_mode.should eq(:admin)
49
- described_class.enable_fictional_activity_feed.should be_true
49
+ described_class.enable_fictional_activity_feed.should be true
50
50
  end
51
51
  end
52
52
 
@@ -56,8 +56,8 @@ describe Figleaf::Settings do
56
56
  s.some_boolean = true
57
57
  end
58
58
 
59
- described_class.some_boolean.should be_true
60
- described_class.some_boolean?.should be_true
59
+ described_class.some_boolean.should be true
60
+ described_class.some_boolean?.should be true
61
61
  end
62
62
 
63
63
  it "should define predicate methods for false value" do
@@ -65,8 +65,8 @@ describe Figleaf::Settings do
65
65
  s.another_boolean = false
66
66
  end
67
67
 
68
- described_class.another_boolean.should be_false
69
- described_class.another_boolean?.should be_false
68
+ described_class.another_boolean.should be false
69
+ described_class.another_boolean?.should be false
70
70
  end
71
71
 
72
72
  it "should evaluate presence predicate methods for string value" do
@@ -74,7 +74,7 @@ describe Figleaf::Settings do
74
74
  s.not_a_boolean = "Hello, world!"
75
75
  end
76
76
 
77
- described_class.not_a_boolean?.should be_true
77
+ described_class.not_a_boolean?.should be true
78
78
  end
79
79
 
80
80
  it "should return false for empty string" do
@@ -82,7 +82,7 @@ describe Figleaf::Settings do
82
82
  s.empty_string = ""
83
83
  end
84
84
 
85
- described_class.empty_string?.should be_false
85
+ described_class.empty_string?.should be false
86
86
  end
87
87
 
88
88
  it "return true for lists" do
@@ -90,7 +90,7 @@ describe Figleaf::Settings do
90
90
  s.not_a_boolean = %w(1 2 3)
91
91
  end
92
92
 
93
- described_class.not_a_boolean?.should be_true
93
+ described_class.not_a_boolean?.should be true
94
94
  end
95
95
  end
96
96
 
@@ -79,6 +79,15 @@ describe Figleaf::Settings do
79
79
  expect { described_class.service.blah }.to raise_error NoMethodError
80
80
  end
81
81
 
82
+ context "with bad files" do
83
+ let(:overload) { File.expand_path("../../fixtures/errors/*.yml", __FILE__) }
84
+
85
+ it "reports the file that has errors" do
86
+ expect { described_class.load_settings(overload, "test") }.
87
+ to raise_error(described_class::InvalidYAML)
88
+ end
89
+ end
90
+
82
91
  context "overloading settings" do
83
92
  before do
84
93
  overload = File.expand_path("../../fixtures/extra/*.yml", __FILE__)
@@ -0,0 +1,5 @@
1
+ ---
2
+ test:
3
+ foo: bar
4
+ bar: baz
5
+ baz:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: figleaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan C. Müller
@@ -48,6 +48,7 @@ files:
48
48
  - ".gitignore"
49
49
  - ".rspec"
50
50
  - ".travis.yml"
51
+ - CHANGELOG.md
51
52
  - Gemfile
52
53
  - Guardfile
53
54
  - HISTORY.md
@@ -65,13 +66,14 @@ files:
65
66
  - spec/fixtures/array.yml
66
67
  - spec/fixtures/boolean.yml
67
68
  - spec/fixtures/erb.yml
69
+ - spec/fixtures/errors/bad_file.yml
68
70
  - spec/fixtures/extra/array.yml
69
71
  - spec/fixtures/extra/boolean.yml
70
72
  - spec/fixtures/extra/service.yml
71
73
  - spec/fixtures/service.yml
72
74
  - spec/fixtures/string.yml
73
75
  - spec/spec_helper.rb
74
- homepage: http://github.com/challengepost/figleaf
76
+ homepage: http://github.com/jcmuller/figleaf
75
77
  licenses: []
76
78
  metadata: {}
77
79
  post_install_message:
@@ -101,6 +103,7 @@ test_files:
101
103
  - spec/fixtures/array.yml
102
104
  - spec/fixtures/boolean.yml
103
105
  - spec/fixtures/erb.yml
106
+ - spec/fixtures/errors/bad_file.yml
104
107
  - spec/fixtures/extra/array.yml
105
108
  - spec/fixtures/extra/boolean.yml
106
109
  - spec/fixtures/extra/service.yml