utopia-gallery 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/utopia/gallery/tags.rb +5 -2
- data/lib/utopia/gallery/version.rb +1 -1
- data/spec/utopia/gallery/site_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '085b1a92499a813b63c9f671ea6fb5c8c04d0933'
|
4
|
+
data.tar.gz: 43f18e4240c39ba8920438650cadd9b5d764d8fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbbd73e4f3b352c1ac397b7b4937b7971fbcfb2d0537d832ac1d36b19a6752c3de663f89fd6556714f69f934c28eb4463b520290af44afdfe4a05c3a5ac3b853
|
7
|
+
data.tar.gz: 212869947d7d7c5e172298d447f71d0cfdacef505d92bb5b1ace84519840fa0b320172c661251ba1725f8ef3e3ea4c2ba68d57fd4cec59b6308e2c9d85755d9c
|
data/README.md
CHANGED
@@ -6,7 +6,6 @@ This extension for [Utopia](https://github.com/ioquatix/utopia) provides tags fo
|
|
6
6
|
[![Code Climate](https://codeclimate.com/github/ioquatix/utopia-gallery.svg)](https://codeclimate.com/github/ioquatix/utopia-gallery)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/ioquatix/utopia-gallery/badge.svg)](https://coveralls.io/r/ioquatix/utopia-gallery)
|
8
8
|
|
9
|
-
|
10
9
|
## Installation
|
11
10
|
|
12
11
|
Add this line to your website's Gemfile:
|
@@ -17,6 +16,17 @@ And then execute:
|
|
17
16
|
|
18
17
|
$ bundle
|
19
18
|
|
19
|
+
### VIPS
|
20
|
+
|
21
|
+
If you want to use `utopia-gallery` with PDFs or SVGs, you need to ensure you have VIPS compiled correctly.
|
22
|
+
|
23
|
+
$ vips pdfload
|
24
|
+
load PDF with libpoppler
|
25
|
+
|
26
|
+
On Arch linux:
|
27
|
+
|
28
|
+
$ sudo pacman -S poppler-glib cairo librsvg
|
29
|
+
|
20
30
|
## Usage
|
21
31
|
|
22
32
|
Require the tag in your `config/environment.rb`:
|
data/lib/utopia/gallery/tags.rb
CHANGED
@@ -36,12 +36,14 @@ module Utopia
|
|
36
36
|
# @param media_root [String] Directory where media is stored.
|
37
37
|
# @param cache_root [String] Directory where media is cached.
|
38
38
|
# @param cache_root [String] The prefix path for the cached assets, served as static content.
|
39
|
-
def initialize(media_root: Utopia.default_root, cache_root: Utopia.default_root('public/_gallery'), cache_path: '/_gallery', processes: DEFAULT_PROCESSES)
|
39
|
+
def initialize(media_root: Utopia.default_root, cache_root: Utopia.default_root('public/_gallery'), cache_path: '/_gallery', processes: DEFAULT_PROCESSES, container_class: 'gallery')
|
40
40
|
@media_root = media_root
|
41
41
|
@cache_root = cache_root
|
42
42
|
@cache_path = cache_path
|
43
43
|
@processes = {}
|
44
44
|
|
45
|
+
@container_class = container_class
|
46
|
+
|
45
47
|
processes.each do |process|
|
46
48
|
name = process.name
|
47
49
|
|
@@ -66,8 +68,9 @@ module Utopia
|
|
66
68
|
container = Container.new(@media_root, path, **options)
|
67
69
|
|
68
70
|
media_tag_name = state[:tag] || 'img'
|
71
|
+
container_class = state[:class] || @container_class
|
69
72
|
|
70
|
-
document.tag('div', class:
|
73
|
+
document.tag('div', class: container_class) do
|
71
74
|
container.sort.each do |media|
|
72
75
|
cache = Cache.new(@media_root, @cache_root, @cache_path, media, @processes).update
|
73
76
|
document.tag(media_tag_name, src: cache, alt: media)
|
@@ -35,7 +35,7 @@ describe Utopia::Gallery do
|
|
35
35
|
it "should generate gallery of sample images" do
|
36
36
|
get "/index"
|
37
37
|
|
38
|
-
expect(last_response.body).to be == '<div class="gallery"><img src="/sample_images/IMG_3340.jpg" alt="IMG_3340"/><img src="/sample_images/IMG_3341.jpg" alt="IMG_3341"/><img src="/sample_images/IMG
|
38
|
+
expect(last_response.body).to be == '<div class="gallery"><img src="/sample_images/IMG_3340.jpg" alt="IMG_3340"/><img src="/sample_images/IMG_3341.jpg" alt="IMG_3341"/><img src="/sample_images/IMG%203344.jpg" alt="IMG 3344"/><img src="/sample_images/IMG_3351.jpg" alt="IMG_3351"/></div>'
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should generate a gallery using the specified tag" do
|
@@ -54,8 +54,8 @@ describe Utopia::Gallery do
|
|
54
54
|
<div class="caption">IMG_3341</div>
|
55
55
|
</span>
|
56
56
|
<span class="photo">
|
57
|
-
<a rel="photos" class="thumbnail" href="/_gallery/sample_images/large/IMG
|
58
|
-
<img src="/_gallery/sample_images/small/IMG
|
57
|
+
<a rel="photos" class="thumbnail" href="/_gallery/sample_images/large/IMG%203344.jpg" title="IMG 3344">
|
58
|
+
<img src="/_gallery/sample_images/small/IMG%203344.jpg" alt="IMG 3344"/>
|
59
59
|
</a>
|
60
60
|
<div class="caption">IMG 3344</div>
|
61
61
|
</span>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia-gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: utopia
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.6.
|
152
|
+
rubygems_version: 2.6.12
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: A gallery tag for use with the Utopia web framework.
|