cloudfuji_paperclip 2.4.6

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.
Files changed (105) hide show
  1. data/.gitignore +22 -0
  2. data/.travis.yml +13 -0
  3. data/Appraisals +14 -0
  4. data/CONTRIBUTING.md +38 -0
  5. data/Gemfile +5 -0
  6. data/Gemfile.lock +137 -0
  7. data/LICENSE +26 -0
  8. data/README.md +444 -0
  9. data/Rakefile +41 -0
  10. data/cucumber/paperclip_steps.rb +6 -0
  11. data/features/basic_integration.feature +46 -0
  12. data/features/rake_tasks.feature +63 -0
  13. data/features/step_definitions/attachment_steps.rb +65 -0
  14. data/features/step_definitions/html_steps.rb +15 -0
  15. data/features/step_definitions/rails_steps.rb +182 -0
  16. data/features/step_definitions/s3_steps.rb +14 -0
  17. data/features/step_definitions/web_steps.rb +209 -0
  18. data/features/support/env.rb +8 -0
  19. data/features/support/fakeweb.rb +3 -0
  20. data/features/support/fixtures/.boot_config.rb.swo +0 -0
  21. data/features/support/fixtures/boot_config.txt +15 -0
  22. data/features/support/fixtures/gemfile.txt +5 -0
  23. data/features/support/fixtures/preinitializer.txt +20 -0
  24. data/features/support/paths.rb +28 -0
  25. data/features/support/rails.rb +46 -0
  26. data/features/support/selectors.rb +19 -0
  27. data/gemfiles/rails2.gemfile +9 -0
  28. data/gemfiles/rails3.gemfile +9 -0
  29. data/gemfiles/rails3_1.gemfile +9 -0
  30. data/generators/paperclip/USAGE +5 -0
  31. data/generators/paperclip/paperclip_generator.rb +27 -0
  32. data/generators/paperclip/templates/paperclip_migration.rb.erb +19 -0
  33. data/init.rb +4 -0
  34. data/lib/generators/paperclip/USAGE +8 -0
  35. data/lib/generators/paperclip/paperclip_generator.rb +33 -0
  36. data/lib/generators/paperclip/templates/paperclip_migration.rb.erb +19 -0
  37. data/lib/paperclip/attachment.rb +468 -0
  38. data/lib/paperclip/callback_compatibility.rb +61 -0
  39. data/lib/paperclip/geometry.rb +120 -0
  40. data/lib/paperclip/interpolations.rb +174 -0
  41. data/lib/paperclip/iostream.rb +45 -0
  42. data/lib/paperclip/matchers/have_attached_file_matcher.rb +57 -0
  43. data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +81 -0
  44. data/lib/paperclip/matchers/validate_attachment_presence_matcher.rb +54 -0
  45. data/lib/paperclip/matchers/validate_attachment_size_matcher.rb +95 -0
  46. data/lib/paperclip/matchers.rb +64 -0
  47. data/lib/paperclip/missing_attachment_styles.rb +87 -0
  48. data/lib/paperclip/processor.rb +58 -0
  49. data/lib/paperclip/railtie.rb +31 -0
  50. data/lib/paperclip/schema.rb +39 -0
  51. data/lib/paperclip/storage/filesystem.rb +81 -0
  52. data/lib/paperclip/storage/fog.rb +174 -0
  53. data/lib/paperclip/storage/s3.rb +333 -0
  54. data/lib/paperclip/storage.rb +3 -0
  55. data/lib/paperclip/style.rb +103 -0
  56. data/lib/paperclip/thumbnail.rb +105 -0
  57. data/lib/paperclip/upfile.rb +62 -0
  58. data/lib/paperclip/url_generator.rb +64 -0
  59. data/lib/paperclip/version.rb +3 -0
  60. data/lib/paperclip.rb +487 -0
  61. data/lib/tasks/paperclip.rake +101 -0
  62. data/paperclip.gemspec +41 -0
  63. data/rails/init.rb +2 -0
  64. data/shoulda_macros/paperclip.rb +124 -0
  65. data/test/.gitignore +1 -0
  66. data/test/attachment_test.rb +1116 -0
  67. data/test/database.yml +4 -0
  68. data/test/fixtures/12k.png +0 -0
  69. data/test/fixtures/50x50.png +0 -0
  70. data/test/fixtures/5k.png +0 -0
  71. data/test/fixtures/animated.gif +0 -0
  72. data/test/fixtures/bad.png +1 -0
  73. data/test/fixtures/fog.yml +8 -0
  74. data/test/fixtures/question?mark.png +0 -0
  75. data/test/fixtures/s3.yml +8 -0
  76. data/test/fixtures/spaced file.png +0 -0
  77. data/test/fixtures/text.txt +1 -0
  78. data/test/fixtures/twopage.pdf +0 -0
  79. data/test/fixtures/uppercase.PNG +0 -0
  80. data/test/geometry_test.rb +206 -0
  81. data/test/helper.rb +177 -0
  82. data/test/integration_test.rb +654 -0
  83. data/test/interpolations_test.rb +216 -0
  84. data/test/iostream_test.rb +71 -0
  85. data/test/matchers/have_attached_file_matcher_test.rb +24 -0
  86. data/test/matchers/validate_attachment_content_type_matcher_test.rb +87 -0
  87. data/test/matchers/validate_attachment_presence_matcher_test.rb +26 -0
  88. data/test/matchers/validate_attachment_size_matcher_test.rb +51 -0
  89. data/test/paperclip_missing_attachment_styles_test.rb +80 -0
  90. data/test/paperclip_test.rb +390 -0
  91. data/test/processor_test.rb +10 -0
  92. data/test/schema_test.rb +98 -0
  93. data/test/storage/filesystem_test.rb +56 -0
  94. data/test/storage/fog_test.rb +219 -0
  95. data/test/storage/s3_live_test.rb +138 -0
  96. data/test/storage/s3_test.rb +943 -0
  97. data/test/style_test.rb +209 -0
  98. data/test/support/mock_attachment.rb +22 -0
  99. data/test/support/mock_interpolator.rb +24 -0
  100. data/test/support/mock_model.rb +2 -0
  101. data/test/support/mock_url_generator_builder.rb +27 -0
  102. data/test/thumbnail_test.rb +383 -0
  103. data/test/upfile_test.rb +53 -0
  104. data/test/url_generator_test.rb +187 -0
  105. metadata +404 -0
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *~
2
+ *.swp
3
+ .rvmrc
4
+ .bundle
5
+ tmp
6
+
7
+ test/s3.yml
8
+ test/debug.log
9
+ test/paperclip.db
10
+ test/doc
11
+ test/pkg
12
+ test/tmp
13
+
14
+ public
15
+ paperclip*.gem
16
+ capybara*.html
17
+
18
+ *.rbc
19
+ .rbx
20
+
21
+ *SPIKE*
22
+ *emfile.lock
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - ree
5
+ - rbx-2.0
6
+
7
+ before_script: "sudo ntpdate -ub ntp.ubuntu.com pool.ntp.org; true"
8
+ script: "bundle exec rake clean test cucumber"
9
+
10
+ gemfile:
11
+ - gemfiles/rails2.gemfile
12
+ - gemfiles/rails3.gemfile
13
+ - gemfiles/rails3_1.gemfile
data/Appraisals ADDED
@@ -0,0 +1,14 @@
1
+ appraise "rails2" do
2
+ gem "rails", "~> 2.3.14"
3
+ gem "paperclip", :path => "../"
4
+ end
5
+
6
+ appraise "rails3" do
7
+ gem "rails", "~> 3.0.10"
8
+ gem "paperclip", :path => "../"
9
+ end
10
+
11
+ appraise "rails3_1" do
12
+ gem "rails", "~> 3.1.0"
13
+ gem "paperclip", :path => "../"
14
+ end
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,38 @@
1
+ We love pull requests. Here's a quick guide:
2
+
3
+ 1. Fork the repo.
4
+
5
+ 2. Run the tests. We only take pull requests with passing tests, and it's great
6
+ to know that you have a clean slate: `bundle && rake`
7
+
8
+ 3. Add a test for your change. Only refactoring and documentation changes
9
+ require no new tests. If you are adding functionality or fixing a bug, we need
10
+ a test!
11
+
12
+ 4. Make the test pass.
13
+
14
+ 5. Push to your fork and submit a pull request.
15
+
16
+
17
+ At this point you're waiting on us. We like to at least comment on, if not
18
+ accept, pull requests within three business days (and, typically, one business
19
+ day). We may suggest some changes or improvements or alternatives.
20
+
21
+ Some things that will increase the chance that your pull request is accepted,
22
+ taken straight from the Ruby on Rails guide:
23
+
24
+ * Use Rails idioms and helpers
25
+ * Include tests that fail without your code, and pass with it
26
+ * Update the documentation, the surrounding one, examples elsewhere, guides,
27
+ whatever is affected by your contribution
28
+
29
+ Syntax:
30
+
31
+ * Two spaces, no tabs.
32
+ * No trailing whitespace. Blank lines should not have any space.
33
+ * Prefer &&/|| over and/or.
34
+ * MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
35
+ * a = b and not a=b.
36
+ * Follow the conventions you see used in the source already.
37
+
38
+ And in case we didn't emphasize it enough: we love tests!
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "jruby-openssl", :platform => :jruby
data/Gemfile.lock ADDED
@@ -0,0 +1,137 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cloudfuji_paperclip (2.4.6)
5
+ activerecord (>= 2.3.0)
6
+ activesupport (>= 2.3.2)
7
+ cocaine (>= 0.0.2)
8
+ mime-types
9
+
10
+ GEM
11
+ remote: http://rubygems.org/
12
+ specs:
13
+ activemodel (3.2.3)
14
+ activesupport (= 3.2.3)
15
+ builder (~> 3.0.0)
16
+ activerecord (3.2.3)
17
+ activemodel (= 3.2.3)
18
+ activesupport (= 3.2.3)
19
+ arel (~> 3.0.2)
20
+ tzinfo (~> 0.3.29)
21
+ activesupport (3.2.3)
22
+ i18n (~> 0.6)
23
+ multi_json (~> 1.0)
24
+ appraisal (0.4.0)
25
+ bundler
26
+ rake
27
+ arel (3.0.2)
28
+ aruba (0.4.6)
29
+ bcat (>= 0.6.1)
30
+ childprocess (>= 0.2.0)
31
+ cucumber (>= 1.0.2)
32
+ rdiscount (>= 1.6.8)
33
+ rspec (>= 2.6.0)
34
+ aws-sdk (1.2.1)
35
+ httparty (~> 0.7)
36
+ json (~> 1.4)
37
+ nokogiri (>= 1.4.4)
38
+ uuidtools (~> 2.1)
39
+ bcat (0.6.2)
40
+ rack (~> 1.0)
41
+ builder (3.0.0)
42
+ capybara (1.1.1)
43
+ mime-types (>= 1.16)
44
+ nokogiri (>= 1.3.3)
45
+ rack (>= 1.0.0)
46
+ rack-test (>= 0.5.4)
47
+ selenium-webdriver (~> 2.0)
48
+ xpath (~> 0.1.4)
49
+ childprocess (0.2.2)
50
+ ffi (~> 1.0.6)
51
+ cocaine (0.2.0)
52
+ cucumber (1.1.4)
53
+ builder (>= 2.1.2)
54
+ diff-lcs (>= 1.1.2)
55
+ gherkin (~> 2.7.1)
56
+ json (>= 1.4.6)
57
+ term-ansicolor (>= 1.0.6)
58
+ diff-lcs (1.1.3)
59
+ excon (0.6.6)
60
+ fakeweb (1.3.0)
61
+ ffi (1.0.9)
62
+ fog (0.11.0)
63
+ builder
64
+ excon (~> 0.6.5)
65
+ formatador (~> 0.2.0)
66
+ mime-types
67
+ multi_json (~> 1.0.3)
68
+ net-scp (~> 1.0.4)
69
+ net-ssh (~> 2.1.4)
70
+ nokogiri (~> 1.5.0)
71
+ ruby-hmac
72
+ formatador (0.2.1)
73
+ gherkin (2.7.1)
74
+ json (>= 1.4.6)
75
+ httparty (0.8.1)
76
+ multi_json
77
+ multi_xml
78
+ i18n (0.6.0)
79
+ json (1.6.3)
80
+ json_pure (1.6.1)
81
+ metaclass (0.0.1)
82
+ mime-types (1.16)
83
+ mocha (0.10.0)
84
+ metaclass (~> 0.0.1)
85
+ multi_json (1.0.3)
86
+ multi_xml (0.4.1)
87
+ net-scp (1.0.4)
88
+ net-ssh (>= 1.99.1)
89
+ net-ssh (2.1.4)
90
+ nokogiri (1.5.0)
91
+ rack (1.3.3)
92
+ rack-test (0.6.1)
93
+ rack (>= 1.0)
94
+ rake (0.9.2)
95
+ rdiscount (1.6.8)
96
+ rspec (2.6.0)
97
+ rspec-core (~> 2.6.0)
98
+ rspec-expectations (~> 2.6.0)
99
+ rspec-mocks (~> 2.6.0)
100
+ rspec-core (2.6.4)
101
+ rspec-expectations (2.6.0)
102
+ diff-lcs (~> 1.1.2)
103
+ rspec-mocks (2.6.0)
104
+ ruby-hmac (0.4.0)
105
+ rubyzip (0.9.4)
106
+ selenium-webdriver (2.7.0)
107
+ childprocess (>= 0.2.1)
108
+ ffi (>= 1.0.7)
109
+ json_pure
110
+ rubyzip
111
+ shoulda (2.11.3)
112
+ sqlite3 (1.3.4)
113
+ term-ansicolor (1.0.7)
114
+ tzinfo (0.3.33)
115
+ uuidtools (2.1.2)
116
+ xpath (0.1.4)
117
+ nokogiri (~> 1.3)
118
+
119
+ PLATFORMS
120
+ ruby
121
+
122
+ DEPENDENCIES
123
+ appraisal (~> 0.4.0)
124
+ aruba
125
+ aws-sdk
126
+ bundler
127
+ capybara
128
+ cloudfuji_paperclip!
129
+ cocaine (~> 0.2)
130
+ cucumber (~> 1.1.0)
131
+ fakeweb
132
+ fog
133
+ jruby-openssl
134
+ mocha
135
+ rake
136
+ shoulda
137
+ sqlite3 (~> 1.3.4)
data/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+
2
+ LICENSE
3
+
4
+ The MIT License
5
+
6
+ Copyright (c) 2008 Jon Yurek and thoughtbot, inc.
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+