jekyll-html 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 793bbfd027434c896b031a52e9af08bfc66e0dfaf6631e85272294cf82011759
4
- data.tar.gz: 6946f4fa63b7595f880d564c44c7624ec987cff339ad5ef28cc1d1ba3afa0628
3
+ metadata.gz: dd9d9fe272f49637d75ecf1b0640b0fbab6cb7083029ae5cf272de0b087815a7
4
+ data.tar.gz: 652ad949a3d5cccaf81b4e7347e9b5a90735b70e28d5944a694f604fb1b100e2
5
5
  SHA512:
6
- metadata.gz: 2dd844b2d77160cae3c13d392f3f33e6ef437224d377e306647745505c449ac6f0c61915e1fc600d52f283f098d09eadb22666208fb342ff073f50dea4658e83
7
- data.tar.gz: 4a60a0a3b7557e8a13457476a86647dc3468d229885953ebc3fb1ebadd16129b937167a29d7e8fdb2d7da33d44062b31645141a5364eecd8f55f32b17b1c04d6
6
+ metadata.gz: e86f1af00e2fc74832cebf24dce84a89f93aa9b8d5fc9114e77c8c6f33e7807923c0ceb7685d8f1f2078d1680eb1e7c8e796b136f7399069744ee5dad241ebd0
7
+ data.tar.gz: 4601a42005570d86f550e49d2338f385268dbfb885d3a6f249c4ddbaad02a38c9180b9076ef0536d33a0b327bdecec6797148bb1f82b28b6e5d46324687572a5
data/.gitignore CHANGED
@@ -1,24 +1,24 @@
1
- *.gem
2
- *.swp
3
- *~
4
- .DS_Store
5
- .analysis
6
- .bundle/
7
- .byebug_history
8
- .jekyll-metadata
9
- .ruby-gemset
10
- .ruby-version
11
- .sass-cache
12
- /test/source/file_name.txt
13
- /vendor
14
- Gemfile.lock
15
- _site/
16
- .idea/
17
- bin/
18
- bbin/
19
- coverage
20
- gh-pages/
21
- pkg/
22
- site/_site/
23
- test/dest
24
- tmp/*
1
+ *.gem
2
+ *.swp
3
+ *~
4
+ .DS_Store
5
+ .analysis
6
+ .bundle/
7
+ .byebug_history
8
+ .jekyll-metadata
9
+ .ruby-gemset
10
+ .ruby-version
11
+ .sass-cache
12
+ /test/source/file_name.txt
13
+ /vendor
14
+ Gemfile.lock
15
+ _site/
16
+ .idea/
17
+ bin/
18
+ bbin/
19
+ coverage
20
+ gh-pages/
21
+ pkg/
22
+ site/_site/
23
+ test/dest
24
+ tmp/*
@@ -0,0 +1,8 @@
1
+ inherit_gem:
2
+ jekyll: .rubocop.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.3
6
+ Exclude:
7
+ - vendor/**/*
8
+ - jekyll-html.gemspec
@@ -1,11 +1,14 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
 
4
- before_install:
5
- - gem update --system
4
+ before_install: gem update --system
5
+ before_script: bundle update
6
+
7
+ script: script/cibuild
6
8
 
7
9
  matrix:
8
10
  include:
11
+ - rvm: 2.6.0-preview1
9
12
  - rvm: 2.5.0
10
13
  - rvm: 2.4.3
11
14
  - rvm: 2.3.6
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- gemspec
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ gemspec
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017-present Kacper Duras
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.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017-present Kacper Duras
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.
data/README.md CHANGED
@@ -23,15 +23,15 @@ $ gem install jekyll-html
23
23
 
24
24
  Input:
25
25
  ```
26
- {% starttag p %}
26
+ {% st p %}
27
27
  Example text
28
- {% endtag p %}
28
+ {% et p %}
29
29
 
30
- {% starttag div class=test_class %}
31
- {% starttag p class=test_class %}
30
+ {% st div class=test_class %}
31
+ {% et p class=test_class %}
32
32
  Example text
33
- {% endtag p class=test_class %}
34
- {% endtag div %}
33
+ {% et p class=test_class %}
34
+ {% et div %}
35
35
  ```
36
36
 
37
37
  Output:
data/Rakefile CHANGED
@@ -1,10 +1,12 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << 'test'
6
- t.libs << 'lib'
7
- t.test_files = FileList['test/**/*_test.rb']
8
- end
9
-
10
- task default: :test
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ task :default => :test
@@ -1,38 +1,41 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "jekyll-html/version"
3
6
 
4
7
  Gem::Specification.new do |spec|
5
- spec.name = 'jekyll-html'
6
- spec.version = '1.0.1'
7
- spec.authors = ['Kacper Duras']
8
- spec.email = ['git@kacperduras.pl']
8
+ spec.name = "jekyll-html"
9
+ spec.version = Jekyll::HTML::VERSION
10
+ spec.authors = ["Kacper Duras"]
11
+ spec.email = ["git@kacperduras.pl"]
9
12
 
10
- spec.summary = 'A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections.'
11
- spec.homepage = 'https://github.com/kacperduras/jekyll-html'
12
- spec.license = 'MIT'
13
+ spec.summary = "A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections."
14
+ spec.homepage = "https://github.com/kacperduras/jekyll-html"
15
+ spec.license = "MIT"
13
16
 
14
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
15
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
16
19
  if spec.respond_to?(:metadata)
17
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
21
  else
19
- raise 'RubyGems 2.0 or newer is required to protect against ' \
20
- 'public gem pushes.'
22
+ raise "RubyGems 2.0 or newer is required to protect against " \
23
+ "public gem pushes."
21
24
  end
22
25
 
23
- spec.required_ruby_version = '>= 2.2'
26
+ spec.required_ruby_version = ">= 2.2"
24
27
 
25
28
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
- f.match(%r{^(test|spec|features)/})
29
+ f.match(%r!^(test|spec|features)/!)
27
30
  end
28
- spec.bindir = 'exe'
29
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
- spec.require_paths = ['lib']
31
-
32
- spec.add_dependency 'jekyll', '~> 3.7.0'
31
+ spec.bindir = "exe"
32
+ spec.executables = spec.files.grep(%r!^exe/!) { |f| File.basename(f) }
33
+ spec.require_paths = ["lib"]
33
34
 
34
- spec.add_development_dependency 'bundler', '~> 1.16.1'
35
+ spec.add_dependency "jekyll", "~> 3.7.3"
35
36
 
36
- spec.add_development_dependency 'rake', '~> 12.3'
37
- spec.add_development_dependency 'minitest', '~> 5.11.1'
37
+ spec.add_development_dependency "bundler", "~> 1.16.1"
38
+ spec.add_development_dependency "minitest", "~> 5.11.3"
39
+ spec.add_development_dependency "rake", "~> 12.3"
40
+ spec.add_development_dependency "rubocop", "~> 0.52.0"
38
41
  end
@@ -1,33 +1,33 @@
1
- require 'jekyll'
2
- require 'liquid'
1
+ # frozen_string_literal: true
3
2
 
4
- require 'jekyll-html/start_tag'
5
- require 'jekyll-html/end_tag'
3
+ require "jekyll"
4
+ require "liquid"
6
5
 
7
- module Jekyll
6
+ require "jekyll-html/start_tag"
7
+ require "jekyll-html/end_tag"
8
8
 
9
- module Html
9
+ module Jekyll
10
+ module HTML
10
11
 
11
12
  class << self
12
-
13
13
  def generate_start_tag(tag_content)
14
- raise('Tag content cannot be null!') if tag_content.nil?
15
- raise('Tag content cannot be empty!') if tag_content.empty?
14
+ raise("Tag content cannot be null!") if tag_content.nil?
15
+ raise("Tag content cannot be empty!") if tag_content.empty?
16
16
 
17
- content = tag_content.split(' ')
18
- raise('Splitted content cannot be empty!') if content.empty?
17
+ content = tag_content.split(" ")
18
+ raise("Splitted content cannot be empty!") if content.empty?
19
19
 
20
- result = ''
20
+ result = ""
21
21
 
22
22
  content.each do |target|
23
- targetContent = target.split('=')
24
- if targetContent.length != 2
25
- result += target + ' '
23
+ target_content = target.split("=")
24
+ if target_content.length != 2
25
+ result += target + " "
26
26
  next
27
27
  end
28
28
 
29
- key = targetContent[0]
30
- value = targetContent[1].tr('_', ' ')
29
+ key = target_content[0]
30
+ value = target_content[1].tr("_", " ")
31
31
 
32
32
  result += "#{key}=\"#{value}\"\""
33
33
  end
@@ -36,20 +36,18 @@ module Jekyll
36
36
  end
37
37
 
38
38
  def generate_end_tag(tag_content)
39
- raise('Tag content cannot be null!') if tag_content.nil?
40
- raise('Tag content cannot be empty!') if tag_content.empty?
39
+ raise("Tag content cannot be null!") if tag_content.nil?
40
+ raise("Tag content cannot be empty!") if tag_content.empty?
41
41
 
