inform6lib 0.0.4 → 0.0.6

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: 477a096d09791055964f9ce00e5704458229ea4f93a08fe02e3933e4b55fe965
4
- data.tar.gz: 47623263a5a61447eed164253a5e149a82901dcd690c5b218986f6577569fde0
3
+ metadata.gz: 75df46b86e8925d0c8718ba0e793d0f2d0484d5c1453799353f08e1b309ad315
4
+ data.tar.gz: 41f7feeec64e87be45b5f21aaf8fc5762caa69dc76c99760a6380aa853081dc9
5
5
  SHA512:
6
- metadata.gz: ec37887dfa90266ea2859cc48dff0feda6bbb82bbbb7c794e241a729d3011750cb5f3431bfce92c3ad3fc5f1732bcd44600b80742c7957edbde9784549374063
7
- data.tar.gz: 7ba5fed6397f7eeaee3f5e821e53967a77ddb8e3192281da7b80948739898ed8a72297b00848cb344f06277c90beec902ad51c3b04a66ad3f4cab607f883775e
6
+ metadata.gz: cad7012fd9edb3fdc6a2fc861781d7ed27a1600dfe1c0d48b7592db6c0499bf9091af0ac379178c7b4fd6b663f2d9c40fb2f9abffea48b486e068a1cdaec9988
7
+ data.tar.gz: b53828a2b70ad238ab6cbcfef5a9056922ac8815548b7527634b692d7bd3824c343b9820f0470161db5cd7e171cf43c738bf73bfd99694833132c040ee179563
data/README.md CHANGED
@@ -1,17 +1,17 @@
1
- # Inform6 Ruby Port
1
+ # Inform 6 Ruby Port
2
2
 
