usps_flags 0.3.25 → 0.3.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/usps_flags/generate.rb +4 -4
- data/spec/usps_flags/generate_spec.rb +4 -0
- data/usps_flags.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0521b62207fb9d9d13206972bd4191d3bd8c22c29c7fe4a249e4029cecbbd010
|
4
|
+
data.tar.gz: e5d1f626ec6874f6cc64c3f8c0cb5d52f0a959d0d4a653f6415291d20c071ad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dde0ed9cd1bcba8808fce3380fb399336a94c624b4ef06acc91eab146cd83abdc676e5cbfc320914875d8380ec54db3b8c75cb34e9c2f362f34cb288dfe7a0f6
|
7
|
+
data.tar.gz: 9d37013cb48d27b9b0137fece5c16525ae8acd153644cff363269aba2a74f47a49e58e2d6b27fe7dcf466fbd261fb2d020a2eaff459c1ddbe433ca778db6aa54
|
data/Gemfile.lock
CHANGED
data/lib/usps_flags/generate.rb
CHANGED
@@ -31,7 +31,8 @@ class USPSFlags::Generate
|
|
31
31
|
# @param [String] svg The SVG data.
|
32
32
|
# @param [String] outfile The path to save the PNG file to. (Required because the file is not accessible if this is left blank.)
|
33
33
|
# @param [Boolean] trim Whether to trim the generated PNG file of excess transparency.
|
34
|
-
|
34
|
+
# @param [String] background Background color. Defaults to 'none' (transparent).
|
35
|
+
def png(svg, outfile: nil, trim: false, background: 'none')
|
35
36
|
raise USPSFlags::Errors::PNGGenerationError, svg: svg if outfile.nil? || outfile.empty?
|
36
37
|
|
37
38
|
set_temp_svg(svg)
|
@@ -39,7 +40,7 @@ class USPSFlags::Generate
|
|
39
40
|
USPSFlags::Helpers.ensure_dir_for_file(outfile)
|
40
41
|
|
41
42
|
MiniMagick::Tool::Convert.new do |convert|
|
42
|
-
convert << "-background" <<
|
43
|
+
convert << "-background" << background
|
43
44
|
convert << "-format" << "png"
|
44
45
|
convert << "-trim" if trim
|
45
46
|
convert << @temp_svg_path
|
@@ -194,8 +195,7 @@ class USPSFlags::Generate
|
|
194
195
|
end
|
195
196
|
|
196
197
|
def delete_temp_svg?
|
197
|
-
!@temp_svg_path.to_s.empty? &&
|
198
|
-
::File.exist?(@temp_svg_path)
|
198
|
+
!@temp_svg_path.to_s.empty? && ::File.exist?(@temp_svg_path)
|
199
199
|
end
|
200
200
|
|
201
201
|
def generate_static_png
|
@@ -72,6 +72,10 @@ describe USPSFlags::Generate do
|
|
72
72
|
expect(USPSFlags::Generate.spec(outfile: "")).to include("<title>USPS Trident Specifications</title>")
|
73
73
|
end
|
74
74
|
|
75
|
+
it "should generate the trident specification sheet with a scaled border" do
|
76
|
+
expect(USPSFlags::Generate.spec(outfile: "", scaled_border: true)).to include("<title>USPS Trident Specifications</title>")
|
77
|
+
end
|
78
|
+
|
75
79
|
it "should generate the trident specification sheet with a fractional field size" do
|
76
80
|
expect(USPSFlags::Generate.spec(outfile: "", fly: 23.5)).to include("<title>USPS Trident Specifications</title>")
|
77
81
|
end
|
data/usps_flags.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'usps_flags'
|
3
|
-
s.version = '0.3.
|
4
|
-
s.date = '2019-04-
|
3
|
+
s.version = '0.3.26'
|
4
|
+
s.date = '2019-04-22'
|
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'
|
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.3.
|
4
|
+
version: 0.3.26
|
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-04-
|
11
|
+
date: 2019-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: file_utils
|