inform-runtime 1.0.4 → 1.2.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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -12
  3. data/Rakefile +26 -16
  4. data/lib/{runtime → story_teller}/articles.rb +14 -10
  5. data/lib/{runtime → story_teller}/builtins.rb +50 -22
  6. data/lib/{runtime → story_teller}/color.rb +8 -8
  7. data/lib/{runtime → story_teller}/command.rb +26 -28
  8. data/lib/{runtime → story_teller}/context.rb +23 -24
  9. data/lib/story_teller/core.rb +38 -0
  10. data/lib/{runtime → story_teller}/daemon.rb +35 -36
  11. data/lib/story_teller/engine.rb +151 -0
  12. data/lib/story_teller/ephemeral_adapter.rb +42 -0
  13. data/lib/{runtime → story_teller}/events.rb +8 -9
  14. data/lib/{runtime → story_teller}/experimental/handler_dsl.rb +7 -18
  15. data/lib/story_teller/experimental/reverse_engineer_class.rb +37 -0
  16. data/lib/{runtime → story_teller}/grammar_parser.rb +24 -40
  17. data/lib/{runtime → story_teller}/helpers.rb +21 -7
  18. data/lib/{runtime → story_teller}/history.rb +5 -5
  19. data/lib/{runtime → story_teller}/inflector.rb +4 -5
  20. data/lib/story_teller/inform/base.rb +160 -0
  21. data/lib/{runtime → story_teller/inform/ephemeral}/link.rb +27 -45
  22. data/lib/{runtime → story_teller/inform/ephemeral}/module.rb +17 -58
  23. data/lib/story_teller/inform/ephemeral/object.rb +329 -0
  24. data/lib/{runtime → story_teller/inform/ephemeral}/tag.rb +54 -81
  25. data/lib/story_teller/inform/models.rb +25 -0
  26. data/lib/{runtime → story_teller}/io.rb +10 -10
  27. data/lib/{runtime → story_teller}/kernel.rb +21 -31
  28. data/lib/story_teller/library/bootstrap.rb +66 -0
  29. data/lib/story_teller/library/declarations.rb +53 -0
  30. data/lib/story_teller/library/directives.rb +91 -0
  31. data/lib/story_teller/library/loader.rb +104 -0
  32. data/lib/story_teller/library/location.rb +73 -0
  33. data/lib/{runtime → story_teller}/library.rb +27 -12
  34. data/lib/{runtime → story_teller}/logging.rb +47 -24
  35. data/lib/{runtime → story_teller}/mixins.rb +6 -6
  36. data/lib/story_teller/model_adapter.rb +132 -0
  37. data/lib/{runtime → story_teller}/plurals.rb +11 -11
  38. data/lib/{runtime → story_teller}/prototype.rb +11 -10
  39. data/lib/{runtime → story_teller}/publication.rb +9 -9
  40. data/lib/{runtime → story_teller}/session.rb +6 -8
  41. data/lib/{runtime → story_teller}/stdlib.rb +13 -11
  42. data/lib/{runtime → story_teller}/subscription.rb +8 -8
  43. data/lib/{runtime → story_teller}/tree.rb +6 -6
  44. data/lib/{runtime → story_teller}/version.rb +16 -6
  45. data/lib/story_teller/world_tree.rb +54 -0
  46. data/lib/story_teller.rb +26 -0
  47. metadata +59 -99
  48. data/config/database.yml +0 -37
  49. data/exe/inform.rb +0 -6
  50. data/game/config.yml +0 -5
  51. data/game/example.inf +0 -76
  52. data/game/example.rb +0 -90
  53. data/game/forms/example_form.rb +0 -2
  54. data/game/grammar/game_grammar.inf.rb +0 -11
  55. data/game/languages/english.rb +0 -2
  56. data/game/models/example_model.rb +0 -2
  57. data/game/modules/example_module.rb +0 -9
  58. data/game/rules/example_state.rb +0 -2
  59. data/game/scripts/example_script.rb +0 -2
  60. data/game/topics/example_topic.rb +0 -2
  61. data/game/verbs/game_verbs.rb +0 -15
  62. data/game/verbs/metaverbs.rb +0 -2028
  63. data/lib/runtime/config.rb +0 -48
  64. data/lib/runtime/database.rb +0 -500
  65. data/lib/runtime/game.rb +0 -74
  66. data/lib/runtime/game_loader.rb +0 -132
  67. data/lib/runtime/library_loader.rb +0 -135
  68. data/lib/runtime/object.rb +0 -761
  69. data/lib/runtime/options.rb +0 -104
  70. data/lib/runtime/persistence.rb +0 -292
  71. data/lib/runtime/runtime.rb +0 -321
  72. data/lib/runtime/world_tree.rb +0 -69
  73. data/lib/runtime.rb +0 -35
metadata CHANGED
@@ -1,56 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inform-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nels Nelson
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
- name: bigdecimal
13
+ name: base64
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 3.2.2
18
+ version: 0.3.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 3.2.2
25
+ version: 0.3.0
26
26
  - !ruby/object:Gem::Dependency
27
- name: curses
27
+ name: bigdecimal
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 1.4.0
32
+ version: 4.1.1
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 1.4.0
39
+ version: 4.1.1
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: inform6lib
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.0.6
46
+ version: 0.1.0
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 0.0.6
53
+ version: 0.1.0
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: logger
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -79,99 +79,59 @@ dependencies:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: 1.1.0
82
- - !ruby/object:Gem::Dependency
83
- name: nokogiri
84
- requirement: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: 1.13.1
89
- type: :runtime
90
- prerelease: false
91
- version_requirements: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 1.13.1
96
- - !ruby/object:Gem::Dependency
97
- name: sequel
98
- requirement: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: 5.58.0
103
- type: :runtime
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: 5.58.0
110
- description: The Inform Runtime for Ruby is a command-line interface software runtime
111
- program for playing interactive-fiction games which use the Inform 6 Ruby Port.
82
+ description: The StoryTeller Engine for Ruby is a reusable runtime-support library
83
+ for interactive-fiction games which are built with the Inform 6 Ruby Port.
112
84
  email: nels@nelsnelson.org
113
- executables:
114
- - inform.rb
85
+ executables: []
115
86
  extensions: []
116
87
  extra_rdoc_files: []
117
88
  files:
118
89
  - LICENSE
119
90
  - README.md
120
91
  - Rakefile
121
- - config/database.yml
122
- - exe/inform.rb
123
- - game/config.yml
124
- - game/example.inf
125
- - game/example.rb
126
- - game/forms/example_form.rb
127
- - game/grammar/game_grammar.inf.rb
128
- - game/languages/english.rb
129
- - game/models/example_model.rb
130
- - game/modules/example_module.rb
131
- - game/rules/example_state.rb
132
- - game/scripts/example_script.rb
133
- - game/topics/example_topic.rb
134
- - game/verbs/game_verbs.rb
135
- - game/verbs/metaverbs.rb
136
- - lib/runtime.rb
137
- - lib/runtime/articles.rb
138
- - lib/runtime/builtins.rb
139
- - lib/runtime/color.rb
140
- - lib/runtime/command.rb
141
- - lib/runtime/config.rb
142
- - lib/runtime/context.rb
143
- - lib/runtime/daemon.rb
144
- - lib/runtime/database.rb
145
- - lib/runtime/events.rb
146
- - lib/runtime/experimental/handler_dsl.rb
147
- - lib/runtime/game.rb
148
- - lib/runtime/game_loader.rb
149
- - lib/runtime/grammar_parser.rb
150
- - lib/runtime/helpers.rb
151
- - lib/runtime/history.rb
152
- - lib/runtime/inflector.rb
153
- - lib/runtime/io.rb
154
- - lib/runtime/kernel.rb
155
- - lib/runtime/library.rb
156
- - lib/runtime/library_loader.rb
157
- - lib/runtime/link.rb
158
- - lib/runtime/logging.rb
159
- - lib/runtime/mixins.rb
160
- - lib/runtime/module.rb
161
- - lib/runtime/object.rb
162
- - lib/runtime/options.rb
163
- - lib/runtime/persistence.rb
164
- - lib/runtime/plurals.rb
165
- - lib/runtime/prototype.rb
166
- - lib/runtime/publication.rb
167
- - lib/runtime/runtime.rb
168
- - lib/runtime/session.rb
169
- - lib/runtime/stdlib.rb
170
- - lib/runtime/subscription.rb
171
- - lib/runtime/tag.rb
172
- - lib/runtime/tree.rb
173
- - lib/runtime/version.rb
174
- - lib/runtime/world_tree.rb
92
+ - lib/story_teller.rb
93
+ - lib/story_teller/articles.rb
94
+ - lib/story_teller/builtins.rb
95
+ - lib/story_teller/color.rb
96
+ - lib/story_teller/command.rb
97
+ - lib/story_teller/context.rb
98
+ - lib/story_teller/core.rb
99
+ - lib/story_teller/daemon.rb
100
+ - lib/story_teller/engine.rb
101
+ - lib/story_teller/ephemeral_adapter.rb
102
+ - lib/story_teller/events.rb
103
+ - lib/story_teller/experimental/handler_dsl.rb
104
+ - lib/story_teller/experimental/reverse_engineer_class.rb
105
+ - lib/story_teller/grammar_parser.rb
106
+ - lib/story_teller/helpers.rb
107
+ - lib/story_teller/history.rb
108
+ - lib/story_teller/inflector.rb
109
+ - lib/story_teller/inform/base.rb
110
+ - lib/story_teller/inform/ephemeral/link.rb
111
+ - lib/story_teller/inform/ephemeral/module.rb
112
+ - lib/story_teller/inform/ephemeral/object.rb
113
+ - lib/story_teller/inform/ephemeral/tag.rb
114
+ - lib/story_teller/inform/models.rb
115
+ - lib/story_teller/io.rb
116
+ - lib/story_teller/kernel.rb
117
+ - lib/story_teller/library.rb
118
+ - lib/story_teller/library/bootstrap.rb
119
+ - lib/story_teller/library/declarations.rb
120
+ - lib/story_teller/library/directives.rb
121
+ - lib/story_teller/library/loader.rb
122
+ - lib/story_teller/library/location.rb
123
+ - lib/story_teller/logging.rb
124
+ - lib/story_teller/mixins.rb
125
+ - lib/story_teller/model_adapter.rb
126
+ - lib/story_teller/plurals.rb
127
+ - lib/story_teller/prototype.rb
128
+ - lib/story_teller/publication.rb
129
+ - lib/story_teller/session.rb
130
+ - lib/story_teller/stdlib.rb
131
+ - lib/story_teller/subscription.rb
132
+ - lib/story_teller/tree.rb
133
+ - lib/story_teller/version.rb
134
+ - lib/story_teller/world_tree.rb
175
135
  homepage: https://rubygems.org/gems/inform-runtime
176
136
  licenses:
177
137
  - GPL-3.0-or-later
@@ -186,14 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
146
  requirements:
187
147
  - - ">="
188
148
  - !ruby/object:Gem::Version
189
- version: 2.6.8
149
+ version: 4.0.0
190
150
  required_rubygems_version: !ruby/object:Gem::Requirement
191
151
  requirements:
192
152
  - - ">="
193
153
  - !ruby/object:Gem::Version
194
154
  version: '0'
195
155
  requirements: []
196
- rubygems_version: 3.7.2
156
+ rubygems_version: 4.0.9
197
157
  specification_version: 4
198
- summary: Inform Runtime for Ruby.
158
+ summary: StoryTeller Engine for Ruby.
199
159
  test_files: []
data/config/database.yml DELETED
@@ -1,37 +0,0 @@
1
-
2
- default:
3
- adapter: postgres
4
- database: postgres
5
- username: postgres
6
- host: localhost
7
- pool: 5
8
-
9
- development:
10
- adapter: postgres
11
- database: example
12
- username: example
13
- password: example
14
- host: localhost
15
- pool: 5
16
- timeout: 5000
17
-
18
- test:
19
- adapter: sqlite
20
-
21
- docker:
22
- adapter: postgres
23
- database: example
24
- username: example
25
- password: example
26
- host: postgres
27
- pool: 5
28
- timeout: 5000
29
-
30
- production:
31
- adapter: postgres
32
- database: example
33
- username: example
34
- password: example
35
- host: localhost
36
- pool: 5
37
- timeout: 5000
data/exe/inform.rb DELETED
@@ -1,6 +0,0 @@
1
- #! /usr/bin/env ruby
2
- # frozen_string_literal: false
3
-
4
- require_relative '../lib/runtime'
5
-
6
- Object.new.extend(Inform::App).main
data/game/config.yml DELETED
@@ -1,5 +0,0 @@
1
- # Configuration for game module
2
-
3
- ---
4
- database_name: example
5
- environment: production
data/game/example.inf DELETED
@@ -1,76 +0,0 @@
1
-
2
- ! ----------------------------------------------------------------------------
3
- ! Example
4
- ! ----------------------------------------------------------------------------
5
-
6
- ! DEBUG = true
7
- Constant Story = "EXAMPLE";
8
- Constant Headline = "^An Interactive Example^
9
- Copyright (c) 2025 by Nels N. Nelson.^";
10
-
11
- Replace DrawStatusLine;
12
-
13
- Include "Parser";
14
- Include "VerbLib";
15
-
16
- Object Field "Field"
17
- with description
18
- "You are standing in a field. A small 19th century house stands
19
- to the east, hardly standing up to the stiff wind rolling down
20
- from the north.",
21
- e_to HouseFoyer,
22
- w_to Shingle
23
- has light;
24
-
25
- Object -> "small toy top"
26
- with name 'small' 'toy' 'top',
27
- before [;
28
- Examine:
29
- print "A totem, somehow familiar, made of brass";
30
- if (self in player) {
31
- print " and heavy in your hand";
32
- }
33
- ".";
34
- ];
35
-
36
- Object HouseFoyer "Foyer"
37
- with description
38
- "You stand in the foyer of this
39
- ancient structure. A draft swirls through
40
- the hallway to the east.",
41
- out_to Field,
42
- w_to Field
43
- has light;
44
-
45
- Object Shingle "Shingle"
46
- with description
47
- "You seem to be only a small child
48
- playing on a sea-shore, and diverting yourself
49
- in finding a smoother pebble or a prettier shell
50
- than ordinary, whilst the great ocean of
51
- truth lies all undiscovered before you.",
52
- e_to Field
53
- has light;
54
-
55
- [ Initialise;
56
- location = Field;
57
- "^^^^^Welcome to...^";
58
- ];
59
-
60
- [ DrawStatusLine;
61
- @split_window 1; @set_window 1; @set_cursor 1 1; style reverse;
62
- spaces (0->33)-1;
63
- @set_cursor 1 2; PrintShortName(location);
64
- @set_cursor 1 60; print "(as ";
65
- @print_obj player;
66
- print ")"; ! There ya are.
67
- @set_cursor 1 1; style roman; @set_window 0;
68
- ];
69
-
70
- Include "Grammar";
71
-
72
- Verb meta 'example'
73
- * -> Example;
74
- Verb 'smile'
75
- * -> Smile;
76
-
data/game/example.rb DELETED
@@ -1,90 +0,0 @@
1
-
2
- # ----------------------------------------------------------------------------
3
- # Example
4
- # ----------------------------------------------------------------------------
5
-
6
- # DEBUG = true
7
- Story = "EXAMPLE"
8
- Headline = "\nAn Interactive Example\n" \
9
- "Copyright (c) 2025 by Nels N. Nelson.\n"
10
- Release = 1
11
-
12
- def DrawStatusLine; end
13
-
14
- Include "Parser"
15
- Include "VerbLib"
16
-
17
- Field = Object("Field") {
18
- with {
19
- description "You are standing in a field in " \
20
- "front of a small 19th century house which " \
21
- "stands just to the east of you. The house " \
22
- "hardly stands up to the stiff wind rolling " \
23
- "down from the north."
24
- e_to :HouseFoyer
25
- w_to :Shingle
26
- }
27
- has :light
28
- }
29
-
30
- # Note that the "with" directive here is vestigial and
31
- # can be discarded altogether, but is supported for
32
- # ease of transition/adoption.
33
- #
34
- # Field > Object("small toy top") {
35
- # with {
36
- # def before_examine
37
- # "A totem, somehow familiar, made of brass" +
38
- # (self.parent == player ? " and heavy in your hand" : '') + "."
39
- # end
40
- # weight 15 # grams
41
- # }
42
- # }
43
- Field > Object("small toy top") {
44
- def before_examine
45
- print "A totem, somehow familiar, made of brass"
46
- print " and heavy in your hand" if self.parent == player
47
- "."
48
- end
49
- weight 15 # grams
50
- }
51
-
52
- HouseFoyer = Object("Foyer") {
53
- with {
54
- description "You stand in the foyer of this " \
55
- "ancient structure. A draft swirls through " \
56
- "the hallway to the east."
57
- out_to :Field; w_to :Field
58
- }
59
- has :light
60
- }
61
-
62
- Shingle = Object("Shingle") {
63
- with {
64
- description "You seem to be only a small child " \
65
- "playing on a sea-shore, and diverting yourself " \
66
- "in finding a smoother pebble or a prettier shell " \
67
- "than ordinary, whilst the great ocean of " \
68
- "truth lies all undiscovered before you."
69
- e_to :Field
70
- }
71
- has :light
72
- }
73
-
74
- class InformLibrary
75
- def Initialise
76
- @location = Field
77
- "\n\n\n\n\nWelcome to...\n"
78
- end
79
- end
80
-
81
- Include "Grammar"
82
-
83
- Inform::Grammar <<~EOT
84
- Verb meta 'example'
85
- * -> Example;
86
- Verb 'smile'
87
- * -> Smile;
88
- EOT
89
-
90
- # log.info "Finished loading example game file: #{__FILE__} #<#{self.class}:#{self.object_id}>"
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
3
-
4
- Verb meta 'library'
5
- * 'methods' -> LibraryMethods;
6
-
7
- Verb meta 'test'
8
- * -> Test
9
- * special -> Test
10
- * number special -> Test;
11
-
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
@@ -1,9 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
3
-
4
- # The Huggable module
5
- module Huggable
6
- def life_hug
7
- ":-)"
8
- end
9
- end
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
@@ -1,15 +0,0 @@
1
- # encoding: utf-8
2
- # frozen_string_literal: false
3
-
4
- # The Inform module
5
- module Inform
6
- # The Verb module
7
- module Verbs
8
- def ExampleSub
9
- "This is just an example."
10
- end
11
- def SmileSub
12
- "You smile."
13
- end
14
- end
15
- end