http_eventstore 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/Rakefile +4 -0
- data/http_eventstore.gemspec +1 -1
- data/lib/http_eventstore/event.rb +2 -2
- data/lib/http_eventstore/helpers/parse_entries.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00f8ef3dc338ddc7ff8501bbf15543285f187d23
|
4
|
+
data.tar.gz: 725d0bec9eadc6055eab2b36b5d4201314539f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8252180f72f6398870bcf9aa9799899f8df3c4ddc4208381b4c757ba4fd9ab8324d047cfb1582d72b39084e8eeec133e1f230f4a73fc2c8238174242a3351e27
|
7
|
+
data.tar.gz: e7bb0108833f99acc909d824f31398f130a7637c4da56efbc591f5ceebda038c8b811bd15af854524fcc4393304d91fc72a4bea2b35d84ef90bd6af350bf09b7
|
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/arkency/http_eventstore.svg?branch=master)](https://travis-ci.org/arkency/http_eventstore)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/http_eventstore.svg)](http://badge.fury.io/rb/http_eventstore)
|
3
|
+
|
1
4
|
# HttpEventstore
|
2
5
|
|
3
6
|
HttpEventstore is a HTTP connector to the Greg's [Event Store](https://geteventstore.com/).
|
@@ -13,7 +16,7 @@ gem 'http_eventstore'
|
|
13
16
|
## Usage
|
14
17
|
|
15
18
|
To communicate with ES you have to create instance of `HttpEventstore::Connection` class. After configuring a client, you can do the following things.
|
16
|
-
|
19
|
+
|
17
20
|
```ruby
|
18
21
|
client = HttpEventstore::Connection.new do |config|
|
19
22
|
#default value is '127.0.0.1'
|
data/Rakefile
CHANGED
data/http_eventstore.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'http_eventstore'
|
7
|
-
spec.version = '0.1.
|
7
|
+
spec.version = '0.1.2'
|
8
8
|
spec.authors = ['Tomasz Rybczyński']
|
9
9
|
spec.email = ['tomek.rybka@gmail.com', 'dev@arkency.com']
|
10
10
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'securerandom'
|
2
2
|
|
3
|
-
class Event < Struct.new(:type, :data, :event_id, :id)
|
4
|
-
def initialize(type, data, event_id
|
3
|
+
class Event < Struct.new(:type, :data, :event_id, :id, :position, :stream_name)
|
4
|
+
def initialize(type, data, event_id=nil, id=nil, position=nil, stream_name=nil)
|
5
5
|
event_id = SecureRandom.uuid if event_id.nil?
|
6
6
|
super
|
7
7
|
end
|
@@ -11,11 +11,13 @@ module HttpEventstore
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def create_event(entry)
|
14
|
-
id = entry['
|
14
|
+
id = entry['eventNumber']
|
15
15
|
event_id = entry['eventId']
|
16
16
|
type = entry['eventType']
|
17
17
|
data = JSON.parse(entry['data'])
|
18
|
-
|
18
|
+
stream_name = entry['streamId']
|
19
|
+
position = entry['positionEventNumber']
|
20
|
+
Event.new(type, data, event_id, id, position, stream_name)
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_eventstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Rybczyński
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|