usps_flags 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d178e622dbc6370cd277324673a7f9ee15c0adcf7e3b0d59a34f6499b73ca98
4
- data.tar.gz: c3eb0cf858463f11624f4474ce5e13cffe5f75698f2c80cf3ad0558df3028d4c
3
+ metadata.gz: f7668f981b685971d9920b30cdc6fdac6bc7aa98df4b735e9d87deec582e05cb
4
+ data.tar.gz: 3c0101f8ad5aa5713fec0848040ab67bdf61a37fa8d571a9a612eada714b9aa4
5
5
  SHA512:
6
- metadata.gz: bf09d8306ee9bc6da4405a89e79f71866c8a36041b003033c7f40bf6e8070f3feb7f12c5b1dad473beb57b7a0d26a641b093aef5828962e6df5fe3a84943d6dd
7
- data.tar.gz: 9f312f4248f69039910e6d04f879a0eb733044101b0d76511e66cef06a9ecc83857aea05503a98eddcd225b7997d5eba7955741a15837799883bf051b0c95986
6
+ metadata.gz: 8f32f4ec49c1ecf428aa9fbea996196fa630472c57f2ab965447ebd2092c8fbd78873303f9a11ddeece882cf99b38167b9b786c557f766e727113f5e129665a3
7
+ data.tar.gz: 10da9cd1e199d2add0044816d4f902933cf04ecc9a05ae3f8abfdf3addd0876b35360ad9c07c17d92eba2b5f16053751ac69c66fb99e5de0e60b0c30bd3c50f5
data/.gitignore CHANGED
@@ -2,3 +2,4 @@ doc/
2
2
  coverage/
3
3
  lib/output/
4
4
  tmp/
5
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps_flags (0.5.8)
4
+ usps_flags (0.5.9)
5
5
  file_utils (~> 1.1, >= 1.1.2)
6
6
  mini_magick (~> 4.9, >= 4.9.4)
7
7
  rubyzip (~> 1.3, >= 1.3.0)
@@ -52,7 +52,7 @@ class USPSFlags
52
52
  l #{@fly} 0
53
53
  l 0 #{@hoist}
54
54
  l -#{@fly} 0
55
- l 0 -#{@hoist}
55
+ l 0 -#{@hoist} z
56
56
  " fill="#{@color_code}" #{@border_svg}/>
57
57
  SVG
58
58
  end
@@ -71,7 +71,7 @@ class USPSFlags
71
71
  def past_field
72
72
  <<~SVG
73
73
  <g transform="translate(#{USPSFlags::Config::BASE_FLY / 1200}, #{USPSFlags::Config::BASE_FLY / 1800})">
74
- <path d="M 0 #{USPSFlags::Config::BASE_FLY / 600} #{past_line_one}" fill="#{@color_code}" />
74
+ <path d="M 0 #{USPSFlags::Config::BASE_FLY / 1200} #{past_line_one}" fill="#{@color_code}" />
75
75
  <path d="M #{@fly / 2} #{@hoist / 12} #{past_line_two}" fill="#{@past_mid_color}" />
76
76
  <path d="M #{@fly * 3 / 4} #{@hoist * 3 / 24} #{past_line_three}" fill="#{@past_tail_color}" />
77
77
  <path d="M 0 0 #{past_line_four} z" fill="none" stroke="#000000" stroke-width="#{USPSFlags::Config::BASE_FLY / 600}" />
@@ -54,7 +54,7 @@ class USPSFlags
54
54
  <<~SVG
55
55
  <?xml version="1.0" standalone="no"?>
56
56
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
57
- <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="#{@width}" height="#{@height}" viewBox="0 0 #{@view_width} #{@view_height}" preserveAspectRatio="xMidYMid meet">
57
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="#{@width}" height="#{@height}" viewBox="-#{@view_width * 0.001} -#{@view_height * 0.002} #{@view_width * 1.004} #{@view_height * 1.005}" preserveAspectRatio="xMidYMid meet">
58
58
  <title>#{@title}</title>
59
59
  <metadata>
60
60
  <desc id="created-by">Julian Fiander</desc>
@@ -24,13 +24,14 @@ class USPSFlags
24
24
  end
25
25
 
26
26
  def special(type, level:, field: true)
27
+ translate = (type == :f && level == :n) || !field
27
28
  # Paths were designed for a base fly of 3000 pixels, but the base was changed for more useful fractions.
28
29
  svg = +''
29
- svg << "<g transform=\"translate(#{USPSFlags::Config::BASE_FLY / 10})\">" unless field
30
+ svg << "<g transform=\"translate(#{USPSFlags::Config::BASE_FLY / 10})\">" if translate
30
31
  svg << "<g transform=\"scale(#{Rational(USPSFlags::Config::BASE_FLY, 3000).to_f})\">"
31
32
  svg << special_icon(type, level)
32
33
  svg << '</g>'
33
- svg << '</g>' unless field
34
+ svg << '</g>' if translate
34
35
 
35
36
  svg
36
37
  end
@@ -15,7 +15,7 @@ class USPSFlags
15
15
  @district_past = %w[PDLTC PDC]
16
16
  @district_elected = %w[D1LT DLTC DC]
17
17
  @district_swallowtail = %w[DLT DAIDE DFLT]
18
- @national_past = %w[PSTFC PRC PVC PCC]
18
+ @national_past = %w[PNFLT PSTFC PRC PVC PCC]
19
19
  @national_elected = %w[STFC RC VC CC]
20
20
  @national_swallowtail = %w[NAIDE NFLT]
21
21
  end
data/usps_flags.gemspec CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'usps_flags'
5
- s.version = '0.5.8'
6
- s.date = '2019-12-15'
5
+ s.version = '0.5.9'
6
+ s.date = '2019-12-16'
7
7
  s.summary = 'Flag generator for United States Power Squadrons'
8
8
  s.description = 'A flag image (PNG, SVG) generator for United States Power Squadrons.'
9
9
  s.homepage = 'http://rubygems.org/gems/usps_flags'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps_flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-15 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: file_utils