rtanque 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b5b5b5c762071e699e291d5fb2eee0b3fbde3969
4
- data.tar.gz: 7024d13b01047e8e8ed0108419105e4c6ff00580
2
+ SHA256:
3
+ metadata.gz: 904ec986676c1508ca635f9410de479034ffd7c17d5fa62b0f1024e0321f7b18
4
+ data.tar.gz: cc73862924bab7dfbd15c440dc80454080a5bde83ea1f29abd9b5f78aca366d1
5
5
  SHA512:
6
- metadata.gz: 8e61aa1c443deaaba2127306671699c76e2753d06c911073b71e6811fba2a8975a472b9ac66b3a0b24aa20f7c12922dcf6d0af8c85b67d4cb62cecd0a37c4915
7
- data.tar.gz: 30d528d916bf3b267bee41bbc6528d8c0ce2666d19dbb0755b83b673c9f138069773b9c9deb495d8be40c976390bc67ff49b7ee457ae85b8052408a7bf4cba88
6
+ metadata.gz: 829cba49a0e2c4de0d280ea42b3eb0cb5dd5c8684deb2a3491aac0717799be420696ad740c71712fc8c4403f778f77c34344d83de86a14f7ebb9816cf9e867ff
7
+ data.tar.gz: 24dad8514f8d856dd6e30b08a0118b4c76a6ddccf540394130d3f619182c867b855765065571f267113b9d3923c024e93ed3ea95b528a1e9cc7d5cddbe268b2b
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.5.0
@@ -5,6 +5,11 @@ rvm:
5
5
  - 1.9.2
6
6
  - 1.9.3
7
7
  - 2.0.0
8
+ - 2.1.0
9
+ - 2.2.0
10
+ - 2.3.6
11
+ - 2.4.3
12
+ - 2.5.0
8
13
  branches:
9
14
  only:
10
15
  - master
data/Gemfile.ci CHANGED
@@ -1,6 +1,5 @@
1
1
  # Gemfile for Travis. Doesn't require gosu which doesn't compile in Travis
2
2
  source 'https://rubygems.org'
3
3
 
4
- gem 'rspec'
5
- gem 'rspec-mocks'
6
- gem 'configuration'
4
+ gem 'rspec', '~> 3.7.0'
5
+ gem 'configuration', '~> 1.3.4'
data/README.md CHANGED
@@ -33,7 +33,7 @@ RTanque is based on the Java project [Robocode](http://robocode.sourceforge.net/
33
33
  ## Requirements
34
34
 
35
35
  * The [Gosu](https://github.com/jlnr/gosu) library used for rendering has some dependencies. Use the [Gosu getting started](https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux) to resolve any for your system.
36
- * Ruby 2.0.0 or 1.9.3 (tested on 1.8.7 and 1.9.2)
36
+ * Ruby 2.2 or later (also tested on earlier versions)
37
37
 
38
38
  ## Quick Start
39
39
 
@@ -91,6 +91,10 @@ At some point you'll want to compete against other bots, or maybe you'll even or
91
91
  Ask your friends to upload their bot(s) in a [gist](https://gist.github.com/), which you can then download with the following command:
92
92
 
93
93
  bundle exec rtanque get_gist <gist_id> ...
94
+
95
+ For example, to download [Marksman](https://gist.github.com/SteveRidout/5909793)
96
+
97
+ bundle exec rtanque get_gist 5909793
94
98
 
95
99
  If you'd like to publicly share your bot, post its gist id on the wiki https://github.com/awilliams/RTanque/wiki/bot-gists
96
100
 
@@ -103,7 +103,7 @@ LONGDESC
103
103
  puts set_color("Error! Gist #{gist_id} not found. Please ensure the gist id is correct.", :red)
104
104
  else
105
105
  gist.files.attrs.each do |name, gist_file|
106
- gist_path = "#{BOT_DIR}/#{gist.user.login}.#{gist_id}/#{name}"
106
+ gist_path = "#{BOT_DIR}/#{gist.owner.login}.#{gist_id}/#{name}"
107
107
  create_file(gist_path, gist_file.content, options)
108
108
  end
109
109
  end
@@ -1,3 +1,3 @@
1
1
  module RTanque
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -22,13 +22,12 @@ Have fun competing against friends' tanks or the sample ones included. Maybe you
22
22
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
23
23
  gem.require_paths = ["lib"]
24
24
 
25
- gem.add_dependency 'gosu', '~> 0.7.45'
26
- gem.add_dependency 'configuration', '~> 1.3.2'
27
- gem.add_dependency 'octokit', '~> 2.7.0'
28
- gem.add_dependency 'thor', '~> 0.17.0'
29
- gem.add_dependency 'texplay'
25
+ gem.add_dependency 'gosu', '~> 0.13.1'
26
+ gem.add_dependency 'configuration', '~> 1.3.4'
27
+ gem.add_dependency 'octokit', '~> 4.8.0'
28
+ gem.add_dependency 'thor', '~> 0.20.0'
29
+ gem.add_dependency 'texplay', '>= 0.4.4pre'
30
30
 
31
31
  gem.add_development_dependency 'pry'
32
- gem.add_development_dependency 'rspec', '~> 2.13.0'
33
- gem.add_development_dependency 'rspec-mocks', '~> 2.13.0'
32
+ gem.add_development_dependency 'rspec', '~> 3.7.0'
34
33
  end
@@ -6,12 +6,12 @@ describe RTanque::Bot do
6
6
 
7
7
  context '#dead?' do
8
8
  it 'should not initially be dead' do
9
- expect(bot.dead?).to be_false
9
+ expect(bot.dead?).to be_falsey
10
10
  end
11
11
 
12
12
  it 'should be true if health is below min' do
13
13
  bot.health = RTanque::Configuration.bot.health.min - 1
14
- expect(bot.dead?).to be_true
14
+ expect(bot.dead?).to be_truthy
15
15
  end
16
16
  end
17
17
 
@@ -110,7 +110,7 @@ describe RTanque::Heading do
110
110
  end
111
111
 
112
112
  it 'creates frozen object' do
113
- expect(described_class.new(0).frozen?).to be_true
113
+ expect(described_class.new(0).frozen?).to be_truthy
114
114
  end
115
115
  end
116
116
 
@@ -135,43 +135,43 @@ describe RTanque::Heading do
135
135
  describe '#==' do
136
136
  it 'works like Numeric, ignoring type' do
137
137
  a = described_class.new(1.0)
138
- expect(a == 1).to be_true
138
+ expect(a == 1).to be_truthy
139
139
  end
140
140
 
141
141
  it 'correctly compares two equal headings' do
142
142
  a = described_class.new(1.0)
143
143
  b = described_class.new(1.0)
144
- expect(a == b).to be_true
144
+ expect(a == b).to be_truthy
145
145
  end
146
146
 
147
147
  it 'correctly compares two different headings' do
148
148
  a = described_class.new(0)
149
149
  b = described_class.new(1.0)
150
- expect(a == b).to be_false
150
+ expect(a == b).to be_falsey
151
151
  end
152
152
 
153
153
  it 'compares to a numeric on LHS' do
154
154
  a = described_class.new(Math::PI)
155
- expect(Math::PI == a).to be_true
155
+ expect(Math::PI == a).to be_truthy
156
156
  end
157
157
  end
158
158
 
159
159
  describe '#eql?' do
160
160
  it 'compares types like Numeric, comparing type' do
161
161
  a = described_class.new(1.0)
162
- expect(a.eql?(1)).to be_false
162
+ expect(a.eql?(1)).to be_falsey
163
163
  end
164
164
 
165
165
  it 'correctly compares two equal headings' do
166
166
  a = described_class.new(1.0)
167
167
  b = described_class.new(1.0)
168
- expect(a.eql?(b)).to be_true
168
+ expect(a.eql?(b)).to be_truthy
169
169
  end
170
170
 
171
171
  it 'correctly compares two different headings' do
172
172
  a = described_class.new(0)
173
173
  b = described_class.new(1.0)
174
- expect(a.eql?(b)).to be_false
174
+ expect(a.eql?(b)).to be_falsey
175
175
  end
176
176
  end
177
177
 
@@ -12,19 +12,19 @@ describe RTanque::Match do
12
12
  it 'should allow adding bots' do
13
13
  bot = double('bot')
14
14
  @instance.add_bots(bot)
15
- expect(@instance.bots.include?(bot)).to be_true
15
+ expect(@instance.bots.include?(bot)).to be_truthy
16
16
  end
17
17
 
18
18
  describe '#finished?' do
19
19
  it 'should be true if one or less bots left' do
20
- expect(@instance.finished?).to be_true
20
+ expect(@instance.finished?).to be_truthy
21
21
  end
22
22
 
23
23
  it 'should be false if two or more bots left' do
24
24
  bot1 = double('bot', :name => "bot1")
25
25
  bot2 = double('bot', :name => "bot2")
26
26
  @instance.add_bots(bot1, bot2)
27
- expect(@instance.finished?).to be_false
27
+ expect(@instance.finished?).to be_falsey
28
28
  end
29
29
 
30
30
  it 'should be true if two or more bots left w/ same name' do
@@ -32,7 +32,7 @@ describe RTanque::Match do
32
32
  bot1 = double('bot', :name => "bot1")
33
33
  bot2 = double('bot', :name => "bot1")
34
34
  @instance.add_bots(bot1, bot2)
35
- expect(@instance.finished?).to be_true
35
+ expect(@instance.finished?).to be_truthy
36
36
  end
37
37
  end
38
38
 
@@ -8,7 +8,7 @@ describe RTanque::NormalizedAttr do
8
8
  described_class::AttrContainer.new(1..5)
9
9
  end
10
10
  let(:attached_instance) do
11
- mock('some_object')
11
+ double('some_object')
12
12
  end
13
13
 
14
14
  it 'has -infinity as max_delta' do
@@ -33,13 +33,11 @@ describe RTanque::NormalizedAttr do
33
33
  described_class::AttrContainer.new(0..5, lambda{ |attached| attached.max_delta })
34
34
  end
35
35
  let(:attached_instance) do
36
- mock('some_object', :max_delta => 0.1)
36
+ double('some_object', :max_delta => 0.1)
37
37
  end
38
38
 
39
39
  it 'should call block for max_delta' do
40
- attached = mock('some_object')
41
- attached.should_receive(:max_delta).and_return(0.1)
42
- expect(instance.max_delta(attached)).to eq 0.1
40
+ expect(instance.max_delta(attached_instance)).to eq 0.1
43
41
  end
44
42
 
45
43
  it 'does not allow a change greater than given delta' do
@@ -19,7 +19,7 @@ describe RTanque::Point do
19
19
  context '#initialize' do
20
20
  it 'should be frozen' do
21
21
  a = described_class.new(10, 10, @arena)
22
- expect(a.frozen?).to be_true
22
+ expect(a.frozen?).to be_truthy
23
23
  end
24
24
 
25
25
  it 'should not allow modification' do
@@ -83,15 +83,15 @@ describe RTanque::Point do
83
83
  it 'is true when x & y are equal' do
84
84
  a = described_class.new(1, 1, @arena)
85
85
  b = described_class.new(1, 1, @arena)
86
- expect(a == b).to be_true
87
- expect(b == a).to be_true
86
+ expect(a == b).to be_truthy
87
+ expect(b == a).to be_truthy
88
88
  end
89
89
 
90
90
  it 'is not true when x & y are equal' do
91
91
  a = described_class.new(2, 1, @arena)
92
92
  b = described_class.new(1, 1, @arena)
93
- expect(a == b).to be_false
94
- expect(b == a).to be_false
93
+ expect(a == b).to be_falsey
94
+ expect(b == a).to be_falsey
95
95
  end
96
96
  end
97
97
 
@@ -165,32 +165,32 @@ describe RTanque::Point do
165
165
 
166
166
  it 'correctly detects equal points' do
167
167
  @b = @a.clone
168
- expect(@a.within_radius?(@b, 1)).to be_true
168
+ expect(@a.within_radius?(@b, 1)).to be_truthy
169
169
  end
170
170
 
171
171
  it 'correctly detects point 1 to left' do
172
172
  @b = described_class.new(4, 5, @arena)
173
- expect(@a.within_radius?(@b, 1)).to be_true
173
+ expect(@a.within_radius?(@b, 1)).to be_truthy
174
174
  end
175
175
 
176
176
  it 'correctly detects point 1 to right' do
177
177
  @b = described_class.new(6, 5, @arena)
178
- expect(@a.within_radius?(@b, 1)).to be_true
178
+ expect(@a.within_radius?(@b, 1)).to be_truthy
179
179
  end
180
180
 
181
181
  it 'correctly detects point 1 above' do
182
182
  @b = described_class.new(5, 6, @arena)
183
- expect(@a.within_radius?(@b, 1)).to be_true
183
+ expect(@a.within_radius?(@b, 1)).to be_truthy
184
184
  end
185
185
 
186
186
  it 'correctly detects point 1 below' do
187
187
  @b = described_class.new(5, 4, @arena)
188
- expect(@a.within_radius?(@b, 1)).to be_true
188
+ expect(@a.within_radius?(@b, 1)).to be_truthy
189
189
  end
190
190
 
191
191
  it 'correctly detects point 1 NE' do
192
192
  @b = described_class.new(6, 6, @arena)
193
- expect(@a.within_radius?(@b, 1)).to be_false
193
+ expect(@a.within_radius?(@b, 1)).to be_falsey
194
194
  end
195
195
  end
196
196
  end
@@ -15,12 +15,12 @@ describe RTanque::Bot::Radar do
15
15
 
16
16
  it 'should return an empty array' do
17
17
  radar.scan([])
18
- expect(radar.empty?).to be_true
18
+ expect(radar.empty?).to be_truthy
19
19
  end
20
20
 
21
21
  it 'should 1 Reflection' do
22
22
  radar.scan([mockbot(10, 20)])
23
- expect(radar).to have(1).reflections
23
+ expect(radar.instance_variable_get(:@reflections).size).to eq 1
24
24
  expect(radar.first).to be_an_instance_of described_class::Reflection
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ describe RTanque::Bot::Radar do
32
32
  it 'should clear self' do
33
33
  radar.scan([mockbot(10, 20, 'otherbot')])
34
34
  radar.scan([])
35
- expect(radar.empty?).to be_true
35
+ expect(radar.empty?).to be_truthy
36
36
  end
37
37
 
38
38
  it 'reflections should be correct' do
@@ -57,7 +57,7 @@ describe RTanque::Bot::Radar do
57
57
  y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.last) * 10
58
58
  bots = [mockbot(x, y, 'border')]
59
59
  radar.scan(bots)
60
- expect(radar.to_a).to have(1).reflections
60
+ expect(radar.instance_variable_get(:@reflections).size).to eq 1
61
61
  end
62
62
 
63
63
  it 'should detect point on min vision range' do
@@ -65,7 +65,7 @@ describe RTanque::Bot::Radar do
65
65
  y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.first) * 10
66
66
  bots = [mockbot(x, y, 'border')]
67
67
  radar.scan(bots)
68
- expect(radar.to_a).to have(1).reflections
68
+ expect(radar.instance_variable_get(:@reflections).size).to eq 1
69
69
  end
70
70
 
71
71
  it 'should not detect point outside max vision range' do
@@ -73,7 +73,7 @@ describe RTanque::Bot::Radar do
73
73
  y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.last) * 10
74
74
  bots = [mockbot(x + 0.01, y, 'border')]
75
75
  radar.scan(bots)
76
- expect(radar.to_a).to have(0).reflections
76
+ expect(radar.instance_variable_get(:@reflections).size).to eq 0
77
77
  end
78
78
 
79
79
  it 'should not detect point outside max vision range' do
@@ -81,7 +81,7 @@ describe RTanque::Bot::Radar do
81
81
  y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.first) * 10
