refile 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/refile.rb +252 -27
  3. data/lib/refile/app.rb +55 -14
  4. data/lib/refile/attacher.rb +39 -40
  5. data/lib/refile/attachment.rb +28 -13
  6. data/lib/refile/attachment/active_record.rb +90 -1
  7. data/lib/refile/attachment_definition.rb +47 -0
  8. data/lib/refile/backend/s3.rb +1 -147
  9. data/lib/refile/backend_macros.rb +13 -5
  10. data/lib/refile/custom_logger.rb +3 -1
  11. data/lib/refile/file.rb +9 -0
  12. data/lib/refile/image_processing.rb +1 -143
  13. data/lib/refile/rails.rb +30 -0
  14. data/lib/refile/rails/attachment_helper.rb +27 -16
  15. data/lib/refile/signature.rb +5 -0
  16. data/lib/refile/simple_form.rb +17 -0
  17. data/lib/refile/version.rb +1 -1
  18. data/spec/refile/active_record_helper.rb +11 -0
  19. data/spec/refile/app_spec.rb +197 -20
  20. data/spec/refile/attachment/active_record_spec.rb +298 -1
  21. data/spec/refile/attachment_helper_spec.rb +39 -0
  22. data/spec/refile/attachment_spec.rb +53 -5
  23. data/spec/refile/backend_examples.rb +13 -2
  24. data/spec/refile/backend_macros_spec.rb +27 -6
  25. data/spec/refile/custom_logger_spec.rb +2 -3
  26. data/spec/refile/features/direct_upload_spec.rb +18 -0
  27. data/spec/refile/features/multiple_upload_spec.rb +122 -0
  28. data/spec/refile/features/normal_upload_spec.rb +5 -3
  29. data/spec/refile/features/presigned_upload_spec.rb +4 -0
  30. data/spec/refile/features/simple_form_spec.rb +8 -0
  31. data/spec/refile/fixtures/monkey.txt +1 -0
  32. data/spec/refile/fixtures/world.txt +1 -0
  33. data/spec/refile/spec_helper.rb +21 -11
  34. data/spec/refile_spec.rb +253 -24
  35. metadata +12 -303
  36. data/.gitignore +0 -27
  37. data/.rspec +0 -2
  38. data/.rubocop.yml +0 -68
  39. data/.travis.yml +0 -21
  40. data/.yardopts +0 -1
  41. data/CONTRIBUTING.md +0 -33
  42. data/Gemfile +0 -3
  43. data/History.md +0 -96
  44. data/LICENSE.txt +0 -22
  45. data/README.md +0 -651
  46. data/Rakefile +0 -19
  47. data/app/assets/javascripts/refile.js +0 -63
  48. data/config.ru +0 -8
  49. data/config/locales/en.yml +0 -8
  50. data/config/routes.rb +0 -5
  51. data/refile.gemspec +0 -42
  52. data/spec/refile/backend/s3_spec.rb +0 -11
  53. data/spec/refile/test_app.rb +0 -65
  54. data/spec/refile/test_app/app/assets/javascripts/application.js +0 -42
  55. data/spec/refile/test_app/app/controllers/application_controller.rb +0 -2
  56. data/spec/refile/test_app/app/controllers/direct_posts_controller.rb +0 -15
  57. data/spec/refile/test_app/app/controllers/home_controller.rb +0 -4
  58. data/spec/refile/test_app/app/controllers/normal_posts_controller.rb +0 -48
  59. data/spec/refile/test_app/app/controllers/presigned_posts_controller.rb +0 -31
  60. data/spec/refile/test_app/app/models/post.rb +0 -5
  61. data/spec/refile/test_app/app/views/direct_posts/new.html.erb +0 -20
  62. data/spec/refile/test_app/app/views/home/index.html.erb +0 -1
  63. data/spec/refile/test_app/app/views/layouts/application.html.erb +0 -14
  64. data/spec/refile/test_app/app/views/normal_posts/_form.html.erb +0 -28
  65. data/spec/refile/test_app/app/views/normal_posts/edit.html.erb +0 -1
  66. data/spec/refile/test_app/app/views/normal_posts/index.html +0 -5
  67. data/spec/refile/test_app/app/views/normal_posts/new.html.erb +0 -1
  68. data/spec/refile/test_app/app/views/normal_posts/show.html.erb +0 -19
  69. data/spec/refile/test_app/app/views/presigned_posts/new.html.erb +0 -16
  70. data/spec/refile/test_app/config/database.yml +0 -7
  71. data/spec/refile/test_app/config/routes.rb +0 -17
  72. data/spec/refile/test_app/public/favicon.ico +0 -0
@@ -1 +0,0 @@
1
- <%= render "form" %>
@@ -1,5 +0,0 @@
1
- <h1>Posts</h1>
2
-
3
- <% @posts.each do |post| %>
4
- <h2><%= post.title %></h2>
5
- <% end %>
@@ -1 +0,0 @@
1
- <%= render "form" %>
@@ -1,19 +0,0 @@
1
- <h1><%= @post.title %></h1>
2
-
3
- <% if @post.image %>
4
- <%= attachment_image_tag(@post, :image) %>
5
- <% end %>
6
-
7
- <% if @post.document %>
8
- <%= link_to "Document", attachment_url(@post, :document) %>
9
-
10
- <p class="content-type"><%= @post.document_content_type %></p>
11
- <p class="size"><%= @post.document_size %></p>
12
- <p class="filename"><%= @post.document_filename %></p>
13
-
14
- <%= link_to "Convert to Upper", attachment_url(@post, :document, :convert_case, format: "up") %>
15
- <% end %>
16
-
17
- <%= link_to "Edit", edit_normal_post_url(@post) %>
18
-
19
- <%= link_to "Delete", normal_post_url(@post), method: :delete %>
@@ -1,16 +0,0 @@
1
- <%= form_for [:presigned, @post], html: { id: "direct" } do |form| %>
2
- <p>
3
- <%= @post.errors.full_messages.to_sentence %>
4
- </p>
5
- <p>
6
- <%= form.label :title %>
7
- <%= form.text_field :title %>
8
- </p>
9
- <p>
10
- <%= form.label :document %>
11
- <%= form.attachment_field :document, presigned: true %>
12
- </p>
13
- <p>
14
- <%= form.submit "Create" %>
15
- </p>
16
- <% end %>
@@ -1,7 +0,0 @@
1
- development: &default
2
- adapter: "sqlite3"
3
- database: "db/db.sqlite"
4
- verbosity: "quiet"
5
-
6
- test:
7
- <<: *default
@@ -1,17 +0,0 @@
1
- Refile::TestApp.routes.draw do
2
- root to: "home#index"
3
-
4
- scope path: "normal", as: "normal" do
5
- resources :posts, controller: "normal_posts"
6
- end
7
-
8
- scope path: "direct", as: "direct" do
9
- resources :posts, only: [:new, :create], controller: "direct_posts"
10
- end
11
-
12
- scope path: "presigned", as: "presigned" do
13
- resources :posts, only: [:new, :create], controller: "presigned_posts" do
14
- post :upload, on: :collection
15
- end
16
- end
17
- end
File without changes