42
- content = tag_content.split(' ')
43
- raise('Splitted content cannot be empty!') if content.empty?
42
+ content = tag_content.split(" ")
43
+ raise("Splitted content cannot be empty!") if content.empty?
44
44
 
45
45
  "</#{content[0]}>"
46
46
  end
47
-
48
47
  end
49
48
 
50
49
  end
51
-
52
50
  end
53
51
 
54
- Liquid::Template.register_tag('starttag', Jekyll::Html::StartTag)
55
- Liquid::Template.register_tag('endtag', Jekyll::Html::EndTag)
52
+ Liquid::Template.register_tag("st", Jekyll::HTML::StartTag)
53
+ Liquid::Template.register_tag("et", Jekyll::HTML::EndTag)
@@ -1,24 +1,22 @@
1
- require 'jekyll'
2
- require 'liquid'
1
+ # frozen_string_literal: true
3
2
 
4
- require 'jekyll-html'
3
+ require "jekyll"
4
+ require "liquid"
5
5
 
6
- module Jekyll
6
+ require "jekyll-html"
7
7
 
8
- module Html
8
+ module Jekyll
9
+ module HTML
9
10
 
10
11
  class EndTag < Liquid::Tag
11
-
12
- def initialize(tag_name, txt, tokens)
13
- @context = txt.nil? || txt.empty? ? '' : txt
12
+ def initialize(_tag_name, txt, _tokens)
13
+ @context = txt.nil? || txt.empty? ? "" : txt
14
14
  end
15
15
 
16
- def render(context)
16
+ def render(_context)
17
17
  Jekyll::Html.generate_end_tag(@context)
18
18
  end
19
-
20
19
  end
21
20
 
22
21
  end
23
-
24
22
  end
@@ -1,24 +1,22 @@
1
- require 'jekyll'
2
- require 'liquid'
1
+ # frozen_string_literal: true
3
2
 
4
- require 'jekyll-html'
3
+ require "jekyll"
4
+ require "liquid"
5
5
 
6
- module Jekyll
6
+ require "jekyll-html"
7
7
 
8
- module Html
8
+ module Jekyll
9
+ module HTML
9
10
 
10
11
  class StartTag < Liquid::Tag
11
-
12
- def initialize(tag_name, txt, tokens)
13
- @context = txt.nil? || txt.empty? ? '' : txt
12
+ def initialize(_tag_name, txt, _tokens)
13
+ @context = txt.nil? || txt.empty? ? "" : txt
14
14
  end
15
15
 
16
- def render(context)
16
+ def render(_context)
17
17
  Jekyll::Html.generate_start_tag(@context)
18
18
  end
19
-
20
19
  end
21
20
 
22
21
  end
23
-
24
22
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module HTML
5
+ VERSION = "1.0.2"
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ script/fmt
6
+ bundle exec rake build
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+ # Lint Ruby according to Jekyll's conventions
3
+ set -e
4
+
5
+ echo "Rubocop $(bundle exec rubocop --version)"
6
+ bundle exec rubocop -S -D -E $@
7
+ success=$?
8
+ if ((success != 0)); then
9
+ echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"
10
+ fi
11
+ exit $success
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ # Tag and push a release.
3
+
4
+ set -e
5
+
6
+ script/cibuild
7
+ bundle exec rake release
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kacper Duras
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-03 00:00:00.000000000 Z
11
+ date: 2018-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.7.0
19
+ version: 3.7.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.7.0
26
+ version: 3.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.16.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 5.11.3
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 5.11.3
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -53,19 +67,19 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '12.3'
55
69
  - !ruby/object:Gem::Dependency
56
- name: minitest
70
+ name: rubocop
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: 5.11.1
75
+ version: 0.52.0
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: 5.11.1
82
+ version: 0.52.0
69
83
  description:
70
84
  email:
71
85
  - git@kacperduras.pl
@@ -74,6 +88,7 @@ extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
76
90
  - ".gitignore"
91
+ - ".rubocop.yml"
77
92
  - ".travis.yml"
78
93
  - Gemfile
79
94
  - LICENSE
@@ -85,6 +100,10 @@ files:
85
100
  - lib/jekyll-html.rb
86
101
  - lib/jekyll-html/end_tag.rb
87
102
  - lib/jekyll-html/start_tag.rb
103
+ - lib/jekyll-html/version.rb
104
+ - script/cibuild
105
+ - script/fmt
106
+ - script/release
88
107
  homepage: https://github.com/kacperduras/jekyll-html
89
108
  licenses:
90
109
  - MIT