imagebin 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 3
4
- :patch: 3
4
+ :patch: 4
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Take a screenshot, upload it, and display the link
4
+ #
5
+ # Requires: imagemagick, xmessage, and the imagebin script
6
+ #
7
+
8
+ # Location to save files
9
+ working_dir = "/tmp"
10
+ # Default delay before taking screenshots
11
+ delay = 3
12
+ #Prefix to use for images captured.
13
+ prefix = "screenshot"
14
+ import = `which import`.chomp
15
+ xmess = `which xmessage`.chomp
16
+ imagebin = `which imagebin`.chomp
17
+
18
+ # Check if the dir to store the screenshots exists, else create it:
19
+ Dir.mkdir(working_dir) if not File.exists?(working_dir)
20
+
21
+ i = Dir.glob("#{working_dir}/#{prefix}.png").size + 1
22
+
23
+ sleep delay
24
+ system("#{import}", "-window", "root", "#{working_dir}/#{prefix}-#{i}.png")
25
+ link = `#{imagebin} -p -l -f #{working_dir}/#{prefix}-#{i}.png`
26
+ system("#{xmess}", "-nearmouse", "#{link}")
27
+
28
+ File.delete("#{working_dir}/#{prefix}-#{i}.png")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagebin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - dougsko
@@ -45,7 +45,7 @@ dependencies:
45
45
  description: Command line interface to imagebin.ca
46
46
  email: dougtko@gmail.com
47
47
  executables:
48
- - takeScreenshot.sh
48
+ - takeScreenshot.rb
49
49
  - imagebin
50
50
  extensions: []
51
51
 
@@ -58,7 +58,7 @@ files:
58
58
  - Rakefile
59
59
  - VERSION.yml
60
60
  - bin/imagebin
61
- - bin/takeScreenshot.sh
61
+ - bin/takeScreenshot.rb
62
62
  - lib/imagebin.rb
63
63
  - spec/ZGrass04.jpg
64
64
  - spec/imagebin_spec.rb
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # Take a screenshot, upload it, and display the link
4
- #
5
- # Requires: imagemagick, xmessage, and the imagebin script
6
- #
7
-
8
- # Location to save files
9
- WORKINGDIR=/tmp
10
- # Default delay before taking screenshots
11
- DELAY=3
12
- #Prefix to use for images captured.
13
- PREFIX=screenshot
14
- IMPORT=`which import`
15
-
16
- # Check if the dir to store the screenshots exists, else create it:
17
- if [ ! -d "${WORKINGDIR}" ]; then mkdir "${WORKINGDIR}"; fi
18
-
19
- i=`ls -l $WORKINGDIR/$PREFIX*.png | wc -l`
20
- ((i = i+1))
21
-
22
- sleep $DELAY
23
- $IMPORT -window root $WORKINGDIR/$PREFIX-$i.png
24
- xmessage -nearmouse `imagebin -p -l -f $WORKINGDIR/$PREFIX-$i.png`
25
- rm $WORKINGDIR/$PREFIX-$i.png