win32screenshot 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ = 1.0.3 2011-04-17
2
+ * Try to take a screenshot of the window even if the activation of that window fails.
3
+
1
4
  = 1.0.2 2011-01-20
2
5
  * Fixed to work with RAutomation version 0.4
3
6
 
data/Rakefile CHANGED
@@ -15,11 +15,11 @@ begin
15
15
 
16
16
  gem.rdoc_options = ["--main", "README.rdoc"]
17
17
 
18
- gem.add_dependency "ffi", "~>0"
19
- gem.add_dependency "mini_magick", "~>3.1"
20
- gem.add_dependency "rautomation", "~>0.4"
18
+ gem.add_dependency "ffi", "~>1"
19
+ gem.add_dependency "mini_magick", "~>3.2"
20
+ gem.add_dependency "rautomation", "~>0.5"
21
21
 
22
- gem.add_development_dependency "rspec", "~>2.3"
22
+ gem.add_development_dependency "rspec", "~>2.5"
23
23
  end
24
24
  Jeweler::GemcutterTasks.new
25
25
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -1,5 +1,4 @@
1
1
  require 'ffi'
2
- require 'stringio' # this is needed for MiniMagick for now
3
2
  require 'mini_magick'
4
3
  ENV["RAUTOMATION_ADAPTER"] = "win_ffi" # make sure that WinFfi adapter is always used for RAutomation
5
4
  require 'rautomation'
@@ -63,9 +63,12 @@ module Win32
63
63
  def window(opts)
64
64
  area = {:area => opts.delete(:area)}
65
65
  win = opts[:rautomation] || RAutomation::Window.new(opts)
66
- timeout = Time.now + 60
66
+ timeout = Time.now + 10
67
67
  until win.active?
68
- raise "Failed to set window into focus, unable to take a screenshot!" if Time.now >= timeout
68
+ if Time.now >= timeout
69
+ Kernel.warn "Failed to set window '#{win.locators}' into focus!"
70
+ break
71
+ end
69
72
  win.activate
70
73
  end
71
74
  take_screenshot(win.hwnd, opts.merge(area || {}))
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{win32screenshot}
8
- s.version = "1.0.2"
8
+ s.version = "1.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jarmo Pertman", "Aslak Helles\303\270y"]
12
- s.date = %q{2011-01-20}
12
+ s.date = %q{2011-04-17}
13
13
  s.description = %q{Capture Screenshots on Windows with Ruby to bmp, gif, jpg or png formats!}
14
14
  s.email = ["jarmo.p@gmail.com", "aslak.hellesoy@gmail.com"]
15
15
  s.extra_rdoc_files = [
@@ -69,21 +69,21 @@ Gem::Specification.new do |s|
69
69
  s.specification_version = 3
70
70
 
71
71
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
72
- s.add_runtime_dependency(%q<ffi>, ["~> 0"])
73
- s.add_runtime_dependency(%q<mini_magick>, ["~> 3.1"])
74
- s.add_runtime_dependency(%q<rautomation>, ["~> 0.4"])
75
- s.add_development_dependency(%q<rspec>, ["~> 2.3"])
72
+ s.add_runtime_dependency(%q<ffi>, ["~> 1"])
73
+ s.add_runtime_dependency(%q<mini_magick>, ["~> 3.2"])
74
+ s.add_runtime_dependency(%q<rautomation>, ["~> 0.5"])
75
+ s.add_development_dependency(%q<rspec>, ["~> 2.5"])
76
76
  else
77
- s.add_dependency(%q<ffi>, ["~> 0"])
78
- s.add_dependency(%q<mini_magick>, ["~> 3.1"])
79
- s.add_dependency(%q<rautomation>, ["~> 0.4"])
80
- s.add_dependency(%q<rspec>, ["~> 2.3"])
77
+ s.add_dependency(%q<ffi>, ["~> 1"])
78
+ s.add_dependency(%q<mini_magick>, ["~> 3.2"])
79
+ s.add_dependency(%q<rautomation>, ["~> 0.5"])
80
+ s.add_dependency(%q<rspec>, ["~> 2.5"])
81
81
  end
82
82
  else
83
- s.add_dependency(%q<ffi>, ["~> 0"])
84
- s.add_dependency(%q<mini_magick>, ["~> 3.1"])
85
- s.add_dependency(%q<rautomation>, ["~> 0.4"])
86
- s.add_dependency(%q<rspec>, ["~> 2.3"])
83
+ s.add_dependency(%q<ffi>, ["~> 1"])
84
+ s.add_dependency(%q<mini_magick>, ["~> 3.2"])
85
+ s.add_dependency(%q<rautomation>, ["~> 0.5"])
86
+ s.add_dependency(%q<rspec>, ["~> 2.5"])
87
87
  end
88
88
  end
89
89
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32screenshot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jarmo Pertman
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-20 00:00:00 +02:00
19
+ date: 2011-04-17 00:00:00 +03:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -27,10 +27,10 @@ dependencies:
27
27
  requirements:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 3
30
+ hash: 1
31
31
  segments:
32
- - 0
33
- version: "0"
32
+ - 1
33
+ version: "1"
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -41,11 +41,11 @@ dependencies:
41
41
  requirements:
42
42
  - - ~>
43
43
  - !ruby/object:Gem::Version
44
- hash: 5
44
+ hash: 3
45
45
  segments:
46
46
  - 3
47
- - 1
48
- version: "3.1"
47
+ - 2
48
+ version: "3.2"
49
49
  type: :runtime
50
50
  version_requirements: *id002
51
51
  - !ruby/object:Gem::Dependency
@@ -56,11 +56,11 @@ dependencies:
56
56
  requirements:
57
57
  - - ~>
58
58
  - !ruby/object:Gem::Version
59
- hash: 3
59
+ hash: 1
60
60
  segments:
61
61
  - 0
62
- - 4
63
- version: "0.4"
62
+ - 5
63
+ version: "0.5"
64
64
  type: :runtime
65
65
  version_requirements: *id003
66
66
  - !ruby/object:Gem::Dependency
@@ -71,11 +71,11 @@ dependencies:
71
71
  requirements:
72
72
  - - ~>
73
73
  - !ruby/object:Gem::Version
74
- hash: 5
74
+ hash: 9
75
75
  segments:
76
76
  - 2
77
- - 3
78
- version: "2.3"
77
+ - 5
78
+ version: "2.5"
79
79
  type: :development
80
80
  version_requirements: *id004
81
81
  description: Capture Screenshots on Windows with Ruby to bmp, gif, jpg or png formats!