toy_robo_simulator 0.1.0 → 1.0.1
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 +1 -0
- data/.yardopts +1 -0
- data/Gemfile +1 -0
- data/README.md +85 -18
- data/lib/toy_robo_simulator.rb +3 -3
- data/lib/toy_robo_simulator/console.rb +36 -18
- data/lib/toy_robo_simulator/{env.rb → message.rb} +6 -10
- data/lib/toy_robo_simulator/robo.rb +81 -11
- data/lib/toy_robo_simulator/table.rb +7 -1
- data/lib/toy_robo_simulator/validator.rb +23 -9
- data/lib/toy_robo_simulator/version.rb +1 -1
- data/toy_robo_simulator.gemspec +13 -13
- metadata +14 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62ae956554d56c2339ad12155828b718e5c43001
|
4
|
+
data.tar.gz: 4e821907248355bb259346bda33259f1859dd661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 185656aec074d6b64dc86c8e07081380232c7551683e66634ab78042c1307982ca4e05a1dff1f96b0592fbafba25d69e1079905eed2bda37cbfcd1d5adb947d3
|
7
|
+
data.tar.gz: b0aec3cc330d7290d00324f2a481d781a77867feda4e81db6aa565e28baf2cffe6b9125bc085a82308f8502fe59710b8962a5ebe9ce8a1d2d86abedfbc76304d
|
data/.gitignore
CHANGED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--markup=markdown
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,34 +1,101 @@
|
|
1
|
-
# Toy
|
1
|
+
# Toy Robo Simulator
|
2
2
|
|
3
|
-
|
3
|
+
[](https://rubygems.org/gems/toy_robo_simulator) [](https://travis-ci.org/adlerhsieh/toy_robo_simulator) [](https://codeclimate.com/github/adlerhsieh/toy_robo_simulator) [](https://codeclimate.com/github/adlerhsieh/toy_robo_simulator/coverage)
|
4
|
+
|
5
|
+
Toy Robo Simulator is a command line application that simulates the movement of a toy robot, or robo, on a square table. Entering an interactive console, you have several commands to control the robo including `PLACE`, `MOVE`, `LEFT`, and `RIGHT`. It's like moving a character in a PRG game. Feel free to roam around.
|
4
6
|
|
5
|
-
|
7
|
+
## Installation
|
6
8
|
|
7
9
|
```
|
8
10
|
gem install toy_robo_simulator
|
9
11
|
```
|
10
12
|
|
11
|
-
|
13
|
+
Since this is a standalone program, there is no need to install with a `Gemfile`.
|
14
|
+
|
15
|
+
## Initialize
|
16
|
+
|
17
|
+
```
|
18
|
+
robo
|
19
|
+
```
|
20
|
+
|
21
|
+
You should see a welcome message along with a command line prompt. Ready to move the robots!
|
22
|
+
|
23
|
+
## Available Commands
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
PLACE
|
27
|
+
# Place a robo. Requires x, y, and orientation arguments. Arguments are separated by a white space.
|
28
|
+
# e.g. PLACE 2 5 NORTH
|
29
|
+
|
30
|
+
MOVE
|
31
|
+
# Move forward one space. e.g. Facing north will move the robo one unit toward north.
|
12
32
|
|
13
|
-
|
33
|
+
LEFT
|
34
|
+
# Turn left.
|
14
35
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
-
|
36
|
+
RIGHT
|
37
|
+
# Turn right.
|
38
|
+
|
39
|
+
REPORT
|
40
|
+
# Report current position and orientation.
|
41
|
+
|
42
|
+
HELP
|
43
|
+
# Display all available commands.
|
44
|
+
```
|
45
|
+
|
46
|
+
The commands are not case-sensitive. Either `PLACE`, `Place` or `place` will work.
|
47
|
+
|
48
|
+
However, several rules to follow:
|
49
|
+
|
50
|
+
- A robo must be placed on the table before any other commands.
|
51
|
+
- The robo cannot be placed out of the table.
|
52
|
+
- The robo is not allowed to move out the the table.
|
53
|
+
|
54
|
+
## A Complete Example
|
55
|
+
|
56
|
+
```
|
57
|
+
Welcome to Toy Robo Simulator!
|
58
|
+
|
59
|
+
Available Commands:
|
60
|
+
- PLACE: Place a robo. Requires x, y, and orientation arguments.
|
61
|
+
e.g. PLACE 2 5 NORTH
|
62
|
+
- MOVE: Move forward
|
63
|
+
- LEFT: Turn left
|
64
|
+
- RIGHT: Turn right
|
65
|
+
- REPORT: Report current position and orientation
|
66
|
+
- HELP: Display all available commands
|
67
|
+
Use PLACE first to start the simulation :)
|
68
|
+
|
69
|
+
00 > PLACE 2 1 NORTH
|
70
|
+
It is placed.
|
71
|
+
01 > MOVE
|
72
|
+
It moves forward.
|
73
|
+
02 > LEFT
|
74
|
+
It turns left.
|
75
|
+
03 > REPORT
|
76
|
+
Robo is now at (2,2) facing WEST
|
77
|
+
04 > MOVE
|
78
|
+
It moves forward.
|
79
|
+
05 > RIGHT
|
80
|
+
It turns right
|
81
|
+
06 > MOVE
|
82
|
+
It moves forward.
|
83
|
+
07 > REPORT
|
84
|
+
Robo is now at (1,3) facing NORTH
|
85
|
+
08 > exit
|
86
|
+
|
87
|
+
Thank You!
|
88
|
+
```
|
89
|
+
|
90
|
+
## Development Documentation
|
91
|
+
|
92
|
+
Detailed documentations of every class, module, and method are on [RubyDoc](http://www.rubydoc.info/gems/toy_robo_simulator/1.0.0).
|
26
93
|
|
27
94
|
## Contributing
|
28
95
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
96
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/adlerhsieh/toy_robo_simulator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
30
97
|
|
31
98
|
## License
|
32
99
|
|
33
100
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
34
|
-
|
101
|
+
|
data/lib/toy_robo_simulator.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require_relative 'toy_robo_simulator/version'
|
2
|
-
require_relative 'toy_robo_simulator/
|
2
|
+
require_relative 'toy_robo_simulator/message'
|
3
3
|
require_relative 'toy_robo_simulator/table'
|
4
4
|
require_relative 'toy_robo_simulator/validator'
|
5
5
|
require_relative 'toy_robo_simulator/robo'
|
@@ -7,11 +7,11 @@ require_relative 'toy_robo_simulator/console'
|
|
7
7
|
|
8
8
|
# This module includes all other modules and classes in this program.
|
9
9
|
# Basically it can be divided into:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# - Console: Offering a command line interface for input & output.
|
12
12
|
# - Robo: A robot simulating the movement on a table.
|
13
13
|
# - Validator: Validating the robo's actions and their prerequisities.
|
14
14
|
# - Others
|
15
|
-
#
|
16
15
|
module ToyRoboSimulator
|
16
|
+
ORIENTATIONS = %i(north west south east).freeze
|
17
17
|
end
|
@@ -1,46 +1,64 @@
|
|
1
1
|
module ToyRoboSimulator
|
2
|
-
# The console is responsible for initaing
|
2
|
+
# The console is responsible for initaing an interactive command line interface for
|
3
3
|
# users to access the program.
|
4
4
|
class Console
|
5
|
+
attr_accessor :robo
|
6
|
+
# Available uner-input commands
|
7
|
+
AVAILABLE_COMMANDS = %w(place move left right report help exit).freeze
|
8
|
+
|
9
|
+
# Initializes a CLI that includes a Robo instance.
|
5
10
|
def initialize
|
6
|
-
puts
|
11
|
+
puts MESSAGE
|
7
12
|
@n = 0
|
8
13
|
@robo = Robo.new
|
9
14
|
print "#{format('%02d', @n)} > "
|
10
15
|
end
|
11
16
|
|
17
|
+
# Starts watching for user input.
|
12
18
|
def watch
|
13
|
-
command = STDIN.gets
|
19
|
+
command = STDIN.gets.chomp
|
14
20
|
while command
|
15
21
|
run(command)
|
16
22
|
print "#{format('%02d', @n += 1)} > "
|
17
|
-
command = STDIN.gets
|
23
|
+
command = STDIN.gets.chomp
|
18
24
|
end
|
19
25
|
end
|
20
26
|
|
27
|
+
# Analyzes if command is available, and process the command.
|
28
|
+
# The command should be separated either by white spaces or commas.
|
29
|
+
# However, only commands in AVAILABLE_COMMANDS are allowed.
|
30
|
+
#
|
31
|
+
# ```
|
32
|
+
# console = ToyRoboSimulator::Console.new
|
33
|
+
# console.run('hello world') # => 'unknown command.'
|
34
|
+
# console.run('foo, bar') # => 'unknown command.'
|
35
|
+
# console.run('exit') # => 'Thank You!'
|
36
|
+
# ```
|
21
37
|
def run(command)
|
22
|
-
args
|
23
|
-
|
24
|
-
|
25
|
-
when ::AVAILABLE_COMMANDS.include?(action)
|
26
|
-
process(action, args)
|
27
|
-
when action == 'exit'
|
28
|
-
exit_program
|
29
|
-
when action == 'help'
|
30
|
-
help
|
38
|
+
args = to_args(command)
|
39
|
+
if AVAILABLE_COMMANDS.include?(args[0])
|
40
|
+
process(args[0], args[1..-1])
|
31
41
|
else
|
32
|
-
puts
|
42
|
+
puts WARNING
|
33
43
|
end
|
34
44
|
end
|
35
45
|
|
36
46
|
private
|
37
47
|
|
48
|
+
# Directly sends the command with arguments to the Robo instance.
|
38
49
|
def process(action, args)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
50
|
+
case action
|
51
|
+
when 'exit' then exit_program
|
52
|
+
when 'help' then help
|
53
|
+
else
|
54
|
+
@robo.send(action.to_sym, *args)
|
43
55
|
end
|
56
|
+
rescue ArgumentError => e
|
57
|
+
tip if e.message.include? 'wrong number of arguments'
|
58
|
+
end
|
59
|
+
|
60
|
+
def to_args(command)
|
61
|
+
command.split(' ').map { |n| n.split(',') }.flatten.map(&:chomp).map(&:downcase)
|
44
62
|
end
|
45
63
|
|
46
64
|
def tip
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'colorize'
|
2
2
|
|
3
|
-
|
3
|
+
TIP = "#{'WARNING'.colorize(:red)}
|
4
|
+
- PLACE should take 3 arguments: x, y, and orientation. e.g. PLACE 1 2 NORTH
|
5
|
+
- Other commands take no argument.".freeze
|
4
6
|
|
5
7
|
HELP = "Available Commands:
|
6
8
|
- PLACE: Place a robo. Requires x, y, and orientation arguments.
|
@@ -9,15 +11,9 @@ HELP = "Available Commands:
|
|
9
11
|
- LEFT: Turn left
|
10
12
|
- RIGHT: Turn right
|
11
13
|
- REPORT: Report current position and orientation
|
12
|
-
- HELP: Display all available commands"
|
14
|
+
- HELP: Display all available commands".freeze
|
13
15
|
|
14
16
|
MESSAGE = "\n#{'Welcome to Toy Robo Simulator!'.colorize(:green)}
|
15
|
-
\n#{HELP}\nUse PLACE first to start the simulation :)\n\n"
|
16
|
-
|
17
|
-
WARNING = "Command Not Found. See 'HELP'."
|
18
|
-
|
19
|
-
TIP = "#{'WARNING'.colorize(:red)}
|
20
|
-
- PLACE should take 3 arguments: x, y, and orientation. e.g. PLACE 1 2 NORTH
|
21
|
-
- Other commands take no argument."
|
17
|
+
\n#{HELP}\nUse PLACE first to start the simulation :)\n\n".freeze
|
22
18
|
|
23
|
-
|
19
|
+
WARNING = "Command Not Found. See 'HELP'.".freeze
|
@@ -1,50 +1,106 @@
|
|
1
1
|
module ToyRoboSimulator
|
2
|
+
# Rubo is the character of this program. It serves to simulates the movement of a robot on a table.
|
3
|
+
# The available actions are place, move, left, right, and report. Each action is validated before execution
|
4
|
+
# and will respond with the result.
|
2
5
|
class Robo
|
3
6
|
include Validator
|
4
7
|
attr_accessor :x, :y, :orientation
|
5
8
|
|
9
|
+
# Initializes a Robo instance with a table sizes 5x5.
|
6
10
|
def initialize
|
7
11
|
@table = Table.new(5, 5)
|
8
12
|
@errors = []
|
9
13
|
end
|
10
14
|
|
15
|
+
# Places the robo on the table. The x and y arguments indicates its position.
|
16
|
+
# The positions shoule be within the range of the table.
|
17
|
+
# The orientation is limited to either north, south, west, and east.
|
18
|
+
# Any invalid argument will not set the Robo's attributes.
|
19
|
+
#
|
20
|
+
# ```
|
21
|
+
# robo = ToyRoboSimulator::Robo.new
|
22
|
+
# robo.place(1, 2, :north) # => 'It is placed.'
|
23
|
+
# robo.x # => 1
|
24
|
+
# robo.y # => 2
|
25
|
+
# robo.orientation # => :north
|
26
|
+
#
|
27
|
+
# robo.place("foo", "bar", :south)
|
28
|
+
# # => 'X must be a number'
|
29
|
+
# # => 'Y must be a number'
|
30
|
+
# robo.x # => nil
|
31
|
+
# robo.y # => nil
|
32
|
+
# ```
|
11
33
|
def place(x, y, orientation)
|
12
34
|
validate_placement(x, y, orientation)
|
13
35
|
warning && return if @errors.any?
|
14
|
-
@x
|
36
|
+
@x = x.to_i
|
37
|
+
@y = y.to_i
|
15
38
|
@orientation = orientation.downcase.to_sym
|
16
39
|
puts 'It is placed.'
|
17
40
|
end
|
18
41
|
|
42
|
+
# Moves forward one space. This method is noly valid after the Robo is placed.
|
43
|
+
# Facing north will move the Robo one unit toward north.
|
44
|
+
# However, no further move is allowed if the Robo is at the edge of a table,
|
45
|
+
# which means, for example, its x coordinate is equal to the max value of
|
46
|
+
# a Table's width.
|
47
|
+
#
|
48
|
+
# ```
|
49
|
+
# robo = ToyRoboSimulator::Robo.new
|
50
|
+
# robo.move # => 'The Robo is not placed yet. Use PLACE command first.'
|
51
|
+
#
|
52
|
+
# robo.place(4, 2, :east) # => 'It is placed.'
|
53
|
+
# robo.x # => 4
|
54
|
+
# robo.move # => 'It moves forward.'
|
55
|
+
# robo.x # => 5
|
56
|
+
# robo.move # => 'The Robo is at edge. No further move is allowed.'
|
57
|
+
# robo.x # => 5
|
58
|
+
# ```
|
19
59
|
def move
|
20
60
|
validate_if_placed
|
21
61
|
validate_movement
|
22
62
|
warning && return if @errors.any?
|
23
|
-
|
24
|
-
when :north then @y += 1
|
25
|
-
when :east then @x += 1
|
26
|
-
when :south then @y -= 1
|
27
|
-
when :west then @x -= 1
|
28
|
-
end
|
63
|
+
move_forward(1)
|
29
64
|
puts 'It moves forward.'
|
30
65
|
end
|
31
66
|
|
67
|
+
# Turns left. It changes the Robo's current orientation.
|
68
|
+
# This method is noly valid after the Robo is placed.
|
69
|
+
#
|
70
|
+
# ```
|
71
|
+
# robo = ToyRoboSimulator::Robo.new
|
72
|
+
# robo.left # => 'The Robo is not placed yet. Use PLACE command first.'
|
73
|
+
#
|
74
|
+
# robo.place(3, 3, :east) # => 'It is placed.'
|
75
|
+
# robo.orientation # => :east
|
76
|
+
# robo.left # => 'It turns left'
|
77
|
+
# robo.orientation # => :north
|
78
|
+
# ```
|
32
79
|
def left
|
33
80
|
validate_if_placed
|
34
81
|
warning && return if @errors.any?
|
35
|
-
|
36
|
-
@orientation = ::ORIENTATIONS[index] || :north
|
82
|
+
turn(:left)
|
37
83
|
puts 'It turns left.'
|
38
84
|
end
|
39
85
|
|
86
|
+
# Turns right. See `#left`.
|
40
87
|
def right
|
41
88
|
validate_if_placed
|
42
89
|
warning && return if @errors.any?
|
43
|
-
|
44
|
-
@orientation = ::ORIENTATIONS[index]
|
90
|
+
turn(:right)
|
45
91
|
puts 'It turns right'
|
46
92
|
end
|
47
93
|
|
94
|
+
# Reports current postion and orientation.
|
95
|
+
# This method is noly valid after the Robo is placed.
|
96
|
+
#
|
97
|
+
# ```
|
98
|
+
# robo = ToyRoboSimulator::Robo.new
|
99
|
+
# robo.report # => 'The Robo is not placed yet. Use PLACE command first.'
|
100
|
+
#
|
101
|
+
# robo.place(3, 3, :east) # => 'It is placed.'
|
102
|
+
# robo.report # => 'Robo is now at (3,3) facing EAST'
|
103
|
+
# ```
|
48
104
|
def report
|
49
105
|
validate_if_placed
|
50
106
|
warning && return if @errors.any?
|
@@ -58,5 +114,19 @@ module ToyRoboSimulator
|
|
58
114
|
@errors = []
|
59
115
|
end
|
60
116
|
|
117
|
+
def turn(direction)
|
118
|
+
i = direction == :left ? 1 : -1
|
119
|
+
index = ORIENTATIONS.index(@orientation) + i
|
120
|
+
@orientation = ORIENTATIONS[index] || :north
|
121
|
+
end
|
122
|
+
|
123
|
+
def move_forward(unit)
|
124
|
+
case @orientation
|
125
|
+
when :north then @y += unit
|
126
|
+
when :east then @x += unit
|
127
|
+
when :south then @y -= unit
|
128
|
+
when :west then @x -= unit
|
129
|
+
end
|
130
|
+
end
|
61
131
|
end
|
62
132
|
end
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module ToyRoboSimulator
|
2
|
+
# Table is the environment in the program which decides
|
3
|
+
# the length and width of the table. The table will be used to
|
4
|
+
# validate the placement and movement of a Robo.
|
5
|
+
#
|
6
|
+
# The attributes x and y are the maximum values of length and width,
|
7
|
+
# while 0 is the minimum value.
|
2
8
|
class Table
|
3
|
-
|
9
|
+
attr_reader :x, :y
|
4
10
|
def initialize(x, y)
|
5
11
|
@x = x
|
6
12
|
@y = y
|
@@ -1,5 +1,9 @@
|
|
1
1
|
module ToyRoboSimulator
|
2
|
+
# Validator serves to validate operations performed by a Robo. It is a standalone module but
|
3
|
+
# takes arguments and attributes from a Robo.
|
2
4
|
module Validator
|
5
|
+
# Ensures input values of Robo#place action is valid in type and range.
|
6
|
+
# Returns false if it is not valid.
|
3
7
|
def validate_placement(x, y, orientation)
|
4
8
|
@errors << 'X must be a number' unless int?(x)
|
5
9
|
@errors << 'Y must be a number' unless int?(y)
|
@@ -8,21 +12,18 @@ module ToyRoboSimulator
|
|
8
12
|
@errors << 'Orientation should be either NORTH, SOUTH, EAST, or WEST' unless orientation_valid?(orientation)
|
9
13
|
end
|
10
14
|
|
15
|
+
# Prevents Robo#move from moving out of the table.
|
16
|
+
# Returns false if the Robo is at the edge of the table.
|
11
17
|
def validate_movement
|
12
|
-
@errors << 'The Robo is at edge. No further move is allowed.' if
|
18
|
+
@errors << 'The Robo is at edge. No further move is allowed.' if edge?
|
13
19
|
end
|
14
20
|
|
21
|
+
# Ensures the Robo is placed before any other actions are performed.
|
22
|
+
# Returns false if no attributes are set for the Robo.
|
15
23
|
def validate_if_placed
|
16
24
|
@errors << 'The Robo is not placed yet. Use PLACE command first.' unless @x && @y && @orientation
|
17
25
|
end
|
18
26
|
|
19
|
-
def at_table_edge?
|
20
|
-
(@orientation == :north && @y == @table.y) ||
|
21
|
-
(@orientation == :east && @x == @table.x) ||
|
22
|
-
(@orientation == :south && @y == 0) ||
|
23
|
-
(@orientation == :west && @x == 0)
|
24
|
-
end
|
25
|
-
|
26
27
|
private
|
27
28
|
|
28
29
|
def int?(value)
|
@@ -34,7 +35,20 @@ module ToyRoboSimulator
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def orientation_valid?(orientation)
|
37
|
-
|
38
|
+
ORIENTATIONS.include? orientation.downcase.to_sym
|
39
|
+
end
|
40
|
+
|
41
|
+
def edge?
|
42
|
+
case @orientation
|
43
|
+
when :north
|
44
|
+
@y == @table.y
|
45
|
+
when :east
|
46
|
+
@x == @table.x
|
47
|
+
when :south
|
48
|
+
@y == 0
|
49
|
+
when :west
|
50
|
+
@x == 0
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
end
|
data/toy_robo_simulator.gemspec
CHANGED
@@ -4,23 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'toy_robo_simulator/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'toy_robo_simulator'
|
8
8
|
spec.version = ToyRoboSimulator::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Adler']
|
10
|
+
spec.email = ['nkj20932@hotmail.com']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
12
|
+
spec.summary = 'A toy robot simulator'
|
13
|
+
spec.description = 'A CLI that simulates the movement of a robot on a 5x5 table'
|
14
|
+
spec.homepage = 'http://github.com/adlerhsieh/toy_robo_simulator'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir =
|
18
|
+
spec.bindir = 'exe'
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '3.4.0'
|
25
|
+
spec.add_development_dependency 'colorize', '0.7.7'
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toy_robo_simulator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.4.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 3.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: colorize
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.7.7
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.7.7
|
69
69
|
description: A CLI that simulates the movement of a robot on a 5x5 table
|
70
70
|
email:
|
71
71
|
- nkj20932@hotmail.com
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- ".rubocop.yml"
|
79
79
|
- ".ruby-version"
|
80
80
|
- ".travis.yml"
|
81
|
+
- ".yardopts"
|
81
82
|
- CODE_OF_CONDUCT.md
|
82
83
|
- Gemfile
|
83
84
|
- LICENSE.txt
|
@@ -88,13 +89,13 @@ files:
|
|
88
89
|
- bin/setup
|
89
90
|
- lib/toy_robo_simulator.rb
|
90
91
|
- lib/toy_robo_simulator/console.rb
|
91
|
-
- lib/toy_robo_simulator/
|
92
|
+
- lib/toy_robo_simulator/message.rb
|
92
93
|
- lib/toy_robo_simulator/robo.rb
|
93
94
|
- lib/toy_robo_simulator/table.rb
|
94
95
|
- lib/toy_robo_simulator/validator.rb
|
95
96
|
- lib/toy_robo_simulator/version.rb
|
96
97
|
- toy_robo_simulator.gemspec
|
97
|
-
homepage: http://github.com/adlerhsieh/
|
98
|
+
homepage: http://github.com/adlerhsieh/toy_robo_simulator
|
98
99
|
licenses:
|
99
100
|
- MIT
|
100
101
|
metadata: {}
|
@@ -119,3 +120,4 @@ signing_key:
|
|
119
120
|
specification_version: 4
|
120
121
|
summary: A toy robot simulator
|
121
122
|
test_files: []
|
123
|
+
has_rdoc:
|