iab-Oil 0.1.5 → 0.1.6

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.
@@ -8,6 +8,23 @@ class HashWithIndifferentAccess < Hash
8
8
  end
9
9
 
10
10
  class CoverageInterpreter < DslContext
11
+
12
+ def self.execute(*args)
13
+
14
+ rules = polish_text(args[0])
15
+ #significant change to allow class instance variables to be set on the initialize, ahead
16
+ #of the evaluation of the DSL - allows dynamic props to be sent to the class
17
+ #see VPMSProductSchemaInterpreter, which gets a param from the package interpreter
18
+ inst = (args.length > 1) ? self.new(args.slice(1,1)) : self.new
19
+ inst.setProduct(args[2])
20
+ rules.each do |rule|
21
+ result = inst.instance_eval(rule)
22
+ #passes results as parm into code that was passed with call to execute (if any was)
23
+ yield result if block_given?
24
+ end
25
+ inst.getResult
26
+ end
27
+
11
28
  include Marshaller
12
29
 
13
30
  bubble :than, :is, :list, :the, :to, :at, :it, :end
@@ -48,7 +65,11 @@ class CoverageInterpreter < DslContext
48
65
  def endentity(*args)
49
66
  end_erb
50
67
  end
51
-
68
+
69
+ def setProduct(product)
70
+ @product = product
71
+ end
72
+
52
73
  def use(*args)
53
74
  #puts "INTO USE WITH:#{args}"
54
75
  #the test on hidden_fields property is a bit too brutal in that it cuts out a whole part of the tree
@@ -141,7 +162,7 @@ class CoverageInterpreter < DslContext
141
162
  @erb << '<% end %>' unless specific_widget == nil
142
163
 
143
164
  if (!@modelsLoaded)
144
- req_stmt = deriveActiveRecordDefinitionOfProduct('Telenexus')
165
+ req_stmt = deriveActiveRecordDefinitionOfProduct("#{@product}")
145
166
  eval(req_stmt)
146
167
  @modelsLoaded = true
147
168
  end
@@ -167,7 +167,7 @@ class LayoutInterpreter < DslContext
167
167
  else
168
168
  dsl << @contents.to_s
169
169
  end
170
- @erb << CoverageInterpreter.execute(dsl, args[1])
170
+ @erb << CoverageInterpreter.execute(dsl, args[1],@product)
171
171
  end
172
172
 
173
173
  def interpretUse(use)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iab-Oil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Mawdsley
@@ -61,6 +61,7 @@ files:
61
61
  - lib/xslt/VPMSSchemaInterpreter.xsl
62
62
  has_rdoc: true
63
63
  homepage: http://github.com/iab/Oil
64
+ licenses:
64
65
  post_install_message:
65
66
  rdoc_options:
66
67
  - --inline-source
@@ -82,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  requirements: []
83
84
 
84
85
  rubyforge_project: Oil
85
- rubygems_version: 1.2.0
86
+ rubygems_version: 1.3.5
86
87
  signing_key:
87
88
  specification_version: 2
88
89
  summary: Oil is a RAILS based mini language for Financial Applications