paperclip-hacked 2.3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/LICENSE +26 -0
  2. data/README.rdoc +179 -0
  3. data/Rakefile +103 -0
  4. data/generators/paperclip/USAGE +5 -0
  5. data/generators/paperclip/paperclip_generator.rb +27 -0
  6. data/generators/paperclip/templates/paperclip_migration.rb.erb +19 -0
  7. data/init.rb +1 -0
  8. data/lib/paperclip.rb +357 -0
  9. data/lib/paperclip/attachmenta.rb +334 -0
  10. data/lib/paperclip/callback_compatability.rb +33 -0
  11. data/lib/paperclip/geometry.rb +115 -0
  12. data/lib/paperclip/interpolations.rb +108 -0
  13. data/lib/paperclip/iostream.rb +59 -0
  14. data/lib/paperclip/matchers.rb +33 -0
  15. data/lib/paperclip/matchers/have_attached_file_matcher.rb +57 -0
  16. data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +75 -0
  17. data/lib/paperclip/matchers/validate_attachment_presence_matcher.rb +55 -0
  18. data/lib/paperclip/matchers/validate_attachment_size_matcher.rb +96 -0
  19. data/lib/paperclip/processor.rb +49 -0
  20. data/lib/paperclip/storage.rb +247 -0
  21. data/lib/paperclip/thumbnail.rb +75 -0
  22. data/lib/paperclip/upfile.rb +50 -0
  23. data/shoulda_macros/paperclip.rb +117 -0
  24. data/tasks/paperclip_tasks.rake +79 -0
  25. data/test/attachment_test.rb +764 -0
  26. data/test/database.yml +4 -0
  27. data/test/fixtures/12k.png +0 -0
  28. data/test/fixtures/50x50.png +0 -0
  29. data/test/fixtures/5k.png +0 -0
  30. data/test/fixtures/bad.png +1 -0
  31. data/test/fixtures/s3.yml +8 -0
  32. data/test/fixtures/text.txt +0 -0
  33. data/test/fixtures/twopage.pdf +0 -0
  34. data/test/geometry_test.rb +177 -0
  35. data/test/helper.rb +128 -0
  36. data/test/integration_test.rb +483 -0
  37. data/test/interpolations_test.rb +124 -0
  38. data/test/iostream_test.rb +78 -0
  39. data/test/matchers/have_attached_file_matcher_test.rb +24 -0
  40. data/test/matchers/validate_attachment_content_type_matcher_test.rb +37 -0
  41. data/test/matchers/validate_attachment_presence_matcher_test.rb +26 -0
  42. data/test/matchers/validate_attachment_size_matcher_test.rb +51 -0
  43. data/test/paperclip_test.rb +298 -0
  44. data/test/processor_test.rb +10 -0
  45. data/test/storage_test.rb +330 -0
  46. data/test/thumbnail_test.rb +227 -0
  47. data/test/upfile_test.rb +36 -0
  48. metadata +185 -0
@@ -0,0 +1,36 @@
1
+ require 'test/helper'
2
+
3
+ class UpfileTest < Test::Unit::TestCase
4
+ { %w(jpg jpe jpeg) => 'image/jpeg',
5
+ %w(tif tiff) => 'image/tiff',
6
+ %w(png) => 'image/png',
7
+ %w(gif) => 'image/gif',
8
+ %w(bmp) => 'image/bmp',
9
+ %w(txt) => 'text/plain',
10
+ %w(htm html) => 'text/html',
11
+ %w(csv) => 'text/csv',
12
+ %w(xml) => 'text/xml',
13
+ %w(css) => 'text/css',
14
+ %w(js) => 'application/js',
15
+ %w(foo) => 'application/x-foo'
16
+ }.each do |extensions, content_type|
17
+ extensions.each do |extension|
18
+ should "return a content_type of #{content_type} for a file with extension .#{extension}" do
19
+ file = stub('file', :path => "basename.#{extension}")
20
+ class << file
21
+ include Paperclip::Upfile
22
+ end
23
+
24
+ assert_equal content_type, file.content_type
25
+ end
26
+
27
+ should "return a content_type of text/plain on a real file whose content_type is determined with the file command" do
28
+ file = File.new(File.join(File.dirname(__FILE__), "..", "LICENSE"))
29
+ class << file
30
+ include Paperclip::Upfile
31
+ end
32
+ assert_equal 'text/plain', file.content_type
33
+ end
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: paperclip-hacked
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 3
8
+ - 1
9
+ - 1
10
+ version: 2.3.1.1
11
+ platform: ruby
12
+ authors:
13
+ - Jon Yurek
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2009-10-09 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: thoughtbot-shoulda
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :development
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: jferris-mocha
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ - 9
43
+ - 5
44
+ - 0
45
+ - 1241126838
46
+ version: 0.9.5.0.1241126838
47
+ type: :development
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: aws-s3
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ type: :development
60
+ version_requirements: *id003
61
+ - !ruby/object:Gem::Dependency
62
+ name: sqlite3-ruby
63
+ prerelease: false
64
+ requirement: &id004 !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ type: :development
72
+ version_requirements: *id004
73
+ - !ruby/object:Gem::Dependency
74
+ name: activerecord
75
+ prerelease: false
76
+ requirement: &id005 !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ segments:
81
+ - 0
82
+ version: "0"
83
+ type: :development
84
+ version_requirements: *id005
85
+ - !ruby/object:Gem::Dependency
86
+ name: activesupport
87
+ prerelease: false
88
+ requirement: &id006 !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ type: :development
96
+ version_requirements: *id006
97
+ description:
98
+ email: jyurek@thoughtbot.com
99
+ executables: []
100
+
101
+ extensions: []
102
+
103
+ extra_rdoc_files:
104
+ - README.rdoc
105
+ files:
106
+ - README.rdoc
107
+ - LICENSE
108
+ - Rakefile
109
+ - init.rb
110
+ - generators/paperclip/paperclip_generator.rb
111
+ - generators/paperclip/templates/paperclip_migration.rb.erb
112
+ - generators/paperclip/USAGE
113
+ - lib/paperclip/attachmenta.rb
114
+ - lib/paperclip/callback_compatability.rb
115
+ - lib/paperclip/geometry.rb
116
+ - lib/paperclip/interpolations.rb
117
+ - lib/paperclip/iostream.rb
118
+ - lib/paperclip/matchers/have_attached_file_matcher.rb
119
+ - lib/paperclip/matchers/validate_attachment_content_type_matcher.rb
120
+ - lib/paperclip/matchers/validate_attachment_presence_matcher.rb
121
+ - lib/paperclip/matchers/validate_attachment_size_matcher.rb
122
+ - lib/paperclip/matchers.rb
123
+ - lib/paperclip/processor.rb
124
+ - lib/paperclip/storage.rb
125
+ - lib/paperclip/thumbnail.rb
126
+ - lib/paperclip/upfile.rb
127
+ - lib/paperclip.rb
128
+ - tasks/paperclip_tasks.rake
129
+ - test/attachment_test.rb
130
+ - test/database.yml
131
+ - test/fixtures/12k.png
132
+ - test/fixtures/50x50.png
133
+ - test/fixtures/5k.png
134
+ - test/fixtures/bad.png
135
+ - test/fixtures/s3.yml
136
+ - test/fixtures/text.txt
137
+ - test/fixtures/twopage.pdf
138
+ - test/geometry_test.rb
139
+ - test/helper.rb
140
+ - test/integration_test.rb
141
+ - test/interpolations_test.rb
142
+ - test/iostream_test.rb
143
+ - test/matchers/have_attached_file_matcher_test.rb
144
+ - test/matchers/validate_attachment_content_type_matcher_test.rb
145
+ - test/matchers/validate_attachment_presence_matcher_test.rb
146
+ - test/matchers/validate_attachment_size_matcher_test.rb
147
+ - test/paperclip_test.rb
148
+ - test/processor_test.rb
149
+ - test/storage_test.rb
150
+ - test/thumbnail_test.rb
151
+ - test/upfile_test.rb
152
+ - shoulda_macros/paperclip.rb
153
+ has_rdoc: true
154
+ homepage: http://www.thoughtbot.com/projects/paperclip
155
+ licenses: []
156
+
157
+ post_install_message:
158
+ rdoc_options:
159
+ - --line-numbers
160
+ - --inline-source
161
+ require_paths:
162
+ - lib
163
+ required_ruby_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ segments:
168
+ - 0
169
+ version: "0"
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ segments:
175
+ - 0
176
+ version: "0"
177
+ requirements:
178
+ - ImageMagick
179
+ rubyforge_project: paperclip
180
+ rubygems_version: 1.3.6
181
+ signing_key:
182
+ specification_version: 3
183
+ summary: File attachments as attributes for ActiveRecord
184
+ test_files: []
185
+