ashikawa-core 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/{config/rubocop.yml → .hound.yml} +17 -2
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +6 -6
  6. data/CHANGELOG.md +22 -0
  7. data/Gemfile +3 -4
  8. data/Guardfile +3 -3
  9. data/README.md +12 -11
  10. data/Rakefile +52 -6
  11. data/ashikawa-core.gemspec +42 -19
  12. data/config/mutant.yml +1 -3
  13. data/config/reek.yml +3 -1
  14. data/lib/ashikawa-core/collection.rb +9 -7
  15. data/lib/ashikawa-core/configuration.rb +1 -1
  16. data/lib/ashikawa-core/connection.rb +43 -0
  17. data/lib/ashikawa-core/database.rb +61 -2
  18. data/lib/ashikawa-core/error_response.rb +14 -3
  19. data/lib/ashikawa-core/exceptions/client_error.rb +4 -4
  20. data/lib/ashikawa-core/exceptions/client_error/bad_syntax.rb +3 -2
  21. data/lib/ashikawa-core/exceptions/server_error.rb +4 -4
  22. data/lib/ashikawa-core/key_options.rb +3 -2
  23. data/lib/ashikawa-core/query.rb +33 -29
  24. data/lib/ashikawa-core/status.rb +9 -0
  25. data/lib/ashikawa-core/transaction.rb +3 -3
  26. data/lib/ashikawa-core/version.rb +1 -1
  27. data/spec/acceptance/basic_spec.rb +14 -8
  28. data/spec/acceptance/index_spec.rb +2 -2
  29. data/spec/acceptance/query_spec.rb +4 -4
  30. data/spec/acceptance/spec_helper.rb +24 -9
  31. data/spec/acceptance/transactions_spec.rb +2 -2
  32. data/spec/unit/collection_spec.rb +3 -3
  33. data/spec/unit/connection_spec.rb +38 -6
  34. data/spec/unit/database_spec.rb +58 -7
  35. data/spec/unit/document_spec.rb +3 -3
  36. data/spec/unit/exception_spec.rb +5 -1
  37. data/spec/unit/index_spec.rb +6 -1
  38. data/spec/unit/query_spec.rb +32 -22
  39. data/spec/unit/spec_helper.rb +5 -20
  40. data/spec/unit/status_spec.rb +25 -25
  41. data/spec/unit/transaction_spec.rb +4 -4
  42. metadata +192 -31
  43. data/.coveralls.yml +0 -1
  44. data/Gemfile.devtools +0 -71
  45. data/config/devtools.yml +0 -5
  46. data/config/flay.yml +0 -3
  47. data/config/flog.yml +0 -3
  48. data/config/yardstick.yml +0 -2
  49. data/tasks/adjustments.rake +0 -17
@@ -2,6 +2,11 @@
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
 
5
+ require 'codeclimate-test-reporter'
6
+ CodeClimate::TestReporter.start
7
+
8
+ require 'rspec/its'
9
+
5
10
  RSpec.configure do |config|
6
11
  config.expect_with :rspec do |c|
7
12
  c.syntax = :expect
@@ -12,26 +17,6 @@ RSpec.configure do |config|
12
17
  end
13
18
  end
14
19
 
15
- # Do not run SimpleCov in Guard
16
- if ENV['COVERAGE'] == 'true'
17
- require 'simplecov'
18
- require 'coveralls'
19
-
20
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
21
- SimpleCov::Formatter::HTMLFormatter,
22
- Coveralls::SimpleCov::Formatter
23
- ]
24
-
25
- SimpleCov.start do
26
- command_name 'spec:unit'
27
- add_filter 'config'
28
- add_filter 'spec'
29
- minimum_coverage 99
30
- end
31
- end
32
-
33
- require 'json'
34
-
35
20
  # Helper to simulate Server Responses. Parses the fixtures in the spec folder
36
21
  def server_response(path)
37
22
  JSON.parse(File.readlines("spec/fixtures/#{path}.json").join)
@@ -6,46 +6,46 @@ describe Ashikawa::Core::Status do
6
6
 
7
7
  describe 'a new born collection' do
8
8
  subject { Ashikawa::Core::Status.new(1) }
9
- its(:new_born?) { should be_true }
10
- its(:unloaded?) { should be_false }
11
- its(:loaded?) { should be_false }
12
- its(:being_unloaded?) { should be_false }
13
- its(:corrupted?) { should be_false }
9
+ its(:new_born?) { should be_truthy }
10
+ its(:unloaded?) { should be_falsey }
11
+ its(:loaded?) { should be_falsey }
12
+ its(:being_unloaded?) { should be_falsey }
13
+ its(:corrupted?) { should be_falsey }
14
14
  end
15
15
 
16
16
  describe 'an unloaded collection' do
17
17
  subject { Ashikawa::Core::Status.new(2) }
18
- its(:new_born?) { should be_false }
19
- its(:unloaded?) { should be_true }
20
- its(:loaded?) { should be_false }
21
- its(:being_unloaded?) { should be_false }
22
- its(:corrupted?) { should be_false }
18
+ its(:new_born?) { should be_falsey }
19
+ its(:unloaded?) { should be_truthy }
20
+ its(:loaded?) { should be_falsey }
21
+ its(:being_unloaded?) { should be_falsey }
22
+ its(:corrupted?) { should be_falsey }
23
23
  end
24
24
 
25
25
  describe 'a loaded collection' do
26
26
  subject { Ashikawa::Core::Status.new(3) }
27
- its(:new_born?) { should be_false }
28
- its(:unloaded?) { should be_false }
29
- its(:loaded?) { should be_true }
30
- its(:being_unloaded?) { should be_false }
31
- its(:corrupted?) { should be_false }
27
+ its(:new_born?) { should be_falsey }
28
+ its(:unloaded?) { should be_falsey }
29
+ its(:loaded?) { should be_truthy }
30
+ its(:being_unloaded?) { should be_falsey }
31
+ its(:corrupted?) { should be_falsey }
32
32
  end
33
33
 
34
34
  describe 'a collection being unloaded' do
35
35
  subject { Ashikawa::Core::Status.new(4) }
36
- its(:new_born?) { should be_false }
37
- its(:unloaded?) { should be_false }
38
- its(:loaded?) { should be_false }
39
- its(:being_unloaded?) { should be_true }
40
- its(:corrupted?) { should be_false }
36
+ its(:new_born?) { should be_falsey }
37
+ its(:unloaded?) { should be_falsey }
38
+ its(:loaded?) { should be_falsey }
39
+ its(:being_unloaded?) { should be_truthy }
40
+ its(:corrupted?) { should be_falsey }
41
41
  end
42
42
 
43
43
  describe 'a corrupted collection' do
44
44
  subject { Ashikawa::Core::Status.new(6) }
45
- its(:new_born?) { should be_false }
46
- its(:unloaded?) { should be_false }
47
- its(:loaded?) { should be_false }
48
- its(:being_unloaded?) { should be_false }
49
- its(:corrupted?) { should be_true }
45
+ its(:new_born?) { should be_falsey }
46
+ its(:unloaded?) { should be_falsey }
47
+ its(:loaded?) { should be_falsey }
48
+ its(:being_unloaded?) { should be_falsey }
49
+ its(:corrupted?) { should be_truthy }
50
50
  end
51
51
  end
@@ -43,9 +43,9 @@ describe Ashikawa::Core::Transaction do
43
43
  subject { Ashikawa::Core::Transaction.new(db, action, read_and_write_collections) }
44
44
 
45
45
  it 'should be possible to activate waiting for sync' do
46
- expect(subject.wait_for_sync).to be_false
46
+ expect(subject.wait_for_sync).to be_falsey
47
47
  subject.wait_for_sync = true
48
- expect(subject.wait_for_sync).to be_true
48
+ expect(subject.wait_for_sync).to be_truthy
49
49
  end
50
50
 
51
51
  it 'should be possible to set the lock timeout' do
@@ -64,7 +64,7 @@ describe Ashikawa::Core::Transaction do
64
64
  before do
65
65
  allow(response).to receive(:[])
66
66
  allow(db).to receive(:send_request)
67
- .and_return { response }
67
+ .and_return(response)
68
68
  end
69
69
 
70
70
  it 'should return the result from the database' do
@@ -72,7 +72,7 @@ describe Ashikawa::Core::Transaction do
72
72
  .with('result')
73
73
  .and_return(result)
74
74
  expect(db).to receive(:send_request)
75
- .and_return { response }
75
+ .and_return(response)
76
76
  expect(subject.execute).to eq(result)
77
77
  end
78
78
 
metadata CHANGED
@@ -1,85 +1,253 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ashikawa-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - moonglum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-14 00:00:00.000000000 Z
11
+ date: 2014-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.8
19
+ version: 0.9.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.8.8
26
+ version: 0.9.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday_middleware
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.0
33
+ version: 0.9.1
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: 0.9.0
40
+ version: 0.9.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.8.1
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
54
  version: 1.8.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: null_logger
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.0.1
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
68
  version: 0.0.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: equalizer
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.0.8
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
82
  version: 0.0.8
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 10.3.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 10.3.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 3.0.0.beta2
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 3.0.0.beta2
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-its
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.0.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.0.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: codeclimate-test-reporter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.3.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.3.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.8.7.4
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.8.7.4
153
+ - !ruby/object:Gem::Dependency
154
+ name: inch
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.4.5
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.4.5
167
+ - !ruby/object:Gem::Dependency
168
+ name: reek
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 1.3.7
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 1.3.7
181
+ - !ruby/object:Gem::Dependency
182
+ name: mutant
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.5.12
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.5.12
195
+ - !ruby/object:Gem::Dependency
196
+ name: mutant-rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 0.5.3
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 0.5.3
209
+ - !ruby/object:Gem::Dependency
210
+ name: pry
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: 0.9.12.6
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: 0.9.12.6
223
+ - !ruby/object:Gem::Dependency
224
+ name: guard
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: 2.6.1
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: 2.6.1
237
+ - !ruby/object:Gem::Dependency
238
+ name: guard-bundler
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: 2.0.0
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: 2.0.0
83
251
  description: Ashikawa Core is a wrapper around the ArangoDB REST API. It provides
84
252
  low level access and is intended to be used in ArangoDB ODMs and other tools.
85
253
  email:
@@ -88,28 +256,22 @@ executables: []
88
256
  extensions: []
89
257
  extra_rdoc_files: []
90
258
  files:
91
- - .coveralls.yml
92
- - .gitignore
93
- - .rspec
94
- - .ruby-version
95
- - .travis.yml
259
+ - ".gitignore"
260
+ - ".hound.yml"
261
+ - ".rspec"
262
+ - ".ruby-version"
263
+ - ".travis.yml"
96
264
  - CHANGELOG.md
97
265
  - CONTRIBUTING.md
98
266
  - Gemfile
99
- - Gemfile.devtools
100
267
  - Guardfile
101
268
  - LICENSE
102
269
  - README.md
103
270
  - Rakefile
104
271
  - ashikawa-core.gemspec
105
272
  - cache/Mac_applications
106
- - config/devtools.yml
107
- - config/flay.yml
108
- - config/flog.yml
109
273
  - config/mutant.yml
110
274
  - config/reek.yml
111
- - config/rubocop.yml
112
- - config/yardstick.yml
113
275
  - lib/ashikawa-core.rb
114
276
  - lib/ashikawa-core/collection.rb
115
277
  - lib/ashikawa-core/configuration.rb
@@ -182,7 +344,6 @@ files:
182
344
  - spec/unit/spec_helper.rb
183
345
  - spec/unit/status_spec.rb
184
346
  - spec/unit/transaction_spec.rb
185
- - tasks/adjustments.rake
186
347
  homepage: http://triagens.github.com/ashikawa-core
187
348
  licenses:
188
349
  - Apache License 2.0
@@ -193,16 +354,16 @@ require_paths:
193
354
  - lib
194
355
  required_ruby_version: !ruby/object:Gem::Requirement
195
356
  requirements:
196
- - - '>='
357
+ - - ">="
197
358
  - !ruby/object:Gem::Version
198
359
  version: 1.9.3
199
360
  required_rubygems_version: !ruby/object:Gem::Requirement
200
361
  requirements:
201
- - - '>='
362
+ - - ">="
202
363
  - !ruby/object:Gem::Version
203
364
  version: '0'
204
365
  requirements:
205
- - ArangoDB, v1.4 or v2.0
366
+ - ArangoDB, v2.0
206
367
  rubyforge_project: ashikawa-core
207
368
  rubygems_version: 2.2.2
208
369
  signing_key: