active_record_content_blob 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +99 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/active_record_content_blob.rb +6 -0
- data/lib/content_blob/blobable.rb +59 -0
- data/lib/content_blob.rb +11 -0
- data/lib/generators/content_blob/content_blob_generator.rb +27 -0
- data/lib/generators/content_blob/templates/create_content_blobs.rb +16 -0
- data/spec/spec_helper.rb +67 -0
- data/spec/unit/blobable_spec.rb +87 -0
- data/spec/unit/content_blob_spec.rb +30 -0
- metadata +210 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem "rspec", "~> 2.14.0"
|
5
|
+
gem "bundler"
|
6
|
+
gem "jeweler", "~> 1.8.4"
|
7
|
+
gem 'database_cleaner'
|
8
|
+
gem "pry"
|
9
|
+
gem "rdoc", "~> 3.12"
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
gem 'sqlite3'
|
14
|
+
gem 'activesupport', ">=3.2.12"
|
15
|
+
gem 'activerecord', ">=3.2.12"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (4.0.0)
|
5
|
+
activesupport (= 4.0.0)
|
6
|
+
builder (~> 3.1.0)
|
7
|
+
activerecord (4.0.0)
|
8
|
+
activemodel (= 4.0.0)
|
9
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
10
|
+
activesupport (= 4.0.0)
|
11
|
+
arel (~> 4.0.0)
|
12
|
+
activerecord-deprecated_finders (1.0.3)
|
13
|
+
activesupport (4.0.0)
|
14
|
+
i18n (~> 0.6, >= 0.6.4)
|
15
|
+
minitest (~> 4.2)
|
16
|
+
multi_json (~> 1.3)
|
17
|
+
thread_safe (~> 0.1)
|
18
|
+
tzinfo (~> 0.3.37)
|
19
|
+
addressable (2.3.5)
|
20
|
+
arel (4.0.0)
|
21
|
+
atomic (1.1.12)
|
22
|
+
builder (3.1.4)
|
23
|
+
coderay (1.0.9)
|
24
|
+
database_cleaner (1.1.1)
|
25
|
+
diff-lcs (1.2.4)
|
26
|
+
faraday (0.8.8)
|
27
|
+
multipart-post (~> 1.2.0)
|
28
|
+
git (1.2.5)
|
29
|
+
github_api (0.10.1)
|
30
|
+
addressable
|
31
|
+
faraday (~> 0.8.1)
|
32
|
+
hashie (>= 1.2)
|
33
|
+
multi_json (~> 1.4)
|
34
|
+
nokogiri (~> 1.5.2)
|
35
|
+
oauth2
|
36
|
+
hashie (2.0.5)
|
37
|
+
highline (1.6.19)
|
38
|
+
httpauth (0.2.0)
|
39
|
+
i18n (0.6.4)
|
40
|
+
jeweler (1.8.6)
|
41
|
+
builder
|
42
|
+
bundler (~> 1.0)
|
43
|
+
git (>= 1.2.5)
|
44
|
+
github_api (= 0.10.1)
|
45
|
+
highline (>= 1.6.15)
|
46
|
+
nokogiri (= 1.5.10)
|
47
|
+
rake
|
48
|
+
rdoc
|
49
|
+
json (1.8.0)
|
50
|
+
jwt (0.1.8)
|
51
|
+
multi_json (>= 1.5)
|
52
|
+
method_source (0.8.2)
|
53
|
+
minitest (4.7.5)
|
54
|
+
multi_json (1.7.8)
|
55
|
+
multi_xml (0.5.5)
|
56
|
+
multipart-post (1.2.0)
|
57
|
+
nokogiri (1.5.10)
|
58
|
+
oauth2 (0.9.2)
|
59
|
+
faraday (~> 0.8)
|
60
|
+
httpauth (~> 0.2)
|
61
|
+
jwt (~> 0.1.4)
|
62
|
+
multi_json (~> 1.0)
|
63
|
+
multi_xml (~> 0.5)
|
64
|
+
rack (~> 1.2)
|
65
|
+
pry (0.9.12.2)
|
66
|
+
coderay (~> 1.0.5)
|
67
|
+
method_source (~> 0.8)
|
68
|
+
slop (~> 3.4)
|
69
|
+
rack (1.5.2)
|
70
|
+
rake (10.1.0)
|
71
|
+
rdoc (3.12.2)
|
72
|
+
json (~> 1.4)
|
73
|
+
rspec (2.14.1)
|
74
|
+
rspec-core (~> 2.14.0)
|
75
|
+
rspec-expectations (~> 2.14.0)
|
76
|
+
rspec-mocks (~> 2.14.0)
|
77
|
+
rspec-core (2.14.4)
|
78
|
+
rspec-expectations (2.14.0)
|
79
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
80
|
+
rspec-mocks (2.14.2)
|
81
|
+
slop (3.4.6)
|
82
|
+
sqlite3 (1.3.7)
|
83
|
+
thread_safe (0.1.2)
|
84
|
+
atomic
|
85
|
+
tzinfo (0.3.37)
|
86
|
+
|
87
|
+
PLATFORMS
|
88
|
+
ruby
|
89
|
+
|
90
|
+
DEPENDENCIES
|
91
|
+
activerecord (>= 3.2.12)
|
92
|
+
activesupport (>= 3.2.12)
|
93
|
+
bundler
|
94
|
+
database_cleaner
|
95
|
+
jeweler (~> 1.8.4)
|
96
|
+
pry
|
97
|
+
rdoc (~> 3.12)
|
98
|
+
rspec (~> 2.14.0)
|
99
|
+
sqlite3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Dan Nguyen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= active_record_content_blob
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to active_record_content_blob
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2013 Dan Nguyen. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "active_record_content_blob"
|
18
|
+
gem.homepage = "http://github.com/dannguyen/active_record_content_blob"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Attach a TEXT/BLOB column to your model as a has_one}
|
21
|
+
gem.description = %Q{Loading up TEXT/BLOB columns can be slow}
|
22
|
+
gem.email = "dansonguyen@gmail.com"
|
23
|
+
gem.authors = ["Dan Nguyen"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rdoc/task'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "active_record_content_blob #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module ActiveRecordContentBlob
|
2
|
+
module Blobable
|
3
|
+
|
4
|
+
# This is what an ActiveRecord model includes if it wants to have a content_blob
|
5
|
+
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
included do
|
8
|
+
|
9
|
+
scope :has_blob, ->{joins(:content_blob)}
|
10
|
+
|
11
|
+
if self.instance_methods.include?(:contents) || self.column_names.include?('contents')
|
12
|
+
raise StandardError, "Cannot already have a :contents attribute or method"
|
13
|
+
end
|
14
|
+
|
15
|
+
has_one :content_blob, as: :blobable, dependent: :destroy
|
16
|
+
# TODO: allow customization of :contents name
|
17
|
+
# in case model already has a contents field
|
18
|
+
delegate :contents, to: :content_blob, allow_nil: true
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
module ClassMethods
|
23
|
+
|
24
|
+
# returns a new record with an attached blob
|
25
|
+
def build_with_blob(hsh, blob_content=nil)
|
26
|
+
hsh_syms = hsh.symbolize_keys
|
27
|
+
# delete a possible :content_blob so that we can initialize
|
28
|
+
# the record
|
29
|
+
|
30
|
+
record = self.new(hsh_syms.reject{|k,v| k == :contents})
|
31
|
+
|
32
|
+
if blob_content.nil?
|
33
|
+
# then build a blob only if hsh_syms has :content_blob key
|
34
|
+
if hsh_syms.key?(:contents)
|
35
|
+
blob_content = hsh_syms[:contents]
|
36
|
+
record.build_a_blob(blob_content)
|
37
|
+
end
|
38
|
+
else
|
39
|
+
# second argument is for the blo
|
40
|
+
record.build_a_blob(blob_content)
|
41
|
+
end
|
42
|
+
|
43
|
+
return record
|
44
|
+
end
|
45
|
+
|
46
|
+
def create_with_blob(hsh, blob_content=nil)
|
47
|
+
build_with_blob(hsh, blob_content).save
|
48
|
+
end
|
49
|
+
end # classmethods
|
50
|
+
|
51
|
+
## instance methods
|
52
|
+
def build_a_blob(some_content)
|
53
|
+
self.build_content_blob(contents: some_content)
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
data/lib/content_blob.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/migration'
|
3
|
+
require 'rails/generators/active_record'
|
4
|
+
|
5
|
+
class ContentBlobGenerator < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
|
8
|
+
desc "Creates the content_blobs table"
|
9
|
+
|
10
|
+
self.source_paths << File.join(File.dirname(__FILE__), 'templates')
|
11
|
+
|
12
|
+
def self.next_migration_number(path)
|
13
|
+
ActiveRecord::Generators::Base.next_migration_number(path)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_migration_files
|
17
|
+
create_migration_file_if_not_exist 'create_content_blobs'
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def create_migration_file_if_not_exist(file_name)
|
23
|
+
unless self.class.migration_exists?(File.dirname(File.expand_path("db/migrate/#{file_name}")), file_name)
|
24
|
+
migration_template "#{file_name}.rb", "db/migrate/#{file_name}.rb"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateContentBlobs < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :content_blobs do |t|
|
4
|
+
t.integer "blobable_id"
|
5
|
+
t.string "blobable_type"
|
6
|
+
t.text "contents", :limit => 2147483647
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :content_blobs, [:blobable_type, :blobable_id]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :content_blobs
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'active_record'
|
5
|
+
require 'database_cleaner'
|
6
|
+
require 'sqlite3'
|
7
|
+
|
8
|
+
require 'active_record_content_blob'
|
9
|
+
|
10
|
+
# Requires supporting files with custom matchers and macros, etc,
|
11
|
+
# in ./support/ and its subdirectories.
|
12
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
13
|
+
|
14
|
+
#DatabaseCleaner.strategy = :truncation
|
15
|
+
|
16
|
+
RSpec.configure do |config|
|
17
|
+
# Use color in STDOUT
|
18
|
+
config.color_enabled = true
|
19
|
+
|
20
|
+
# Use color not only in STDOUT but also in pagers and files
|
21
|
+
config.tty = true
|
22
|
+
|
23
|
+
# Use the specified formatter
|
24
|
+
config.formatter = :documentation # :progress, :html, :textmate
|
25
|
+
|
26
|
+
config.before(:each) do
|
27
|
+
DatabaseCleaner.start
|
28
|
+
end
|
29
|
+
config.after(:each) do
|
30
|
+
DatabaseCleaner.clean
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
ActiveRecord::Base.establish_connection(
|
35
|
+
:adapter => "sqlite3",
|
36
|
+
:database => ":memory:"
|
37
|
+
)
|
38
|
+
ActiveRecord::Migration.verbose = false
|
39
|
+
|
40
|
+
ActiveRecord::Schema.define do
|
41
|
+
create_table :content_blobs do |t|
|
42
|
+
t.integer "blobable_id"
|
43
|
+
t.string "blobable_type"
|
44
|
+
t.text "contents", :limit => 2147483647
|
45
|
+
t.timestamps
|
46
|
+
end
|
47
|
+
|
48
|
+
add_index :content_blobs, [:blobable_type, :blobable_id]
|
49
|
+
|
50
|
+
|
51
|
+
##############
|
52
|
+
create_table :music_records, :force => true do |t|
|
53
|
+
t.string :name
|
54
|
+
t.timestamps
|
55
|
+
end
|
56
|
+
|
57
|
+
create_table :bad_records, :force => true do |t|
|
58
|
+
t.string :namez
|
59
|
+
t.string :contents
|
60
|
+
t.timestamps
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class MusicRecord < ActiveRecord::Base
|
4
|
+
include Blobable
|
5
|
+
end
|
6
|
+
|
7
|
+
class BadRecord < ActiveRecord::Base; end
|
8
|
+
|
9
|
+
describe "Blobable" do
|
10
|
+
before(:each) do
|
11
|
+
DatabaseCleaner.clean
|
12
|
+
MusicRecord.delete_all
|
13
|
+
ContentBlob.delete_all
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should raise an error if a class has :contents as an actual field' do
|
17
|
+
expect{BadRecord.class_eval('include Blobable')}.to raise_error
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#build_a_blob' do
|
21
|
+
before(:each) do
|
22
|
+
@record = MusicRecord.new
|
23
|
+
@record.build_a_blob({'abc' => 123})
|
24
|
+
@record.save
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should have :blobable_id and :blobable_type' do
|
28
|
+
@blob = @record.content_blob
|
29
|
+
expect(@blob.blobable_id).to eq @record.id
|
30
|
+
expect(@blob.blobable_type).to eq 'MusicRecord'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should assign single argument to :contents' do
|
34
|
+
expect(@record.contents).to eq({'abc' => 123})
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should overwrite existing blob' do
|
38
|
+
@record.build_a_blob({'xyz'=>'999'})
|
39
|
+
expect(@record.content_blob.new_record?).to be_true
|
40
|
+
expect(@record.content_blob.valid?).to be_true
|
41
|
+
|
42
|
+
@record.save
|
43
|
+
|
44
|
+
@record = MusicRecord.find(@record.id)
|
45
|
+
expect(@record.contents['xyz']).to eq '999'
|
46
|
+
|
47
|
+
expect(ContentBlob.count).to eq 1
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe 'class convenience method ::build_with_blob' do
|
52
|
+
context 'one argument' do
|
53
|
+
it 'should build associated content_blob with Hash :contents' do
|
54
|
+
@record = MusicRecord.build_with_blob({name: 'X', contents: [1]})
|
55
|
+
expect(@record.contents).to eq [1]
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'should build no content_blob without :contents' do
|
59
|
+
@record = MusicRecord.build_with_blob(name: 'X')
|
60
|
+
expect(@record.contents).to be_nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'second argument' do
|
65
|
+
it 'should use second argument as :contents for built blob' do
|
66
|
+
@record = MusicRecord.build_with_blob({name: 'A'}, [99])
|
67
|
+
expect(@record.contents).to eq [99]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'scopes' do
|
73
|
+
before(:each) do
|
74
|
+
@r1 = MusicRecord.create_with_blob(name: 'A', contents: ['Z'])
|
75
|
+
@r2 = MusicRecord.create(name: 'qqq')
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '::has_blob' do
|
79
|
+
it 'should only count records with associated content_blob' do
|
80
|
+
expect(MusicRecord.has_blob.count).to eq 1
|
81
|
+
expect(MusicRecord.has_blob.first.name).to eq 'A'
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'should not eager load content_blob'
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "ContentBlob" do
|
4
|
+
context 'standalone' do
|
5
|
+
before(:each) do
|
6
|
+
DatabaseCleaner.clean
|
7
|
+
end
|
8
|
+
|
9
|
+
context 'serialization' do
|
10
|
+
it 'should by default serialize @contents' do
|
11
|
+
@blob = ContentBlob.create(contents: [1,2,3])
|
12
|
+
expect(@blob.contents).to be_an Array
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'validation and scope' do
|
17
|
+
it 'should validate_uniqueness_of blobable_id and blobable_type' do
|
18
|
+
ContentBlob.create(blobable_id: 10, blobable_type: 'Hello')
|
19
|
+
@blob = ContentBlob.new(blobable_id: 10, blobable_type: 'Hello')
|
20
|
+
expect(@blob.valid?).to be_false
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'x' do
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
metadata
ADDED
@@ -0,0 +1,210 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: active_record_content_blob
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dan Nguyen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-08-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sqlite3
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: activesupport
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 3.2.12
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.2.12
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: activerecord
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.2.12
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.2.12
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.14.0
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.14.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: jeweler
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.8.4
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.8.4
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: database_cleaner
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: pry
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rdoc
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ~>
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '3.12'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '3.12'
|
158
|
+
description: Loading up TEXT/BLOB columns can be slow
|
159
|
+
email: dansonguyen@gmail.com
|
160
|
+
executables: []
|
161
|
+
extensions: []
|
162
|
+
extra_rdoc_files:
|
163
|
+
- LICENSE.txt
|
164
|
+
- README.rdoc
|
165
|
+
files:
|
166
|
+
- .document
|
167
|
+
- .rspec
|
168
|
+
- Gemfile
|
169
|
+
- Gemfile.lock
|
170
|
+
- LICENSE.txt
|
171
|
+
- README.rdoc
|
172
|
+
- Rakefile
|
173
|
+
- VERSION
|
174
|
+
- lib/active_record_content_blob.rb
|
175
|
+
- lib/content_blob.rb
|
176
|
+
- lib/content_blob/blobable.rb
|
177
|
+
- lib/generators/content_blob/content_blob_generator.rb
|
178
|
+
- lib/generators/content_blob/templates/create_content_blobs.rb
|
179
|
+
- spec/spec_helper.rb
|
180
|
+
- spec/unit/blobable_spec.rb
|
181
|
+
- spec/unit/content_blob_spec.rb
|
182
|
+
homepage: http://github.com/dannguyen/active_record_content_blob
|
183
|
+
licenses:
|
184
|
+
- MIT
|
185
|
+
post_install_message:
|
186
|
+
rdoc_options: []
|
187
|
+
require_paths:
|
188
|
+
- lib
|
189
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
190
|
+
none: false
|
191
|
+
requirements:
|
192
|
+
- - ! '>='
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
segments:
|
196
|
+
- 0
|
197
|
+
hash: -996606693736125422
|
198
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
|
+
none: false
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
requirements: []
|
205
|
+
rubyforge_project:
|
206
|
+
rubygems_version: 1.8.23
|
207
|
+
signing_key:
|
208
|
+
specification_version: 3
|
209
|
+
summary: Attach a TEXT/BLOB column to your model as a has_one
|
210
|
+
test_files: []
|