3
3
  [![License](https://img.shields.io/badge/license-Artistic--2.0-blue.svg?style=flat)][license]
4
4
 
5
5
 
6
6
 
7
- **The Inform 6 Library Ruby Port** is a faithful port of the Inform6
7
+ **The Inform 6 Library Ruby Port** is a faithful port of the Inform 6
8
8
  interactive fiction standard library to Ruby.
9
9
 
10
10
  The Inform 6 Library Ruby Port includes the natural language parser
11
11
  library, the verb subroutine library, and the standard grammar definitions.
12
12
 
13
13
  The reimplementation in Ruby is intended to be as faithful as possible to
14
- [the Inform6 interactive fiction standard library, maintained by David
14
+ [the Inform 6 interactive fiction standard library, maintained by David
15
15
  Griffith](https://gitlab.com/DavidGriffith/inform6lib)
16
16
 
17
17
  However, the current version of the ported library has been based on
@@ -23,26 +23,26 @@ David Griffith's Release 6.12.2-pre (serial number 160608).
23
23
  ## Requirements
24
24
 
25
25
  It is necessary to use the companion runtime for a program which is
26
- written to use the Ruby Inform6 Library. This arrangement and dependence
26
+ written to use the Ruby Inform 6 Library. This arrangement and dependence
27
27
  on a second piece of software is required for two reasons.
28
28
 
29
29
  First, it was explicitly requested of me by the author of the original
30
- Inform6 Library, Graham Nelson, that the license used for the ruby port
31
- would be compatible with the original Inform6 releases, specifically the
30
+ Inform 6 Library, Graham Nelson, that the license used for the ruby port
31
+ would be compatible with the original Inform 6 releases, specifically the
32
32
  Artistic License.
33
33
 
34
34
  Second, it is the primary goal of this software project to represent as
35
35
  closely as possible the original source code. But of course, the original
36
- source code required the Inform6 compiler, which converted the source code
36
+ source code required the Inform 6 compiler, which converted the source code
37
37
  into byte code to be executed portably by an interpreter program compiled
38
38
  for a user's specific system. A program running in the Ruby interpreter
39
39
  runtime will not require such a compiler, simply a runtime apparatus.
40
- However, in order to maintain a close resemblance to the original Inform6
41
- Library, it is decided to make the runtime component of this Ruby Inform6
40
+ However, in order to maintain a close resemblance to the original Inform 6
41
+ Library, it is decided to make the runtime component of this Ruby Inform 6
42
42
  development framework remain a project independent from the ported library.
43
43
 
44
- To use the Inform6 Library Ruby Port, one must install the Inform Runtime
45
- program that supports running a game written using the Inform6 Library.
44
+ To use the Inform 6 Library Ruby Port, one must install the Inform Runtime
45
+ program that supports running a game written using the Inform 6 Library.
46
46
 
47
47
  This component is packaged and distributed as its own separate stand-alone
48
48
  gem. So to get up and running as quickly as possible, you may obtain the
@@ -55,21 +55,20 @@ gem install inform-runtime
55
55
 
56
56
  ## Run
57
57
 
58
- Execute the `inform6.rb` program. It will play the example game included
58
+ Execute the `inform.rb` program. It will play the example game included
59
59
  with the runtime software.
60
60
 
61
61
  ```sh
62
- bundle exec inform6.rb
62
+ bundle exec inform.rb
63
63
  ```
64
64
 
65
65
  ```
66
+ Welcome to...
66
67
 
67
68
  EXAMPLE
68
-
69
69
  An Interactive Example
70
- Copyright (c) 2022 by Nels N. Nelson.
71
-
72
- Release 1 / Serial number 220730 / inform6.rb v1.0.1 Library 6/11N
70
+ Copyright (c) 2025 by Nels N. Nelson.
71
+ Release 1 / Serial number 251006 / inform.rb v1.0.3 Library 6/11N
73
72
 
74
73
  Field
75
74
  You are standing in a field in front of a small 19th century house which stands just to the east of you. The house hardly stands up to the stiff wind rolling down from the north.
data/Rakefile CHANGED
@@ -7,59 +7,67 @@
7
7
  require 'rake'
8
8
  require 'rake/clean'
9
9
 
10
- project = File.basename(__dir__, '-ruby')
10
+ unless defined?(Inform6Lib::PROJECT)
11
+ # Ensure Inform6Lib module constants
12
+ module Inform6Lib
13
+ SUFFIX = '-ruby'.freeze unless defined?(Inform6Lib::SUFFIX)
14
+ PROJECT = File.basename(__dir__, Inform6Lib::SUFFIX)
15
+ end
16
+ end
11
17
 
12
- load "#{project}.gemspec"
18
+ load "#{Inform6Lib::PROJECT}.gemspec"
13
19
 
14
20
  CLEAN.add File.join('tmp', '**', '*'), 'tmp'
15
- CLOBBER.add "#{project}-*", '*.gem', 'pkg'
21
+ CLOBBER.add "#{Inform6Lib::PROJECT}-*", '*.gem', 'pkg'
16
22
 
17
23
  task default: %i[package]
18
24
 
19
25
  desc 'Run the rubocop linter'
20
26
  task :lint do
21
- system(*'bundle exec rubocop'.split) or abort
27
+ system('bundle', 'exec', 'rubocop') or abort
22
28
  end
23
29
 
24
30
  desc 'Explode the gem'
25
31
  task :explode do
26
- system(*'gem install --no-document --install-dir=tmp *.gem'.split)
32
+ puts "Installing gem into the ./tmp directory..."
33
+ gems = Dir['*.gem']
34
+ raise 'No .gem files found' if gems.empty?
35
+ system('gem', 'install', '--no-document', '--install-dir=tmp', *gems) or abort
27
36
  end
28
37
  task explode: :clean
29
38
 
30
39
  desc 'Package the gem'
31
40
  task :package do
32
- system(*'gem build'.split)
41
+ system('gem', 'build')
33
42
  end
34
43
  task package: %i[clean clobber lint]
35
44
 
36
45
  desc 'Verify the gem'
37
46
  task :verify do
38
- system(*'bundle exec rspec spec/verify_spec.rb'.split) or abort
39
- system(*'bundle exec rake clean'.split)
47
+ system('bundle', 'exec', 'rspec', 'spec/verify_gem_spec.rb') or abort
48
+ system('bundle', 'exec', 'rake', 'clean')
40
49
  end
41
50
  task verify: :explode
42
51
 
43
52
  desc 'Host dev gem'
44
53
  task :devhost do
45
- system(*"bundle exec gem inabox --overwrite #{latest_gem}".split) unless latest_gem.nil?
54
+ system('bundle', 'exec', 'gem', 'inabox', '--overwrite ', latest_gem) unless latest_gem.nil?
46
55
  end
47
56
  task devhost: :verify
48
57
 
49
58
  desc 'Publish the gem to GitHub Packages'
50
59
  task :publish_github do
51
60
  host = 'https://rubygems.pkg.github.com/nelsnelson'
52
- system(*"gem push --key github --host #{host} #{latest_gem}".split)
61
+ system('gem', 'push', '--key', 'github', '--host', host, latest_gem) or abort
53
62
  end
54
63
  task publish_github: :verify
55
64
 
56
65
  desc 'Publish the gem'
57
66
  task :publish do
58
- system(*"gem push #{latest_gem}".split) unless latest_gem.nil?
67
+ system('gem', 'push', latest_gem) or abort
59
68
  end
60
69
  task publish: :verify
61
70
 
62
71
  def latest_gem
63
- project = File.basename(__dir__, '-ruby')
64
- `find . -name "#{project}*.gem"`.strip.split("\n").first
72
+ Dir["#{Inform6Lib::PROJECT}*.gem"].max_by { |p| File.mtime(p) }
65
73
  end
@@ -17,10 +17,10 @@
17
17
  # English.
18
18
  # ==============================================================================
19
19
 
20
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
20
+ # Copyright Nels Nelson 2008-2025 but freely usable (see license)
21
21
  #
22
22
  # You should have received a copy of the Artistic License
23
- # along with the Inform6 Ruby Port.
23
+ # along with the Inform 6 Ruby Port.
24
24
  #
25
25
  # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
26
26
 
@@ -6,15 +6,17 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
10
- # ==============================================================================
11
-
12
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
13
11
  #
14
- # You should have received a copy of the Artistic License
15
- # along with the Inform6 Ruby Port.
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
16
14
  #
17
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
19
+ # ==============================================================================
18
20
 
19
21
  # ------------------------------------------------------------------------------
20
22
  # The "meta-verbs", commands to the game rather than in the game, come first:
@@ -6,7 +6,16 @@
6
6
  #
7
7
  # Supplied for use with Inform 6/7 -- Release 6/11N -- Serial number 060709
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # In your game file, Include three library files in this order:
12
21
  # Include "Parser";
@@ -14,13 +23,6 @@
14
23
  # Include "Grammar";
15
24
  # ==============================================================================
16
25
 
17
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
18
- #
19
- # You should have received a copy of the Artistic License
20
- # along with the Inform6 Ruby Port.
21
- #
22
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
23
-
24
26
  # System_file
25
27
 
26
28
  # ------------------------------------------------------------------------------
@@ -6,7 +6,16 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # In your game file, Include three library files in this order:
12
21
  # Include "Parser";
@@ -14,13 +23,6 @@
14
23
  # Include "Grammar";
15
24
  # ==============================================================================
16
25
 
17
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
18
- #
19
- # You should have received a copy of the Artistic License
20
- # along with the Inform6 Ruby Port.
21
- #
22
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
23
-
24
26
  # The Inform module
25
27
  module Inform
26
28
  Default :AMUSING_PROVIDED, 1
@@ -6,19 +6,21 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # This file is automatically Included in your game file by "Grammar" if you
12
21
  # supply the -X compiler switch.
13
22
  # ==============================================================================
14
23
 
15
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
16
- #
17
- # You should have received a copy of the Artistic License
18
- # along with the Inform6 Ruby Port.
19
- #
20
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
21
-
22
24
  # ------------------------------------------------------------------------------
23
25
 
24
26
  Verb meta ';i' ';inv' ';inventory'
@@ -6,19 +6,21 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # This file is automatically Included in your game file by "Grammar" if you
12
21
  # supply the -X compiler switch.
13
22
  # ==============================================================================
14
23
 
15
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
16
- #
17
- # You should have received a copy of the Artistic License
18
- # along with the Inform6 Ruby Port.
19
- #
20
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
21
-
22
24
  # ------------------------------------------------------------------------------
23
25
 
24
26
  if defined? DEBUG_INFIX
@@ -6,7 +6,16 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # This file is automatically Included in your game file by "Parser".
12
21
  # ==============================================================================
@@ -6,20 +6,21 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # This file is automatically Included in your game file by "verblibm" only if
12
21
  # you supply the -U compiler switch to use pre-compiled Modules.
13
22
  # ==============================================================================
14
23
 
15
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
16
- #
17
- # You should have received a copy of the Artistic License
18
- # along with the Inform6 Ruby Port.
19
- #
20
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
21
-
22
-
23
24
  # ------------------------------------------------------------------------------
24
25
 
25
26
  import_global :location
@@ -6,7 +6,16 @@
6
6
  #
7
7
  # Supplied for use with Inform 6 -- Release 6/11N -- Serial number 060709
8
8
  #
9
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
11
+ #
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
14
+ #
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
17
+ #
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
10
19
  #
11
20
  # This file is automatically Included in your game file by "Parser".
12
21
  # ------------------------------------------------------------------------------
@@ -47,13 +56,6 @@
47
56
  # Game banner, "version" verb, run-time errors
48
57
  # ==============================================================================
49
58
 
50
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
51
- #
52
- # You should have received a copy of the Artistic License
53
- # along with the Inform6 Ruby Port.
54
- #
55
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
56
-
57
59
  # This is not our English.h.rb, this is the Ruby built-in English module
58
60
  # which supports the referencing of Special Global Variables like
59
61
  # $LAST_MATCH_INFO by their screaming snake case names.
@@ -1,24 +1,24 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: false
3
3
 
4
- # rubocop: disable Lint/UselessAssignment
5
-
6
4
  # ==============================================================================
7
5
  # VerbLib: Core of standard verbs library.
8
6
  #
9
7
  # Supplied for use with Inform 6 -- Release 6/11 -- Serial number 040227
10
8
  #
11
- # Copyright Graham Nelson 1993-2004 but freely usable (see manuals)
9
+ # Copyright Graham Nelson 1993-2004 and Nels Nelson 2008-2025 but
10
+ # freely usable (see manuals)
12
11
  #
13
- # This file is automatically Included in your game file by "VerbLib".
14
- # ==============================================================================
15
-
16
- # Copyright Nels Nelson 2008-2022 but freely usable (see license)
12
+ # This code is licensed under either the traditional Inform license as
13
+ # described by the DM4 or the Artistic License version 2.0.
17
14
  #
18
- # You should have received a copy of the Artistic License
19
- # along with the Inform6 Ruby Port.
15
+ # You should have received a copy of the Artistic License along with
16
+ # the Inform 6 Ruby Port.
20
17
  #
21
- # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
18
+ # If not, see <https://www.perlfoundation.org/artistic-license-20.html>.
19
+ #
20
+ # This file is automatically Included in your game file by "VerbLib".
21
+ # ==============================================================================
22
22
 
23
23
  # The Inform module
24
24
  module Inform
@@ -1122,7 +1122,7 @@ module Verbs
1122
1122
 
1123
1123
  def InvSub
1124
1124
  return L__M(:Inv, 1) unless child(@player)
1125
- return InvTallSub() if @inventory_style == 0
1125
+ return InvTallSub() if @inventory_style.nil?
1126
1126
 
1127
1127
  L__M(:Inv, 2)
1128
1128
  if (@inventory_style & NEWLINE_BIT) != 0 then L__M(:Inv, 3) else print " " end
@@ -2468,8 +2468,6 @@ end
2468
2468
  end
2469
2469
  # module Inform
2470
2470
 
2471
- # rubocop: enable Lint/UselessAssignment
2472
-
2473
2471
  # The Inform module
2474
2472
  module Inform
2475
2473
  # The Parser module
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inform6lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nels Nelson