usps_flags-grades 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +95 -0
- data/.travis.yml +3 -0
- data/Gemfile.lock +20 -1
- data/lib/usps_flags/grades.rb +102 -100
- data/lib/usps_flags/grades/config.rb +5 -3
- data/lib/usps_flags/grades/edpro.rb +14 -12
- data/lib/usps_flags/grades/grade.rb +81 -77
- data/lib/usps_flags/grades/membership.rb +128 -124
- data/lib/usps_flags/grades/merit_marks.rb +50 -54
- data/spec/usps_flags/grades_spec.rb +44 -43
- data/usps_flags-grades.gemspec +7 -5
- metadata +44 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bed371b7ebafe55439d4e32bc76f7d827f6e451886cf36686468dbbcee68b5f0
|
4
|
+
data.tar.gz: 137519775477d52fe1cdb7868fee126aa77126fee16bebabf0a928180b4dacc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7daf28c0211cb0c5ed8c5cf1fd826aadd0055d4fffb6950ce894f0f47374c4744b21502ae198fa134993e9f8aa5210fcaacb9a211bc5078ed33dbce85212ecd
|
7
|
+
data.tar.gz: 32eda0eae042cf09f6f92e7c7aaae66551ffbeb50d617611f95ca4843390e040e59b6f494b0ac55b3653bd8297b5a4ac18a6c25935c4b83027a866a631c3fc67
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
AllCops:
|
3
|
+
TargetRubyVersion: 2.5
|
4
|
+
Exclude:
|
5
|
+
- lib/output/*
|
6
|
+
- tmp/**/*
|
7
|
+
- vendor/**/*
|
8
|
+
|
9
|
+
Layout/IndentFirstHashElement:
|
10
|
+
EnforcedStyle: consistent
|
11
|
+
Layout/AccessModifierIndentation:
|
12
|
+
EnforcedStyle: outdent
|
13
|
+
Layout/EmptyLinesAroundAccessModifier:
|
14
|
+
Enabled: true
|
15
|
+
Layout/AlignArray:
|
16
|
+
Enabled: true
|
17
|
+
Layout/AlignHash:
|
18
|
+
Enabled: true
|
19
|
+
Layout/EmptyLineAfterGuardClause:
|
20
|
+
Enabled: true
|
21
|
+
Layout/SpaceInsideBlockBraces:
|
22
|
+
EnforcedStyle: space
|
23
|
+
EnforcedStyleForEmptyBraces: no_space
|
24
|
+
Layout/SpaceInsideHashLiteralBraces:
|
25
|
+
EnforcedStyle: space
|
26
|
+
EnforcedStyleForEmptyBraces: no_space
|
27
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
28
|
+
EnforcedStyle: no_space
|
29
|
+
Layout/EndAlignment:
|
30
|
+
EnforcedStyleAlignWith: start_of_line
|
31
|
+
|
32
|
+
Lint/UnusedMethodArgument:
|
33
|
+
Enabled: true
|
34
|
+
Lint/UselessAssignment:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
Metrics/BlockLength:
|
38
|
+
Exclude:
|
39
|
+
- 'spec/**/*.rb'
|
40
|
+
Metrics/LineLength:
|
41
|
+
Max: 120
|
42
|
+
Metrics/MethodLength:
|
43
|
+
Enabled: true
|
44
|
+
Metrics/ClassLength:
|
45
|
+
Enabled: true
|
46
|
+
Max: 125
|
47
|
+
Metrics/ParameterLists:
|
48
|
+
Enabled: true
|
49
|
+
Metrics/CyclomaticComplexity:
|
50
|
+
Enabled: true
|
51
|
+
Metrics/AbcSize:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Naming/UncommunicativeMethodParamName:
|
55
|
+
Enabled: false
|
56
|
+
Naming/AccessorMethodName:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
RSpec/MessageSpies:
|
60
|
+
EnforcedStyle: receive
|
61
|
+
RSpec/InstanceVariable:
|
62
|
+
Enabled: false
|
63
|
+
RSpec/NestedGroups:
|
64
|
+
Enabled: false
|
65
|
+
RSpec/ExampleLength:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Style/Documentation:
|
69
|
+
Enabled: false
|
70
|
+
Style/FrozenStringLiteralComment:
|
71
|
+
Enabled: true
|
72
|
+
Style/NumericLiterals:
|
73
|
+
Enabled: true
|
74
|
+
Style/StringLiterals:
|
75
|
+
EnforcedStyle: single_quotes
|
76
|
+
Style/AndOr:
|
77
|
+
Enabled: true
|
78
|
+
Style/ClassCheck:
|
79
|
+
Enabled: true
|
80
|
+
Style/GuardClause:
|
81
|
+
Enabled: true
|
82
|
+
Style/ClassAndModuleChildren:
|
83
|
+
EnforcedStyle: nested
|
84
|
+
Style/GlobalVars:
|
85
|
+
Exclude:
|
86
|
+
- 'spec/**/*.rb'
|
87
|
+
Style/ParallelAssignment:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
Security/Eval:
|
91
|
+
Enabled: true
|
92
|
+
Security/JSONLoad:
|
93
|
+
Enabled: true
|
94
|
+
Security/YAMLLoad:
|
95
|
+
Enabled: true
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
usps_flags-grades (0.1.
|
4
|
+
usps_flags-grades (0.1.2)
|
5
5
|
usps_flags (~> 0.5, >= 0.5.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
ast (2.4.0)
|
10
11
|
diff-lcs (1.3)
|
11
12
|
docile (1.1.5)
|
12
13
|
file_utils (1.1.2)
|
14
|
+
jaro_winkler (1.5.2)
|
13
15
|
json (2.1.0)
|
14
16
|
mini_magick (4.9.3)
|
17
|
+
parallel (1.17.0)
|
18
|
+
parser (2.6.3.0)
|
19
|
+
ast (~> 2.4.0)
|
20
|
+
rainbow (3.0.0)
|
15
21
|
rake (12.2.1)
|
16
22
|
rspec (3.7.0)
|
17
23
|
rspec-core (~> 3.7.0)
|
@@ -26,12 +32,23 @@ GEM
|
|
26
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
33
|
rspec-support (~> 3.7.0)
|
28
34
|
rspec-support (3.7.0)
|
35
|
+
rubocop (0.71.0)
|
36
|
+
jaro_winkler (~> 1.5.1)
|
37
|
+
parallel (~> 1.10)
|
38
|
+
parser (>= 2.6)
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
40
|
+
ruby-progressbar (~> 1.7)
|
41
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
42
|
+
rubocop-rspec (1.33.0)
|
43
|
+
rubocop (>= 0.60.0)
|
44
|
+
ruby-progressbar (1.10.1)
|
29
45
|
rubyzip (1.2.3)
|
30
46
|
simplecov (0.15.1)
|
31
47
|
docile (~> 1.1.0)
|
32
48
|
json (>= 1.8, < 3)
|
33
49
|
simplecov-html (~> 0.10.0)
|
34
50
|
simplecov-html (0.10.2)
|
51
|
+
unicode-display_width (1.6.0)
|
35
52
|
usps_flags (0.5.1)
|
36
53
|
file_utils (~> 1.1, >= 1.1.2)
|
37
54
|
mini_magick (~> 4.8, >= 4.8.0)
|
@@ -43,6 +60,8 @@ PLATFORMS
|
|
43
60
|
DEPENDENCIES
|
44
61
|
rake (~> 12.2, >= 12.2.1)
|
45
62
|
rspec (~> 3.7, >= 3.7.0)
|
63
|
+
rubocop (~> 0.71, >= 0.71.0)
|
64
|
+
rubocop-rspec (~> 1.30, >= 1.30.0)
|
46
65
|
simplecov (~> 0.15, >= 0.15.1)
|
47
66
|
usps_flags-grades!
|
48
67
|
|
data/lib/usps_flags/grades.rb
CHANGED
@@ -5,121 +5,123 @@ require 'usps_flags/grades/config'
|
|
5
5
|
require 'usps_flags/grades/errors'
|
6
6
|
|
7
7
|
# Main class for generating grade and other insignia.
|
8
|
-
class USPSFlags
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
attr_accessor :grade
|
42
|
-
attr_accessor :edpro
|
43
|
-
attr_accessor :membership
|
44
|
-
attr_accessor :merit_marks
|
45
|
-
attr_accessor :outfile
|
46
|
-
|
47
|
-
# Generates the constructed file as SVG.
|
48
|
-
#
|
49
|
-
# @return [String] Returns the SVG file output path, or the svg data if no path was specified.
|
50
|
-
def svg
|
51
|
-
validate
|
52
|
-
@svg = <<~SVG
|
53
|
-
#{USPSFlags::Core.headers(title: title).gsub('0 0 3072 2048', '0 0 1024 682')}
|
54
|
-
<g transform="translate(0, 50)">
|
55
|
-
#{USPSFlags::Grades::Grade.get(@grade)}
|
56
|
-
#{USPSFlags::Grades::EdPro.get(@grade) if @edpro && USPSFlags::Grades::EdPro.for_grade(@grade)}
|
57
|
-
#{USPSFlags::Grades::Membership.get(@membership) unless @membership.nil?}
|
58
|
-
</g>
|
59
|
-
<g transform="translate(0, 450)">
|
60
|
-
#{USPSFlags::Grades::MeritMarks.get(@merit_marks)}
|
61
|
-
</g>
|
62
|
-
#{USPSFlags::Core.footer}
|
63
|
-
SVG
|
64
|
-
|
65
|
-
USPSFlags::Helpers.output(@svg, outfile: @outfile)
|
66
|
-
end
|
8
|
+
class USPSFlags
|
9
|
+
class Grades
|
10
|
+
require 'usps_flags/grades/grade'
|
11
|
+
require 'usps_flags/grades/membership'
|
12
|
+
require 'usps_flags/grades/edpro'
|
13
|
+
require 'usps_flags/grades/merit_marks'
|
14
|
+
|
15
|
+
ALL_CONFIGS ||= [
|
16
|
+
[:s, false, nil], [:p, false, nil], [:ap, false, nil], [:ap, true, nil],
|
17
|
+
[:jn, false, nil], [:jn, true, nil], [:n, false, nil], [:n, true, nil],
|
18
|
+
[:sn, false, nil], [nil, false, :senior], [nil, false, :life]
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
# Constructor for generating grade insignia.
|
22
|
+
#
|
23
|
+
# @example Generate JN with EdPro and Senior Member
|
24
|
+
# insignia = USPSFlags::Grades.new do |b|
|
25
|
+
# b.grade = :jn
|
26
|
+
# b.edpro = :edpro
|
27
|
+
# b.membership = :senior
|
28
|
+
# b.outfile = "/path/to/svg/output.svg"
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# insignia.svg #=> Generates SVG file at "/path/to/svg/output.svg"
|
32
|
+
def initialize(options = {})
|
33
|
+
@grade = options[:grade]
|
34
|
+
@edpro = options[:edpro] || false
|
35
|
+
@membership = options[:membership]
|
36
|
+
@merit_marks = options[:merit_marks] || 0
|
37
|
+
@outfile = options[:outfile]
|
38
|
+
@generated_at = Time.now.strftime('%Y%m%d.%H%S%z')
|
39
|
+
yield self if block_given?
|
40
|
+
end
|
67
41
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
42
|
+
attr_accessor :grade
|
43
|
+
attr_accessor :edpro
|
44
|
+
attr_accessor :membership
|
45
|
+
attr_accessor :merit_marks
|
46
|
+
attr_accessor :outfile
|
47
|
+
|
48
|
+
# Generates the constructed file as SVG.
|
49
|
+
#
|
50
|
+
# @return [String] Returns the SVG file output path, or the svg data if no path was specified.
|
51
|
+
def svg
|
52
|
+
validate
|
53
|
+
@svg = <<~SVG
|
54
|
+
#{USPSFlags::Core.headers(title: title).gsub('0 0 3072 2048', '0 0 1024 682')}
|
55
|
+
<g transform="translate(0, 50)">
|
56
|
+
#{USPSFlags::Grades::Grade.get(@grade)}
|
57
|
+
#{USPSFlags::Grades::EdPro.get(@grade) if @edpro && USPSFlags::Grades::EdPro.for_grade(@grade)}
|
58
|
+
#{USPSFlags::Grades::Membership.get(@membership) unless @membership.nil?}
|
59
|
+
</g>
|
60
|
+
<g transform="translate(0, 450)">
|
61
|
+
#{USPSFlags::Grades::MeritMarks.get(@merit_marks)}
|
62
|
+
</g>
|
63
|
+
#{USPSFlags::Core.footer}
|
64
|
+
SVG
|
65
|
+
|
66
|
+
USPSFlags::Helpers.output(@svg, outfile: @outfile)
|
79
67
|
end
|
80
68
|
|
81
|
-
|
82
|
-
|
69
|
+
# Generates the descriptive title for the SVG.
|
70
|
+
#
|
71
|
+
# @return [String] Returns the descriptive title.
|
72
|
+
def title
|
73
|
+
grade = @grade.to_s.upcase
|
74
|
+
edpro = ' - EdPro' if @edpro && @grade != :sn
|
75
|
+
membership = case @membership
|
76
|
+
when :senior
|
77
|
+
' - Senior Member'
|
78
|
+
when :life
|
79
|
+
' - Life Member'
|
80
|
+
end
|
81
|
+
|
82
|
+
"#{grade}#{edpro}#{membership}"
|
83
|
+
end
|
83
84
|
|
84
|
-
|
85
|
-
|
85
|
+
def self.all(dir = nil)
|
86
|
+
dir ||= USPSFlags.configuration.flags_dir
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
88
|
+
ALL_CONFIGS.each do |grade, edpro, membership|
|
89
|
+
path = "#{dir}/#{grade}"
|
90
|
+
path += '_edpro' if edpro
|
90
91
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
insignia = USPSFlags::Grades.new(
|
93
|
+
grade: grade, edpro: edpro, membership: membership,
|
94
|
+
outfile: "#{path}.svg"
|
95
|
+
)
|
95
96
|
|
96
|
-
|
97
|
+
USPSFlags::Generate.png(insignia.svg, outfile: "#{path}.png", trim: true)
|
98
|
+
end
|
97
99
|
end
|
98
|
-
end
|
99
100
|
|
100
|
-
private
|
101
|
+
private
|
101
102
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
def validate
|
104
|
+
validate_grade
|
105
|
+
validate_edpro
|
106
|
+
validate_membership
|
107
|
+
end
|
107
108
|
|
108
|
-
|
109
|
-
|
109
|
+
def validate_grade
|
110
|
+
return if @grade.nil? || USPSFlags::Grades::Grade.valid_grades.include?(@grade)
|
110
111
|
|
111
|
-
|
112
|
-
|
112
|
+
raise USPSFlags::Errors::InvalidInsignia, "Unknown grade: #{@grade}"
|
113
|
+
end
|
113
114
|
|
114
|
-
|
115
|
-
|
115
|
+
def validate_edpro
|
116
|
+
return if [true, false].include?(@edpro)
|
116
117
|
|
117
|
-
|
118
|
-
|
118
|
+
raise USPSFlags::Errors::InvalidInsignia, 'EdPro must be boolean'
|
119
|
+
end
|
119
120
|
|
120
|
-
|
121
|
-
|
121
|
+
def validate_membership
|
122
|
+
return if [nil, :senior, :life].include?(@membership)
|
122
123
|
|
123
|
-
|
124
|
+
raise USPSFlags::Errors::InvalidInsignia, "Unknown membership level: #{@membership}"
|
125
|
+
end
|
124
126
|
end
|
125
127
|
end
|
@@ -4,20 +4,22 @@
|
|
4
4
|
#
|
5
5
|
# This class should never need to be called directly.
|
6
6
|
# @private
|
7
|
-
class USPSFlags
|
8
|
-
class
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
class USPSFlags
|
8
|
+
class Grades
|
9
|
+
class EdPro
|
10
|
+
class << self
|
11
|
+
def get(grade)
|
12
|
+
raise USPSFlags::Errors::InvalidInsignia, 'EdPro is only valid for grades AP, JN, N' unless for_grade(grade)
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
<<~SVG
|
15
|
+
<rect x="0" y="100" width="#{USPSFlags::Grades::Grade.width(grade)}" height="20" fill="#{USPSFlags::Config::GOLD}" />
|
16
|
+
SVG
|
17
|
+
end
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
def for_grade(grade)
|
20
|
+
%i[ap jn n].include?(grade)
|
21
|
+
end
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -4,95 +4,99 @@
|
|
4
4
|
#
|
5
5
|
# This class should never need to be called directly.
|
6
6
|
# @private
|
7
|
-
class USPSFlags
|
8
|
-
class
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
class USPSFlags
|
8
|
+
class Grades
|
9
|
+
class Grade
|
10
|
+
class << self
|
11
|
+
def get(grade)
|
12
|
+
return if grade.nil?
|
13
|
+
raise USPSFlags::Errors::InvalidInsignia, "Unknown grade: #{grade}" unless valid_grades.include?(grade)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
send(grade)
|
16
|
+
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
def valid_grades
|
19
|
+
%i[s p ap jn n sn]
|
20
|
+
end
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
def width(grade)
|
23
|
+
case grade
|
24
|
+
when :ap
|
25
|
+
USPSFlags::Config::GRADE_SPACING * 2.25 + 100
|
26
|
+
when :jn
|
27
|
+
USPSFlags::Config::GRADE_SPACING * 3 + 10
|
28
|
+
when :n
|
29
|
+
USPSFlags::Config::GRADE_SPACING * 5 + 45
|
30
|
+
end
|
31
|
+
end
|
30
32
|
|
31
|
-
|
33
|
+
private
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
def bar
|
36
|
+
<<~SVG
|
37
|
+
<rect x="0" y="0" width="100" height="35" fill="#{USPSFlags::Config::GOLD}" />
|
38
|
+
SVG
|
39
|
+
end
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
def star
|
42
|
+
<<~SVG
|
43
|
+
<g transform="scale(0.33) translate(0, 150)">
|
44
|
+
#{USPSFlags::Core::Icons::Star.new.svg.gsub('fill="#FFFFFF"', "fill=\"#{USPSFlags::Config::GOLD}\"")}
|
45
|
+
</g>
|
46
|
+
SVG
|
47
|
+
end
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
49
|
+
def s
|
50
|
+
bar
|
51
|
+
end
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
def p
|
54
|
+
<<~SVG
|
55
|
+
#{bar}
|
56
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING})">#{bar}</g>
|
57
|
+
SVG
|
58
|
+
end
|
57
59
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
def ap
|
61
|
+
<<~SVG
|
62
|
+
#{bar}
|
63
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 1.5 + 5})">#{star}</g>
|
64
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 2.25})">#{bar}</g>
|
65
|
+
SVG
|
66
|
+
end
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
def jn
|
69
|
+
<<~SVG
|
70
|
+
<g transform="translate(60)">
|
71
|
+
#{star}
|
72
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING / 2 + 25})">#{bar}</g>
|
73
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 2 + 20})">#{star}</g>
|
74
|
+
</g>
|
75
|
+
SVG
|
76
|
+
end
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
78
|
+
def n
|
79
|
+
<<~SVG
|
80
|
+
<g transform="translate(60)">
|
81
|
+
#{star}
|
82
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING / 2 + 25})">#{bar}</g>
|
83
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 2 + 20})">#{star}</g>
|
84
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 3 - 10})">#{bar}</g>
|
85
|
+
<g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 4 + 50})">#{star}</g>
|
86
|
+
</g>
|
87
|
+
SVG
|
88
|
+
end
|
87
89
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
90
|
+
def sn
|
91
|
+
box_width = USPSFlags::Grades::Grade.width(:n) + 60
|
92
|
+
<<~SVG
|
93
|
+
<rect x="20" y="-10" width="#{box_width}" height="155" fill=\"none\" stroke-width=\"20\" stroke=\"#{USPSFlags::Config::GOLD}\" />
|
94
|
+
<g transform="translate(50, 50)">
|
95
|
+
#{n}
|
96
|
+
</g>
|
97
|
+
SVG
|
98
|
+
end
|
99
|
+
end
|
96
100
|
end
|
97
101
|
end
|
98
102
|
end
|