jekyll-imgproxy-tag 0.1.0 → 0.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
  SHA256:
3
- metadata.gz: 4986a8d138622cab25b06efb7716d58786a2dd34e646f6ed2c34c94d79d4eda5
4
- data.tar.gz: 9d4fd300c70729f06a9df38ea742bba7ea7f0428664fb542a1d1025063e2c6be
3
+ metadata.gz: 93d9cf64777bdf8dec7fc86157adaea3583a1852efc806f9d05692cb500afb7f
4
+ data.tar.gz: c70b5a8a761ff1af47bcc6495c26d8dd4d7cf5282fdf1a1431a20c7990223699
5
5
  SHA512:
6
- metadata.gz: 34d27de575af077407197a0e3c9f1e518d5c6b3a8f006d9feaa84ec1932ff2c4243571dd2da87477e81290e4d2ee4214bcf04363f0424bf5975402d87af7e42a
7
- data.tar.gz: 28c1efba10ef21ff65f7941606633868b87e4a30cc0ec58dffa79ffa1cb918ffea7d7b54cf1ab238090b5739e924ad850f2fc9610e658d44205036254a8360cf
6
+ metadata.gz: c2afe6b962fd12b38d261bc7e554baa01821d073b0f2dc57767e105a92e4785821112d4ad579f61adfc9601c2a94c5b0f1d9766540917d9845a338752ab7a472
7
+ data.tar.gz: d183df96f205344dce6e335304e6dcf879224b37a3f1a3ecd5301768358c7062b90248a3c9648fc3c68d6aa398b8e97c2a8b814e962984a17b3e34a3f38ff1bd
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/CHANGELOG ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] - 2022-06-12
11
+
12
+ ### Changed
13
+
14
+ - Refactored the `PathBuilder` to check that there's a path to an image passed
15
+ to it, otherwise, raise an error. Without a image path, this would be useless.
16
+
17
+ ## [0.1.0] - 2022-06-07
18
+
19
+ ### Added
20
+
21
+ - Everything
22
+
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-imgproxy-tag (0.1.0)
4
+ jekyll-imgproxy-tag (0.2.0)
5
5
  jekyll
6
6
 
7
7
  GEM
@@ -24,6 +24,10 @@ module Jekyll
24
24
  class BaseUrlNotSet < Error
25
25
  '"base_url" not set in Jekyll Imgproxy config'
26
26
  end
27
+
28
+ class PathNotSet < Error
29
+ '"path" to image is not provided'
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -9,7 +9,6 @@ module Jekyll
9
9
  def initialize(config, options)
10
10
  @config = config
11
11
  @options = options
12
- @path = @options.delete('path')
13
12
 
14
13
  @resizing_type = 'rs:fit'
15
14
  @width = ':'
@@ -20,15 +19,18 @@ module Jekyll
20
19
  def build
21
20
  options.each { |key, value| send("#{key}=".to_sym, value) }
22
21
 
22
+ raise Jekyll::Imgproxy::Tag::Errors::PathNotSet unless path
23
+
23
24
  "/#{resizing_type}#{width}#{height}#{gravity}#{quality}#{max_bytes}#{cache_buster}/#{encoded_url}#{format}"
24
25
  end
25
26
 
26
27
  protected
27
28
 
29
+ attr_accessor :path
30
+
28
31
  attr_reader \
29
32
  :config,
30
33
  :options,
31
- :path,
32
34
  :resizing_type,
33
35
  :width,
34
36
  :height,
@@ -3,7 +3,7 @@
3
3
  module Jekyll
4
4
  module Imgproxy
5
5
  class Tag < ::Liquid::Tag
6
- VERSION = '0.1.0'
6
+ VERSION = '0.2.0'
7
7
 
8
8
  def initialize(tag_name, raw_options, tokens)
9
9
  super
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-imgproxy-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-07 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -101,7 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".gitignore"
104
105
  - ".rspec"
106
+ - CHANGELOG
105
107
  - Gemfile
106
108
  - Gemfile.lock
107
109
  - LICENSE.md