parker 0.0.1 → 0.1.0

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: d6de19b17c3640302aaade18a9d582f9f722932c
4
- data.tar.gz: c48cf8251883eeee06758cf1ca2751668132e1a6
3
+ metadata.gz: '0709af93d92931305663713141fe6a67fb9699df'
4
+ data.tar.gz: 58bb11ca758aa66e6ccb6495eba785c901c1bcd8
5
5
  SHA512:
6
- metadata.gz: bc6d256b2e12b1fbdb0cd9e0b66d5bc9f173a8c0c130c0333481ce75c9c246828fb9c93e1e027907227c7cf877f7a656f18d9a8f969a8b3ecc09c3fce65810b1
7
- data.tar.gz: f4c8445a9b40b25f3499226303de72bb3e752e3fbdc82bc13d7e0ce8e5c3f9925d25f8e7121a2b8f604301cbde65b2287f7f83e3e732471a01929e8753286407
6
+ metadata.gz: f1a54c242f0ba0b815bfa6e7ca5342c5cc56e4617a8f19383b0b68b3643999bdc5d20faf72ab2d489d35a9176c656530d57a8c148abaddf6a80b8d9d47738915
7
+ data.tar.gz: f9fa4103f6319804bd295c8c9e823a76e35cdf5398b5dbb2433ce31116f1770d5632a48324c61fc58838fd17111991f96df81b9bad28f7ce29471dad64335080
data/bin/parker CHANGED
@@ -24,7 +24,6 @@ Usage:
24
24
  parker
25
25
  Options:
26
26
  EOS
27
- opt :config, 'Config file path', type: :string, default: File.join(source_directory, 'config.json')
28
27
  opt :destination, 'Output directory for screenshots', type: :string, default: Dir.pwd
29
28
  end
30
29
 
@@ -36,7 +35,7 @@ end
36
35
 
37
36
  platforms = []
38
37
 
39
- Dir.glob(File.join(source_directory, '*.json')).each do |path|
38
+ Dir.glob(File.join(source_directory, 'platforms', '*.json')).each do |path|
40
39
  platform_name = File.basename(path, File.extname(path)).capitalize
41
40
 
42
41
  if (platform_klass = Object.const_get("Parker::Platform::#{platform_name}"))
@@ -50,6 +49,11 @@ Dir.glob(File.join(source_directory, '*.json')).each do |path|
50
49
  end
51
50
  end
52
51
 
52
+ if platforms.empty?
53
+ puts "Nothing to do (no platforms found)."
54
+ exit
55
+ end
56
+
53
57
  output_path = File.expand_path(options[:destination])
54
58
  FileUtils.mkdir_p(output_path) unless Dir.exist?(output_path)
55
59
 
@@ -0,0 +1,46 @@
1
+ # Parker
2
+
3
+ This is a very simple tool for organising your video game screenshots. I _love_ my game screenshots, and like to have them neatly sorted by platform and game, but I might just be weird.
4
+
5
+ It currently supports 3 platforms: Steam, the Nintendo Switch, and the PS4. Please note: you'll still have to, y'know, actually copy them onto a disk somewhere yourself before running Parker. I wish this wasn't still a painful experience, but here we are.
6
+
7
+ ## Installation
8
+
9
+ Parker is built in Ruby as a gem, and thus:
10
+
11
+ > gem install parker
12
+
13
+ And done.
14
+
15
+ ## Usage
16
+
17
+ It's a very simple command-line tool - by default, Parker will try to copy your screenshots into the current directory, though you can provide an alternative with the `-d` option.
18
+
19
+ It will look for JSON configuration files with a name matching each game platform in its `~/.config/parker` directory:
20
+
21
+ - `~/.config/parker/steam.json`
22
+ - `~/.config/parker/switch.json`
23
+ - `~/.config/parker/playstation.json`
24
+
25
+ All config files share the same format:
26
+
27
+ ```json
28
+ {
29
+ "source_path": "/path/to/game/screenshots/",
30
+ "name": "My Steam Screenshots",
31
+ "games": {
32
+ "game_id_1": "Awesome Game",
33
+ "game_id_2": "Awesome Game 2: More Awesomer"
34
+ }
35
+ }
36
+ ```
37
+
38
+ Your config _must_ have a `source_path`, or Parker won't know where to look for screenshots, and that would be bad.
39
+
40
+ The optional `name` value will be used to name the parent directory housing each game (and so in the above example, if you were telling Parker to use `~/Pictures/Screenshots`, the above would copy games into `~/Pictures/Screenshots/My Steam Screenshots/Awesome Game`, etc. If left out, it defaults to a capitalised version of the platform name.
41
+
42
+ The key/value in the `games` section is required for every platform _except_ the Playstation (due to the layout of the screenshots on disk coming off the console, we can pull the game name for you). You can determine the game ID for Steam and Switch games based on the ID in the screenshot path, or the ending hash of the filename, respectively. This is less than ideal, but hey, it works for now.
43
+
44
+ It's possible that eventually I'd either add a way to look these up or keep a giant database of the mappings locally. Maybe.
45
+
46
+ And that's pretty much it. This is mostly for me, really, but I'd love to know if someone else finds it useful.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parker
4
- VERSION = '0.0.1'
4
+ VERSION = '0.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-04 00:00:00.000000000 Z
11
+ date: 2017-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop
@@ -34,6 +34,7 @@ extra_rdoc_files: []
34
34
  files:
35
35
  - bin/parker
36
36
  - lib/parker.rb
37
+ - lib/parker/README.md
37
38
  - lib/parker/game.rb
38
39
  - lib/parker/platform/base.rb
39
40
  - lib/parker/platform/playstation.rb