82
82
  bots = [mockbot(x, y - 0.01, 'border')]
83
83
  radar.scan(bots)
84
- expect(radar.to_a).to have(0).reflections
84
+ expect(radar.instance_variable_get(:@reflections).size).to eq 0
85
85
  end
86
86
  end
87
87
  end
@@ -17,9 +17,9 @@ describe RTanque::Shell do
17
17
 
18
18
  it 'shell should be dead after hit' do
19
19
  bots = [mockbot(10, 10, 'deadbot')]
20
- expect(shell.dead?).to be_false
20
+ expect(shell.dead?).to be_falsey
21
21
  shell.hits(bots)
22
- expect(shell.dead?).to be_true
22
+ expect(shell.dead?).to be_truthy
23
23
  end
24
24
 
25
25
  it 'should hit shell on bot radius' do
@@ -7,7 +7,6 @@
7
7
  require 'rtanque'
8
8
 
9
9
  RSpec.configure do |config|
10
- config.treat_symbols_as_metadata_keys_with_true_values = true
11
10
  config.run_all_when_everything_filtered = true
12
11
 
13
12
  # Run specs in random order to surface order dependencies. If you find an
metadata CHANGED
@@ -1,127 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtanque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.45
19
+ version: 0.13.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.45
26
+ version: 0.13.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: configuration
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3.2
33
+ version: 1.3.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.3.2
40
+ version: 1.3.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: octokit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.7.0
47
+ version: 4.8.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.7.0
54
+ version: 4.8.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.17.0
61
+ version: 0.20.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.17.0
68
+ version: 0.20.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: texplay
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.4.4pre
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 0.4.4pre
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
102
- - !ruby/object:Gem::Version
103
- version: 2.13.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 2.13.0
111
- - !ruby/object:Gem::Dependency
112
- name: rspec-mocks
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ~>
101
+ - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: 2.13.0
103
+ version: 3.7.0
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - ~>
108
+ - - "~>"
123
109
  - !ruby/object:Gem::Version
