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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7df606052bd99feb2e413424aee474abc2c38de
4
- data.tar.gz: e2f3eacbb044cf3920178315a475d2c8e0fe0a9d
3
+ metadata.gz: a09d7e73bc37c30f64b170c09a38a6761db8788f
4
+ data.tar.gz: 6611a2cd44128874452e1172ad77a1b38e128134
5
5
  SHA512:
6
- metadata.gz: 0652e4cdc58c66a22ba3e018265f85114ca14e41bb75429ce91e8ee95dc96cdfbbefba72707c53f701df9c5a99b7104fc38afe6ac063b79e86ebbf5b82c41a44
7
- data.tar.gz: 00fa87eb476049549c909406eaff59e4759e415fb87868a60d54c4a3181e1cef8a3bcb351d53719559d840b0eee2c809a732b7e3a7d0ab34cdaee2860235bd8b
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.rc3)
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.1.0)
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
- moped (2.0.6)
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 'moped'
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[:moped_session] ||= if uri
86
- Moped::Session.connect(uri)
85
+ Thread.current[:mongo_session] ||= if uri
86
+ Mongo::Client.new(uri)
87
87
  else
88
- Moped::Session.new([*hosts]).tap do |session|
89
- session.use database
90
- session.login(username, password) if username && password
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.insert(serialized_entity)
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).remove if 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).tap do |results|
51
- results.sort(sort) if sort
52
- results.select(fields) if fields
53
- results.skip(@skip) if @skip
54
- results.limit(@limit) if @limit
55
- end
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
@@ -13,7 +13,7 @@ require 'dragonfly/middleware'
13
13
  require_relative 'middlewares'
14
14
 
15
15
  if ENV['PROFILER']
16
- require 'moped'
16
+ require 'mongo'
17
17
  require 'rack-mini-profiler'
18
18
  end
19
19
 
@@ -3,6 +3,6 @@
3
3
  # 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0
4
4
  module Locomotive
5
5
  module Steam
6
- VERSION = '1.0.0.rc3'
6
+ VERSION = '1.0.0.rc4'
7
7
  end
8
8
  end
@@ -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.add_development_dependency 'moped', '~> 2.0.6'
22
- spec.add_development_dependency 'origin', '~> 2.1.1'
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
@@ -6,3 +6,4 @@ require_relative 'support/examples/matching_locale'
6
6
  require_relative 'support/examples/locale_file'
7
7
  require_relative 'support/time'
8
8
  require_relative 'support/pry'
9
+ require_relative 'support/mongo'
@@ -0,0 +1,3 @@
1
+ require 'mongo'
2
+
3
+ Mongo::Logger.logger.level = Logger::INFO # DEBUG # INFO
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.rc3
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-13 00:00:00.000000000 Z
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: moped
45
+ name: mongo
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 2.0.6
51
- type: :development
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.0.6
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: :development
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