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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d04db88fa35d1d77607f2d5bae89654050d273456bd18b2cbeb16398df65823
4
- data.tar.gz: a67938502f0e98b24440f8b34773033d2306f390a2253577bf3469ac2dacb23f
3
+ metadata.gz: bed371b7ebafe55439d4e32bc76f7d827f6e451886cf36686468dbbcee68b5f0
4
+ data.tar.gz: 137519775477d52fe1cdb7868fee126aa77126fee16bebabf0a928180b4dacc2
5
5
  SHA512:
6
- metadata.gz: 4299127e49b38dac33d0f3000f6e95871468e6172b4eb7adac8d5b445d44eef2f154608fac209cbe0b0b772536dd72873c99b11b055acf1c03963a8ea51bd601
7
- data.tar.gz: 27230946ec311f81ac5457b1893322c990509686422d6c7286c87d1c64dd942f64201184ad7a837f0c0bec058f6fa9356aff1e8fce62d88d882fd3d97ca12120
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
@@ -8,3 +8,6 @@ notifications:
8
8
  email:
9
9
  on_success: change
10
10
  on_failure: always
11
+ script:
12
+ - bundle exec rubocop
13
+ - bundle exec rspec
data/Gemfile.lock CHANGED
@@ -1,17 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps_flags-grades (0.1.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
 
@@ -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::Grades
9
- require 'usps_flags/grades/grade'
10
- require 'usps_flags/grades/membership'
11
- require 'usps_flags/grades/edpro'
12
- require 'usps_flags/grades/merit_marks'
13
-
14
- ALL_CONFIGS ||= [
15
- [:s, false, nil], [:p, false, nil], [:ap, false, nil], [:ap, true, nil],
16
- [:jn, false, nil], [:jn, true, nil], [:n, false, nil], [:n, true, nil],
17
- [:sn, false, nil], [nil, false, :senior], [nil, false, :life]
18
- ].freeze
19
-
20
- # Constructor for generating grade insignia.
21
- #
22
- # @example Generate JN with EdPro and Senior Member
23
- # insignia = USPSFlags::Grades.new do |b|
24
- # b.grade = :jn
25
- # b.edpro = :edpro
26
- # b.membership = :senior
27
- # b.outfile = "/path/to/svg/output.svg"
28
- # end
29
- #
30
- # insignia.svg #=> Generates SVG file at "/path/to/svg/output.svg"
31
- def initialize(options = {})
32
- @grade = options[:grade]
33
- @edpro = options[:edpro] || false
34
- @membership = options[:membership]
35
- @merit_marks = options[:merit_marks] || 0
36
- @outfile = options[:outfile]
37
- @generated_at = Time.now.strftime('%Y%m%d.%H%S%z')
38
- yield self if block_given?
39
- end
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
- # Generates the descriptive title for the SVG.
69
- #
70
- # @return [String] Returns the descriptive title.
71
- def title
72
- grade = @grade.to_s.upcase
73
- edpro = ' - EdPro' if @edpro && @grade != :sn
74
- membership = case @membership
75
- when :senior
76
- ' - Senior Member'
77
- when :life
78
- ' - Life Member'
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
- "#{grade}#{edpro}#{membership}"
82
- end
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
- def self.all(dir = nil)
85
- dir ||= USPSFlags.configuration.flags_dir
85
+ def self.all(dir = nil)
86
+ dir ||= USPSFlags.configuration.flags_dir
86
87
 
87
- ALL_CONFIGS.each do |grade, edpro, membership|
88
- path = "#{dir}/#{grade}"
89
- path += '_edpro' if edpro
88
+ ALL_CONFIGS.each do |grade, edpro, membership|
89
+ path = "#{dir}/#{grade}"
90
+ path += '_edpro' if edpro
90
91
 
91
- insignia = USPSFlags::Grades.new(
92
- grade: grade, edpro: edpro, membership: membership,
93
- outfile: "#{path}.svg"
94
- )
92
+ insignia = USPSFlags::Grades.new(
93
+ grade: grade, edpro: edpro, membership: membership,
94
+ outfile: "#{path}.svg"
95
+ )
95
96
 
96
- USPSFlags::Generate.png(insignia.svg, outfile: "#{path}.png", trim: true)
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
- def validate
103
- validate_grade
104
- validate_edpro
105
- validate_membership
106
- end
103
+ def validate
104
+ validate_grade
105
+ validate_edpro
106
+ validate_membership
107
+ end
107
108
 
108
- def validate_grade
109
- return if @grade.nil? || USPSFlags::Grades::Grade.valid_grades.include?(@grade)
109
+ def validate_grade
110
+ return if @grade.nil? || USPSFlags::Grades::Grade.valid_grades.include?(@grade)
110
111
 
111
- raise USPSFlags::Errors::InvalidInsignia, "Unknown grade: #{@grade}"
112
- end
112
+ raise USPSFlags::Errors::InvalidInsignia, "Unknown grade: #{@grade}"
113
+ end
113
114
 
114
- def validate_edpro
115
- return if [true, false].include?(@edpro)
115
+ def validate_edpro
116
+ return if [true, false].include?(@edpro)
116
117
 
117
- raise USPSFlags::Errors::InvalidInsignia, 'EdPro must be boolean'
118
- end
118
+ raise USPSFlags::Errors::InvalidInsignia, 'EdPro must be boolean'
119
+ end
119
120
 
120
- def validate_membership
121
- return if [nil, :senior, :life].include?(@membership)
121
+ def validate_membership
122
+ return if [nil, :senior, :life].include?(@membership)
122
123
 
123
- raise USPSFlags::Errors::InvalidInsignia, "Unknown membership level: #{@membership}"
124
+ raise USPSFlags::Errors::InvalidInsignia, "Unknown membership level: #{@membership}"
125
+ end
124
126
  end
125
127
  end
@@ -3,7 +3,9 @@
3
3
  # Extension of USPSFlags::Config to for insignia config.
4
4
  #
5
5
  # @private
6
- class USPSFlags::Config
7
- GOLD ||= '#FFBF3F'
8
- GRADE_SPACING ||= 125
6
+ class USPSFlags
7
+ class Config
8
+ GOLD ||= '#FFBF3F'
9
+ GRADE_SPACING ||= 125
10
+ end
9
11
  end
@@ -4,20 +4,22 @@
4
4
  #
5
5
  # This class should never need to be called directly.
6
6
  # @private
7
- class USPSFlags::Grades::EdPro
8
- class << self
9
- def get(grade)
10
- unless for_grade(grade)
11
- raise USPSFlags::Errors::InvalidInsignia, 'EdPro is only valid for grades AP, JN, N'
12
- end
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
- <<~SVG
15
- <rect x="0" y="100" width="#{USPSFlags::Grades::Grade.width(grade)}" height="20" fill="#{USPSFlags::Config::GOLD}" />
16
- SVG
17
- end
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
- def for_grade(grade)
20
- %i[ap jn n].include?(grade)
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::Grades::Grade
8
- class << self
9
- def get(grade)
10
- return if grade.nil?
11
- raise USPSFlags::Errors::InvalidInsignia, "Unknown grade: #{grade}" unless valid_grades.include?(grade)
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
- send(grade)
14
- end
15
+ send(grade)
16
+ end
15
17
 
16
- def valid_grades
17
- %i[s p ap jn n sn]
18
- end
18
+ def valid_grades
19
+ %i[s p ap jn n sn]
20
+ end
19
21
 
20
- def width(grade)
21
- case grade
22
- when :ap
23
- USPSFlags::Config::GRADE_SPACING * 2.25 + 100
24
- when :jn
25
- USPSFlags::Config::GRADE_SPACING * 3 + 10
26
- when :n
27
- USPSFlags::Config::GRADE_SPACING * 5 + 45
28
- end
29
- end
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
- private
33
+ private
32
34
 
33
- def bar
34
- <<~SVG
35
- <rect x="0" y="0" width="100" height="35" fill="#{USPSFlags::Config::GOLD}" />
36
- SVG
37
- end
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
- def star
40
- <<~SVG
41
- <g transform="scale(0.33) translate(0, 150)">
42
- #{USPSFlags::Core::Icons::Star.new.svg.gsub('fill="#FFFFFF"', "fill=\"#{USPSFlags::Config::GOLD}\"")}
43
- </g>
44
- SVG
45
- end
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
- def s
48
- bar
49
- end
49
+ def s
50
+ bar
51
+ end
50
52
 
51
- def p
52
- <<~SVG
53
- #{bar}
54
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING})">#{bar}</g>
55
- SVG
56
- end
53
+ def p
54
+ <<~SVG
55
+ #{bar}
56
+ <g transform="translate(#{USPSFlags::Config::GRADE_SPACING})">#{bar}</g>
57
+ SVG
58
+ end
57
59
 
58
- def ap
59
- <<~SVG
60
- #{bar}
61
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 1.5 + 5})">#{star}</g>
62
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 2.25})">#{bar}</g>
63
- SVG
64
- end
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
- def jn
67
- <<~SVG
68
- <g transform="translate(60)">
69
- #{star}
70
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING / 2 + 25})">#{bar}</g>
71
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 2 + 20})">#{star}</g>
72
- </g>
73
- SVG
74
- end
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
- def n
77
- <<~SVG
78
- <g transform="translate(60)">
79
- #{star}
80
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING / 2 + 25})">#{bar}</g>
81
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 2 + 20})">#{star}</g>
82
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 3 - 10})">#{bar}</g>
83
- <g transform="translate(#{USPSFlags::Config::GRADE_SPACING * 4 + 50})">#{star}</g>
84
- </g>
85
- SVG
86
- end
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
- def sn
89
- box_width = USPSFlags::Grades::Grade.width(:n) + 60
90
- <<~SVG
91
- <rect x="20" y="-10" width="#{box_width}" height="155" fill=\"none\" stroke-width=\"20\" stroke=\"#{USPSFlags::Config::GOLD}\" />
92
- <g transform="translate(50, 50)">
93
- #{n}
94
- </g>
95
- SVG
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