toy_robot_cli 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a3133755b582dabf6ef44af7158ab89e3fbf6c92a765e579ebd2e38b736b7d7
4
- data.tar.gz: a6c15e28cd2c552f4e5a5fe37cbdb2e903311fac82676c8c6de7960dcb2f0c52
3
+ metadata.gz: '0286fcf7a56398a6d3263ec5b8512beefa7aac8c24cbabc1730fa7f8c0ac23e6'
4
+ data.tar.gz: 55ce69fa57731918240127ee733af3861f82cd25416309f86b9a4361e9572b3d
5
5
  SHA512:
6
- metadata.gz: ca4c27c5b823f86f59d96ea39d60d88409d70165108671dd543c88e86f4570fee619420735456dde3f4d21b11490ffebb7472423443482d03ec46a7c6369efea
7
- data.tar.gz: fbd92d9c66ef0ab748296773933f55947e0535b585c67d77d1c475ab8369a67999c04de2c9e8ca1b266d610f0cdb0cf5948d2b17a9c1e25a321765281cb20acb
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.
@@ -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
@@ -39,7 +39,7 @@ module ToyRobotCli
39
39
  # >> robot.place(0, 0, "SOUTH")
40
40
  # => 2
41
41
  # >> robot.current_position
42
- # => [2, 2]
42
+ # => [0, 0]
43
43
  #
44
44
  # Returns:
45
45
  # (Array) - An array containing the X and Y coordinates of the robot's current position.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ToyRobotCli
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
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.2
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-19 00:00:00.000000000 Z
11
+ date: 2023-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba