axeml 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/axeml.gemspec +4 -1
- data/lib/axeml.rb +6 -1
- data/spec/basic_spec.rb +5 -0
- metadata +19 -3
data/README.md
CHANGED
@@ -43,7 +43,7 @@ The syntax can be described by the following grammar:
|
|
43
43
|
|
44
44
|
|
45
45
|
Note that since `AxeML.transform` returns an instance of
|
46
|
-
`Nokogiri::XML::Document` you can directly use its search facilities
|
46
|
+
`Nokogiri::XML::Document` you can directly use its search facilities,
|
47
47
|
for example:
|
48
48
|
|
49
49
|
AxeML.transform([:foo, [:bar, [:baz, "very well"]]]).search('foo baz').text
|
data/Rakefile
CHANGED
@@ -12,6 +12,7 @@ begin
|
|
12
12
|
gem.authors = ["Moritz Heidkamp"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
14
|
gem.add_dependency 'nokogiri'
|
15
|
+
gem.add_dependency 'active_support', '>= 2.3.8'
|
15
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
17
|
end
|
17
18
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/axeml.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{axeml}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Moritz Heidkamp"]
|
@@ -45,13 +45,16 @@ Gem::Specification.new do |s|
|
|
45
45
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
46
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
47
47
|
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<active_support>, [">= 2.3.8"])
|
48
49
|
else
|
49
50
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
50
51
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
52
|
+
s.add_dependency(%q<active_support>, [">= 2.3.8"])
|
51
53
|
end
|
52
54
|
else
|
53
55
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
54
56
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
57
|
+
s.add_dependency(%q<active_support>, [">= 2.3.8"])
|
55
58
|
end
|
56
59
|
end
|
57
60
|
|
data/lib/axeml.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'nokogiri'
|
2
|
+
require 'active_support'
|
2
3
|
|
3
4
|
module AxeML
|
4
5
|
|
@@ -18,7 +19,11 @@ module AxeML
|
|
18
19
|
when Array
|
19
20
|
transform_element(e, doc, el)
|
20
21
|
when String
|
21
|
-
|
22
|
+
if e.html_safe?
|
23
|
+
el.add_child(e)
|
24
|
+
else
|
25
|
+
el.content += e
|
26
|
+
end
|
22
27
|
when Fixnum, Float
|
23
28
|
el.content += e.to_s
|
24
29
|
when Hash
|
data/spec/basic_spec.rb
CHANGED
@@ -46,5 +46,10 @@ describe AxeML do
|
|
46
46
|
doc.search('foo foo:first').text.should == 'bar'
|
47
47
|
doc.search('foo foo:last').text.should == 'baz'
|
48
48
|
end
|
49
|
+
|
50
|
+
it 'should respect html_safe' do
|
51
|
+
doc = AxeML.transform([:foo, '<bar>okay</bar>'.html_safe])
|
52
|
+
doc.search('bar').text.should == 'okay'
|
53
|
+
end
|
49
54
|
|
50
55
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: axeml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Moritz Heidkamp
|
@@ -48,6 +48,22 @@ dependencies:
|
|
48
48
|
version: "0"
|
49
49
|
type: :runtime
|
50
50
|
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: active_support
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 19
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 3
|
63
|
+
- 8
|
64
|
+
version: 2.3.8
|
65
|
+
type: :runtime
|
66
|
+
version_requirements: *id003
|
51
67
|
description: AxeML is a notation for Nokogiri XML documents inspired by SXML
|
52
68
|
email: moritz.heidkamp@bevuta.com
|
53
69
|
executables: []
|