battlesnake 0.1.0
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 +7 -0
- data/.gitignore +7 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +0 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +76 -0
- data/Guardfile +6 -0
- data/README.md +38 -0
- data/Rakefile +2 -0
- data/battlesnake.gemspec +32 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Battlesnake/Error.html +135 -0
- data/docs/Battlesnake/Location.html +1005 -0
- data/docs/Battlesnake/Snake.html +1349 -0
- data/docs/Battlesnake.html +155 -0
- data/docs/_index.html +152 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +497 -0
- data/docs/file.README.html +107 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +107 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +219 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/battlesnake/location.rb +142 -0
- data/lib/battlesnake/snake.rb +74 -0
- data/lib/battlesnake/version.rb +4 -0
- data/lib/battlesnake.rb +11 -0
- metadata +149 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e268dabbc4bbf5559d5ee84247f0dd4f69c8f4b264da6302d4a7c4ed164a1f4c
|
4
|
+
data.tar.gz: 3f9cdd282e002ba8d0c7764c56077335514ee042702c7151d7e98b50ef3d831f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3b8db625deaf846d5abf90e3b8aa313b690761c0aa60830600dc454c687ca698a4e88c854f2cdec1aa4d4bedd816154f78a763bde2ea8ce96377a8a9c8b96c36
|
7
|
+
data.tar.gz: 970ce4f77db5bfc5c080c7ad61f4d7f510d2404423554b808b36300de4a8afec7dbfa077c981a6db2c04f0d12e739a6894d443060874f2dbd92161d1a247d3b4
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--output-dir docs/
|
data/CHANGELOG.md
ADDED
File without changes
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
battlesnake (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.3)
|
10
|
+
diff-lcs (1.5.0)
|
11
|
+
fabrication (2.30.0)
|
12
|
+
ffi (1.15.5)
|
13
|
+
formatador (1.1.0)
|
14
|
+
guard (2.18.0)
|
15
|
+
formatador (>= 0.2.4)
|
16
|
+
listen (>= 2.7, < 4.0)
|
17
|
+
lumberjack (>= 1.0.12, < 2.0)
|
18
|
+
nenv (~> 0.1)
|
19
|
+
notiffany (~> 0.0)
|
20
|
+
pry (>= 0.13.0)
|
21
|
+
shellany (~> 0.0)
|
22
|
+
thor (>= 0.18.1)
|
23
|
+
guard-compat (1.2.1)
|
24
|
+
guard-rspec (4.7.3)
|
25
|
+
guard (~> 2.1)
|
26
|
+
guard-compat (~> 1.1)
|
27
|
+
rspec (>= 2.99.0, < 4.0)
|
28
|
+
listen (3.7.1)
|
29
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
30
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
31
|
+
lumberjack (1.2.8)
|
32
|
+
method_source (1.0.0)
|
33
|
+
nenv (0.3.0)
|
34
|
+
notiffany (0.1.3)
|
35
|
+
nenv (~> 0.1)
|
36
|
+
shellany (~> 0.0)
|
37
|
+
pry (0.14.1)
|
38
|
+
coderay (~> 1.1)
|
39
|
+
method_source (~> 1.0)
|
40
|
+
rake (12.3.3)
|
41
|
+
rb-fsevent (0.11.2)
|
42
|
+
rb-inotify (0.10.1)
|
43
|
+
ffi (~> 1.0)
|
44
|
+
rspec (3.12.0)
|
45
|
+
rspec-core (~> 3.12.0)
|
46
|
+
rspec-expectations (~> 3.12.0)
|
47
|
+
rspec-mocks (~> 3.12.0)
|
48
|
+
rspec-core (3.12.0)
|
49
|
+
rspec-support (~> 3.12.0)
|
50
|
+
rspec-expectations (3.12.0)
|
51
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
+
rspec-support (~> 3.12.0)
|
53
|
+
rspec-mocks (3.12.0)
|
54
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
+
rspec-support (~> 3.12.0)
|
56
|
+
rspec-support (3.12.0)
|
57
|
+
shellany (0.0.1)
|
58
|
+
thor (1.2.1)
|
59
|
+
webrick (1.7.0)
|
60
|
+
yard (0.9.28)
|
61
|
+
webrick (~> 1.7.0)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
battlesnake!
|
68
|
+
fabrication (~> 2.30.0)
|
69
|
+
guard (~> 2.18.0)
|
70
|
+
guard-rspec (~> 4.7.3)
|
71
|
+
rake (~> 12.0)
|
72
|
+
rspec (~> 3.12.0)
|
73
|
+
yard (~> 0.9.28)
|
74
|
+
|
75
|
+
BUNDLED WITH
|
76
|
+
2.1.4
|
data/Guardfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Battlesnake
|
2
|
+
|
3
|
+
[battlesnake.com](https://battlesnake.com) is a fun way to pit your programming skills against other developers, by implementing your own player in an
|
4
|
+
online version of the classic [snake](https://en.wikipedia.org/wiki/Snake_(video_game_genre)) video game.
|
5
|
+
|
6
|
+
The battlesnake gem provides classes and helper methods to speed development. Simple mathematical mapping methods are available so you can focus on
|
7
|
+
coding your strategy, rather than re-inventing the wheel.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'battlesnake'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle install
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install battlesnake
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Examples coming soon. For now, view our [documentation](https://bellmyer.github.io/battlesnake/).
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
+
|
33
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bellmyer/battlesnake.
|
38
|
+
|
data/Rakefile
ADDED
data/battlesnake.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'lib/battlesnake/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "battlesnake"
|
5
|
+
spec.version = Battlesnake::VERSION
|
6
|
+
spec.authors = ["Jaime Bellmyer"]
|
7
|
+
spec.email = ["ruby@bellmyer.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Object modeling and helpful methods for building Battlesnake players.}
|
10
|
+
spec.description = %q{Focus on strategy, rather than the low-level mapping of JSON objects.}
|
11
|
+
spec.homepage = "https://github.com/bellmyer/battlesnake"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
15
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
16
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|Guardfile|doc|tmp)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.12.0'
|
28
|
+
spec.add_development_dependency 'guard', '~> 2.18.0'
|
29
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
|
30
|
+
spec.add_development_dependency 'yard', '~> 0.9.28'
|
31
|
+
spec.add_development_dependency 'fabrication', '~> 2.30.0'
|
32
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "battlesnake"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Exception: Battlesnake::Error
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.28
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Battlesnake::Error";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Battlesnake.html" title="Battlesnake (module)">Battlesnake</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Error</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Exception: Battlesnake::Error
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">StandardError</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">StandardError</li>
|
78
|
+
|
79
|
+
<li class="next">Battlesnake::Error</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/battlesnake.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Default error class for Battlesnake.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div id="footer">
|
128
|
+
Generated on Fri Nov 4 14:55:40 2022 by
|
129
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
|
+
0.9.28 (ruby-2.7.2).
|
131
|
+
</div>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
</body>
|
135
|
+
</html>
|