dragonfly-mogilefs 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,6 +30,7 @@ module EnMasse
30
30
  configurable_attr :readonly
31
31
  configurable_attr :db_backend
32
32
  configurable_attr :remote_url
33
+ configurable_attr :use_filesystem, true
33
34
 
34
35
  def initialize(options = {})
35
36
  self.hosts = options[:hosts]
@@ -44,10 +45,15 @@ module EnMasse
44
45
  def store(temp_object, options = {})
45
46
  meta = options[:meta] || {}
46
47
  uid = options[:key] || generate_uid(meta[:name] || temp_object.original_filename || 'file')
47
-
48
- temp_object.file do |fp|
49
- connection.store_file(uid, self.klass, fp)
48
+
49
+ if use_filesystem
50
+ temp_object.file do |fp|
51
+ connection.store_file(uid, self.klass, fp)
52
+ end
53
+ else
54
+ connection.store_file(uid, self.klass, temp_object.data)
50
55
  end
56
+
51
57
  store_meta_data(uid, meta)
52
58
 
53
59
  uid
@@ -79,7 +85,7 @@ module EnMasse
79
85
  @connection ||= ::MogileFS::MogileFS.new(options)
80
86
  end
81
87
 
82
- def url_for(uid)
88
+ def url_for(uid, options = {})
83
89
  "#{remote_url}/#{uid}"
84
90
  end
85
91
 
@@ -19,7 +19,7 @@
19
19
  module EnMasse
20
20
  module Dragonfly
21
21
  module MogileFS
22
- VERSION = "0.0.2"
22
+ VERSION = "0.0.3"
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,61 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dragonfly-mogilefs
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
4
5
  prerelease:
5
- version: 0.0.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Jamie Winsor
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-07-14 00:00:00 -07:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2011-09-18 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: dragonfly
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70168306079480 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0.9"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.9'
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: mogilefs-client
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70168306079480
25
+ - !ruby/object:Gem::Dependency
26
+ name: mogilefs-client
27
+ requirement: &70168306078980 !ruby/object:Gem::Requirement
31
28
  none: false
32
- requirements:
29
+ requirements:
33
30
  - - ~>
34
- - !ruby/object:Gem::Version
31
+ - !ruby/object:Gem::Version
35
32
  version: 2.2.0
36
33
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: rspec
40
34
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70168306078980
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &70168306078520 !ruby/object:Gem::Requirement
42
39
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
46
43
  version: 2.6.0
47
44
  type: :development
48
- version_requirements: *id003
45
+ prerelease: false
46
+ version_requirements: *70168306078520
49
47
  description: MogileFS Data Store for Dragonfly
50
- email:
48
+ email:
51
49
  - jamie@enmasse.com
52
50
  executables: []
53
-
54
51
  extensions: []
55
-
56
52
  extra_rdoc_files: []
57
-
58
- files:
53
+ files:
59
54
  - .gitignore
60
55
  - Gemfile
61
56
  - LICENSE
@@ -67,34 +62,30 @@ files:
67
62
  - lib/dragonfly-mogilefs/version.rb
68
63
  - spec/dragonfly-mogilefs/data_store_spec.rb
69
64
  - spec/spec_helper.rb
70
- has_rdoc: true
71
65
  homepage: https://github.com/enmasse-entertainment/dragonfly-mogilefs
72
66
  licenses: []
73
-
74
67
  post_install_message:
75
68
  rdoc_options: []
76
-
77
- require_paths:
69
+ require_paths:
78
70
  - lib
79
- required_ruby_version: !ruby/object:Gem::Requirement
71
+ required_ruby_version: !ruby/object:Gem::Requirement
80
72
  none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: "0"
85
- required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
78
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
91
83
  requirements: []
92
-
93
84
  rubyforge_project: dragonfly-mogilefs
94
- rubygems_version: 1.6.2
85
+ rubygems_version: 1.8.10
95
86
  signing_key:
96
87
  specification_version: 3
97
88
  summary: MogileFS Data Store for Dragonfly
98
- test_files:
89
+ test_files:
99
90
  - spec/dragonfly-mogilefs/data_store_spec.rb
100
91
  - spec/spec_helper.rb