has_media 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,11 @@ Easy way to link media (ie image, audio, pdf for now) on other activerecords mod
20
20
 
21
21
  has_one_medium :pdf, :encode => false
22
22
 
23
+ == Model and Uploaders
24
+
25
+ You must defined model and uploader with the name given in the only option
26
+ Examples are in the /examples directory...
27
+
23
28
  == Configuration
24
29
 
25
30
  * Set custom uploaders/models path to overload has_media ones
@@ -34,6 +39,19 @@ Easy way to link media (ie image, audio, pdf for now) on other activerecords mod
34
39
  * Set custom error messages
35
40
  HasMedia.errors_messages = {:type_error => I18n.t('has_media.errors.type_error')}
36
41
 
42
+ == Testing
43
+
44
+ Factory example using factory_girl :
45
+
46
+ Factory.define :image, :class => Image do |f|
47
+ f.content_type 'image/jpeg'
48
+ f.filename 'image.jpg'
49
+ f.status 'accepted'
50
+ f.encode_status 0
51
+ f.add_attribute :context, 'images'
52
+ f.file {ActionController::TestUploadedFile.new(File.join(Rails.root, '/spec/factories/image.jpg'), 'image/jpeg')}
53
+ end
54
+
37
55
  == TODO
38
56
 
39
57
  * Add a video class
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.1.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_media
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - klacointe
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-04-06 00:00:00 +02:00
13
+ date: 2010-04-16 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -69,19 +69,19 @@ files:
69
69
  - README.rdoc
70
70
  - Rakefile
71
71
  - VERSION
72
+ - examples/models/audio.rb
73
+ - examples/models/image.rb
74
+ - examples/models/pdf.rb
75
+ - examples/uploaders/audio_uploader.rb
76
+ - examples/uploaders/image_uploader.rb
77
+ - examples/uploaders/pdf_uploader.rb
72
78
  - generators/has_media/has_media_generator.rb
73
79
  - generators/has_media/templates/create_media.rb
74
80
  - generators/has_media/templates/create_media_links.rb
75
81
  - lib/has_media.rb
76
- - lib/has_media/models/audio.rb
77
- - lib/has_media/models/image.rb
78
82
  - lib/has_media/models/media_link.rb
79
83
  - lib/has_media/models/medium.rb
80
- - lib/has_media/models/pdf.rb
81
- - lib/has_media/uploaders/audio_uploader.rb
82
- - lib/has_media/uploaders/image_uploader.rb
83
84
  - lib/has_media/uploaders/medium_uploader.rb
84
- - lib/has_media/uploaders/pdf_uploader.rb
85
85
  - spec/fixtures/media/Conversational_Capital _Explained.pdf
86
86
  - spec/fixtures/media/audio.wav
87
87
  - spec/fixtures/media/image.jpg
@@ -125,3 +125,9 @@ test_files:
125
125
  - spec/fixtures/models/image.rb
126
126
  - spec/fixtures/uploaders/uploader_with_exception.rb
127
127
  - spec/has_media_spec.rb
128
+ - examples/models/pdf.rb
129
+ - examples/models/image.rb
130
+ - examples/models/audio.rb
131
+ - examples/uploaders/image_uploader.rb
132
+ - examples/uploaders/pdf_uploader.rb
133
+ - examples/uploaders/audio_uploader.rb