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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d0493a816344f5ccc123dad4b73a1bb8319c8d9
4
- data.tar.gz: 8c22311cacb394ab66126673e56231a11e69042d
3
+ metadata.gz: 5756803ad9fee99689694217261dfbba137d50d7
4
+ data.tar.gz: 4bfe28a1b93a06735ed6a83fce93855d8e52ca7e
5
5
  SHA512:
6
- metadata.gz: 22671b6eeee6f93555cdd3e55400de6d79b5556668da6a7accc4b7150520d0dc63df263556ba4adf7274a227a120a40314927adc7c5e9dda0143a68b964ccd5a
7
- data.tar.gz: 922d2972c09ad020135ee14cdd3d83c6d88979a7e5994ef0aa055fa1468c6259f4ab402a8f3c1204c2e89fa0d09268c50301c338de82ac5ed5211c60dd4b9c8a
6
+ metadata.gz: 87271b5c13e5c02aadf0faa1515f8a8c65c5771c1e2343d8675f3ea0fdf603094a5eae73792481b7aa8b0c637e30956dc9ddc8895c50d17d6dffffcd0fbfa05f
7
+ data.tar.gz: f86975805b7a90566de578722020aba59c512754895220e365ae109a4a78c8e4e5f1781b30d756929a0ed1c27102d5404a69f863cc337bf717772e4ff0adb5f3
@@ -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.2
10
- - rvm: 2.1
11
- - rvm: 1.9.3
12
- - rvm: 2.0
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.4 to differentiate the rvm version
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.4
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.4
31
+ - rvm: 2.1.9
21
32
 
@@ -1,3 +1,7 @@
1
+ ## 0.4.2 2016-07-04
2
+
3
+ * Allow Opal v0.10.0
4
+
1
5
  ## 0.4.1 2015-11-02
2
6
 
3
7
  * Updated specs to use jQuery 1.8 (that was initially released in 2012)
data/Gemfile CHANGED
@@ -1,2 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+
4
+ gem 'opal', ENV['OPAL_VERSION'] || '~> 0.10.0'
5
+ gem 'opal-rspec', github: 'opal/opal-rspec', submodules: true
6
+ gem 'rack', ENV['RACK_VERSION'] || '> 0'
@@ -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
- # returns an Array of Hashes
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
@@ -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
- `#@xhr.getResponseHeader(#{key});`
228
+ %x{
229
+ var value = #@xhr.getResponseHeader(#{key});
230
+ return (value === null) ? nil : value;
231
+ }
228
232
  end
229
233
 
230
234
  private
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module JQuery
3
- VERSION = '0.4.1'
3
+ VERSION = '0.4.2'
4
4
  end
5
5
  end
@@ -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.10.0'
19
- s.add_development_dependency 'opal-rspec', '~> 0.4.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
@@ -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)
@@ -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
@@ -1,6 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  </head>
5
6
  <body>
6
7
  <%= javascript_include_tag 'jquery/jquery' %>
@@ -1,6 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  </head>
5
6
  <body>
6
7
  <%= javascript_include_tag 'zepto/zepto' %>
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.1
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: 2015-11-02 00:00:00.000000000 Z
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.10.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.10.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.4.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.4.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.8
159
+ rubygems_version: 2.6.4
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Opal access to jquery