sandthorn_driver_sequel 1.0.5 → 1.0.6

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: 32fcaa013235d94d983f889c5f3ccc7784bc8e13
4
- data.tar.gz: aaf942165819a2b0d5257f3e2aa4288064e5fa6b
3
+ metadata.gz: 1afb165a1182b4ca32503c6cd50e457dc3a463ec
4
+ data.tar.gz: 0564b8de514327e5216d9e5c40b9afeee4cd013d
5
5
  SHA512:
6
- metadata.gz: 2348c4fc6cd403f535c13b22b158431d39c8f297a2f9c32108188941de496fd250b8983b11c6e8519499c48e6630ebe68929d27895e4b09a56c2d487b0f41158
7
- data.tar.gz: 8d83bbc8aef2d009ecbfc8e49d8da795f969d131cb2778318b96fb629c53d1d197a95bdc3522015316942b015d2e0f98f474843cd8d8f51a6c68153f052d1c46
6
+ metadata.gz: 709c4d3a672d0b9c796ad635929d538137e67117c333724a6aec5d423a62d0fc7a48512e351a65cee3a268b3ef8749efc2eeb201819b2799bc930e5a850defa1
7
+ data.tar.gz: 37136fed39a9701ddbaf558e4f188321f5078f943f7233153ffe69265ac8daac425e3862f553c5055ff36eb1f62a0cd326ae1fdf974c744e22b79f9576be0a8c
data/.autotest ADDED
@@ -0,0 +1,3 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ %w{.git spec/db coverage}.each {|exception| at.add_exception(exception)}
3
+ end
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.0
4
+ - 2.0.0
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # SandthornDriverSequel
1
+ [![Code Climate](https://codeclimate.com/github/Sandthorn/sandthorn_driver_sequel.png)](https://codeclimate.com/github/Sandthorn/sandthorn_driver_sequel)
2
2
 
3
- TODO: Write a gem description
3
+ # Sandthorn Sequel-driver
4
+
5
+ A SQL database driver for [Sandthorn](https://github.com/Sandthorn/sandthorn), made with [Sequel](http://sequel.jeremyevans.net/).
4
6
 
5
7
  ## Installation
6
8
 
data/Rakefile CHANGED
@@ -3,5 +3,8 @@ require "bundler/gem_tasks"
3
3
  require 'rspec/core/rake_task'
4
4
 
5
5
  RSpec::Core::RakeTask.new(:spec)
6
- sh "ulimit -n 8192"
7
6
  task default: :spec
7
+
8
+ task :benchmark do
9
+ sh "ulimit -n 8192 && rspec --tag benchmark"
10
+ end
@@ -116,13 +116,10 @@ module SandthornDriverSequel
116
116
  return query.order(:sequence_number).all
117
117
  end
118
118
  end
119
- def get_events args = {}
120
- classes = args.fetch(:classes, [])
121
- after_sequence_number = args.fetch(:after_sequence_number) { raise ArgumentError.new "Must provide a :after_sequence_number-argument. 1 is first sequence_number, so use 0 if starting over." }
122
- take = args.fetch(:take, 0)
123
- include_events = args.fetch(:include_events, []).collect { |e| e.to_s }
124
- exclude_events = args.fetch(:exclude_events, []).collect { |e| e.to_s }
125
- aggregate_types = classes.collect { |e| e.to_s }
119
+ def get_events aggregate_types: [], take: 0, after_sequence_number: 0, include_events: [], exclude_events: []
120
+ include_events = include_events.map { |e| e.to_s }
121
+ exclude_events = exclude_events.map { |e| e.to_s }
122
+ aggregate_types = aggregate_types.map { |e| e.to_s }
126
123
  driver.execute do |db|
127
124
  if aggregate_types.empty?
128
125
  query = db[events_table_name].join(aggregates_table_name, id: :aggregate_table_id)
@@ -1,3 +1,3 @@
1
1
  module SandthornDriverSequel
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
 
24
24
  spec.add_development_dependency "rspec"
25
+ spec.add_development_dependency "coveralls"
25
26
  spec.add_development_dependency "gem-release"
26
27
  spec.add_development_dependency "sqlite3"
27
28
  spec.add_development_dependency "pry"
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  module Sandthorn
6
6
  module AggregateRoot
7
7
 
8
- describe "benchmark" do
8
+ describe "benchmark", benchmark: true do
9
9
 
10
10
  before(:each) { prepare_for_test }
11
11
  let(:test_events_20_events) do
data/spec/db/.keep ADDED
File without changes
@@ -71,7 +71,7 @@ module SandthornDriverSequel
71
71
  end
72
72
  end
73
73
  context "and getting events of type :new and foo" do
74
- let(:events) {event_store.get_events after_sequence_number: 0, classes: ["String", SandthornDriverSequel::EventStore], include_events: [:new, "foo"]}
74
+ let(:events) {event_store.get_events after_sequence_number: 0, aggregate_types: ["String", SandthornDriverSequel::EventStore], include_events: [:new, "foo"]}
75
75
  it "should find 3 events" do
76
76
  events.length.should eql 3
77
77
  end
@@ -80,7 +80,7 @@ module SandthornDriverSequel
80
80
  end
81
81
  end
82
82
  context "and getting events for SandthornDriverSequel::EventStore, and String after 0" do
83
- let(:events) {event_store.get_events after_sequence_number: 0, classes: [SandthornDriverSequel::EventStore, String]}
83
+ let(:events) {event_store.get_events after_sequence_number: 0, aggregate_types: [SandthornDriverSequel::EventStore, String]}
84
84
  it "should find 5 events" do
85
85
  events.length.should eql 5
86
86
  end
@@ -93,7 +93,7 @@ module SandthornDriverSequel
93
93
  end
94
94
  end
95
95
  context "and getting events for SandthornDriverSequel::EventStore after 0" do
96
- let(:events) {event_store.get_events after_sequence_number: 0, classes: [SandthornDriverSequel::EventStore]}
96
+ let(:events) {event_store.get_events after_sequence_number: 0, aggregate_types: [SandthornDriverSequel::EventStore]}
97
97
  it "should find 3 events" do
98
98
  events.length.should eql 3
99
99
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,11 @@
1
+ require 'coveralls'
1
2
  require 'sandthorn_driver_sequel'
2
3
  require 'sandthorn_driver_sequel/migration'
3
4
  require 'ap'
4
5
  require 'uuidtools'
6
+
7
+ Bundler.require
8
+ Coveralls.wear!
5
9
  # This file was generated by the `rspec --init` command. Conventionally, all
6
10
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
7
11
  # Require this file using `require "spec_helper"` to ensure that it is only
@@ -12,6 +16,7 @@ RSpec.configure do |config|
12
16
  config.treat_symbols_as_metadata_keys_with_true_values = true
13
17
  config.run_all_when_everything_filtered = true
14
18
  config.filter_run :focus
19
+ config.filter_run_excluding benchmark: true
15
20
  config.order = 'random'
16
21
  end
17
22
  def prepare_for_test context: :test
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandthorn_driver_sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Krantz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-17 00:00:00.000000000 Z
12
+ date: 2014-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: coveralls
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: gem-release
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -229,10 +243,12 @@ executables: []
229
243
  extensions: []
230
244
  extra_rdoc_files: []
231
245
  files:
246
+ - ".autotest"
232
247
  - ".gitignore"
233
248
  - ".rspec"
234
249
  - ".ruby-gemset"
235
250
  - ".ruby-version"
251
+ - ".travis.yml"
236
252
  - Gemfile
237
253
  - LICENSE.txt
238
254
  - README.md
@@ -247,6 +263,7 @@ files:
247
263
  - sandthorn_driver_sequel.gemspec
248
264
  - spec/asking_for_aggregates_to_snapshot_spec.rb
249
265
  - spec/benchmark_spec.rb
266
+ - spec/db/.keep
250
267
  - spec/driver_interface_spec.rb
251
268
  - spec/event_store_with_context_spec.rb
252
269
  - spec/get_events_spec.rb
@@ -281,6 +298,7 @@ summary: sequel driver for sandthorn
281
298
  test_files:
282
299
  - spec/asking_for_aggregates_to_snapshot_spec.rb
283
300
  - spec/benchmark_spec.rb
301
+ - spec/db/.keep
284
302
  - spec/driver_interface_spec.rb
285
303
  - spec/event_store_with_context_spec.rb
286
304
  - spec/get_events_spec.rb