frecon 1.4.0 → 1.4.1

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: 76274cd22631fa8a8fec64c7f20e9fa3823a5c6c
4
- data.tar.gz: 22e582985d03f0117c4c6c52bc9df8dd0baed5e1
3
+ metadata.gz: 7b8b0d806d7d674f25440c32b7850550487aded2
4
+ data.tar.gz: 166db8cd776ff6f007ec8875e9369b1c87821800
5
5
  SHA512:
6
- metadata.gz: 642a0a6cecd69f672894e201aea4079b284664a49bb1ebc6b118cdc220dc3e2e0c53bec0453f2b15999b199dae683bb24f860a76d9caf806d2ce8ae6a24b8d67
7
- data.tar.gz: 0bb4e0aeb6e7037a77614f4f678077e6e7824a8cc5ca37a7b0dd5197e6317be94afddbddc730bd49f2439c13c11299f1629877c1f30c150426f21d8cedf5ee98
6
+ metadata.gz: 0831100b5a48f4bf522e8120487ad59ff947be1882ee60d7c8e54cd948962ddb82951d18dabb9960784c8ca4f480ad2012dac91a25f4416c45b14b5981da6e75
7
+ data.tar.gz: ec873b44158f9f16508c815fbe22123aa22df38171255bace84519174ff076bdbe3aececc924c7b80d3bf300adf2f7ae03421313cc7cb04d64904279a4cb2375
@@ -11,10 +11,10 @@ require 'mongoid'
11
11
 
12
12
  # Public: An extension for the BSON module.
13
13
  module BSON
14
-
15
14
  # Public: A monkey-patch for the BSON::ObjectId class which introduces an
16
15
  # #as_json method.
17
16
  class ObjectId
17
+
18
18
  # Public: Get produce a JSON representation of this ObjectId.
19
19
  #
20
20
  # Since we don't want to produce a JSON Object for every ID, this method
@@ -24,6 +24,6 @@ module BSON
24
24
  def as_json(*args)
25
25
  to_s
26
26
  end
27
- end
28
27
 
28
+ end
29
29
  end
@@ -1,7 +1,6 @@
1
1
  require 'yaml'
2
2
 
3
3
  module FReCon
4
-
5
4
  # Public: A class to represent the operational constraints for the FReCon
6
5
  # instance.
7
6
  class Environment
@@ -169,5 +168,4 @@ module FReCon
169
168
  end
170
169
 
171
170
  end
172
-
173
171
  end
@@ -13,7 +13,7 @@ require 'frecon/base/environment'
13
13
  module FReCon
14
14
 
15
15
  # Public: A String representing the current version of FReCon.
16
- VERSION = '1.4.0'
16
+ VERSION = '1.4.1'
17
17
 
18
18
  # Public: An Environment representing the system execution environment.
19
19
  ENVIRONMENT = Environment.new(:development)
@@ -12,6 +12,7 @@ require 'frecon'
12
12
  module FReCon
13
13
  # Public: The wrapper system for a pry console.
14
14
  class Console
15
+
15
16
  # Public: Starts the FReCon console.
16
17
  #
17
18
  # Returns the result of running pry on FReCon.
@@ -22,5 +23,6 @@ module FReCon
22
23
 
23
24
  FReCon.pry
24
25
  end
26
+
25
27
  end
26
28
  end
@@ -17,6 +17,7 @@ require 'frecon/base/object'
17
17
  module FReCon
18
18
  # Public: A base class to represent a controller.
19
19
  class Controller
20
+
20
21
  # Public: Converts the class's name to a Model name.
21
22
  #
22
23
  # Returns a Symbol that is the Model name.
@@ -233,5 +234,6 @@ module FReCon
233
234
 
234
235
  @models.to_json
235
236
  end
237
+
236
238
  end
237
239
  end
@@ -13,6 +13,7 @@ require 'frecon/models'
13
13
  module FReCon
14
14
  # Public: The Dump controller.
15
15
  class DumpController
16
+
16
17
  # Public: Creates a dump.
17
18
  #
18
19
  # Returns a String containing a dump of the database.
@@ -47,5 +48,6 @@ module FReCon
47
48
  def self.dump_compliant_name(model)
48
49
  model.name.gsub(/FReCon::/, '').downcase.pluralize
49
50
  end
51
+
50
52
  end
51
53
  end
@@ -15,6 +15,7 @@ require 'frecon/base/variables'
15
15
  module FReCon
16
16
  # Public: A wrapper to handle converting match numbers and storing them.
17
17
  class MatchNumber
18
+
18
19
  # Public: All of the possible match types for a MatchNumber to have.
19
20
  POSSIBLE_TYPES = [:practice, :qualification, :quarterfinal, :semifinal, :final]
20
21
 
@@ -271,5 +272,6 @@ module FReCon
271
272
  def elimination?
272
273
  ELIMINATION_TYPES.include?(@type)
273
274
  end
275
+
274
276
  end
275
277
  end
data/lib/frecon/model.rb CHANGED
@@ -15,6 +15,7 @@ module FReCon
15
15
  # Public: A base class designed to assist with creating MongoDB Models
16
16
  # elsewhere in the project.
17
17
  class Model
18
+
18
19
  # Public: Bootstraps inheritors of this class as working
19
20
  # Models, also providing class methods for them to use.
20
21
  #
@@ -111,5 +112,6 @@ module FReCon
111
112
  def relation_invalid?(class_constant, id)
112
113
  class_constant.find_by(id: id).nil?
113
114
  end
115
+
114
116
  end
115
117
  end
@@ -12,6 +12,7 @@ require 'frecon/model'
12
12
  module FReCon
13
13
  # Public: The Competition model.
14
14
  class Competition < Model
15
+
15
16
  field :location, type: String
16
17
  field :name, type: String
17
18
 
@@ -41,5 +42,6 @@ module FReCon
41
42
  register_routable_relation :records, 'records'
42
43
  register_routable_relation :robots, 'robots'
43
44
  register_routable_relation :teams, 'teams'
45
+
44
46
  end
45
47
  end
@@ -13,6 +13,7 @@ require 'frecon/match_number'
13
13
  module FReCon
14
14
  # Public: The Match model.
15
15
  class Match < Model
16
+
16
17
  field :number, type: MatchNumber
17
18
 
18
19
  field :blue_score, type: Integer, default: 0
@@ -43,5 +44,6 @@ module FReCon
43
44
  register_routable_relation :participations, 'participations'
44
45
  register_routable_relation :robots, 'robots'
45
46
  register_routable_relation :teams, 'teams'
47
+
46
48
  end
47
49
  end
@@ -12,6 +12,7 @@ require 'frecon/model'
12
12
  module FReCon
13
13
  # Public: The Participation model.
14
14
  class Participation < Model
15
+
15
16
  belongs_to :robot
16
17
  belongs_to :competition
17
18
  has_many :records, dependent: :destroy
@@ -33,5 +34,6 @@ module FReCon
33
34
  register_routable_relation :competition, 'competition'
34
35
  register_routable_relation :matches, 'matches'
35
36
  register_routable_relation :records, 'records'
37
+
36
38
  end
37
39
  end
@@ -13,6 +13,7 @@ require 'frecon/position'
13
13
  module FReCon
14
14
  # Public: The Record model.
15
15
  class Record < Model
16
+
16
17
  field :notes, type: String
17
18
  field :position, type: Position
18
19
 
@@ -41,5 +42,6 @@ module FReCon
41
42
  register_routable_relation :participation, 'participation'
42
43
  register_routable_relation :robot, 'robot'
43
44
  register_routable_relation :team, 'team'
45
+
44
46
  end
45
47
  end
@@ -12,6 +12,7 @@ require 'frecon/model'
12
12
  module FReCon
13
13
  # Public: The Robot model.
14
14
  class Robot < Model
15
+
15
16
  # This is an optional field we included for organization.
16
17
  field :name, type: String
17
18
 
@@ -40,5 +41,6 @@ module FReCon
40
41
  register_routable_relation :competitions, 'competitions'
41
42
  register_routable_relation :records, 'records'
42
43
  register_routable_relation :matches, 'matches'
44
+
43
45
  end
44
46
  end
@@ -12,6 +12,7 @@ require 'frecon/model'
12
12
  module FReCon
13
13
  # Public: The Team model.
14
14
  class Team < Model
15
+
15
16
  field :number, type: Integer
16
17
 
17
18
  field :location, type: String
@@ -64,5 +65,6 @@ module FReCon
64
65
  alias_method :with_number, :number
65
66
  alias_method :that_has_number, :number
66
67
  end
68
+
67
69
  end
68
70
  end
@@ -14,6 +14,7 @@ module Mongoid
14
14
  # Public: A monkey-patch for the Mongoid::Criteria class which introduces
15
15
  # a #psv_filter method.
16
16
  class Criteria
17
+
17
18
  # Public: Filter by given PSV parameters.
18
19
  #
19
20
  # PSV is an introduced system that can be used within query strings to
@@ -80,5 +81,6 @@ module Mongoid
80
81
  # Return the fully-filtered collection.
81
82
  collection
82
83
  end
84
+
83
85
  end
84
86
  end
@@ -15,6 +15,7 @@ require 'frecon/base/variables'
15
15
  module FReCon
16
16
  # Public: A wrapper to handle converting team positions and storing them.
17
17
  class Position
18
+
18
19
  # Public: The alliance part of the position
19
20
  #
20
21
  # Examples
@@ -172,5 +173,6 @@ module FReCon
172
173
 
173
174
  alias_method :was_blue?, :is_blue?
174
175
  alias_method :was_red?, :is_red?
176
+
175
177
  end
176
178
  end
@@ -11,6 +11,7 @@ require 'json'
11
11
 
12
12
  # Public: A class representing errors that emanate from request handling.
13
13
  class RequestError < StandardError
14
+
14
15
  # Public: The Array or Integer representing what can be returned from the
15
16
  # request handler.
16
17
  attr_reader :return_value
@@ -46,4 +47,5 @@ class RequestError < StandardError
46
47
  @code
47
48
  end
48
49
  end
50
+
49
51
  end
data/lib/frecon/routes.rb CHANGED
@@ -12,6 +12,7 @@ require 'frecon/controllers'
12
12
  module FReCon
13
13
  # Public: A module containing all of the routes.
14
14
  module Routes
15
+
15
16
  # Public: Set up basic resource route handlers.
16
17
  #
17
18
  # base - Sinatra::Application to register the routes under.
@@ -133,5 +134,6 @@ module FReCon
133
134
  end
134
135
  end
135
136
  end
137
+
136
138
  end
137
139
  end
@@ -13,6 +13,7 @@ module FReCon
13
13
  # The default scraper scrapes other FReCon instances.
14
14
  # To scrape a different source, a descendant scraper should be used.
15
15
  class Scraper
16
+
16
17
  def initialize(base_uri)
17
18
  @base_uri = base_uri
18
19
  end
@@ -75,5 +76,6 @@ module FReCon
75
76
 
76
77
  read data.body, model: model, type: type
77
78
  end
79
+
78
80
  end
79
81
  end
data/lib/frecon/server.rb CHANGED
@@ -16,6 +16,7 @@ require 'frecon/routes'
16
16
  module FReCon
17
17
  # Public: The Sinatra web server.
18
18
  class Server < Sinatra::Base
19
+
19
20
  include Routes
20
21
 
21
22
  before do
@@ -53,5 +54,6 @@ module FReCon
53
54
 
54
55
  super
55
56
  end
57
+
56
58
  end
57
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frecon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Craig
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-07-05 00:00:00.000000000 Z
16
+ date: 2016-08-03 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: sinatra
@@ -91,14 +91,14 @@ dependencies:
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '0.8'
94
+ version: '0.9'
95
95
  type: :development
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '0.8'
101
+ version: '0.9'
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: yard-tomdoc
104
104
  requirement: !ruby/object:Gem::Requirement
@@ -133,56 +133,56 @@ dependencies:
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: '10.4'
136
+ version: '11.2'
137
137
  type: :development
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - "~>"
142
142
  - !ruby/object:Gem::Version
143
- version: '10.4'
143
+ version: '11.2'
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: rspec
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: '3.3'
150
+ version: '3.5'
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: '3.3'
157
+ version: '3.5'
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: guard
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - "~>"
163
163
  - !ruby/object:Gem::Version
164
- version: '2.13'
164
+ version: '2.14'
165
165
  type: :development
166
166
  prerelease: false
167
167
  version_requirements: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: '2.13'
171
+ version: '2.14'
172
172
  - !ruby/object:Gem::Dependency
173
173
  name: guard-rspec
174
174
  requirement: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - "~>"
177
177
  - !ruby/object:Gem::Version
178
- version: '4.6'
178
+ version: '4.7'
179
179
  type: :development
180
180
  prerelease: false
181
181
  version_requirements: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - "~>"
184
184
  - !ruby/object:Gem::Version
185
- version: '4.6'
185
+ version: '4.7'
186
186
  - !ruby/object:Gem::Dependency
187
187
  name: coveralls
188
188
  requirement: !ruby/object:Gem::Requirement
@@ -203,28 +203,28 @@ dependencies:
203
203
  requirements:
204
204
  - - "~>"
205
205
  - !ruby/object:Gem::Version
206
- version: '0.15'
206
+ version: '0.35'
207
207
  type: :development
208
208
  prerelease: false
209
209
  version_requirements: !ruby/object:Gem::Requirement
210
210
  requirements:
211
211
  - - "~>"
212
212
  - !ruby/object:Gem::Version
213
- version: '0.15'
213
+ version: '0.35'
214
214
  - !ruby/object:Gem::Dependency
215
215
  name: codeclimate-test-reporter
216
216
  requirement: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - "~>"
219
219
  - !ruby/object:Gem::Version
220
- version: '0.4'
220
+ version: '0.6'
221
221
  type: :development
222
222
  prerelease: false
223
223
  version_requirements: !ruby/object:Gem::Requirement
224
224
  requirements:
225
225
  - - "~>"
226
226
  - !ruby/object:Gem::Version
227
- version: '0.4'
227
+ version: '0.6'
228
228
  - !ruby/object:Gem::Dependency
229
229
  name: pry-doc
230
230
  requirement: !ruby/object:Gem::Requirement
@@ -310,4 +310,3 @@ signing_key:
310
310
  specification_version: 4
311
311
  summary: A JSON API for scouting FRC competitions.
312
312
  test_files: []
313
- has_rdoc: