gamefic 3.0.0 → 3.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.
@@ -61,12 +61,12 @@ module Gamefic
61
61
  # Convert a String into a Command.
62
62
  #
63
63
  # @param text [String]
64
- # @return [Command, nil]
64
+ # @return [Expression, nil]
65
65
  def tokenize text
66
66
  match = text&.match(template.regexp)
67
67
  return nil unless match
68
68
 
69
- Command.new(verb, match_to_args(match))
69
+ Expression.new(verb, match_to_args(match))
70
70
  end
71
71
 
72
72
  # Determine if the specified text matches the syntax's expected pattern.
@@ -94,7 +94,7 @@ module Gamefic
94
94
  #
95
95
  # @param text [String] The text to tokenize.
96
96
  # @param syntaxes [Array<Syntax>] The syntaxes to use.
97
- # @return [Array<Command>] The tokenized commands.
97
+ # @return [Array<Expression>] The tokenized expressions.
98
98
  def self.tokenize text, syntaxes
99
99
  syntaxes
100
100
  .map { |syn| syn.tokenize(text) }
@@ -109,7 +109,7 @@ module Gamefic
109
109
  end
110
110
 
111
111
  # @param string [String]
112
- # @return [String, nil]
112
+ # @return [Symbol, nil]
113
113
  def self.literal_or_nil string
114
114
  string.start_with?(':') ? nil : string.to_sym
115
115
  end
data/lib/gamefic/vault.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gamefic
2
4
  # An array wrapper that exposes a protected interface. The array is always
3
5
  # returned frozen. It can only be modified through #add and #delete. The
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gamefic
4
- VERSION = '3.0.0'
4
+ VERSION = '3.2.0'
5
5
  end
data/lib/gamefic.rb CHANGED
@@ -11,6 +11,7 @@ require 'gamefic/rulebook'
11
11
  require 'gamefic/query'
12
12
  require 'gamefic/scanner'
13
13
  require 'gamefic/scope'
14
+ require 'gamefic/expression'
14
15
  require 'gamefic/command'
15
16
  require 'gamefic/action'
16
17
  require 'gamefic/props'
@@ -27,6 +28,7 @@ require 'gamefic/node'
27
28
  require 'gamefic/describable'
28
29
  require 'gamefic/messenger'
29
30
  require 'gamefic/entity'
31
+ require 'gamefic/composer'
30
32
  require 'gamefic/dispatcher'
31
33
  require 'gamefic/active'
32
34
  require 'gamefic/active/cue'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-27 00:00:00.000000000 Z
11
+ date: 2024-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -136,11 +136,13 @@ files:
136
136
  - lib/gamefic/actor.rb
137
137
  - lib/gamefic/block.rb
138
138
  - lib/gamefic/command.rb
139
+ - lib/gamefic/composer.rb
139
140
  - lib/gamefic/core_ext/array.rb
140
141
  - lib/gamefic/core_ext/string.rb
141
142
  - lib/gamefic/describable.rb
142
143
  - lib/gamefic/dispatcher.rb
143
144
  - lib/gamefic/entity.rb
145
+ - lib/gamefic/expression.rb
144
146
  - lib/gamefic/logging.rb
145
147
  - lib/gamefic/messenger.rb
146
148
  - lib/gamefic/narrative.rb
@@ -149,6 +151,7 @@ files:
149
151
  - lib/gamefic/props.rb
150
152
  - lib/gamefic/props/default.rb
151
153
  - lib/gamefic/props/multiple_choice.rb
154
+ - lib/gamefic/props/output.rb
152
155
  - lib/gamefic/props/pause.rb
153
156
  - lib/gamefic/props/yes_or_no.rb
154
157
  - lib/gamefic/query.rb