opal-jquery 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +19 -8
- data/CHANGELOG.md +4 -0
- data/Gemfile +4 -0
- data/lib/opal/jquery/element.rb +8 -1
- data/lib/opal/jquery/http.rb +5 -1
- data/lib/opal/jquery/version.rb +1 -1
- data/opal-jquery.gemspec +2 -2
- data/spec/element_spec.rb +12 -0
- data/spec/http_spec.rb +14 -0
- data/spec/jquery/index.html.erb +1 -0
- data/spec/zepto/index.html.erb +1 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5756803ad9fee99689694217261dfbba137d50d7
|
4
|
+
data.tar.gz: 4bfe28a1b93a06735ed6a83fce93855d8e52ca7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87271b5c13e5c02aadf0faa1515f8a8c65c5771c1e2343d8675f3ea0fdf603094a5eae73792481b7aa8b0c637e30956dc9ddc8895c50d17d6dffffcd0fbfa05f
|
7
|
+
data.tar.gz: f86975805b7a90566de578722020aba59c512754895220e365ae109a4a78c8e4e5f1781b30d756929a0ed1c27102d5404a69f863cc337bf717772e4ff0adb5f3
|
data/.travis.yml
CHANGED
@@ -4,18 +4,29 @@ sudo: false
|
|
4
4
|
fast_finish: true
|
5
5
|
script: rake $RUN
|
6
6
|
|
7
|
+
before_install:
|
8
|
+
# thanks to https://mediocre.com/forum/topics/phantomjs-2-and-travis-ci-we-beat-our-heads-against-a-wall-so-you-dont-have-to
|
9
|
+
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
|
10
|
+
- tar -xjf phantomjs-2.0.0-ubuntu-12.04.tar.bz2
|
11
|
+
# Keep track of which version of phantomjs we're running the specs against
|
12
|
+
- phantomjs -v
|
13
|
+
|
7
14
|
matrix:
|
8
15
|
include:
|
9
|
-
- rvm: 2.
|
10
|
-
|
11
|
-
- rvm:
|
12
|
-
|
16
|
+
- rvm: 2.3.1
|
17
|
+
env: PATH=".:$PATH"
|
18
|
+
- rvm: 2.2.4
|
19
|
+
env: PATH=".:$PATH"
|
20
|
+
- rvm: 2.1.10
|
21
|
+
env: PATH=".:$PATH" RACK_VERSION='< 2.0'
|
22
|
+
- rvm: 2.0.0
|
23
|
+
env: PATH=".:$PATH" RACK_VERSION='< 2.0'
|
13
24
|
|
14
|
-
# We use 2.1.
|
25
|
+
# We use 2.1.9 to differentiate the rvm version
|
15
26
|
# as travis doesn't allow failures by env.
|
16
|
-
- rvm: 2.1.
|
17
|
-
env: RUN=zepto
|
27
|
+
- rvm: 2.1.9
|
28
|
+
env: RUN=zepto PATH=".:$PATH" RACK_VERSION='< 2.0'
|
18
29
|
|
19
30
|
allow_failures:
|
20
|
-
- rvm: 2.1.
|
31
|
+
- rvm: 2.1.9
|
21
32
|
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/opal/jquery/element.rb
CHANGED
@@ -261,6 +261,11 @@ class Element < `#{JQUERY_CLASS.to_n}`
|
|
261
261
|
# @return [Element]
|
262
262
|
alias_native :filter
|
263
263
|
|
264
|
+
# @!method not(selector)
|
265
|
+
# @param selector [String]
|
266
|
+
# @return [Element]
|
267
|
+
alias_native :not
|
268
|
+
|
264
269
|
# @!method last
|
265
270
|
#
|
266
271
|
# Returns a new {Element} instance containing the last element in this
|
@@ -699,7 +704,9 @@ class Element < `#{JQUERY_CLASS.to_n}`
|
|
699
704
|
}
|
700
705
|
end
|
701
706
|
|
702
|
-
#
|
707
|
+
# Serializes a form into an Array of Hash objects.
|
708
|
+
#
|
709
|
+
# @return [Array<Hashes>]
|
703
710
|
def serialize_array
|
704
711
|
`self.serializeArray()`.map { |e| Hash.new(e) }
|
705
712
|
end
|
data/lib/opal/jquery/http.rb
CHANGED
@@ -223,8 +223,12 @@ class HTTP
|
|
223
223
|
#
|
224
224
|
# @param key [String] name of the header to get
|
225
225
|
# @return [String] value of the header
|
226
|
+
# @return [nil] if the header +key+ was not in the response
|
226
227
|
def get_header(key)
|
227
|
-
|
228
|
+
%x{
|
229
|
+
var value = #@xhr.getResponseHeader(#{key});
|
230
|
+
return (value === null) ? nil : value;
|
231
|
+
}
|
228
232
|
end
|
229
233
|
|
230
234
|
private
|
data/lib/opal/jquery/version.rb
CHANGED
data/opal-jquery.gemspec
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.require_paths = ['lib']
|
17
17
|
|
18
|
-
s.add_runtime_dependency 'opal', '>= 0.7.0', '< 0.
|
19
|
-
s.add_development_dependency 'opal-rspec', '~> 0.
|
18
|
+
s.add_runtime_dependency 'opal', '>= 0.7.0', '< 0.11.0'
|
19
|
+
s.add_development_dependency 'opal-rspec', '~> 0.5'
|
20
20
|
s.add_development_dependency 'yard'
|
21
21
|
s.add_development_dependency 'rake'
|
22
22
|
end
|
data/spec/element_spec.rb
CHANGED
@@ -165,6 +165,18 @@ describe Element do
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
168
|
+
describe ".not" do
|
169
|
+
it "should subtract from a set of elements" do
|
170
|
+
divs = Element['#foo, .woosh']
|
171
|
+
divs.should be_kind_of(Element)
|
172
|
+
divs.size.should == 3
|
173
|
+
|
174
|
+
subtracted = divs.not('#foo')
|
175
|
+
subtracted.should be_kind_of(Element)
|
176
|
+
subtracted.length.should == 2
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
168
180
|
describe '.id' do
|
169
181
|
it "should return a new instance with the element with given id" do
|
170
182
|
Element.id('foo').should be_kind_of(Element)
|
data/spec/http_spec.rb
CHANGED
@@ -78,4 +78,18 @@ describe HTTP do
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
81
|
+
|
82
|
+
describe '#get_header' do
|
83
|
+
async 'returns the header value' do
|
84
|
+
HTTP.get(good_url) do |response|
|
85
|
+
async { expect(response.get_header 'Content-Type').to eq 'text/plain' }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
async 'returns nil' do
|
90
|
+
HTTP.get(good_url) do |response|
|
91
|
+
async { expect(response.get_header 'Does-Not-Exist').to be nil }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
81
95
|
end
|
data/spec/jquery/index.html.erb
CHANGED
data/spec/zepto/index.html.erb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-jquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Beynon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.7.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.11.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,21 +29,21 @@ dependencies:
|
|
29
29
|
version: 0.7.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.11.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: opal-rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
39
|
+
version: '0.5'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
46
|
+
version: '0.5'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: yard
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
158
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.4
|
159
|
+
rubygems_version: 2.6.4
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Opal access to jquery
|