Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rdoc #6

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
boaw (0.1.2)
boaw (0.1.3)

GEM
remote: https://rubygems.org/
Expand Down
6 changes: 6 additions & 0 deletions lib/boaw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ def initialize
@adapter = Xdotool::Adapter.new
end

# method returns the current cursor position
# { :x => 1, :y =>2 }
def position
adapter.position
end

# clicks with the left mouse button,
# takes the position coordinates as input
def left_click(position)
adapter.left_click(position)
end

# clicks with the right mouse button,
# takes the position coordinates as input
def right_click(position)
adapter.right_click(position)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/boaw/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class Boaw
VERSION = '0.1.2'
VERSION = '0.1.3'
end
2 changes: 1 addition & 1 deletion lib/xdotool/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

module Xdotool
# Xdotool adapter for mouse control
class Adapter
class Adapter # :nodoc: all
def initialize
result = Kernel.system('xdotool version')
raise BaseError if result.nil?
Expand Down
2 changes: 1 addition & 1 deletion lib/xdotool/base_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Xdotool
# default error
class BaseError < StandardError
class BaseError < StandardError # :nodoc: all
def message
'failed to initialize xdotool module'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/xdotool/position_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Xdotool
# coordinate position parser from Xdotool
class PositionParser
class PositionParser # :nodoc: all
def self.parse(position)
hash_position = position.scan(/(\w+):(\d+)/).to_h

Expand Down
2 changes: 1 addition & 1 deletion test/lib/boaw/version_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

class VersionTest < Minitest::Test
def test_version
assert_equal '0.1.2', Boaw::VERSION
assert_equal '0.1.3', Boaw::VERSION
end
end