gamefic-standard 2.3.1 → 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 +4 -4
- data/.github/workflows/rspec.yml +40 -0
- data/CHANGELOG.md +4 -0
- data/gamefic-standard.gemspec +1 -1
- data/lib/gamefic-standard/actions/drop.rb +1 -1
- data/lib/gamefic-standard/actions/go.rb +3 -3
- data/lib/gamefic-standard/actions/insert.rb +1 -1
- data/lib/gamefic-standard/actions/leave.rb +3 -3
- data/lib/gamefic-standard/actions/lock.rb +1 -1
- data/lib/gamefic-standard/actions/look.rb +2 -2
- data/lib/gamefic-standard/actions/open.rb +2 -2
- data/lib/gamefic-standard/actions/place.rb +1 -1
- data/lib/gamefic-standard/actions/search.rb +2 -2
- data/lib/gamefic-standard/actions/talk.rb +1 -1
- data/lib/gamefic-standard/actions/unlock.rb +1 -1
- data/lib/gamefic-standard/give.rb +1 -1
- data/lib/gamefic-standard/version.rb +3 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6abba8f34782d5cfb4beee5d43dc31f155b535da326b385d7404e939d3920c6e
|
|
4
|
+
data.tar.gz: 938d1bdcdbf488ee44531fcc00df5de29c4979869986c5ddbc3e7e479ae8e6bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
data/gamefic-standard.gemspec
CHANGED
|
@@ -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.
|
|
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'
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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,7 +18,7 @@ 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.
|
|
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
|
|
@@ -26,14 +26,14 @@ Gamefic.script do
|
|
|
26
26
|
|
|
27
27
|
respond :leave do |actor|
|
|
28
28
|
if actor.parent
|
|
29
|
-
actor.
|
|
29
|
+
actor.execute :leave, actor.parent
|
|
30
30
|
else
|
|
31
31
|
actor.tell "You don't see any obvious exits."
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
respond :leave, Use.parent(Container, :enterable?, :closed?) do |actor, container|
|
|
36
|
-
actor.
|
|
36
|
+
actor.execute :open, container
|
|
37
37
|
actor.proceed if container.open?
|
|
38
38
|
end
|
|
39
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.
|
|
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.
|
|
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.
|
|
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.
|
|
25
|
-
actor.
|
|
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.
|
|
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.
|
|
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.
|
|
20
|
+
actor.execute :open, container
|
|
21
21
|
actor.proceed if container.open?
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -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.
|
|
16
|
+
actor.execute :take, key if key.parent != actor
|
|
17
17
|
actor.proceed if key.parent == actor
|
|
18
18
|
end
|
|
19
19
|
|
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.
|
|
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:
|
|
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.
|
|
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.
|
|
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"
|