accessibility_core 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.yardopts +9 -0
  2. data/History.markdown +36 -0
  3. data/README.markdown +66 -0
  4. data/Rakefile +72 -0
  5. data/ext/accessibility/bridge/ext/accessibility/bridge/bridge.c +490 -0
  6. data/ext/accessibility/bridge/ext/accessibility/bridge/extconf.rb +22 -0
  7. data/ext/accessibility/bridge/lib/accessibility/bridge.rb +33 -0
  8. data/ext/accessibility/bridge/lib/accessibility/bridge/common.rb +57 -0
  9. data/ext/accessibility/bridge/lib/accessibility/bridge/macruby.rb +185 -0
  10. data/ext/accessibility/bridge/lib/accessibility/bridge/mri.rb +121 -0
  11. data/ext/accessibility/bridge/lib/accessibility/bridge/version.rb +6 -0
  12. data/ext/accessibility/bridge/test/array_test.rb +31 -0
  13. data/ext/accessibility/bridge/test/boxed_test.rb +23 -0
  14. data/ext/accessibility/bridge/test/cfrange_test.rb +21 -0
  15. data/ext/accessibility/bridge/test/cgpoint_test.rb +54 -0
  16. data/ext/accessibility/bridge/test/cgrect_test.rb +60 -0
  17. data/ext/accessibility/bridge/test/cgsize_test.rb +54 -0
  18. data/ext/accessibility/bridge/test/helper.rb +19 -0
  19. data/ext/accessibility/bridge/test/nsstring_test.rb +22 -0
  20. data/ext/accessibility/bridge/test/nsurl_test.rb +17 -0
  21. data/ext/accessibility/bridge/test/object_test.rb +19 -0
  22. data/ext/accessibility/bridge/test/range_test.rb +16 -0
  23. data/ext/accessibility/bridge/test/string_test.rb +35 -0
  24. data/ext/accessibility/bridge/test/uri_test.rb +15 -0
  25. data/ext/accessibility/core/bridge.h +1 -0
  26. data/ext/accessibility/core/core.c +705 -0
  27. data/ext/accessibility/core/extconf.rb +22 -0
  28. data/ext/accessibility/highlighter/extconf.rb +22 -0
  29. data/ext/accessibility/highlighter/highlighter.c +7 -0
  30. data/lib/accessibility/core.rb +12 -0
  31. data/lib/accessibility/core/core_ext/common.rb +57 -0
  32. data/lib/accessibility/core/core_ext/macruby.rb +140 -0
  33. data/lib/accessibility/core/core_ext/mri.rb +121 -0
  34. data/lib/accessibility/core/macruby.rb +858 -0
  35. data/lib/accessibility/core/version.rb +6 -0
  36. data/test/helper.rb +48 -0
  37. metadata +158 -0
