dr_talon 0.1.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 +7 -0
- data/CHANGELOG.md +60 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +270 -0
- data/Rakefile +10 -0
- data/exe/talon +6 -0
- data/lib/dr_talon/cli/engine.rb +274 -0
- data/lib/dr_talon/cli/generate.rb +29 -0
- data/lib/dr_talon/cli.rb +343 -0
- data/lib/dr_talon/config.rb +29 -0
- data/lib/dr_talon/credentials.rb +94 -0
- data/lib/dr_talon/deps/dependency.rb +238 -0
- data/lib/dr_talon/deps/git.rb +69 -0
- data/lib/dr_talon/deps/installer.rb +207 -0
- data/lib/dr_talon/deps/manifest.rb +220 -0
- data/lib/dr_talon/deps/tree.rb +97 -0
- data/lib/dr_talon/deps.rb +62 -0
- data/lib/dr_talon/doctor.rb +161 -0
- data/lib/dr_talon/engine/fetchers.rb +251 -0
- data/lib/dr_talon/engine/git_ignore.rb +63 -0
- data/lib/dr_talon/engine/importer.rb +103 -0
- data/lib/dr_talon/engine/inspector.rb +113 -0
- data/lib/dr_talon/engine/installation.rb +77 -0
- data/lib/dr_talon/engine/materializer.rb +172 -0
- data/lib/dr_talon/engine/spec.rb +38 -0
- data/lib/dr_talon/engine/store.rb +119 -0
- data/lib/dr_talon/engine.rb +50 -0
- data/lib/dr_talon/errors.rb +5 -0
- data/lib/dr_talon/file_copy.rb +49 -0
- data/lib/dr_talon/generators/new_project.rb +289 -0
- data/lib/dr_talon/generators/talon_code.rb +92 -0
- data/lib/dr_talon/http.rb +120 -0
- data/lib/dr_talon/paths.rb +115 -0
- data/lib/dr_talon/project.rb +101 -0
- data/lib/dr_talon/runner.rb +188 -0
- data/lib/dr_talon/talon_framework.rb +103 -0
- data/lib/dr_talon/templates/bare/main_tests.rb.tt +7 -0
- data/lib/dr_talon/templates/bare/rubocop.yml.tt +8 -0
- data/lib/dr_talon/templates/bare/solargraph.yml.tt +24 -0
- data/lib/dr_talon/templates/lib/app/main.rb.tt +13 -0
- data/lib/dr_talon/templates/lib/lib/library.rb.tt +4 -0
- data/lib/dr_talon/templates/lib/lib/version.rb.tt +3 -0
- data/lib/dr_talon/templates/lib/rubocop.yml.tt +9 -0
- data/lib/dr_talon/templates/lib/solargraph.yml.tt +23 -0
- data/lib/dr_talon/templates/lib/test/test_helper.rb.tt +1 -0
- data/lib/dr_talon/templates/lib/test/tests.rb.tt +8 -0
- data/lib/dr_talon/templates/shared/Gemfile.tt +10 -0
- data/lib/dr_talon/templates/shared/README.md.tt +45 -0
- data/lib/dr_talon/templates/shared/editorconfig.tt +9 -0
- data/lib/dr_talon/templates/shared/gitignore.tt +19 -0
- data/lib/dr_talon/templates/talon/game/dependencies.rb.tt +3 -0
- data/lib/dr_talon/templates/talon/game/main.rb.tt +9 -0
- data/lib/dr_talon/templates/talon/game/spin.rb.tt +7 -0
- data/lib/dr_talon/templates/talon/game/title.rb.tt +8 -0
- data/lib/dr_talon/templates/talon/game/title_tests.rb.tt +16 -0
- data/lib/dr_talon/templates/talon/generate/component.rb.tt +19 -0
- data/lib/dr_talon/templates/talon/generate/component_tests.rb.tt +15 -0
- data/lib/dr_talon/templates/talon/generate/prefab.rb.tt +11 -0
- data/lib/dr_talon/templates/talon/generate/prefab_tests.rb.tt +15 -0
- data/lib/dr_talon/templates/talon/generate/scene.rb.tt +14 -0
- data/lib/dr_talon/templates/talon/generate/scene_tests.rb.tt +13 -0
- data/lib/dr_talon/test_report.rb +76 -0
- data/lib/dr_talon/version.rb +5 -0
- data/lib/dr_talon.rb +17 -0
- data/sig/dr_talon.rbs +524 -0
- metadata +142 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require "<%= talon_require %>"
|
|
2
|
+
require "<%= file_require %>"
|
|
3
|
+
|
|
4
|
+
class <%= class_name %>Tests
|
|
5
|
+
class TestScene < Talon::Scene; end
|
|
6
|
+
|
|
7
|
+
def test_<%= file_name %>_updates_and_draws(args, assert)
|
|
8
|
+
scene = TestScene.new
|
|
9
|
+
scene.args = args
|
|
10
|
+
go = scene.spawn(:subject) { |g| g.add(<%= class_name %>) }
|
|
11
|
+
scene.tick
|
|
12
|
+
|
|
13
|
+
assert.true! go[<%= class_name %>].is_a?(<%= class_name %>), "the component should be attached"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# A prefab: a reusable game object setup. Spawn one with
|
|
2
|
+
# spawn(:<%= file_name %>, <%= class_name %>, x: 640, y: 360)
|
|
3
|
+
module <%= class_name %>
|
|
4
|
+
# @param go [Talon::GameObject] the object being spawned
|
|
5
|
+
def self.call(go)
|
|
6
|
+
go.w ||= 32
|
|
7
|
+
go.h ||= 32
|
|
8
|
+
go.path ||= "sprites/square/blue.png"
|
|
9
|
+
# go.add(SomeComponent, speed: 2)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require "<%= talon_require %>"
|
|
2
|
+
require "<%= file_require %>"
|
|
3
|
+
|
|
4
|
+
class <%= class_name %>Tests
|
|
5
|
+
class TestScene < Talon::Scene; end
|
|
6
|
+
|
|
7
|
+
def test_<%= file_name %>_spawns(args, assert)
|
|
8
|
+
scene = TestScene.new
|
|
9
|
+
scene.args = args
|
|
10
|
+
go = scene.spawn(:<%= file_name %>, <%= class_name %>, x: 10, y: 20)
|
|
11
|
+
scene.tick
|
|
12
|
+
|
|
13
|
+
assert.equal! [ go.x, go.y ], [ 10, 20 ]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# A scene: one screen or level of the game. Switch to it with
|
|
2
|
+
# game.change_scene(<%= class_name %>.new)
|
|
3
|
+
class <%= class_name %> < Talon::Scene
|
|
4
|
+
# Scene state lives in args.state and is cleared when the scene ends.
|
|
5
|
+
# state :score, default: 0
|
|
6
|
+
|
|
7
|
+
on_enter do
|
|
8
|
+
# Spawn the scene's game objects, e.g.:
|
|
9
|
+
# spawn(:player, Player, x: 640, y: 360)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
on_exit do
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require "<%= talon_require %>"
|
|
2
|
+
require "<%= file_require %>"
|
|
3
|
+
|
|
4
|
+
class <%= class_name %>Tests
|
|
5
|
+
def test_<%= file_name %>_is_entered_by_the_game(args, assert)
|
|
6
|
+
scene = <%= class_name %>.new
|
|
7
|
+
game = Talon::Game.new(scene)
|
|
8
|
+
game.args = args
|
|
9
|
+
game.tick
|
|
10
|
+
|
|
11
|
+
assert.equal! scene.game, game
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DrTalon
|
|
4
|
+
# The outcome of one +dragonruby --test FILE+ run, read from its output.
|
|
5
|
+
# DragonRuby exits 0 whether tests pass, fail or the file doesn't load, so
|
|
6
|
+
# the output is the only signal.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute [r] status
|
|
9
|
+
# @return [Symbol] +:passed+, +:failed+, +:error+ (an exception outside a
|
|
10
|
+
# test, such as a syntax error), +:no_tests+ or +:timeout+
|
|
11
|
+
# @!attribute [r] passed
|
|
12
|
+
# @return [Integer]
|
|
13
|
+
# @!attribute [r] failed
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
# @!attribute [r] inconclusive
|
|
16
|
+
# @return [Integer] tests that made no assertions
|
|
17
|
+
# @!attribute [r] details
|
|
18
|
+
# @return [String] failure or exception details, empty when passing
|
|
19
|
+
# @!attribute [r] output
|
|
20
|
+
# @return [String] everything DragonRuby printed
|
|
21
|
+
TestReport = Data.define(:status, :passed, :failed, :inconclusive, :details, :output)
|
|
22
|
+
|
|
23
|
+
class TestReport
|
|
24
|
+
SUMMARY = /\] (\d+) test\(s\) (passed|failed|inconclusive)\./
|
|
25
|
+
EXCEPTION = /^(?:- \[Game\] )?\* (?:EXCEPTION|ERROR):/
|
|
26
|
+
NO_TESTS = "No tests were found"
|
|
27
|
+
ENGINE_LINE = /^[-*?] \[Engine\]/
|
|
28
|
+
|
|
29
|
+
# @param output [String]
|
|
30
|
+
# @return [TestReport]
|
|
31
|
+
def self.parse(output)
|
|
32
|
+
counts = Hash.new(0)
|
|
33
|
+
output.scan(SUMMARY) { |count, kind| counts[kind] = count.to_i }
|
|
34
|
+
summary = output.match?(SUMMARY)
|
|
35
|
+
lines = output.lines(chomp: true)
|
|
36
|
+
|
|
37
|
+
status, details =
|
|
38
|
+
if (start = lines.index { |line| line.match?(EXCEPTION) })
|
|
39
|
+
[:error, section(lines, start)]
|
|
40
|
+
elsif !summary && output.include?(NO_TESTS)
|
|
41
|
+
[:no_tests, ""]
|
|
42
|
+
elsif !summary
|
|
43
|
+
[:error, "DragonRuby didn't print a test summary."]
|
|
44
|
+
elsif counts["failed"].positive?
|
|
45
|
+
[:failed, section(lines, lines.index { |line| line.match?(/\] \d+ test\(s\) failed\./) } + 1)]
|
|
46
|
+
else
|
|
47
|
+
[:passed, ""]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
new(status: status, passed: counts["passed"], failed: counts["failed"],
|
|
51
|
+
inconclusive: counts["inconclusive"], details: details, output: output)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# @param output [String] whatever was printed before the run was stopped
|
|
55
|
+
# @return [TestReport]
|
|
56
|
+
def self.timeout(output)
|
|
57
|
+
new(status: :timeout, passed: 0, failed: 0, inconclusive: 0, details: "", output: output)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @return [Boolean]
|
|
61
|
+
def passed?
|
|
62
|
+
status == :passed
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Lines from +start+ up to DragonRuby's shutdown messages, without the
|
|
66
|
+
# "- [Game] " log prefixes and with runs of blank lines collapsed.
|
|
67
|
+
def self.section(lines, start)
|
|
68
|
+
finish = ((start + 1)...lines.size).find { |i| lines[i].match?(ENGINE_LINE) } || lines.size
|
|
69
|
+
lines[start...finish]
|
|
70
|
+
.map { |line| line.sub(/\A- \[Game\] /, "").rstrip }
|
|
71
|
+
.chunk_while { |a, b| a.empty? && b.empty? }.map(&:first)
|
|
72
|
+
.join("\n").strip
|
|
73
|
+
end
|
|
74
|
+
private_class_method :section
|
|
75
|
+
end
|
|
76
|
+
end
|
data/lib/dr_talon.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "dr_talon/version"
|
|
4
|
+
require_relative "dr_talon/errors"
|
|
5
|
+
require_relative "dr_talon/paths"
|
|
6
|
+
require_relative "dr_talon/config"
|
|
7
|
+
require_relative "dr_talon/file_copy"
|
|
8
|
+
require_relative "dr_talon/http"
|
|
9
|
+
require_relative "dr_talon/credentials"
|
|
10
|
+
require_relative "dr_talon/engine"
|
|
11
|
+
require_relative "dr_talon/project"
|
|
12
|
+
require_relative "dr_talon/doctor"
|
|
13
|
+
require_relative "dr_talon/test_report"
|
|
14
|
+
require_relative "dr_talon/runner"
|
|
15
|
+
require_relative "dr_talon/deps"
|
|
16
|
+
require_relative "dr_talon/talon_framework"
|
|
17
|
+
require_relative "dr_talon/cli"
|
data/sig/dr_talon.rbs
ADDED
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
module DrTalon
|
|
2
|
+
VERSION: String
|
|
3
|
+
|
|
4
|
+
class Error < StandardError
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class Paths
|
|
8
|
+
APP_NAME: String
|
|
9
|
+
|
|
10
|
+
def initialize: (?env: Hash[String, String], ?host_os: String, ?home: String) -> void
|
|
11
|
+
def data_dir: () -> String
|
|
12
|
+
def cache_dir: () -> String
|
|
13
|
+
def config_dir: () -> String
|
|
14
|
+
def engines_dir: () -> String
|
|
15
|
+
def downloads_dir: () -> String
|
|
16
|
+
def config_file: () -> String
|
|
17
|
+
def credentials_file: () -> String
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class Config < Data
|
|
21
|
+
DEFAULTS: Hash[Symbol, String?]
|
|
22
|
+
|
|
23
|
+
attr_reader default_template: String
|
|
24
|
+
attr_reader dev_id: String?
|
|
25
|
+
attr_reader dev_title: String?
|
|
26
|
+
|
|
27
|
+
def self.load: (?String path) -> Config
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class HTTP
|
|
31
|
+
MAX_REDIRECTS: Integer
|
|
32
|
+
|
|
33
|
+
class Error < DrTalon::Error
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class Unauthorized < Error
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class Auth < Data
|
|
40
|
+
attr_reader username: String
|
|
41
|
+
attr_reader password: String
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def get: (String url, ?auth: Auth?) -> String
|
|
45
|
+
def post_form: (String url, Hash[String, String] form) -> String
|
|
46
|
+
def download: (String url, String path, ?auth: Auth?) ?{ (Integer received, Integer? total) -> void } -> String
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class Credentials < Data
|
|
50
|
+
ENV_USERNAME: String
|
|
51
|
+
ENV_PASSWORD: String
|
|
52
|
+
|
|
53
|
+
class InsecureFile < Error
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
attr_reader username: String
|
|
57
|
+
attr_reader password: String
|
|
58
|
+
attr_reader source: (:env | :file | :prompt)
|
|
59
|
+
|
|
60
|
+
def self.lookup: (?env: Hash[String, String], ?path: String) -> Credentials?
|
|
61
|
+
def self.from_env: (?Hash[String, String] env) -> Credentials?
|
|
62
|
+
def self.load: (String path) -> Credentials?
|
|
63
|
+
def self.delete: (String path) -> bool
|
|
64
|
+
def save: (String path) -> void
|
|
65
|
+
def to_auth: () -> HTTP::Auth
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
module FileCopy
|
|
69
|
+
FICLONE: Integer
|
|
70
|
+
CLONE_UNSUPPORTED: Array[Class]
|
|
71
|
+
|
|
72
|
+
def self.copy: (String src, String dst) -> bool
|
|
73
|
+
def self.try_clone: (IO input, IO output) -> bool
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class Project
|
|
77
|
+
PIN_FILE: String
|
|
78
|
+
|
|
79
|
+
class NotFound < Error
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def self.find: (?String dir) -> Project?
|
|
83
|
+
def self.locate: (?String dir) -> Project
|
|
84
|
+
|
|
85
|
+
attr_reader root: String
|
|
86
|
+
|
|
87
|
+
def initialize: (String root) -> void
|
|
88
|
+
def layout: () -> (:full | :game_only | nil)
|
|
89
|
+
def game_dir: () -> String
|
|
90
|
+
def pin_path: () -> String
|
|
91
|
+
def pin: () -> Engine::Spec?
|
|
92
|
+
def pin!: (Engine::Installation installation) -> void
|
|
93
|
+
def path: (*String relative) -> String
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
class Doctor
|
|
97
|
+
METADATA_PLACEHOLDERS: Hash[String, String]
|
|
98
|
+
|
|
99
|
+
def self.unset_metadata: (Project project) -> Array[String]?
|
|
100
|
+
|
|
101
|
+
class Check < Data
|
|
102
|
+
attr_reader status: (:ok | :warning | :error)
|
|
103
|
+
attr_reader message: String
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def initialize: (Project project, Engine::Store store, ?host_platform: String) -> void
|
|
107
|
+
def checks: () -> Array[Check]
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
module Engine
|
|
111
|
+
TIERS: Array[String]
|
|
112
|
+
|
|
113
|
+
class InvalidEngine < Error
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
class NotFound < Error
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
class Ambiguous < Error
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
class AlreadyInstalled < Error
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def self.host_platform: (?host_os: String, ?host_cpu: String) -> String
|
|
126
|
+
|
|
127
|
+
class Installation < Data
|
|
128
|
+
METADATA_FILE: String
|
|
129
|
+
RECORDED: Array[Symbol]
|
|
130
|
+
|
|
131
|
+
attr_reader version: String
|
|
132
|
+
attr_reader tier: String
|
|
133
|
+
attr_reader platform: String
|
|
134
|
+
attr_reader path: String
|
|
135
|
+
attr_reader build_date: String?
|
|
136
|
+
attr_reader git_sha: String?
|
|
137
|
+
attr_reader sha256: String?
|
|
138
|
+
attr_reader source: String?
|
|
139
|
+
attr_reader imported_at: String?
|
|
140
|
+
|
|
141
|
+
def self.load: (String path) -> Installation
|
|
142
|
+
def id: () -> String
|
|
143
|
+
def gem_version: () -> Gem::Version
|
|
144
|
+
def built_on: () -> String?
|
|
145
|
+
def write_metadata: (?String dir) -> void
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
class Spec < Data
|
|
149
|
+
PATTERN: Regexp
|
|
150
|
+
|
|
151
|
+
attr_reader version: String
|
|
152
|
+
attr_reader tier: String?
|
|
153
|
+
attr_reader platform: String?
|
|
154
|
+
|
|
155
|
+
def self.parse: (String string) -> Spec
|
|
156
|
+
def match?: (Installation installation) -> bool
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
class Inspector
|
|
160
|
+
CHANGELOG: String
|
|
161
|
+
VERSION_FILE: String
|
|
162
|
+
BINARIES: Array[String]
|
|
163
|
+
|
|
164
|
+
def self.find_root: (String dir) -> String
|
|
165
|
+
def self.engine_root?: (String dir) -> bool
|
|
166
|
+
def initialize: (String root, ?hints: Array[String], ?tier: String?, ?platform: String?) -> void
|
|
167
|
+
def details: () -> Hash[Symbol, String?]
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
class Store
|
|
171
|
+
attr_reader root: String
|
|
172
|
+
|
|
173
|
+
def initialize: (String root, ?host_platform: String) -> void
|
|
174
|
+
def installations: () -> Array[Installation]
|
|
175
|
+
def get: (String id) -> Installation?
|
|
176
|
+
def find: (String | Spec spec) -> Installation
|
|
177
|
+
def find_native: (Spec spec, ?default_tier: String?) -> Installation
|
|
178
|
+
def latest_native: () -> Installation?
|
|
179
|
+
def path_for: (String id) -> String
|
|
180
|
+
def remove: (Installation installation) -> void
|
|
181
|
+
def stage: [T] () { (String dir) -> T } -> T
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
class Importer
|
|
185
|
+
class Result < Data
|
|
186
|
+
attr_reader installation: Installation
|
|
187
|
+
attr_reader status: Symbol
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def initialize: (Store store, ?tier: String?, ?platform: String?, ?force: bool) -> void
|
|
191
|
+
def import: (String source) -> Result
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
class Materializer
|
|
195
|
+
MANIFEST: String
|
|
196
|
+
GAME_ONLY_FILES: Array[String]
|
|
197
|
+
SKIPPED: Array[String]
|
|
198
|
+
SKIPPED_NAMES: Array[String]
|
|
199
|
+
|
|
200
|
+
class Conflict < Error
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
class Manifest < Data
|
|
204
|
+
attr_reader engine: String?
|
|
205
|
+
attr_reader files: Array[String]
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
class Result < Data
|
|
209
|
+
attr_reader copied: Integer
|
|
210
|
+
attr_reader removed: Integer
|
|
211
|
+
attr_reader cloned: Integer
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
def initialize: (Project project) -> void
|
|
215
|
+
def manifest: () -> Manifest?
|
|
216
|
+
def files_for: (Installation installation) -> Array[String]
|
|
217
|
+
def conflicts: (Installation installation) -> Array[String]
|
|
218
|
+
def install: (Installation installation, ?force: bool) -> Result
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
module Fetchers
|
|
222
|
+
ZIP_MAGIC: String
|
|
223
|
+
|
|
224
|
+
def self.for: (String tier, **untyped options) -> (DragonRubyAPI | ItchJam | Butler)
|
|
225
|
+
def self.zip?: (String path) -> bool
|
|
226
|
+
def self.download_zip: (HTTP http, String url, String path, ?auth: HTTP::Auth?) ?{ (Integer, Integer?) -> void } -> String
|
|
227
|
+
|
|
228
|
+
class DragonRubyAPI
|
|
229
|
+
API: String
|
|
230
|
+
OS_NAMES: Hash[String, String]
|
|
231
|
+
|
|
232
|
+
attr_reader tier: String
|
|
233
|
+
|
|
234
|
+
def initialize: (String tier, ?http: HTTP, ?downloads_dir: String, ?platform: String, ?api: String) -> void
|
|
235
|
+
def credentials?: () -> bool
|
|
236
|
+
def api_url: () -> String
|
|
237
|
+
def verify: (Credentials credentials) -> void
|
|
238
|
+
def fetch: (credentials: Credentials?) ?{ (Integer received, Integer? total) -> void } -> String
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
class ItchJam
|
|
242
|
+
PAGE: String
|
|
243
|
+
UPLOADS: Hash[String, String]
|
|
244
|
+
|
|
245
|
+
def initialize: (?http: HTTP, ?downloads_dir: String, ?platform: String, ?page: String) -> void
|
|
246
|
+
def tier: () -> String
|
|
247
|
+
def credentials?: () -> bool
|
|
248
|
+
def fetch: (?credentials: Credentials?) ?{ (Integer received, Integer? total) -> void } -> String
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
class Butler
|
|
252
|
+
GAME: String
|
|
253
|
+
|
|
254
|
+
def initialize: (?platform: String, ?downloads_dir: String, ?butler: String) -> void
|
|
255
|
+
def tier: () -> String
|
|
256
|
+
def credentials?: () -> bool
|
|
257
|
+
def fetch: (?credentials: Credentials?) -> String
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
module GitIgnore
|
|
262
|
+
BEGIN_MARKER: String
|
|
263
|
+
END_MARKER: String
|
|
264
|
+
BLOCK: Regexp
|
|
265
|
+
|
|
266
|
+
def self.patterns: (Array[String] files) -> Array[String]
|
|
267
|
+
def self.block?: (String path) -> bool
|
|
268
|
+
def self.write: (String path, Array[String] files) -> void
|
|
269
|
+
def self.refresh: (String path, Array[String] files) -> bool
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
class TestReport < Data
|
|
274
|
+
SUMMARY: Regexp
|
|
275
|
+
EXCEPTION: Regexp
|
|
276
|
+
NO_TESTS: String
|
|
277
|
+
ENGINE_LINE: Regexp
|
|
278
|
+
|
|
279
|
+
attr_reader status: (:passed | :failed | :error | :no_tests | :timeout)
|
|
280
|
+
attr_reader passed: Integer
|
|
281
|
+
attr_reader failed: Integer
|
|
282
|
+
attr_reader inconclusive: Integer
|
|
283
|
+
attr_reader details: String
|
|
284
|
+
attr_reader output: String
|
|
285
|
+
|
|
286
|
+
def self.parse: (String output) -> TestReport
|
|
287
|
+
def self.timeout: (String output) -> TestReport
|
|
288
|
+
def passed?: () -> bool
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
class Runner
|
|
292
|
+
GENERATED_DIRS: Array[String]
|
|
293
|
+
TEST_PATTERN: String
|
|
294
|
+
TEST_DIRS: Array[String]
|
|
295
|
+
HEADLESS_ENV: Hash[String, String]
|
|
296
|
+
|
|
297
|
+
class MissingBinary < Error
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def self.exec_process: (Array[String] argv, chdir: String) -> bot
|
|
301
|
+
|
|
302
|
+
def initialize: (Project project) -> void
|
|
303
|
+
def binary: (?String name) -> String
|
|
304
|
+
def game_arg: () -> String
|
|
305
|
+
def run_command: (?Array[String] args) -> Array[String]
|
|
306
|
+
def build_command: (?Array[String] args) -> Array[String]
|
|
307
|
+
def serve_command: (String dir, Integer port) -> Array[String]
|
|
308
|
+
def test_command: (String file) -> Array[String]
|
|
309
|
+
def html5_build: () -> String?
|
|
310
|
+
def test_files: (?Array[String] paths, ?base: String) -> Array[String]
|
|
311
|
+
def run_test: (String file, ?timeout: Numeric, ?headless: bool) -> TestReport
|
|
312
|
+
def clean: () -> Array[String]
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
module Deps
|
|
316
|
+
class FetchError < Error
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
class ManifestError < Error
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
class ModifiedError < Error
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
def self.parse_source: (String source) -> [Symbol, String]
|
|
326
|
+
def self.declaration: (Symbol kind, String value, ?path: String?, ?ref: String?, ?as: String?) -> String
|
|
327
|
+
def self.require_hint: (Project project, Dependency dependency) -> String?
|
|
328
|
+
|
|
329
|
+
class Git
|
|
330
|
+
FULL_SHA: Regexp
|
|
331
|
+
|
|
332
|
+
def resolve: (String url, String? ref) -> String
|
|
333
|
+
def checkout: (String url, String commit, String dir) -> void
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
module Tree
|
|
337
|
+
def self.checksum: (String path) -> String?
|
|
338
|
+
def self.copy_subpath: (String root, String? subpath, String target) -> void
|
|
339
|
+
def self.untar: (String data, String dir, ?strip: Integer) -> void
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
class Context < Data
|
|
343
|
+
attr_reader http: DrTalon::HTTP
|
|
344
|
+
attr_reader git: Git
|
|
345
|
+
attr_reader github_url: String
|
|
346
|
+
attr_reader codeload_url: String
|
|
347
|
+
|
|
348
|
+
def self.default: () -> Context
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
class Dependency
|
|
352
|
+
VENDOR: String
|
|
353
|
+
|
|
354
|
+
attr_reader name: String
|
|
355
|
+
attr_reader destination: String
|
|
356
|
+
attr_reader ref: String?
|
|
357
|
+
attr_reader line: Integer?
|
|
358
|
+
|
|
359
|
+
def initialize: (?name: String?, ?destination: String?, ?ref: String?, ?line: Integer?) -> void
|
|
360
|
+
def key: () -> String
|
|
361
|
+
def lockable?: () -> bool
|
|
362
|
+
def resolve: (Context context) -> String?
|
|
363
|
+
def fetch: (Context context, String? commit, String target) -> void
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
class GitHubDependency < Dependency
|
|
367
|
+
attr_reader owner: String
|
|
368
|
+
attr_reader repo: String
|
|
369
|
+
attr_reader subpath: String
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
class GitDependency < Dependency
|
|
373
|
+
attr_reader url: String
|
|
374
|
+
attr_reader subpath: String
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
class URLDependency < Dependency
|
|
378
|
+
attr_reader url: String
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
class PathDependency < Dependency
|
|
382
|
+
attr_reader path: String
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
class Lock < Data
|
|
386
|
+
attr_reader key: String
|
|
387
|
+
attr_reader ref: String?
|
|
388
|
+
attr_reader destination: String
|
|
389
|
+
attr_reader commit: String?
|
|
390
|
+
attr_reader checksum: String?
|
|
391
|
+
|
|
392
|
+
def self.parse: (String line) -> Lock?
|
|
393
|
+
def to_line: () -> String
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
class Manifest
|
|
397
|
+
FILE: String
|
|
398
|
+
SEPARATOR: Regexp
|
|
399
|
+
LOCK_HEADER: String
|
|
400
|
+
|
|
401
|
+
attr_reader path: String
|
|
402
|
+
attr_reader config: String
|
|
403
|
+
attr_reader dependencies: Array[Dependency]
|
|
404
|
+
attr_reader locks: Array[Lock]
|
|
405
|
+
attr_reader foodchain_locks: bool
|
|
406
|
+
|
|
407
|
+
def self.for: (Project project) -> Manifest
|
|
408
|
+
def initialize: (String path) -> void
|
|
409
|
+
def exist?: () -> bool
|
|
410
|
+
def find: (String name) -> Dependency?
|
|
411
|
+
def write_locks: (Array[Lock] locks) -> void
|
|
412
|
+
def add: (String line) -> void
|
|
413
|
+
def remove: (Dependency dependency) -> void
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
class DSL
|
|
417
|
+
METHODS: Array[String]
|
|
418
|
+
|
|
419
|
+
def self.evaluate: (String source, String file) -> Array[Dependency]
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
class Installer
|
|
423
|
+
class Change < Data
|
|
424
|
+
attr_reader name: String
|
|
425
|
+
attr_reader action: (:installed | :updated | :unchanged | :restored | :removed | :kept)
|
|
426
|
+
attr_reader dependency: Dependency?
|
|
427
|
+
attr_reader commit: String?
|
|
428
|
+
attr_reader previous: String?
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
def initialize: (Project project, ?context: Context, ?force: bool) -> void
|
|
432
|
+
def install: (?update: (Array[String] | true)?) -> Array[Change]
|
|
433
|
+
def outdated: () -> Array[Hash[Symbol, untyped]]
|
|
434
|
+
def problems: () -> Array[Hash[Symbol, untyped]]
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
module TalonFramework
|
|
439
|
+
REPOSITORY: String
|
|
440
|
+
GITHUB_KEY: Regexp
|
|
441
|
+
REQUIRE: String
|
|
442
|
+
BEGIN_MARKER: String
|
|
443
|
+
END_MARKER: String
|
|
444
|
+
BLOCK: Regexp
|
|
445
|
+
KIND_ORDER: Array[String]
|
|
446
|
+
|
|
447
|
+
class NotUsed < Error
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
def self.dependency: (Project project) -> Deps::Dependency?
|
|
451
|
+
def self.used_by?: (Project project) -> bool
|
|
452
|
+
def self.require_path: (Project project) -> String
|
|
453
|
+
def self.require_used!: (Project project) -> void
|
|
454
|
+
def self.add_require: (String main_rb, String line) -> (:added | :present | :no_block)
|
|
455
|
+
def self.names: (String name) -> [String, String]
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
module Generators
|
|
459
|
+
class TalonCode < Thor::Group
|
|
460
|
+
KINDS: Array[String]
|
|
461
|
+
|
|
462
|
+
def self.source_root: () -> String
|
|
463
|
+
def class_name: () -> String
|
|
464
|
+
def file_name: () -> String
|
|
465
|
+
def code_path: () -> String
|
|
466
|
+
def test_path: () -> String
|
|
467
|
+
def talon_require: () -> String
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
class NewProject < Thor::Group
|
|
471
|
+
TEMPLATES: Array[String]
|
|
472
|
+
NAME_PATTERN: Regexp
|
|
473
|
+
|
|
474
|
+
def self.source_root: () -> String
|
|
475
|
+
def name: () -> String
|
|
476
|
+
def file_name: () -> String
|
|
477
|
+
def module_name: () -> String
|
|
478
|
+
def title: () -> String
|
|
479
|
+
def template_name: () -> String
|
|
480
|
+
def layout: () -> (:full | :game_only)
|
|
481
|
+
def talon?: () -> bool
|
|
482
|
+
def tooling_template: () -> String
|
|
483
|
+
def engine: () -> Engine::Installation
|
|
484
|
+
def commit_engine?: () -> bool
|
|
485
|
+
end
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
class CLI < Thor
|
|
489
|
+
def self.exit_on_failure?: () -> bool
|
|
490
|
+
def version: () -> void
|
|
491
|
+
def new: (String path) -> void
|
|
492
|
+
def run_game: (*String args) -> void
|
|
493
|
+
def test: (*String paths) -> void
|
|
494
|
+
def build: (*String args) -> void
|
|
495
|
+
def serve: (?String? dir) -> void
|
|
496
|
+
def clean: () -> void
|
|
497
|
+
def install: () -> void
|
|
498
|
+
def update: (*String names) -> void
|
|
499
|
+
def add: (String source) -> void
|
|
500
|
+
def remove: (String name) -> void
|
|
501
|
+
def outdated: () -> void
|
|
502
|
+
def doctor: () -> void
|
|
503
|
+
|
|
504
|
+
class Generate < Thor
|
|
505
|
+
def self.exit_on_failure?: () -> bool
|
|
506
|
+
def scene: (String name) -> void
|
|
507
|
+
def component: (String name) -> void
|
|
508
|
+
def prefab: (String name) -> void
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
class Engine < Thor
|
|
512
|
+
def self.exit_on_failure?: () -> bool
|
|
513
|
+
def import: (String path) -> void
|
|
514
|
+
def list: () -> void
|
|
515
|
+
def which: (?String? spec) -> void
|
|
516
|
+
def fetch: () -> void
|
|
517
|
+
def login: () -> void
|
|
518
|
+
def logout: () -> void
|
|
519
|
+
def use: (?String? spec) -> void
|
|
520
|
+
def current: () -> void
|
|
521
|
+
def uninstall: (String spec) -> void
|
|
522
|
+
end
|
|
523
|
+
end
|
|
524
|
+
end
|