usps_flags 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24d9d86fd36ca806b8d47c4d409d813b2e77ef1d
4
- data.tar.gz: 2a1bf6507c6d795471336e0501c5422afb3626c2
3
+ metadata.gz: 5538a747a32b8bd07984afe3742c35f64484408c
4
+ data.tar.gz: 33d223ed7afecad4a79874626dc8120340ee4a7c
5
5
  SHA512:
6
- metadata.gz: 91e6bd78e902f7de7c0bd88d02293890771eeb80c867d44d05caf4a86eb5bea3d0638633e199923ef7fe4a9f9df5da46044336a46a1ea0864d3249a52fe88496
7
- data.tar.gz: a710623205717e2c7280a320c1dbf5ad54f2d6e902ac3cb424f991c50856610596b741182eb4ecd6720bd66b8986c9697b1e40867c7640b6e9afcf59e1cdf6dd
6
+ metadata.gz: 8019ac806ce8f503290a329902c5015467a9b4d35114b44c7649e56cad387370c906f969e3e829ddcee675babd897a97d33cbbaf1a5e1defa8d9b19bb6bfb56f
7
+ data.tar.gz: 135bc1769b9aca1f9543abe2c84461984466bbcc30b005b8534fc7a72a79c718d8fd5c14dbabc8f145136dffbd98a11eadd488fa013d3ffd47b6853880bc31a6
@@ -1,2 +1,2 @@
1
- P_ 4��1���� ��rl�+��Q� ��L�Q@0ey<��V-� �ǁ�;\K�d���� ����|��p/��,C7}i_NU�Μ���$�{�4}=�/ �}${XW�ü�����w�֧ R84�
2
- ?��F��?in���na��>�)6��p�����EW��8\c
1
+ $|t���k=Y{���2�4͐�����0큪���N
2
+ B�g�Ι�ԦƐ�LPd���ɋ�9��j-7U��̴�M���`�5T���)����n���}:1v����eU7e4��ހ�q?>�ɧg.
data.tar.gz.sig CHANGED
Binary file
@@ -12,9 +12,9 @@ class USPSFlags::Core::US
12
12
 
13
13
  @star_offset = 20 # Half of scaled star height
14
14
 
15
- svg = stripes
16
- svg << stars(:odd)
17
- svg << stars(:even)
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
- def stars(type = :odd)
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
- rows[type].each do |r|
40
- columns[type].each do |c|
41
- svg << <<~SVG
42
- <g transform="translate(#{@canton_fly*c/12}, #{@star_offset+@canton_hoist*r/10})"><g transform="scale(0.31)">#{USPSFlags::Core.star}</g></g>
43
- SVG
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
- <<~SVG
51
- <rect x="0" y="0" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
52
- <rect x="0" y="#{@base_hoist*1/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#FFFFFF" />
53
- <rect x="0" y="#{@base_hoist*2/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
54
- <rect x="0" y="#{@base_hoist*3/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#FFFFFF" />
55
- <rect x="0" y="#{@base_hoist*4/13}" width="#{@base_fly}" height="#{@base_hoist/13}" fill="#{USPSFlags::Config::OLD_GLORY_RED}" />
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>
@@ -1,19 +1,19 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'usps_flags'
3
- s.version = '0.3.19'
4
- s.date = '2018-02-10'
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 = ['lib', 'spec', 'doc']
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("~/.ssh/usps_flags-private_key.pem") if $0 =~ /gem\z/
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.19
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-02-10 00:00:00.000000000 Z
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