administrate-field-carrierwave 0.3.2 → 0.3.3

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: 505ff07bb8b8dc13a7926c9a327bf73068de8564d6fe89b7cc84f5236e7c1bde
4
- data.tar.gz: 19bc883f883ecdb2f70156c58083f0067fed395259e148b1e000a42a41321223
3
+ metadata.gz: 3e06215467cf2202c2c081140fb7676b891de7e3a7e5f4d971ef78144f8b5bcd
4
+ data.tar.gz: f9ef96c25f4705381150fc96f7098bd617e8faef81c717f39abd606c57e060f0
5
5
  SHA512:
6
- metadata.gz: 7ffbfa4ac815083b73c806a26089d8f43499a8022a52c2cf3650b844c5f566d7a33514cf4c4b8ba3ec8f4fd3c32cd078d5546076caefcdac6e3cc03d66801180
7
- data.tar.gz: e11d1584a89a28f1dbffe2030696c9061e426b5c8538e5d18fe377f979c381fc7f80ed2693cf9d32d6b660442aa72fe89545a12d9ba9495a95bee7269191e115
6
+ metadata.gz: ddcbfba35becd5eedb7c3a07427df242a1351c7a070438f378c7dfbf47d18a5ee8eea39747503dfbeb234d102072a764719a6f268a84472bd10801817daf9335
7
+ data.tar.gz: 719e67c4a90194e28156f7dea326a8d8c587af9649c59c67378ed5b1468e9b68981d53c9c7380c18357eecb63232d062a6a539c3027675af0d40ca072de27631
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  *.gem
2
2
  Gemfile.lock
