locomotivecms_steam 1.0.0.rc3 → 1.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -9
- data/lib/locomotive/steam/adapters/mongodb.rb +6 -7
- data/lib/locomotive/steam/adapters/mongodb/command.rb +2 -2
- data/lib/locomotive/steam/adapters/mongodb/query.rb +7 -6
- data/lib/locomotive/steam/server.rb +1 -1
- data/lib/locomotive/steam/version.rb +1 -1
- data/locomotivecms_steam.gemspec +2 -2
- data/spec/integration/repositories/page_repository_spec.rb +0 -5
- data/spec/support.rb +1 -0
- data/spec/support/mongo.rb +3 -0
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a09d7e73bc37c30f64b170c09a38a6761db8788f
|
4
|
+
data.tar.gz: 6611a2cd44128874452e1172ad77a1b38e128134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b759d95e386dd121a7936bb4715ec5fe8d308af8854c4408ff16d0a878dfcc31d50e45e0a16d6847a3360a83d528ddfbc479dbd74ca8f606bb63381f20cc8657
|
7
|
+
data.tar.gz: 9e51a4924b1f934f08dbd5dd3fc503ef1c18454e753a742009890bbe2abae6e231f8c60ddd39a75bb253f3a136e69976ad48f4ca7ae1fbda3d0aaa654e5aeb12
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
locomotivecms_steam (1.0.0.
|
4
|
+
locomotivecms_steam (1.0.0.rc4)
|
5
5
|
RedCloth (~> 4.2.9)
|
6
6
|
chronic (~> 0.10.2)
|
7
7
|
coffee-script (~> 2.4.1)
|
@@ -15,7 +15,9 @@ PATH
|
|
15
15
|
mime-types (~> 2.6.1)
|
16
16
|
mimetype-fu (~> 0.1.2)
|
17
17
|
moneta (~> 0.8.0)
|
18
|
+
mongo (~> 2.1.2)
|
18
19
|
morphine (~> 0.1.1)
|
20
|
+
origin (~> 2.1.1)
|
19
21
|
rack-cache (~> 1.2)
|
20
22
|
rack-rewrite (~> 1.5.1)
|
21
23
|
rack_csrf (~> 2.5.0)
|
@@ -36,7 +38,7 @@ GEM
|
|
36
38
|
tzinfo (~> 1.1)
|
37
39
|
addressable (2.3.8)
|
38
40
|
attr_extras (4.4.0)
|
39
|
-
bson (3.
|
41
|
+
bson (3.2.6)
|
40
42
|
byebug (4.0.5)
|
41
43
|
columnize (= 0.9.0)
|
42
44
|
chronic (0.10.2)
|
@@ -63,7 +65,6 @@ GEM
|
|
63
65
|
sass (>= 3.3.0, < 3.5)
|
64
66
|
compass-import-once (1.0.5)
|
65
67
|
sass (>= 3.2, < 3.5)
|
66
|
-
connection_pool (2.2.0)
|
67
68
|
coveralls (0.8.1)
|
68
69
|
json (~> 1.8)
|
69
70
|
rest-client (>= 1.6.8, < 2)
|
@@ -121,10 +122,8 @@ GEM
|
|
121
122
|
mini_portile (0.6.2)
|
122
123
|
minitest (5.8.2)
|
123
124
|
moneta (0.8.0)
|
124
|
-
|
125
|
+
mongo (2.1.2)
|
125
126
|
bson (~> 3.0)
|
126
|
-
connection_pool (~> 2.0)
|
127
|
-
optionable (~> 0.2.0)
|
128
127
|
morphine (0.1.1)
|
129
128
|
multi_json (1.11.1)
|
130
129
|
multi_xml (0.5.5)
|
@@ -133,7 +132,6 @@ GEM
|
|
133
132
|
mini_portile (~> 0.6.0)
|
134
133
|
nokogumbo (1.4.1)
|
135
134
|
nokogiri
|
136
|
-
optionable (0.2.0)
|
137
135
|
origin (2.1.1)
|
138
136
|
pry (0.10.1)
|
139
137
|
coderay (~> 1.1.0)
|
@@ -226,8 +224,6 @@ DEPENDENCIES
|
|
226
224
|
json_spec (~> 1.1.4)
|
227
225
|
locomotivecms_steam!
|
228
226
|
memory_profiler
|
229
|
-
moped (~> 2.0.6)
|
230
|
-
origin (~> 2.1.1)
|
231
227
|
pry-byebug (~> 3.1.0)
|
232
228
|
puma
|
233
229
|
rack-mini-profiler
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'mongo'
|
2
2
|
require 'origin'
|
3
3
|
|
4
4
|
require_relative 'mongodb/origin'
|
@@ -82,13 +82,12 @@ module Locomotive::Steam
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def session
|
85
|
-
Thread.current[:
|
86
|
-
|
85
|
+
Thread.current[:mongo_session] ||= if uri
|
86
|
+
Mongo::Client.new(uri)
|
87
87
|
else
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
end
|
88
|
+
client = Mongo::Client.new([*hosts], database: database)
|
89
|
+
client = client.with(user: username, password: password) if username && password
|
90
|
+
client
|
92
91
|
end
|
93
92
|
end
|
94
93
|
|
@@ -15,13 +15,13 @@ module Locomotive::Steam
|
|
15
15
|
|
16
16
|
serialized_entity = @mapper.serialize(entity)
|
17
17
|
|
18
|
-
@collection.
|
18
|
+
@collection.insert_one(serialized_entity)
|
19
19
|
|
20
20
|
entity
|
21
21
|
end
|
22
22
|
|
23
23
|
def delete(entity)
|
24
|
-
@collection.find(_id: entity._id).
|
24
|
+
@collection.find(_id: entity._id).delete_one if entity._id
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
@@ -47,12 +47,13 @@ module Locomotive::Steam
|
|
47
47
|
_query = to_origin
|
48
48
|
selector, fields, sort = _query.selector, _query.options[:fields], _query.options[:sort]
|
49
49
|
|
50
|
-
collection.find(selector)
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
results = collection.find(selector)
|
51
|
+
results = results.sort(sort) if sort
|
52
|
+
results = results.projection(fields) if fields
|
53
|
+
results = results.skip(@skip) if @skip
|
54
|
+
results = results.limit(@limit) if @limit
|
55
|
+
|
56
|
+
results
|
56
57
|
end
|
57
58
|
|
58
59
|
def to_origin
|
data/locomotivecms_steam.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
19
19
|
spec.add_development_dependency 'rake', '~> 10.4.2'
|
20
20
|
|
21
|
-
spec.
|
22
|
-
spec.
|
21
|
+
spec.add_dependency 'mongo', '~> 2.1.2'
|
22
|
+
spec.add_dependency 'origin', '~> 2.1.1'
|
23
23
|
|
24
24
|
spec.add_dependency 'sanitize', '~> 4.0.0'
|
25
25
|
spec.add_dependency 'morphine', '~> 0.1.1'
|
@@ -5,11 +5,6 @@ require_relative '../../../lib/locomotive/steam/adapters/mongodb.rb'
|
|
5
5
|
|
6
6
|
describe Locomotive::Steam::PageRepository do
|
7
7
|
|
8
|
-
# before(:all) do
|
9
|
-
# Moped.logger = Logger.new($stdout)
|
10
|
-
# Moped.logger.level = Logger::DEBUG
|
11
|
-
# end
|
12
|
-
|
13
8
|
shared_examples_for 'a repository' do
|
14
9
|
|
15
10
|
let(:site) { Locomotive::Steam::Site.new(_id: site_id, locales: %w(en fr nb)) }
|
data/spec/support.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotivecms_steam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-11-
|
14
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -42,19 +42,19 @@ dependencies:
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 10.4.2
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
|
-
name:
|
45
|
+
name: mongo
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - "~>"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 2.
|
51
|
-
type: :
|
50
|
+
version: 2.1.2
|
51
|
+
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 2.
|
57
|
+
version: 2.1.2
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: origin
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: 2.1.1
|
65
|
-
type: :
|
65
|
+
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
@@ -675,6 +675,7 @@ files:
|
|
675
675
|
- spec/support/helpers.rb
|
676
676
|
- spec/support/liquid.rb
|
677
677
|
- spec/support/matchers/hash.rb
|
678
|
+
- spec/support/mongo.rb
|
678
679
|
- spec/support/pry.rb
|
679
680
|
- spec/support/time.rb
|
680
681
|
- spec/unit/adapters/filesystem/simple_cache_store_spec.rb
|
@@ -915,6 +916,7 @@ test_files:
|
|
915
916
|
- spec/support/helpers.rb
|
916
917
|
- spec/support/liquid.rb
|
917
918
|
- spec/support/matchers/hash.rb
|
919
|
+
- spec/support/mongo.rb
|
918
920
|
- spec/support/pry.rb
|
919
921
|
- spec/support/time.rb
|
920
922
|
- spec/unit/adapters/filesystem/simple_cache_store_spec.rb
|