figleaf 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +8 -4
- data/Guardfile +43 -7
- data/lib/figleaf/settings.rb +3 -0
- data/lib/figleaf/version.rb +1 -1
- data/spec/figleaf/settings_spec.rb +30 -0
- data/spec/fixtures/extra/default.yml +6 -0
- data/spec/fixtures/extra/default_anchor.yml +7 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebc37827cd68fb9d931fa327581d19acd47a2c02
|
4
|
+
data.tar.gz: 7f5c2050291f1ead028c57e98febeba9329fbe97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73bc054a55de88db693d019a84d816e5a6e2adf40d76b8fcbba5484a49d79e0afc36fddada3e9d72bd1ff6e2797844c193f765cdd482d7166656f8d424f8d34e
|
7
|
+
data.tar.gz: 452291366fe8950e631cf4a0c77c8da558e68291b904481e9df10b3abf797656d0b31b86640a5b95c280b9ea7882a45b300065c8cf39d9449ced1493ad9262b9
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -12,10 +12,14 @@ group :development do
|
|
12
12
|
gem "rb-fchange", require: false
|
13
13
|
gem "rb-fsevent", require: false
|
14
14
|
gem "rb-inotify", require: false
|
15
|
-
|
16
|
-
gem
|
17
|
-
gem
|
18
|
-
gem
|
15
|
+
|
16
|
+
gem 'guard-bundler', :require => false
|
17
|
+
gem 'guard-livereload', :require => false
|
18
|
+
gem 'guard-rspec', :require => false
|
19
|
+
gem 'libnotify', :require => false # linux notifications
|
20
|
+
gem 'ruby_gntp', :require => false # os x notifications
|
21
|
+
gem "terminal-notifier-guard", :require => false
|
22
|
+
|
19
23
|
gem "pry"
|
20
24
|
gem "pry-debugger", platforms: :ruby_19
|
21
25
|
end
|
data/Guardfile
CHANGED
@@ -1,10 +1,46 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
platform = RUBY_PLATFORM.match(/(linux|darwin)/)[0].to_sym
|
2
|
+
notification case platform
|
3
|
+
when :darwin
|
4
|
+
:gntp
|
5
|
+
when :linux
|
6
|
+
require 'libnotify'
|
7
|
+
:libnotify
|
8
|
+
end
|
9
|
+
|
10
|
+
guard :bundler do
|
11
|
+
require 'guard/bundler'
|
12
|
+
require 'guard/bundler/verify'
|
13
|
+
helper = Guard::Bundler::Verify.new
|
14
|
+
|
15
|
+
files = ['Gemfile']
|
16
|
+
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
17
|
+
|
18
|
+
# Assume files are symlinked from somewhere
|
19
|
+
files.each { |file| watch(helper.real_path(file)) }
|
4
20
|
end
|
5
21
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
22
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
23
|
+
# rspec may be run, below are examples of the most common uses.
|
24
|
+
# * bundler: 'bundle exec rspec'
|
25
|
+
# * bundler binstubs: 'bin/rspec'
|
26
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
27
|
+
# installed the spring binstubs per the docs)
|
28
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
29
|
+
# * 'just' rspec: 'rspec'
|
30
|
+
|
31
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
32
|
+
require "guard/rspec/dsl"
|
33
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
34
|
+
|
35
|
+
# Feel free to open issues for suggestions and improvements
|
36
|
+
|
37
|
+
# RSpec files
|
38
|
+
rspec = dsl.rspec
|
39
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
40
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
41
|
+
watch(rspec.spec_files)
|
42
|
+
|
43
|
+
# Ruby files
|
44
|
+
ruby = dsl.ruby
|
45
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
10
46
|
end
|
data/lib/figleaf/settings.rb
CHANGED
@@ -43,8 +43,11 @@ module Figleaf
|
|
43
43
|
Dir.glob(file_pattern).each do |file|
|
44
44
|
property_name = File.basename(file, '.yml')
|
45
45
|
yaml_hash = load_file(file) or next
|
46
|
+
default = yaml_hash["default"]
|
46
47
|
property = yaml_hash[env_to_load]
|
47
48
|
|
49
|
+
property = default.merge(property) if !default.nil?
|
50
|
+
|
48
51
|
next if property.nil?
|
49
52
|
|
50
53
|
if self.respond_to?(property_name) &&
|
data/lib/figleaf/version.rb
CHANGED
@@ -109,5 +109,35 @@ describe Figleaf::Settings do
|
|
109
109
|
expect(described_class.boolean).to eq(true) # remains unchanged
|
110
110
|
end
|
111
111
|
end
|
112
|
+
|
113
|
+
context "default is applied" do
|
114
|
+
before do
|
115
|
+
default = File.expand_path("../../fixtures/extra/default.yml", __FILE__)
|
116
|
+
described_class.load_settings(default, "test")
|
117
|
+
end
|
118
|
+
|
119
|
+
it "overrides values" do
|
120
|
+
expect(described_class.default.foo).to eq("overriden")
|
121
|
+
end
|
122
|
+
|
123
|
+
it "respects values set in default" do
|
124
|
+
expect(described_class.default.bar).to eq("baz")
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
context "using default as a YAML anchor is OK" do
|
129
|
+
before do
|
130
|
+
default = File.expand_path("../../fixtures/extra/default_anchor.yml", __FILE__)
|
131
|
+
described_class.load_settings(default, "test")
|
132
|
+
end
|
133
|
+
|
134
|
+
it "overrides values" do
|
135
|
+
expect(described_class.default.foo).to eq("overriden")
|
136
|
+
end
|
137
|
+
|
138
|
+
it "respects values set in default" do
|
139
|
+
expect(described_class.default.bar).to eq("baz")
|
140
|
+
end
|
141
|
+
end
|
112
142
|
end
|
113
143
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figleaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan C. Müller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -69,6 +69,8 @@ files:
|
|
69
69
|
- spec/fixtures/errors/bad_file.yml
|
70
70
|
- spec/fixtures/extra/array.yml
|
71
71
|
- spec/fixtures/extra/boolean.yml
|
72
|
+
- spec/fixtures/extra/default.yml
|
73
|
+
- spec/fixtures/extra/default_anchor.yml
|
72
74
|
- spec/fixtures/extra/service.yml
|
73
75
|
- spec/fixtures/service.yml
|
74
76
|
- spec/fixtures/string.yml
|
@@ -106,6 +108,8 @@ test_files:
|
|
106
108
|
- spec/fixtures/errors/bad_file.yml
|
107
109
|
- spec/fixtures/extra/array.yml
|
108
110
|
- spec/fixtures/extra/boolean.yml
|
111
|
+
- spec/fixtures/extra/default.yml
|
112
|
+
- spec/fixtures/extra/default_anchor.yml
|
109
113
|
- spec/fixtures/extra/service.yml
|
110
114
|
- spec/fixtures/service.yml
|
111
115
|
- spec/fixtures/string.yml
|