administrate-field-image 0.0.2 → 1.2.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
- SHA1:
3
- metadata.gz: a68a25016e03aea5296e1ec2f1a0b97793f46d15
4
- data.tar.gz: 251f9f9285960a46bf3c25a487f939efaa0f83d2
2
+ SHA256:
3
+ metadata.gz: 22d50e30ce09fa1d8de5adb7cdfb0da08cf5ee09d3ab14e7ce2ff946bfa0ce62
4
+ data.tar.gz: 40d83b517d0d006d9fb0d579a4416fdb4398d49e920932ade9bbbcf501eb1a2a
5
5
  SHA512:
6
- metadata.gz: 4836ce0a706939f63e18ce9f57cca822f7c99dd0866e309095143911a4d349f7837bce4243f530b8194213fd827f38454a18564b7b07199c6de388ae4c884226
7
- data.tar.gz: e1748f861c9b4befb44db7a9d8bcb23a59c8ef06d2b280b052a614ec3e7450a05c2035e7dfc95a64c58b2df89402d4d189751f0c3f589a39387b1c9a5fe5b8fb
6
+ metadata.gz: 66eb1e098eea69927db230c3537ddb84487fecfebfa89bbc19b9370176c93406249845f93a2eaf497ca10cd9ae21a46e3f5ca19b7388fc77505f5836ada6b837
7
+ data.tar.gz: 5b324a632ce314f2c8adaac4cd3d529b8ec66b06c419085dbcaac6b534c2ca5b488edd0265852ce8c7dced93defcdd3843095a1212cb30470a4c6bc84b9a7946
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: CI
3
+ on: [push]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - name: Set up Ruby
12
+ uses: ruby/setup-ruby@v1
13
+ - name: Install dependencies
14
+ run: bundle install
15
+ - name: Run tests
16
+ run: bundle exec rspec
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.0.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # CHANGELOG
2
+
3
+ ## 1.2.0 (2022-07-11)
4
+
5
+ * Fix #index preview crash on when no image attached ([#23])
6
+ * Use file_field instead of text_field in the form ([#22]]
7
+ * Setup GitHub Actions for CI ([#21])
8
+
9
+ [#21]: https://github.com/thoughtbot/administrate-field-image/pull/21
10
+ [#22]: https://github.com/thoughtbot/administrate-field-image/pull/22
11
+ [#23]: https://github.com/thoughtbot/administrate-field-image/pull/23
12
+
13
+ ## 1.1.0 (2017-03-24)
14
+
15
+ * Don't crash if image is nil/blank ([#9][])
16
+ * Remove Explicit Dependency on Rails ([#11][])
17
+ * Adds this CHANGELOG ([#12][])
18
+
19
+ [#9]: https://github.com/thoughtbot/administrate-field-image/pull/9
20
+ [#11]: https://github.com/thoughtbot/administrate-field-image/pull/11
21
+ [#12]: https://github.com/thoughtbot/administrate-field-image/pull/12
22
+
23
+ ## 1.0.0 (2017-01-16)
24
+
25
+ * Extraction from [administrate][].
26
+ * Rails 5 support.
27
+
28
+ [administrate]: https://github.com/thoughtbot/administrate
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2008-2017 thoughtbot, inc.
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -6,4 +6,28 @@ This repository is the first field plugin extracted out of Administrate.
6
6
  Although its structure may change,
7
7
  it's designed to act as a template for other Administrate field plugins.
8
8
 
9
+ ## FAQs
10
+
11
+ **Q: How should I name my gem?**
12
+
13
+ A: Administrate field gems must be named according to the [Rubygems naming guidelines].
14
+
15
+ Essentially, name your gem after the field class that it defines.
16
+ If there's a namespace in the class name, that gets translated to a dash (`-`) in the gem name.
17
+ If the class name is CamelCased, that translates to an underscore (`_`) in the gem name.
18
+
19
+ Since all administrate field gems are under the namespace `Administrate::Field`,
20
+ every field gem name should start with the prefix `administrate-field-`.
21
+
22
+ Here are some examples (these don't correspond to actual gems):
23
+
24
+ | Gem Name | Field Name |
25
+ |----------------------------|------------------------------|
26
+ | `administrate-field-image` | `Administrate::Field::Image` |
27
+ | `administrate-field-file_upload` | `Administrate::Field::FileUpload` |
28
+ | `administrate-field-geocoding-region` | `Administrate::Field::Geocoding::Region` |
29
+ | `administrate-field-geocoding-geo_json` | `Administrate::Field::Geocoding::GeoJson` |
30
+
31
+ [Rubygems naming guidelines]: http://guides.rubygems.org/name-your-gem/
32
+
9
33
  [Administrate]: https://github.com/thoughtbot/administrate
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env rake
2
+
3
+ begin
4
+ require "bundler/setup"
5
+ rescue LoadError
6
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
7
+ end
8
+
9
+ require "bundler/gem_tasks"
10
+
11
+ ##
12
+ # Configure the test suite.
13
+ ##
14
+ require "rspec/core"
15
+ require "rspec/core/rake_task"
16
+
17
+ RSpec::Core::RakeTask.new
18
+
19
+ ##
20
+ # By default, just run the tests.
21
+ ##
22
+ task default: :spec
@@ -1,13 +1,11 @@
1
1
  $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
- require "administrate/field/image"
4
-
5
3
  Gem::Specification.new do |gem|
6
4
  gem.name = "administrate-field-image"
7
- gem.version = Administrate::Field::Image::VERSION
8
- gem.authors = ["Grayson Wright"]
9
- gem.email = ["wright.grayson@gmail.com"]
10
- gem.homepage = "https://github.com/graysonwright/administrate_field_image"
5
+ gem.version = "1.2.0"
6
+ gem.authors = ["Grayson Wright", "Nick Charlton"]
7
+ gem.email = ["wright.grayson@gmail.com", "nick@nickcharlton.net"]
8
+ gem.homepage = "https://github.com/graysonwright/administrate-field-image"
11
9
  gem.summary = "Official Image field plugin for Administrate"
12
10
  gem.description = gem.summary
13
11
  gem.license = "MIT"
@@ -16,6 +14,7 @@ Gem::Specification.new do |gem|
16
14
  gem.files = `git ls-files`.split("\n")
17
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
16
 
19
- gem.add_dependency "administrate", ">= 0.2.0.rc1", "< 0.3.0"
20
- gem.add_dependency "rails", "~> 4.2"
17
+ gem.add_dependency "administrate", ">= 0.2.0.rc1"
18
+
19
+ gem.add_development_dependency "rspec", "~> 3.4"
21
20
  end
@@ -19,5 +19,5 @@ By default, the input is a text field for the image's URL.
19
19
  <%= f.label field.attribute %>
20
20
  </div>
21
21
  <div class="field-unit__field">
22
- <%= f.text_field field.attribute %>
22
+ <%= f.file_field field.attribute %>
23
23
  </div>
@@ -15,4 +15,4 @@ By default, the attribute is rendered as an image tag.
15
15
  [1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Image
16
16
  %>
17
17
 
18
- <%= image_tag field.data %>
18
+ <%= image_tag field.data if field.data.present? %>
@@ -15,4 +15,4 @@ By default, the attribute is rendered as an image tag.
15
15
  [1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Image
16
16
  %>
17
17
 
18
- <%= image_tag field.data %>
18
+ <%= image_tag field.data if field.data.present? %>
@@ -4,8 +4,6 @@ require "rails"
4
4
  module Administrate
5
5
  module Field
6
6
  class Image < Administrate::Field::Base
7
- VERSION = "0.0.2"
8
-
9
7
  class Engine < ::Rails::Engine
10
8
  end
11
9
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grayson Wright
8
- autorequire:
8
+ - Nick Charlton
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
12
+ date: 2022-07-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: administrate
@@ -17,9 +18,6 @@ dependencies:
17
18
  - - ">="
18
19
  - !ruby/object:Gem::Version
19
20
  version: 0.2.0.rc1
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: 0.3.0
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,42 +25,47 @@ dependencies:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
29
27
  version: 0.2.0.rc1
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: 0.3.0
33
28
  - !ruby/object:Gem::Dependency
34
- name: rails
29
+ name: rspec
35
30
  requirement: !ruby/object:Gem::Requirement
36
31
  requirements:
37
32
  - - "~>"
38
33
  - !ruby/object:Gem::Version
39
- version: '4.2'
40
- type: :runtime
34
+ version: '3.4'
35
+ type: :development
41
36
  prerelease: false
42
37
  version_requirements: !ruby/object:Gem::Requirement
43
38
  requirements:
44
39
  - - "~>"
45
40
  - !ruby/object:Gem::Version
46
- version: '4.2'
41
+ version: '3.4'
47
42
  description: Official Image field plugin for Administrate
48
43
  email:
49
44
  - wright.grayson@gmail.com
45
+ - nick@nickcharlton.net
50
46
  executables: []
51
47
  extensions: []
52
48
  extra_rdoc_files: []
53
49
  files:
50
+ - ".github/workflows/main.yml"
51
+ - ".gitignore"
52
+ - ".ruby-version"
53
+ - CHANGELOG.md
54
+ - Gemfile
55
+ - LICENSE
54
56
  - README.md
57
+ - Rakefile
55
58
  - administrate-field-image.gemspec
56
59
  - app/views/fields/image/_form.html.erb
57
60
  - app/views/fields/image/_index.html.erb
58
61
  - app/views/fields/image/_show.html.erb
59
62
  - lib/administrate/field/image.rb
60
63
  - spec/lib/administrate/field/image_spec.rb
61
- homepage: https://github.com/graysonwright/administrate_field_image
64
+ homepage: https://github.com/graysonwright/administrate-field-image
62
65
  licenses:
63
66
  - MIT
64
67
  metadata: {}
65
- post_install_message:
68
+ post_install_message:
66
69
  rdoc_options: []
67
70
  require_paths:
68
71
  - lib
@@ -77,9 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
80
  - !ruby/object:Gem::Version
78
81
  version: '0'
79
82
  requirements: []
80
- rubyforge_project:
81
- rubygems_version: 2.5.1
82
- signing_key:
83
+ rubygems_version: 3.2.22
84
+ signing_key:
83
85
  specification_version: 4
84
86
  summary: Official Image field plugin for Administrate
85
87
  test_files: