photile 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -2
- data/lib/photile.rb +1 -1
- data/lib/photile/cli.rb +7 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -24,7 +24,9 @@ Usage: photile [options] infile outfile
|
|
24
24
|
-c, --compress Loss-less compress image
|
25
25
|
-w, --watermark FILE Watermark with given file
|
26
26
|
-t, --tile WIDTHxHEIGHT Tile to the given dimensions
|
27
|
+
-v, --verbose Run verbosely
|
27
28
|
-h, --help Display options help
|
29
|
+
--version Show version
|
28
30
|
|
29
31
|
# Basic Examples
|
30
32
|
$ photile --quality 80 image-in image-out
|
@@ -62,11 +64,10 @@ Photile uses the amazing [Imagemagick](http://www.imagemagick.org/script/index.p
|
|
62
64
|
### TODO
|
63
65
|
|
64
66
|
- Documentation
|
65
|
-
- CLI option to show version
|
66
67
|
- Use log4r for logging
|
67
|
-
- File validation for infile/outfile
|
68
68
|
- More unit tests to ensure that all pipe permutations work
|
69
69
|
- Sign gem on deploy
|
70
|
+
- Use from rake/ruby scripts and from rails
|
70
71
|
|
71
72
|
* * *
|
72
73
|
Copyright (c) 2013 Nitin Dhar. See [MIT-LICENSE](MIT-LICENSE) for details.
|
data/lib/photile.rb
CHANGED
data/lib/photile/cli.rb
CHANGED
@@ -36,6 +36,11 @@ class Photile::Cli
|
|
36
36
|
puts Photile::REQUIREMENTS
|
37
37
|
exit
|
38
38
|
end
|
39
|
+
|
40
|
+
opts.on_tail("--version", "Show version") do
|
41
|
+
puts "photile-#{Photile::VERSION}"
|
42
|
+
exit
|
43
|
+
end
|
39
44
|
end
|
40
45
|
|
41
46
|
begin
|
@@ -58,6 +63,8 @@ class Photile::Cli
|
|
58
63
|
puts 'Invalid option'
|
59
64
|
puts optparse
|
60
65
|
exit
|
66
|
+
rescue exit
|
67
|
+
exit
|
61
68
|
rescue Exception => e
|
62
69
|
puts e
|
63
70
|
puts optparse
|