lemmibot 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: 6b106002c756748ac7852fdb8b8b616d2dd4f72f
4
- data.tar.gz: dbd17187abff6a25faa338b4fd45fc3d6114688b
3
+ metadata.gz: 227fcd2e8c60d5da75e9c77c3790cc8f1d0329dd
4
+ data.tar.gz: 128e3d7d894e5d8a7ba60e481778273347fb1c46
5
5
  SHA512:
6
- metadata.gz: 77ac2d3a783f676071c553ca15e1c2e3ae5948182260d31aeaa01dcb0c63bfaf064b6b8a89f870b4d52b23b5492162b8004cd673caae39285ce13e68ee41e1fc
7
- data.tar.gz: fea7929b621aca80379f15ea6fde93f035574edf5ef23a5a5ce6ae7ed078be4468d9dce76f651bb799e8c22f62eb45f7a2a323e1ddae2f121257bdb12bd571ff
6
+ metadata.gz: b06fd2ecf35b87301a1bd8f7ed021c3a8e6dfeb9eb265036b00c904c54fd0254eb860f89fe9b63e7a34a01935f25edaa3312deb5df2980488d93a605a92f01ad
7
+ data.tar.gz: ce2fa468a77cbd5d56f09ea0a8335d28c31bbcdfc9399818b6f3b4f124511edd744ecba204f5ca894a708e923d3550390809f25acc92e4621748fc5d45b42e75
data/.rubocop.yml CHANGED
@@ -1,6 +1,10 @@
1
1
  Metrics/BlockLength:
2
2
  Exclude:
3
3
  - 'spec/**/*.rb'
4
+ Metrics/LineLength:
5
+ Exclude:
6
+ - 'spec/**/*.rb'
7
+ - 'lemmibot.gemspec'
4
8
  # Do not prefix writer method names with set_
5
9
  Style/AccessorMethodName:
6
10
  Enabled: false
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lemmibot
2
2
 
3
- A toy robot simulator with more self-preservation instincts than a real lemming.
3
+ A toy robot with better self-preservation instincts than a real lemming.
4
4
 
5
5
  ## Installation
6
6
 
@@ -32,6 +32,27 @@ Any commands that would result in this bot's untimely demise
32
32
  (e.g. placing it off the edge of the table, or attempting to move the bot off the edge of the table)
33
33
  will be silently ignored.
34
34
 
35
+ ### Using a command script
36
+
37
+ Lemmibot can fed a list of commands from a file:
38
+
39
+ $ lemmibot < examples/basic_move
40
+
41
+ The following scripts may be found in the `examples` directory:
42
+
43
+ * `basic_move` - Demonstrates moving Lemmibot one unit and reporting. The output should be `0,1,NORTH`.
44
+ * `basic_rotate` - Demonstrates rotating Lemmibot 90 degrees left and reporting. The output should be `0,0,WEST`.
45
+ * `move_and_rotate` - Demonstrates moving and rotating Lemmibot, then reporting. The output should be `3,3,NORTH`.
46
+ * `self_preservation` - Demonstrates that Lemmibot will not jump off the table. The output should be `2,4,EAST`.
47
+
48
+ ## Development
49
+
50
+ Lemmibot uses `rake`, `rspec`, `aruba`, and `rubocop` for development and testing.
51
+
52
+ After cloning the repository, you may use the setup script at `./bin/setup` to install development dependencies.
53
+
54
+ To run the RSpec test suite and Rubocop style checker against Lemmibot, run `bundle exec rake`.
55
+
35
56
  ## Contributing
36
57
 
37
58
  Bug reports and pull requests are welcome on GitHub at https://github.com/ineffyble/lemmibot.
@@ -0,0 +1,3 @@
1
+ PLACE 0,0,NORTH
2
+ MOVE
3
+ REPORT
@@ -0,0 +1,3 @@
1
+ PLACE 0,0,NORTH
2
+ LEFT
3
+ REPORT
@@ -0,0 +1,6 @@
1
+ PLACE 1,2,EAST
2
+ MOVE
3
+ MOVE
4
+ LEFT
5
+ MOVE
6
+ REPORT
@@ -0,0 +1,12 @@
1
+ PLACE 0,0,NORTH
2
+ MOVE
3
+ MOVE
4
+ MOVE
5
+ MOVE
6
+ MOVE
7
+ MOVE
8
+ MOVE
9
+ RIGHT
10
+ MOVE
11
+ MOVE
12
+ REPORT
data/lemmibot.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['Effy Elden']
11
11
  spec.email = ['git@effy.is']
12
12
 
13
- spec.summary = 'A toy robot simulator'
13
+ spec.summary = 'A toy robot with better self-preservation instincts than a lemming'
14
14
  spec.homepage = 'https://github.com/ineffyble/lemmibot'
15
15
  spec.license = 'MIT'
16
16
 
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'rspec', '~> 3.0'
27
27
  spec.add_development_dependency 'rubocop', '~> 0.49'
28
+ spec.add_development_dependency 'aruba', '~> 0.14'
28
29
  end
@@ -39,6 +39,7 @@ module Lemmibot
39
39
 
40
40
  # Outputs a report of the bot's current position and direction
41
41
  def report
42
+ return unless @bot.placed
42
43
  puts "#{@bot.pos_x},#{@bot.pos_y},#{@bot.direction.upcase}"
43
44
  end
44
45
  end
@@ -1,3 +1,3 @@
1
1
  module Lemmibot
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lemmibot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Effy Elden
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-18 00:00:00.000000000 Z
11
+ date: 2017-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.49'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.14'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.14'
69
83
  description:
70
84
  email:
71
85
  - git@effy.is
@@ -83,6 +97,10 @@ files:
83
97
  - README.md
84
98
  - Rakefile
85
99
  - bin/setup
100
+ - examples/basic_move
101
+ - examples/basic_rotate
102
+ - examples/move_and_rotate
103
+ - examples/self_preservation
86
104
  - exe/lemmibot
87
105
  - lemmibot.gemspec
88
106
  - lib/lemmibot.rb
@@ -112,5 +130,5 @@ rubyforge_project:
112
130
  rubygems_version: 2.6.12
113
131
  signing_key:
114
132
  specification_version: 4
115
- summary: A toy robot simulator
133
+ summary: A toy robot with better self-preservation instincts than a lemming
116
134
  test_files: []