desoto-photoapp 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/photoapp +6 -11
- data/lib/desoto-photoapp.rb +12 -4
- data/lib/desoto-photoapp/photo.rb +0 -5
- data/lib/desoto-photoapp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d5955b79b2143eff1ecec4bff7478b6da4049d8
|
4
|
+
data.tar.gz: 5da6fc93e9392a66853fb79749f4fa448a9dd3af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb2530bdf77c3ddc89979b6cd4f043797382aaa3641a800ac025de2bb14bf90fe530f6db769fc12d16e926e564572793f45a44412cc3b8ca29334a65952521d
|
7
|
+
data.tar.gz: b45e45d136f52745caa107635ac8d2d1f4cb72eca3368e09afd1dc1f0b5e927df3b5fb3cda8cd392bc1a541116d329a49e04716c5e6f066407e2900e19e708ec
|
data/exe/photoapp
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
$LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))
|
4
4
|
|
5
5
|
require 'optparse'
|
6
|
-
require
|
6
|
+
require 'desoto-photoapp'
|
7
7
|
|
8
8
|
options = {}
|
9
9
|
|
@@ -11,10 +11,6 @@ OptionParser.new do |opts|
|
|
11
11
|
opts.on("-c", "--config PATH", String, "Path to config file") do |config|
|
12
12
|
options['config'] = config
|
13
13
|
end
|
14
|
-
|
15
|
-
opts.on("-s", "--source PATH", String, "Path to photos directory") do |source|
|
16
|
-
options['source'] = source
|
17
|
-
end
|
18
14
|
end.parse!
|
19
15
|
|
20
16
|
if ARGV.first == 'setup'
|
@@ -24,16 +20,15 @@ if ARGV.first == 'setup'
|
|
24
20
|
end
|
25
21
|
system "open #{Photoapp.gem_dir('assets/photos-action-installer.pkg')}"
|
26
22
|
else
|
27
|
-
p = Photoapp::Session.new(options)
|
28
23
|
|
29
24
|
if ARGV.first == 'process'
|
30
25
|
ARGV.shift
|
31
|
-
|
26
|
+
options['source'] = ARGV.shift
|
27
|
+
Photoapp::Session.new(options).process
|
32
28
|
elsif ARGV.first == 'upload'
|
29
|
+
Photoapp::Session.new(options).upload
|
30
|
+
elsif ARGV.first == 'reprint'
|
33
31
|
ARGV.shift
|
34
|
-
|
35
|
-
elsif ARGV.first == 'print'
|
36
|
-
ARGV.shift
|
37
|
-
p.print
|
32
|
+
Photoapp.print(ARGV.shift)
|
38
33
|
end
|
39
34
|
end
|
data/lib/desoto-photoapp.rb
CHANGED
@@ -11,6 +11,12 @@ module Photoapp
|
|
11
11
|
File.expand_path(File.join(File.dirname(__FILE__), '..', *paths))
|
12
12
|
end
|
13
13
|
|
14
|
+
# Handle printing
|
15
|
+
def print(path)
|
16
|
+
system "lpr #{path}"
|
17
|
+
end
|
18
|
+
|
19
|
+
|
14
20
|
class Session
|
15
21
|
attr_accessor :photos, :print, :upload
|
16
22
|
|
@@ -65,15 +71,15 @@ module Photoapp
|
|
65
71
|
logo = Magick::Image.read(config['watermark']).first
|
66
72
|
photos = []
|
67
73
|
tmp = root('.tmp')
|
68
|
-
FileUtils.mkdir_p
|
74
|
+
FileUtils.mkdir_p tmp
|
69
75
|
|
70
76
|
if empty_print_queue?
|
71
77
|
FileUtils.rm_rf(config['print'])
|
72
78
|
end
|
73
79
|
|
74
80
|
load_photos.each do |f|
|
75
|
-
FileUtils.mv f, tmp
|
76
81
|
path = File.join(tmp, File.basename(f))
|
82
|
+
FileUtils.mv f, path
|
77
83
|
`automator -i #{path} #{Photoapp.gem_dir("lib/adjust-image.workflow")}`
|
78
84
|
photos << Photo.new(path, logo, self)
|
79
85
|
end
|
@@ -81,16 +87,18 @@ module Photoapp
|
|
81
87
|
photos.each do |p|
|
82
88
|
p.write
|
83
89
|
p.add_to_photos
|
84
|
-
p.
|
90
|
+
Photoapp.print(p.print_dest)
|
85
91
|
end
|
86
92
|
|
93
|
+
upload
|
94
|
+
|
87
95
|
FileUtils.rm_rf tmp
|
88
96
|
end
|
89
97
|
|
90
98
|
def load_photos
|
91
99
|
files = ['*.jpg', '*.JPG', '*.JPEG', '*.jpeg'].map! { |f| File.join(config['source'], f) }
|
92
100
|
|
93
|
-
Dir[*files]
|
101
|
+
Dir[*files].uniq
|
94
102
|
end
|
95
103
|
|
96
104
|
def empty_print_queue?
|
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|