macos 0.1.2 → 0.1.4

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
  SHA256:
3
- metadata.gz: 423a1401afca3af5d7e80af2653462f51c8a94b2b38e2b886eecf7d958e33f59
4
- data.tar.gz: b5a9a30edef68dccea9f734befd4638b3c1ca0c176360f250a322a4f0ea00e50
3
+ metadata.gz: a108d88ec5b706a9bc9839ded07b08849a2a232cb74ec9f9ec9e50f23f84734d
4
+ data.tar.gz: f55c8d91de3341d0d709a59cd921c96f4690dce88a0dd7568af617e084682c4e
5
5
  SHA512:
6
- metadata.gz: 39d70e2ef94ebf0af0aab4a33c2d68f3daa49de8faa38a9fc7e3fde2deac2face88a7cd9a45e2e7fa5f772976a6ead402671d29269b5140e5f8d492ccbc0fb45
7
- data.tar.gz: 31219d6687186afda87061b43274bb75c85ef2b4b8589625d0bce96e1522782efc6461a3d45aaec749c1f547cb0a7b38dd17f8edc195db12761d354104124ce2
6
+ metadata.gz: 00aea0fa47b5dc3363fd3be123288ab12277429d0af9cd7db45066a9bc431421a3c966ab3d04401b6aa510a641378b1b58107577952a763b0b8f0e218956393f
7
+ data.tar.gz: 9530f04a0e57b4b22b78c46266ea9079f4e138c6238f8ac503764e72f106f281fd6ac7d9ccb1bc91f18cd81ee59fd4f2126e50e886bbbec75c52269469280970
data/README.md CHANGED
@@ -42,7 +42,7 @@ bounds = display.bounds
42
42
 
43
43
  puts "#{bounds.width}×#{bounds.height}"
44
44
 
45
- display.capture do |tempfile|
45
+ display.screenshot do |tempfile|
46
46
  # ...
47
47
  end
48
48
  ```
data/lib/macos/display.rb CHANGED
@@ -27,7 +27,7 @@ module MacOS
27
27
 
28
28
  # @yield [tempfile]
29
29
  # @yieldparam tempfile [Tempfile]
30
- def capture
30
+ def screenshot
31
31
  tempfile = Tempfile.new(["screenshot", ".png"])
32
32
  system("screencapture -o -x #{tempfile.path}")
33
33
  yield tempfile
data/lib/macos/mouse.rb CHANGED
@@ -41,59 +41,59 @@ module MacOS
41
41
 
42
42
  # @param x [Float]
43
43
  # @param y [Float]
44
- def left_mouse_down(x:, y:)
44
+ def left_down(x:, y:)
45
45
  trigger(type: CG::EventType::LEFT_MOUSE_DOWN, x:, y:, button: CG::MouseButton::LEFT)
46
46
  end
47
47
 
48
48
  # @param x [Float]
49
49
  # @param y [Float]
50
- def left_mouse_up(x:, y:)
50
+ def left_up(x:, y:)
51
51
  trigger(type: CG::EventType::LEFT_MOUSE_UP, x:, y:, button: CG::MouseButton::LEFT)
52
52
  end
53
53
 
54
54
  # @param x [Float]
55
55
  # @param y [Float]
56
- def left_mouse_click(x:, y:)
57
- left_mouse_down(x:, y:)
58
- left_mouse_up(x:, y:)
56
+ def left_click(x:, y:)
57
+ left_down(x:, y:)
58
+ left_up(x:, y:)
59
59
  end
60
60
 
61
61
  # @param x [Float]
62
62
  # @param y [Float]
63
- def right_mouse_down(x:, y:)
63
+ def right_down(x:, y:)
64
64
  trigger(type: CG::EventType::RIGHT_MOUSE_DOWN, x:, y:, button: CG::MouseButton::RIGHT)
65
65
  end
66
66
 
67
67
  # @param x [Float]
68
68
  # @param y [Float]
69
- def right_mouse_up(x:, y:)
69
+ def right_up(x:, y:)
70
70
  trigger(type: CG::EventType::RIGHT_MOUSE_UP, x:, y:, button: CG::MouseButton::RIGHT)
71
71
  end
72
72
 
73
73
  # @param x [Float]
74
74
  # @param y [Float]
75
- def right_mouse_click(x:, y:)
76
- right_mouse_down(x:, y:)
77
- right_mouse_up(x:, y:)
75
+ def right_click(x:, y:)
76
+ right_down(x:, y:)
77
+ right_up(x:, y:)
78
78
  end
79
79
 
80
80
  # @param x [Float]
81
81
  # @param y [Float]
82
- def middle_mouse_down(x:, y:)
82
+ def middle_down(x:, y:)
83
83
  trigger(type: CG::EventType::OTHER_MOUSE_DOWN, x:, y:, button: CG::MouseButton::CENTER)
84
84
  end
85
85
 
86
86
  # @param x [Float]
87
87
  # @param y [Float]
88
- def middle_mouse_up(x:, y:)
88
+ def middle_up(x:, y:)
89
89
  trigger(type: CG::EventType::OTHER_MOUSE_UP, x:, y:, button: CG::MouseButton::CENTER)
90
90
  end
91
91
 
92
92
  # @param x [Float]
93
93
  # @param y [Float]
94
- def middle_mouse_click(x:, y:)
95
- middle_mouse_down(x:, y:)
96
- middle_mouse_up(x:, y:)
94
+ def middle_click(x:, y:)
95
+ middle_down(x:, y:)
96
+ middle_up(x:, y:)
97
97
  end
98
98
  end
99
99
  end
data/lib/macos/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MacOS
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/macos.rb CHANGED
@@ -26,8 +26,8 @@ module MacOS
26
26
  # mouse = MacOS.mouse
27
27
  # mouse.move(x: 4, y: 8)
28
28
  # position = mouse.position
29
- # mouse.left_mouse_click(x: position.x, y: position.y)
30
- # mouse.right_mouse_click(x: position.x, y: position.y)
29
+ # mouse.left_click(x: position.x, y: position.y)
30
+ # mouse.right_click(x: position.x, y: position.y)
31
31
  #
32
32
  # @return [MacOS::Mouse]
33
33
  def self.mouse
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre