knossoscli 0.1.0 → 0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -12
- data/lib/knossoscli/cli.rb +5 -5
- data/lib/knossoscli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ad119ae5907f4b566810135a30e2c7164de1ba5a9bbc2d3389094615456afcf
|
4
|
+
data.tar.gz: 71526dce71f7af01aecb17a00d1b3fc68e438a9624d50ac2087578aa4b7968dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52904915ab632cde7eb36285fa0882102d18e1770924c60f60cbf5755ad404264fc49c2309287a5734cec2ef30d264b73f4ee2ca98d431db96e52949fc7e583e
|
7
|
+
data.tar.gz: 94fedd8f142e93c9e9ca61157770b11553a27abf089b2776ed6ac62ffe4e5d413628bbded57d321d654b253b559acdd1006f41ecfb48c246002c8014f92f3055
|
data/CHANGELOG.md
CHANGED
@@ -4,20 +4,29 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
This project uses [Semantic Versioning][semv].
|
5
5
|
|
6
6
|
## [Unreleased][new]
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
-
|
11
|
-
|
12
|
-
-
|
13
|
-
-
|
14
|
-
|
7
|
+
|
8
|
+
## [0.2.0][0.2.0] — 2020-01-09
|
9
|
+
### Changed
|
10
|
+
- Use `KnossosCLI::VERSION` to calculate an '~> x.y.0' dependency on the
|
11
|
+
`knossos` gem during major version 0 development.
|
12
|
+
- Scope `Algorithm` and `Renderer` under `Knossos`.
|
13
|
+
- Only set a default value for the `--image` argument to `carve` when the option
|
14
|
+
is actually specified in the command.
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- Properly require this gem's code in `bin/console`
|
18
|
+
|
19
|
+
## [0.1.0][0.1.0] — 2020-01-09
|
20
|
+
### Added
|
21
|
+
- Add the `carve` sub-command, including options to specify the grid dimensions,
|
22
|
+
the maze-generating algorithm, and a filename to hold a .png image of the maze.
|
15
23
|
- Automagically infer the list of available algorithms. At least until the
|
16
|
-
library provides a cleaner way.
|
17
|
-
- Provide an option to save a PNG image of the generated maze.
|
24
|
+
library provides a cleaner way.
|
18
25
|
|
19
|
-
## [0.0.0][0.0.0] —
|
26
|
+
## [0.0.0][0.0.0] — 2019-12-31
|
20
27
|
### Added
|
28
|
+
- Create the project as a Ruby gem.
|
29
|
+
- Add the Thor toolkit to build the command line interface.
|
21
30
|
|
22
31
|
---
|
23
32
|
_This file is composed with [GitHub Flavored Markdown][gfm]._
|
@@ -25,5 +34,7 @@ _This file is composed with [GitHub Flavored Markdown][gfm]._
|
|
25
34
|
[gfm]: https://github.github.com/gfm/
|
26
35
|
[semv]: https://semver.org
|
27
36
|
|
28
|
-
[new]: https://github.com/petejh/knossoscli/compare/HEAD..v0.
|
37
|
+
[new]: https://github.com/petejh/knossoscli/compare/HEAD..v0.2.0
|
38
|
+
[0.2.0]: https://github.com/petejh/knossoscli/releases/tag/v0.2.0
|
39
|
+
[0.1.0]: https://github.com/petejh/knossoscli/releases/tag/v0.1.0
|
29
40
|
[0.0.0]: https://github.com/petejh/knossoscli/releases/tag/v0.0.0
|
data/lib/knossoscli/cli.rb
CHANGED
@@ -12,11 +12,11 @@ class KnossosCLI::CLI < Thor
|
|
12
12
|
method_option :algorithm,
|
13
13
|
:type => :string,
|
14
14
|
:aliases => '-a',
|
15
|
-
:enum => Algorithm.constants.map(&:to_s).sort,
|
15
|
+
:enum => Knossos::Algorithm.constants.map(&:to_s).sort,
|
16
16
|
:default => 'BinaryTree'
|
17
17
|
method_option :image,
|
18
18
|
:type => :string,
|
19
|
-
:
|
19
|
+
:lazy_default => 'maze.png'
|
20
20
|
def carve
|
21
21
|
params = {}
|
22
22
|
params[:rows] = options[:rows].to_i if options[:rows]
|
@@ -24,14 +24,14 @@ class KnossosCLI::CLI < Thor
|
|
24
24
|
|
25
25
|
grid = Knossos::Grid.new(params)
|
26
26
|
|
27
|
-
carver = Algorithm.const_get(options[:algorithm])
|
27
|
+
carver = Knossos::Algorithm.const_get(options[:algorithm])
|
28
28
|
carver.carve(grid: grid)
|
29
29
|
|
30
|
-
text_renderer = Renderer::Text.new
|
30
|
+
text_renderer = Knossos::Renderer::Text.new
|
31
31
|
puts text_renderer.render(grid: grid)
|
32
32
|
|
33
33
|
if options[:image]
|
34
|
-
image_renderer = Renderer::Image.new(grid)
|
34
|
+
image_renderer = Knossos::Renderer::Image.new(grid)
|
35
35
|
image = image_renderer.render
|
36
36
|
image.save(options[:image])
|
37
37
|
end
|
data/lib/knossoscli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knossoscli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter J. Hinckley
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.2.0
|
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: 0.
|
26
|
+
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|