gamefic-sdk 2.0.2 → 2.3.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/.gitignore +0 -1
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/bin/gamefic +0 -10
- data/gamefic-sdk.gemspec +2 -2
- data/lib/gamefic-sdk/server.rb +1 -2
- data/lib/gamefic-sdk/tasks/web.rb +0 -1
- data/lib/gamefic-sdk/version.rb +1 -1
- data/scaffolds/react/.babelrc +1 -1
- data/scaffolds/react/package.json.gf.erb +13 -13
- data/scaffolds/react/web/src/index.js +12 -1
- data/scaffolds/react/web/src/scenes/Activity.jsx +13 -0
- data/scaffolds/react/web/src/scenes/Conclusion.jsx +12 -0
- data/scaffolds/react/web/src/scenes/MultipleChoice.jsx +13 -0
- data/scaffolds/react/web/src/scenes/Pause.jsx +13 -0
- data/scaffolds/react/web/src/scenes/index.js +11 -0
- data/scaffolds/react/webpack.config.js +11 -9
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f10176e643c4b2c2d6cfaab7cc0e9ef02b5e1d2611663c3722b22fd26f8a19ff
|
4
|
+
data.tar.gz: 8337ecbafa9ddfc546f1002bf176f507447640429ea110c96b544c046e52c205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e89c8edd366ac6e4a36b9edfa5bf7240ff344297e6ccfcef105ee92c3ee4f7ce7ac771498f32cf2bbdc69562a292bd1b4de9eeecc9ea3e06e54d0a646130ccb
|
7
|
+
data.tar.gz: 241fbc39235327f6e03aefb68955650a73f17508212f5482ebb9bdaebb82e449fefd0aeb4f04198054aad49ea07505c2f080f4e3a526e3b6e22645803c22e6b8
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
## 2.3.0 - December 14, 2020
|
2
|
+
- Update package dependencies for web builds
|
3
|
+
|
4
|
+
## 2.2.0 - August 29, 2020
|
5
|
+
- Update to react-gamefic 0.4.0
|
6
|
+
|
7
|
+
## 2.1.0 - August 27, 2020
|
8
|
+
- Update web app with customizable scene components
|
9
|
+
|
10
|
+
## 2.0.4 - April 25, 2020
|
11
|
+
- Server does not symbolize snapshot keys
|
12
|
+
- Update dependencies
|
data/README.md
CHANGED
@@ -123,7 +123,7 @@ Note: building the web app requires [Node.js](https://nodejs.org).
|
|
123
123
|
### Example Projects
|
124
124
|
|
125
125
|
The gamefic-sdk repo includes several example projects that provide more
|
126
|
-
|
126
|
+
complete demonstrations of Gamefic's features. To run an example, copy
|
127
127
|
its `main.rb` file to your own project.
|
128
128
|
|
129
129
|
### Learning More
|
data/bin/gamefic
CHANGED
@@ -4,13 +4,3 @@ require 'gamefic-sdk'
|
|
4
4
|
require 'gamefic-sdk/shell'
|
5
5
|
|
6
6
|
Gamefic::Sdk::Shell.start(ARGV)
|
7
|
-
|
8
|
-
#!/usr/bin/env ruby
|
9
|
-
|
10
|
-
#require 'gamefic'
|
11
|
-
#require 'gamefic-tty'
|
12
|
-
|
13
|
-
# Make play the default command if the first argument is an existing file
|
14
|
-
#args = %w(play help).include?(ARGV[0]) || ARGV.count.zero? || !File.exist?(ARGV[0]) ? ARGV : ARGV.dup.unshift('play')
|
15
|
-
|
16
|
-
#Gamefic::Tty::Shell.start(args)
|
data/gamefic-sdk.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.required_ruby_version = '>= 2.3.0'
|
26
26
|
|
27
|
-
s.add_runtime_dependency 'gamefic', '~> 2.0', '>= 2.0.
|
27
|
+
s.add_runtime_dependency 'gamefic', '~> 2.0', '>= 2.0.2'
|
28
28
|
s.add_runtime_dependency 'gamefic-standard', '~> 2.0'
|
29
29
|
s.add_runtime_dependency 'gamefic-tty', '~> 2.0', '>= 2.0.1'
|
30
30
|
s.add_runtime_dependency 'listen', '~> 3.0'
|
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.add_development_dependency 'bundler', '~> 2.0'
|
36
36
|
s.add_development_dependency 'capybara', '~> 3.3'
|
37
37
|
s.add_development_dependency 'puma', '~> 3'
|
38
|
-
s.add_development_dependency 'rake', '~>
|
38
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
39
39
|
s.add_development_dependency 'rspec', '~> 3.0'
|
40
40
|
s.add_development_dependency 'selenium-webdriver', '~> 3.13'
|
41
41
|
s.add_development_dependency 'simplecov', '~> 0.14'
|
data/lib/gamefic-sdk/server.rb
CHANGED
@@ -32,7 +32,6 @@ module Gamefic
|
|
32
32
|
content_type :json
|
33
33
|
@@plot.update
|
34
34
|
@@plot.ready
|
35
|
-
# @@character.state.merge(input: params['command'], continued: @@character.queue.any?).to_json
|
36
35
|
@@character.output.to_json
|
37
36
|
end
|
38
37
|
|
@@ -45,7 +44,7 @@ module Gamefic
|
|
45
44
|
content_type :json
|
46
45
|
# The snapshot needs to be received as a JSON string because of issues
|
47
46
|
# with IndifferentHash malforming arrays.
|
48
|
-
snapshot = JSON.parse(params['snapshot']
|
47
|
+
snapshot = JSON.parse(params['snapshot'])
|
49
48
|
@@plot.restore snapshot
|
50
49
|
@@character.cue @@plot.default_scene
|
51
50
|
@@plot.update
|
data/lib/gamefic-sdk/version.rb
CHANGED
data/scaffolds/react/.babelrc
CHANGED
@@ -8,27 +8,27 @@
|
|
8
8
|
"private": true,
|
9
9
|
"scripts": {
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
11
|
-
"build": "webpack --
|
12
|
-
"develop": "webpack --
|
11
|
+
"build": "webpack --mode production",
|
12
|
+
"develop": "webpack --mode development"
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
|
-
"babel
|
16
|
-
"babel-loader": "^
|
17
|
-
"babel
|
18
|
-
"babel
|
19
|
-
"copy-webpack-plugin": "^
|
20
|
-
"css-loader": "^
|
21
|
-
"file-loader": "^
|
15
|
+
"@babel/core": "^7.12.0",
|
16
|
+
"babel-loader": "^8.2.2",
|
17
|
+
"@babel/preset-env": "^7.12.10",
|
18
|
+
"@babel/preset-react": "^7.12.10",
|
19
|
+
"copy-webpack-plugin": "^7.0.0",
|
20
|
+
"css-loader": "^5.0.1",
|
21
|
+
"file-loader": "^6.2.0",
|
22
22
|
"opal-webpack-bundler": "^0.0.1",
|
23
23
|
"style-loader": "^0.23.1",
|
24
|
-
"url-loader": "^1.1
|
25
|
-
"webpack": "^
|
26
|
-
"webpack-cli": "^
|
24
|
+
"url-loader": "^4.1.1",
|
25
|
+
"webpack": "^5.10.1",
|
26
|
+
"webpack-cli": "^4.2.0"
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
29
|
"gamefic-driver": "^0.2.1",
|
30
30
|
"react": "^16.5.2",
|
31
31
|
"react-dom": "^16.5.2",
|
32
|
-
"react-gamefic": "^0.
|
32
|
+
"react-gamefic": "^0.5.0"
|
33
33
|
}
|
34
34
|
}
|
@@ -1,13 +1,24 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { render } from 'react-dom';
|
3
3
|
import { Console, Terminal } from 'react-gamefic';
|
4
|
+
|
4
5
|
import { driver } from 'driver';
|
6
|
+
|
7
|
+
import { Activity, Pause, MultipleChoice, Conclusion } from './scenes';
|
5
8
|
import 'react-gamefic/styles/ebook';
|
6
9
|
import './style.css';
|
7
10
|
|
11
|
+
const sceneComponents = {
|
12
|
+
Activity: Activity,
|
13
|
+
Pause: Pause,
|
14
|
+
MultipleChoice: MultipleChoice,
|
15
|
+
YesOrNo: MultipleChoice,
|
16
|
+
Conclusion: Conclusion
|
17
|
+
}
|
18
|
+
|
8
19
|
render(
|
9
20
|
<Console driver={driver}>
|
10
|
-
<Terminal />
|
21
|
+
<Terminal sceneComponents={sceneComponents} autoScroll={true} />
|
11
22
|
</Console>,
|
12
23
|
document.getElementById('root')
|
13
24
|
);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ActivityScene, Output, CommandForm } from 'react-gamefic';
|
3
|
+
|
4
|
+
export class Activity extends React.Component {
|
5
|
+
render() {
|
6
|
+
return (
|
7
|
+
<ActivityScene>
|
8
|
+
<Output {...this.props} transcribe={true} />
|
9
|
+
<CommandForm prompt={this.props.state.prompt} />
|
10
|
+
</ActivityScene>
|
11
|
+
);
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ConclusionScene, Output } from 'react-gamefic';
|
3
|
+
|
4
|
+
export class Conclusion extends React.Component {
|
5
|
+
render() {
|
6
|
+
return (
|
7
|
+
<ConclusionScene>
|
8
|
+
<Output {...this.props} transcribe={true} />
|
9
|
+
</ConclusionScene>
|
10
|
+
);
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MultipleChoiceScene, ChoiceList } from 'react-gamefic';
|
3
|
+
|
4
|
+
export class MultipleChoice extends React.Component {
|
5
|
+
render() {
|
6
|
+
return (
|
7
|
+
<MultipleChoiceScene>
|
8
|
+
<Output {...this.props} transcribe={true} />,
|
9
|
+
<ChoiceList options={this.props.state.options} prompt={this.props.state.prompt} />
|
10
|
+
</MultipleChoiceScene>
|
11
|
+
);
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PauseScene, Output, CommandLink } from 'react-gamefic';
|
3
|
+
|
4
|
+
export class Pause extends React.Component {
|
5
|
+
render() {
|
6
|
+
return (
|
7
|
+
<PauseScene>
|
8
|
+
<Output {...this.props} transcribe={true} />
|
9
|
+
<CommandLink command="">Continue</CommandLink>
|
10
|
+
</PauseScene>
|
11
|
+
);
|
12
|
+
}
|
13
|
+
}
|
@@ -1,24 +1,26 @@
|
|
1
1
|
const path = require('path');
|
2
2
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
3
3
|
|
4
|
-
module.exports = (
|
4
|
+
module.exports = (_env, argv) => {
|
5
5
|
var config = {
|
6
6
|
entry: path.resolve(__dirname, 'web', 'src', 'index.js'),
|
7
7
|
output: {
|
8
8
|
filename: 'bundle.js',
|
9
|
-
path: path.resolve(__dirname, "builds", "web",
|
9
|
+
path: path.resolve(__dirname, "builds", "web", argv.mode)
|
10
10
|
},
|
11
11
|
resolve: {
|
12
12
|
alias: {
|
13
|
-
driver: path.join(__dirname, 'web', 'src', 'driver',
|
13
|
+
driver: path.join(__dirname, 'web', 'src', 'driver', argv.mode)
|
14
14
|
}
|
15
15
|
},
|
16
16
|
plugins: [
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
new CopyWebpackPlugin({
|
18
|
+
patterns: [
|
19
|
+
{
|
20
|
+
from: path.resolve(__dirname, 'web', 'public')
|
21
|
+
}
|
22
|
+
]
|
23
|
+
})
|
22
24
|
],
|
23
25
|
module: {
|
24
26
|
rules: [
|
@@ -45,7 +47,7 @@ module.exports = (env) => {
|
|
45
47
|
}
|
46
48
|
}
|
47
49
|
|
48
|
-
if (
|
50
|
+
if (argv.mode == 'production') {
|
49
51
|
config.module.rules.push(
|
50
52
|
{
|
51
53
|
// opal-webpack-bundler will compile and include ruby files in the pack
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gamefic-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.3.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: 2020-
|
11
|
+
date: 2020-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gamefic
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '2.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 2.0.
|
22
|
+
version: 2.0.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '2.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 2.0.
|
32
|
+
version: 2.0.2
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: gamefic-standard
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,14 +168,14 @@ dependencies:
|
|
168
168
|
requirements:
|
169
169
|
- - "~>"
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: '
|
171
|
+
version: '13.0'
|
172
172
|
type: :development
|
173
173
|
prerelease: false
|
174
174
|
version_requirements: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
176
|
- - "~>"
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version: '
|
178
|
+
version: '13.0'
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: rspec
|
181
181
|
requirement: !ruby/object:Gem::Requirement
|
@@ -228,6 +228,7 @@ files:
|
|
228
228
|
- ".gitignore"
|
229
229
|
- ".rspec"
|
230
230
|
- ".travis.yml"
|
231
|
+
- CHANGELOG.md
|
231
232
|
- Gemfile
|
232
233
|
- LICENSE.txt
|
233
234
|
- README.md
|
@@ -260,6 +261,11 @@ files:
|
|
260
261
|
- scaffolds/react/web/src/driver/opal.rb
|
261
262
|
- scaffolds/react/web/src/driver/production.js
|
262
263
|
- scaffolds/react/web/src/index.js
|
264
|
+
- scaffolds/react/web/src/scenes/Activity.jsx
|
265
|
+
- scaffolds/react/web/src/scenes/Conclusion.jsx
|
266
|
+
- scaffolds/react/web/src/scenes/MultipleChoice.jsx
|
267
|
+
- scaffolds/react/web/src/scenes/Pause.jsx
|
268
|
+
- scaffolds/react/web/src/scenes/index.js
|
263
269
|
- scaffolds/react/web/src/style.css
|
264
270
|
- scaffolds/react/webpack.config.js
|
265
271
|
homepage: http://gamefic.com
|
@@ -281,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
287
|
- !ruby/object:Gem::Version
|
282
288
|
version: '0'
|
283
289
|
requirements: []
|
284
|
-
rubygems_version: 3.
|
290
|
+
rubygems_version: 3.1.2
|
285
291
|
signing_key:
|
286
292
|
specification_version: 4
|
287
293
|
summary: Gamefic SDK
|