watir-ng 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b30575bd85b1df23cde1446b8a4f3280b498a02c
4
+ data.tar.gz: 3fbaf91d2a2ba2fe45170607b3f8c1644cfd247f
5
+ SHA512:
6
+ metadata.gz: 58ddc387d8969e749064e93cd71ae6fc07ea5734cf7d4baf201c660d5886b11cd91204515744f4747383d2fd065a9cf220c5a3780e4d731d07bb8589379a24cf
7
+ data.tar.gz: 1a1f18d275085b8f3959d8d850a0a2163f701411dfd6d2f4834450a46e5c43f4df0295131229d5ba1b3cc858d5c29e3fcec709f0ce6ac5897d82db3e5d7d2f0d
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
6
+ - 2.2.2
7
+ script: bundle exec rspec spec
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in watir-ng.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Johnson Denen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # watir-ng
2
+ [![Build Status](https://travis-ci.org/jdenen/watir-ng.svg?branch=master)](https://travis-ci.org/jdenen/watir-ng)
3
+
4
+ Identify [watir-webdriver](http://github.com/watir/watir-webdriver) elements with AngularJS [ng](https://docs.angularjs.org/api/ng/directive) directives.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/watir-ng.rb ADDED
@@ -0,0 +1,51 @@
1
+ require "watir-webdriver"
2
+ require "watir-ng/version"
3
+
4
+ #
5
+ # Adds AngularJS `ng` directives as identifiers for `Watir::Webdriver` elements.
6
+ #
7
+ module WatirNg
8
+
9
+ #
10
+ # All the ng directives from the AngularJS documentation.
11
+ #
12
+ # @see `https://docs.angularjs.org/api/ng/directive`
13
+ #
14
+ NG_STRINGS = %w(ng_jq ng_app ng_href ng_src ng_srcset ng_disabled ng_checked ng_readonly
15
+ ng_selected ng_open ng_form ng_value ng_bind ng_bind_template ng_bind_html
16
+ ng_change ng_class ng_class_odd ng_class_even ng_cloak ng_controller ng_csp
17
+ ng_click ng_dblclick ng_mousedown ng_mouseup ng_mouseover ng_mouseenter
18
+ ng_mouseleave ng_mousemove ng_keydown ng_keyup ng_keypress ng_submit ng_focus
19
+ ng_blur ng_copy ng_cut ng_paste ng_if ng_include ng_init ng_list ng_model
20
+ ng_model_options ng_non_bindable ng_options ng_pluralize ng_repeat ng_show
21
+ ng_hide ng_style ng_switch ng_transclude
22
+ )
23
+
24
+ #
25
+ # Inserts `NG_STRINGS` into `cls.attributes` as symbols when included in the class.
26
+ #
27
+ # @param cls [Class]
28
+ # @return [nil]
29
+ #
30
+ def self.included cls
31
+ if cls.respond_to? :attributes
32
+ ng_directives.each { |ng| cls.attributes << ng }
33
+ end
34
+ end
35
+
36
+ #
37
+ # Converts `NG_STRINGS` into an array of symbols.
38
+ #
39
+ # @api private
40
+ # @return [Array<Symbol>] directives
41
+ #
42
+ def self.ng_directives
43
+ @ng_directives ||= NG_STRINGS.map(&:to_sym)
44
+ end
45
+ end
46
+
47
+ module Watir
48
+ class HTMLElement
49
+ include WatirNg
50
+ end
51
+ end
@@ -0,0 +1,4 @@
1
+ module WatirNg
2
+ # @api private
3
+ VERSION = "0.1.0"
4
+ end
data/watir-ng.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'watir-ng/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "watir-ng"
8
+ spec.version = WatirNg::VERSION
9
+ spec.authors = ["Johnson Denen"]
10
+ spec.email = ["johnson.denen@gmail.com"]
11
+
12
+ spec.summary = %q{Use AngularJS ng directives as element identifiers with watir-webdriver}
13
+ spec.description = %q{Use AngularJS ng directives as element identifiers with watir-webdriver}
14
+ spec.homepage = "http://github.com/jdenen/watir-ng"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "watir-webdriver", "~> 0.7.0"
22
+
23
+ spec.add_development_dependency "bundler"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.2.0"
26
+ spec.add_development_dependency "cucumber", "~> 2.0.0"
27
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: watir-ng
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Johnson Denen
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: watir-webdriver
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.7.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.7.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.0.0
83
+ description: Use AngularJS ng directives as element identifiers with watir-webdriver
84
+ email:
85
+ - johnson.denen@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".travis.yml"
92
+ - Gemfile
93
+ - LICENSE
94
+ - README.md
95
+ - Rakefile
96
+ - lib/watir-ng.rb
97
+ - lib/watir-ng/version.rb
98
+ - watir-ng.gemspec
99
+ homepage: http://github.com/jdenen/watir-ng
100
+ licenses: []
101
+ metadata: {}
102
+ post_install_message:
103
+ rdoc_options: []
104
+ require_paths:
105
+ - lib
106
+ required_ruby_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ requirements: []
117
+ rubyforge_project:
118
+ rubygems_version: 2.4.5
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: Use AngularJS ng directives as element identifiers with watir-webdriver
122
+ test_files: []
123
+ has_rdoc: