gamefic-standard 2.3.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +41 -0
  3. data/.rspec-opal +2 -0
  4. data/CHANGELOG.md +7 -0
  5. data/Gemfile +2 -0
  6. data/README.md +64 -60
  7. data/Rakefile +14 -6
  8. data/gamefic-standard.gemspec +6 -3
  9. data/lib/gamefic-standard/actions/attack.rb +28 -0
  10. data/lib/gamefic-standard/actions/close.rb +14 -10
  11. data/lib/gamefic-standard/actions/drop.rb +20 -16
  12. data/lib/gamefic-standard/actions/enter.rb +29 -19
  13. data/lib/gamefic-standard/actions/go.rb +51 -47
  14. data/lib/gamefic-standard/actions/help.rb +52 -0
  15. data/lib/gamefic-standard/actions/insert.rb +33 -29
  16. data/lib/gamefic-standard/actions/inventory.rb +12 -8
  17. data/lib/gamefic-standard/actions/leave.rb +43 -39
  18. data/lib/gamefic-standard/actions/lock.rb +21 -17
  19. data/lib/gamefic-standard/actions/look.rb +117 -96
  20. data/lib/gamefic-standard/actions/move.rb +24 -0
  21. data/lib/gamefic-standard/actions/nil.rb +16 -15
  22. data/lib/gamefic-standard/actions/open.rb +7 -7
  23. data/lib/gamefic-standard/actions/place.rb +5 -5
  24. data/lib/gamefic-standard/actions/quit.rb +4 -8
  25. data/lib/gamefic-standard/actions/repeat.rb +14 -0
  26. data/lib/gamefic-standard/actions/save-restore-undo.rb +18 -0
  27. data/lib/gamefic-standard/actions/search.rb +7 -7
  28. data/lib/gamefic-standard/actions/take.rb +15 -4
  29. data/lib/gamefic-standard/actions/talk.rb +17 -5
  30. data/lib/gamefic-standard/actions/unlock.rb +11 -7
  31. data/lib/gamefic-standard/actions/wait.rb +3 -1
  32. data/lib/gamefic-standard/actions.rb +5 -0
  33. data/lib/gamefic-standard/articles.rb +2 -7
  34. data/lib/gamefic-standard/direction.rb +2 -3
  35. data/lib/gamefic-standard/entities/container.rb +2 -0
  36. data/lib/gamefic-standard/entities/door.rb +2 -0
  37. data/lib/gamefic-standard/entities/fixture.rb +2 -1
  38. data/lib/gamefic-standard/entities/item.rb +2 -0
  39. data/lib/gamefic-standard/entities/portal.rb +2 -0
  40. data/lib/gamefic-standard/entities/receptacle.rb +2 -0
  41. data/lib/gamefic-standard/entities/room.rb +21 -36
  42. data/lib/gamefic-standard/entities/rubble.rb +2 -1
  43. data/lib/gamefic-standard/entities/scenery.rb +2 -0
  44. data/lib/gamefic-standard/entities/supporter.rb +2 -0
  45. data/lib/gamefic-standard/entities/thing.rb +2 -0
  46. data/lib/gamefic-standard/give.rb +15 -14
  47. data/lib/gamefic-standard/grammar/pronoun.rb +80 -80
  48. data/lib/gamefic-standard/introduction.rb +8 -0
  49. data/lib/gamefic-standard/modules/enterable.rb +2 -0
  50. data/lib/gamefic-standard/modules/lockable.rb +3 -1
  51. data/lib/gamefic-standard/modules/standardized.rb +10 -12
  52. data/lib/gamefic-standard/modules.rb +0 -1
  53. data/lib/gamefic-standard/queries.rb +7 -20
  54. data/lib/gamefic-standard/version.rb +3 -1
  55. data/lib/gamefic-standard.rb +26 -8
  56. data/spec-opal/spec_helper.rb +32 -0
  57. metadata +34 -13
  58. data/lib/gamefic-standard/modules/use.rb +0 -45
  59. data/lib/gamefic-standard/test.rb +0 -34
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'gamefic-standard'
4
+
5
+ class TestPlot < Gamefic::Plot
6
+ include Gamefic::Standard
7
+ end
8
+
9
+ RSpec.configure do |config|
10
+ # Run specs in random order to surface order dependencies. If you find an
11
+ # order dependency and want to debug it, you can fix the order by providing
12
+ # the seed, which is printed after each run.
13
+ # --seed 1234
14
+ config.order = :random
15
+
16
+ # Seed global randomization in this process using the `--seed` CLI option.
17
+ # Setting this allows you to use `--seed` to deterministically reproduce
18
+ # test failures related to randomization by passing the same `--seed` value
19
+ # as the one that triggered the failure.
20
+ Kernel.srand config.seed
21
+
22
+ # Disable RSpec exposing methods globally on `Module` and `main`
23
+ config.disable_monkey_patching!
24
+
25
+ config.expect_with :rspec do |c|
26
+ c.syntax = :expect
27
+ end
28
+
29
+ config.after :each do
30
+ TestPlot.blocks.clear
31
+ end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic-standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-25 00:00:00.000000000 Z
11
+ date: 2024-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic
@@ -16,42 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.2'
19
+ version: '3.0'
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.2'
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: opal
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
27
41
  - !ruby/object:Gem::Dependency
