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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9be917548dd9db548ea995592262ba3b3ec50c8
4
- data.tar.gz: f6ddd5964b4f1088479d08f5dedd21bfc14b61c6
3
+ metadata.gz: 07a5fc5910f73505ef69d97b4bc3d2478133ebce
4
+ data.tar.gz: 7a19a33217844c40a3e1a8fcf7f65fdd83a46976
5
5
  SHA512:
6
- metadata.gz: 51c2803542f1eb1bed340747dc526c9d455c9e1d8a8533aadb4933d3f1b058ec30e81e22cd47dc7cb4827d3554e4a1ee31c73b9e9869eca8b5309a3ea8ac5d75
7
- data.tar.gz: 13cd019b9527fb38112f1f4d62316b25863b58b4d8cf054e0e6a741ecfba0ff44cfe1f574b1642ee350397de9c5c53ab0ecf1c7e1f12fc04b5af44627a11b347
6
+ metadata.gz: 3c13cdfda8a7e2316009ba20118021e0777b73b88ddca248853702670f9a9ce40bc70ff087fb21398d3fce9b6cae521ddf7839f1418842c7319f37797e807927
7
+ data.tar.gz: d9e1368c50cd19689ca820583414ab4393dc15592be4f5844ec23428b15bb688541c0ab835ed1784c119262c1b8da66c45dbf3e0044f12268015edf353202380
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = deskshot CHANGELOG
2
2
 
3
+ == v1.0.2 [24-Feb-2014] :
4
+
5
+ * add default filename
6
+
3
7
  == v1.0.1 [12-Feb-2014] :
4
8
 
5
9
  * Minor bug fix
@@ -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 = FileDialog.new(nil, "Save as", FileDialog::SAVE)
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 = output.getDirectory + output.getFile
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 = Toolkit.get_default_toolkit
19
- dim = toolkit.get_screen_size
20
- rectangle = Rectangle.new(0, 0, dim.get_width, dim.get_height)
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 = java::io::File.new(filename)
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
@@ -1,5 +1,6 @@
1
1
  class TrayApplication
2
2
  include Java
3
+
3
4
  import java.awt.TrayIcon
4
5
  import java.awt.Toolkit
5
6
 
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.1
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-12 00:00:00.000000000 Z
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: Thanks for installing! Please go through Documentation provided in http://rubydoc.info/gems/deskshot
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