maze-solver 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -0
- data/README.md +2 -0
- data/lib/maze_solver.rb +8 -5
- data/lib/maze_solver/version.rb +1 -1
- data/maze_solver.gemspec +2 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ec0da994a169727806deaee6c3d1391f1b7c9ba
|
4
|
+
data.tar.gz: b2b13e0b2f4cf4911d74c17fe49b5e2de4917157
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a428adeeda9eb4f8fc8986be6b432520b93291b7b6b6ae49a177ead025a47a29f673accd4f0ed7e88e36d0ad84cfd86147366acf5815d55774d640cf8b34312b
|
7
|
+
data.tar.gz: 1113bd960066d6308d3558aeda413038ad8005dfee0efdfb0ca44fdb41cfda8426160ec66f172fd99aac87d3c3fdfe627a64e7ce1539287c1b7bf83c2a474489
|
data/.travis.yml
CHANGED
@@ -1,8 +1,18 @@
|
|
1
|
+
before_install:
|
2
|
+
- gem install bundler
|
1
3
|
language: ruby
|
2
4
|
rvm:
|
3
5
|
- '1.9'
|
4
6
|
- '2.0'
|
5
7
|
- '2.1'
|
8
|
+
- '2.2'
|
9
|
+
- '2.3.0'
|
6
10
|
- jruby-19mode
|
7
11
|
- jruby-head
|
8
12
|
- ruby-head
|
13
|
+
matrix:
|
14
|
+
allow_failures:
|
15
|
+
- rvm: jruby-head
|
16
|
+
- rvm: ruby-head
|
17
|
+
fast_finish: true
|
18
|
+
|
data/README.md
CHANGED
@@ -34,6 +34,8 @@ Maze Solver is available from
|
|
34
34
|
|
35
35
|
$ gem install maze-solver
|
36
36
|
|
37
|
+
[RubyGems.org gem replacement vulnerability and mitigation](http://blog.rubygems.org/2016/04/06/gem-replacement-vulnerability-and-mitigation.html): not affected.
|
38
|
+
|
37
39
|
## Usage
|
38
40
|
|
39
41
|
$ maze_solver filename start_x start_y end_x end_y
|
data/lib/maze_solver.rb
CHANGED
@@ -28,19 +28,22 @@ module MazeSolver
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def visitable?(x, y)
|
31
|
-
row
|
32
|
-
|
33
|
-
return false unless (0...
|
31
|
+
row = y
|
32
|
+
column = x
|
33
|
+
return false unless (0...height).cover? row
|
34
|
+
return false unless (0...width).cover? column
|
34
35
|
grid[row][column].chr == ' '
|
35
36
|
end
|
36
37
|
|
37
38
|
def visit(x, y)
|
38
|
-
row
|
39
|
+
row = y
|
40
|
+
column = x
|
39
41
|
grid[row][column] = '.'
|
40
42
|
end
|
41
43
|
|
42
44
|
def unvisit(x, y)
|
43
|
-
row
|
45
|
+
row = y
|
46
|
+
column = x
|
44
47
|
grid[row][column] = ' '
|
45
48
|
end
|
46
49
|
|
data/lib/maze_solver/version.rb
CHANGED
data/maze_solver.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.homepage = 'https://github.com/johnsyweb/ruby_maze_solver#readme'
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
16
|
-
gem.executables = gem.files.grep(
|
17
|
-
gem.test_files = gem.files.grep(
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r(^{test|spec|features}/))
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
gem.licenses = 'MIT'
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maze-solver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Johns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A gem to solve a 2D maze.
|
14
14
|
email:
|
@@ -53,10 +53,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
56
|
+
rubygems_version: 2.5.1
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Written as an exercise
|
60
60
|
test_files:
|
61
|
+
- ".rspec"
|
62
|
+
- maze_solver.gemspec
|
61
63
|
- spec/maze_solver_spec.rb
|
62
64
|
- spec/spec_helper.rb
|