jekyll-thumbor 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9582d54c827be2b8f5f991cdc3a91fd3cbb08904
4
+ data.tar.gz: bc0a66e1366c912bdcd0d11e8b35761051d59b94
5
+ SHA512:
6
+ metadata.gz: bca00b60a0dfa660258a79e2a55cdd2f0bd7e2a87b3628d3dde292e4e7294c986e32af1664755dd1556899828264436c424059624a97b4ac527a02095ee100fc
7
+ data.tar.gz: e76ec2615ff75c22ca01e8e617b046aa7268c2cb98f5fdd9c4951eb9732f3868acee29674a4254951ffe1894fb57e2dc3f27150938311f0fdb081324dcf4d8d0
@@ -0,0 +1,16 @@
1
+ [bumpversion]
2
+ current_version = 0.3.0
3
+ commit = False
4
+ tag = False
5
+ message = :bookmark: {current_version} → {new_version}
6
+
7
+ [bumpversion:file:.travis.yml]
8
+ search = pkg/jekyll-thumbor-{current_version}.gem
9
+ replace = pkg/jekyll-thumbor-{new_version}.gem
10
+
11
+ [bumpversion:file:appveyor.yml]
12
+ search = v{current_version}
13
+ replace = v{new_version}
14
+
15
+ [bumpversion:file:lib/jekyll/thumbor_tag.rb]
16
+
@@ -0,0 +1,3 @@
1
+ [*.rb]
2
+ indent_style = space
3
+ indent_size = 2
@@ -0,0 +1,28 @@
1
+ <!-- Jekyll::ThumborTag Issue Ticket -->
2
+ <!-- To tackle bugs better, we recommend that you report one issue per ticket -->
3
+
4
+ ### Description:
5
+ <!-- Describe in one or two sentences why you're opening this issue: -->
6
+
7
+
8
+ ### Tell us a bit about yourself:
9
+ * Version of Jekyll::ThumborTag I'm using <HINT: use `bundle show` to check>:
10
+ * Version of Jekyll I'm using <HINT: use `bundle show` to check>:
11
+ * Version of Ruby I'm using:
12
+ * Operating System <e.g. Linux, OS X, Windows>:
13
+ * Browser <e.g, Safari, Chrome>:
14
+
15
+ ### Steps to reproduce:
16
+ <!-- List the steps someone else can take to reproduce the conditions you're reporting. -->
17
+
18
+
19
+ ### I expected the following:
20
+ <!-- After you take those steps, what do you expect to happen? -->
21
+
22
+
23
+ ### But got the following, instead:
24
+ <!-- After you take those steps, what actually happens, instead? -->
25
+
26
+
27
+ ### Other details:
28
+ <!-- Anything else you think we should know? Do you have a screenshot? An animated GIF? Can you express the problem using emoji? -->
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
10
+ /spec/dest/
11
+ /designs/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0
4
+ - 2.1
5
+ - 2.2
6
+ before_install:
7
+ - gem update bundler
8
+ script:
9
+ - bundle exec rake
10
+ after_script:
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
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
@@ -0,0 +1,29 @@
1
+ # Contributing
2
+
3
+ I love to get pull requests from everyone. By participating in this project, you agree to abide by the [code of conduct](CODE_OF_CONDUCT.md).
4
+
5
+ [Fork](https://github.com/myles/jekyll-thumbor/fork), then clone the repo:
6
+
7
+ ```
8
+ git clone git@github.com:your-username/jekyll-thumbor.git
9
+ ```
10
+
11
+ Set up your machine:
12
+
13
+ ```
14
+ ./bin/setup
15
+ ```
16
+
17
+ Make sure the tests pass
18
+
19
+ ```
20
+ ./bin/test
21
+ ```
22
+
23
+ Make your change. Add tests for your change. Make the tests pass:
24
+
25
+ ```
26
+ ./bin/test
27
+ ```
28
+
29
+ Push to your fork and [submit a pull request](https://github.com/myles/jekyll-thumbor/compare/).
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'ruby-thumbor'
4
+
5
+ group :test do
6
+ gem 'simplecov'
7
+ gem 'codeclimate-test-reporter', '~> 1.0.0'
8
+ end
9
+
10
+ gemspec
@@ -0,0 +1,85 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jekyll-thumbor (0.3.0)
5
+ ruby-thumbor
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.5.0)
11
+ public_suffix (~> 2.0, >= 2.0.2)
12
+ codeclimate-test-reporter (1.0.7)
13
+ simplecov
14
+ colorator (1.1.0)
15
+ diff-lcs (1.3)
16
+ docile (1.1.5)
17
+ ffi (1.9.18)
18
+ forwardable-extended (2.6.0)
19
+ jekyll (3.4.2)
20
+ addressable (~> 2.4)
21
+ colorator (~> 1.0)
22
+ jekyll-sass-converter (~> 1.0)
23
+ jekyll-watch (~> 1.1)
24
+ kramdown (~> 1.3)
25
+ liquid (~> 3.0)
26
+ mercenary (~> 0.3.3)
27
+ pathutil (~> 0.9)
28
+ rouge (~> 1.7)
29
+ safe_yaml (~> 1.0)
30
+ jekyll-sass-converter (1.5.0)
31
+ sass (~> 3.4)
32
+ jekyll-watch (1.5.0)
33
+ listen (~> 3.0, < 3.1)
34
+ json (2.0.3)
35
+ kramdown (1.13.2)
36
+ liquid (3.0.6)
37
+ listen (3.0.8)
38
+ rb-fsevent (~> 0.9, >= 0.9.4)
39
+ rb-inotify (~> 0.9, >= 0.9.7)
40
+ mercenary (0.3.6)
41
+ pathutil (0.14.0)
42
+ forwardable-extended (~> 2.6)
43
+ public_suffix (2.0.5)
44
+ rake (10.5.0)
45
+ rb-fsevent (0.9.8)
46
+ rb-inotify (0.9.8)
47
+ ffi (>= 0.5.0)
48
+ rouge (1.11.1)
49
+ rspec (3.5.0)
50
+ rspec-core (~> 3.5.0)
51
+ rspec-expectations (~> 3.5.0)
52
+ rspec-mocks (~> 3.5.0)
53
+ rspec-core (3.5.4)
54
+ rspec-support (~> 3.5.0)
55
+ rspec-expectations (3.5.0)
56
+ diff-lcs (>= 1.2.0, < 2.0)
57
+ rspec-support (~> 3.5.0)
58
+ rspec-mocks (3.5.0)
59
+ diff-lcs (>= 1.2.0, < 2.0)
60
+ rspec-support (~> 3.5.0)
61
+ rspec-support (3.5.0)
62
+ ruby-thumbor (2.0.1)
63
+ safe_yaml (1.0.4)
64
+ sass (3.4.23)
65
+ simplecov (0.14.1)
66
+ docile (~> 1.1.0)
67
+ json (>= 1.8, < 3)
68
+ simplecov-html (~> 0.10.0)
69
+ simplecov-html (0.10.0)
70
+
71
+ PLATFORMS
72
+ ruby
73
+
74
+ DEPENDENCIES
75
+ bundler (~> 1.7)
76
+ codeclimate-test-reporter (~> 1.0.0)
77
+ jekyll
78
+ jekyll-thumbor!
79
+ rake (~> 10.0)
80
+ rspec (~> 3.0)
81
+ ruby-thumbor
82
+ simplecov
83
+
84
+ BUNDLED WITH
85
+ 1.13.7
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Myles Braithwaite
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.
@@ -0,0 +1,46 @@
1
+ # Jekyll::ThumborTag
2
+
3
+ A [Jekyll](https://jekyllrb.com/) template tag for [Thumbor](https://github.com/thumbor/thumbor) imaging service.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'jekyll-thumbor'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```
22
+ $ gem install jekyll-thumbor
23
+ ```
24
+
25
+ You now need to enable the plugin in your Jekyll web site. Append it to the `gems` array in your `_config.yml` file:
26
+
27
+ ```yaml
28
+ gems:
29
+ - jekyll-thumbor
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```html
35
+ <img src="{% thumbor_tag https://example.org/picture.jpg, width: 500, height: 500 %}"
36
+ ```
37
+
38
+ ## Development
39
+
40
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
41
+
42
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, run `bumpversion minor`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
43
+
44
+ ## Contributing
45
+
46
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,25 @@
1
+ version: v0.3.0-{branch}-{build}
2
+
3
+ environment:
4
+ matrix:
5
+ - ruby_version: 22
6
+ - ruby_version: 22-x64
7
+ - ruby_version: 21
8
+ - ruby_version: 21-x64
9
+ - ruby_version: 200
10
+ - ruby_version: 200-x64
11
+
12
+ install:
13
+ - set PATH=C:\Ruby%ruby_version%\bin;%PATH%
14
+ - gem install bundler --no-document -v 1.10.5
15
+ - bundle install --retry=3
16
+
17
+ build: off
18
+
19
+ before_test:
20
+ - ruby -v
21
+ - gem -v
22
+ - bundle -v
23
+
24
+ test_script:
25
+ - bundle exec rake
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "jekyll/thumbor"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle exec jekyll serve --config ./spec/fixtures/_config.yml -d ./spec/dest -s ./spec/fixtures/ --watch
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install --path vendor/bundle
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle exec rake
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jekyll/thumbor_tag'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jekyll-thumbor"
8
+ spec.version = Jekyll::ThumborTag::VERSION
9
+ spec.summary = %q{A Jekyll template tag for Thumbor imaging service.}
10
+ spec.description = %q{A Jekyll template tag for Thumbor imaging service.}
11
+ spec.license = "MIT"
12
+
13
+ spec.authors = ["Myles Braithwaite"]
14
+ spec.email = ["me@mylesbraithwaite.com"]
15
+
16
+ spec.homepage = "http://myles.github.io/jekyll-thumbor/"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_runtime_dependency "ruby-thumbor"
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.7"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "jekyll"
29
+ end
@@ -0,0 +1,2 @@
1
+ # rubocop: disable FileName
2
+ require "jekyll/thumbor_tag"
@@ -0,0 +1,34 @@
1
+ require "liquid"
2
+ require "ruby-thumbor"
3
+
4
+ module Jekyll
5
+ class ThumborTag < Liquid::Tag
6
+
7
+ VERSION = "0.3.0"
8
+
9
+ def initialize(tag_name, text, tokens)
10
+ super
11
+
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
20
+ end
21
+ end
22
+
23
+ def render(context)
24
+ @config = context.registers[:site].config['thumbor']
25
+
26
+ image = Thumbor::Cascade.new(@config['key'], @url)
27
+ image_url = image.width(@parameters['width']).height(@parameters['height']).generate
28
+
29
+ "#{@config['url']}#{image_url}"
30
+ end
31
+ end
32
+ end
33
+
34
+ Liquid::Template.register_tag('thumbor', Jekyll::ThumborTag)
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-thumbor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Myles Braithwaite
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby-thumbor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jekyll
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: A Jekyll template tag for Thumbor imaging service.
84
+ email:
85
+ - me@mylesbraithwaite.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".bumpversion.cfg"
91
+ - ".editorconfig"
92
+ - ".github/ISSUE_TEMPLATE.md"
93
+ - ".gitignore"
94
+ - ".rspec"
95
+ - ".travis.yml"
96
+ - CODE_OF_CONDUCT.md
97
+ - CONTRIBUTING.md
98
+ - Gemfile
99
+ - Gemfile.lock
100
+ - LICENSE.txt
101
+ - README.md
102
+ - Rakefile
103
+ - appveyor.yml
104
+ - bin/console
105
+ - bin/server
106
+ - bin/setup
107
+ - bin/test
108
+ - jekyll-thumbor.gemspec
109
+ - lib/jekyll-thumbor.rb
110
+ - lib/jekyll/thumbor_tag.rb
111
+ homepage: http://myles.github.io/jekyll-thumbor/
112
+ licenses:
113
+ - MIT
114
+ metadata: {}
115
+ post_install_message:
116
+ rdoc_options: []
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 2.4.5.1
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: A Jekyll template tag for Thumbor imaging service.
135
+ test_files: []