3
+ .ruby-gemset
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'bin/*'
4
+
5
+ Documentation:
6
+ Enabled: false
7
+
8
+ Metrics/BlockLength:
9
+ Exclude:
10
+ - 'spec/**/*.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.3.3](https://github.com/zooppa/administrate-field-carrierwave/tree/v0.3.3) (2018-10-11)
4
+
5
+ [Full Changelog](https://github.com/zooppa/administrate-field-carrierwave/compare/v0.3.2...v0.3.3)
6
+
7
+ * Fix form with nested attributes (thanks @JapArt)
8
+ * Add RuboCop and Guard
9
+ * Add contribution guidelines
10
+
3
11
  ## [v0.3.2](https://github.com/zooppa/administrate-field-carrierwave/tree/v0.3.2) (2018-03-06)
4
12
 
5
13
  [Full Changelog](https://github.com/zooppa/administrate-field-carrierwave/compare/v0.3.1...v0.3.2)
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,9 @@
1
+ # Contributing
2
+
3
+ 1. [Fork this repository](https://help.github.com/articles/fork-a-repo/)
4
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
5
+ 3. Run `guard`
6
+ 4. Make changes and keep an eye on RuboCop violations and green tests
7
+ 5. Commit your changes (`git commit -am 'Add a feature'`)
8
+ 6. Push to the branch (`git push origin my-new-feature`)
9
+ 7. [Create a new pull request](https://help.github.com/articles/creating-a-pull-request/)
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/Guardfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ directories(%w[app lib spec]).select do |d|
4
+ Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")
5
+ end
6
+
7
+ guard :rspec, cmd: 'rspec' do
8
+ watch(%r{^spec/.+_spec\.rb$})
9
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
10
+ watch('spec/spec_helper.rb') { 'spec' }
11
+ end
12
+
13
+ guard :rubocop do
14
+ watch(%r{/.+\.rb$/})
15
+ watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
16
+ end
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Administrate::Field::Carrierwave
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-carrierwave/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-carrierwave)
4
3
  [![Build Status](https://semaphoreci.com/api/v1/zooppa/administrate-field-carrierwave/branches/master/badge.svg)](https://semaphoreci.com/zooppa/administrate-field-carrierwave)
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].
7
7
 
@@ -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.2'
13
+ gem 'administrate-field-carrierwave', '~> 0.3.3'
14
14
  ```
15
15
 
16
16
  Run:
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,8 +1,10 @@
1
- $:.push File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
4
 
3
5
  Gem::Specification.new do |gem|
4
6
  gem.name = 'administrate-field-carrierwave'
5
- gem.version = '0.3.2'
7
+ gem.version = '0.3.3'
6
8
  gem.authors = ['Michele Gerarduzzi']
7
9
  gem.email = ['michele.gerarduzzi@gmail.com']
8
10
  gem.homepage = 'https://github.com/zooppa/administrate-field-carrierwave'
@@ -17,6 +19,10 @@ Gem::Specification.new do |gem|
17
19
  gem.add_runtime_dependency 'administrate', '< 1.0.0'
18
20
  gem.add_runtime_dependency 'rails', '>= 4.2', '< 6'
19
21
 
22
+ gem.add_development_dependency 'guard', '~> 2.14'
23
+ gem.add_development_dependency 'guard-rspec', '~> 4.7'
24
+ gem.add_development_dependency 'guard-rubocop', '~> 1.3'
20
25
  gem.add_development_dependency 'rake', '~> 12.3'
21
26
  gem.add_development_dependency 'rspec', '~> 3.7'
27
+ gem.add_development_dependency 'rubocop', '~> 0.59'
22
28
  end
data/bin/_guard-core ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application '_guard-core' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("guard", "_guard-core")
data/bin/guard ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'guard' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("guard", "guard")
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'administrate/field/base'
2
4
  require 'rails'
3
5
 
@@ -35,7 +37,9 @@ module Administrate
35
37
  end
36
38
 
37
39
  def show_preview?
38
- data.model.persisted? && file.version_exists?(image) && data.file.present?
40
+ data&.model&.persisted? &&
41
+ data&.file.present? &&
42
+ file.version_exists?(image)
39
43
  end
40
44
 
41
45
  def show_file?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Administrate::Field::Carrierwave do
@@ -5,8 +7,12 @@ describe Administrate::Field::Carrierwave do
5
7
  let(:model) { double 'Model', persisted?: true }
6
8
  let(:file) { double 'File' }
7
9
 
8
- let(:cw_file) { double 'CW with file', model: model, file: file, version_exists?: true }
9
- let(:cw_no_file) { double 'CW without file', model: model, file: nil, version_exists?: true }
10
+ let(:cw_file) do
11
+ double 'CW with file', model: model, file: file, version_exists?: true
12
+ end
13
+ let(:cw_no_file) do
14
+ double 'CW without file', model: model, file: nil, version_exists?: true
15
+ end
10
16
 
11
17
  let(:data) { cw_file }
12
18
  let(:options) { {} }
data/spec/spec_helper.rb CHANGED
@@ -1,2 +1,4 @@
1
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
2
4
  require 'administrate/field/carrierwave'
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.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Gerarduzzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-06 00:00:00.000000000 Z
11
+ date: 2018-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -44,6 +44,48 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '6'
47
+ - !ruby/object:Gem::Dependency
48
+ name: guard
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.14'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.14'
61
+ - !ruby/object:Gem::Dependency
62
+ name: guard-rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '4.7'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '4.7'
75
+ - !ruby/object:Gem::Dependency
76
+ name: guard-rubocop
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.3'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.3'
47
89
  - !ruby/object:Gem::Dependency
48
90
  name: rake
49
91
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +114,20 @@ dependencies:
72
114
  - - "~>"
73
115
  - !ruby/object:Gem::Version
74
116
  version: '3.7'
117
+ - !ruby/object:Gem::Dependency
118
+ name: rubocop
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0.59'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '0.59'
75
131
  description: A plugin to manage Carrierwave attachments in Administrate
76
132
  email:
77
133
  - michele.gerarduzzi@gmail.com
@@ -81,8 +137,12 @@ extra_rdoc_files: []
81
137
  files:
82
138
  - ".gitignore"
83
139
  - ".rspec"
140
+ - ".rubocop.yml"
141
+ - ".ruby-version"
84
142
  - CHANGELOG.md
143
+ - CONTRIBUTING.md
85
144
  - Gemfile
145
+ - Guardfile
86
146
  - LICENSE.md
87
147
  - README.md
88
148
  - Rakefile
@@ -92,6 +152,8 @@ files:
92
152
  - app/views/fields/carrierwave/_index.html.erb
93
153
  - app/views/fields/carrierwave/_preview.html.erb
94
154
  - app/views/fields/carrierwave/_show.html.erb
155
+ - bin/_guard-core
156
+ - bin/guard
95
157
  - lib/administrate/field/carrierwave.rb
96
158
  - spec/lib/administrate/field/carrierwave_spec.rb
97
159
  - spec/spec_helper.rb
@@ -115,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
177
  version: '0'
116
178
  requirements: []
117
179
  rubyforge_project:
118
- rubygems_version: 2.7.6
180
+ rubygems_version: 2.7.7
119
181
  signing_key:
120
182
  specification_version: 4
121
183
  summary: Carrierwave field plugin for Administrate