dragonfly-mongoid_data_store 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 2a232288fcaafed49d8e5e27993c8e85942c85db7f9a491b2d0de88674a7d8fb
4
- data.tar.gz: 117ab8f6f90307d572bfc0a75fc9d2030cd8853e9f67b449258816a965b15501
3
+ metadata.gz: 5d843cf661eb171417472bf7d104a3a3d15da439c5d0438f8330bbda7c36edc2
4
+ data.tar.gz: b5e072f02da003d06ef2bc1a03973224349362c893a5fd30f80ffeb6c11d4a24
5
5
  SHA512:
6
- metadata.gz: 140c8da86b2ceca6b986ac3387fb30eca8be8a42cf203107751e3795fe91e676981f4e4ca3a179314c680a821770175c1926933c9be97e99178771912489fe55
7
- data.tar.gz: f8dc7b29d76a8d2df0b235fd757404ffb4be689122538e7b11f99299febd495c53e37d62da76614a57d7b1450379090d8d37035558b844f4b6b24d2aa6e0aaab
6
+ metadata.gz: c0c65a9667c633d82e9384a731a90adc989d0d811c52bb822a99b9d2169616078bc54768c32f30b9cc9b795bf3a0e33ec8062982e8463a9034093d84f2d6a9bb
7
+ data.tar.gz: 464ca7014c5baf4d17f4227dc3c7782e399da2bf79f26085cff60bb58e04ebee580257661969c4c1f61f5d0957051ebe3f156c5abebc1b97db1bdf240308ad03
@@ -0,0 +1,29 @@
1
+ name: Tests
2
+ on: [push, pull_request]
3
+ concurrency:
4
+ group: ${{ github.ref }}
5
+ cancel-in-progress: true
6
+ jobs:
7
+ test:
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ gemfile: ["7", "8"]
12
+ ruby: ["2.7", "3.0", "3.1"]
13
+ include:
14
+ - gemfile: "6"
15
+ ruby: "2.7"
16
+ runs-on: ubuntu-latest
17
+ services:
18
+ mongodb:
19
+ image: mongo
20
+ ports: ["27017:27017"]
21
+ env:
22
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ bundler-cache: true
29
+ - run: bundle exec rake
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ /gemfiles/*.gemfile.lock
data/Appraisals ADDED
@@ -0,0 +1,11 @@
1
+ appraise "6" do
2
+ gem "mongoid", "~> 6.0"
3
+ end
4
+
5
+ appraise "7" do
6
+ gem "mongoid", "~> 7.0"
7
+ end
8
+
9
+ appraise "8" do
10
+ gem "mongoid", "~> 8.0"
11
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.1
4
+
5
+ * Mongoid 8 compatibility
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  * Mongoid 7 compatibility
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Dragonfly::MongoidDataStore
2
2
 
3
- [![Build Status](https://travis-ci.org/tomasc/dragonfly-mongoid_data_store.svg)](https://travis-ci.org/tomasc/dragonfly-mongoid_data_store) [![Gem Version](https://badge.fury.io/rb/dragonfly-mongoid_data_store.svg)](http://badge.fury.io/rb/dragonfly-mongoid_data_store) [![Coverage Status](https://img.shields.io/coveralls/tomasc/dragonfly-mongoid_data_store.svg)](https://coveralls.io/r/tomasc/dragonfly-mongoid_data_store)
3
+ [![Tests](https://github.com/tomasc/dragonfly-mongoid_data_store/actions/workflows/test.yml/badge.svg)](https://github.com/tomasc/dragonfly-mongoid_data_store/actions/workflows/test.yml) [![Gem Version](https://badge.fury.io/rb/dragonfly-mongoid_data_store.svg)](http://badge.fury.io/rb/dragonfly-mongoid_data_store) [![Coverage Status](https://img.shields.io/coveralls/tomasc/dragonfly-mongoid_data_store.svg)](https://coveralls.io/r/tomasc/dragonfly-mongoid_data_store)
4
4
 
5
5
  [Dragonfly](https://github.com/markevans/dragonfly) data store that uses [Mongoid::GridFs](https://github.com/ahoward/mongoid-grid_fs).
6
6
 
@@ -19,12 +19,13 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'dragonfly', '~> 1.0'
22
- spec.add_dependency 'mongoid', '>= 5', '< 8'
23
- spec.add_dependency 'mongoid-grid_fs', '~> 2.4', '>= 2.4.0'
22
+ spec.add_dependency 'mongoid'
23
+ spec.add_dependency 'mongoid-grid_fs', '>= 2.4.0'
24
24
 
25
+ spec.add_development_dependency 'appraisal'
25
26
  spec.add_development_dependency 'bundler'
26
27
  spec.add_development_dependency 'coveralls'
27
- spec.add_development_dependency 'database_cleaner', '>= 1.5.1'
28
+ spec.add_development_dependency 'database_cleaner-mongoid'
28
29
  spec.add_development_dependency 'guard'
29
30
  spec.add_development_dependency 'guard-minitest'
30
31
  spec.add_development_dependency 'minitest'
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "mongoid", "~> 6.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "mongoid", "~> 7.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "mongoid", "~> 8.0"
6
+
7
+ gemspec path: "../"
@@ -1,5 +1,5 @@
1
1
  module Dragonfly
2
2
  class MongoidDataStore
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
5
5
  end
@@ -14,25 +14,25 @@ describe Dragonfly::MongoidDataStore do
14
14
  it 'stores the data in the database' do
15
15
  uid = data_store.write(content)
16
16
  response = Mongoid::GridFS.get(uid)
17
- response.data.must_equal content.data
17
+ _(response.data).must_equal content.data
18
18
  end
19
19
 
20
20
  it 'stores default mime type' do
21
21
  uid = data_store.write(content)
22
22
  response = Mongoid::GridFS.get(uid)
23
- response.content_type.must_equal 'application/octet-stream'
23
+ _(response.content_type).must_equal 'application/octet-stream'
24
24
  end
25
25
 
26
26
  it 'stores supplied mime type' do
27
27
  uid = data_store.write(content, content_type: 'text/plain')
28
28
  response = Mongoid::GridFS.get(uid)
29
- response.content_type.must_equal 'text/plain'
29
+ _(response.content_type).must_equal 'text/plain'
30
30
  end
31
31
 
32
32
  it 'stores additional meta data' do
33
33
  uid = data_store.write(content, meta: meta)
34
34
  response = Mongoid::GridFS.get(uid)
35
- marshal_b64_decode(response.meta)[:my_meta].must_equal meta[:my_meta]
35
+ _(marshal_b64_decode(response.meta)[:my_meta]).must_equal meta[:my_meta]
36
36
  end
37
37
  end
38
38
 
@@ -43,15 +43,15 @@ describe Dragonfly::MongoidDataStore do
43
43
  end
44
44
 
45
45
  it 'retrieves the file' do
46
- @result.first.must_equal content.data
46
+ _(@result.first).must_equal content.data
47
47
  end
48
48
 
49
49
  it 'retrieves meta data' do
50
- @result.last.must_equal meta
50
+ _(@result.last).must_equal meta
51
51
  end
52
52
 
53
53
  it 'raises DataNotFound when file does not exist' do
54
- proc { data_store.read(BSON::ObjectId.new) }.must_raise Dragonfly::MongoidDataStore::DataNotFound
54
+ _(proc { data_store.read(BSON::ObjectId.new) }).must_raise Dragonfly::MongoidDataStore::DataNotFound
55
55
  end
56
56
  end
57
57
 
@@ -62,8 +62,8 @@ describe Dragonfly::MongoidDataStore do
62
62
 
63
63
  it 'destroys data in the database' do
64
64
  res = data_store.destroy(@stored_content.id)
65
- res.must_equal true
66
- Mongoid::GridFS.find(_id: @stored_content.id).must_be_nil
65
+ _(res).must_equal true
66
+ _(Mongoid::GridFS.find(_id: @stored_content.id)).must_be_nil
67
67
  end
68
68
  end
69
69
  end
data/test/test_helper.rb CHANGED
@@ -4,7 +4,7 @@ require 'minitest/autorun'
4
4
  require 'minitest/spec'
5
5
  require 'dragonfly/mongoid_data_store'
6
6
  require 'rubygems'
7
- require 'database_cleaner'
7
+ require 'database_cleaner/mongoid'
8
8
 
9
9
  if ENV['CI']
10
10
  require 'coveralls'
@@ -15,10 +15,7 @@ Mongoid.configure do |config|
15
15
  config.connect_to('dragonfly-mongoid_data_store_test')
16
16
  end
17
17
 
18
- DatabaseCleaner.orm = :mongoid
19
- DatabaseCleaner.strategy = :truncation
20
-
21
- class MiniTest::Spec
18
+ class Minitest::Spec
22
19
  before(:each) { DatabaseCleaner.start }
23
20
  after(:each) { DatabaseCleaner.clean }
24
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly-mongoid_data_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dragonfly
@@ -30,27 +30,18 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '5'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '8'
33
+ version: '0'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - ">="
42
39
  - !ruby/object:Gem::Version
43
- version: '5'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '8'
40
+ version: '0'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: mongoid-grid_fs
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '2.4'
54
45
  - - ">="
55
46
  - !ruby/object:Gem::Version
56
47
  version: 2.4.0
@@ -58,12 +49,23 @@ dependencies:
58
49
  prerelease: false
59
50
  version_requirements: !ruby/object:Gem::Requirement
60
51
  requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '2.4'
64
52
  - - ">="
65
53
  - !ruby/object:Gem::Version
66
54
  version: 2.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: appraisal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
67
69
  - !ruby/object:Gem::Dependency
68
70
  name: bundler
69
71
  requirement: !ruby/object:Gem::Requirement
@@ -93,19 +95,19 @@ dependencies:
93
95
  - !ruby/object:Gem::Version
94
96
  version: '0'
95
97
  - !ruby/object:Gem::Dependency
96
- name: database_cleaner
98
+ name: database_cleaner-mongoid
97
99
  requirement: !ruby/object:Gem::Requirement
98
100
  requirements:
99
101
  - - ">="
100
102
  - !ruby/object:Gem::Version
101
- version: 1.5.1
103
+ version: '0'
102
104
  type: :development
103
105
  prerelease: false
104
106
  version_requirements: !ruby/object:Gem::Requirement
105
107
  requirements:
106
108
  - - ">="
107
109
  - !ruby/object:Gem::Version
108
- version: 1.5.1
110
+ version: '0'
109
111
  - !ruby/object:Gem::Dependency
110
112
  name: guard
111
113
  requirement: !ruby/object:Gem::Requirement
@@ -169,8 +171,9 @@ executables: []
169
171
  extensions: []
170
172
  extra_rdoc_files: []
171
173
  files:
174
+ - ".github/workflows/test.yml"
172
175
  - ".gitignore"
173
- - ".travis.yml"
176
+ - Appraisals
174
177
  - CHANGELOG.md
175
178
  - Gemfile
176
179
  - Guardfile
@@ -179,6 +182,9 @@ files:
179
182
  - README.md
180
183
  - Rakefile
181
184
  - dragonfly-mongoid_data_store.gemspec
185
+ - gemfiles/6.gemfile
186
+ - gemfiles/7.gemfile
187
+ - gemfiles/8.gemfile
182
188
  - lib/dragonfly/mongoid_data_store.rb
183
189
  - lib/dragonfly/mongoid_data_store/version.rb
184
190
  - test/dragonfly/mongoid_data_store_test.rb
@@ -187,7 +193,7 @@ homepage: https://github.com/tomasc/dragonfly-mongoid_data_store
187
193
  licenses:
188
194
  - MIT
189
195
  metadata: {}
190
- post_install_message:
196
+ post_install_message:
191
197
  rdoc_options: []
192
198
  require_paths:
193
199
  - lib
@@ -202,9 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
208
  - !ruby/object:Gem::Version
203
209
  version: '0'
204
210
  requirements: []
205
- rubyforge_project:
206
- rubygems_version: 2.7.6
207
- signing_key:
211
+ rubygems_version: 3.3.14
212
+ signing_key:
208
213
  specification_version: 4
209
214
  summary: Dragonfly data store that uses Mongoid::GridFs.
210
215
  test_files:
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- script: 'bundle exec rake'
4
- rvm:
5
- - 2.2.5
6
- services:
7
- - mongodb
8
-
9
- notifications:
10
- email:
11
- recipients:
12
- - tomas.celizna@gmail.com
13
- on_failure: change
14
- on_success: never
15
-
16
- matrix:
17
- include:
18
- - rvm: 2.3.3
19
- env: MONGOID_VERSION=5
20
- - rvm: 2.3.3
21
- env: MONGOID_VERSION=6
22
- - rvm: 2.5.0
23
- env: MONGOID_VERSION=7