desoto-photoapp 0.5.1 → 0.5.2

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: 185ccf03bd22737b9e08a24a510eca676756d8ca
4
- data.tar.gz: 38c4d6902e24c4965bf2324c40ac6741a963b3ea
3
+ metadata.gz: d5949131739e516e163c03bd44c2fd32a4e800dc
4
+ data.tar.gz: eba38bdd03a9f1e1169209c2e1ee8aec3bad00c6
5
5
  SHA512:
6
- metadata.gz: 36c34a300be4d316241780afcfc536d9ab2d310c377af6d6cde6ec94cae1a46fb11e17b2e0b0c8b1cc66337605c5c90c08e6dade2295264a82b2c8ffce9d1509
7
- data.tar.gz: af9a815ca6ab03c3d5a4fde02c6ff40d86200fe499a2936144005486c5bc9e954b82b5e5c21916ccca6cdb2a240bb1b6dce88e38733b4b5ff5e6ee8f82622277
6
+ metadata.gz: ce5c5d075f1920ac9a0627aadd7aba2b8e0b40d4fdbb3544ae7e39b7ca5f11fb1fbfa002147769598885c06966ecd9f565e3cc73dec0b32cb2120f9f9e4a91f4
7
+ data.tar.gz: d584d96845fa977832d0ed00fa4da872f710dc39becb832c193277abf5b84fa960062c4dea1f56e33c32ebc0a5e2c730c287cdd4b67856e50bbb489a978e3e99
@@ -1,3 +1,4 @@
1
1
  source ~/.bash_profile
2
2
  photoapp process
3
3
  photoapp upload
4
+ photoapp import_alt
@@ -115,6 +115,8 @@ when 'reprint'
115
115
  Photoapp::Session.new(options).reprint
116
116
  when 'import'
117
117
  Photoapp::Session.new(options).import
118
+ when 'import_alt'
119
+ Photoapp::Session.new(options).import_alt
118
120
  when 'print'
119
121
  Photoapp::Session.new(options).print
120
122
  when 'optimize'
@@ -52,8 +52,11 @@ module Photoapp
52
52
  'upload' => 'upload',
53
53
  'upload_queue' => 'upload_queue',
54
54
  'print' => 'print',
55
+ 'print_duplicate' => false,
55
56
  'photos_import' => 'photos_import',
56
- 'reprint' => 'reprint'
57
+ 'import_alt' => false,
58
+ 'reprint' => 'reprint',
59
+ 'interval' => 60
57
60
  }
58
61
 
59
62
  config_file = root(options['config'] || config['config'])
@@ -69,6 +72,8 @@ module Photoapp
69
72
  config['print'] = root(config['print'])
70
73
  config['photos_import'] = root(config['photos_import'])
71
74
  config['reprint'] = root(config['reprint'])
75
+ config['import_alt'] = File.expand_path(config['import_alt']) if config['import_alt']
76
+ config['print_duplicate'] = File.expand_path(config['print_duplicate']) if config['print_duplicate']
72
77
 
73
78
  config
74
79
  end
@@ -106,9 +111,14 @@ module Photoapp
106
111
  end
107
112
  end
108
113
 
114
+ def import_alt
115
+ import(config['import_alt']) if config['import_alt']
116
+ end
117
+
109
118
  # Import to Photos.app via AppleScript
110
- def import
111
- script = %Q{osascript -e 'set filePosixPath to "#{config['photos_import']}"
119
+ def import(path=nil)
120
+ path ||= config['photos_import']
121
+ script = %Q{osascript -e 'set filePosixPath to "#{path}"
112
122
  set importFolder to (POSIX file filePosixPath) as alias
113
123
 
114
124
  set extensionsList to {"jpg", "jpeg"}
@@ -128,7 +138,7 @@ if (count of theFiles) > 0 then
128
138
  end tell
129
139
  end if'}
130
140
  `#{script}`
131
- FileUtils.rm_rf config['photos_import']
141
+ FileUtils.rm load_photos(config['photos_import'])
132
142
  end
133
143
 
134
144
  def print
@@ -234,7 +244,7 @@ end if'}
234
244
  <key>WorkingDirectory</key>
235
245
  <string>#{root}</string>
236
246
  <key>StartInterval</key>
237
- <integer>60</integer>
247
+ <integer>#{config['interval']}</integer>
238
248
  </dict>
239
249
  </plist>}
240
250
  end
@@ -84,6 +84,7 @@ module Photoapp
84
84
  else
85
85
  FileUtils.mkdir_p(File.dirname(upload_dest))
86
86
  FileUtils.mkdir_p(File.dirname(print_dest))
87
+ FileUtils.mkdir_p(File.dirname(print_dup_dest)) if print_dup_dest
87
88
  FileUtils.mkdir_p(File.dirname(import_dest))
88
89
 
89
90
  puts "writing #{upload_dest}"
@@ -92,6 +93,11 @@ module Photoapp
92
93
  puts "writing #{print_dest}"
93
94
  with_url.write print_dest
94
95
 
96
+ if print_dup_dest
97
+ puts "writing #{print_dup_dest}"
98
+ with_url.write print_dest
99
+ end
100
+
95
101
  puts "writing #{import_dest}"
96
102
  with_url.write import_dest
97
103
 
@@ -112,6 +118,12 @@ module Photoapp
112
118
  File.join(config['print'], short + '.jpg')
113
119
  end
114
120
 
121
+ def print_dup_dest
122
+ if config['print_duplicate']
123
+ File.join(config['print_duplicate'], short + '.jpg')
124
+ end
125
+ end
126
+
115
127
  def import_dest
116
128
  File.join(config['photos_import'], short + '.jpg')
117
129
  end
@@ -1,3 +1,3 @@
1
1
  module Photoapp
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: desoto-photoapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-04 00:00:00.000000000 Z
11
+ date: 2018-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick