flox 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8c588236a3e6206950c5d693305514fe02335a0e
4
- data.tar.gz: 9344c387fa0f1ff1a6060b8bff84cb1fdcdc485d
2
+ SHA256:
3
+ metadata.gz: b43c6043976e6f113bd8f1882c82ca6f106385b7279dbff99ea87e7eec3059ef
4
+ data.tar.gz: 9166d78906c48085337b996fbf73f554a7aee8912d20d5e18e5b247ad13f463d
5
5
  SHA512:
6
- metadata.gz: ade435b67774267ec23f818078a756525a542ae1bc7ca7205d4a80e22909eda3e1d45121935a7ee430bdf91dbf4ecb5495e2f5d4f0238de7fd747febe2ae3af8
7
- data.tar.gz: cd5754f39054ebf0b8d9cbce960b3c5c6850ee931ff92b3ddc35d58e94d83d2af3a9e38d0b8b98332ff5dbec9c66542691e4edd29e5421b19b03fa0ecafed720
6
+ metadata.gz: 3edae31aac538f8ff71ac335cbc75b2393a2620c1c98aa63736634c62a5e815aff98be75f6b6df20898ab7356a119aab80e02b0b4c16708fb8bf985f4bb112e8
7
+ data.tar.gz: 0a34f6e3de1631f64ba71a3f2c9100ffe9c51bce75611378f1f8fa66f6a51658e93c40325e04542fb4502d63964b7db5e824b87fc1ac07360b783d66b6c4ade6
data/README.md CHANGED
@@ -68,10 +68,10 @@ We're done with the preparations! Now let's look at some of the things you can d
68
68
 
69
69
  ### Loading logs
70
70
 
71
- # load all logs from a certain day that contain a warning or error
72
- logs = flox.load_logs('day:2014-02-22 warning')
71
+ # find all logs from a certain day that contain a warning or error
72
+ logs = flox.find_logs('day:2014-02-22 severity:warning')
73
73
  num_logs = logs.length
74
- logs.each { |log| puts log['duration'] }
74
+ logs.each { |log| puts log[:duration] }
75
75
 
76
76
  ## Where to go from here:
77
77
 
@@ -155,7 +155,7 @@ class Flox
155
155
  end
156
156
 
157
157
  # Finds just the IDs of the logs, defined by a certain query.
158
- # @see {#find_logs}
158
+ # @see #find_logs
159
159
  # @return [Array<String>]
160
160
  def find_log_ids(query=nil, limit=nil)
161
161
  log_ids = []
@@ -197,7 +197,8 @@ class Flox
197
197
  def find_entity_ids(*query)
198
198
  query = create_query(*query)
199
199
  path = "entities/#{query.type}"
200
- data = { where: query.constraints, offset: query.offset, limit: query.limit }
200
+ data = { where: query.constraints, offset: query.offset,
201
+ limit: query.limit, orderBy: query.order_by }
201
202
  service.post(path, data).map {|e| e[:id]}
202
203
  end
203
204
 
@@ -12,7 +12,7 @@ class Flox::ServiceError < Flox::Error
12
12
  # @return [Net::HTTPResponse] the complete server response
13
13
  attr_reader :response
14
14
 
15
- # @param code [String] the http status code
15
+ # @param response [Net::HTTPResponse] the complete server response
16
16
  def initialize(response)
17
17
  @response = response
18
18
  end
@@ -35,6 +35,9 @@ class Flox::Query
35
35
  # @return [Fixnum] the maximum number of returned entities.
36
36
  attr_accessor :limit
37
37
 
38
+ # @return [String] Order the results by a certain property, like 'price ASC' or 'name DESC'.
39
+ attr_accessor :order_by
40
+
38
41
  # @return [String] the entity type that is searched.
39
42
  attr_reader :type
40
43
 
@@ -9,6 +9,6 @@
9
9
  class Flox
10
10
 
11
11
  # The current version of the Flox SDK.
12
- VERSION = '0.2.0'
12
+ VERSION = '0.3.0'
13
13
 
14
14
  end
@@ -35,6 +35,12 @@ class FloxTest < Test::Unit::TestCase
35
35
  assert_equal(5, query.limit)
36
36
  end
37
37
 
38
+ def test_order_by
39
+ query = Flox::Query.new("Type")
40
+ query.order_by = "updated_at DESC"
41
+ assert_equal("updated_at DESC", query.order_by)
42
+ end
43
+
38
44
  def test_constraints_checks_argument_count
39
45
  query = Flox::Query.new("Type")
40
46
  assert_raise ArgumentError do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Sperl
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 2.3.0
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'
26
+ version: 2.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slop
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.4.7
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.3.5
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.3.5
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: mocha
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +72,28 @@ dependencies:
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0.8'
75
+ version: 0.9.11
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0.8'
82
+ version: 0.9.11
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - ">="
87
+ - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '0'
89
+ version: '13.0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - ">="
94
+ - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '0'
96
+ version: '13.0'
83
97
  description: |
84
98
  Flox is the no-fuzz backend for game developers. The Ruby SDK allows direct
85
99
  interaction with the Flox servers, e.g. to download log files or update
@@ -91,14 +105,11 @@ executables:
91
105
  extensions: []
92
106
  extra_rdoc_files: []
93
107
  files:
94
- - README.md
95
- - LICENSE.md
96
108
  - ".yardopts"
109
+ - LICENSE.md
110
+ - README.md
97
111
  - bin/flox
98
- - test/test_entity.rb
99
- - test/test_flox.rb
100
- - test/test_query.rb
101
- - test/test_utils.rb
112
+ - lib/flox.rb
102
113
  - lib/flox/entity.rb
103
114
  - lib/flox/errors.rb
104
115
  - lib/flox/player.rb
@@ -107,10 +118,13 @@ files:
107
118
  - lib/flox/score.rb
108
119
  - lib/flox/utils.rb
109
120
  - lib/flox/version.rb
110
- - lib/flox.rb
121
+ - test/test_entity.rb
122
+ - test/test_flox.rb
123
+ - test/test_query.rb
124
+ - test/test_utils.rb
111
125
  homepage: https://www.flox.cc
112
126
  licenses:
113
- - Simplified BSD
127
+ - BSD-2-Clause
114
128
  metadata: {}
115
129
  post_install_message:
116
130
  rdoc_options: []
@@ -127,10 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
141
  - !ruby/object:Gem::Version
128
142
  version: '0'
129
143
  requirements: []
130
- rubyforge_project:
131
- rubygems_version: 2.0.3
144
+ rubygems_version: 3.0.6
132
145
  signing_key:
133
146
  specification_version: 4
134
147
  summary: Ruby SDK for the flox.cc game backend
135
148
  test_files: []
136
- has_rdoc: