tb_media 1.0.3 → 1.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da2fc786f93beee53dff2d8a36f7d06c67511eba
4
- data.tar.gz: 391d08b38dec8f6ea1bc46437d24dc4eef8f847b
3
+ metadata.gz: e599f4b4028bbd60d0ffd260da07f780efbf275d
4
+ data.tar.gz: ed8b87939c2736898875f1b3e11c2af028f6f309
5
5
  SHA512:
6
- metadata.gz: 874c6eaf487f54776889f0cb6151b1e4fbd55813f583500b522498905104706e8c703dfbfd78584b74357c0f30fede6187565acf59c75a42e368672d92ffd4ac
7
- data.tar.gz: cddf0000c41571aac371bb99021f827caa40014046222e967a28ef39c122c50aa644fc537faa4b00649235cd7343735d73b709d426dabc518cf6631d72735078
6
+ metadata.gz: fc2b408053de8cfb801419c3ba72997440bb82da364ed7c195195fa56ffea30886448a72268d1f6fea73f6f2e3e10621bad1337ae0e6947d5dff67228d32017f
7
+ data.tar.gz: e7f7e50010f62c106520846b054c2bf20e46f6026790940908456da289ebb5418d4d06c07480906276263e372e2f4c65c0af6d4809c71c9a10e73586c6a54840
@@ -14,7 +14,9 @@ class SpudMedia < ActiveRecord::Base
14
14
 
15
15
  validates_numericality_of :crop_x, :crop_y, :crop_w, :crop_h, :crop_s, :allow_nil => true
16
16
 
17
- validates_attachment :attachment, :presence => true
17
+ validates_attachment :attachment,
18
+ :presence => true,
19
+ :content_type => {:content_type => Spud::Media::CONTENT_TYPES}
18
20
 
19
21
  before_create :rename_file
20
22
  #after_create :validate_permissions
@@ -0,0 +1,61 @@
1
+ module Spud
2
+ module Media
3
+ CONTENT_TYPES = [
4
+ # Microsoft
5
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
6
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
7
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
8
+ 'application/msword',
9
+ 'application/vnd.ms-excel',
10
+ 'application/vnd.ms-powerpoint',
11
+
12
+ # Documents
13
+ 'application/pdf',
14
+ 'text/html',
15
+ 'text/plain',
16
+ 'text/rtf',
17
+ 'application/xml',
18
+
19
+ # Archives
20
+ 'application/x-compressed',
21
+ 'application/x-tar',
22
+ 'application/x-gtar',
23
+ 'application/x-gzip',
24
+ 'application/zip',
25
+ 'application/gzip',
26
+ 'application/zip',
27
+
28
+ # Audio
29
+ 'audio/mp4',
30
+ 'audio/mpeg',
31
+ 'audio/ogg',
32
+ 'audio/vorbis',
33
+ 'audio/vnd.wave',
34
+ 'audio/webm',
35
+ 'audio/x-aiff',
36
+ 'audio/x-wav',
37
+
38
+ # Images
39
+ 'image/bmp',
40
+ 'image/gif',
41
+ 'image/jpeg',
42
+ 'image/png',
43
+ 'image/svg+xml',
44
+ 'image/tiff',
45
+
46
+ # Video
47
+ 'video/avi',
48
+ 'video/mpeg',
49
+ 'video/mp4',
50
+ 'video/ogg',
51
+ 'video/quicktime',
52
+ 'video/webm',
53
+ 'video/x-flv',
54
+
55
+ # Adobe
56
+ 'image/vnd.adobe.photoshop',
57
+ 'application/postscript',
58
+ 'application/x-shockwave-flash'
59
+ ]
60
+ end
61
+ end
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Media
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
data/lib/tb_media.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Spud
2
- module Media
3
- require 'spud_media/configuration'
4
- require 'spud_media/engine' if defined?(Rails)
5
- end
2
+ module Media
3
+ require 'spud_media/configuration'
4
+ require 'spud_media/content_types'
5
+ require 'spud_media/engine' if defined?(Rails)
6
+ end
6
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_media
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake Design
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-22 00:00:00.000000000 Z
11
+ date: 2014-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -254,6 +254,7 @@ files:
254
254
  - db/migrate/20120501203325_add_protected_to_spud_media.rb
255
255
  - db/migrate/20120508132153_add_cropping_to_spud_media.rb
256
256
  - lib/spud_media/configuration.rb
257
+ - lib/spud_media/content_types.rb
257
258
  - lib/spud_media/engine.rb
258
259
  - lib/spud_media/version.rb
259
260
  - lib/tasks/spud_media_tasks.rake