tla-trace-filter 0.0.3 → 0.0.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.
@@ -22,7 +22,7 @@ describe TlaTraceFilter::Render do
22
22
  %i[ render render_str SOLC_LINE read_partial read_partial_file gem_location ].each do |op|
23
23
  specify { is_expected.to respond_to(op) }
24
24
  end
25
- %i[ API_OUTPUT_STATE_INIT API_INPUT_STATE_INIT API_CALL_INIT API_RETURN_INIT API_OUTPUT_STATE API_INPUT_STATE API_CALL API_RETURN ].each do |op|
25
+ %i[ DUMP_YAML API_AFTER_STATE_INIT API_BEFORE_STATE_INIT API_CALL_INIT API_RETURN_INIT API_AFTER_STATE API_BEFORE_STATE API_CALL API_RETURN ].each do |op|
26
26
  specify { is_expected.to respond_to(op) }
27
27
  end
28
28
  end
@@ -96,7 +96,7 @@ describe TlaTraceFilter::Render do
96
96
 
97
97
  describe "#render_str" do
98
98
  let( :template ) { "data" }
99
- let( :data ) { { :val => "yksi" } }
99
+ let( :data ) { { :val => "yksi", "valstr" => { :hei => :world}, :child => { :val => "kaksi"} } }
100
100
  let( :render_str ) { start.render_str(template, data) }
101
101
  context "template=string" do
102
102
  it { expect( render_str ).to eql template }
@@ -105,6 +105,28 @@ describe TlaTraceFilter::Render do
105
105
  let( :template ) { "val={{val}}" }
106
106
  it { expect( render_str ).to eql "val=yksi" }
107
107
  end
108
+
109
+ describe "#DUMP_YAML" do
110
+ let( :dump_yaml ) { render_str }
111
+ let( :template ) { "{{#DUMP_YAML}}#{key}{{/DUMP_YAML}}" }
112
+ context "key is symbol" do
113
+ let ( :key ) { :val }
114
+ it { expect( dump_yaml ).to eql data[key].to_yaml }
115
+ end
116
+ context "key is symbol" do
117
+ let ( :key ) { "valstr" }
118
+ it { expect( dump_yaml ).to eql data[key].to_yaml }
119
+ end
120
+ context "key is string" do
121
+ let ( :key ) { "val" }
122
+ it { expect( dump_yaml ).to eql data[key.to_sym].to_yaml }
123
+ end
124
+ context "key val.childs" do
125
+ let ( :key ) { "child.val" }
126
+ it { expect( dump_yaml ).to eql data[:child][:val].to_yaml }
127
+ end
128
+ end # DUMP_YAML
129
+
108
130
  end # render_str
109
131
 
110
132
  describe "#read_partial_file" do
@@ -120,7 +142,8 @@ describe TlaTraceFilter::Render do
120
142
  it { expect( read_partial_file ).to eql nil }
121
143
  end
122
144
 
123
- end
145
+ end
146
+
124
147
 
125
148
  describe "#SOLC_LINE" do
126
149
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.name = 'tla-trace-filter'
15
15
  s.version = version
16
16
  s.date = Time.now.strftime( "%Y-%m-%d" ) #'2014-09-10'
17
- s.summary = "Post process tla+tools model checker trace output"
17
+ s.summary = "Post process trace output from model checking sbuilder formal models"
18
18
  s.description = <<EOF
19
19
 
20
20
 
@@ -29,14 +29,14 @@ Gem::Specification.new do |s|
29
29
  EOF
30
30
 
31
31
  s.authors = ["jarjuk"]
32
- s.files = ["README.org", "VERSION", "#{s.name}.gemspec" ] | Dir.glob("lib/**/*") |Dir.glob("mustache/**/*") | Dir.glob("spec/**/*")
32
+ s.files = ["README.md", "VERSION", "#{s.name}.gemspec" ] | Dir.glob("lib/**/*") |Dir.glob("mustache/**/*") | Dir.glob("spec/**/*")
33
33
  s.require_paths = [ "lib" ]
34
34
  s.executables = [ "tla-trace-filter.rb" ]
35
35
  s.license = 'MIT'
36
36
 
37
37
  s.required_ruby_version = '~> 2', ">=2.3"
38
38
 
39
- s.add_runtime_dependency 'tla-sbuilder', '~>0.3', ">0.3.7"
39
+ s.add_runtime_dependency 'tla-sbuilder', '~>0.3', ">=0.3.9"
40
40
  s.add_runtime_dependency 'thor', '~>0.19', ">=0.19.1"
41
41
  s.add_runtime_dependency 'treetop', '~>1.6', ">=1.6.3"
