carrierwave-neo4j 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -0
- data/README.md +1 -1
- data/carrierwave-neo4j.gemspec +1 -1
- data/lib/carrierwave/neo4j.rb +2 -2
- data/lib/carrierwave/neo4j/uploader_converter.rb +11 -5
- data/lib/carrierwave/neo4j/version.rb +1 -1
- data/spec/neo4j_spec.rb +2 -1
- data/spec/spec_helper.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eed0a17437d69669c72cecb206892b4ceb44b97f
|
4
|
+
data.tar.gz: 090b62247871e18da9c37b08fe2d500e93228bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 917b312423a7483035661b3550b2bb5377e260ebcb9c1ee034dfa9de38810250a461efa4856223df425d162de3fe3aa2da067cf70efe965fc181c8e2daa121f2
|
7
|
+
data.tar.gz: 6f98f2c765206a1a92e15ccd5ceb71f36259ba55fc98d1ebba6be98856ec88f4eef01cb4f0f3e7225069def15edb1ad1f62bf35869ec48d58c4023a730ac7545
|
data/Gemfile
CHANGED
@@ -3,4 +3,9 @@ source "http://rubygems.org"
|
|
3
3
|
# Specify your gem's dependencies in carrierwave_neo4j.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
gem 'neo4j', github: 'neo4jrb/neo4j'
|
7
|
+
gem 'neo4j-core', github: 'neo4jrb/neo4j-core'
|
8
|
+
#gem 'carrierwave', '0.10.0'
|
9
|
+
gem 'pry'
|
10
|
+
gem 'rspec-its'
|
6
11
|
gem 'database_cleaner', github: 'dpisarewski/database_cleaner', branch: 'neo4j'
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This gem adds support for Neo4j 3.0+ to CarrierWave, see the CarrierWave documen
|
|
7
7
|
Add to your Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'carrierwave-neo4j', require: 'carrierwave/neo4j'
|
10
|
+
gem 'carrierwave-neo4j', require: 'carrierwave/neo4j'
|
11
11
|
```
|
12
12
|
Use it like this:
|
13
13
|
|
data/carrierwave-neo4j.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
s.add_dependency("activesupport", ">= 3.0" )
|
22
|
-
s.add_dependency("neo4j", ">=
|
22
|
+
s.add_dependency("neo4j", ">= 3.0.0")
|
23
23
|
s.add_dependency("carrierwave", "~> 0.5")
|
24
24
|
s.add_development_dependency("rspec", "~> 2.0")
|
25
25
|
end
|
data/lib/carrierwave/neo4j.rb
CHANGED
@@ -26,6 +26,7 @@ module CarrierWave
|
|
26
26
|
|
27
27
|
after_save :"store_#{column}!"
|
28
28
|
before_save :"write_#{column}_identifier"
|
29
|
+
before_destroy :"clear_#{column}"
|
29
30
|
after_destroy :"remove_#{column}!"
|
30
31
|
|
31
32
|
class_eval <<-RUBY, __FILE__, __LINE__+1
|
@@ -41,8 +42,7 @@ module CarrierWave
|
|
41
42
|
super
|
42
43
|
end
|
43
44
|
|
44
|
-
def
|
45
|
-
super
|
45
|
+
def clear_#{column}
|
46
46
|
write_uploader(_mounter(:#{column}).serialization_column, nil)
|
47
47
|
end
|
48
48
|
|
@@ -18,9 +18,15 @@ module CarrierWave::Neo4j
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
21
|
+
def register_converter(mod)
|
22
|
+
mod::TypeConverters.send :include, CarrierWave::Neo4j::TypeConverters
|
23
|
+
end
|
25
24
|
|
26
|
-
|
25
|
+
major = Neo4j::VERSION.split('.').first.to_i
|
26
|
+
|
27
|
+
case major
|
28
|
+
when 1..2 then fail('Unsupported version of Neo4j gem. Please update it.')
|
29
|
+
when 3 then register_converter(Neo4j)
|
30
|
+
when 4 then register_converter(Neo4j::Shared)
|
31
|
+
when 5..Float::INFINITY then Neo4j::Shared::TypeConverters.register_converter(CarrierWave::Neo4j::TypeConverters::UploaderConverter)
|
32
|
+
end
|
data/spec/neo4j_spec.rb
CHANGED
@@ -116,8 +116,9 @@ describe CarrierWave::Neo4j do
|
|
116
116
|
end
|
117
117
|
|
118
118
|
it "also destroys the image" do
|
119
|
+
file_path = record.image.path
|
119
120
|
expect { record.destroy }.to change {
|
120
|
-
File.exist?
|
121
|
+
File.exist? file_path
|
121
122
|
}.from(true).to(false)
|
122
123
|
end
|
123
124
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-neo4j
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Navarro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 3.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 3.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: carrierwave
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project: carrierwave_neo4j
|
109
|
-
rubygems_version: 2.4.
|
109
|
+
rubygems_version: 2.4.6
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Neo4j support for Carrierwave
|