usps_flags 0.3.19 → 0.3.20
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 -2
- data.tar.gz.sig +0 -0
- data/lib/usps_flags/core/us.rb +22 -25
- data/lib/usps_flags/core/us_defs.svg.partial +13 -0
- data/usps_flags.gemspec +4 -4
- metadata +3 -2
- 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: 5538a747a32b8bd07984afe3742c35f64484408c
|
4
|
+
data.tar.gz: 33d223ed7afecad4a79874626dc8120340ee4a7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8019ac806ce8f503290a329902c5015467a9b4d35114b44c7649e56cad387370c906f969e3e829ddcee675babd897a97d33cbbaf1a5e1defa8d9b19bb6bfb56f
|
7
|
+
data.tar.gz: 135bc1769b9aca1f9543abe2c84461984466bbcc30b005b8534fc7a72a79c718d8fd5c14dbabc8f145136dffbd98a11eadd488fa013d3ffd47b6853880bc31a6
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
$|t���k=Y{���2�4͐�����0큪���N�
|
2
|
+
B�g�Ι�ԦƐ�LPd���ɋ�9��j-7U��̴�M���`�5T���)����n���}:1v����e�U7�e4��ހ�q?>�ɧg.
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/usps_flags/core/us.rb
CHANGED
@@ -12,9 +12,9 @@ class USPSFlags::Core::US
|
|
12
12
|
|
13
13
|
@star_offset = 20 # Half of scaled star height
|
14
14
|
|
15
|
-
svg =
|
16
|
-
svg <<
|
17
|
-
svg << stars
|
15
|
+
svg = defs
|
16
|
+
svg << stripes
|
17
|
+
svg << stars
|
18
18
|
|
19
19
|
# star_diameter = base_hoist*4/5/13
|
20
20
|
# svg << <<~SVG
|
@@ -25,7 +25,12 @@ class USPSFlags::Core::US
|
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
|
-
|
28
|
+
|
29
|
+
def defs
|
30
|
+
File.read("#{File.dirname(__dir__)}/core/us_defs.svg.partial").gsub('STAR', USPSFlags::Core.star)
|
31
|
+
end
|
32
|
+
|
33
|
+
def stars
|
29
34
|
rows = {
|
30
35
|
odd: (1..9).step(2).to_a,
|
31
36
|
even: (2..8).step(2).to_a
|
@@ -36,32 +41,24 @@ class USPSFlags::Core::US
|
|
36
41
|
}
|
37
42
|
|
38
43
|
svg = ""
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
+
%i[odd even].each do |type|
|
45
|
+
rows[type].each do |r|
|
46
|
+
columns[type].each do |c|
|
47
|
+
svg << <<~SVG
|
48
|
+
<g transform="translate(#{@canton_fly*c/12}, #{@star_offset+@canton_hoist*r/10})"><g transform="scale(0.31)"><use href="#star" /></g></g>
|
49
|
+
SVG
|
50
|
+
end
|
44
51
|
end
|
45
52
|
end
|
46
53
|
svg
|
47
54
|
end
|
48
55
|
|
49
56
|
def stripes
|
50
|
-
|
51
|
-
|
52
|
-
<
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<rect x="0" y="#{@base_hoist*5/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#FFFFFF" />
|
57
|
-
<rect x="0" y="#{@base_hoist*6/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
|
58
|
-
<rect x="0" y="#{@base_hoist*7/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#FFFFFF" />
|
59
|
-
<rect x="0" y="#{@base_hoist*8/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
|
60
|
-
<rect x="0" y="#{@base_hoist*9/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#FFFFFF" />
|
61
|
-
<rect x="0" y="#{@base_hoist*10/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
|
62
|
-
<rect x="0" y="#{@base_hoist*11/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#FFFFFF" />
|
63
|
-
<rect x="0" y="#{@base_hoist*12/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
|
64
|
-
<rect x="0" y="0" width="#{@canton_fly}" height="#{@canton_hoist}" fill="#{USPSFlags::Config::OLD_GLORY_BLUE}" />
|
65
|
-
SVG
|
57
|
+
s = (0..12).map do |i|
|
58
|
+
color = i.even? ? 'red' : 'white'
|
59
|
+
"<use href=\"##{color}-stripe\" y=\"#{@base_hoist*i/13}\" />"
|
60
|
+
end
|
61
|
+
|
62
|
+
s.join("\n") + "\n<rect y=\"0\" width=\"#{@canton_fly}\" height=\"#{@canton_hoist}\" fill=\"#{USPSFlags::Config::OLD_GLORY_BLUE}\" />\n"
|
66
63
|
end
|
67
64
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<defs>
|
2
|
+
<g id="star" transform="scale(0.31)">
|
3
|
+
STAR
|
4
|
+
</g>
|
5
|
+
|
6
|
+
<g id="red-stripe">
|
7
|
+
<rect x="0" y="0" width="3820.0" height="153.84615384615384" fill="#BF0D3E" />
|
8
|
+
</g>
|
9
|
+
|
10
|
+
<g id="white-stripe">
|
11
|
+
<rect x="0" y="0" width="3820.0" height="153.84615384615384" fill="#FFFFFF" />
|
12
|
+
</g>
|
13
|
+
</defs>
|
data/usps_flags.gemspec
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'usps_flags'
|
3
|
-
s.version = '0.3.
|
4
|
-
s.date = '2018-
|
3
|
+
s.version = '0.3.20'
|
4
|
+
s.date = '2018-05-24'
|
5
5
|
s.summary = 'Flag generator for United States Power Squadrons'
|
6
6
|
s.description = 'A flag image (PNG, SVG) generator for United States Power Squadrons.'
|
7
7
|
s.homepage = 'http://rubygems.org/gems/usps_flags'
|
8
8
|
s.license = 'GPL-3.0'
|
9
9
|
s.authors = ['Julian Fiander']
|
10
10
|
s.email = 'julian@fiander.one'
|
11
|
-
s.require_paths = [
|
11
|
+
s.require_paths = %w[lib spec doc]
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
14
14
|
|
15
15
|
s.cert_chain = ['certs/jfiander.pem']
|
16
|
-
s.signing_key = File.expand_path(
|
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
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usps_flags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
3YzYAc+kXfD7kkzA2NMvLT6Q1v03qQyIZ8BS8SNk5wLGAdLM+IravFDLEs448fjz
|
31
31
|
lEAU0RHLFVbE+CXW6makIlWGHR0=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-
|
33
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: file_utils
|
@@ -187,6 +187,7 @@ files:
|
|
187
187
|
- lib/usps_flags/core/tridents.rb
|
188
188
|
- lib/usps_flags/core/trumpet.rb
|
189
189
|
- lib/usps_flags/core/us.rb
|
190
|
+
- lib/usps_flags/core/us_defs.svg.partial
|
190
191
|
- lib/usps_flags/core/wheel.rb
|
191
192
|
- lib/usps_flags/core/wheel.svg.partial
|
192
193
|
- lib/usps_flags/errors.rb
|
metadata.gz.sig
CHANGED
Binary file
|