usps_flags-burgees 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -2
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/usps_flags/burgees/config.rb +5 -22
- data/lib/usps_flags/burgees/customs.rb +2 -2
- data/spec/spec_helper.rb +4 -2
- data/spec/usps_flags/burgees/config_spec.rb +4 -8
- data/spec/usps_flags/burgees_spec.rb +3 -3
- data/usps_flags-burgees.gemspec +2 -2
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17cdb6d1a1b7884bacbc3d43b20dabc43705d7da
|
4
|
+
data.tar.gz: 45b65770285a0f819a272f14e23715f216684e3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75caed7857b7c30d4dbef2158a91b1f9ddfa4200e7b53c2f48b0092d4c6bb3dac37f25c4fc3d47f85ba89aee43438b9615f1c4a495cedc8ab7d97a94c03e50bf
|
7
|
+
data.tar.gz: 23676c88f54dab8765b5351be84f913b4c97c0f6056eb73369619467465de58d003a41489dcf937b94bd5d4ce7def66b5db716fb8d48747cbac879fb12886403
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
�jsx���F�g�V�ū4Z�f�[��S��86\B�l
|
1
|
+
ӂ�3�i;�]�A��ʿ"����/Th( �P��9��E�J|Z��!�(B��v���i-�"�4�#φl�FOK�V 6�]�f��T��(H�u����G�f�
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
usps_flags-burgees (0.0.
|
5
|
-
usps_flags (~> 0.3, >= 0.3.
|
4
|
+
usps_flags-burgees (0.0.9)
|
5
|
+
usps_flags (~> 0.3, >= 0.3.11)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
json (>= 1.8, < 3)
|
35
35
|
simplecov-html (~> 0.10.0)
|
36
36
|
simplecov-html (0.10.2)
|
37
|
-
usps_flags (0.3.
|
37
|
+
usps_flags (0.3.11)
|
38
38
|
file_utils (~> 1.1, >= 1.1.2)
|
39
39
|
mini_magick (~> 4.8, >= 4.8.0)
|
40
40
|
rubyzip (~> 1.2, >= 1.2.1)
|
data/README.md
CHANGED
@@ -2,33 +2,16 @@
|
|
2
2
|
#
|
3
3
|
# @private
|
4
4
|
class USPSFlags::Config
|
5
|
-
@@burgees_dir ||= defined?(::Rails) ? "#{::Rails.root}/app/lib/usps-burgees" : "#{File.dirname(__dir__)}/output"
|
6
|
-
|
7
|
-
@@flags_dir ||= USPSFlags::Config.flags_dir
|
8
|
-
@@reset ||= USPSFlags::Config.reset
|
9
|
-
@@use_larger_tridents ||= USPSFlags::Config.use_larger_tridents
|
10
|
-
|
11
5
|
attr_accessor :burgees_dir
|
12
6
|
|
13
|
-
alias :parent_initialize :initialize
|
14
7
|
def initialize
|
15
|
-
|
16
|
-
|
17
|
-
c.flags_dir = @@flags_dir
|
18
|
-
c.reset = @@reset
|
19
|
-
c.use_larger_tridents = @@use_larger_tridents
|
20
|
-
end
|
8
|
+
get_defaults
|
9
|
+
get_extension_defaults
|
21
10
|
yield self if block_given?
|
22
|
-
@@burgees_dir = @burgees_dir
|
23
11
|
end
|
24
12
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
else
|
29
|
-
@@burgees_dir
|
30
|
-
end
|
31
|
-
::FileUtils.mkdir_p(burgees_path)
|
32
|
-
burgees_path
|
13
|
+
private
|
14
|
+
def get_extension_defaults
|
15
|
+
@burgees_dir ||= defined?(::Rails) ? "#{::Rails.root}/app/lib/usps-burgees" : "#{File.dirname(__dir__)}/output"
|
33
16
|
end
|
34
17
|
end
|
@@ -3,13 +3,13 @@
|
|
3
3
|
# @private
|
4
4
|
class USPSFlags::Burgees::Customs
|
5
5
|
def self.available
|
6
|
-
Dir.glob("#{USPSFlags
|
6
|
+
Dir.glob("#{USPSFlags.configuration.burgees_dir}/**/*.svg").map do |b|
|
7
7
|
b.split("/").last.split(".svg").first.to_sym
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.get(burgee)
|
12
12
|
raise USPSFlags::Errors::UnknownBurgee unless self.available.include?(burgee)
|
13
|
-
::File.read("#{USPSFlags
|
13
|
+
::File.read("#{USPSFlags.configuration.burgees_dir}/#{burgee}.svg")
|
14
14
|
end
|
15
15
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -13,14 +13,16 @@ RSpec::Expectations.configuration.on_potential_false_positives = :nothing
|
|
13
13
|
RSpec.configure do |config|
|
14
14
|
config.before(:suite) do
|
15
15
|
$tmp_flags_dir = "tmp/flags"
|
16
|
+
$tmp_burgees_dir = "tmp/path/to/burgees"
|
16
17
|
|
17
|
-
USPSFlags
|
18
|
+
USPSFlags.configure do |c|
|
18
19
|
c.flags_dir = $tmp_flags_dir
|
20
|
+
c.burgees_dir = $tmp_burgees_dir
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
22
24
|
config.after(:suite) do
|
23
25
|
::FileUtils.rm_rf("tmp") if ::Dir.exist?("tmp")
|
24
|
-
::FileUtils.rm_rf(USPSFlags
|
26
|
+
::FileUtils.rm_rf(USPSFlags.configuration.burgees_dir) if ::Dir.exist?(USPSFlags.configuration.burgees_dir)
|
25
27
|
end
|
26
28
|
end
|
@@ -2,14 +2,8 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe USPSFlags::Config do
|
4
4
|
describe "general configuration" do
|
5
|
-
before(:each) do
|
6
|
-
@config = USPSFlags::Config.new do |c|
|
7
|
-
c.burgees_dir = "tmp/path/to/burgees"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
5
|
it "should correctly set the burgees_dir in USPSFlags::Config" do
|
12
|
-
expect(USPSFlags
|
6
|
+
expect(USPSFlags.configuration.burgees_dir).to eql($tmp_burgees_dir)
|
13
7
|
end
|
14
8
|
end
|
15
9
|
|
@@ -20,10 +14,12 @@ describe USPSFlags::Config do
|
|
20
14
|
"tmp/rails_app"
|
21
15
|
end
|
22
16
|
end
|
17
|
+
|
18
|
+
@config = USPSFlags::Config.new
|
23
19
|
end
|
24
20
|
|
25
21
|
it "should use the default Rails log directory" do
|
26
|
-
expect(
|
22
|
+
expect(@config.burgees_dir).to eql("tmp/rails_app/app/lib/usps-burgees")
|
27
23
|
end
|
28
24
|
end
|
29
25
|
end
|
@@ -116,8 +116,8 @@ describe USPSFlags::Burgees do
|
|
116
116
|
end
|
117
117
|
|
118
118
|
it "should generate a burgee from the custom directory" do
|
119
|
-
@custom_file = "#{USPSFlags
|
120
|
-
::FileUtils.mkdir_p(USPSFlags
|
119
|
+
@custom_file = "#{USPSFlags.configuration.burgees_dir}/birmingham.svg"
|
120
|
+
::FileUtils.mkdir_p(USPSFlags.configuration.burgees_dir)
|
121
121
|
::FileUtils.cp("lib/usps_flags/burgees/builtins/birmingham.svg", @custom_file)
|
122
122
|
f = ::File.open(@custom_file, "w+")
|
123
123
|
f.write("<!-- Custom -->")
|
@@ -131,6 +131,6 @@ describe USPSFlags::Burgees do
|
|
131
131
|
expect(@burgee.svg).to include("<title>Birmingham Burgee</title>")
|
132
132
|
expect(@burgee.svg).to include("<!-- Custom -->")
|
133
133
|
|
134
|
-
::FileUtils.rm_rf(USPSFlags
|
134
|
+
::FileUtils.rm_rf(USPSFlags.configuration.burgees_dir)
|
135
135
|
end
|
136
136
|
end
|
data/usps_flags-burgees.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'usps_flags-burgees'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.9'
|
4
4
|
s.date = '2017-11-08'
|
5
5
|
s.summary = 'Flag generator for United States Power Squadrons burgees'
|
6
6
|
s.description = 'An extension to the flag image (PNG, SVG) generator for United States Power Squadrons to generate burgees.'
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.required_ruby_version = '~> 2.4'
|
19
19
|
|
20
|
-
s.add_runtime_dependency 'usps_flags', '~> 0.3', '>= 0.3.
|
20
|
+
s.add_runtime_dependency 'usps_flags', '~> 0.3', '>= 0.3.11'
|
21
21
|
|
22
22
|
s.add_development_dependency 'rake', '~> 12.1', '>= 12.1.0'
|
23
23
|
s.add_development_dependency 'rspec', '~> 3.7', '>= 3.7.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usps_flags-burgees
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
version: '0.3'
|
42
42
|
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.3.
|
44
|
+
version: 0.3.11
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
version: '0.3'
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.3.
|
54
|
+
version: 0.3.11
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|