another_uploader 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. data/MIT-LICENSE +21 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/images/another_uploader/doc.gif +0 -0
  5. data/app/assets/images/another_uploader/mp3.gif +0 -0
  6. data/app/assets/images/another_uploader/none.gif +0 -0
  7. data/app/assets/images/another_uploader/pdf.gif +0 -0
  8. data/app/assets/images/another_uploader/spreadsheet.gif +0 -0
  9. data/app/assets/images/another_uploader/text.gif +0 -0
  10. data/app/assets/javascripts/another_uploader/index.js +5 -0
  11. data/app/assets/javascripts/uploads.js +2 -0
  12. data/app/assets/stylesheets/another_uploader/index.css +5 -0
  13. data/app/assets/stylesheets/uploads.css +4 -0
  14. data/app/controllers/uploads_controller.rb +7 -0
  15. data/app/helpers/uploads_helper.rb +2 -0
  16. data/app/models/upload.rb +145 -0
  17. data/app/views/uploads/destroy.html.erb +2 -0
  18. data/app/views/uploads/uploadify.html.erb +2 -0
  19. data/config/routes.rb +6 -0
  20. data/db/migrate/20121115043827_create_uploads.rb +31 -0
  21. data/lib/another_uploader.rb +14 -0
  22. data/lib/another_uploader/configuration.rb +36 -0
  23. data/lib/another_uploader/engine.rb +4 -0
  24. data/lib/another_uploader/icons.rb +23 -0
  25. data/lib/another_uploader/image_processing.rb +29 -0
  26. data/lib/another_uploader/mime_type_getters.rb +17 -0
  27. data/lib/another_uploader/mime_type_groups.rb +17 -0
  28. data/lib/another_uploader/transliteration.rb +22 -0
  29. data/lib/another_uploader/version.rb +3 -0
  30. data/lib/tasks/another_uploader_tasks.rake +4 -0
  31. data/test/another_uploader_test.rb +7 -0
  32. data/test/dummy/README.rdoc +261 -0
  33. data/test/dummy/Rakefile +7 -0
  34. data/test/dummy/app/assets/javascripts/application.js +17 -0
  35. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  36. data/test/dummy/app/controllers/application_controller.rb +6 -0
  37. data/test/dummy/app/controllers/main_controller.rb +4 -0
  38. data/test/dummy/app/helpers/application_helper.rb +2 -0
  39. data/test/dummy/app/models/user.rb +6 -0
  40. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  41. data/test/dummy/app/views/main/index.html.erb +2 -0
  42. data/test/dummy/config.ru +4 -0
  43. data/test/dummy/config/application.rb +59 -0
  44. data/test/dummy/config/boot.rb +10 -0
  45. data/test/dummy/config/database.yml +25 -0
  46. data/test/dummy/config/environment.rb +5 -0
  47. data/test/dummy/config/environments/development.rb +37 -0
  48. data/test/dummy/config/environments/production.rb +67 -0
  49. data/test/dummy/config/environments/test.rb +37 -0
  50. data/test/dummy/config/initializers/another_uploader.rb +10 -0
  51. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  52. data/test/dummy/config/initializers/inflections.rb +15 -0
  53. data/test/dummy/config/initializers/mime_types.rb +5 -0
  54. data/test/dummy/config/initializers/secret_token.rb +7 -0
  55. data/test/dummy/config/initializers/session_store.rb +8 -0
  56. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  57. data/test/dummy/config/locales/en.yml +5 -0
  58. data/test/dummy/config/routes.rb +61 -0
  59. data/test/dummy/config/s3.yml +10 -0
  60. data/test/dummy/config/s3.yml.example +21 -0
  61. data/test/dummy/db/development.sqlite3 +0 -0
  62. data/test/dummy/db/migrate/20121115045546_create_users.easy_rails_authentication_engine.rb +12 -0
  63. data/test/dummy/db/migrate/20121115045547_create_password_recoveries.easy_rails_authentication_engine.rb +13 -0
  64. data/test/dummy/db/migrate/20121115045630_create_uploads.another_uploader_engine.rb +32 -0
  65. data/test/dummy/db/schema.rb +63 -0
  66. data/test/dummy/db/test.sqlite3 +0 -0
  67. data/test/dummy/log/development.log +53979 -0
  68. data/test/dummy/log/test.log +139363 -0
  69. data/test/dummy/public/404.html +26 -0
  70. data/test/dummy/public/422.html +26 -0
  71. data/test/dummy/public/500.html +25 -0
  72. data/test/dummy/public/favicon.ico +0 -0
  73. data/test/dummy/script/rails +6 -0
  74. data/test/dummy/test/functional/main_controller_test.rb +9 -0
  75. data/test/dummy/tmp/cache/assets/C1D/CB0/sprockets%2F1368a6c195444308f76a970b1127660b +0 -0
  76. data/test/dummy/tmp/cache/assets/C56/660/sprockets%2F9606c93013df9ec75112d323643686a9 +0 -0
  77. data/test/dummy/tmp/cache/assets/C64/2A0/sprockets%2F779fa4794d76f3083f442743352e247c +0 -0
  78. data/test/dummy/tmp/cache/assets/C80/910/sprockets%2F1da2794871f7097ea5246354ae85300b +0 -0
  79. data/test/dummy/tmp/cache/assets/C82/240/sprockets%2F625dc2916f00654e5351b054afc95678 +0 -0
  80. data/test/dummy/tmp/cache/assets/C9F/DD0/sprockets%2F1801bd89c75539c636659918883e8dea +0 -0
  81. data/test/dummy/tmp/cache/assets/CA9/ED0/sprockets%2F845117661057731bd942dc61ddda24f3 +0 -0
  82. data/test/dummy/tmp/cache/assets/CB1/030/sprockets%2F330d8361296be2294bcf4e8282473ab7 +0 -0
  83. data/test/dummy/tmp/cache/assets/CBD/D80/sprockets%2F65641a234ede6ff88b006594b1869b29 +0 -0
  84. data/test/dummy/tmp/cache/assets/CC1/4E0/sprockets%2F53d9bd83335f4bb9561087645769c5da +0 -0
  85. data/test/dummy/tmp/cache/assets/CD6/C50/sprockets%2Fd30f21629ea47cf66530fa0e347272b4 +0 -0
  86. data/test/dummy/tmp/cache/assets/CD7/B40/sprockets%2F21b71f8ea0f566175a551816b6f530cb +0 -0
  87. data/test/dummy/tmp/cache/assets/CD7/EE0/sprockets%2Fd677061accd85058216607c208b7a2bf +0 -0
  88. data/test/dummy/tmp/cache/assets/CD8/000/sprockets%2F12d162f45ae0036e177e4a67b926a92d +0 -0
  89. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  90. data/test/dummy/tmp/cache/assets/CD9/990/sprockets%2Fba64ae414cc39805ce695e2c40162807 +0 -0
  91. data/test/dummy/tmp/cache/assets/CDA/700/sprockets%2F2437e594d81db9b2b87b24411630dba8 +0 -0
  92. data/test/dummy/tmp/cache/assets/CE1/340/sprockets%2F0573a62b0251cc18c80949a9c9fe34d7 +0 -0
  93. data/test/dummy/tmp/cache/assets/CE1/C30/sprockets%2F6a2c53cf042c621806c77ada86288c77 +0 -0
  94. data/test/dummy/tmp/cache/assets/CE6/1A0/sprockets%2F41ce96883326a6a9313b408cdf80df74 +0 -0
  95. data/test/dummy/tmp/cache/assets/CE7/F50/sprockets%2F5118ca4d54388e2cc84e90c95f36048a +0 -0
  96. data/test/dummy/tmp/cache/assets/CED/B00/sprockets%2Fbde328b963290de060b7677fd155695e +0 -0
  97. data/test/dummy/tmp/cache/assets/CF2/4B0/sprockets%2Fb95901745337c00037e00a7f0cacaa3c +0 -0
  98. data/test/dummy/tmp/cache/assets/CF9/960/sprockets%2F69590f47d597a9ec070b6c0bc28e9876 +0 -0
  99. data/test/dummy/tmp/cache/assets/CFE/EE0/sprockets%2F1100a030f19d781dc98eb066ab6075ec +0 -0
  100. data/test/dummy/tmp/cache/assets/D00/D30/sprockets%2F08dc27f9a9ed399356a91d4069889c5d +0 -0
  101. data/test/dummy/tmp/cache/assets/D0A/760/sprockets%2F28d26ec78714eaf45198b0abab175117 +0 -0
  102. data/test/dummy/tmp/cache/assets/D0E/E90/sprockets%2Fa982198515b54c1f58f8aae30830f0ea +0 -0
  103. data/test/dummy/tmp/cache/assets/D12/7E0/sprockets%2F35c1a2211d6547b7c7ffa5ed813d7938 +0 -0
  104. data/test/dummy/tmp/cache/assets/D18/610/sprockets%2F66cc7f1b171e5729d4279bac1676de53 +0 -0
  105. data/test/dummy/tmp/cache/assets/D1A/AC0/sprockets%2F045847ba35c0701c01fa0b0ecf73d11a +0 -0
  106. data/test/dummy/tmp/cache/assets/D1B/810/sprockets%2F76112c598c956c07c4f4e91f6ee3ba80 +0 -0
  107. data/test/dummy/tmp/cache/assets/D1E/580/sprockets%2F5f965913df7a03e307dfd9326f9b06b7 +0 -0
  108. data/test/dummy/tmp/cache/assets/D21/CE0/sprockets%2F85c75ccf1618c6e9214374fa80ff6a78 +0 -0
  109. data/test/dummy/tmp/cache/assets/D23/8A0/sprockets%2F6175cb8fa517f52908739e3b478ef4bd +0 -0
  110. data/test/dummy/tmp/cache/assets/D24/DF0/sprockets%2F205e10fc11b2c5ed047b48e7d13ca262 +0 -0
  111. data/test/dummy/tmp/cache/assets/D25/860/sprockets%2Ff8260dc5f64465554e619b1e8d8e5fb7 +0 -0
  112. data/test/dummy/tmp/cache/assets/D27/BB0/sprockets%2F1ce3f0373575afde958376fec61658e8 +0 -0
  113. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  114. data/test/dummy/tmp/cache/assets/D35/000/sprockets%2F26017814dcf3891ad5be86ec7005a0ae +0 -0
  115. data/test/dummy/tmp/cache/assets/D38/250/sprockets%2F80644f3f31455068a51deebec0aa7a86 +0 -0
  116. data/test/dummy/tmp/cache/assets/D41/DF0/sprockets%2F86004b9b60de26aa7d87a1ff8b828f21 +0 -0
  117. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  118. data/test/dummy/tmp/cache/assets/D4F/1A0/sprockets%2F7901d59d8f722a5ebfff972429bb2d45 +0 -0
  119. data/test/dummy/tmp/cache/assets/D4F/4A0/sprockets%2F4fcb3c5126d2489feb99578dfa0c8507 +0 -0
  120. data/test/dummy/tmp/cache/assets/D52/E40/sprockets%2F04b1950fad18f3bcf64d30120da8b40b +0 -0
  121. data/test/dummy/tmp/cache/assets/D52/FD0/sprockets%2F19d7b68fb60b78d7519fc64d3c9a05f6 +0 -0
  122. data/test/dummy/tmp/cache/assets/D59/F30/sprockets%2F9dff7df99c759433823d4030cea998ac +0 -0
  123. data/test/dummy/tmp/cache/assets/D5A/850/sprockets%2F4015515d4be88de02aa43ff1b0abb594 +0 -0
  124. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  125. data/test/dummy/tmp/cache/assets/D5C/030/sprockets%2F85440ce896b9da860fd37bb1e58f978e +0 -0
  126. data/test/dummy/tmp/cache/assets/D65/DA0/sprockets%2Fd0515dae6856f8da160c5d3050aa8b8e +0 -0
  127. data/test/dummy/tmp/cache/assets/D68/CD0/sprockets%2F9d829309524cfa22a0bdddf62c817d2a +0 -0
  128. data/test/dummy/tmp/cache/assets/D6B/A10/sprockets%2Fe2054cdbee145cdb51eb971863f54c80 +0 -0
  129. data/test/dummy/tmp/cache/assets/D6C/4B0/sprockets%2F543f257da84ce9914a414c3ffc1ad5a5 +0 -0
  130. data/test/dummy/tmp/cache/assets/D6C/AC0/sprockets%2Ffc095dd6183c1fcdf793351aa0b9057c +0 -0
  131. data/test/dummy/tmp/cache/assets/D71/520/sprockets%2Fc8e0327abdc946f27d2a91311ddd868e +0 -0
  132. data/test/dummy/tmp/cache/assets/D72/B90/sprockets%2Fc267891912fff9a3fa22ae346ba4f82b +0 -0
  133. data/test/dummy/tmp/cache/assets/D7C/E70/sprockets%2F9cae95be6892da1bf96c244c0d58069c +0 -0
  134. data/test/dummy/tmp/cache/assets/D7D/750/sprockets%2F8755c9ddd1217ce9ab854a429c4f7e3d +0 -0
  135. data/test/dummy/tmp/cache/assets/D91/D00/sprockets%2Fc1e1b10c6a5879ae7a2a875b0dbd357a +0 -0
  136. data/test/dummy/tmp/cache/assets/D95/0C0/sprockets%2Ffce9642718191a3112260ccbc8cafefc +0 -0
  137. data/test/dummy/tmp/cache/assets/D9A/DE0/sprockets%2Fcd78fb20bde75dba85a0c62b4838542c +0 -0
  138. data/test/dummy/tmp/cache/assets/DBB/440/sprockets%2Fe68195d6a29fe5fd90ded7559fccb429 +0 -0
  139. data/test/dummy/tmp/cache/assets/DBB/A30/sprockets%2Fe70dc841dca9ceee2e413a1661ed0b03 +0 -0
  140. data/test/dummy/tmp/cache/assets/DBF/3A0/sprockets%2F3c82ed0abb7057c1e728ac0f2ca41df9 +0 -0
  141. data/test/dummy/tmp/cache/assets/DC0/490/sprockets%2F5e0aebe091b8cea050c89d4ea19e080b +0 -0
  142. data/test/dummy/tmp/cache/assets/DC9/380/sprockets%2F2aaba93d71e5b9e178b0ce2df59eb603 +0 -0
  143. data/test/dummy/tmp/cache/assets/DCC/450/sprockets%2Fb3392d6eaf0e4cc318e19b6beb59b33f +0 -0
  144. data/test/dummy/tmp/cache/assets/DD0/2F0/sprockets%2F2cb2d409afda49a014f5bfef65f75c67 +0 -0
  145. data/test/dummy/tmp/cache/assets/DD9/030/sprockets%2F22d64f8febf6fc918b3a9ff6ad40441f +0 -0
  146. data/test/dummy/tmp/cache/assets/DDA/760/sprockets%2F31d55e4ecf03fbd5d71d5d7fd6d6d586 +0 -0
  147. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  148. data/test/dummy/tmp/cache/assets/DDC/630/sprockets%2Fd23e663fbbe6dfdb81e7a5d86d87b507 +0 -0
  149. data/test/dummy/tmp/cache/assets/DEA/760/sprockets%2Fcf1c5cfb9b1239a5b3dee52a3dd5001e +0 -0
  150. data/test/dummy/tmp/cache/assets/DED/500/sprockets%2F6b8b0740ec26f31fe0bcaa5ecd1e75a4 +0 -0
  151. data/test/dummy/tmp/cache/assets/DF1/B80/sprockets%2Fae7705cefbeb7308c73ba3a7a42c6a1f +0 -0
  152. data/test/dummy/tmp/cache/assets/DF6/DE0/sprockets%2Fd4eb25c8857c4c413cacaf6e7a0ccd26 +0 -0
  153. data/test/dummy/tmp/cache/assets/DF8/1A0/sprockets%2F0f9b45b1ca394c1aedc6febec735820f +0 -0
  154. data/test/dummy/tmp/cache/assets/DFE/980/sprockets%2F3493099ba61bb24ebec3f59cddf08ead +0 -0
  155. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  156. data/test/dummy/tmp/cache/assets/E29/000/sprockets%2F6d13db8fbbd48dbce7392e43ac0ecb46 +0 -0
  157. data/test/dummy/tmp/cache/assets/E31/930/sprockets%2Ff68b89fd7200b23eccd9b1ba9afff3d3 +0 -0
  158. data/test/dummy/tmp/cache/assets/E79/780/sprockets%2Fd7e2d10be0ca0abfe06ecab1d3868dfd +0 -0
  159. data/test/fixtures/files/1000Hz-5sec.mp3 +0 -0
  160. data/test/fixtures/files/lorem-ipsum +7 -0
  161. data/test/fixtures/files/lorem-ipsum.jpg +0 -0
  162. data/test/fixtures/files/lorem-ipsum.ods +0 -0
  163. data/test/fixtures/files/lorem-ipsum.odt +0 -0
  164. data/test/fixtures/files/lorem-ipsum.pdf +0 -0
  165. data/test/fixtures/files/lorem-ipsum.txt +7 -0
  166. data/test/fixtures/users.yml +10 -0
  167. data/test/functional/uploads_controller_test.rb +14 -0
  168. data/test/integration/navigation_test.rb +10 -0
  169. data/test/test_helper.rb +52 -0
  170. data/test/unit/file_storage_test.rb +157 -0
  171. data/test/unit/helpers/uploads_helper_test.rb +4 -0
  172. data/test/unit/icon_and_thumb_test.rb +36 -0
  173. data/test/unit/mime_types_test.rb +74 -0
  174. data/test/unit/name_test.rb +51 -0
  175. data/test/unit/scope_test.rb +162 -0
  176. data/test/unit/upload_test.rb +7 -0
  177. data/test/upload_test_helper.rb +52 -0
  178. metadata +486 -0
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,10 @@
1
+ AnotherUploader.configure do |config|
2
+ config_file = "#{::Rails.root}/config/s3.yml"
3
+ if !File.exists?(config_file)
4
+ puts "Please create #{config_file}"
5
+ puts "Sample file located at #{config_file}.example"
6
+ exit
7
+ end
8
+ s3 = YAML.load_file(config_file)[Rails.env].symbolize_keys
9
+ config.has_attached_file_options.merge!({storage: :s3, s3_credentials: s3[:credentials], bucket: s3[:bucket]})
10
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'c35ed6200c41cccf5381a17260882b0277b2ef94e65db5b94d76da0eb9808d31cb8f54a82b0d3a39b872a65f27856987c20b8674a1715be2c8c7cf6605e50aa2'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,61 @@
1
+ Dummy::Application.routes.draw do
2
+ root to: 'main#index'
3
+ get "main/index"
4
+
5
+ # The priority is based upon order of creation:
6
+ # first created -> highest priority.
7
+
8
+ # Sample of regular route:
9
+ # match 'products/:id' => 'catalog#view'
10
+ # Keep in mind you can assign values other than :controller and :action
11
+
12
+ # Sample of named route:
13
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
14
+ # This route can be invoked with purchase_url(:id => product.id)
15
+
16
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
17
+ # resources :products
18
+
19
+ # Sample resource route with options:
20
+ # resources :products do
21
+ # member do
22
+ # get 'short'
23
+ # post 'toggle'
24
+ # end
25
+ #
26
+ # collection do
27
+ # get 'sold'
28
+ # end
29
+ # end
30
+
31
+ # Sample resource route with sub-resources:
32
+ # resources :products do
33
+ # resources :comments, :sales
34
+ # resource :seller
35
+ # end
36
+
37
+ # Sample resource route with more complex sub-resources
38
+ # resources :products do
39
+ # resources :comments
40
+ # resources :sales do
41
+ # get 'recent', :on => :collection
42
+ # end
43
+ # end
44
+
45
+ # Sample resource route within a namespace:
46
+ # namespace :admin do
47
+ # # Directs /admin/products/* to Admin::ProductsController
48
+ # # (app/controllers/admin/products_controller.rb)
49
+ # resources :products
50
+ # end
51
+
52
+ # You can have the root of your site routed with "root"
53
+ # just remember to delete public/index.html.
54
+ # root :to => 'welcome#index'
55
+
56
+ # See how all your routes lay out with "rake routes"
57
+
58
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
59
+ # Note: This route will make all actions in every controller accessible via GET requests.
60
+ # match ':controller(/:action(/:id))(.:format)'
61
+ end
@@ -0,0 +1,10 @@
1
+ test:
2
+ bucket: iyb_development
3
+ credentials:
4
+ access_key_id: AKIAIQKPBDN3O74M7TEA
5
+ secret_access_key: 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
6
+ development:
7
+ bucket: iyb_development
8
+ credentials:
9
+ access_key_id: AKIAIQKPBDN3O74M7TEA
10
+ secret_access_key: FhgVMDyjERpkJsGdOVp6q1wROhzofeRbLnLrK2Oj
@@ -0,0 +1,21 @@
1
+ # Save this in your main application as config/initializers/s3.yml and update the values below appropriately.
2
+ # It's recommended to add that file to .gitignore for security
3
+ # host_alias may be omitted if you're not redirecting from your website to S3 with a CNAME
4
+ test:
5
+ bucket: test_bucket
6
+ host_alias: test_bucket.s3.amazon.com
7
+ credentials:
8
+ access_key_id: 4DVQZMCFEZWVXTL73PD6
9
+ secret_access_key: dReL6mrQDKdfstjevFeBOqHprhO9PC38GN5GtVYS
10
+ development:
11
+ bucket: dev_bucket
12
+ host_alias: dev_bucket.s3.amazon.com
13
+ credentials:
14
+ access_key_id: 4DVQZMCFEZWVXTL73PD6
15
+ secret_access_key: dReL6mrQDKdfstjevFeBOqHprhO9PC38GN5GtVYS
16
+ production:
17
+ bucket: production_bucket
18
+ host_alias: production_bucket.s3.amazon.com
19
+ credentials:
20
+ access_key_id: GWUDL70DBXGYK0W637NX
21
+ secret_access_key: Kf8wt75m8drOeP8WfMoNvHcECIe5pDGn6DSYUICv
@@ -0,0 +1,12 @@
1
+ # This migration comes from easy_rails_authentication_engine (originally 20120904133320)
2
+ class CreateUsers < ActiveRecord::Migration
3
+ def change
4
+ create_table :users do |t|
5
+ t.string :email
6
+ t.string :password_digest
7
+ t.boolean :admin
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # This migration comes from easy_rails_authentication_engine (originally 20120914205956)
2
+ class CreatePasswordRecoveries < ActiveRecord::Migration
3
+ def change
4
+ create_table :password_recoveries do |t|
5
+ t.integer :user_id
6
+ t.string :reset_link
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :password_recoveries, :user_id, :unique => true
11
+ add_index :password_recoveries, :reset_link, :unique => true
12
+ end
13
+ end
@@ -0,0 +1,32 @@
1
+ # This migration comes from another_uploader_engine (originally 20121115043827)
2
+ class CreateUploads < ActiveRecord::Migration
3
+ def change
4
+ create_table :uploads do |t|
5
+ t.integer :creator_id
6
+ t.string :name
7
+ t.string :caption, limit: 1000
8
+ t.text :description
9
+ t.boolean :is_public, default: true
10
+ t.integer :uploadable_id
11
+ t.string :uploadable_type
12
+ t.string :width
13
+ t.string :height
14
+ t.string :local_file_name
15
+ t.string :local_content_type
16
+ t.integer :local_file_size
17
+ t.datetime :local_updated_at
18
+ t.string :local_fingerprint
19
+ t.string :remote_file_name
20
+ t.string :remote_content_type
21
+ t.integer :remote_file_size
22
+ t.datetime :remote_updated_at
23
+ t.string :remote_fingerprint
24
+
25
+ t.timestamps
26
+ end
27
+ add_index :uploads, :creator_id
28
+ add_index :uploads, :uploadable_id
29
+ add_index :uploads, :uploadable_type
30
+ add_index :uploads, :local_file_name
31
+ end
32
+ end
@@ -0,0 +1,63 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20121115045630) do
15
+
16
+ create_table "password_recoveries", :force => true do |t|
17
+ t.integer "user_id"
18
+ t.string "reset_link"
19
+ t.datetime "created_at", :null => false
20
+ t.datetime "updated_at", :null => false
21
+ end
22
+
23
+ add_index "password_recoveries", ["reset_link"], :name => "index_password_recoveries_on_reset_link", :unique => true
24
+ add_index "password_recoveries", ["user_id"], :name => "index_password_recoveries_on_user_id", :unique => true
25
+
26
+ create_table "uploads", :force => true do |t|
27
+ t.integer "creator_id"
28
+ t.string "name"
29
+ t.string "caption", :limit => 1000
30
+ t.text "description"
31
+ t.boolean "is_public", :default => true
32
+ t.integer "uploadable_id"
33
+ t.string "uploadable_type"
34
+ t.string "width"
35
+ t.string "height"
36
+ t.string "local_file_name"
37
+ t.string "local_content_type"
38
+ t.integer "local_file_size"
39
+ t.datetime "local_updated_at"
40
+ t.string "local_fingerprint"
41
+ t.string "remote_file_name"
42
+ t.string "remote_content_type"
43
+ t.integer "remote_file_size"
44
+ t.datetime "remote_updated_at"
45
+ t.string "remote_fingerprint"
46
+ t.datetime "created_at", :null => false
47
+ t.datetime "updated_at", :null => false
48
+ end
49
+
50
+ add_index "uploads", ["creator_id"], :name => "index_uploads_on_creator_id"
51
+ add_index "uploads", ["local_file_name"], :name => "index_uploads_on_local_file_name"
52
+ add_index "uploads", ["uploadable_id"], :name => "index_uploads_on_uploadable_id"
53
+ add_index "uploads", ["uploadable_type"], :name => "index_uploads_on_uploadable_type"
54
+
55
+ create_table "users", :force => true do |t|
56
+ t.string "email"
57
+ t.string "password_digest"
58
+ t.boolean "admin"
59
+ t.datetime "created_at", :null => false
60
+ t.datetime "updated_at", :null => false
61
+ end
62
+
63
+ end