usps_flags 0.1.17

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.
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe USPSFlags::Helpers do
4
+ describe "valid_flags" do
5
+ it "should return an Array" do
6
+ expect(USPSFlags::Helpers.valid_flags).to be_an(Array)
7
+ end
8
+
9
+ it "should return all officer flags but nothing else when given type :officer" do
10
+ expect(USPSFlags::Helpers.valid_flags(:officer)).to eql(%w[PLTC PC PORTCAP FLEETCAP LT FLT 1LT LTC CDR PDLTC PDC DLT DAIDE DFLT D1LT DLTC DC PSTFC PRC PVC PCC NAIDE NFLT STFC RC VC CC])
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,157 @@
1
+ require 'spec_helper'
2
+
3
+ describe USPSFlags do
4
+ before(:each) do
5
+ @flag = USPSFlags.new
6
+ end
7
+
8
+ describe "constructor" do
9
+ it "should update type" do
10
+ @flag.type "LtC"
11
+ expect(@flag.type).to eql("LtC")
12
+ end
13
+
14
+ it "should update scale" do
15
+ @flag.scale 4
16
+ expect(@flag.scale).to eql(4)
17
+ end
18
+
19
+ it "should update field" do
20
+ @flag.field false
21
+ expect(@flag.field).to eql(false)
22
+ end
23
+
24
+ it "should update trim" do
25
+ @flag.trim true
26
+ expect(@flag.trim).to eql(true)
27
+ end
28
+
29
+ it "should update svg_file" do
30
+ @flag.svg_file "/path/to/svg/output.svg"
31
+ expect(@flag.svg_file).to eql("/path/to/svg/output.svg")
32
+ end
33
+
34
+ it "should update png_file" do
35
+ @flag.png_file "/path/to/png/output.png"
36
+ expect(@flag.png_file).to eql("/path/to/png/output.png")
37
+ end
38
+
39
+ it "should construct and generate a flag" do
40
+ @flag.type "Cdr"
41
+ @flag.scale 5
42
+ @flag.svg_file ""
43
+
44
+ expect(@flag.svg).to eql(
45
+ <<~SVG
46
+ <?xml version="1.0" standalone="no"?>
47
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
48
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="614pt" height="409pt" viewBox="0 0 3072 2048" preserveAspectRatio="xMidYMid meet">
49
+ <metadata>Created by Julian Fiander (2017)</metadata>
50
+ <g transform="translate(-768, 192)">
51
+ <path d="M 1536 512
52
+ l 80 136
53
+ l -40 -8
54
+ l 0 896
55
+ l -80 0
56
+ l 0 -896
57
+ l -40 8
58
+ l 80 -136
59
+ " fill="#041E42" />
60
+ <path d="M 1296 1024
61
+ l 480 0
62
+ l 0 80
63
+ l -480 0
64
+ l 0 -80
65
+ " fill="#041E42" />
66
+ <path d="M 1296 1025
67
+ l 0 -432
68
+ l 120 136
69
+ l -40 0
70
+ l 0 296
71
+ " fill="#041E42" />
72
+ <path d="M 1776 1025
73
+ l 0 -432
74
+ l -120 136
75
+ l 40 0
76
+ l 0 296
77
+ " fill="#041E42" />
78
+ <path d="M 1392 1184
79
+ l 288 0
80
+ l 0 80
81
+ l -288 0
82
+ l 0 -80
83
+ " fill="#041E42" />
84
+ </g><g transform="translate(0, -193)">
85
+ <path d="M 1536 512
86
+ l 80 136
87
+ l -40 -8
88
+ l 0 896
89
+ l -80 0
90
+ l 0 -896
91
+ l -40 8
92
+ l 80 -136
93
+ " fill="#041E42" />
94
+ <path d="M 1296 1024
95
+ l 480 0
96
+ l 0 80
97
+ l -480 0
98
+ l 0 -80
99
+ " fill="#041E42" />
100
+ <path d="M 1296 1025
101
+ l 0 -432
102
+ l 120 136
103
+ l -40 0
104
+ l 0 296
105
+ " fill="#041E42" />
106
+ <path d="M 1776 1025
107
+ l 0 -432
108
+ l -120 136
109
+ l 40 0
110
+ l 0 296
111
+ " fill="#041E42" />
112
+ <path d="M 1392 1184
113
+ l 288 0
114
+ l 0 80
115
+ l -288 0
116
+ l 0 -80
117
+ " fill="#041E42" />
118
+ </g><g transform="translate(768, 192)">
119
+ <path d="M 1536 512
120
+ l 80 136
121
+ l -40 -8
122
+ l 0 896
123
+ l -80 0
124
+ l 0 -896
125
+ l -40 8
126
+ l 80 -136
127
+ " fill="#041E42" />
128
+ <path d="M 1296 1024
129
+ l 480 0
130
+ l 0 80
131
+ l -480 0
132
+ l 0 -80
133
+ " fill="#041E42" />
134
+ <path d="M 1296 1025
135
+ l 0 -432
136
+ l 120 136
137
+ l -40 0
138
+ l 0 296
139
+ " fill="#041E42" />
140
+ <path d="M 1776 1025
141
+ l 0 -432
142
+ l -120 136
143
+ l 40 0
144
+ l 0 296
145
+ " fill="#041E42" />
146
+ <path d="M 1392 1184
147
+ l 288 0
148
+ l 0 80
149
+ l -288 0
150
+ l 0 -80
151
+ " fill="#041E42" />
152
+ </g></svg>
153
+ SVG
154
+ )
155
+ end
156
+ end
157
+ end
@@ -0,0 +1,27 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'usps_flags'
3
+ s.version = '0.1.17'
4
+ s.date = '2017-10-18'
5
+ s.summary = 'Flag generator for United States Power Squadrons'
6
+ s.description = 'A flag image (PNG, SVG) generator for United States Power Squadrons.'
7
+ s.homepage = 'http://rubygems.org/gems/usps_flags'
8
+ s.license = 'GPL-3.0'
9
+ s.authors = ['Julian Fiander']
10
+ s.email = 'julian@fiander.one'
11
+ s.require_paths = ['lib', 'spec', 'doc']
12
+ s.files = `git ls-files`.split("\n").reject { |f| f.match /archive\/.*/ }
13
+ s.test_files = `git ls-files -- spec/*`.split("\n")
14
+
15
+ s.cert_chain = ['certs/jfiander.pem']
16
+ s.signing_key = File.expand_path("~/.ssh/usps_flags-private_key.pem") if $0 =~ /gem\z/
17
+
18
+ s.required_ruby_version = '~> 2.4'
19
+
20
+ s.add_runtime_dependency 'file_utils', '~> 1.1', '>= 1.1.2'
21
+ s.add_runtime_dependency 'mini_magick', '~> 4.8', '>= 4.8.0'
22
+ s.add_runtime_dependency 'rubyzip', '~> 1.2', '>= 1.2.1'
23
+
24
+ s.add_development_dependency 'rake', '~> 12.1', '>= 12.1.0'
25
+ s.add_development_dependency 'rspec', '~> 3.7', '>= 3.7.0'
26
+ s.add_development_dependency 'coveralls', '~> 0.8', '>= 0.8.21'
27
+ end
metadata ADDED
@@ -0,0 +1,223 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: usps_flags
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.17
5
+ platform: ruby
6
+ authors:
7
+ - Julian Fiander
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZqdWxp
14
+ YW4xFzAVBgoJkiaJk/IsZAEZFgdmaWFuZGVyMRMwEQYKCZImiZPyLGQBGRYDb25l
15
+ MB4XDTE3MTAxNzIwMzYwNVoXDTE4MTAxNzIwMzYwNVowPzEPMA0GA1UEAwwGanVs
16
+ aWFuMRcwFQYKCZImiZPyLGQBGRYHZmlhbmRlcjETMBEGCgmSJomT8ixkARkWA29u
17
+ ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKgyweLKJcXOZUJ/Y/fb
18
+ IjGIQzFgi0UUbIxc6BRP3BYCAr7MpflEq3sYaVsECs0ZyM27zLpyDN0oW73Wby6k
19
+ jaik/yBcsDMvrl58+6mjHnB3yIuk0BbEfQaijgMBzW2p0hToocMToMXigwZOGe4e
20
+ kPTAO6yTIIYLhhjWALA+nURCBcCNI8d1YAIjiEuF1lCr4pnV4aAq8tPBVrz7a8Fg
21
+ WpeLe0V1Blhkg9BDzNUmSrDxDxitO8oA5+A0z9Wm1xn8cJfn50103813SEK8gaXV
22
+ eb/zLRa/CNnTzQ8xUrySd10b1auLnKduXgewBhINcWYjDOT/C1FCjxpK5F6buJ6S
23
+ 1ukCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/F
24
+ wfSc4YJ3gO9EnkvjGcT6fE3WMB0GA1UdEQQWMBSBEmp1bGlhbkBmaWFuZGVyLm9u
25
+ ZTAdBgNVHRIEFjAUgRJqdWxpYW5AZmlhbmRlci5vbmUwDQYJKoZIhvcNAQEFBQAD
26
+ ggEBAHddpCbrFKtf02u/4MPzRQQO+uTP9vlbNDxseQsMvpjIIzMjJzANGBqPeI+V
27
+ HCjLEnKtnUi9br+RqjtQWWc2jGBdZwrlhOFglKUcTVn60ZvBNrByUj8PeBHQR3U2
28
+ vEKSi1v2i/jlVVvrk+9z4DZ4QdrfARBcPCZhUSZcZBsDbnzjMeX6lhoknnqKn/oi
29
+ op1Z8vhtFmvxNk4UfHMG1bdUoxl6DDXKfodqWM//9mARZwSyVX9oV7snFP0nKUaD
30
+ 3YzYAc+kXfD7kkzA2NMvLT6Q1v03qQyIZ8BS8SNk5wLGAdLM+IravFDLEs448fjz
31
+ lEAU0RHLFVbE+CXW6makIlWGHR0=
32
+ -----END CERTIFICATE-----
33
+ date: 2017-10-18 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: file_utils
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.1'
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 1.1.2
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
50
+ - !ruby/object:Gem::Version
51
+ version: '1.1'
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.1.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: mini_magick
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.8'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 4.8.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '4.8'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 4.8.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubyzip
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.2'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 1.2.1
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '1.2'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 1.2.1
95
+ - !ruby/object:Gem::Dependency
96
+ name: rake
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '12.1'
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 12.1.0
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '12.1'
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: 12.1.0
115
+ - !ruby/object:Gem::Dependency
116
+ name: rspec
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '3.7'
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 3.7.0
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.7'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 3.7.0
135
+ - !ruby/object:Gem::Dependency
136
+ name: coveralls
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '0.8'
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 0.8.21
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.8'
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: 0.8.21
155
+ description: A flag image (PNG, SVG) generator for United States Power Squadrons.
156
+ email: julian@fiander.one
157
+ executables: []
158
+ extensions: []
159
+ extra_rdoc_files: []
160
+ files:
161
+ - ".gitignore"
162
+ - ".rspec"
163
+ - ".travis.yml"
164
+ - ".yardoc/checksums"
165
+ - ".yardoc/complete"
166
+ - ".yardoc/object_types"
167
+ - ".yardoc/objects/root.dat"
168
+ - ".yardoc/proxy_types"
169
+ - ".yardopts"
170
+ - Gemfile
171
+ - Gemfile.lock
172
+ - LICENSE
173
+ - README.md
174
+ - Rakefile
175
+ - certs/jfiander.pem
176
+ - lib/rational.rb
177
+ - lib/usps_flags.rb
178
+ - lib/usps_flags/config.rb
179
+ - lib/usps_flags/core.rb
180
+ - lib/usps_flags/generate.rb
181
+ - lib/usps_flags/helpers.rb
182
+ - spec/rational_spec.rb
183
+ - spec/spec_helper.rb
184
+ - spec/usps_flags/config_spec.rb
185
+ - spec/usps_flags/core_spec.rb
186
+ - spec/usps_flags/generate_spec.rb
187
+ - spec/usps_flags/helpers_spec.rb
188
+ - spec/usps_flags_spec.rb
189
+ - usps_flags.gemspec
190
+ homepage: http://rubygems.org/gems/usps_flags
191
+ licenses:
192
+ - GPL-3.0
193
+ metadata: {}
194
+ post_install_message:
195
+ rdoc_options: []
196
+ require_paths:
197
+ - lib
198
+ - spec
199
+ - doc
200
+ required_ruby_version: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: '2.4'
205
+ required_rubygems_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ requirements: []
211
+ rubyforge_project:
212
+ rubygems_version: 2.6.11
213
+ signing_key:
214
+ specification_version: 4
215
+ summary: Flag generator for United States Power Squadrons
216
+ test_files:
217
+ - spec/rational_spec.rb
218
+ - spec/spec_helper.rb
219
+ - spec/usps_flags/config_spec.rb
220
+ - spec/usps_flags/core_spec.rb
221
+ - spec/usps_flags/generate_spec.rb
222
+ - spec/usps_flags/helpers_spec.rb
223
+ - spec/usps_flags_spec.rb
@@ -0,0 +1,2 @@
1
+ <j��ߍr���DK�2aB0)��L��L���c�,Ζ_k.y�J ��9~��U
2
+ N��%k ��t%��