ashikawa-core 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.gitignore +11 -9
  2. data/.rspec +4 -0
  3. data/.travis.yml +8 -3
  4. data/CONTRIBUTING.md +5 -5
  5. data/Gemfile +5 -1
  6. data/Gemfile.devtools +65 -0
  7. data/Guardfile +1 -11
  8. data/README.md +14 -8
  9. data/Rakefile +5 -103
  10. data/ashikawa-core.gemspec +3 -29
  11. data/config/flay.yml +3 -0
  12. data/config/flog.yml +2 -0
  13. data/config/mutant.yml +3 -0
  14. data/config/roodi.yml +18 -0
  15. data/config/site.reek +95 -0
  16. data/config/yardstick.yml +2 -0
  17. data/lib/ashikawa-core/collection.rb +138 -178
  18. data/lib/ashikawa-core/connection.rb +74 -26
  19. data/lib/ashikawa-core/cursor.rb +30 -9
  20. data/lib/ashikawa-core/database.rb +23 -19
  21. data/lib/ashikawa-core/document.rb +33 -8
  22. data/lib/ashikawa-core/exceptions/collection_not_found.rb +15 -0
  23. data/lib/ashikawa-core/exceptions/document_not_found.rb +4 -0
  24. data/lib/ashikawa-core/exceptions/index_not_found.rb +15 -0
  25. data/lib/ashikawa-core/exceptions/no_collection_provided.rb +4 -0
  26. data/lib/ashikawa-core/exceptions/unknown_path.rb +15 -0
  27. data/lib/ashikawa-core/figure.rb +73 -0
  28. data/lib/ashikawa-core/index.rb +25 -7
  29. data/lib/ashikawa-core/query.rb +68 -55
  30. data/lib/ashikawa-core/status.rb +77 -0
  31. data/lib/ashikawa-core/version.rb +1 -1
  32. data/spec/acceptance/basic_spec.rb +14 -18
  33. data/spec/acceptance/index_spec.rb +4 -2
  34. data/spec/acceptance/query_spec.rb +18 -19
  35. data/spec/acceptance_auth/auth_spec.rb +2 -2
  36. data/spec/setup/arangodb.sh +34 -39
  37. data/spec/spec_helper.rb +27 -0
  38. data/spec/unit/collection_spec.rb +25 -73
  39. data/spec/unit/connection_spec.rb +46 -15
  40. data/spec/unit/cursor_spec.rb +3 -3
  41. data/spec/unit/database_spec.rb +8 -7
  42. data/spec/unit/document_spec.rb +2 -2
  43. data/spec/unit/exception_spec.rb +21 -0
  44. data/spec/unit/figure_spec.rb +28 -0
  45. data/spec/unit/index_spec.rb +1 -1
  46. data/spec/unit/query_spec.rb +25 -25
  47. data/spec/unit/spec_helper.rb +6 -4
  48. data/spec/unit/status_spec.rb +51 -0
  49. data/tasks/adjustments.rake +46 -0
  50. metadata +31 -203
@@ -1,11 +1,13 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
3
 
4
- require 'simplecov'
5
- SimpleCov.start do
6
- add_filter "spec/"
4
+ if defined? version and version != '1.8.7'
5
+ require 'simplecov'
6
+ SimpleCov.start do
7
+ add_filter "spec/"
8
+ end
9
+ SimpleCov.minimum_coverage 100
7
10
  end
8
- SimpleCov.minimum_coverage 100
9
11
 
10
12
  # For HTTP Testing
11
13
  require 'webmock/rspec'
@@ -0,0 +1,51 @@
1
+ require "ashikawa-core/status"
2
+
3
+ describe Ashikawa::Core::Status do
4
+ subject { Ashikawa::Core::Status }
5
+ let(:status_codes) { (1..6).to_a }
6
+
7
+ it "should know if the collection is new born" do
8
+ status = subject.new 1
9
+ status.new_born?.should == true
10
+
11
+ (status_codes - [1]).each do |status_code|
12
+ status = subject.new status_code
13
+ status.new_born?.should == false
14
+ end
15
+ end
16
+
17
+ it "should know if the collection is unloaded" do
18
+ status = subject.new 2
19
+ status.unloaded?.should == true
20
+
21
+ (status_codes - [2]).each do |status_code|
22
+ status = subject.new status_code
23
+ status.unloaded?.should == false
24
+ end
25
+ end
26
+
27
+ it "should know if the collection is loaded" do
28
+ status = subject.new 3
29
+ status.loaded?.should == true
30
+
31
+ (status_codes - [3]).each do |status_code|
32
+ status = subject.new status_code
33
+ status.loaded?.should == false
34
+ end
35
+ end
36
+
37
+ it "should know if the collection is being unloaded" do
38
+ status = subject.new 4
39
+ status.being_unloaded?.should == true
40
+
41
+ (status_codes - [4]).each do |status_code|
42
+ status = subject.new status_code
43
+ status.being_unloaded?.should == false
44
+ end
45
+ end
46
+
47
+ it "should know if the collection is corrupted" do
48
+ status = subject.new 6
49
+ status.corrupted?.should == true
50
+ end
51
+ end
@@ -0,0 +1,46 @@
1
+ # Remove some tasks defined by devtools to redefine them
2
+
3
+ Rake::Task["spec"].clear
4
+ Rake::Task["ci:metrics"].clear
5
+ Rake::Task["ci"].clear
6
+
7
+ ## Specs
8
+ # Difference to Devtools:
9
+ # * Acceptance, no integration tests
10
+ # * Special Case: ArangoDB needed for Acceptance Tests
11
+
12
+
13
+ desc 'Run all specs'
14
+ task :spec => %w[ spec:unit spec:acceptance ]
15
+
16
+ namespace :spec do
17
+ desc "Run the acceptance tests. Requires ArangoDB to be running."
18
+ RSpec::Core::RakeTask.new(:acceptance_with_running_arangodb) do |spec|
19
+ spec.pattern = "spec/acceptance/*_spec.rb"
20
+ end
21
+
22
+ desc "Run the acceptance tests. Requires ArangoDB."
23
+ RSpec::Core::RakeTask.new(:acceptance) do |spec|
24
+ spec.rspec_opts = "--require acceptance/arango_helper.rb"
25
+ spec.pattern = "spec/acceptance/*_spec.rb"
26
+ end
27
+
28
+ desc "Run the authentication acceptance tests. Requires ArangoDB."
29
+ RSpec::Core::RakeTask.new(:acceptance_auth) do |spec|
30
+ spec.rspec_opts = "--require acceptance_auth/arango_helper.rb"
31
+ spec.pattern = "spec/acceptance_auth/*_spec.rb"
32
+ end
33
+ end
34
+
35
+ ## Metrics
36
+ # Differences to Devtools:
37
+ # * Do not run mutant and reek, they do not pass yet
38
+ # * On the CI, ArangoDB is already running so use the special acceptance task
39
+
40
+ namespace :ci do
41
+ desc 'Run metrics'
42
+ task :metrics => %w[ metrics:verify_measurements metrics:flog metrics:flay metrics:reek metrics:roodi ]
43
+ end
44
+
45
+ desc 'Run metrics with Mutant'
46
+ task :ci => %w[ spec:unit spec:acceptance_with_running_arangodb ci:metrics ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ashikawa-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-16 00:00:00.000000000 Z
13
+ date: 2013-02-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -29,69 +29,21 @@ dependencies:
29
29
  - !ruby/object:Gem::Version
30
30
  version: 1.6.7
31
31
  - !ruby/object:Gem::Dependency
32
- name: redcarpet
32
+ name: json
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  none: false
35
35
  requirements:
36
36
  - - ~>
37
37
  - !ruby/object:Gem::Version
38
- version: 2.2.2
39
- type: :development
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- version: 2.2.2
47
- - !ruby/object:Gem::Dependency
48
- name: rake
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 0.9.2.2
55
- type: :development
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ~>
61
- - !ruby/object:Gem::Version
62
- version: 0.9.2.2
63
- - !ruby/object:Gem::Dependency
64
- name: rspec
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ~>
69
- - !ruby/object:Gem::Version
70
- version: 2.11.0
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: 2.11.0
79
- - !ruby/object:Gem::Dependency
80
- name: yard
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ~>
85
- - !ruby/object:Gem::Version
86
- version: 0.8.3
87
- type: :development
38
+ version: 1.7.7
39
+ type: :runtime
88
40
  prerelease: false
89
41
  version_requirements: !ruby/object:Gem::Requirement
90
42
  none: false
91
43
  requirements:
92
44
  - - ~>
93
45
  - !ruby/object:Gem::Version
94
- version: 0.8.3
46
+ version: 1.7.7
95
47
  - !ruby/object:Gem::Dependency
96
48
  name: webmock
97
49
  requirement: !ruby/object:Gem::Requirement
@@ -99,151 +51,7 @@ dependencies:
99
51
  requirements:
100
52
  - - ~>
101
53
  - !ruby/object:Gem::Version
102
- version: 1.9.0
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 1.9.0
111
- - !ruby/object:Gem::Dependency
112
- name: simplecov
113
- requirement: !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - ~>
117
- - !ruby/object:Gem::Version
118
- version: 0.7.1
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ~>
125
- - !ruby/object:Gem::Version
126
- version: 0.7.1
127
- - !ruby/object:Gem::Dependency
128
- name: cane
129
- requirement: !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ~>
133
- - !ruby/object:Gem::Version
134
- version: 2.4.0
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ~>
141
- - !ruby/object:Gem::Version
142
- version: 2.4.0
143
- - !ruby/object:Gem::Dependency
144
- name: roodi1.9
145
- requirement: !ruby/object:Gem::Requirement
146
- none: false
147
- requirements:
148
- - - ~>
149
- - !ruby/object:Gem::Version
150
- version: 2.0.1
151
- type: :development
152
- prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - ~>
157
- - !ruby/object:Gem::Version
158
- version: 2.0.1
159
- - !ruby/object:Gem::Dependency
160
- name: ruby_parser
161
- requirement: !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
164
- - - ~>
165
- - !ruby/object:Gem::Version
166
- version: 2.3.1
167
- type: :development
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - ~>
173
- - !ruby/object:Gem::Version
174
- version: 2.3.1
175
- - !ruby/object:Gem::Dependency
176
- name: guard
177
- requirement: !ruby/object:Gem::Requirement
178
- none: false
179
- requirements:
180
- - - ~>
181
- - !ruby/object:Gem::Version
182
- version: 1.5.3
183
- type: :development
184
- prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
188
- - - ~>
189
- - !ruby/object:Gem::Version
190
- version: 1.5.3
191
- - !ruby/object:Gem::Dependency
192
- name: guard-rspec
193
- requirement: !ruby/object:Gem::Requirement
194
- none: false
195
- requirements:
196
- - - ~>
197
- - !ruby/object:Gem::Version
198
- version: 2.1.1
199
- type: :development
200
- prerelease: false
201
- version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
- requirements:
204
- - - ~>
205
- - !ruby/object:Gem::Version
206
- version: 2.1.1
207
- - !ruby/object:Gem::Dependency
208
- name: guard-bundler
209
- requirement: !ruby/object:Gem::Requirement
210
- none: false
211
- requirements:
212
- - - ~>
213
- - !ruby/object:Gem::Version
214
- version: 1.0.0
215
- type: :development
216
- prerelease: false
217
- version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
- requirements:
220
- - - ~>
221
- - !ruby/object:Gem::Version
222
- version: 1.0.0
223
- - !ruby/object:Gem::Dependency
224
- name: guard-yard
225
- requirement: !ruby/object:Gem::Requirement
226
- none: false
227
- requirements:
228
- - - ~>
229
- - !ruby/object:Gem::Version
230
- version: 2.0.1
231
- type: :development
232
- prerelease: false
233
- version_requirements: !ruby/object:Gem::Requirement
234
- none: false
235
- requirements:
236
- - - ~>
237
- - !ruby/object:Gem::Version
238
- version: 2.0.1
239
- - !ruby/object:Gem::Dependency
240
- name: rb-fsevent
241
- requirement: !ruby/object:Gem::Requirement
242
- none: false
243
- requirements:
244
- - - ~>
245
- - !ruby/object:Gem::Version
246
- version: 0.9.2
54
+ version: 1.9.3
247
55
  type: :development
248
56
  prerelease: false
249
57
  version_requirements: !ruby/object:Gem::Requirement
@@ -251,7 +59,7 @@ dependencies:
251
59
  requirements:
252
60
  - - ~>
253
61
  - !ruby/object:Gem::Version
254
- version: 0.9.2
62
+ version: 1.9.3
255
63
  description: Ashikawa Core is a wrapper around the ArangoDB REST API. It provides
256
64
  low level access and will be used in different ArangoDB ODMs.
257
65
  email:
@@ -262,25 +70,38 @@ extensions: []
262
70
  extra_rdoc_files: []
263
71
  files:
264
72
  - .gitignore
73
+ - .rspec
265
74
  - .rvmrc
266
75
  - .travis.yml
267
76
  - CONTRIBUTING.md
268
77
  - Gemfile
78
+ - Gemfile.devtools
269
79
  - Guardfile
270
80
  - LICENSE
271
81
  - README.md
272
82
  - Rakefile
273
83
  - ashikawa-core.gemspec
84
+ - config/flay.yml
85
+ - config/flog.yml
86
+ - config/mutant.yml
87
+ - config/roodi.yml
88
+ - config/site.reek
89
+ - config/yardstick.yml
274
90
  - lib/ashikawa-core.rb
275
91
  - lib/ashikawa-core/collection.rb
276
92
  - lib/ashikawa-core/connection.rb
277
93
  - lib/ashikawa-core/cursor.rb
278
94
  - lib/ashikawa-core/database.rb
279
95
  - lib/ashikawa-core/document.rb
96
+ - lib/ashikawa-core/exceptions/collection_not_found.rb
280
97
  - lib/ashikawa-core/exceptions/document_not_found.rb
98
+ - lib/ashikawa-core/exceptions/index_not_found.rb
281
99
  - lib/ashikawa-core/exceptions/no_collection_provided.rb
100
+ - lib/ashikawa-core/exceptions/unknown_path.rb
101
+ - lib/ashikawa-core/figure.rb
282
102
  - lib/ashikawa-core/index.rb
283
103
  - lib/ashikawa-core/query.rb
104
+ - lib/ashikawa-core/status.rb
284
105
  - lib/ashikawa-core/version.rb
285
106
  - spec/acceptance/arango_helper.rb
286
107
  - spec/acceptance/basic_spec.rb
@@ -314,15 +135,19 @@ files:
314
135
  - spec/fixtures/simple-queries/range.json
315
136
  - spec/fixtures/simple-queries/within.json
316
137
  - spec/setup/arangodb.sh
138
+ - spec/spec_helper.rb
317
139
  - spec/unit/collection_spec.rb
318
140
  - spec/unit/connection_spec.rb
319
141
  - spec/unit/cursor_spec.rb
320
142
  - spec/unit/database_spec.rb
321
143
  - spec/unit/document_spec.rb
322
144
  - spec/unit/exception_spec.rb
145
+ - spec/unit/figure_spec.rb
323
146
  - spec/unit/index_spec.rb
324
147
  - spec/unit/query_spec.rb
325
148
  - spec/unit/spec_helper.rb
149
+ - spec/unit/status_spec.rb
150
+ - tasks/adjustments.rake
326
151
  homepage: http://triagens.github.com/ashikawa-core
327
152
  licenses: []
328
153
  post_install_message:
@@ -343,11 +168,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
168
  version: '0'
344
169
  segments:
345
170
  - 0
346
- hash: 4004032968452563439
171
+ hash: -2208395334206716502
347
172
  requirements:
348
- - ArangoDB, v1.0 alpha or greater
173
+ - ArangoDB, v1.1.2
349
174
  rubyforge_project: ashikawa-core
350
- rubygems_version: 1.8.24
175
+ rubygems_version: 1.8.25
351
176
  signing_key:
352
177
  specification_version: 3
353
178
  summary: Ashikawa Core is a wrapper around the ArangoDB REST API
@@ -384,13 +209,16 @@ test_files:
384
209
  - spec/fixtures/simple-queries/range.json
385
210
  - spec/fixtures/simple-queries/within.json
386
211
  - spec/setup/arangodb.sh
212
+ - spec/spec_helper.rb
387
213
  - spec/unit/collection_spec.rb
388
214
  - spec/unit/connection_spec.rb
389
215
  - spec/unit/cursor_spec.rb
390
216
  - spec/unit/database_spec.rb
391
217
  - spec/unit/document_spec.rb
392
218
  - spec/unit/exception_spec.rb
219
+ - spec/unit/figure_spec.rb
393
220
  - spec/unit/index_spec.rb
394
221
  - spec/unit/query_spec.rb
395
222
  - spec/unit/spec_helper.rb
223
+ - spec/unit/status_spec.rb
396
224
  has_rdoc: