diff --git a/Gemfile.lock b/Gemfile.lock index c173612..5375299 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - boaw (0.1.2) + boaw (0.1.3) GEM remote: https://rubygems.org/ diff --git a/lib/boaw.rb b/lib/boaw.rb index 8fb449c..2bc13f0 100644 --- a/lib/boaw.rb +++ b/lib/boaw.rb @@ -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 diff --git a/lib/boaw/version.rb b/lib/boaw/version.rb index abb8735..11b638f 100644 --- a/lib/boaw/version.rb +++ b/lib/boaw/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true class Boaw - VERSION = '0.1.2' + VERSION = '0.1.3' end diff --git a/lib/xdotool/adapter.rb b/lib/xdotool/adapter.rb index 48e75db..d5702af 100644 --- a/lib/xdotool/adapter.rb +++ b/lib/xdotool/adapter.rb @@ -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? diff --git a/lib/xdotool/base_error.rb b/lib/xdotool/base_error.rb index 9f0bd69..4b8b503 100644 --- a/lib/xdotool/base_error.rb +++ b/lib/xdotool/base_error.rb @@ -2,7 +2,7 @@ module Xdotool # default error - class BaseError < StandardError + class BaseError < StandardError # :nodoc: all def message 'failed to initialize xdotool module' end diff --git a/lib/xdotool/position_parser.rb b/lib/xdotool/position_parser.rb index 5ec70f4..3b5ded9 100644 --- a/lib/xdotool/position_parser.rb +++ b/lib/xdotool/position_parser.rb @@ -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 diff --git a/test/lib/boaw/version_test.rb b/test/lib/boaw/version_test.rb index 93e05cd..d059f36 100644 --- a/test/lib/boaw/version_test.rb +++ b/test/lib/boaw/version_test.rb @@ -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