hexp 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -14
- data/Gemfile.lock +27 -26
- data/hexp.gemspec +1 -1
- data/lib/hexp/css_selector.rb +6 -0
- data/lib/hexp/css_selector/sass_parser.rb +3 -1
- data/lib/hexp/version.rb +1 -1
- data/spec/unit/hexp/css_selector/attribute_spec.rb +13 -0
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd5812a1b6d435382838232f4cec4d2fdb2162d2
|
4
|
+
data.tar.gz: eeff9a4c48a878863a8bc020d4ae37d0dd01d8ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbfde6d4249a6726cc2c492a26b14e2ad79b253844fb813eae65a1fa8eeedac4106a8dcc16155fcbe87312124448e6f6fbfb6078f151cb26eeb01dfbcbe659f1
|
7
|
+
data.tar.gz: 8ad112e34c87099bf467b5fa1e5a6ff5795a8d4494c24f6c2cd8074b8edb87b57dfc3bccc176fc85d20ab0bcac1b4366d0b942acf922f98e348f5c35631e8826
|
data/.travis.yml
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
bundler_args: --without yard guard benchmarks
|
4
|
-
script: "bundle exec rake ci:travis"
|
2
|
+
script: "bundle exec rspec"
|
5
3
|
rvm:
|
6
4
|
- 1.9.2
|
7
5
|
- 1.9.3
|
@@ -9,18 +7,7 @@ rvm:
|
|
9
7
|
- 2.1.0
|
10
8
|
- ruby-head
|
11
9
|
matrix:
|
12
|
-
include:
|
13
|
-
- rvm: jruby-19mode
|
14
|
-
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
15
|
-
- rvm: jruby-head
|
16
|
-
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
17
10
|
allow_failures:
|
18
11
|
- rvm: jruby-19mode
|
19
12
|
- rvm: ruby-head
|
20
13
|
- rvm: jruby-head
|
21
|
-
notifications:
|
22
|
-
email:
|
23
|
-
recipients:
|
24
|
-
- arne@arnebrasseur.net
|
25
|
-
on_success: never
|
26
|
-
on_failure: change
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/rom-rb/devtools.git
|
3
|
-
revision:
|
3
|
+
revision: f831a3b8963ee4d4104b988b4d68e772acd25373
|
4
4
|
specs:
|
5
5
|
devtools (0.0.2)
|
6
6
|
|
7
7
|
GIT
|
8
8
|
remote: https://github.com/dkubb/yardstick.git
|
9
|
-
revision:
|
9
|
+
revision: 2ab8dd59c64e9da098294b9056d08794cb06e994
|
10
10
|
specs:
|
11
11
|
yardstick (0.9.9)
|
12
12
|
yard (~> 0.8, >= 0.8.7.2)
|
@@ -14,11 +14,11 @@ GIT
|
|
14
14
|
PATH
|
15
15
|
remote: .
|
16
16
|
specs:
|
17
|
-
hexp (0.3.
|
17
|
+
hexp (0.3.3)
|
18
18
|
equalizer (~> 0.0)
|
19
19
|
ice_nine (~> 0.9)
|
20
20
|
nokogiri (~> 1.6)
|
21
|
-
sass (~> 3.2.
|
21
|
+
sass (~> 3.2.19)
|
22
22
|
|
23
23
|
GEM
|
24
24
|
remote: https://rubygems.org/
|
@@ -74,11 +74,11 @@ GEM
|
|
74
74
|
rb-fsevent (>= 0.9.3)
|
75
75
|
rb-inotify (>= 0.9)
|
76
76
|
rb-kqueue (>= 0.2)
|
77
|
-
lumberjack (1.0.
|
77
|
+
lumberjack (1.0.5)
|
78
78
|
method_source (0.8.2)
|
79
|
-
mime-types (2.
|
79
|
+
mime-types (2.2)
|
80
80
|
mini_portile (0.5.3)
|
81
|
-
multi_json (1.
|
81
|
+
multi_json (1.9.2)
|
82
82
|
nokogiri (1.6.1)
|
83
83
|
mini_portile (~> 0.5.0)
|
84
84
|
nokogiri (1.6.1-java)
|
@@ -87,11 +87,11 @@ GEM
|
|
87
87
|
ast (~> 1.1)
|
88
88
|
slop (~> 3.4, >= 3.4.5)
|
89
89
|
powerpack (0.0.9)
|
90
|
-
pry (0.9.12.
|
90
|
+
pry (0.9.12.6)
|
91
91
|
coderay (~> 1.0)
|
92
92
|
method_source (~> 0.8)
|
93
93
|
slop (~> 3.4)
|
94
|
-
pry (0.9.12.
|
94
|
+
pry (0.9.12.6-java)
|
95
95
|
coderay (~> 1.0)
|
96
96
|
method_source (~> 0.8)
|
97
97
|
slop (~> 3.4)
|
@@ -103,13 +103,14 @@ GEM
|
|
103
103
|
rb-fsevent (0.9.4)
|
104
104
|
rb-inotify (0.9.3)
|
105
105
|
ffi (>= 0.5.0)
|
106
|
-
rb-kqueue (0.2.
|
106
|
+
rb-kqueue (0.2.2)
|
107
107
|
ffi (>= 0.5.0)
|
108
108
|
rb-notifu (0.0.4)
|
109
109
|
rbench (0.2.3)
|
110
|
-
reek (1.3.
|
111
|
-
|
112
|
-
|
110
|
+
reek (1.3.7)
|
111
|
+
rainbow
|
112
|
+
ruby2ruby (~> 2.0.8)
|
113
|
+
ruby_parser (~> 3.3)
|
113
114
|
sexp_processor
|
114
115
|
rest-client (1.6.7)
|
115
116
|
mime-types (>= 1.16)
|
@@ -117,35 +118,35 @@ GEM
|
|
117
118
|
rspec-core (~> 2.14.0)
|
118
119
|
rspec-expectations (~> 2.14.0)
|
119
120
|
rspec-mocks (~> 2.14.0)
|
120
|
-
rspec-core (2.14.
|
121
|
-
rspec-expectations (2.14.
|
121
|
+
rspec-core (2.14.8)
|
122
|
+
rspec-expectations (2.14.5)
|
122
123
|
diff-lcs (>= 1.1.3, < 2.0)
|
123
|
-
rspec-mocks (2.14.
|
124
|
+
rspec-mocks (2.14.6)
|
124
125
|
rubocop (0.11.1)
|
125
126
|
backports (~> 3.3.3)
|
126
127
|
parser (~> 2.0.0.pre6)
|
127
128
|
powerpack (~> 0.0.3)
|
128
129
|
rainbow (>= 1.1.4)
|
129
|
-
ruby2ruby (2.0.
|
130
|
+
ruby2ruby (2.0.8)
|
130
131
|
ruby_parser (~> 3.1)
|
131
132
|
sexp_processor (~> 4.0)
|
132
|
-
ruby_parser (3.
|
133
|
+
ruby_parser (3.5.0)
|
133
134
|
sexp_processor (~> 4.1)
|
134
|
-
sass (3.2.
|
135
|
-
sexp_processor (4.4.
|
135
|
+
sass (3.2.19)
|
136
|
+
sexp_processor (4.4.3)
|
136
137
|
simplecov (0.7.1)
|
137
138
|
multi_json (~> 1.0)
|
138
139
|
simplecov-html (~> 0.7.1)
|
139
140
|
simplecov-html (0.7.1)
|
140
|
-
slop (3.
|
141
|
+
slop (3.5.0)
|
141
142
|
spoon (0.0.4)
|
142
143
|
ffi
|
143
|
-
term-ansicolor (1.
|
144
|
-
tins (~> 0
|
144
|
+
term-ansicolor (1.3.0)
|
145
|
+
tins (~> 1.0)
|
145
146
|
terminal-notifier-guard (1.5.3)
|
146
|
-
thor (0.
|
147
|
-
tins (
|
148
|
-
yard (0.8.7.
|
147
|
+
thor (0.19.1)
|
148
|
+
tins (1.1.0)
|
149
|
+
yard (0.8.7.4)
|
149
150
|
yard-spellcheck (0.1.5)
|
150
151
|
ffi-hunspell (~> 0.2)
|
151
152
|
yard (~> 0.6)
|
data/hexp.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = `git ls-files -- spec`.split($/)
|
18
18
|
gem.extra_rdoc_files = %w[README.md]
|
19
19
|
|
20
|
-
gem.add_runtime_dependency 'sass', '~> 3.2.
|
20
|
+
gem.add_runtime_dependency 'sass', '~> 3.2.19'
|
21
21
|
gem.add_runtime_dependency 'nokogiri', '~> 1.6'
|
22
22
|
gem.add_runtime_dependency 'ice_nine', '~> 0.9'
|
23
23
|
gem.add_runtime_dependency 'equalizer', '~> 0.0'
|
data/lib/hexp/css_selector.rb
CHANGED
@@ -276,6 +276,12 @@ module Hexp
|
|
276
276
|
return false unless element[name]
|
277
277
|
attribute = element[name]
|
278
278
|
|
279
|
+
# TODO: check the spec with regards to IDENTIFIERS vs STRINGS as value
|
280
|
+
# see if we can lett SASS parse the string instead of unwrapping
|
281
|
+
# it ourselves
|
282
|
+
value = self.value
|
283
|
+
value = $1.gsub('\"', '"') if value =~ /\A"?(.*?)"?\z/
|
284
|
+
|
279
285
|
case operator
|
280
286
|
# CSS 2
|
281
287
|
when nil
|
@@ -9,7 +9,9 @@ module Hexp
|
|
9
9
|
#
|
10
10
|
# @api private
|
11
11
|
def initialize(selector)
|
12
|
-
|
12
|
+
# TODO this is a private API and has before changed in minor versions,
|
13
|
+
# see if there is a more robust call.
|
14
|
+
super(selector, '', 0)
|
13
15
|
end
|
14
16
|
|
15
17
|
# Parse the selector
|
data/lib/hexp/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
1
3
|
describe Hexp::CssSelector::Attribute do
|
2
4
|
subject(:selector) { described_class.new(name, namespace, operator, value, flags) }
|
3
5
|
let(:name) { nil }
|
@@ -134,4 +136,15 @@ describe Hexp::CssSelector::Attribute do
|
|
134
136
|
end
|
135
137
|
end
|
136
138
|
|
139
|
+
describe '$= with quoted string values' do
|
140
|
+
subject(:selector) { Hexp::CssSelector::Parser.new('[src$="foo/bar.js"]').parse }
|
141
|
+
|
142
|
+
it 'should match correctly' do
|
143
|
+
expect(selector.matches? H[:script, src: "/tmp/foo/bar.js"]).to be_true
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'should only match at the end' do
|
147
|
+
expect(selector.matches? H[:script, src: "/tmp/foo/bar.jsx"]).to be_false
|
148
|
+
end
|
149
|
+
end
|
137
150
|
end
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arne Brasseur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2.
|
19
|
+
version: 3.2.19
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.2.
|
26
|
+
version: 3.2.19
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ice_nine
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.9'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: equalizer
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '10.1'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '10.1'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '2.14'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.14'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: benchmark_suite
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '1.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.0'
|
111
111
|
description: Generate and manipulate HTML documents and nodes.
|
@@ -116,9 +116,9 @@ extensions: []
|
|
116
116
|
extra_rdoc_files:
|
117
117
|
- README.md
|
118
118
|
files:
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
119
|
+
- .gitignore
|
120
|
+
- .travis.yml
|
121
|
+
- .yardopts
|
122
122
|
- Changelog.md
|
123
123
|
- Gemfile
|
124
124
|
- Gemfile.devtools
|
@@ -208,17 +208,17 @@ require_paths:
|
|
208
208
|
- lib
|
209
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
|
-
- -
|
211
|
+
- - '>='
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- -
|
216
|
+
- - '>='
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.0.14
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Generate and manipulate HTML documents and nodes.
|