js2 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +3 -0
- data/Manifest.txt +1 -0
- data/README +69 -0
- data/README.rdoc +28 -7
- data/README.txt +69 -0
- data/lib/js2/test/selenium_element.rb +19 -5
- data/lib/js2.rb +1 -1
- metadata +7 -5
data/Changelog
CHANGED
data/Manifest.txt
CHANGED
data/README
CHANGED
@@ -0,0 +1,69 @@
|
|
1
|
+
= js2
|
2
|
+
|
3
|
+
* http://code.google.com/p/js2lang
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
A cross-browser object oriented approach to javascript
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* Class Definition Syntax
|
12
|
+
* Inheritence
|
13
|
+
* getters / setters
|
14
|
+
* Mixins
|
15
|
+
* Static Methods
|
16
|
+
* currying
|
17
|
+
* foreach
|
18
|
+
|
19
|
+
== SYNOPSIS:
|
20
|
+
|
21
|
+
class My.Base {
|
22
|
+
function sayHi () {
|
23
|
+
alert("hi");
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
class My.Concrete {
|
29
|
+
function sayHello () {
|
30
|
+
alert("hello");
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
js2 --out-dir=/dir/to/write/js/code /dir/with/js2/clode
|
36
|
+
|
37
|
+
== REQUIREMENTS:
|
38
|
+
|
39
|
+
* RubyInline
|
40
|
+
* HAML (optional)
|
41
|
+
|
42
|
+
== INSTALL:
|
43
|
+
|
44
|
+
gem install js2
|
45
|
+
|
46
|
+
== LICENSE:
|
47
|
+
|
48
|
+
(The MIT License)
|
49
|
+
|
50
|
+
Copyright (c) 2009 FIXME full name
|
51
|
+
|
52
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
53
|
+
a copy of this software and associated documentation files (the
|
54
|
+
'Software'), to deal in the Software without restriction, including
|
55
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
56
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
57
|
+
permit persons to whom the Software is furnished to do so, subject to
|
58
|
+
the following conditions:
|
59
|
+
|
60
|
+
The above copyright notice and this permission notice shall be
|
61
|
+
included in all copies or substantial portions of the Software.
|
62
|
+
|
63
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
64
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
65
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
66
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
67
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
68
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
69
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
CHANGED
@@ -1,26 +1,47 @@
|
|
1
1
|
= js2
|
2
2
|
|
3
|
-
* http://
|
3
|
+
* http://code.google.com/p/js2lang
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
|
-
|
7
|
+
A cross-browser object oriented approach to javascript
|
8
8
|
|
9
9
|
== FEATURES/PROBLEMS:
|
10
10
|
|
11
|
-
*
|
11
|
+
* Class Definition Syntax
|
12
|
+
* Inheritence
|
13
|
+
* getters / setters
|
14
|
+
* Mixins
|
15
|
+
* Static Methods
|
16
|
+
* currying
|
17
|
+
* foreach
|
12
18
|
|
13
19
|
== SYNOPSIS:
|
14
20
|
|
15
|
-
|
21
|
+
class My.Base {
|
22
|
+
function sayHi () {
|
23
|
+
alert("hi");
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
class My.Concrete {
|
29
|
+
function sayHello () {
|
30
|
+
alert("hello");
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
js2 --out-dir=/dir/to/write/js/code /dir/with/js2/clode
|
16
36
|
|
17
37
|
== REQUIREMENTS:
|
18
38
|
|
19
|
-
*
|
39
|
+
* RubyInline
|
40
|
+
* HAML (optional)
|
20
41
|
|
21
42
|
== INSTALL:
|
22
43
|
|
23
|
-
|
44
|
+
gem install js2
|
24
45
|
|
25
46
|
== LICENSE:
|
26
47
|
|
@@ -45,4 +66,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
45
66
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
46
67
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
47
68
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
48
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
69
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.txt
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
= js2
|
2
|
+
|
3
|
+
* http://code.google.com/p/js2lang
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
A cross-browser object oriented approach to javascript
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* Class Definition Syntax
|
12
|
+
* Inheritence
|
13
|
+
* getters / setters
|
14
|
+
* Mixins
|
15
|
+
* Static Methods
|
16
|
+
* currying
|
17
|
+
* foreach
|
18
|
+
|
19
|
+
== SYNOPSIS:
|
20
|
+
|
21
|
+
class My.Base {
|
22
|
+
function sayHi () {
|
23
|
+
alert("hi");
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
class My.Concrete {
|
29
|
+
function sayHello () {
|
30
|
+
alert("hello");
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
js2 --out-dir=/dir/to/write/js/code /dir/with/js2/clode
|
36
|
+
|
37
|
+
== REQUIREMENTS:
|
38
|
+
|
39
|
+
* RubyInline
|
40
|
+
* HAML (optional)
|
41
|
+
|
42
|
+
== INSTALL:
|
43
|
+
|
44
|
+
gem install js2
|
45
|
+
|
46
|
+
== LICENSE:
|
47
|
+
|
48
|
+
(The MIT License)
|
49
|
+
|
50
|
+
Copyright (c) 2009 FIXME full name
|
51
|
+
|
52
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
53
|
+
a copy of this software and associated documentation files (the
|
54
|
+
'Software'), to deal in the Software without restriction, including
|
55
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
56
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
57
|
+
permit persons to whom the Software is furnished to do so, subject to
|
58
|
+
the following conditions:
|
59
|
+
|
60
|
+
The above copyright notice and this permission notice shall be
|
61
|
+
included in all copies or substantial portions of the Software.
|
62
|
+
|
63
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
64
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
65
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
66
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
67
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
68
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
69
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -42,6 +42,10 @@ class JS2::Test::SeleniumElement
|
|
42
42
|
return self.check_attribute(':visible', true, wait_for);
|
43
43
|
end
|
44
44
|
|
45
|
+
def sel_visible?()
|
46
|
+
return @sel.visible?(get_ele())
|
47
|
+
end
|
48
|
+
|
45
49
|
def hidden?(wait_for = nil)
|
46
50
|
return self.check_attribute(':visible', false, wait_for);
|
47
51
|
end
|
@@ -69,10 +73,14 @@ class JS2::Test::SeleniumElement
|
|
69
73
|
|
70
74
|
def attr (attr)
|
71
75
|
get_ele()
|
72
|
-
js = %{
|
76
|
+
js = %{window.$(#{get_js_locator()}).attr(#{attr.to_json});}
|
73
77
|
return @sel.js_eval(js)
|
74
78
|
end
|
75
79
|
|
80
|
+
def jq_attr (attr)
|
81
|
+
return @sel.execute("window.$(#{get_js_locator()}).#{attr};")
|
82
|
+
end
|
83
|
+
|
76
84
|
def check_attribute (attr, val, wait_for = nil)
|
77
85
|
wait_for ||= QUICK_WAIT_FOR
|
78
86
|
get_ele()
|
@@ -134,12 +142,12 @@ class JS2::Test::SeleniumElement
|
|
134
142
|
trigger("LEFT_MOUSE_DOWN")
|
135
143
|
end
|
136
144
|
|
137
|
-
def mouse_over
|
138
|
-
@sel.mouse_over(get_ele()
|
145
|
+
def mouse_over
|
146
|
+
@sel.mouse_over(get_ele())
|
139
147
|
end
|
140
148
|
|
141
|
-
def mouse_out
|
142
|
-
@sel.mouse_out(get_ele()
|
149
|
+
def mouse_out
|
150
|
+
@sel.mouse_out(get_ele())
|
143
151
|
end
|
144
152
|
|
145
153
|
def type (*params)
|
@@ -148,6 +156,12 @@ class JS2::Test::SeleniumElement
|
|
148
156
|
@sel.fire_event(elem, 'blur')
|
149
157
|
end
|
150
158
|
|
159
|
+
def select(params)
|
160
|
+
elem = get_ele()
|
161
|
+
@sel.select(elem, params)
|
162
|
+
@sel.fire_event(elem, 'blur')
|
163
|
+
end
|
164
|
+
|
151
165
|
def html ()
|
152
166
|
wait_for_ajax
|
153
167
|
js = get_js_locator()
|
data/lib/js2.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Su
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-30 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 2.3.3
|
44
44
|
version:
|
45
|
-
description:
|
45
|
+
description: A cross-browser object oriented approach to javascript
|
46
46
|
email:
|
47
47
|
- me@jeffsu.com
|
48
48
|
executables:
|
@@ -53,6 +53,7 @@ extra_rdoc_files:
|
|
53
53
|
- History.txt
|
54
54
|
- Manifest.txt
|
55
55
|
- PostInstall.txt
|
56
|
+
- README.txt
|
56
57
|
- website/index.txt
|
57
58
|
files:
|
58
59
|
- Changelog
|
@@ -61,6 +62,7 @@ files:
|
|
61
62
|
- Manifest.txt
|
62
63
|
- PostInstall.txt
|
63
64
|
- README
|
65
|
+
- README.txt
|
64
66
|
- README.rdoc
|
65
67
|
- Rakefile
|
66
68
|
- examples/js2.yml
|
@@ -100,7 +102,7 @@ files:
|
|
100
102
|
- bin/js2
|
101
103
|
- website/index.txt
|
102
104
|
has_rdoc: true
|
103
|
-
homepage: http://
|
105
|
+
homepage: http://code.google.com/p/js2lang
|
104
106
|
licenses: []
|
105
107
|
|
106
108
|
post_install_message:
|
@@ -127,6 +129,6 @@ rubyforge_project: js2
|
|
127
129
|
rubygems_version: 1.3.5
|
128
130
|
signing_key:
|
129
131
|
specification_version: 3
|
130
|
-
summary:
|
132
|
+
summary: A cross-browser object oriented approach to javascript
|
131
133
|
test_files: []
|
132
134
|
|