toy_robot_cli 0.1.2 → 0.1.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 +4 -0
- data/lib/toy_robot_cli/cli.rb +12 -0
- data/lib/toy_robot_cli/robot.rb +1 -1
- data/lib/toy_robot_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0286fcf7a56398a6d3263ec5b8512beefa7aac8c24cbabc1730fa7f8c0ac23e6'
|
4
|
+
data.tar.gz: 55ce69fa57731918240127ee733af3861f82cd25416309f86b9a4361e9572b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 989ca9cc8029b13045eae164da6f2d1e5cc7b40b5ed59a57fd8de5408c55f46ae326b50a7cda8fda33dfb141a46c1eaf370e3a2c55901b03e4df6886920d4d88
|
7
|
+
data.tar.gz: 971511c18d084a0cf59299d1c6d3d146252976fd15773b56938ed6ea22a8f160578153f5dd84eb8fcafef3b08d6a50c164abc0d3169842d72fd6727f6f9b915f
|
data/README.md
CHANGED
@@ -56,6 +56,10 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
56
56
|
|
57
57
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
58
58
|
|
59
|
+
### Docs
|
60
|
+
|
61
|
+
`rdoc lib/toy_robot_cli/robot.rb`
|
62
|
+
|
59
63
|
## Contributing
|
60
64
|
|
61
65
|
Bug reports and pull requests are welcome on GitHub at https://github.com/phsacramento/toy_robot_cli.
|
data/lib/toy_robot_cli/cli.rb
CHANGED
@@ -46,6 +46,16 @@ module ToyRobotCli
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
desc "current_direction", "Return the current direction of the robot"
|
50
|
+
def current_direction
|
51
|
+
direction = @robot.current_direction
|
52
|
+
if direction
|
53
|
+
puts "Current Direction: #{direction}"
|
54
|
+
else
|
55
|
+
puts "Robot is not placed on the table."
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
49
59
|
desc "interactive", "Interactive mode to input commands"
|
50
60
|
def interactive
|
51
61
|
loop do
|
@@ -67,6 +77,8 @@ module ToyRobotCli
|
|
67
77
|
report
|
68
78
|
when "current_position"
|
69
79
|
current_position
|
80
|
+
when "current_direction"
|
81
|
+
current_direction
|
70
82
|
when "exit"
|
71
83
|
break
|
72
84
|
else
|
data/lib/toy_robot_cli/robot.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toy_robot_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo H Sacramento
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|