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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3f0bbdf432d280a7867fdf3d4cd42d9ea1a1f1bcbc155cb631b9629933d40b9
4
- data.tar.gz: 7e82ccfe0ba83c9664a4c95b5e6da40771a85a99becdf7c76cbd3e229bfc4039
3
+ metadata.gz: 0521b62207fb9d9d13206972bd4191d3bd8c22c29c7fe4a249e4029cecbbd010
4
+ data.tar.gz: e5d1f626ec6874f6cc64c3f8c0cb5d52f0a959d0d4a653f6415291d20c071ad8
5
5
  SHA512:
6
- metadata.gz: 42faccac2e3284d76b12bbd26b27812b23576ce4569d164481359ba856b789a88cbd42a674cbdf4014751d15d6227c87f769e28b52f35fef0989a4c50c7a2614
7
- data.tar.gz: c88594bb16de059b7cf7f7d3baa60934a007d413cef0c2323d480abaced05a9a2828e34f13ffc792ac5a9a5748329051b09b0f3227ffbddb186b284ba1352479
6
+ metadata.gz: dde0ed9cd1bcba8808fce3380fb399336a94c624b4ef06acc91eab146cd83abdc676e5cbfc320914875d8380ec54db3b8c75cb34e9c2f362f34cb288dfe7a0f6
7
+ data.tar.gz: 9d37013cb48d27b9b0137fece5c16525ae8acd153644cff363269aba2a74f47a49e58e2d6b27fe7dcf466fbd261fb2d020a2eaff459c1ddbe433ca778db6aa54
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps_flags (0.3.25)
4
+ usps_flags (0.3.26)
5
5
  file_utils (~> 1.1, >= 1.1.2)
6
6
  mini_magick (~> 4.8, >= 4.8.0)
7
7
  rubyzip (~> 1.2, >= 1.2.1)
@@ -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
- def png(svg, outfile: nil, trim: false)
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" << "none"
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
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'usps_flags'
3
- s.version = '0.3.25'
4
- s.date = '2019-04-17'
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.25
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-17 00:00:00.000000000 Z
11
+ date: 2019-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: file_utils