prolog_mqi 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 9c109ed3ef0a3a3cba8c8e5defde6ba32e4b5160cc2fd4b8d9d2a2c181453df6
4
- data.tar.gz: 38d01627cce8f28cf8566d438a20aef0a7f609a2f1512c782fc289043efbb40a
3
+ metadata.gz: c140e8137101d2baf02d0a584c067e9eab8129848c9180c0b4f0385afe24b916
4
+ data.tar.gz: ccd2b9ef79061e9c5eff1fb2292f2a8c8f986b50d302f7c4b7a7d1447ba6d71e
5
5
  SHA512:
6
- metadata.gz: 8b586c21226e11c7fd3af8244e4e0941b5aa7c065e5a09755aceff68c979dc491f8d346aa4471584804d48cd70f1a5412dde80c8d624788a21e0b32055be169f
7
- data.tar.gz: 7098791a95a9a79e4e838434740f1517771221b6a880cbda32641fd0c07ab27409b6a371212b3ae2d405f18bff6998c62aac63feed500c619d796301c23efeb7
6
+ metadata.gz: 3891f27ddd92e97506998ba3ee15bf273bd575e846a478dba657307bbf4d3adea65e7a135ea992aa5c5dd9f668184255e472ddb42ecee9efc1a96c033e30351c
7
+ data.tar.gz: 6d21ed8b6dc2efd65132df959ae904625780c6138e50d3a3c2c598aa74371337d5d30516f0fee40d800a981d0918e8696e015d25a1c4dbc70b3a88beda63807c
data/.rubocop.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
@@ -9,8 +9,14 @@ Rake::TestTask.new(:test) do |t|
9
9
  t.test_files = FileList['test/**/test_*.rb']
10
10
  end
11
11
 
12
+ Rake::TestTask.new(:bench) do |t|
13
+ t.libs << 'test'
14
+ t.libs << 'lib'
15
+ t.test_files = FileList['test/**/bench_*.rb']
16
+ end
17
+
12
18
  require 'rubocop/rake_task'
13
19
 
14
20
  RuboCop::RakeTask.new
15
21
 
16
- task default: %i[test rubocop]
22
+ task default: %i[test bench rubocop]
File without changes
File without changes
@@ -6,7 +6,7 @@ module PrologMQI
6
6
  @timeout = timeout
7
7
 
8
8
  @process = nil
9
- @unix_domain_socket = nil
9
+ @socket = nil
10
10
  @running = false
11
11
  end
12
12
 
@@ -22,6 +22,8 @@ module PrologMQI
22
22
  end
23
23
 
24
24
  def start
25
+ raise LaunchError, 'PrologMQI is already running' if running?
26
+
25
27
  # Start prolog process
26
28
  @stdin, @stdout, @stderr, @process =
27
29
  Open3.popen3('swipl', '--quiet', '-g', 'mqi_start', '-t', 'halt', '--', '--write_connection_values=true',
@@ -38,6 +40,7 @@ module PrologMQI
38
40
  end
39
41
 
40
42
  # Authenticate
43
+ @running = true
41
44
  write(password)
42
45
  read
43
46
  end
@@ -63,13 +66,13 @@ module PrologMQI
63
66
  @socket.write(message)
64
67
  end
65
68
 
66
- def stop(kill: false)
69
+ def stop
67
70
  @socket.close
68
71
  @stdin.close
69
72
  @stdout.close
70
73
  @stderr.close
71
- @process.kill if kill
72
- @process.close
74
+ @process.kill
75
+ @running = false
73
76
  end
74
77
  end
75
78
  end
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrologMQI
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/prolog_mqi.rb CHANGED
File without changes
data/prolog_mqi.gemspec CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prolog_mqi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delton Ding
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-01 00:00:00.000000000 Z
11
+ date: 2023-07-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A PrologMQI implementation in Ruby.
14
14
  email:
@@ -38,7 +38,7 @@ metadata:
38
38
  homepage_uri: https://github.com/yet-another-ai/prologmqi.rb
39
39
  source_code_uri: https://github.com/yet-another-ai/prologmqi.rb
40
40
  rubygems_mfa_required: 'true'
41
- post_install_message:
41
+ post_install_message:
42
42
  rdoc_options: []
43
43
  require_paths:
44
44
  - lib
@@ -53,8 +53,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 3.4.10
57
- signing_key:
56
+ rubygems_version: 3.4.12
57
+ signing_key:
58
58
  specification_version: 4
59
59
  summary: Yet Another Prolog Interface for Ruby.
60
60
  test_files: []