mumuki-prolog-runner 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dab434597d362d9a8c033197ed7c0eb47cd560d8
4
- data.tar.gz: ad855475c88070abd0bfdbad357e4eb8316344b3
3
+ metadata.gz: c19c69dab69e130aeae1ba6aa51635fa846fc197
4
+ data.tar.gz: 4d4bfd4060672df8ef526cc91ee6c2eacb82680f
5
5
  SHA512:
6
- metadata.gz: 41434c5e8eeca6b9660dd5af71242cf608dc1a7f83a5f3d582f46b758dc20312d5d68217cb58238e108f6d09fd3caf83ac414ccab6f16f174048ace18902a7f8
7
- data.tar.gz: b948b58825f5374cfb854a817c9dd7a339cde391b01738cc9c52388c9553e6b91573d6cc33a9eaf8f203902563d0217449a7db8245d827b073a56aa80cb864e1
6
+ metadata.gz: 5f8002b9036d6fe4730c0e0c9cb8c6395df690c2475a92492380cb09f68b6b4dae50ab11bc12337e5e298222875d05a01406a91fd1867376b28fa8cb8c9adaf6
7
+ data.tar.gz: eb2583b4ea5825a5b3e8970db93b1cc6457de11ec1e758aa5d0316b6147d2e6ae755ade267833b3a56a10726ec5d23615f9cc72f857f3a2e3d6dff1245169794
@@ -1,63 +1,7 @@
1
- require 'json'
2
- require 'mumukit/inspection'
1
+ class PrologExpectationsHook < Mumukit::Templates::MulangExpectationsHook
2
+ include_smells true
3
3
 
4
- class Mumukit::Inspection::PlainInspection
5
- def to_term
6
- "inspection('#{type}')"
7
- end
8
- end
9
-
10
- class Mumukit::Inspection::TargetedInspection
11
- def to_term
12
- "inspection('#{type}',#{Integer(target)})" rescue "inspection('#{type}','#{target}')"
13
- end
14
- end
15
-
16
- class Mumukit::Inspection::NegatedInspection
17
- def to_term
18
- "not(#{@inspection.to_term})"
19
- end
20
- end
21
-
22
- class PrologExpectationsHook < Mumukit::Templates::FileHook
23
- isolated true
24
-
25
- def command_line(filename)
26
- "swipl -f #{filename} --quiet -t main 2>&1"
27
- end
28
-
29
- def compile_file_content(request)
30
- ExpectationsFile.new(request).render
31
- end
32
-
33
- def post_process_file(file, result, status)
34
- JSON.parse(result)['expectationResults'] rescue []
35
- end
36
- end
37
-
38
- class ExpectationsFile
39
- def initialize(request)
40
- @content = request.content
41
- @expectation_terms = self.class.expectations_to_terms(request.expectations)
42
- end
43
-
44
- def self.expectations_to_terms(expectations)
45
- '[' + expectations.map do |e|
46
- "expectation('#{e['binding']}',#{inspection_to_term(e['inspection'])})"
47
- end.join(',') + ']'
48
- end
49
-
50
- def self.inspection_to_term(s)
51
- Mumukit::Inspection.parse(s).to_term
52
- end
53
-
54
- def render
55
- ERB.new(File.read(template_path)).result(binding)
56
- end
57
-
58
- private
59
-
60
- def template_path
61
- File.expand_path '../main.pl.erb', __FILE__
4
+ def language
5
+ 'Prolog'
62
6
  end
63
7
  end
data/lib/prolog_runner.rb CHANGED
@@ -8,6 +8,7 @@ Mumukit.configure do |config|
8
8
  config.content_type = 'markdown'
9
9
  end
10
10
 
11
+ require_relative 'version'
11
12
  require_relative 'test_hook'
12
13
  require_relative 'query_hook'
13
14
  require_relative 'expectations_hook'
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module PrologVersionHook
2
+ VERSION = '1.1.0'
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-prolog-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-28 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -16,28 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.6'
19
+ version: '2.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.6'
27
- - !ruby/object:Gem::Dependency
28
- name: mumukit-inspection
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.1'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.1'
26
+ version: '2.10'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -124,6 +110,7 @@ files:
124
110
  - lib/prolog_runner.rb
125
111
  - lib/query_hook.rb
126
112
  - lib/test_hook.rb
113
+ - lib/version.rb
127
114
  homepage: http://github.com/mumuki/mumuki-prolog-server
128
115
  licenses:
129
116
  - MIT
@@ -144,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
131
  version: '0'
145
132
  requirements: []
146
133
  rubyforge_project:
147
- rubygems_version: 2.4.8
134
+ rubygems_version: 2.6.11
148
135
  signing_key:
149
136
  specification_version: 4
150
137
  summary: Prolog Runner for Mumuki