administrate-field-paperclip 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3d41e35ed69b05f97239bfc3d8761ce29c423d55
4
- data.tar.gz: 1243a8110b8f491f69a82c3fdeb9cd9fa60d4e82
2
+ SHA256:
3
+ metadata.gz: e1912688400a8648c80a6e0b6da6edceea2e572cff2d4c13424d8541c2fcb5b0
4
+ data.tar.gz: 4ad6e9d18d822c98496e844c8fcd7a86eeb160b5f9d829a4723a825fd57fcb08
5
5
  SHA512:
6
- metadata.gz: '01836a41e2120c6a1a2873770be1abe15893cc4082b914a2a224711164c7230c51942ddf6f4d1fc9f7244a7750b2465469f24e622cec89bd0048e13706eee0d2'
7
- data.tar.gz: b731b352618d245bcfb251be6b1e12f9f459925ce6ec8cf5c065903fdc0046b057f62ad379c87e53abd05d67c9f549405ea873a448eda74d36199f9bb4b4e557
6
+ metadata.gz: b67d0174d9202a8345ef161dafe1b64011cfab05056e9be5fedf0d3f66410d557b64396e549ec8b812c97465832c2c6d2e99cf3324e29b2dbe692f774725c5df
7
+ data.tar.gz: 9267013c35eae198a6118166e5b615cc2eb3be69b0284fbf20447d47a48d34499bc9ccf80e402b50700728830f553d18966366205b1065ddd59bd8a0ddd8be04
@@ -0,0 +1,11 @@
1
+ rubocop:
2
+ runs-on: ubuntu-latest
3
+ steps:
4
+ - uses: actions/checkout@v2
5
+ - uses: ruby/setup-ruby@v1
6
+ with:
7
+ ruby-version: 2.7
8
+ - name: Run Rubocop
9
+ run: |
10
+ bundle install
11
+ bundle exec rubocop
@@ -0,0 +1,22 @@
1
+ name: Ruby
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ ruby: [ 2.4, 2.5, 2.6, 2.7, jruby ]
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: ${{ matrix.ruby }}
15
+ - name: Install dependencies
16
+ run: sudo apt-get install libsqlite3-dev
17
+ - name: Build
18
+ run: |
19
+ ruby -v
20
+ bundle install --jobs 4 --retry 3
21
+ - name: Test with Rake
22
+ run: bundle exec rspec
data/.gitignore CHANGED
@@ -7,4 +7,6 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- /*.gem
10
+ /*.gem
11
+ /spec/processed_images/
12
+ /.byebug_history
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,13 @@
1
+ Metrics/LineLength:
2
+ Max: 120
3
+
4
+ Documentation:
5
+ Enabled: false
6
+
7
+ Style/FrozenStringLiteralComment:
8
+ Enabled: false
9
+
10
+ # specs tend to get long
11
+ Metrics/BlockLength:
12
+ Exclude:
13
+ - 'spec/**/*'
@@ -0,0 +1,11 @@
1
+ SimpleCov.start 'rails' do
2
+ add_group 'app', 'app'
3
+ add_group 'lib', 'lib'
4
+
5
+ refuse_coverage_drop
6
+
7
+ formatter SimpleCov::Formatter::MultiFormatter.new([
8
+ SimpleCov::Formatter::HTMLFormatter,
9
+ Coveralls::SimpleCov::Formatter
10
+ ])
11
+ end
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 Fernando Briano
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Fernando Briano
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,25 +1,47 @@
1
- # Administrate::Field::Paperclip
2
-
3
- A plugin to integrate [Paperclip](https://github.com/thoughtbot/paperclip) fields in [Administrate](https://github.com/thoughtbot/administrate).
4
-
5
- # Instructions
6
-
7
- Add `administrate-field-paperclip` and `paperclip` to your Gemfile:
8
-
9
- ```
10
- gem 'administrate-field-paperclip'
11
- gem 'paperclip'
12
- ```
13
-
14
- Install:
15
-
16
- ```
17
- $ bundle install
18
- ```
19
-
20
- Follow the [instructions on Paperclip](https://github.com/thoughtbot/paperclip#quick-start) to get started with your models and migrations. Once you've added the Paperclip attribute to your models, edit your Administrate dashboards. If you added 'avatar' to 'User', then you should:
21
-
22
- * Add `avatar: Field::PaperclipField` to `ATTRIBUTE_TYPES`.
23
- * Add `:avatar` to `FORM_ATTRIBUTES`, `SHOW_PAGE_ATTRIBUTES` and (optionally) `COLLECTION_ATTRIBUTES`.
24
-
25
- Based on the [Administrate::Field::Image](https://github.com/thoughtbot/administrate-field-image) template.
1
+ # Administrate::Field::Paperclip
2
+
3
+ A plugin to integrate [Paperclip](https://github.com/thoughtbot/paperclip) fields in [Administrate](https://github.com/thoughtbot/administrate).
4
+
5
+ **[Paperclip has been deprecated](https://thoughtbot.com/blog/closing-the-trombone)**, so starting in version 0.0.6, this gem depends on [kt-paperclip](https://github.com/kreeti/kt-paperclip), an ongoing fork of Paperclip. If you're still using the deprecated version of Paperclip, version 0.0.5 should still work for you.
6
+
7
+ # Instructions
8
+
9
+ Add `administrate-field-paperclip` and `kt-paperclip` to your Gemfile:
10
+
11
+ ```
12
+ gem 'administrate-field-paperclip'
13
+ gem 'kt-paperclip'
14
+ ```
15
+
16
+ Install:
17
+
18
+ ```
19
+ $ bundle install
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ Follow the [instructions on Paperclip](https://github.com/kreeti/kt-paperclip#quick-start) to get started with your models and migrations. Once you've added the Paperclip attribute to your models, edit your Administrate dashboards. If you added 'avatar' to 'User', then you should:
25
+
26
+ ```ruby
27
+ class UserDashboard < Administrate::BaseDashboard
28
+ ATTRIBUTE_TYPES = {
29
+ avatar: Field::Paperclip,
30
+ }
31
+ # ...
32
+ ```
33
+
34
+ Then add `:avatar` to `FORM_ATTRIBUTES`, `SHOW_PAGE_ATTRIBUTES` and (optionally) `COLLECTION_ATTRIBUTES`.
35
+
36
+ You can provide the field with options using `Field::Paperclip.with_options(options)`:
37
+
38
+ * `thumbnail_style` (defaults to `'thumbnail'`) to control what image style is used to display the image in collection views
39
+ * `big_style` (defaults to `'original'`) to control what image style is used to display the image on the show page.
40
+ * `url_only` (defaults to `false`) to show only a URL (as a link) instead of trying to display an image.
41
+
42
+ ## [Contributors](https://github.com/picandocodigo/administrate-field-paperclip/graphs/contributors)
43
+
44
+ * Klas Eskilson - https://github.com/klaseskilson
45
+ * Rich - https://github.com/pedantic-git
46
+
47
+ Based on the [Administrate::Field::Image](https://github.com/thoughtbot/administrate-field-image) template.
data/Rakefile CHANGED
@@ -1,18 +1,16 @@
1
- #!/usr/bin/env rake
2
-
3
1
  begin
4
- require "bundler/setup"
2
+ require 'bundler/setup'
5
3
  rescue LoadError
6
- puts "You must `gem install bundler` and `bundle install` to run rake tasks"
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
5
  end
8
6
 
9
- require "bundler/gem_tasks"
7
+ require 'bundler/gem_tasks'
10
8
 
11
9
  ##
12
10
  # Configure the test suite.
13
11
  ##
14
- require "rspec/core"
15
- require "rspec/core/rake_task"
12
+ require 'rspec/core'
13
+ require 'rspec/core/rake_task'
16
14
 
17
15
  RSpec::Core::RakeTask.new
18
16
 
@@ -1,8 +1,8 @@
1
- $:.push File.expand_path('../lib', __FILE__)
1
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'administrate-field-paperclip'
5
- gem.version = '0.0.1'
5
+ gem.version = '0.0.6'
6
6
  gem.authors = ['Fernando Briano']
7
7
  gem.email = ['fernando@picandocodigo.net']
8
8
  gem.homepage = 'https://github.com/picandocodigo/administrate-field-paperclip'
@@ -14,8 +14,19 @@ Gem::Specification.new do |gem|
14
14
  gem.files = `git ls-files`.split("\n")
15
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split('\n')
16
16
 
17
- gem.add_dependency 'administrate', '~> 0.4'
18
- gem.add_dependency 'rails', '~> 5.0'
17
+ gem.add_dependency 'administrate', '~> 0.13'
18
+ gem.add_dependency 'rails', '>= 4.2'
19
19
 
20
+ if defined?(JRUBY_VERSION)
21
+ gem.add_development_dependency 'activerecord-jdbcsqlite3-adapter' if defined?(JRUBY_VERSION)
22
+ else
23
+ gem.add_development_dependency 'byebug'
24
+ gem.add_development_dependency 'sqlite3', '~> 1.3.6'
25
+ end
26
+ gem.add_development_dependency 'coveralls'
27
+ gem.add_development_dependency 'factory_girl'
28
+ gem.add_development_dependency 'kt-paperclip'
20
29
  gem.add_development_dependency 'rspec', '~> 3.5'
30
+ gem.add_development_dependency 'rubocop'
31
+ gem.add_development_dependency 'simplecov'
21
32
  end
@@ -0,0 +1,5 @@
1
+ <% if field.url_only? -%>
2
+ <%= link_to field.url, field.url if field.url.present? %>
3
+ <% else -%>
4
+ <%= image_tag field.thumbnail %>
5
+ <% end -%>
@@ -0,0 +1,5 @@
1
+ <% if field.url_only? -%>
2
+ <%= link_to field.url, field.url if field.url.present? %>
3
+ <% else -%>
4
+ <%= image_tag field.url if field.url.present? %>
5
+ <% end -%>
@@ -3,19 +3,38 @@ require 'rails'
3
3
 
4
4
  module Administrate
5
5
  module Field
6
- class PaperclipField < Administrate::Field::Base
7
- def url
8
- data.url
6
+ class Paperclip < Administrate::Field::Base
7
+ class Engine < ::Rails::Engine
8
+ end
9
+
10
+ def style(size = big_style)
11
+ data.try(:url, size) || ''
9
12
  end
10
13
 
14
+ delegate :url, to: :data
15
+
11
16
  def thumbnail
12
- data.url(:thumbnail)
17
+ style(thumbnail_style)
13
18
  end
14
19
 
15
- def to_s
16
- data
20
+ # Just display the URL as a link, rather than trying to make it an image
21
+ def url_only?
22
+ options.fetch(:url_only, false)
17
23
  end
18
- class Engine < ::Rails::Engine
24
+
25
+ alias url style
26
+
27
+ private
28
+
29
+ DEFAULT_THUMBNAIL_STYLE = :thumbnail
30
+ DEFAULT_BIG_STYLE = :original
31
+
32
+ def thumbnail_style
33
+ options.fetch(:thumbnail_style, DEFAULT_THUMBNAIL_STYLE)
34
+ end
35
+
36
+ def big_style
37
+ options.fetch(:big_style, DEFAULT_BIG_STYLE)
19
38
  end
20
39
  end
21
40
  end
@@ -0,0 +1,5 @@
1
+ FactoryGirl.define do
2
+ factory :post do
3
+ image { File.new(File.join('spec', 'fixtures', 'image.png')) }
4
+ end
5
+ end
Binary file
@@ -0,0 +1,16 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
4
+
5
+ class Post < ApplicationRecord
6
+ include Paperclip::Glue
7
+
8
+ has_attached_file :image,
9
+ styles: {
10
+ thumbnail: '4x4#',
11
+ extra: '2x4>'
12
+ }
13
+
14
+ # validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/
15
+ do_not_validate_attachment_file_type :image
16
+ end
@@ -0,0 +1,78 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Administrate::Field::Paperclip do
4
+ let(:post) { create(:post) }
5
+ let(:page) { :show }
6
+ let(:field) { described_class.new(:image, post.image, page) }
7
+ let(:empty_field) { described_class.new(:image, nil, page) }
8
+
9
+ require 'administrate/field/paperclip'
10
+
11
+ describe '#to_partial_path' do
12
+ it 'returns a partial based on the page being rendered' do
13
+ expect(empty_field.to_partial_path).to eq("/fields/paperclip/#{page}")
14
+ end
15
+ end
16
+
17
+ PAPECLIP_FIELD_METHODS = %w[style thumbnail url].freeze
18
+ PAPECLIP_FIELD_METHODS.each do |method|
19
+ describe "##{method}" do
20
+ context 'when inner_attribute is not set' do
21
+ it 'should return a non-nil url' do
22
+ expect(field.send(method)).to_not eq ''
23
+ end
24
+ end
25
+
26
+ context 'when image attachment doesn\'t exist' do
27
+ it 'should return empty string' do
28
+ expect(empty_field.send(method)).to eq ''
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ describe '#thumbnail' do
35
+ context 'when thumbnail size is provided as an option' do
36
+ let(:field) { described_class.new(:image, post.image, page, thumbnail_style: :extra) }
37
+
38
+ it 'should return a string to the correct image' do
39
+ expect(field.thumbnail).to_not be_nil
40
+ expect(field.thumbnail).to include('extra')
41
+ end
42
+ end
43
+ end
44
+
45
+ describe '#style' do
46
+ context 'when big image style is provided as an option' do
47
+ let(:field) { described_class.new(:image, post.image, page, big_style: :extra) }
48
+
49
+ it 'should return a string to the correct image' do
50
+ expect(field.style).to_not be_nil
51
+ expect(field.style).to include('extra')
52
+ end
53
+ end
54
+
55
+ context 'when image style is provided as a parameter' do
56
+ let(:field) { described_class.new(:image, post.image, page) }
57
+
58
+ it 'should return a string to the correct image' do
59
+ expect(field.style(:extra)).to_not be_nil
60
+ expect(field.style(:extra)).to include('extra')
61
+ end
62
+ end
63
+ end
64
+
65
+ describe '#url_only?' do
66
+ context 'with no options' do
67
+ it 'should be false' do
68
+ expect(field.url_only?).to be false
69
+ end
70
+ end
71
+ context 'with url_only option true' do
72
+ let(:field) { described_class.new(:image, post.image, page, url_only: true) }
73
+ it 'should be true' do
74
+ expect(field.url_only?).to be true
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,14 @@
1
+ # make sure we have paperclip here
2
+ require 'paperclip'
3
+
4
+ # rubocop:disable Style/MixinUsage
5
+ include Paperclip::Schema
6
+ # rubocop:enable Style/MixinUsage
7
+
8
+ ActiveRecord::Schema.define do
9
+ self.verbose = false
10
+
11
+ create_table :posts, force: true do |t|
12
+ t.attachment :image
13
+ end
14
+ end
@@ -0,0 +1,34 @@
1
+ # start coverage tracking
2
+ require 'coveralls'
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+
6
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
7
+
8
+ require 'administrate/field/paperclip'
9
+
10
+ # config Paperclip for testing purposes
11
+ require 'paperclip'
12
+ Paperclip::Attachment.default_options[:storage] = :filesystem
13
+ Paperclip::Attachment.default_options[:path] = '../processed_images'
14
+
15
+ # enable debugging using byebug
16
+ require 'byebug' unless defined?(JRUBY_VERSION)
17
+
18
+ # start up factory_girl
19
+ require 'factory_girl'
20
+
21
+ # start db and load migrations and everything
22
+ require 'active_record'
23
+ ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
24
+ require_relative 'schema'
25
+ require_relative 'models'
26
+
27
+ # config rspec
28
+ RSpec.configure do |config|
29
+ # configure factory girl
30
+ config.include FactoryGirl::Syntax::Methods
31
+ config.before(:suite) do
32
+ FactoryGirl.find_definitions
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-07 00:00:00.000000000 Z
11
+ date: 2020-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -16,28 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.4'
19
+ version: '0.13'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.4'
26
+ version: '0.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: '4.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '4.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
37
58
  requirements:
38
59
  - - "~>"
39
60
  - !ruby/object:Gem::Version
40
- version: '5.0'
61
+ version: 1.3.6
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.6
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: factory_girl
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: kt-paperclip
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
41
111
  - !ruby/object:Gem::Dependency
42
112
  name: rspec
43
113
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +122,34 @@ dependencies:
52
122
  - - "~>"
53
123
  - !ruby/object:Gem::Version
54
124
  version: '3.5'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
55
153
  description: Integrates Paperclip as a field for Administrate in Rails apps
56
154
  email:
57
155
  - fernando@picandocodigo.net
@@ -59,16 +157,28 @@ executables: []
59
157
  extensions: []
60
158
  extra_rdoc_files: []
61
159
  files:
160
+ - ".github/workflows/rubocop.yml"
161
+ - ".github/workflows/tests.yml"
62
162
  - ".gitignore"
163
+ - ".rspec"
164
+ - ".rubocop.yml"
165
+ - ".simplecov"
63
166
  - Gemfile
64
167
  - LICENSE
65
168
  - README.md
66
169
  - Rakefile
67
170
  - administrate-field-paperclip.gemspec
68
- - app/views/fields/paperclip_field/_form.html.erb
69
- - app/views/fields/paperclip_field/_index.html.erb
70
- - app/views/fields/paperclip_field/_show.html.erb
171
+ - app/views/fields/paperclip/_form.html.erb
172
+ - app/views/fields/paperclip/_index.html.erb
173
+ - app/views/fields/paperclip/_show.html.erb
71
174
  - lib/administrate/field/paperclip.rb
175
+ - spec/factories/posts.rb
176
+ - spec/fixtures/image.png
177
+ - spec/models.rb
178
+ - spec/paperclip_spec.rb
179
+ - spec/processed_images/.keep
180
+ - spec/schema.rb
181
+ - spec/spec_helper.rb
72
182
  homepage: https://github.com/picandocodigo/administrate-field-paperclip
73
183
  licenses:
74
184
  - MIT
@@ -88,10 +198,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
198
  - !ruby/object:Gem::Version
89
199
  version: '0'
90
200
  requirements: []
91
- rubyforge_project:
92
- rubygems_version: 2.6.10
201
+ rubygems_version: 3.1.2
93
202
  signing_key:
94
203
  specification_version: 4
95
204
  summary: Paperclip field plugin for Administrate
96
205
  test_files: []
97
- has_rdoc:
@@ -1 +0,0 @@
1
- <%= image_tag field.thumbnail %>
@@ -1 +0,0 @@
1
- <%= image_tag field.url if field.url.present? %>