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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d3002edbbeffeaf8c5f2e98f47ec631d8f9fe7d
4
- data.tar.gz: fb90b5bdfa8ee4d95223cf418f534179641f8198
3
+ metadata.gz: '085b1a92499a813b63c9f671ea6fb5c8c04d0933'
4
+ data.tar.gz: 43f18e4240c39ba8920438650cadd9b5d764d8fc
5
5
  SHA512:
6
- metadata.gz: 663e13e7e9359179e0efe47227ee747b7dffa569fa5fad0b01fdaafdd151bc194717c2711ee09d597cb4987d3636082838e6a1f01525b0405f59b610e2c4c744
7
- data.tar.gz: 619821213836725b794e66b847ace542a1eb11cdf9846d4cb28837f4c372a6afdec5da6b06941a05e8997f629bdd700d716384cdfb97520e6362ca382bf253f3
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`:
@@ -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: 'gallery') do
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)
@@ -1,5 +1,5 @@
1
1
  module Utopia
2
2
  module Gallery
3
- VERSION = "2.1.0"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
@@ -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+3344.jpg" alt="IMG 3344"/><img src="/sample_images/IMG_3351.jpg" alt="IMG_3351"/></div>'
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+3344.jpg" title="IMG 3344">
58
- <img src="/_gallery/sample_images/small/IMG+3344.jpg" alt="IMG 3344"/>
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.1.0
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-03-30 00:00:00.000000000 Z
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.10
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.