refile 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/refile.rb +252 -27
- data/lib/refile/app.rb +55 -14
- data/lib/refile/attacher.rb +39 -40
- data/lib/refile/attachment.rb +28 -13
- data/lib/refile/attachment/active_record.rb +90 -1
- data/lib/refile/attachment_definition.rb +47 -0
- data/lib/refile/backend/s3.rb +1 -147
- data/lib/refile/backend_macros.rb +13 -5
- data/lib/refile/custom_logger.rb +3 -1
- data/lib/refile/file.rb +9 -0
- data/lib/refile/image_processing.rb +1 -143
- data/lib/refile/rails.rb +30 -0
- data/lib/refile/rails/attachment_helper.rb +27 -16
- data/lib/refile/signature.rb +5 -0
- data/lib/refile/simple_form.rb +17 -0
- data/lib/refile/version.rb +1 -1
- data/spec/refile/active_record_helper.rb +11 -0
- data/spec/refile/app_spec.rb +197 -20
- data/spec/refile/attachment/active_record_spec.rb +298 -1
- data/spec/refile/attachment_helper_spec.rb +39 -0
- data/spec/refile/attachment_spec.rb +53 -5
- data/spec/refile/backend_examples.rb +13 -2
- data/spec/refile/backend_macros_spec.rb +27 -6
- data/spec/refile/custom_logger_spec.rb +2 -3
- data/spec/refile/features/direct_upload_spec.rb +18 -0
- data/spec/refile/features/multiple_upload_spec.rb +122 -0
- data/spec/refile/features/normal_upload_spec.rb +5 -3
- data/spec/refile/features/presigned_upload_spec.rb +4 -0
- data/spec/refile/features/simple_form_spec.rb +8 -0
- data/spec/refile/fixtures/monkey.txt +1 -0
- data/spec/refile/fixtures/world.txt +1 -0
- data/spec/refile/spec_helper.rb +21 -11
- data/spec/refile_spec.rb +253 -24
- metadata +12 -303
- data/.gitignore +0 -27
- data/.rspec +0 -2
- data/.rubocop.yml +0 -68
- data/.travis.yml +0 -21
- data/.yardopts +0 -1
- data/CONTRIBUTING.md +0 -33
- data/Gemfile +0 -3
- data/History.md +0 -96
- data/LICENSE.txt +0 -22
- data/README.md +0 -651
- data/Rakefile +0 -19
- data/app/assets/javascripts/refile.js +0 -63
- data/config.ru +0 -8
- data/config/locales/en.yml +0 -8
- data/config/routes.rb +0 -5
- data/refile.gemspec +0 -42
- data/spec/refile/backend/s3_spec.rb +0 -11
- data/spec/refile/test_app.rb +0 -65
- data/spec/refile/test_app/app/assets/javascripts/application.js +0 -42
- data/spec/refile/test_app/app/controllers/application_controller.rb +0 -2
- data/spec/refile/test_app/app/controllers/direct_posts_controller.rb +0 -15
- data/spec/refile/test_app/app/controllers/home_controller.rb +0 -4
- data/spec/refile/test_app/app/controllers/normal_posts_controller.rb +0 -48
- data/spec/refile/test_app/app/controllers/presigned_posts_controller.rb +0 -31
- data/spec/refile/test_app/app/models/post.rb +0 -5
- data/spec/refile/test_app/app/views/direct_posts/new.html.erb +0 -20
- data/spec/refile/test_app/app/views/home/index.html.erb +0 -1
- data/spec/refile/test_app/app/views/layouts/application.html.erb +0 -14
- data/spec/refile/test_app/app/views/normal_posts/_form.html.erb +0 -28
- data/spec/refile/test_app/app/views/normal_posts/edit.html.erb +0 -1
- data/spec/refile/test_app/app/views/normal_posts/index.html +0 -5
- data/spec/refile/test_app/app/views/normal_posts/new.html.erb +0 -1
- data/spec/refile/test_app/app/views/normal_posts/show.html.erb +0 -19
- data/spec/refile/test_app/app/views/presigned_posts/new.html.erb +0 -16
- data/spec/refile/test_app/config/database.yml +0 -7
- data/spec/refile/test_app/config/routes.rb +0 -17
- data/spec/refile/test_app/public/favicon.ico +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
<%= render "form" %>
|
@@ -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,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
|