AXElements 7.0.0.pre5 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7f5ab5f1fae554a17b4df77fab7596773f091b5
4
- data.tar.gz: bc1b04ac869b3e50dd574157d45176902add557c
3
+ metadata.gz: 27c2ab0e5f551e930564c657754b5832410584c0
4
+ data.tar.gz: 9be9780c14312a8c8d395b55e110e655762f90f0
5
5
  SHA512:
6
- metadata.gz: 474346807b5396a4b265935cb9c3e49bd3bb8d3a2435ce8d61f371382979fdbc4eb3de5eac4307136ebb2512411d575f5bd09cf8e60df9558ea2b9f0780506c7
7
- data.tar.gz: 44febd6f2fae49f1fe67d1594535ecc943407847cd8d5dbbb74ceb5775cef52bd985a2cfb7d63e98b34e7a99b75d36a0764f79f0a14e45927c96decac2a4df8f
6
+ metadata.gz: 2534f8e74ec7d9ec97b2ff56e3053a554e0ca10fb52230ae9fc53d72c410a8205b4bd1b9cf4ac495f662918cd99ccb9e5967f94aa6e85cbb18d93b68472f04bb
7
+ data.tar.gz: 8bac00e64a61e96c63b993230869dc09df7b224a787e4283b715f59e6ea95cbd0bc37f00d79a288f39ee9e7d92448d2402ac99e39f6ba56bd285259843825e7a
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- Gi��(�j���D�!��mܐ[��)|�M��dC,{ؘ"lWb˳_QvD_��3���|(2Az���j���E����fy"�����VY@��
1
+ �>�Uk] �<]xko
2
+ Ʌދ]Q�V��W�b�}��+H=�*�K'eT����9��.:l���ʜ+�t'����o�S��AH:�p�g*O�c����B�{GjD���i60�^��,U8v���!�9J�;ve^�����n�{S�[�O4RV�t�t�C�Bi"\_��������Y���6d����Q'�M��,0C���n|�lX�vB���w�2�h��Gv�4Yx�!V�5���yca
@@ -1,6 +1,7 @@
1
1
  # 7.0.0
2
2
 
3
3
  * Compatibility with Yosemite (OS X 10.10)
4
+ * Add DSL#screenshot and AX::Element#screenshot for taking screenshots
4
5
  * Remove MacRuby support
5
6
  * Allow other Array#method\_missing handlers to function (GH-9)
6
7
  * Update ActiveSupport dependency and
@@ -804,43 +804,28 @@ module Accessibility::DSL
804
804
  alias_method :graph_for, :graph
805
805
 
806
806
  ##
807
- # Take a screen shot and save it to disk. If a file name and path are
808
- # not given then default values will be used; given paths will be
809
- # expanded automatically. A timestamp and file extension will always
810
- # automatically be appended to the file name.
807
+ # Take a screen shot and save it to disk. If a file path is not
808
+ # given then the default value will put it on the desktop. The
809
+ # actual file name will automatically generated with a timestamp.
811
810
  #
812
811
  # @example
813
812
  #
814
813
  # screenshot
815
814
  # # => "~/Desktop/AXElements-ScreenShot-20120422184650.png"
816
815
  #
817
- # screenshot app.title
816
+ # screenshot app.main_window
818
817
  # # => "~/Desktop/Safari-20120422184650.png"
819
818
  #
820
- # screenshot app.title, "/Volumes/SecretStash"
821
- # # => "/Volumes/SecretStash/Safari-20120422184650.png"
819
+ # screenshot app.main_window, "/Volumes/SecretStash"
820
+ # # => "/Volumes/SecretStash/AXElements-ScreenShot-20150622032250.png"
822
821
  #
823
- # @param name [#to_s]
824
- # @param dir [#to_s]
822
+ # @param rect [#to_rect]
823
+ # @param path [#to_s]
825
824
  # @return [String] path to the screenshot
826
- def screenshot name = "AXElements-ScreenShot", dir = '~/Desktop'
827
- # @todo this could move to its own class, much like
828
- # {Accessibility::Highlighter} and expose more options
829
- # while retaining good defaults
830
- dir = File.expand_path dir.to_s
831
- file = "#{dir}/#{name}-#{Time.now.strftime '%Y%m%d%H%M%S'}.png"
832
-
833
- cg_image = CGWindowListCreateImage(CGRectInfinite,
834
- KCGWindowListOptionOnScreenOnly,
835
- KCGNullWindowID,
836
- KCGWindowImageDefault)
837
- NSBitmapImageRep
838
- .alloc
839
- .initWithCGImage(cg_image)
840
- .representationUsingType(NSPNGFileType, properties: nil)
841
- .writeToFile(file, atomically: false)
842
-
843
- file
825
+ def screenshot rect = CGRect.new(CGPoint.new(0, 0), CGSize.new(-1, -1)),
826
+ path = '~/Desktop'
827
+ require 'accessibility/screen_shooter'
828
+ ScreenShooter.shoot rect.to_rect, path
844
829
  end
845
830
  alias_method :capture_screen, :screenshot
846
831
 
@@ -4,7 +4,7 @@
4
4
  # The main AXElements namespace.
5
5
  module Accessibility
6
6
  # @return [String]
7
- VERSION = '7.0.0.pre5'
7
+ VERSION = '7.0.0'
8
8
 
9
9
  # @return [String]
10
10
  CODE_NAME = 'ニンフィア'
@@ -423,6 +423,26 @@ class AX::Element
423
423
  output
424
424
  end
425
425
 
426
+ ##
427
+ # Take a screen shot of the receiving element and save it to disk. If a
428
+ # file path is not given then the default value will put it on the
429
+ # desktop. The actual file name will automatically generated with a
430
+ # timestamp.
431
+ #
432
+ # @example
433
+ #
434
+ # app.main_window.screenshot
435
+ # # => "~/Desktop/AXElements-ScreenShot-20120422184650.png"
436
+ #
437
+ # app.main_window.screenshot "/Volumes/SecretStash"
438
+ # # => "/Volumes/SecretStash/AXElements-ScreenShot-20150622032250.png"
439
+ #
440
+ # @param path [#to_s]
441
+ # @return [String] path to the screenshot
442
+ def screenshot path = '~/Desktop'
443
+ capture_screen self, path
444
+ end
445
+
426
446
  ##
427
447
  # Overriden to respond properly with regards to dynamic attribute
428
448
  # lookups, but will return false for potential implicit searches.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AXElements
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0.pre5
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rada
@@ -30,7 +30,7 @@ cert_chain:
30
30
  0WHcut5WdsOnrIkVkbvgxDUtQclWeulaIRqGkvnajtp2FJdRsi/n8zo3nAfeR6QM
31
31
  vkReJWGG0H8U/JJqYfQBZopYOUMnLJQxN+NA4w==
32
32
  -----END CERTIFICATE-----
33
- date: 2015-03-25 00:00:00.000000000 Z
33
+ date: 2015-06-22 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: mouse
@@ -66,14 +66,14 @@ dependencies:
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 0.5.0
69
+ version: 0.6.1
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 0.5.0
76
+ version: 0.6.1
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: accessibility_keyboard
79
79
  requirement: !ruby/object:Gem::Requirement
@@ -191,9 +191,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  requirements:
194
- - - ">"
194
+ - - ">="
195
195
  - !ruby/object:Gem::Version
196
- version: 1.3.1
196
+ version: '0'
197
197
  requirements: []
198
198
  rubyforge_project:
199
199
  rubygems_version: 2.4.3
metadata.gz.sig CHANGED
Binary file