fabulator-grammar 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/features/library.feature +8 -0
- data/features/step_definitions/xml_steps.rb +6 -6
- metadata +7 -7
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ begin
|
|
7
7
|
gem.email = "jgsmith@tamu.edu"
|
8
8
|
gem.homepage = "http://github.com/jgsmith/ruby-fabulator-grammar"
|
9
9
|
gem.authors = ["James Smith"]
|
10
|
-
gem.add_dependency(%q<fabulator>, [">= 0.0.
|
10
|
+
gem.add_dependency(%q<fabulator>, [">= 0.0.9"])
|
11
11
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
12
12
|
# not sure how to add dependency of a library that's not a gem
|
13
13
|
gem.requirements << 'bitset, 1.0 or greater'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/features/library.feature
CHANGED
@@ -48,6 +48,7 @@ Feature: Grammars embedded in libraries
|
|
48
48
|
xmlns:g="http://dh.tamu.edu/ns/fabulator/grammar/1.0#"
|
49
49
|
xmlns:f="http://dh.tamu.edu/ns/fabulator/1.0#"
|
50
50
|
l:ns="http://example.com/ns/grammar"
|
51
|
+
xmlns:my="http://example.com/ns/grammar"
|
51
52
|
>
|
52
53
|
<g:grammar>
|
53
54
|
<g:context g:mode="normal">
|
@@ -74,6 +75,9 @@ Feature: Grammars embedded in libraries
|
|
74
75
|
<l:action l:name="actn" l:has-actions="true">
|
75
76
|
<f:value-of f:select="f:eval($actions) * 3" />
|
76
77
|
</l:action>
|
78
|
+
<l:action l:name="actn2" l:has-actions="true">
|
79
|
+
<my:actn><f:value-of f:select="f:eval($actions) * 5" /></my:actn>
|
80
|
+
</l:action>
|
77
81
|
</l:library>
|
78
82
|
"""
|
79
83
|
And the statemachine
|
@@ -93,6 +97,9 @@ Feature: Grammars embedded in libraries
|
|
93
97
|
<f:value f:path="barboil">
|
94
98
|
<m:actn><f:value-of f:select="7" /></m:actn>
|
95
99
|
</f:value>
|
100
|
+
<f:value f:path="barboil2">
|
101
|
+
<m:actn2><f:value-of f:select="7" /></m:actn2>
|
102
|
+
</f:value>
|
96
103
|
</f:goes-to>
|
97
104
|
</f:view>
|
98
105
|
<f:view f:name="step1">
|
@@ -121,6 +128,7 @@ Feature: Grammars embedded in libraries
|
|
121
128
|
And the expression (/foo) should equal ['a0A']
|
122
129
|
And the expression (/barbell) should equal [6]
|
123
130
|
And the expression (/barboil) should equal [21]
|
131
|
+
And the expression (/barboil2) should equal [105]
|
124
132
|
When I run it with the following params:
|
125
133
|
| key | value |
|
126
134
|
| bar | a0a |
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Given /the grammar/ do |doc_xml|
|
2
2
|
@context ||= Fabulator::Expr::Context.new
|
3
|
+
@compiler ||= Fabulator::Compiler.new
|
3
4
|
|
4
5
|
if @grammar.nil?
|
5
|
-
@grammar =
|
6
|
-
@grammar.compile_xml(doc_xml, @context)
|
6
|
+
@grammar = @compiler.compile(doc_xml)
|
7
7
|
else
|
8
8
|
@grammar.compile_xml(doc_xml, @context)
|
9
9
|
end
|
@@ -13,10 +13,10 @@ end
|
|
13
13
|
|
14
14
|
Given /the library/ do |doc_xml|
|
15
15
|
@context ||= Fabulator::Expr::Context.new
|
16
|
+
@compiler ||= Fabulator::Compiler.new
|
16
17
|
|
17
18
|
if @library.nil?
|
18
|
-
@library =
|
19
|
-
@library.compile_xml(doc_xml, @context)
|
19
|
+
@library = @compiler.compile(doc_xml)
|
20
20
|
else
|
21
21
|
@library.compile_xml(doc_xml, @context)
|
22
22
|
end
|
@@ -26,10 +26,10 @@ end
|
|
26
26
|
|
27
27
|
Given /the statemachine/ do |doc_xml|
|
28
28
|
@context ||= Fabulator::Expr::Context.new
|
29
|
+
@compiler ||= Fabulator::Compiler.new
|
29
30
|
|
30
31
|
if @sm.nil?
|
31
|
-
@sm =
|
32
|
-
@sm.compile_xml(doc_xml)
|
32
|
+
@sm = @compiler.compile(doc_xml)
|
33
33
|
else
|
34
34
|
@sm.compile_xml(doc_xml)
|
35
35
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabulator-grammar
|
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
|
- James Smith
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-26 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 13
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 0
|
33
|
-
-
|
34
|
-
version: 0.0.
|
33
|
+
- 9
|
34
|
+
version: 0.0.9
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
description: The grammar Fabulator extension provides regular expression support.
|