deskshot 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +4 -0
- data/lib/deskshot/screenshot.rb +11 -8
- data/lib/deskshot/tray.rb +1 -0
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07a5fc5910f73505ef69d97b4bc3d2478133ebce
|
4
|
+
data.tar.gz: 7a19a33217844c40a3e1a8fcf7f65fdd83a46976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c13cdfda8a7e2316009ba20118021e0777b73b88ddca248853702670f9a9ce40bc70ff087fb21398d3fce9b6cae521ddf7839f1418842c7319f37797e807927
|
7
|
+
data.tar.gz: d9e1368c50cd19689ca820583414ab4393dc15592be4f5844ec23428b15bb688541c0ab835ed1784c119262c1b8da66c45dbf3e0044f12268015edf353202380
|
data/CHANGELOG.rdoc
CHANGED
data/lib/deskshot/screenshot.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Screenshot
|
2
2
|
include Java
|
3
3
|
|
4
|
-
import java.awt.FileDialog #For File save as
|
4
|
+
import java.awt.FileDialog #For File save as Dialog
|
5
5
|
import java.awt.Robot
|
6
6
|
import java.awt.Toolkit
|
7
7
|
import java.awt.Rectangle
|
@@ -9,17 +9,20 @@ class Screenshot
|
|
9
9
|
|
10
10
|
def self.capture
|
11
11
|
begin
|
12
|
-
output
|
12
|
+
output = FileDialog.new(nil, "Save as", FileDialog::SAVE)
|
13
|
+
defaultfilename = Time.now.strftime("%F %H-%M-%S")
|
14
|
+
output.setFile(defaultfilename + ".png")
|
13
15
|
output.show
|
14
|
-
filename
|
16
|
+
filename = output.getDirectory + output.getFile
|
17
|
+
#to avoide conflict of capturing own menu/window itself
|
18
|
+
sleep 1
|
15
19
|
|
16
|
-
sleep 0.5 #to avoide conflict of capturing own menu/window itself
|
17
20
|
robot = Robot.new
|
18
|
-
toolkit
|
19
|
-
dim
|
20
|
-
rectangle
|
21
|
+
toolkit = Toolkit.get_default_toolkit
|
22
|
+
dim = toolkit.get_screen_size
|
23
|
+
rectangle = Rectangle.new(0, 0, dim.get_width, dim.get_height)
|
21
24
|
image = robot.create_screen_capture(rectangle)
|
22
|
-
file
|
25
|
+
file = java::io::File.new(filename)
|
23
26
|
ImageIO::write(image, "png", file)
|
24
27
|
rescue Exception
|
25
28
|
end
|
data/lib/deskshot/tray.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deskshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parth Bharadiya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Deskshot allows you to take screenshot of your desktop. It also has system tray application along with. It is implemented using JRuby.
|
14
14
|
email: parthbharadiya007@gmail.com
|
@@ -28,7 +28,15 @@ homepage: http://rubygems.org/gems/deskshot
|
|
28
28
|
licenses:
|
29
29
|
- MIT
|
30
30
|
metadata: {}
|
31
|
-
post_install_message:
|
31
|
+
post_install_message: " ====================================================================================\
|
32
|
+
\ \n\n Thanks for installing! Please go through Documentation provided in http://rubydoc.info/gems/deskshot\
|
33
|
+
\ \n\n == REQUIREMENTS: \n\n\n * You have to install JRuby if you already do\
|
34
|
+
\ not have. http://jruby.org/download \n\n == GETTING STARTED: \n\n\n Step 1 :\
|
35
|
+
\ After installing gem, you can simply run following command in your Windows console/Linux\
|
36
|
+
\ Terminal to start Deskshot app \n\n\n irb -rdeskshot \n\n\n Step 2 : To take\
|
37
|
+
\ screenshot, Follow File > Take Screenshot or by right clicking System Tray Icon.\
|
38
|
+
\ \n\n Shortcut : Ctrl + Alt + Q (keep your deskshot app on top while using shortcut)\
|
39
|
+
\ \n\n ===================================================================================="
|
32
40
|
rdoc_options: []
|
33
41
|
require_paths:
|
34
42
|
- lib
|