42
42
  s.add_runtime_dependency 'mustache', '~>1.0', ">=1.0.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tla-trace-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jarjuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-20 00:00:00.000000000 Z
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tla-sbuilder
@@ -17,9 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.3'
20
- - - ">"
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.3.7
22
+ version: 0.3.9
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +27,9 @@ dependencies:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.3'
30
- - - ">"
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.3.7
32
+ version: 0.3.9
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: thor
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -107,7 +107,7 @@ executables:
107
107
  extensions: []
108
108
  extra_rdoc_files: []
109
109
  files:
110
- - README.org
110
+ - README.md
111
111
  - VERSION
112
112
  - bin/tla-trace-filter.rb
113
113
  - lib/cli/cli.rb
@@ -122,13 +122,26 @@ files:
122
122
  - mustache/add-links-state-dump.mustache
123
123
  - mustache/add-links-transition.mustache
124
124
  - mustache/add-links.mustache
125
- - mustache/api-call-default.mustache
125
+ - mustache/api-call-after-state-post.mustache
126
+ - mustache/api-call-after-state-pre.mustache
127
+ - mustache/api-call-before-state-post.mustache
128
+ - mustache/api-call-before-state-pre.mustache
129
+ - mustache/api-call-call-post.mustache
130
+ - mustache/api-call-call-pre.mustache
131
+ - mustache/api-call-default-afterState.mustache
132
+ - mustache/api-call-default-api_input.mustache
133
+ - mustache/api-call-default-api_return.mustache
134
+ - mustache/api-call-default-beforeState.mustache
135
+ - mustache/api-call-header.mustache
126
136
  - mustache/api-call-init.mustache
127
- - mustache/api-call-input.mustache
128
137
  - mustache/api-call-link.mustache
129
138
  - mustache/api-call-main.mustache
130
- - mustache/api-call-output.mustache
131
- - mustache/api-call-return.mustache
139
+ - mustache/api-call-post.mustache
140
+ - mustache/api-call-pre.mustache
141
+ - mustache/api-call-ret-post.mustache
142
+ - mustache/api-call-ret-pre.mustache
143
+ - mustache/api-call-step-post.mustache
144
+ - mustache/api-call-step-pre.mustache
132
145
  - mustache/api-call.mustache
133
146
  - spec/cli/cli_spec.rb
134
147
  - spec/filter/filter_spec.rb
@@ -167,5 +180,5 @@ rubyforge_project:
167
180
  rubygems_version: 2.6.14
168
181
  signing_key:
169
182
  specification_version: 4
170
- summary: Post process tla+tools model checker trace output
183
+ summary: Post process trace output from model checking sbuilder formal models
171
184
  test_files: []
data/README.org DELETED
@@ -1,66 +0,0 @@
1
- * =tla-sbuilder-trace= - Post process TLA-tools trace output
2
-
3
- A command line filter utility for processing [[http://research.microsoft.com/en-us/um/people/lamport/tla/tools.html][TLA+ Tools]] output
4
- resulting created when model checking [[[http://research.microsoft.com/en-us/um/people/lamport/tla/book.html][TLA+ language]]] formal model
5
- generated using [[https://github.com/jarjuk/tla-sbuilder][sbuilder]] -tool.
6
-
7
- The utility
8
-
9
-
10
- * Installation
11
-
12
- To install =tla-trace-filter= GEM create a =Gemfile= -file with the
13
- content
14
-
15
- #+BEGIN_SRC ruby :eval no
16
- source "https://rubygems.org"
17
- gem 'tla-trace-filter'
18
- #+END_SRC
19
-
20
- and run
21
-
22
- #+BEGIN_SRC ruby :eval no
23
- bundle install
24
- #+END_SRC
25
-
26
- * Usage
27
-
28
- ** Genrate traces :noexport:
29
-
30
- ** Add links to trace file
31
-
32
- To add links to model checker trace output in file =gen/tlc.out=
33
- outputted when model checking TLA+ language formal model code in file
34
- =gen/setup1/tla/model.tla=
35
-
36
- #+BEGIN_SRC ruby :eval no-export
37
- bundle exec tla-trace-filter.rb add-links setup1
38
- #+END_SRC
39
-
40
-
41
- To embed links to trace output run:
42
-
43
- #+BEGIN_SRC ruby :eval no-export
44
- bundle exec tla-trace-filter.rb add-links setup1 --embed
45
- #+END_SRC
46
-
47
-
48
- To create API calls run:
49
-
50
- #+BEGIN_SRC ruby :eval no
51
- bundle exec tla-trace-filter.rb api-calls setup1
52
- #+END_SRC
53
-
54
-
55
- Location of the files and directories can be changes using command
56
- line options. To get a list of available command and their options run:
57
-
58
- bundle exec tla-trace-filter.rb help
59
-
60
-
61
- ** Create API trace
62
-
63
-
64
- ** Documentation
65
-
66
- See [[https://cucumber.io][Cucumber]] tests in =features= -directory [[http://jarjuk.github.io/tla-trace-filter.html][github repo]].