usps_flags 0.3.11 → 0.3.12

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
  SHA1:
3
- metadata.gz: 912c06bbc43cfe66768f59b678da12adaecd9964
4
- data.tar.gz: 44107e8638acf16858899949fc6b29198844f742
3
+ metadata.gz: d7b9c00b3cf12a17087af158aea2a2c73e5b90ec
4
+ data.tar.gz: 7ce70404b37e3818c41bbfeb87ecdea2ad556c5a
5
5
  SHA512:
6
- metadata.gz: eb93a2912820cc42b41a03d1c1deab2fb3caec1a2ccec47c9a0e2ab38e3e930ba1afbcf0510e22d1c6b6a032cdf2619bd4a6cebf413587938ad45a1d0c6b6688
7
- data.tar.gz: bf314db590a8cd310e92155ba5dba21a5bde8773c21ab37faf1d0c6428144a3e554a01dcd392e9b84b15a2269593e9c5143b96b3feb93ddc72a5136dff22f084
6
+ metadata.gz: 133aba211b5fba9f52345890bc0eac2534fe07cd37e3b6eabf310c3feeac704adb750fb542db2156f81b1b217ccfe4db16a5b1044bec073af06ee14436259c81
7
+ data.tar.gz: 00c054d326118ae0a8d330e2456b3f4cb42ba1545ad11957988986a6886f0e98c497a40b63f8a52f8dba7003e75c7cff81aa981f63d1545a08f01dfc9d9f110e
checksums.yaml.gz.sig CHANGED
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps_flags (0.3.11)
4
+ usps_flags (0.3.12)
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)
data/lib/usps_flags.rb CHANGED
@@ -49,11 +49,42 @@ class USPSFlags
49
49
  #
50
50
  # @private
51
51
  def self.ensure_directories
52
- ::FileUtils.rm_rf(@configuration.flags_dir) if @configuration.clear
52
+ self.get_dir_configs
53
+ self.prepare_dir_configs
54
+ self.prepare_flags_dir
55
+ ::FileUtils.mkdir_p(USPSFlags.configuration.log_path)
56
+ end
57
+
58
+ # Gets all configuration variables that specify a dir.
59
+ #
60
+ # @private
61
+ def self.get_dir_configs
62
+ @dirs = USPSFlags.configuration.
63
+ instance_variables.
64
+ map(&:to_s).
65
+ map { |v| v.match(/.*?_dir/) }.
66
+ reject! { |v| v.nil? }.
67
+ map(&:to_s)
68
+ end
69
+
70
+ # Ensures that directories exist (and are cleared, if configured).
71
+ #
72
+ # @private
73
+ def self.prepare_dir_configs
74
+ @dirs.each do |dir|
75
+ dir_path = @configuration.instance_variable_get(dir)
76
+ ::FileUtils.rm_rf(dir_path) if @configuration.clear
77
+ ::FileUtils.mkdir_p(dir_path)
78
+ end
79
+ end
80
+
81
+ # Ensures that the flags_dir subdirectories exist.
82
+ #
83
+ # @private
84
+ def self.prepare_flags_dir
53
85
  ::FileUtils.mkdir_p("#{@configuration.flags_dir}/PNG/insignia")
54
86
  ::FileUtils.mkdir_p("#{@configuration.flags_dir}/SVG/insignia")
55
87
  ::FileUtils.mkdir_p("#{@configuration.flags_dir}/ZIP")
56
- ::FileUtils.mkdir_p(USPSFlags.configuration.log_path)
57
88
  end
58
89
 
59
90
  # Constructor for individual flags.
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.11'
4
- s.date = '2017-11-08'
3
+ s.version = '0.3.12'
4
+ s.date = '2017-11-09'
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'
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps_flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander
@@ -30,7 +30,7 @@ cert_chain:
30
30
  3YzYAc+kXfD7kkzA2NMvLT6Q1v03qQyIZ8BS8SNk5wLGAdLM+IravFDLEs448fjz
31
31
  lEAU0RHLFVbE+CXW6makIlWGHR0=
32
32
  -----END CERTIFICATE-----
33
- date: 2017-11-08 00:00:00.000000000 Z
33
+ date: 2017-11-09 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: file_utils
metadata.gz.sig CHANGED
Binary file