usps_flags-burgees 0.0.3 → 0.0.6
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 +2 -0
- data.tar.gz.sig +2 -0
- data/.gitignore +2 -0
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/.yardopts +1 -0
- data/Gemfile.lock +30 -3
- data/README.md +4 -1
- data/Rakefile +7 -0
- data/certs/jfiander.pem +21 -0
- data/lib/usps_flags/burgees.rb +60 -40
- data/lib/usps_flags/burgees/builtins.rb +3 -0
- data/lib/usps_flags/burgees/config.rb +11 -6
- data/lib/usps_flags/burgees/customs.rb +4 -1
- data/lib/usps_flags/burgees/errors.rb +3 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/usps_flags/burgees/config_spec.rb +29 -0
- data/spec/usps_flags/burgees_spec.rb +136 -0
- data/usps_flags-burgees.gemspec +9 -5
- metadata +100 -5
- metadata.gz.sig +3 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87d2d856b5649f5d68bad1806a6b1c3e1aee79b6
|
4
|
+
data.tar.gz: 0c5c2cbdeb2ff4a092df491430f976316a25c717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a6828a2c28031f999cdd44668e0a164a9375450802f50084f821c4699ac80596f535331a3289c13fa45403d1c49f0175056a36bd972434d01dba98508623c6e
|
7
|
+
data.tar.gz: '04368bc5ffd517bda583dbfebf3b2ea1572ebba2e8752385bd0a617432ebce24ab58e535130f6bc127012d0ea8b7086252aa856db03ef0ff070165133b8d2b0a'
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--no-private
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,40 @@
|
|
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.6)
|
5
|
+
usps_flags (~> 0.3, >= 0.3.7)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
codeclimate-test-reporter (0.6.0)
|
11
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
12
|
+
diff-lcs (1.3)
|
13
|
+
docile (1.1.5)
|
10
14
|
file_utils (1.1.2)
|
15
|
+
json (2.1.0)
|
11
16
|
mini_magick (4.8.0)
|
17
|
+
rake (12.2.1)
|
18
|
+
rspec (3.7.0)
|
19
|
+
rspec-core (~> 3.7.0)
|
20
|
+
rspec-expectations (~> 3.7.0)
|
21
|
+
rspec-mocks (~> 3.7.0)
|
22
|
+
rspec-core (3.7.0)
|
23
|
+
rspec-support (~> 3.7.0)
|
24
|
+
rspec-expectations (3.7.0)
|
25
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
+
rspec-support (~> 3.7.0)
|
27
|
+
rspec-mocks (3.7.0)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.7.0)
|
30
|
+
rspec-support (3.7.0)
|
12
31
|
rubyzip (1.2.1)
|
13
|
-
|
32
|
+
simplecov (0.15.1)
|
33
|
+
docile (~> 1.1.0)
|
34
|
+
json (>= 1.8, < 3)
|
35
|
+
simplecov-html (~> 0.10.0)
|
36
|
+
simplecov-html (0.10.2)
|
37
|
+
usps_flags (0.3.7)
|
14
38
|
file_utils (~> 1.1, >= 1.1.2)
|
15
39
|
mini_magick (~> 4.8, >= 4.8.0)
|
16
40
|
rubyzip (~> 1.2, >= 1.2.1)
|
@@ -19,6 +43,9 @@ PLATFORMS
|
|
19
43
|
ruby
|
20
44
|
|
21
45
|
DEPENDENCIES
|
46
|
+
codeclimate-test-reporter (~> 0.4, >= 0.4.8)
|
47
|
+
rake (~> 12.1, >= 12.1.0)
|
48
|
+
rspec (~> 3.7, >= 3.7.0)
|
22
49
|
usps_flags-burgees!
|
23
50
|
|
24
51
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# USPSFlags Burgees
|
2
2
|
|
3
|
-
[![Gem Version](https://img.shields.io/gem/v/usps_flags.svg)](https://rubygems.org/gems/usps_flags-burgees)
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/usps_flags-burgees.svg)](https://rubygems.org/gems/usps_flags-burgees)
|
4
|
+
[![Build Status](https://travis-ci.org/jfiander/usps_flags-burgees.svg)](https://travis-ci.org/jfiander/usps_flags-burgees)
|
5
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/760b824f0edac3316a11/test_coverage)](https://codeclimate.com/github/jfiander/usps_flags-burgees/test_coverage)
|
6
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/760b824f0edac3316a11/maintainability)](https://codeclimate.com/github/jfiander/usps_flags-burgees/maintainability)
|
4
7
|
|
5
8
|
An extension for [USPSFlags](https://github.com/jfiander/usps-flags) to provide squadron burgees.
|
6
9
|
|
data/Rakefile
ADDED
data/certs/jfiander.pem
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZqdWxp
|
3
|
+
YW4xFzAVBgoJkiaJk/IsZAEZFgdmaWFuZGVyMRMwEQYKCZImiZPyLGQBGRYDb25l
|
4
|
+
MB4XDTE3MTAxNzIwMzYwNVoXDTE4MTAxNzIwMzYwNVowPzEPMA0GA1UEAwwGanVs
|
5
|
+
aWFuMRcwFQYKCZImiZPyLGQBGRYHZmlhbmRlcjETMBEGCgmSJomT8ixkARkWA29u
|
6
|
+
ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKgyweLKJcXOZUJ/Y/fb
|
7
|
+
IjGIQzFgi0UUbIxc6BRP3BYCAr7MpflEq3sYaVsECs0ZyM27zLpyDN0oW73Wby6k
|
8
|
+
jaik/yBcsDMvrl58+6mjHnB3yIuk0BbEfQaijgMBzW2p0hToocMToMXigwZOGe4e
|
9
|
+
kPTAO6yTIIYLhhjWALA+nURCBcCNI8d1YAIjiEuF1lCr4pnV4aAq8tPBVrz7a8Fg
|
10
|
+
WpeLe0V1Blhkg9BDzNUmSrDxDxitO8oA5+A0z9Wm1xn8cJfn50103813SEK8gaXV
|
11
|
+
eb/zLRa/CNnTzQ8xUrySd10b1auLnKduXgewBhINcWYjDOT/C1FCjxpK5F6buJ6S
|
12
|
+
1ukCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/F
|
13
|
+
wfSc4YJ3gO9EnkvjGcT6fE3WMB0GA1UdEQQWMBSBEmp1bGlhbkBmaWFuZGVyLm9u
|
14
|
+
ZTAdBgNVHRIEFjAUgRJqdWxpYW5AZmlhbmRlci5vbmUwDQYJKoZIhvcNAQEFBQAD
|
15
|
+
ggEBAHddpCbrFKtf02u/4MPzRQQO+uTP9vlbNDxseQsMvpjIIzMjJzANGBqPeI+V
|
16
|
+
HCjLEnKtnUi9br+RqjtQWWc2jGBdZwrlhOFglKUcTVn60ZvBNrByUj8PeBHQR3U2
|
17
|
+
vEKSi1v2i/jlVVvrk+9z4DZ4QdrfARBcPCZhUSZcZBsDbnzjMeX6lhoknnqKn/oi
|
18
|
+
op1Z8vhtFmvxNk4UfHMG1bdUoxl6DDXKfodqWM//9mARZwSyVX9oV7snFP0nKUaD
|
19
|
+
3YzYAc+kXfD7kkzA2NMvLT6Q1v03qQyIZ8BS8SNk5wLGAdLM+IravFDLEs448fjz
|
20
|
+
lEAU0RHLFVbE+CXW6makIlWGHR0=
|
21
|
+
-----END CERTIFICATE-----
|
data/lib/usps_flags/burgees.rb
CHANGED
@@ -2,60 +2,80 @@ require 'usps_flags'
|
|
2
2
|
require 'usps_flags/burgees/config'
|
3
3
|
require 'usps_flags/burgees/errors'
|
4
4
|
|
5
|
+
# Main class for generating burgees.
|
5
6
|
class USPSFlags::Burgees
|
6
7
|
require 'usps_flags/burgees/builtins'
|
7
8
|
require 'usps_flags/burgees/customs'
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
# List of available burgees.
|
11
|
+
def self.available
|
12
|
+
(USPSFlags::Burgees::Builtins.available + USPSFlags::Burgees::Customs.available).uniq
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
# Constructor for generating burgees.
|
16
|
+
#
|
17
|
+
# @example Generate Birmingham's burgee
|
18
|
+
# burgee = USPSFlags::Burgee.new do |b|
|
19
|
+
# b.type = :birmingham
|
20
|
+
# b.ourfile = "/path/to/svg/output.svg"
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# burgee.svg #=> Generates SVG file at "/path/to/svg/output.svg"
|
24
|
+
def initialize
|
25
|
+
@squadron = nil
|
26
|
+
@outfile = nil
|
27
|
+
# @width = 3000
|
28
|
+
# @height = 2000
|
29
|
+
@title = nil
|
30
|
+
@generated_at = Time.now.strftime("%Y%m%d.%H%S%z")
|
31
|
+
yield self if block_given?
|
32
|
+
@title ||= title(@squadron)
|
33
|
+
end
|
16
34
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
@title = title(burgee)
|
35
|
+
attr_accessor :squadron
|
36
|
+
attr_accessor :outfile
|
37
|
+
# attr_accessor :width
|
38
|
+
# attr_accessor :height
|
39
|
+
attr_accessor :title
|
23
40
|
|
24
|
-
|
41
|
+
# Generates the constructed file as SVG.
|
42
|
+
#
|
43
|
+
# @return [String] Returns the SVG file output path, or the svg data if no path was specified.
|
44
|
+
def svg
|
45
|
+
raise USPSFlags::Errors::UnknownBurgee unless USPSFlags::Burgees.available.include?(@squadron)
|
25
46
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
47
|
+
@svg = <<~SVG
|
48
|
+
#{USPSFlags::Core.headers(title: @title)}
|
49
|
+
#{core(@squadron)}
|
50
|
+
#{USPSFlags::Core.footer}
|
51
|
+
SVG
|
31
52
|
|
32
|
-
|
33
|
-
|
53
|
+
USPSFlags::Helpers.output(@svg, outfile: @outfile)
|
54
|
+
end
|
34
55
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
56
|
+
private
|
57
|
+
def core(burgee)
|
58
|
+
if custom?(burgee)
|
59
|
+
USPSFlags::Burgees::Customs.get(burgee)
|
60
|
+
elsif builtin?(burgee)
|
61
|
+
USPSFlags::Burgees::Builtins.get(burgee)
|
42
62
|
end
|
63
|
+
end
|
43
64
|
|
44
|
-
|
45
|
-
|
46
|
-
|
65
|
+
def custom?(burgee)
|
66
|
+
USPSFlags::Burgees::Customs.available.include?(burgee)
|
67
|
+
end
|
47
68
|
|
48
|
-
|
49
|
-
|
50
|
-
|
69
|
+
def builtin?(burgee)
|
70
|
+
USPSFlags::Burgees::Builtins.available.include?(burgee)
|
71
|
+
end
|
51
72
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
73
|
+
def title(burgee)
|
74
|
+
burgee_string = burgee.to_s
|
75
|
+
burgee_title = if burgee_string.match(/_/)
|
76
|
+
burgee_string.gsub("_", " ").split(" ").map { |word| word.capitalize }.join(" ") + " Burgee"
|
77
|
+
else
|
78
|
+
"#{burgee_string.capitalize} Burgee"
|
59
79
|
end
|
60
80
|
end
|
61
81
|
end
|
@@ -1,9 +1,8 @@
|
|
1
|
+
# Extension of USPSFlags::Config to allow including custom burgee files.
|
2
|
+
#
|
3
|
+
# @private
|
1
4
|
class USPSFlags::Config
|
2
|
-
@@burgees_dir ||=
|
3
|
-
"#{::Rails.root}/app/lib/usps-burgees"
|
4
|
-
else
|
5
|
-
"#{File.dirname(__dir__)}/output"
|
6
|
-
end
|
5
|
+
@@burgees_dir ||= defined?(::Rails) ? "#{::Rails.root}/app/lib/usps-burgees" : "#{File.dirname(__dir__)}/output"
|
7
6
|
|
8
7
|
attr_accessor :burgees_dir
|
9
8
|
|
@@ -16,6 +15,12 @@ class USPSFlags::Config
|
|
16
15
|
end
|
17
16
|
|
18
17
|
def self.burgees_dir
|
19
|
-
|
18
|
+
burgees_path = if defined?(::Rails)
|
19
|
+
"#{::Rails.root}/app/lib/usps-burgees"
|
20
|
+
else
|
21
|
+
@@burgees_dir
|
22
|
+
end
|
23
|
+
::FileUtils.mkdir_p(burgees_path)
|
24
|
+
burgees_path
|
20
25
|
end
|
21
26
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# Helper class for handling user-provided burgees.
|
2
|
+
#
|
3
|
+
# @private
|
1
4
|
class USPSFlags::Burgees::Customs
|
2
5
|
def self.available
|
3
6
|
Dir.glob("#{USPSFlags::Config.burgees_dir}/**/*.svg").map do |b|
|
@@ -7,6 +10,6 @@ class USPSFlags::Burgees::Customs
|
|
7
10
|
|
8
11
|
def self.get(burgee)
|
9
12
|
raise USPSFlags::Errors::UnknownBurgee unless self.available.include?(burgee)
|
10
|
-
::File.read("
|
13
|
+
::File.read("#{USPSFlags::Config.burgees_dir}/#{burgee}.svg")
|
11
14
|
end
|
12
15
|
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.setup
|
3
|
+
require 'codeclimate-test-reporter'
|
4
|
+
CodeClimate::TestReporter.start
|
5
|
+
|
6
|
+
require 'usps_flags'
|
7
|
+
require 'usps_flags/burgees'
|
8
|
+
|
9
|
+
# The spec for USPSFlags::Burgees contains an example that checks for
|
10
|
+
# USPSFlags::Errors::UnknownBurgee
|
11
|
+
RSpec::Expectations.configuration.on_potential_false_positives = :nothing
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.before(:suite) do
|
15
|
+
$tmp_flags_dir = "tmp/flags"
|
16
|
+
|
17
|
+
USPSFlags::Config.new do |c|
|
18
|
+
c.flags_dir = $tmp_flags_dir
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
config.after(:suite) do
|
23
|
+
::FileUtils.rm_rf("tmp") if ::Dir.exist?("tmp")
|
24
|
+
::FileUtils.rm_rf(USPSFlags::Config.burgees_dir) if ::Dir.exist?(USPSFlags::Config.burgees_dir)
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe USPSFlags::Config do
|
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
|
+
it "should correctly set the burgees_dir in USPSFlags::Config" do
|
12
|
+
expect(USPSFlags::Config.burgees_dir).to eql("tmp/path/to/burgees")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "Rails configuration" do
|
17
|
+
before(:each) do
|
18
|
+
class Rails
|
19
|
+
def self.root
|
20
|
+
"tmp/rails_app"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should use the default Rails log directory" do
|
26
|
+
expect(USPSFlags::Config.burgees_dir).to eql("tmp/rails_app/app/lib/usps-burgees")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe USPSFlags::Burgees do
|
4
|
+
it "should return the list of available burgees from available" do
|
5
|
+
expect(USPSFlags::Burgees.available).to eql([:birmingham])
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should raise USPSFlags::Errors::UnknownBurgee if an invalid burgee is entered" do
|
9
|
+
@burgee = USPSFlags::Burgees.new do |b|
|
10
|
+
b.squadron = :not_a_squadron
|
11
|
+
b.outfile = ""
|
12
|
+
end
|
13
|
+
|
14
|
+
expect { @burgee.svg }.to raise_error(USPSFlags::Errors::UnknownBurgee)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should generate a burgee from the builtins" do
|
18
|
+
@burgee = USPSFlags::Burgees.new do |b|
|
19
|
+
b.squadron = :birmingham
|
20
|
+
b.outfile = ""
|
21
|
+
end
|
22
|
+
|
23
|
+
expect(@burgee.svg).to include(
|
24
|
+
<<~SVG
|
25
|
+
<?xml version="1.0" standalone="no"?>
|
26
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
27
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1024pt" height="682pt" viewBox="0 0 3072 2048" preserveAspectRatio="xMidYMid meet">
|
28
|
+
<title>Birmingham Burgee</title>
|
29
|
+
<metadata>
|
30
|
+
<desc id="created-by">Julian Fiander</desc>
|
31
|
+
SVG
|
32
|
+
)
|
33
|
+
|
34
|
+
expect(@burgee.svg).to include(
|
35
|
+
<<~SVG
|
36
|
+
<desc id="trademark-desc">This image is a registered trademark of United States Power Squadrons.</desc>
|
37
|
+
<desc id="trademark-link">http://www.usps.org/national/itcom/trademark.html</desc>
|
38
|
+
</metadata>
|
39
|
+
|
40
|
+
<g transform="translate(0.000000,2000.000000) scale(0.1,0.1)" fill="#1086FF" stroke="none">
|
41
|
+
<polyline points="0,-20000 30000,-10000 0,0" fill="#1086FF" />
|
42
|
+
<path d="M 19500 -9250
|
43
|
+
l 1175.55 818.05
|
44
|
+
l -414.7 -1370.85
|
45
|
+
l 1141.25 -865.25
|
46
|
+
l -1431.85 -29.15
|
47
|
+
l -470.25 -1352.8
|
48
|
+
l -470.25 1352.8
|
49
|
+
l -1431.85 29.15
|
50
|
+
l 1141.25 865.25
|
51
|
+
l -414.7 1370.85
|
52
|
+
l 1175.55 -818.05
|
53
|
+
" fill="#FFFFFF" />
|
54
|
+
<path d="M 12500 -12250
|
55
|
+
l 1175.55 818.05
|
56
|
+
l -414.7 -1370.85
|
57
|
+
l 1141.25 -865.25
|
58
|
+
l -1431.85 -29.15
|
59
|
+
l -470.25 -1352.8
|
60
|
+
l -470.25 1352.8
|
61
|
+
l -1431.85 29.15
|
62
|
+
l 1141.25 865.25
|
63
|
+
l -414.7 1370.85
|
64
|
+
l 1175.55 -818.05
|
65
|
+
" fill="#FFFFFF" />
|
66
|
+
<path d="M 12500 -6250
|
67
|
+
l 1175.55 818.05
|
68
|
+
l -414.7 -1370.85
|
69
|
+
l 1141.25 -865.25
|
70
|
+
l -1431.85 -29.15
|
71
|
+
l -470.25 -1352.8
|
72
|
+
l -470.25 1352.8
|
73
|
+
l -1431.85 29.15
|
74
|
+
l 1141.25 865.25
|
75
|
+
l -414.7 1370.85
|
76
|
+
l 1175.55 -818.05
|
77
|
+
" fill="#FFFFFF" />
|
78
|
+
<path d="M 5800 -14250
|
79
|
+
c-104.666,449.9807,-22.6957,1072.0206,423.5843,1684.371
|
80
|
+
c316.7131,442.9167,836.5815,765.5356,1051.4854,1365.4361
|
81
|
+
c120.2205,480.3001,374.2754,1457.993,-946.8351,3059.773
|
82
|
+
c-648.359,934.0117,-1831.1951,2019.1478,-2023.2376,2506.6223
|
83
|
+
c-964.4609,1882.8111,1386.3825,1616.3949,578.0677,508.3014
|
84
|
+
c5.4606,-70.2644,222.4875,-178.2827,253.1148,-180.0513
|
85
|
+
c56.7216,-17.4252,136.3628,-24.4061,167.0038,0.0007
|
86
|
+
c161.1126,136.6123,430.9021,302.8633,597.5594,354.8821
|
87
|
+
c-300.4308,315.5714,-335.1624,440.0042,-58.7118,704.5458
|
88
|
+
c-274.1394,154.9454,-644.8725,192.1093,-665.4051,905.4727
|
89
|
+
c-488.9256,-293.8771,-687.8155,-352.2895,-1071.1716,-10.437
|
90
|
+
c-232.009,-232.2225,-143.7366,-684.5085,-965.4897,-605.3878
|
91
|
+
c91.548,-244.4487,158.5041,-843.4501,-427.9466,-1064.6484
|
92
|
+
c222.473,-163.7908,1012.1031,-322.0582,396.6337,-1085.5229
|
93
|
+
c655.3237,-69.3559,837.3459,-311.7418,769.7821,-983.7558
|
94
|
+
c858.7843,6.4381,655.3593,-504.4532,508.8389,-835.0187
|
95
|
+
c998.7721,-520.9843,220.267,-996.9018,-41.7511,-1075.0854
|
96
|
+
c491.9119,-618.1957,36.9677,-919.6739,-568.8601,-1550.007
|
97
|
+
c-903.2258,906.223,-1639.9032,423.1217,-1925.7751,52.1536
|
98
|
+
c-322.3945,-558.7984,648.2547,-2340.7437,934.1994,-2692.8736
|
99
|
+
c186.812,1687.9158,1711.1362,1409.5262,735.8529,-10.4298
|
100
|
+
c736.0593,-141.6665,243.3838,-1007.9676,177.444,-1273.4294
|
101
|
+
c946.2568,-46.3264,448.6675,-750.6045,694.0893,-1205.5123
|
102
|
+
c714.9975,583.3763,862.4609,-108.6177,1210.7799,-495.8427
|
103
|
+
c348.319,797.1493,691.9312,313.4718,923.7179,182.6726
|
104
|
+
c90.9139,291.8189,-123.4323,731.3063,829.8424,1351.6526
|
105
|
+
c-325.0148,646.4338,-198.9636,1511.38,266.0925,1445.6675
|
106
|
+
c68.5255,69.9427,84.6195,121.739,114.8447,193.0877
|
107
|
+
c-157.6051,358.3116,-0.0898,329.9667,-26.0675,631.4773
|
108
|
+
c-166.8505,9.3302,-334.916,20.169,-485.3875,83.4998
|
109
|
+
c-265.2566,-500.1601,-648.6397,-660.7452,-887.1152,-913.3022
|
110
|
+
c-170.648,-210.817,-460.8627,-530.3169,-537.5822,-1054.1948" fill="#FFFFFF" />
|
111
|
+
</g>
|
112
|
+
|
113
|
+
</svg>
|
114
|
+
SVG
|
115
|
+
)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should generate a burgee from the custom directory" do
|
119
|
+
@custom_file = "#{USPSFlags::Config.burgees_dir}/birmingham.svg"
|
120
|
+
::FileUtils.mkdir_p(USPSFlags::Config.burgees_dir)
|
121
|
+
::FileUtils.cp("lib/usps_flags/burgees/builtins/birmingham.svg", @custom_file)
|
122
|
+
f = ::File.open(@custom_file, "w+")
|
123
|
+
f.write("<!-- Custom -->")
|
124
|
+
f.close
|
125
|
+
|
126
|
+
@burgee = USPSFlags::Burgees.new do |b|
|
127
|
+
b.squadron = :birmingham
|
128
|
+
b.outfile = ""
|
129
|
+
end
|
130
|
+
|
131
|
+
expect(@burgee.svg).to include("<title>Birmingham Burgee</title>")
|
132
|
+
expect(@burgee.svg).to include("<!-- Custom -->")
|
133
|
+
|
134
|
+
::FileUtils.rm_rf(USPSFlags::Config.burgees_dir)
|
135
|
+
end
|
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.6'
|
4
4
|
s.date = '2017-11-07'
|
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.'
|
@@ -8,14 +8,18 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.license = 'GPL-3.0'
|
9
9
|
s.authors = ['Julian Fiander']
|
10
10
|
s.email = 'julian@fiander.one'
|
11
|
-
s.require_paths = ['lib'
|
11
|
+
s.require_paths = ['lib', 'spec']
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
s.cert_chain = ['certs/jfiander.pem']
|
16
|
+
s.signing_key = File.expand_path("~/.ssh/usps_flags-private_key.pem") if $0 =~ /gem\z/
|
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.7'
|
21
|
+
|
22
|
+
s.add_development_dependency 'rake', '~> 12.1', '>= 12.1.0'
|
23
|
+
s.add_development_dependency 'rspec', '~> 3.7', '>= 3.7.0'
|
24
|
+
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4', '>= 0.4.8'
|
21
25
|
end
|
metadata
CHANGED
@@ -1,13 +1,35 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZqdWxp
|
14
|
+
YW4xFzAVBgoJkiaJk/IsZAEZFgdmaWFuZGVyMRMwEQYKCZImiZPyLGQBGRYDb25l
|
15
|
+
MB4XDTE3MTAxNzIwMzYwNVoXDTE4MTAxNzIwMzYwNVowPzEPMA0GA1UEAwwGanVs
|
16
|
+
aWFuMRcwFQYKCZImiZPyLGQBGRYHZmlhbmRlcjETMBEGCgmSJomT8ixkARkWA29u
|
17
|
+
ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKgyweLKJcXOZUJ/Y/fb
|
18
|
+
IjGIQzFgi0UUbIxc6BRP3BYCAr7MpflEq3sYaVsECs0ZyM27zLpyDN0oW73Wby6k
|
19
|
+
jaik/yBcsDMvrl58+6mjHnB3yIuk0BbEfQaijgMBzW2p0hToocMToMXigwZOGe4e
|
20
|
+
kPTAO6yTIIYLhhjWALA+nURCBcCNI8d1YAIjiEuF1lCr4pnV4aAq8tPBVrz7a8Fg
|
21
|
+
WpeLe0V1Blhkg9BDzNUmSrDxDxitO8oA5+A0z9Wm1xn8cJfn50103813SEK8gaXV
|
22
|
+
eb/zLRa/CNnTzQ8xUrySd10b1auLnKduXgewBhINcWYjDOT/C1FCjxpK5F6buJ6S
|
23
|
+
1ukCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/F
|
24
|
+
wfSc4YJ3gO9EnkvjGcT6fE3WMB0GA1UdEQQWMBSBEmp1bGlhbkBmaWFuZGVyLm9u
|
25
|
+
ZTAdBgNVHRIEFjAUgRJqdWxpYW5AZmlhbmRlci5vbmUwDQYJKoZIhvcNAQEFBQAD
|
26
|
+
ggEBAHddpCbrFKtf02u/4MPzRQQO+uTP9vlbNDxseQsMvpjIIzMjJzANGBqPeI+V
|
27
|
+
HCjLEnKtnUi9br+RqjtQWWc2jGBdZwrlhOFglKUcTVn60ZvBNrByUj8PeBHQR3U2
|
28
|
+
vEKSi1v2i/jlVVvrk+9z4DZ4QdrfARBcPCZhUSZcZBsDbnzjMeX6lhoknnqKn/oi
|
29
|
+
op1Z8vhtFmvxNk4UfHMG1bdUoxl6DDXKfodqWM//9mARZwSyVX9oV7snFP0nKUaD
|
30
|
+
3YzYAc+kXfD7kkzA2NMvLT6Q1v03qQyIZ8BS8SNk5wLGAdLM+IravFDLEs448fjz
|
31
|
+
lEAU0RHLFVbE+CXW6makIlWGHR0=
|
32
|
+
-----END CERTIFICATE-----
|
11
33
|
date: 2017-11-07 00:00:00.000000000 Z
|
12
34
|
dependencies:
|
13
35
|
- !ruby/object:Gem::Dependency
|
@@ -19,7 +41,7 @@ dependencies:
|
|
19
41
|
version: '0.3'
|
20
42
|
- - ">="
|
21
43
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
44
|
+
version: 0.3.7
|
23
45
|
type: :runtime
|
24
46
|
prerelease: false
|
25
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +51,67 @@ dependencies:
|
|
29
51
|
version: '0.3'
|
30
52
|
- - ">="
|
31
53
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.3.
|
54
|
+
version: 0.3.7
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '12.1'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 12.1.0
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '12.1'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 12.1.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '3.7'
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 3.7.0
|
85
|
+
type: :development
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '3.7'
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 3.7.0
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: codeclimate-test-reporter
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0.4'
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 0.4.8
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0.4'
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: 0.4.8
|
33
115
|
description: An extension to the flag image (PNG, SVG) generator for United States
|
34
116
|
Power Squadrons to generate burgees.
|
35
117
|
email: julian@fiander.one
|
@@ -37,17 +119,26 @@ executables: []
|
|
37
119
|
extensions: []
|
38
120
|
extra_rdoc_files: []
|
39
121
|
files:
|
122
|
+
- ".gitignore"
|
123
|
+
- ".rspec"
|
124
|
+
- ".travis.yml"
|
125
|
+
- ".yardopts"
|
40
126
|
- CONTRIBUTING.md
|
41
127
|
- Gemfile
|
42
128
|
- Gemfile.lock
|
43
129
|
- LICENSE
|
44
130
|
- README.md
|
131
|
+
- Rakefile
|
132
|
+
- certs/jfiander.pem
|
45
133
|
- lib/usps_flags/burgees.rb
|
46
134
|
- lib/usps_flags/burgees/builtins.rb
|
47
135
|
- lib/usps_flags/burgees/builtins/birmingham.svg
|
48
136
|
- lib/usps_flags/burgees/config.rb
|
49
137
|
- lib/usps_flags/burgees/customs.rb
|
50
138
|
- lib/usps_flags/burgees/errors.rb
|
139
|
+
- spec/spec_helper.rb
|
140
|
+
- spec/usps_flags/burgees/config_spec.rb
|
141
|
+
- spec/usps_flags/burgees_spec.rb
|
51
142
|
- usps_flags-burgees.gemspec
|
52
143
|
homepage: http://rubygems.org/gems/usps_flags-burgees
|
53
144
|
licenses:
|
@@ -57,6 +148,7 @@ post_install_message:
|
|
57
148
|
rdoc_options: []
|
58
149
|
require_paths:
|
59
150
|
- lib
|
151
|
+
- spec
|
60
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
61
153
|
requirements:
|
62
154
|
- - "~>"
|
@@ -73,4 +165,7 @@ rubygems_version: 2.6.11
|
|
73
165
|
signing_key:
|
74
166
|
specification_version: 4
|
75
167
|
summary: Flag generator for United States Power Squadrons burgees
|
76
|
-
test_files:
|
168
|
+
test_files:
|
169
|
+
- spec/spec_helper.rb
|
170
|
+
- spec/usps_flags/burgees/config_spec.rb
|
171
|
+
- spec/usps_flags/burgees_spec.rb
|
metadata.gz.sig
ADDED