@@ -0,0 +1,6 @@
1
+ module Accessibility
2
+ module Core
3
+ # return [String]
4
+ VERSION = '0.1.0'
5
+ end
6
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,48 @@
1
+ # We want to launch the test app and make sure it responds to
2
+ # accessibility queries, but that is difficult to know at what
3
+ # point it will start to respond, so we just sleep
4
+ #
5
+ # We also want to make it registers it's at_exit hook before
6
+ # minitest does!
7
+ APP_BUNDLE_PATH = File.expand_path './test/fixture/Release/AXElementsTester.app'
8
+ APP_BUNDLE_IDENTIFIER = 'com.marketcircle.AXElementsTester'
9
+
10
+ `open #{APP_BUNDLE_PATH}`
11
+ sleep 3
12
+
13
+ at_exit do
14
+ `killall AXElementsTester`
15
+ end
16
+
17
+
18
+ require 'minitest/autorun'
19
+ require 'minitest/pride'
20
+ require 'accessibility/core'
21
+
22
+ class MiniTest::Unit::TestCase
23
+
24
+ PID = if on_macruby?
25
+ NSWorkspace.sharedWorkspace.runningApplications.find do |app|
26
+ app.bundleIdentifier == APP_BUNDLE_IDENTIFIER
27
+ end.processIdentifier
28
+ else
29
+ # a bit fragile, need to find a better solution
30
+ `ps aux | grep AXElementsTester`.chomp.split("\n").last.split(' ').at(1).to_i
31
+ end
32
+
33
+ # if this basic API doesn't work we might as well as give up right away
34
+ APP = Accessibility::Element.application_for PID
35
+
36
+ def rand_nums count, range = 1_000
37
+ Array.new count do
38
+ rand range
39
+ end
40
+ end
41
+
42
+ def rand_floats count, range = 1_000.0
43
+ Array.new count do
44
+ rand * range
45
+ end
46
+ end
47
+
48
+ end
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: accessibility_core
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mark Rada
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: accessibility_bridge
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: yard
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.8.3
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.3
46
+ - !ruby/object:Gem::Dependency
47
+ name: kramdown
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.14.1
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.14.1
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake-compiler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.8.1
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.8.1
78
+ description: ! 'accessibility_core is a wrapper around the OS X Accessibility framework.
79
+
80
+
81
+ Originally extracted from the AXElements project.
82
+
83
+ '
84
+ email: markrada26@gmail.com
85
+ executables: []
86
+ extensions:
87
+ - ext/accessibility/core/extconf.rb
88
+ extra_rdoc_files: []
89
+ files:
90
+ - lib/accessibility/core/core_ext/common.rb
91
+ - lib/accessibility/core/core_ext/macruby.rb
92
+ - lib/accessibility/core/core_ext/mri.rb
93
+ - lib/accessibility/core/macruby.rb
94
+ - lib/accessibility/core/version.rb
95
+ - lib/accessibility/core.rb
96
+ - ext/accessibility/bridge/ext/accessibility/bridge/bridge.c
97
+ - ext/accessibility/core/core.c
98
+ - ext/accessibility/highlighter/highlighter.c
99
+ - ext/accessibility/core/bridge.h
100
+ - ext/accessibility/bridge/ext/accessibility/bridge/extconf.rb
101
+ - ext/accessibility/bridge/lib/accessibility/bridge/common.rb
102
+ - ext/accessibility/bridge/lib/accessibility/bridge/macruby.rb
103
+ - ext/accessibility/bridge/lib/accessibility/bridge/mri.rb
104
+ - ext/accessibility/bridge/lib/accessibility/bridge/version.rb
105
+ - ext/accessibility/bridge/lib/accessibility/bridge.rb
106
+ - ext/accessibility/bridge/test/array_test.rb
107
+ - ext/accessibility/bridge/test/boxed_test.rb
108
+ - ext/accessibility/bridge/test/cfrange_test.rb
109
+ - ext/accessibility/bridge/test/cgpoint_test.rb
110
+ - ext/accessibility/bridge/test/cgrect_test.rb
111
+ - ext/accessibility/bridge/test/cgsize_test.rb
112
+ - ext/accessibility/bridge/test/helper.rb
113
+ - ext/accessibility/bridge/test/nsstring_test.rb
114
+ - ext/accessibility/bridge/test/nsurl_test.rb
115
+ - ext/accessibility/bridge/test/object_test.rb
116
+ - ext/accessibility/bridge/test/range_test.rb
117
+ - ext/accessibility/bridge/test/string_test.rb
118
+ - ext/accessibility/bridge/test/uri_test.rb
119
+ - ext/accessibility/core/extconf.rb
120
+ - ext/accessibility/highlighter/extconf.rb
121
+ - Rakefile
122
+ - README.markdown
123
+ - History.markdown
124
+ - .yardopts
125
+ - test/helper.rb
126
+ homepage: http://github.com/ferrous26/accessibility
127
+ licenses:
128
+ - BSD 3-clause
129
+ post_install_message:
130
+ rdoc_options: []
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ segments:
140
+ - 0
141
+ hash: 3560517301155000049
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
143
+ none: false
144
+ requirements:
145
+ - - ! '>='
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ segments:
149
+ - 0
150
+ hash: 3560517301155000049
151
+ requirements: []
152
+ rubyforge_project:
153
+ rubygems_version: 1.8.24
154
+ signing_key:
155
+ specification_version: 3
156
+ summary: A library for building automation tools on OS X
157
+ test_files:
158
+ - test/helper.rb