jekyll-thumbor 0.3.0 → 0.4.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: 9582d54c827be2b8f5f991cdc3a91fd3cbb08904
4
- data.tar.gz: bc0a66e1366c912bdcd0d11e8b35761051d59b94
3
+ metadata.gz: fc16e805534c4b29e22e016579e879505e0bad6c
4
+ data.tar.gz: 2cb1bc7de8c620963fe6cfe021809dbf6a9f868d
5
5
  SHA512:
6
- metadata.gz: bca00b60a0dfa660258a79e2a55cdd2f0bd7e2a87b3628d3dde292e4e7294c986e32af1664755dd1556899828264436c424059624a97b4ac527a02095ee100fc
7
- data.tar.gz: e76ec2615ff75c22ca01e8e617b046aa7268c2cb98f5fdd9c4951eb9732f3868acee29674a4254951ffe1894fb57e2dc3f27150938311f0fdb081324dcf4d8d0
6
+ metadata.gz: f7fb479893313be077ff7e0092266f80023d615f9bf62da2b6d5ca3fa94bc3e3f1c75099823da67bac0166917511f781000ae3181e95d45923705a2ec280241b
7
+ data.tar.gz: 371ab1697454f68fc236488858b75287c0aa8b99e71db21c9c640d9c1fe9496784aba0157842944f0e15705e336b75c6feb90892b33313baa48702dc10b028cb
data/.bumpversion.cfg CHANGED
@@ -1,16 +1,11 @@
1
1
  [bumpversion]
2
- current_version = 0.3.0
3
- commit = False
2
+ current_version = 0.4.0
3
+ commit = True
4
4
  tag = False
5
5
  message = :bookmark: {current_version} → {new_version}
6
6
 
7
- [bumpversion:file:.travis.yml]
8
- search = pkg/jekyll-thumbor-{current_version}.gem
9
- replace = pkg/jekyll-thumbor-{new_version}.gem
10
-
11
7
  [bumpversion:file:appveyor.yml]
12
8
  search = v{current_version}
13
9
  replace = v{new_version}
14
10
 
15
- [bumpversion:file:lib/jekyll/thumbor_tag.rb]
16
-
11
+ [bumpversion:file:lib/jekyll/thumbor_tag/version.rb]
data/.travis.yml CHANGED
@@ -9,7 +9,3 @@ script:
9
9
  - bundle exec rake
10
10
  after_script:
11
11
  - bundle exec codeclimate-test-reporter
12
- after_success:
13
- - gem install package_cloud
14
- - bundle exec rake build
15
- - package_cloud push myles/jekyll-thumbor pkg/jekyll-thumbor-0.3.0.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-thumbor (0.3.0)
4
+ jekyll-thumbor (0.4.0)
5
5
  ruby-thumbor
6
6
 
7
7
  GEM
@@ -82,4 +82,4 @@ DEPENDENCIES
82
82
  simplecov
83
83
 
84
84
  BUNDLED WITH
85
- 1.13.7
85
+ 1.15.1
data/README.md CHANGED
@@ -31,6 +31,16 @@ gems:
31
31
 
32
32
  ## Usage
33
33
 
34
+ You need to add an array for thumbor configuration to your `_config.yml` file:
35
+
36
+ ```yaml
37
+ thumbor:
38
+ url: "https://your-thumbor-server"
39
+ key: "your-key"
40
+ ```
41
+
42
+ Then in the liquid template you can use the template tag:
43
+
34
44
  ```html
35
45
  <img src="{% thumbor_tag https://example.org/picture.jpg, width: 500, height: 500 %}"
36
46
  ```
data/appveyor.yml CHANGED
@@ -1,4 +1,4 @@
1
- version: v0.3.0-{branch}-{build}
1
+ version: v0.4.0-{branch}-{build}
2
2
 
3
3
  environment:
4
4
  matrix:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'jekyll/thumbor_tag'
4
+ require 'jekyll/thumbor_tag/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "jekyll-thumbor"
@@ -0,0 +1,5 @@
1
+ module Jekyll
2
+ module ThumborTag
3
+ VERSION = "0.4.0"
4
+ end
5
+ end
@@ -2,33 +2,33 @@ require "liquid"
2
2
  require "ruby-thumbor"
3
3
 
4
4
  module Jekyll
5
- class ThumborTag < Liquid::Tag
5
+ module ThumborTag
6
+ class ThumborTag < Liquid::Tag
6
7
 
7
- VERSION = "0.3.0"
8
+ def initialize(tag_name, text, tokens)
9
+ super
8
10
 
9
- def initialize(tag_name, text, tokens)
10
- super
11
+ tokens = text.split /\,\s/
12
+ @url = tokens[0]
13
+ @parameters = {}
11
14
 
12
- tokens = text.split /\,\s/
13
- @url = tokens[0]
14
- @parameters = {}
15
-
16
- tokens[1..-1].each do |arg|
17
- k, v = arg.split /:/
18
- v ||= "1"
19
- @parameters[k.strip] = v.strip
15
+ tokens[1..-1].each do |arg|
16
+ k, v = arg.split /:/
17
+ v ||= "1"
18
+ @parameters[k.strip] = v.strip
19
+ end
20
20
  end
21
- end
22
21
 
23
- def render(context)
24
- @config = context.registers[:site].config['thumbor']
22
+ def render(context)
23
+ @config = context.registers[:site].config['thumbor']
25
24
 
26
- image = Thumbor::Cascade.new(@config['key'], @url)
27
- image_url = image.width(@parameters['width']).height(@parameters['height']).generate
25
+ image = Thumbor::Cascade.new(@config['key'], @url)
26
+ image_url = image.width(@parameters['width']).height(@parameters['height']).generate
28
27
 
29
- "#{@config['url']}#{image_url}"
28
+ "#{@config['url']}#{image_url}"
29
+ end
30
30
  end
31
31
  end
32
32
  end
33
33
 
34
- Liquid::Template.register_tag('thumbor', Jekyll::ThumborTag)
34
+ Liquid::Template.register_tag('thumbor', Jekyll::ThumborTag::ThumborTag)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-thumbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myles Braithwaite
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-21 00:00:00.000000000 Z
11
+ date: 2017-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-thumbor
@@ -108,6 +108,7 @@ files:
108
108
  - jekyll-thumbor.gemspec
109
109
  - lib/jekyll-thumbor.rb
110
110
  - lib/jekyll/thumbor_tag.rb
111
+ - lib/jekyll/thumbor_tag/version.rb
111
112
  homepage: http://myles.github.io/jekyll-thumbor/
112
113
  licenses:
113
114
  - MIT