28
- name: bundler
42
+ name: opal-rspec
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '2.0'
47
+ version: '1.0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '2.0'
54
+ version: '1.0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: rake
56
+ name: opal-sprockets
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '10.0'
61
+ version: '1.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '10.0'
68
+ version: '1.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -88,8 +102,10 @@ executables: []
88
102
  extensions: []
89
103
  extra_rdoc_files: []
90
104
  files:
105
+ - ".github/workflows/rspec.yml"
91
106
  - ".gitignore"
92
107
  - ".rspec"
108
+ - ".rspec-opal"
93
109
  - ".travis.yml"
94
110
  - ".vscode/launch.json"
95
111
  - CHANGELOG.md
@@ -102,19 +118,24 @@ files:
102
118
  - gamefic-standard.gemspec
103
119
  - lib/gamefic-standard.rb
104
120
  - lib/gamefic-standard/actions.rb
121
+ - lib/gamefic-standard/actions/attack.rb
105
122
  - lib/gamefic-standard/actions/close.rb
106
123
  - lib/gamefic-standard/actions/drop.rb
107
124
  - lib/gamefic-standard/actions/enter.rb
108
125
  - lib/gamefic-standard/actions/go.rb
126
+ - lib/gamefic-standard/actions/help.rb
109
127
  - lib/gamefic-standard/actions/insert.rb
110
128
  - lib/gamefic-standard/actions/inventory.rb
111
129
  - lib/gamefic-standard/actions/leave.rb
112
130
  - lib/gamefic-standard/actions/lock.rb
113
131
  - lib/gamefic-standard/actions/look.rb
132
+ - lib/gamefic-standard/actions/move.rb
114
133
  - lib/gamefic-standard/actions/nil.rb
115
134
  - lib/gamefic-standard/actions/open.rb
116
135
  - lib/gamefic-standard/actions/place.rb
117
136
  - lib/gamefic-standard/actions/quit.rb
137
+ - lib/gamefic-standard/actions/repeat.rb
138
+ - lib/gamefic-standard/actions/save-restore-undo.rb
118
139
  - lib/gamefic-standard/actions/search.rb
119
140
  - lib/gamefic-standard/actions/take.rb
120
141
  - lib/gamefic-standard/actions/talk.rb
@@ -139,16 +160,16 @@ files:
139
160
  - lib/gamefic-standard/grammar.rb
140
161
  - lib/gamefic-standard/grammar/attributes.rb
141
162
  - lib/gamefic-standard/grammar/pronoun.rb
163
+ - lib/gamefic-standard/introduction.rb
142
164
  - lib/gamefic-standard/modules.rb
143
165
  - lib/gamefic-standard/modules/enterable.rb
144
166
  - lib/gamefic-standard/modules/lockable.rb
145
167
  - lib/gamefic-standard/modules/openable.rb
146
168
  - lib/gamefic-standard/modules/standardized.rb
147
- - lib/gamefic-standard/modules/use.rb
148
169
  - lib/gamefic-standard/pathfinder.rb
149
170
  - lib/gamefic-standard/queries.rb
150
- - lib/gamefic-standard/test.rb
151
171
  - lib/gamefic-standard/version.rb
172
+ - spec-opal/spec_helper.rb
152
173
  homepage: http://gamefic.com
153
174
  licenses:
154
175
  - MIT
@@ -161,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
182
  requirements:
162
183
  - - ">="
163
184
  - !ruby/object:Gem::Version
164
- version: '0'
185
+ version: 2.7.0
165
186
  required_rubygems_version: !ruby/object:Gem::Requirement
166
187
  requirements:
167
188
  - - ">="
@@ -1,45 +0,0 @@
1
- module Use
2
- def self.children *args
3
- Gamefic::Query::Children.new *args
4
- end
5
-
6
- def self.family *args
7
- Gamefic::Query::Family.new *args
8
- end
9
-
10
- def self.parent *args
11
- Gamefic::Query::Parent.new *args
12
- end
13
-
14
- def self.siblings *args
15
- Gamefic::Query::Siblings.new *args
16
- end
17
-
18
- def self.text *args
19
- Gamefic::Query::Text.new *args
20
- end
21
-
22
- def self.available *args
23
- Gamefic::Query::Available.new *args
24
- end
25
-
26
- def self.reachable *args
27
- available *args
28
- end
29
-
30
- def self.visible *args
31
- available *args
32
- end
33
-
34
- def self.room *args
35
- Gamefic::Query::Room.new *args
36
- end
37
-
38
- def self.itself *args
39
- Gamefic::Query::Itself.new *args
40
- end
41
-
42
- def self.from objects, *args
43
- Gamefic::Query::External.new objects, *args
44
- end
45
- end
@@ -1,34 +0,0 @@
1
- module Tester
2
- def test_procs
3
- @test_procs ||= Hash.new
4
- end
5
-
6
- def on_test name = :me, &block
7
- test_procs[name] = block
8
- end
9
-
10
- def run_test name, actor
11
- queue = []
12
- test_procs[name].call(actor, queue)
13
- actor.queue.concat queue
14
- end
15
- end
16
-
17
- class Gamefic::Plot
18
- include Tester
19
- end
20
-
21
- class Gamefic::Subplot
22
- include Tester
23
- end
24
-
25
- Gamefic.script do
26
- meta :test, Gamefic::Query::Text.new do |actor, name|
27
- sym = name.to_sym
28
- if test_procs[sym].nil?
29
- actor.tell "There's no test named '#{name}' in this game."
30
- else
31
- run_test sym, actor
32
- end
33
- end
34
- end