124
- version: 2.13.0
110
+ version: 3.7.0
125
111
  description: |-
126
112
  RTanque is a game for programmers. Players program the brain of a tank and then send their tank+brain into battle with other tanks. All tanks are otherwise equal.
127
113
 
@@ -135,12 +121,12 @@ executables:
135
121
  extensions: []
136
122
  extra_rdoc_files: []
137
123
  files:
138
- - .gitignore
139
- - .rspec
140
- - .ruby-gemset
141
- - .ruby-version
142
- - .travis.yml
143
- - .yardopts
124
+ - ".gitignore"
125
+ - ".rspec"
126
+ - ".ruby-gemset"
127
+ - ".ruby-version"
128
+ - ".travis.yml"
129
+ - ".yardopts"
144
130
  - Gemfile
145
131
  - Gemfile.ci
146
132
  - LICENSE.txt
@@ -276,17 +262,17 @@ require_paths:
276
262
  - lib
277
263
  required_ruby_version: !ruby/object:Gem::Requirement
278
264
  requirements:
279
- - - '>='
265
+ - - ">="
280
266
  - !ruby/object:Gem::Version
281
267
  version: '0'
282
268
  required_rubygems_version: !ruby/object:Gem::Requirement
283
269
  requirements:
284
- - - '>='
270
+ - - ">="
285
271
  - !ruby/object:Gem::Version
286
272
  version: '0'
287
273
  requirements: []
288
274
  rubyforge_project:
289
- rubygems_version: 2.2.1
275
+ rubygems_version: 2.7.3
290
276
  signing_key:
291
277
  specification_version: 4
292
278
  summary: RTanque is a game for programmers. Players program the brain of a tank and