toy-robot-simulator 0.0.3 → 0.0.4
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/README.md +5 -6
- data/lib/toy_robot/robot.rb +0 -1
- data/spec/robot_spec.rb +4 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 493b3b5f6204609a9a398ceca538e84cd2529a73a779f73467136cda368cfb2e
|
4
|
+
data.tar.gz: 0ecba57f5395830348b866e3d561b40a1d95bdf8815d63e32031a880b9f839af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f41cc1eac6a2c7ebb95129fd262d46d0259604dddf580707cd0c791fe6264575b11ecc615e68d3282f78f5da0db79bbc022b903e49695d0939142a850789c0b
|
7
|
+
data.tar.gz: c2a5b22b759bb12e519f5b4ea073968a94f350f0d0c369aa4991514a7200045a4dff704aee1b91462547c5c74a378aba3f1accac9354e3fd376bdcaf10da2051
|
data/README.md
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
# Toy Robot Simulator
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/toy-robot-simulator)
|
4
4
|
|
5
5
|
The Ruby gem let the toy robot move a table painlessly, easily, and most importantly, **it does not fall from the table**
|
6
6
|
|
7
|
-
- [Full gem documentation
|
7
|
+
- [Full gem documentation](https://www.rubydoc.info/gems/toy-robot-simulator/0.0.3/)
|
8
8
|
# Installation
|
9
9
|
```
|
10
10
|
gem install toy-robot-simulator
|
11
11
|
```
|
12
12
|
```ruby
|
13
|
-
gem "toy-robot-simulator", "~> 0.0.
|
13
|
+
gem "toy-robot-simulator", "~> 0.0.4"
|
14
14
|
```
|
15
15
|
```
|
16
16
|
bundle install
|
@@ -64,9 +64,8 @@ REPORT
|
|
64
64
|
```
|
65
65
|
|
66
66
|
## Change Log
|
67
|
-
-
|
68
|
-
-
|
69
|
-
- Updated the CommandSetLoader
|
67
|
+
- Based on the coding challenge brief, Robot can be placed on the table again. This issue has been fixed
|
68
|
+
- Update the robot spec document
|
70
69
|
|
71
70
|
## TODO
|
72
71
|
|
data/lib/toy_robot/robot.rb
CHANGED
@@ -29,7 +29,6 @@ module ToyRobot
|
|
29
29
|
# @raise [Surface::InvalidFacing] if the facing value is other than [NORTH SOUTH EAST WEST]
|
30
30
|
#
|
31
31
|
def place(x, y, facing)
|
32
|
-
return if @placed
|
33
32
|
raise Surface::TableIsNotSet if @table.nil?
|
34
33
|
raise Surface::TableOutOfBound unless @table.can_be_placed?(x, y)
|
35
34
|
raise ToyRobot::InvalidFacing unless DIRECTIONS.include?(facing)
|
data/spec/robot_spec.rb
CHANGED
@@ -24,14 +24,12 @@ describe ToyRobot::Robot do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
context 'robot is already place' do
|
27
|
-
it 'will
|
27
|
+
it 'will place the robot again to the new coordinates and facing' do
|
28
28
|
robot_with_table.place(0, 0, 'SOUTH')
|
29
29
|
robot_with_table.place(1, 1, 'NORTH')
|
30
|
-
robot_with_table.
|
31
|
-
robot_with_table.
|
32
|
-
expect(robot_with_table.
|
33
|
-
expect(robot_with_table.y).to eq(0)
|
34
|
-
expect(robot_with_table.facing).to eq('SOUTH')
|
30
|
+
expect(robot_with_table.x).to eq(1)
|
31
|
+
expect(robot_with_table.y).to eq(1)
|
32
|
+
expect(robot_with_table.facing).to eq('NORTH')
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|