gamefic-standard 2.3.0 → 2.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cec02b79dddf5d0d091572a1bcf1f02c3694d1185097ec4872a73575ff8eeb2
4
- data.tar.gz: f12ca35e7714a573ae43dff154828a35e48123b839413f58bf267eb6a72e251d
3
+ metadata.gz: 6abba8f34782d5cfb4beee5d43dc31f155b535da326b385d7404e939d3920c6e
4
+ data.tar.gz: 938d1bdcdbf488ee44531fcc00df5de29c4979869986c5ddbc3e7e479ae8e6bf
5
5
  SHA512:
6
- metadata.gz: c8924d8c3a38a2f8e828a5b3df4ede8fcad15af65f14abbddae13d3be0166e9490c5dc7767e5588a4ccf85f442acf5e780b189700ca3ea3d05a7ce6c27c85abb
7
- data.tar.gz: '094c6956a318d684e1a8efee452333d376141848e7f1470af3dc168786aacfba2af375c6b3c9cbe5636fb53b2b51a66f47cb3b4d0c6b4ac8cc867abded9a7faf'
6
+ metadata.gz: 8b21f6722f5247b3881bc3d056e77838de488f3d907114234a6c3737a9b37f6a7373d62dc1337a83a5c1e46f022e1cc7dd90f5c55c09043010e07ac814d01a97
7
+ data.tar.gz: 3ea46e35b5f526854c8666f1dee03a5d72f77995dc2cdf803ae6f5b26b07bc619e698b9fc14b1f2c8082924d10cbe4a4ca219ac3db8b08210668c46a5b4cf1e9
@@ -0,0 +1,40 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with rspec.
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: RSpec
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1']
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
31
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
32
+ uses: ruby/setup-ruby@v1
33
+ # uses: ruby/setup-ruby@2b019609e2b0f1ea1a2bc8ca11cb82ab46ada124
34
+ with:
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: false
37
+ - name: Install dependencies
38
+ run: bundle install
39
+ - name: Run tests
40
+ run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 2.4.0 - February 11, 2023
2
+ - Change Actor#perform to Actor#execute
3
+ - Update gamefic dependency
4
+
5
+ ## 2.3.1 - September 25, 2022
6
+ - Handle leave actions without parents
7
+
1
8
  ## 2.3.0 - September 4, 2021
2
9
  - Use nil actions for untokenized arguments
3
10
  - Fix response to closing closed entities
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
36
  spec.require_paths = ["lib"]
37
37
 
38
- spec.add_dependency 'gamefic', '~> 2.2'
38
+ spec.add_dependency 'gamefic', '~> 2.4'
39
39
 
40
40
  spec.add_development_dependency 'bundler', '~> 2.0'
41
41
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -4,7 +4,7 @@ Gamefic.script do
4
4
  end
5
5
 
6
6
  respond :drop, Gamefic::Query::Descendants.new do |actor, thing|
7
- actor.perform :take, thing
7
+ actor.execute :take, thing
8
8
  next unless thing.parent == actor
9
9
  thing.parent = actor.parent
10
10
  actor.tell "You drop #{the thing}."
@@ -7,7 +7,7 @@ Gamefic.script do
7
7
  if !portal.direction.nil?
8
8
  actor.tell "You go #{portal.direction}."
9
9
  end
10
- actor.perform :look
10
+ actor.execute :look
11
11
  end
12
12
  end
13
13
 
@@ -15,7 +15,7 @@ Gamefic.script do
15
15
  if actor.parent == actor.room
16
16
  actor.tell "I don't see any way to go \"#{text} from here."
17
17
  else
18
- actor.perform :leave
18
+ actor.execute :leave
19
19
  if actor.parent == actor.room
20
20
  actor.perform "go #{text}"
21
21
  else
@@ -25,7 +25,7 @@ Gamefic.script do
25
25
  end
26
26
 
27
27
  respond :go, Use.available(Door) do |actor, door|
28
- actor.perform :open, door unless door.open?
28
+ actor.execute :open, door unless door.open?
29
29
  actor.proceed if door.open?
30
30
  end
31
31
 
@@ -4,7 +4,7 @@ Gamefic.script do
4
4
  end
5
5
 
6
6
  respond :insert, Use.available, Use.available(Receptacle) do |actor, thing, receptacle|
7
- actor.perform :take, thing unless thing.parent == actor
7
+ actor.execute :take, thing unless thing.parent == actor
8
8
  next unless thing.parent == actor
9
9
  thing.parent = receptacle
10
10
  actor.tell "You put #{the thing} in #{the receptacle}."
@@ -18,18 +18,22 @@ Gamefic.script do
18
18
  if portals.length == 0
19
19
  actor.tell "You don't see any obvious exits."
20
20
  elsif portals.length == 1
21
- actor.perform :go, portals[0]
21
+ actor.execute :go, portals[0]
22
22
  else
23
23
  actor.tell "I don't know which way you want to go: #{portals.join_or}."
24
24
  end
25
25
  end
26
26
 
27
27
  respond :leave do |actor|
28
- actor.perform :leave, actor.parent
28
+ if actor.parent
29
+ actor.execute :leave, actor.parent
30
+ else
31
+ actor.tell "You don't see any obvious exits."
32
+ end
29
33
  end
30
34
 
31
35
  respond :leave, Use.parent(Container, :enterable?, :closed?) do |actor, container|
32
- actor.perform :open, container
36
+ actor.execute :open, container
33
37
  actor.proceed if container.open?
34
38
  end
35
39
 
@@ -13,7 +13,7 @@ Gamefic.script do
13
13
  end
14
14
 
15
15
  respond :lock, Use.available(Lockable, :has_lock_key?), Use.available do |actor, thing, key|
16
- actor.perform :take, key if key.parent != actor
16
+ actor.execute :take, key if key.parent != actor
17
17
  actor.proceed if key.parent == actor
18
18
  end
19
19
 
@@ -1,11 +1,11 @@
1
1
  Gamefic.script do
2
2
  respond :look, Use.text(/^here$/i) do |actor, _|
3
- actor.perform :look, actor.room
3
+ actor.execute :look, actor.room
4
4
  end
5
5
 
6
6
  respond :look, Use.itself do |actor, _|
7
7
  actor.tell actor.description
8
- actor.perform :inventory
8
+ actor.execute :inventory
9
9
  end
10
10
 
11
11
  respond :look, Use.available(Thing) do |actor, thing|
@@ -21,8 +21,8 @@ Gamefic.script do
21
21
  end
22
22
 
23
23
  respond :open, Use.available(Lockable, :has_lock_key?), Use.available do |actor, thing, key|
24
- actor.perform :unlock, thing, key
25
- actor.perform :open, thing if thing.unlocked?
24
+ actor.execute :unlock, thing, key
25
+ actor.execute :open, thing if thing.unlocked?
26
26
  end
27
27
 
28
28
  interpret 'open :thing with :key', 'open :thing :key'
@@ -4,7 +4,7 @@ Gamefic.script do
4
4
  end
5
5
 
6
6
  respond :place, Use.available, Use.available(Supporter) do |actor, thing, supporter|
7
- actor.perform :take, thing unless thing.parent == actor
7
+ actor.execute :take, thing unless thing.parent == actor
8
8
  next unless thing.parent == actor
9
9
  thing.parent = supporter
10
10
  actor.tell "You put #{the thing} on #{the supporter}."
@@ -1,6 +1,6 @@
1
1
  Gamefic.script do
2
2
  respond :search, Use.available(Thing) do |actor, thing|
3
- actor.perform :look, thing
3
+ actor.execute :look, thing
4
4
  end
5
5
 
6
6
  respond :search, Use.available(Receptacle) do |actor, thing|
@@ -17,7 +17,7 @@ Gamefic.script do
17
17
  end
18
18
 
19
19
  respond :search, Use.available(Container, :closed?) do |actor, container|
20
- actor.perform :open, container
20
+ actor.execute :open, container
21
21
  actor.proceed if container.open?
22
22
  end
23
23
 
@@ -4,7 +4,7 @@ Gamefic.script do
4
4
  end
5
5
 
6
6
  respond :talk, Use.itself do |actor, yourself|
7
- actor.perform :talk
7
+ actor.execute :talk
8
8
  end
9
9
 
10
10
  respond :talk, Use.available do |actor, thing|
@@ -13,7 +13,7 @@ Gamefic.script do
13
13
  end
14
14
 
15
15
  respond :unlock, Use.available(Lockable, :has_lock_key?), Use.available do |actor, _thing, key|
16
- actor.perform :take, key if key.parent != actor
16
+ actor.execute :take, key if key.parent != actor
17
17
  actor.proceed if key.parent == actor
18
18
  end
19
19
 
@@ -9,7 +9,7 @@ Gamefic.script do
9
9
 
10
10
  respond :give, Use.available(Character), Use.available do |actor, _character, gift|
11
11
  if gift.parent != actor
12
- actor.perform :take, gift
12
+ actor.execute :take, gift
13
13
  end
14
14
  if gift.parent == actor
15
15
  actor.proceed
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gamefic
2
4
  module Standard
3
- VERSION = '2.3.0'
5
+ VERSION = '2.4.0'
4
6
  end
5
7
  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.0
4
+ version: 2.4.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: 2021-09-04 00:00:00.000000000 Z
11
+ date: 2023-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.2'
19
+ version: '2.4'
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: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +88,7 @@ executables: []
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
+ - ".github/workflows/rspec.yml"
91
92
  - ".gitignore"
92
93
  - ".rspec"
93
94
  - ".travis.yml"
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
169
  - !ruby/object:Gem::Version
169
170
  version: '0'
170
171
  requirements: []
171
- rubygems_version: 3.1.6
172
+ rubygems_version: 3.3.7
172
173
  signing_key:
173
174
  specification_version: 4
174
175
  summary: The Gamefic standard script library.