has_media 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/lib/has_media.rb +1 -13
- data/spec/has_media_spec.rb +0 -6
- metadata +22 -45
data/README.rdoc
CHANGED
@@ -22,8 +22,8 @@ Easy way to link media (ie image, audio, pdf for now) on other activerecords mod
|
|
22
22
|
|
23
23
|
== Configuration
|
24
24
|
|
25
|
-
* Set custom uploaders path to overload has_media ones
|
26
|
-
HasMedia.
|
25
|
+
* Set custom uploaders/models path to overload has_media ones
|
26
|
+
HasMedia.custom_models_path = File.dirname(__FILE__) + '/../../app/models/has_media'
|
27
27
|
|
28
28
|
* Set the directory path to use to store media
|
29
29
|
HasMedia.directory_path = "media"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
data/lib/has_media.rb
CHANGED
@@ -9,7 +9,6 @@ module HasMedia
|
|
9
9
|
|
10
10
|
@@store_dir = '/tmp'
|
11
11
|
@@directory_uri = ''
|
12
|
-
@@custom_uploaders_path = nil
|
13
12
|
@@custom_models_path = nil
|
14
13
|
@@errors_messages = {:type_error => 'Wrong type'}
|
15
14
|
@@images_content_types = [
|
@@ -56,28 +55,17 @@ module HasMedia
|
|
56
55
|
def self.directory_uri
|
57
56
|
@@directory_uri
|
58
57
|
end
|
59
|
-
def self.custom_uploaders_path=(value)
|
60
|
-
unless value.blank?
|
61
|
-
@@custom_uploaders_path = value
|
62
|
-
Dir.glob(self.custom_uploaders_path + '*.rb').each do |uploader|
|
63
|
-
require uploader
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
58
|
def self.custom_models_path
|
68
59
|
@@custom_models_path
|
69
60
|
end
|
70
61
|
def self.custom_models_path=(value)
|
71
62
|
unless value.blank?
|
72
63
|
@@custom_models_path = value
|
73
|
-
Dir.glob(self.custom_models_path + '
|
64
|
+
Dir.glob(self.custom_models_path + '/*.rb').each do |model|
|
74
65
|
require model
|
75
66
|
end
|
76
67
|
end
|
77
68
|
end
|
78
|
-
def self.custom_uploaders_path
|
79
|
-
@@custom_uploaders_path
|
80
|
-
end
|
81
69
|
# taken from http://github.com/technoweenie/attachment_fu/blob/master/lib/technoweenie/attachment_fu.rb
|
82
70
|
def self.images_content_types
|
83
71
|
@@images_content_types
|
data/spec/has_media_spec.rb
CHANGED
@@ -163,12 +163,6 @@ describe "HasMedia" do
|
|
163
163
|
@medium.errors.full_messages.include?(HasMedia.errors_messages[:type_error])
|
164
164
|
end
|
165
165
|
|
166
|
-
it "should load custom uploaders" do
|
167
|
-
lambda {
|
168
|
-
HasMedia.custom_uploaders_path = File.join(File.dirname(__FILE__), 'fixtures/uploaders/')
|
169
|
-
}.should raise_error(RuntimeError, "this exception is normal, useful for testing")
|
170
|
-
end
|
171
|
-
|
172
166
|
it "should load custom models" do
|
173
167
|
lambda {
|
174
168
|
HasMedia.custom_models_path = File.join(File.dirname(__FILE__), 'fixtures/models/')
|
metadata
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_media
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 8
|
9
|
-
version: 0.0.8
|
4
|
+
version: 0.0.9
|
10
5
|
platform: ruby
|
11
6
|
authors:
|
12
7
|
- klacointe
|
@@ -15,65 +10,49 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2010-04-
|
13
|
+
date: 2010-04-06 00:00:00 +02:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
22
17
|
name: rspec
|
23
|
-
|
24
|
-
|
18
|
+
type: :development
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
21
|
requirements:
|
26
22
|
- - ">="
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 1
|
30
|
-
- 2
|
31
|
-
- 9
|
32
24
|
version: 1.2.9
|
33
|
-
|
34
|
-
version_requirements: *id001
|
25
|
+
version:
|
35
26
|
- !ruby/object:Gem::Dependency
|
36
27
|
name: carrierwave
|
37
|
-
|
38
|
-
|
28
|
+
type: :runtime
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
31
|
requirements:
|
40
32
|
- - ">="
|
41
33
|
- !ruby/object:Gem::Version
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
- 4
|
45
|
-
- 2
|
46
34
|
version: 0.4.2
|
47
|
-
|
48
|
-
version_requirements: *id002
|
35
|
+
version:
|
49
36
|
- !ruby/object:Gem::Dependency
|
50
37
|
name: activerecord
|
51
|
-
|
52
|
-
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
41
|
requirements:
|
54
42
|
- - ">="
|
55
43
|
- !ruby/object:Gem::Version
|
56
|
-
segments:
|
57
|
-
- 2
|
58
|
-
- 3
|
59
|
-
- 4
|
60
44
|
version: 2.3.4
|
61
|
-
|
62
|
-
version_requirements: *id003
|
45
|
+
version:
|
63
46
|
- !ruby/object:Gem::Dependency
|
64
47
|
name: activesupport
|
65
|
-
|
66
|
-
|
48
|
+
type: :runtime
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
51
|
requirements:
|
68
52
|
- - ">="
|
69
53
|
- !ruby/object:Gem::Version
|
70
|
-
segments:
|
71
|
-
- 2
|
72
|
-
- 3
|
73
|
-
- 4
|
74
54
|
version: 2.3.4
|
75
|
-
|
76
|
-
version_requirements: *id004
|
55
|
+
version:
|
77
56
|
description: Media Managment Library for ActiveRecord and Carrierwave
|
78
57
|
email: kevinlacointe@gmail.com
|
79
58
|
executables: []
|
@@ -126,25 +105,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
105
|
requirements:
|
127
106
|
- - ">="
|
128
107
|
- !ruby/object:Gem::Version
|
129
|
-
segments:
|
130
|
-
- 0
|
131
108
|
version: "0"
|
109
|
+
version:
|
132
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
111
|
requirements:
|
134
112
|
- - ">="
|
135
113
|
- !ruby/object:Gem::Version
|
136
|
-
segments:
|
137
|
-
- 0
|
138
114
|
version: "0"
|
115
|
+
version:
|
139
116
|
requirements: []
|
140
117
|
|
141
118
|
rubyforge_project:
|
142
|
-
rubygems_version: 1.3.
|
119
|
+
rubygems_version: 1.3.5
|
143
120
|
signing_key:
|
144
121
|
specification_version: 3
|
145
122
|
summary: Media Managment Library for ActiveRecord and Carrierwave
|
146
123
|
test_files:
|
147
124
|
- spec/spec_helper.rb
|
148
|
-
- spec/fixtures/uploaders/uploader_with_exception.rb
|
149
125
|
- spec/fixtures/models/image.rb
|
126
|
+
- spec/fixtures/uploaders/uploader_with_exception.rb
|
150
127
|
- spec/has_media_spec.rb
|