administrate-field-carrierwave 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e943fb6e75cee528c4c7535105a3b44033d062356b16f125ff7181440a83199
4
- data.tar.gz: 4251ee8e513bd2e958833b0cec3fd7cc600a17752a6d91738ae01c43e5e0e260
3
+ metadata.gz: 4c35090dece6d63d2beefce56064a76702435f65d1e6f402a5b874cca13cc038
4
+ data.tar.gz: c4607f596d442f8df41b698734b59e7a356b8ff84a4cefae60bc02ef19b4f4e2
5
5
  SHA512:
6
- metadata.gz: eda77052d25c80887b0ea7e964772634b5f79fc3781c15f3037ca225c262c8c6ae657e331ea1db83a9c524c06809a900109a108dde1b3bf7d6f1610fcc02fcf6
7
- data.tar.gz: 73be66e26b6327e808a0d2e08ccd5f424542dc511b89be7369eefa1410ca4db3508acadf95ebf5f4f03f52400d5f4c40653a8ecb9fb907c34d828236fa7b3ea3
6
+ metadata.gz: 190d25074a08a85535fd4e26c5fc5fe7011380a3715efc0c475db8d5544e3070c4fd1c96ec5112078dbc2365cd0cb90fd0b2e258275bb2fd924b9c4379cd5822
7
+ data.tar.gz: d66ab4a9de0a128a6e2d2c500da233c9c2b614741fc09b7f304f3c906117c33e7cd7eefe63509838ef712b6698467ba8736368ab913a613064cb6548b3495ff5
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.3
1
+ 2.6.0
data/.travis.yml ADDED
@@ -0,0 +1 @@
1
+ language: ruby
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.4.0](https://github.com/zooppa/administrate-field-carrierwave/tree/v0.4.0) (2019-03-04)
4
+
5
+ [Full Changelog](https://github.com/zooppa/administrate-field-carrierwave/compare/v0.3.4...v0.4.0)
6
+
7
+ * Remove preview on show
8
+
3
9
  ## [v0.3.4](https://github.com/zooppa/administrate-field-carrierwave/tree/v0.3.4) (2018-10-23)
4
10
 
5
11
  [Full Changelog](https://github.com/zooppa/administrate-field-carrierwave/compare/v0.3.3...v0.3.4)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Administrate::Field::Carrierwave
2
2
 
3
- [![Build Status](https://semaphoreci.com/api/v1/zooppa/administrate-field-carrierwave/branches/master/badge.svg)](https://semaphoreci.com/zooppa/administrate-field-carrierwave)
3
+ [![Build Status](https://travis-ci.com/zooppa/administrate-field-carrierwave.svg?branch=master)](https://travis-ci.com/zooppa/administrate-field-carrierwave)
4
4
  [![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-carrierwave/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-carrierwave)
5
5
 
6
6
  A plugin to upload and preview Carrierwave attachments in [Administrate].
@@ -10,7 +10,7 @@ A plugin to upload and preview Carrierwave attachments in [Administrate].
10
10
  Add it to your `Gemfile`:
11
11
 
12
12
  ```ruby
13
- gem 'administrate-field-carrierwave', '~> 0.3.4'
13
+ gem 'administrate-field-carrierwave', '~> 0.4.0'
14
14
  ```
15
15
 
16
16
  Run:
@@ -4,9 +4,9 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'administrate-field-carrierwave'
7
- gem.version = '0.3.4'
8
- gem.authors = ['Michele Gerarduzzi']
9
- gem.email = ['michele.gerarduzzi@gmail.com']
7
+ gem.version = '0.4.0'
8
+ gem.authors = ['Zooppa']
9
+ gem.email = ['dev@zooppa.com']
10
10
  gem.homepage = 'https://github.com/zooppa/administrate-field-carrierwave'
11
11
  gem.summary = 'Carrierwave field plugin for Administrate'
12
12
  gem.description = 'A plugin to manage Carrierwave attachments in Administrate'
@@ -22,9 +22,7 @@ for this attribute
22
22
  <span>No file(s) uploaded yet</span>
23
23
  <% end %>
24
24
  <% else %>
25
- <% if field.show_preview? %>
26
- <%= render 'fields/carrierwave/preview', file: field.file, field: field %>
27
- <% elsif field.show_file? %>
25
+ <% if field.show_file? %>
28
26
  <%= render 'fields/carrierwave/file', file: field.file %>
29
27
  <% else %>
30
28
  -
@@ -40,11 +40,6 @@ module Administrate
40
40
  data.try(:model)
41
41
  end
42
42
 
43
- def show_preview?
44
- has_file = model.try(:persisted?) && file.present?
45
- has_file && (image ? file.version_exists?(image) : true)
46
- end
47
-
48
43
  def show_file?
49
44
  file.present?
50
45
  end
@@ -155,32 +155,6 @@ describe Administrate::Field::Carrierwave do
155
155
  end
156
156
  end
157
157
 
158
- describe '#show_preview?' do
159
- let(:output) { subject.show_preview? }
160
-
161
- context 'when there is an image to show' do
162
- it 'returns true' do
163
- expect(output).to be_truthy
164
- end
165
- end
166
-
167
- context 'when there is no image to show' do
168
- let(:model) { double 'Model', persisted?: false }
169
-
170
- it 'returns false' do
171
- expect(output).to be_falsey
172
- end
173
- end
174
-
175
- context 'when there is an unversioned image to show' do
176
- let(:data) { cw_no_version }
177
-
178
- it 'returns true' do
179
- expect(output).to be_truthy
180
- end
181
- end
182
- end
183
-
184
158
  describe '#show_file?' do
185
159
  let(:output) { subject.show_file? }
186
160
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
- - Michele Gerarduzzi
7
+ - Zooppa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -130,7 +130,7 @@ dependencies:
130
130
  version: '0.59'
131
131
  description: A plugin to manage Carrierwave attachments in Administrate
132
132
  email:
133
- - michele.gerarduzzi@gmail.com
133
+ - dev@zooppa.com
134
134
  executables: []
135
135
  extensions: []
136
136
  extra_rdoc_files: []
@@ -139,6 +139,7 @@ files:
139
139
  - ".rspec"
140
140
  - ".rubocop.yml"
141
141
  - ".ruby-version"
142
+ - ".travis.yml"
142
143
  - CHANGELOG.md
143
144
  - CONTRIBUTING.md
144
145
  - Gemfile
@@ -150,7 +151,6 @@ files:
150
151
  - app/views/fields/carrierwave/_file.html.erb
151
152
  - app/views/fields/carrierwave/_form.html.erb
152
153
  - app/views/fields/carrierwave/_index.html.erb
153
- - app/views/fields/carrierwave/_preview.html.erb
154
154
  - app/views/fields/carrierwave/_show.html.erb
155
155
  - bin/_guard-core
156
156
  - bin/guard
@@ -176,8 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  requirements: []
179
- rubyforge_project:
180
- rubygems_version: 2.7.7
179
+ rubygems_version: 3.0.1
181
180
  signing_key:
182
181
  specification_version: 4
183
182
  summary: Carrierwave field plugin for Administrate
@@ -1 +0,0 @@
1
- <%= link_to image_tag(file.url(field.image), alt: file.filename), file.url, target: '_blank' %>