mouse 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.markdown +4 -0
- data/lib/mouse.rb +54 -4
- data/lib/mouse/version.rb +1 -1
- data/test/helper.rb +0 -2
- metadata +7 -10
- data/lib/mouse/core_extensions.rb +0 -29
- data/lib/mouse/core_extensions/macruby.rb +0 -10
- data/lib/mouse/core_extensions/mri.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81909b0a768cd68bb57c1fb51e957cc94d4a5dc
|
4
|
+
data.tar.gz: 20450a678f6e938de48df53e9d165832df06f5c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df452f27bff39f031bfcf620c19a1bcc7d07ead593d2bf0978865d6c0c7da079c80677f3851236457acae952ffe3c3284d49aae003dcb557a0c3042c46d8046
|
7
|
+
data.tar.gz: 04b9727b98e30a3594a664a675a8c87f3d4ccd951c3c376e71226e89c4dcbb02fdf4a87d12cd1a156aba758e81aa87c97863d61830d0ea7622202c81c515321d
|
data/History.markdown
CHANGED
data/lib/mouse.rb
CHANGED
@@ -1,6 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
##
|
2
|
+
# A structure that contains a point in a two-dimensional coordinate system
|
3
|
+
CGPoint = Struct.new(:x, :y) unless defined? CGPoint
|
4
|
+
|
5
|
+
##
|
6
|
+
# Mouse extensions to `CGPoint`
|
7
|
+
class CGPoint
|
8
|
+
|
9
|
+
# @param x [Number]
|
10
|
+
# @param y [Number]
|
11
|
+
def initialize x = 0.0, y = 0.0
|
12
|
+
super x.to_f, y.to_f
|
13
|
+
end
|
14
|
+
|
15
|
+
# @!attribute [rw] x
|
16
|
+
# The `x` co-ordinate of the screen point
|
17
|
+
# @return [Number]
|
18
|
+
|
19
|
+
# @!attribute [rw] y
|
20
|
+
# The `y` co-ordinate of the screen point
|
21
|
+
# @return [Number]
|
22
|
+
|
23
|
+
##
|
24
|
+
# Return a nice string representation of the point
|
25
|
+
#
|
26
|
+
# Overrides `Object#inspect` to more closely mimic MacRuby `Boxed#inspect`.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
def inspect
|
30
|
+
"#<CGPoint x=#{self.x.to_f} y=#{self.y.to_f}>"
|
31
|
+
end
|
4
32
|
|
5
|
-
|
33
|
+
##
|
34
|
+
# Returns the receiver, since the receiver is already a {CGPoint}
|
35
|
+
#
|
36
|
+
# @return [CGPoint]
|
37
|
+
def to_point
|
38
|
+
self
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Mouse extensions to `Array`
|
45
|
+
class Array
|
46
|
+
##
|
47
|
+
# Coerce the first two elements of the receiver into a {CGPoint}
|
48
|
+
#
|
49
|
+
# @return [CGPoint]
|
50
|
+
def to_point
|
51
|
+
CGPoint.new self[0], self[1]
|
52
|
+
end
|
6
53
|
end
|
54
|
+
|
55
|
+
require 'mouse/version'
|
56
|
+
require 'mouse/mouse'
|
data/lib/mouse/version.rb
CHANGED
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mouse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rada
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.
|
19
|
+
version: 0.8.7
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.
|
26
|
+
version: 0.8.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: kramdown
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.2.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.9.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.9.1
|
55
55
|
description: |
|
56
56
|
mouse is a rich, high level wrapper around OS X CGEvent APIs that allow
|
57
57
|
programmatic manipulation of the mouse cursor.
|
@@ -63,9 +63,6 @@ extensions:
|
|
63
63
|
- ext/mouse/extconf.rb
|
64
64
|
extra_rdoc_files: []
|
65
65
|
files:
|
66
|
-
- lib/mouse/core_extensions/macruby.rb
|
67
|
-
- lib/mouse/core_extensions/mri.rb
|
68
|
-
- lib/mouse/core_extensions.rb
|
69
66
|
- lib/mouse/version.rb
|
70
67
|
- lib/mouse.rb
|
71
68
|
- ext/mouse/mouse.c
|
@@ -1,29 +0,0 @@
|
|
1
|
-
if RUBY_ENGINE == 'macruby'
|
2
|
-
require 'mouse/core_extensions/macruby'
|
3
|
-
else
|
4
|
-
require 'mouse/core_extensions/mri'
|
5
|
-
end
|
6
|
-
|
7
|
-
##
|
8
|
-
# Mouse extensions to `CGPoint`
|
9
|
-
class CGPoint
|
10
|
-
##
|
11
|
-
# Returns the receiver, since the receiver is already a {CGPoint}
|
12
|
-
#
|
13
|
-
# @return [CGPoint]
|
14
|
-
def to_point
|
15
|
-
self
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
##
|
20
|
-
# Mouse extensions to `Array`
|
21
|
-
class Array
|
22
|
-
##
|
23
|
-
# Coerce the first two elements of the receiver into a {CGPoint}
|
24
|
-
#
|
25
|
-
# @return [CGPoint]
|
26
|
-
def to_point
|
27
|
-
CGPoint.new self[0], self[1]
|
28
|
-
end
|
29
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
framework 'AppKit'
|
2
|
-
|
3
|
-
# A workaround that guarantees that `CGPoint` is defined
|
4
|
-
unless defined? MOUNTAIN_LION_APPKIT_VERSION
|
5
|
-
MOUNTAIN_LION_APPKIT_VERSION = 1187
|
6
|
-
end
|
7
|
-
|
8
|
-
if NSAppKitVersionNumber >= MOUNTAIN_LION_APPKIT_VERSION
|
9
|
-
framework '/System/Library/Frameworks/CoreGraphics.framework'
|
10
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# A structure that contains a point in a two-dimensional coordinate system
|
3
|
-
CGPoint = Struct.new(:x, :y) unless defined? CGPoint
|
4
|
-
|
5
|
-
class CGPoint
|
6
|
-
|
7
|
-
# @param x [Number]
|
8
|
-
# @param y [Number]
|
9
|
-
def initialize x = 0.0, y = 0.0
|
10
|
-
super x.to_f, y.to_f
|
11
|
-
end
|
12
|
-
|
13
|
-
# @!attribute [rw] x
|
14
|
-
# The `x` co-ordinate of the screen point
|
15
|
-
# @return [Number]
|
16
|
-
|
17
|
-
# @!attribute [rw] y
|
18
|
-
# The `y` co-ordinate of the screen point
|
19
|
-
# @return [Number]
|
20
|
-
|
21
|
-
##
|
22
|
-
# Return a nice string representation of the point
|
23
|
-
#
|
24
|
-
# Overrides `Object#inspect` to more closely mimic MacRuby `Boxed#inspect`.
|
25
|
-
#
|
26
|
-
# @return [String]
|
27
|
-
def inspect
|
28
|
-
"#<CGPoint x=#{self.x.to_f} y=#{self.y.to_f}>"
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|