appium_lib 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -216,4 +216,20 @@ module Appium::Common
216
216
  def tag tag_name
217
217
  find_element :tag_name, tag_name
218
218
  end
219
+
220
+ # Converts pixel values to window relative values
221
+ #
222
+ # ```ruby
223
+ # px_to_window_rel x: 50, y: 150
224
+ # ```
225
+
226
+ def px_to_window_rel opts={}
227
+
228
+ w = $driver.window_size
229
+ x = opts.fetch :x, 0
230
+ y = opts.fetch :y, 0
231
+
232
+ OpenStruct.new( x: x.to_f / w.width.to_f,
233
+ y: y.to_f / w.height.to_f )
234
+ end
219
235
  end # module Appium::Common
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Appium
3
3
  # Version and Date are defined on the 'Appium' module, not 'Appium::Common'
4
- VERSION = '0.6.1' unless defined? ::Appium::VERSION
5
- DATE = '2013-08-05' unless defined? ::Appium::DATE
4
+ VERSION = '0.6.2' unless defined? ::Appium::VERSION
5
+ DATE = '2013-08-07' unless defined? ::Appium::DATE
6
6
  end
@@ -139,11 +139,10 @@ module Appium
139
139
  # Prefer existing method.
140
140
  # super will invoke method missing on driver
141
141
  super(*args, &block)
142
- # minitest also defines a name method,
143
- # so rescue argument error
144
- # and call the name method on $driver
142
+ # minitest also defines a name method,
143
+ # so rescue argument error
144
+ # and call the name method on $driver
145
145
  rescue NoMethodError, ArgumentError
146
- # puts "[Object.class_eval] '#{m}' not on super"
147
146
  $driver.send m, *args, &block if $driver.respond_to?(m)
148
147
  end
149
148
  end
data/readme.md CHANGED
@@ -47,6 +47,9 @@ apk = {
47
47
  app_wait_activity: '.act.Start'
48
48
  }
49
49
  Appium::Driver.new(apk).start_driver
50
+
51
+ # Define the methods on all objects.
52
+ Appium.promote_appium_methods Object
50
53
  ```
51
54
 
52
55
  #### iOS env vars
@@ -1,3 +1,9 @@
1
+ #### v0.6.1 2013-08-05
2
+
3
+ - [44b4b29](https://github.com/appium/ruby_lib/commit/44b4b29596b59b1d8a7a7ab7485f176a84143ac3) Release 0.6.1
4
+ - [a58228f](https://github.com/appium/ruby_lib/commit/a58228f728576be4bbe8325788ed28571b810bb4) Refactor promotion into a method
5
+
6
+
1
7
  #### v0.6.0 2013-08-05
2
8
 
3
9
  - [09aa23d](https://github.com/appium/ruby_lib/commit/09aa23d8c1b769b054c7d0e24ec86cf55d6bc027) Release 0.6.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-05 00:00:00.000000000 Z
11
+ date: 2013-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver