Skip to content

Commit

Permalink
Rdoc (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonovk authored Nov 17, 2023
1 parent 39a413f commit 4a2cfc0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
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

0 comments on commit 4a2cfc0

Please sign in to comment.