parker 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '0709af93d92931305663713141fe6a67fb9699df'
4
- data.tar.gz: 58bb11ca758aa66e6ccb6495eba785c901c1bcd8
3
+ metadata.gz: 4e496261dcf8e6181289e2eabaad1a6ac16bc238
4
+ data.tar.gz: fd1c11d057521bdaf12d470ff654822dd1638e23
5
5
  SHA512:
6
- metadata.gz: f1a54c242f0ba0b815bfa6e7ca5342c5cc56e4617a8f19383b0b68b3643999bdc5d20faf72ab2d489d35a9176c656530d57a8c148abaddf6a80b8d9d47738915
7
- data.tar.gz: f9fa4103f6319804bd295c8c9e823a76e35cdf5398b5dbb2433ce31116f1770d5632a48324c61fc58838fd17111991f96df81b9bad28f7ce29471dad64335080
6
+ metadata.gz: b92cd4a72815a0558614fca965d3a64d088ce4dbb2c77eb96b826e0a118013411185ca88248358d215b9d24aee043e43f4394fa11b987410e2149a9830c1639d
7
+ data.tar.gz: b535019274ff951e15b5aae14d45e9e7b9232cb13a6ba26d977051a6e14eb399c9915ffc46cc84f02302acbd0786f14ca42076195477429a826197ff17959d60
data/bin/parker CHANGED
@@ -57,15 +57,23 @@ end
57
57
  output_path = File.expand_path(options[:destination])
58
58
  FileUtils.mkdir_p(output_path) unless Dir.exist?(output_path)
59
59
 
60
- puts "Copying screenshots to #{output_path}..."
60
+ puts "Scanning..."
61
61
 
62
62
  platforms.each do |platform|
63
63
  platform.games.each_value do |game|
64
64
  if game.screenshots.length > 0
65
- puts "- Scanning #{game.name} (#{platform.name})"
66
- game.copy_screenshots(File.join(output_path, platform.name))
65
+ print "- #{game.name} (#{platform.name}): "
66
+
67
+ platform_path = File.join(output_path, platform.name)
68
+ copied_count = game.copy_screenshots(platform_path)
69
+
70
+ if copied_count > 0
71
+ puts "Copied #{copied_count} new screenshot#{'s' unless copied_count == 1}."
72
+ else
73
+ puts '✓'
74
+ end
67
75
  end
68
76
  end
69
77
  end
70
78
 
71
- puts "Done!"
79
+ puts "\nDone!"
data/lib/parker.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  $LOAD_PATH.unshift(__dir__)
4
4
 
5
+ require 'fileutils'
5
6
  require 'json'
6
7
 
7
8
  require 'parker/game'
data/lib/parker/game.rb CHANGED
@@ -8,6 +8,8 @@ module Parker
8
8
  end
9
9
 
10
10
  def copy_screenshots(output_path)
11
+ copied_screenshots = 0
12
+
11
13
  screenshots.each do |screenshot|
12
14
  platform_path = File.join(output_path, name)
13
15
  new_file_path = File.join(platform_path, screenshot.filename)
@@ -16,7 +18,11 @@ module Parker
16
18
 
17
19
  FileUtils.mkdir(platform_path) unless Dir.exist?(platform_path)
18
20
  FileUtils.cp(screenshot.path, new_file_path)
21
+
22
+ copied_screenshots += 1
19
23
  end
24
+
25
+ copied_screenshots
20
26
  end
21
27
  end
22
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parker
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan