mac-robot 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mac-robot.rb +9 -0
- data/mac-robot.gemspec +2 -2
- data/spec/mac-robot_spec.rb +10 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/mac-robot.rb
CHANGED
@@ -66,6 +66,15 @@ module Mac
|
|
66
66
|
raise OutOfResolution if x < 0 || y < 0
|
67
67
|
raise OutOfResolution if display_pixel_size.width < x || display_pixel_size.height < y
|
68
68
|
|
69
|
+
# workarownd for exeption occurs when x == display_pixel_size.width
|
70
|
+
#
|
71
|
+
# *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /SourceCache/AppKit/AppKit-1265/AppKit.subproj/NSBitmapImageRep.m:1286
|
72
|
+
# An uncaught exception was raised
|
73
|
+
# Invalid parameter not satisfying: cgImage != NULL
|
74
|
+
if display_pixel_size.width == x
|
75
|
+
x = x - 0.1
|
76
|
+
end
|
77
|
+
|
69
78
|
color = Util.get_pixel_color(x, y)
|
70
79
|
Struct.new(:red, :green, :blue, :alpha).new(*color)
|
71
80
|
end
|
data/mac-robot.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mac-robot"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["youpy"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2014-03-04"
|
13
13
|
s.description = "A Library to Automate User Interactions"
|
14
14
|
s.email = "youpy@buycheapviagraonlinenow.com"
|
15
15
|
s.extensions = ["ext/event_dispatcher/extconf.rb", "ext/util/extconf.rb"]
|
data/spec/mac-robot_spec.rb
CHANGED
@@ -53,5 +53,15 @@ describe Mac::Robot do
|
|
53
53
|
}.should raise_error(Mac::Robot::OutOfResolution)
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
it 'should get color from rightmost pixel' do
|
58
|
+
display_pixel_size = subject.display_pixel_size
|
59
|
+
|
60
|
+
color = subject.get_pixel_color(display_pixel_size.width, 0)
|
61
|
+
color.red.should be_a_kind_of(Float)
|
62
|
+
color.green.should be_a_kind_of(Float)
|
63
|
+
color.blue.should be_a_kind_of(Float)
|
64
|
+
color.alpha.should be_a_kind_of(Float)
|
65
|
+
end
|
56
66
|
end
|
57
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mac-robot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
segments:
|
105
105
|
- 0
|
106
|
-
hash:
|
106
|
+
hash: 734346980075355748
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|