aromancer 0.0.9 → 0.1.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +2 -1
- data/aromancer.gemspec +5 -3
- data/checksums/aromancer-0.1.0.gem.sha512 +1 -0
- data/lib/aromancer/cli.rb +18 -3
- data/lib/aromancer/routes.rb +2 -2
- data/lib/aromancer/storage.rb +6 -1
- data/lib/aromancer/version.rb +4 -1
- data/lib/aromancer.rb +1 -12
- data/oss_om_plugin.rb +54 -0
- data/tasks/make.rake +2 -2
- metadata +8 -5
- data/lib/aromancer/unix_dom.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccf1d829b9e304436e6cba2d61dfa0dcc785faa3084fa1f7a1decb9db3e22f60
|
|
4
|
+
data.tar.gz: c633958a50ed14bbae44ec91f856dbb766fdafa3d0a938c785c5dc75b5efe097
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c77d8b6be396347a5cc7b9382beae520ca4dce5850cf32e1ad6848962a854fdb1392ce1a725cf5e93bc0430507f42ab9c7cd7a45e55523d72626b230b7966cd
|
|
7
|
+
data.tar.gz: c33e62ab2508e1fea739ab82f1480d0d66bd5f88b74492a093e9837fefb066ef94d34622d8f12778fe74a383aa07597a7680ca23fac869a4012fae33ce3fa941
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
aromancer (0.0
|
|
4
|
+
aromancer (0.1.0)
|
|
5
5
|
activesupport (~> 8.1.4)
|
|
6
6
|
faraday (~> 2.14.4)
|
|
7
7
|
fileutils (~> 1.8.0)
|
|
@@ -171,7 +171,7 @@ DEPENDENCIES
|
|
|
171
171
|
|
|
172
172
|
CHECKSUMS
|
|
173
173
|
activesupport (8.1.4) sha256=891dd3fe43c4fc8391934b237b1189bb1f661c932a84a840043db9d46a4e80df
|
|
174
|
-
aromancer (0.0
|
|
174
|
+
aromancer (0.1.0)
|
|
175
175
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
176
176
|
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
177
177
|
bundler (4.0.22) sha256=d8d5ec84c8555e0af71db63ed7aee4d1a8fb839ec46d84212d61979242a5d75a
|
data/README.md
CHANGED
data/aromancer.gemspec
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
|
+
GEM_DESCRIPTION = "aromancer is a unix tarot card game."
|
|
14
|
+
|
|
13
15
|
require_relative "lib/aromancer/version"
|
|
14
16
|
|
|
15
17
|
Gem::Specification.new do |spec|
|
|
@@ -18,9 +20,9 @@ Gem::Specification.new do |spec|
|
|
|
18
20
|
spec.authors = ["i2097i"]
|
|
19
21
|
spec.email = ["i2097i@hotmail.com"]
|
|
20
22
|
|
|
21
|
-
spec.description = ""
|
|
22
|
-
spec.summary =
|
|
23
|
-
spec.homepage = "https://github.com/
|
|
23
|
+
spec.description = GEM_DESCRIPTION + "\n#{Aromancer::VERSION} release notes: #{Aromancer::RELEASE_NOTES}"
|
|
24
|
+
spec.summary = GEM_DESCRIPTION
|
|
25
|
+
spec.homepage = "https://github.com/f-oss-om-foundation/aromancer"
|
|
24
26
|
spec.license = "MIT"
|
|
25
27
|
spec.files = `git ls-files`.split("\n").reject{|p| p.match?(/^(spec|.release|.*.gem$)/)}
|
|
26
28
|
spec.bindir = "bin"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f835a07e99f0233d9050d3e256209fec23d71d682a2762379563b0f36769a7708fff1808d2d03ed6103ddcaa7d72f41ab410271f5b22c2f9d5d9fd4e6ae41f19
|
data/lib/aromancer/cli.rb
CHANGED
|
@@ -15,7 +15,13 @@ module Aromancer
|
|
|
15
15
|
class Cli
|
|
16
16
|
include Singleton
|
|
17
17
|
|
|
18
|
-
attr_accessor :error_timeout
|
|
18
|
+
attr_accessor :error_timeout
|
|
19
|
+
attr_accessor :last_render
|
|
20
|
+
attr_accessor :should_clear_cache
|
|
21
|
+
attr_accessor :storage_mutex
|
|
22
|
+
attr_accessor :ui_busy, :ui_thread
|
|
23
|
+
attr_accessor :ws_busy, :ws_thread
|
|
24
|
+
attr_accessor :running_dimension
|
|
19
25
|
|
|
20
26
|
RENDER_DELAY = 0.1
|
|
21
27
|
|
|
@@ -30,8 +36,17 @@ module Aromancer
|
|
|
30
36
|
Thread.main[:menu_options] = {}
|
|
31
37
|
end
|
|
32
38
|
|
|
39
|
+
def self.safe_exit!
|
|
40
|
+
if self.instance.running_dimension == :plugin_mode
|
|
41
|
+
raise "plugin_mode"
|
|
42
|
+
else
|
|
43
|
+
exit
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
33
47
|
# user entry point
|
|
34
|
-
def self.run
|
|
48
|
+
def self.run(dimension = :default)
|
|
49
|
+
self.instance.running_dimension = dimension
|
|
35
50
|
Aromancer::Websocket.instance
|
|
36
51
|
Aromancer::Storage.instance.ensure_default_preferences_exist
|
|
37
52
|
|
|
@@ -71,7 +86,7 @@ module Aromancer
|
|
|
71
86
|
sleep(1)
|
|
72
87
|
rescue Interrupt => e
|
|
73
88
|
Aromancer::Prompt.say("interrupt on main thread...exiting immediately.")
|
|
74
|
-
|
|
89
|
+
return Aromancer::Cli.safe_exit!
|
|
75
90
|
end
|
|
76
91
|
end
|
|
77
92
|
end
|
data/lib/aromancer/routes.rb
CHANGED
|
@@ -75,7 +75,7 @@ module Aromancer
|
|
|
75
75
|
configure
|
|
76
76
|
}},
|
|
77
77
|
{value: :exit, proc: Proc.new{
|
|
78
|
-
|
|
78
|
+
Aromancer::Cli.safe_exit!
|
|
79
79
|
}}
|
|
80
80
|
]
|
|
81
81
|
Thread.main[:route] = __method__.to_sym
|
|
@@ -241,7 +241,7 @@ module Aromancer
|
|
|
241
241
|
end
|
|
242
242
|
}},
|
|
243
243
|
{value: :exit, proc: Proc.new{
|
|
244
|
-
|
|
244
|
+
Aromancer::Cli.safe_exit!
|
|
245
245
|
}}
|
|
246
246
|
]
|
|
247
247
|
Thread.main[:route] = __method__.to_sym
|
data/lib/aromancer/storage.rb
CHANGED
|
@@ -202,7 +202,6 @@ module Aromancer
|
|
|
202
202
|
|
|
203
203
|
def self.set_arena(arena_hash)
|
|
204
204
|
instance.set_key(:arena, arena_hash)
|
|
205
|
-
Aromancer::UnixDom.render_arena
|
|
206
205
|
end
|
|
207
206
|
|
|
208
207
|
def self.get_arena
|
|
@@ -270,6 +269,12 @@ module Aromancer
|
|
|
270
269
|
URI.parse("#{w_scheme}://#{host}:#{port}/#{w_path}").to_s
|
|
271
270
|
end
|
|
272
271
|
|
|
272
|
+
def dump_game_state
|
|
273
|
+
Aromancer::Cli.instance.storage_mutex.synchronize do
|
|
274
|
+
return JSON.parse(File.read(Aromancer::Storage.storage_filepath, encoding: "UTF-8"))
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
|
|
273
278
|
def get_key(key)
|
|
274
279
|
Aromancer::Cli.instance.storage_mutex.synchronize do
|
|
275
280
|
key = key.to_s
|
data/lib/aromancer/version.rb
CHANGED
data/lib/aromancer.rb
CHANGED
|
@@ -30,24 +30,12 @@ module Aromancer
|
|
|
30
30
|
|
|
31
31
|
def self.configure_home
|
|
32
32
|
FileUtils.mkdir_p(Aromancer.home_directory) unless Dir.exist? Aromancer.home_directory
|
|
33
|
-
FileUtils.mkdir_p(Aromancer.arena_directory) unless Dir.exist? Aromancer.arena_directory
|
|
34
|
-
unless Dir.exist? File.join(Aromancer.home_directory, :".git".to_s)
|
|
35
|
-
FileUtils.chdir Aromancer.home_directory do
|
|
36
|
-
system(:"git init".to_s)
|
|
37
|
-
system(:"git add .".to_s)
|
|
38
|
-
system(:"git commit -m \"#{self.name} initial commit\"".to_s)
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
33
|
end
|
|
42
34
|
|
|
43
35
|
def self.home_directory
|
|
44
36
|
"#{`echo $HOME`.strip}/.aromancer"
|
|
45
37
|
end
|
|
46
38
|
|
|
47
|
-
def self.arena_directory
|
|
48
|
-
File.join(home_directory, :arena.to_s)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
39
|
def self.date_display(raw)
|
|
52
40
|
DateTime.parse(raw)&.strftime(Aromancer::DATE_FORMAT).downcase.gsub(" ", "_")
|
|
53
41
|
end
|
|
@@ -125,4 +113,5 @@ module Aromancer
|
|
|
125
113
|
|
|
126
114
|
Aromancer::Prompt.say(I18n.t(i18n_key || "shared.last_error", status: last_error[:status], error: message), rjust: true)
|
|
127
115
|
end
|
|
116
|
+
|
|
128
117
|
end
|
data/oss_om_plugin.rb
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
aromancer_plugin.rb
|
|
6
|
+
|
|
7
|
+
aro dom aromancer plugin
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module Aro
|
|
14
|
+
module Dom
|
|
15
|
+
class AromancerPlugin
|
|
16
|
+
|
|
17
|
+
EXCLUDE_KEYS = [
|
|
18
|
+
"last_error"
|
|
19
|
+
]
|
|
20
|
+
def self.oss_om_start!(plugin_data = {})
|
|
21
|
+
Aro::P.less(:aromancer_plugin_starting)
|
|
22
|
+
|
|
23
|
+
aromancer_installed = system("#{:which} -#{:s} #{:aromancer}")
|
|
24
|
+
Aro::P.say("aromancer_installed: #{aromancer_installed}")
|
|
25
|
+
raise "aromancer not installed!" unless aromancer_installed
|
|
26
|
+
|
|
27
|
+
aromancer_thread = Thread.new{
|
|
28
|
+
require :aromancer.to_s
|
|
29
|
+
begin
|
|
30
|
+
return Aromancer::Cli.run(:plugin_mode)
|
|
31
|
+
rescue StandardError => e
|
|
32
|
+
Aromancer::Prompt.say("aromancer thread threw an error: #{e}")
|
|
33
|
+
raise e
|
|
34
|
+
end
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
begin
|
|
38
|
+
Aro::P.say("aromancer_thread.join")
|
|
39
|
+
aromancer_thread.join
|
|
40
|
+
rescue StandardError => e
|
|
41
|
+
Aro::P.less(e.inspect)
|
|
42
|
+
Aro::P.say("#{e}")
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
require :aromancer.to_s
|
|
46
|
+
game_state = Aromancer::Storage.instance.dump_game_state.stringify_keys
|
|
47
|
+
game_state["plugin_file_path"] = plugin_data["plugin_file_path"]
|
|
48
|
+
game_state["oss_om_type"] = plugin_data["oss_om_type"]
|
|
49
|
+
return game_state.except(*Aro::Dom::AromancerPlugin::EXCLUDE_KEYS)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
data/tasks/make.rake
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aromancer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- i2097i
|
|
@@ -219,7 +219,9 @@ dependencies:
|
|
|
219
219
|
- - "~>"
|
|
220
220
|
- !ruby/object:Gem::Version
|
|
221
221
|
version: 0.8.2
|
|
222
|
-
description:
|
|
222
|
+
description: |-
|
|
223
|
+
aromancer is a unix tarot card game.
|
|
224
|
+
0.1.0 release notes: adds_oss_om_plugin
|
|
223
225
|
email:
|
|
224
226
|
- i2097i@hotmail.com
|
|
225
227
|
executables:
|
|
@@ -249,6 +251,7 @@ files:
|
|
|
249
251
|
- checksums/aromancer-0.0.7.gem.sha512
|
|
250
252
|
- checksums/aromancer-0.0.8.gem.sha512
|
|
251
253
|
- checksums/aromancer-0.0.9.gem.sha512
|
|
254
|
+
- checksums/aromancer-0.1.0.gem.sha512
|
|
252
255
|
- lib/aromancer.rb
|
|
253
256
|
- lib/aromancer/.DS_Store
|
|
254
257
|
- lib/aromancer/api.rb
|
|
@@ -258,16 +261,16 @@ files:
|
|
|
258
261
|
- lib/aromancer/serve.rb
|
|
259
262
|
- lib/aromancer/server.rb
|
|
260
263
|
- lib/aromancer/storage.rb
|
|
261
|
-
- lib/aromancer/unix_dom.rb
|
|
262
264
|
- lib/aromancer/version.rb
|
|
263
265
|
- lib/aromancer/websocket.rb
|
|
264
266
|
- lib/reiquire.rb
|
|
265
267
|
- listen.rb
|
|
266
268
|
- locale/en.yml
|
|
269
|
+
- oss_om_plugin.rb
|
|
267
270
|
- sig/aromancer.rbs
|
|
268
271
|
- tasks/console.rake
|
|
269
272
|
- tasks/make.rake
|
|
270
|
-
homepage: https://github.com/
|
|
273
|
+
homepage: https://github.com/f-oss-om-foundation/aromancer
|
|
271
274
|
licenses:
|
|
272
275
|
- MIT
|
|
273
276
|
metadata: {}
|
|
@@ -288,5 +291,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
288
291
|
requirements: []
|
|
289
292
|
rubygems_version: 4.0.21
|
|
290
293
|
specification_version: 4
|
|
291
|
-
summary:
|
|
294
|
+
summary: aromancer is a unix tarot card game.
|
|
292
295
|
test_files: []
|