fabulator 0.0.13 → 0.0.14

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.
@@ -1,3 +1,11 @@
1
+ === 0.0.14 2010-12-09
2
+
3
+ * 1 major enhancement:
4
+ * Added implementation classes for 'and' and 'or' in expressions
5
+
6
+ * 1 minor enhancement:
7
+ * Fleshed out basic test environment to enable future unit testing
8
+
1
9
  === 0.0.13 2010-12-08
2
10
 
3
11
  * 7 minor enhancements:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.13
1
+ 0.0.14
@@ -160,6 +160,7 @@ Feature: Function calls and lists
160
160
  When I run the expression (f:not(f:true()))
161
161
  Then I should get 1 item
162
162
  And item 0 should be [f:false()]
163
+
163
164
  @ns
164
165
  Scenario: Negating logic
165
166
  Given a context
@@ -11,3 +11,17 @@ Feature: Simple Flow Control
11
11
  When I run the expression (if ( 1 = 0 ) then 'foo' else 'bar')
12
12
  Then I should get 1 item
13
13
  And item 0 should be ['bar']
14
+
15
+ @conj
16
+ Scenario: Or
17
+ Given a context
18
+ When I run the expression (if ( 1 = 0 or 2 * 2 = 4 ) then 'foo' else 'bar')
19
+ Then I should get 1 item
20
+ And item 0 should be ['foo']
21
+
22
+ @conj
23
+ Scenario: And
24
+ Given a context
25
+ When I run the expression (if ( 1 = 0 and 2 * 2 = 4 ) then 'foo' else 'bar')
26
+ Then I should get 1 item
27
+ And item 0 should be ['bar']
@@ -118,6 +118,26 @@ module Fabulator
118
118
  end
119
119
  end
120
120
 
121
+ class AndExpr < BoolBinExpr
122
+ def op
123
+ :and
124
+ end
125
+
126
+ def calculate(a,b)
127
+ a && b
128
+ end
129
+ end
130
+
131
+ class OrExpr < BoolBinExpr
132
+ def op
133
+ :or
134
+ end
135
+
136
+ def calculate(a,b)
137
+ a || b
138
+ end
139
+ end
140
+
121
141
  class MpyExpr < BinExpr
122
142
  def op
123
143
  :times
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/test_helper.rb'
1
+ require File.dirname(__FILE__) + '/../test_helper.rb'
2
2
  require 'fabulator'
3
3
 
4
4
  class TestFabulator < Test::Unit::TestCase
@@ -8,7 +8,8 @@ class TestFabulator < Test::Unit::TestCase
8
8
 
9
9
  test 'compile trivial application' do
10
10
  doc = LibXML::XML::Document.string('<f:application xmlns:f="http://dh.tamu.edu/ns/fabulator/1.0#" />')
11
- sm = Fabulator::Core::StateMachine.new.compile_xml(doc)
11
+ sm = Fabulator::Core::Structurals::StateMachine.new
12
+ sm.compile_xml(doc)
12
13
  assert_equal sm.states.keys.size, 1, "No states defined automatically"
13
14
  assert_equal sm.states.keys.first, 'start', "Default state is not 'start'"
14
15
  start = sm.states.values.first
@@ -1,6 +1,7 @@
1
+ require 'rubygems'
1
2
  require 'stringio'
2
3
  require 'test/unit'
3
- require 'xml/libxml'
4
+ #require 'xml/libxml'
4
5
  #require 'fabulator'
5
6
 
6
7
  # already required by Rakefile
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fabulator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 13
10
- version: 0.0.13
9
+ - 14
10
+ version: 0.0.14
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-12-08 00:00:00 +00:00
18
+ date: 2010-12-09 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -182,12 +182,12 @@ files:
182
182
  - lib/fabulator/template/standard_tags.rb
183
183
  - lib/fabulator/template/taggable.rb
184
184
  - lib/fabulator/version.rb
185
- - test/test_fabulator.rb
185
+ - test/cucumber.rb
186
+ - test/fabulator/state_machine_test.rb
186
187
  - test/test_helper.rb
187
188
  - xslt/form.xsl
188
189
  - xsm_expression_parser.racc
189
190
  - TODO
190
- - test/cucumber.rb
191
191
  has_rdoc: true
192
192
  homepage: http://github.com/jgsmith/ruby-fabulator
193
193
  licenses: []
@@ -223,6 +223,6 @@ signing_key:
223
223
  specification_version: 3
224
224
  summary: XML-based state machine description language and engine.
225
225
  test_files:
226
- - test/test_fabulator.rb
227
226
  - test/test_helper.rb
228
227
  - test/cucumber.rb
228
+ - test/fabulator/state_machine_test.rb