mongoid-grid_fs 2.1.0 → 2.2.0

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: 50ce3ab62fcedb405803f4d0559206c7b62fedf9
4
- data.tar.gz: f8d76bda2fed5f76abd57d97a3f797237a302488
3
+ metadata.gz: 95f8cd9624c2a5a98edc6d4e2865de77281ea4ff
4
+ data.tar.gz: fae59ebb9cf9b1a3cdec177f8fc40188aef59867
5
5
  SHA512:
6
- metadata.gz: 36a7ad8f5c12467c5f8cd8b074de01aa6cf7ce1a193a08269386749ca40fd6303483a228c94c3567b42560004b00902241309deba5818908723cf79f276c80cb
7
- data.tar.gz: 346ce4a4b25578d1acf2aec839dede4a4c01f131d1854919a020896132b2cef13245691c675fe7e206964cba99193501da8166626548c0e0056318940ae79866
6
+ metadata.gz: 7269e19863de29ae7a52a297e10b3444d8c8e8caf9f953c9aa950de4ab8ea2629080669108fb309c297f13e603c5dd8ffe9c2e6fd6a43bb6294a02554fef14b7
7
+ data.tar.gz: dc06a72417f96b7507f8db8e8e37cc3ecf28ddc04d74c2f77ea389df27726d885a160ba2104c27b654dfe8b2be04391f4fa91461f25546d05b112088565e730e
data/README.md CHANGED
@@ -1,35 +1,42 @@
1
- NAME
1
+ mongoid-grid_fs [![Gem Version](http://img.shields.io/gem/v/mongoid-grid_fs.svg)](https://rubygems.org/gems/mongoid-grid_fs) [![Build Status](https://travis-ci.org/ahoward/mongoid-grid_fs.svg)](https://travis-ci.org/ahoward/mongoid-grid_fs)
2
2
  ----
3
- mongoid-grid_fs
3
+
4
+ A pure Mongoid/Moped implementation of the MongoDB GridFS specification
4
5
 
5
6
  INSTALL
6
7
  -------
7
- gem install mongoid-grid_fs
8
+
9
+ ```
10
+ gem install mongoid-grid_fs
11
+ ```
12
+
8
13
 
9
14
  SYNOPSIS
10
15
  --------
11
- ```ruby
12
- require 'mongoid-grid_fs'
13
16
 
14
- grid_fs = Mongoid::GridFs
17
+ ```ruby
18
+ require 'mongoid/grid_fs'
15
19
 
16
- g = grid_fs.put(readable)
20
+ grid_fs = Mongoid::GridFs
21
+ f = grid_fs.put(readable)
17
22
 
18
- id = g.id
23
+ grid_fs.get(f.id)
24
+ grid_fs.delete(f.id)
19
25
 
20
- grid_fs.get(id)
26
+ g = grid_fs.get(f.id)
27
+ g.data # big huge blob
28
+ g.each { |chunk| file.write(chunk) } # streaming write
21
29
 
22
- grid_fs.delete(id)
23
30
  ```
24
31
 
25
32
  DESCRIPTION
26
33
  -----------
27
- mongoid_grid_fs is a pure mongoid 3 / moped implementation of the mongodb
28
- grid_fs specification
29
34
 
30
- ref: http://docs.mongodb.org/manual/reference/gridfs/
35
+ mongoid_grid_fs is A pure Mongoid/Moped implementation of the MongoDB GridFS specification
31
36
 
32
- it has the following features:
37
+ Reference: http://docs.mongodb.org/manual/reference/gridfs/
38
+
39
+ It has the following features:
33
40
 
34
41
  - implementation is on top of mongoid for portability. moped (the driver) is
35
42
  barely used, so the library should be quite durable except in the face of
@@ -48,19 +55,18 @@ it has the following features:
48
55
  - [] and []= methods which allow the grid to be used like a giant file
49
56
  hash in the sky
50
57
 
51
- - supprt for data_uris, like a html5 boss
52
- ````erb
58
+ - support for data_uris, like a html5 boss
53
59
 
60
+ ```erb
54
61
  <%= image_tag :src => file.data_uri %>
55
-
56
- ````
62
+ ```
57
63
 
58
64
  CONTRIBUTING
59
65
  ------------
60
66
 
61
67
  ```
62
- $ bundle
63
- $ rake test
68
+ $ bundle install
69
+ $ bundle exec rake test
64
70
  ```
65
71
 
66
72
  LICENSE
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
+ require "bundler/setup"
2
3
  require "rake/testtask"
3
4
 
4
5
  Rake::TestTask.new(:test) do |t|
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  class GridFs
3
- VERSION = "2.1.0"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
data/test/helper.rb CHANGED
@@ -20,4 +20,6 @@ Mongoid.configure do |config|
20
20
  end
21
21
 
22
22
  # Avoid annoying deprecation warning
23
- I18n.enforce_available_locales = false
23
+ if I18n.respond_to?(:enforce_available_locales=)
24
+ I18n.enforce_available_locales = false
25
+ end
@@ -69,7 +69,7 @@ Testing Mongoid::GridFs do
69
69
  id = assert{ GridFs::File.last.id }
70
70
  g = assert{ GridFs.get(id) }
71
71
  assert{ GridFs.delete(id) }
72
- assert_raises( Mongoid::Errors::DocumentNotFound){ GridFs.get(id) }
72
+ assert_raises(Mongoid::Errors::DocumentNotFound){ GridFs.get(id) }
73
73
  end
74
74
 
75
75
  end
data/test/testing.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
- require 'test/unit'
2
+ require 'minitest/autorun'
3
3
 
4
4
  testdir = File.expand_path(File.dirname(__FILE__))
5
5
  rootdir = File.dirname(testdir)
@@ -21,7 +21,7 @@ class Testing
21
21
  new(words.join('-').downcase)
22
22
  end
23
23
  end
24
-
24
+
25
25
  class Context
26
26
  attr_accessor :name
27
27
 
@@ -36,7 +36,8 @@ class Testing
36
36
  end
37
37
 
38
38
  def Testing(*args, &block)
39
- Class.new(::Test::Unit::TestCase) do
39
+ Class.new(::Minitest::Test) do
40
+ i_suck_and_my_tests_are_order_dependent!
40
41
 
41
42
  ## class methods
42
43
  #
@@ -133,7 +134,7 @@ def Testing(*args, &block)
133
134
  if block
134
135
  label = "assert(#{ args.join(' ') })"
135
136
  result = nil
136
- assert_nothing_raised{ result = block.call }
137
+ result = block.call
137
138
  __assert__(result, label)
138
139
  result
139
140
  else
@@ -175,7 +176,7 @@ def Testing(*args, &block)
175
176
  self.setup()
176
177
  self.prepare.each{|b| b.call()}
177
178
 
178
- at_exit{
179
+ at_exit{
179
180
  self.teardown()
180
181
  self.cleanup.each{|b| b.call()}
181
182
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-grid_fs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ara T. Howard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -17,9 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
- - - "<"
20
+ - - "<="
21
21
  - !ruby/object:Gem::Version
22
- version: '5.0'
22
+ version: '6.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +27,9 @@ dependencies:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.0'
30
- - - "<"
30
+ - - "<="
31
31
  - !ruby/object:Gem::Version
32
- version: '5.0'
32
+ version: '6.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: mime-types
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,6 +50,26 @@ dependencies:
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '3.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: minitest
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 5.7.0
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '6.0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 5.7.0
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '6.0'
53
73
  description: A pure Mongoid/Moped implementation of the MongoDB GridFS specification
54
74
  email:
55
75
  - ara.t.howard@gmail.com
@@ -89,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
109
  version: '0'
90
110
  requirements: []
91
111
  rubyforge_project:
92
- rubygems_version: 2.2.2
112
+ rubygems_version: 2.4.8
93
113
  signing_key:
94
114
  specification_version: 4
95
115
  summary: A MongoDB GridFS implementation for Mongoid