jekyll-smartify 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5d78a8b62a71dba077c7c62664b4ff10ada0466e
4
+ data.tar.gz: a5d3c81037a2a45344ca04ac9b6e19eadc8cd485
5
+ SHA512:
6
+ metadata.gz: f19439326d02c743c54f9140f8290ad6c7b4bb1923a2cedba4b77145bacffb1ef1ba5cb810215adcf6b6087e3b912b9eea050c60f40e7c9c22b2ba8da66a5726
7
+ data.tar.gz: 476f822cdf830f003591256e9f9ff549c7dece945971e71dbf633a6c1fa9c696b38e089de8bdc187474d83a05b33dfabf7ca8e36a65005547a150148287d4d74
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ Gemfile.lock
3
+ spec/dest
4
+ .bundle
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
4
+ - 2.0
5
+ - 1.9.3
6
+ script: "script/cibuild"
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Pat Hawks
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Jekyll Sitemap Generator Plugin
2
+
3
+ *Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site*
4
+
5
+ [![Build Status](https://travis-ci.org/pathawks/jekyll-smartify.svg?branch=master)](https://travis-ci.org/pathawks/jekyll-smartify)
6
+
7
+ ## Usage
8
+
9
+ 1. Add `gem 'jekyll-smartify'` to your site's Gemfile and run `bundle`
10
+ 2. Add the following to your site's `_config.yml`:
11
+
12
+ ```yml
13
+ gems:
14
+ - jekyll-smartify
15
+ ```
16
+
17
+ ## Testing
18
+
19
+ 1. `script/bootstrap`
20
+ 2. `script/cibuild`
21
+
22
+ ## Contributing
23
+
24
+ 1. Fork the project
25
+ 2. Create a descriptively named feature branch
26
+ 3. Add your feature
27
+ 4. Submit a pull request
data/Rakefile ADDED
@@ -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,22 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "jekyll-smartify"
5
+ spec.summary = "Adds smartify filter to Jekyll."
6
+ spec.version = "0.0.1"
7
+ spec.authors = ["Pat Hawks"]
8
+ spec.email = "pat@pathawks.com"
9
+ spec.homepage = "https://github.com/pathawks/jekyll-smartify"
10
+ spec.licenses = ["MIT"]
11
+
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_development_dependency "jekyll", "~> 2.0"
18
+ spec.add_development_dependency "redcarpet", "~> 3.0"
19
+ spec.add_development_dependency "rspec", "~> 3.0"
20
+ spec.add_development_dependency "rake"
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ end
@@ -0,0 +1,9 @@
1
+ require 'redcarpet'
2
+
3
+ module SmartyPants
4
+ def smartify(input)
5
+ Redcarpet::Render::SmartyPants.render(input)
6
+ end
7
+ end
8
+
9
+ Liquid::Template.register_filter(SmartyPants)
data/script/bootstrap ADDED
@@ -0,0 +1,3 @@
1
+ #! /bin/bash
2
+
3
+ bundle install
data/script/cibuild ADDED
@@ -0,0 +1,3 @@
1
+ #! /bin/bash
2
+
3
+ bundle exec rspec
data/script/console ADDED
@@ -0,0 +1,34 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ def relative_to_root(path)
4
+ File.expand_path(path, File.dirname(File.dirname(__FILE__)))
5
+ end
6
+
7
+ require 'jekyll'
8
+ require relative_to_root('lib/jekyll-smartify.rb')
9
+ require 'pry-debugger'
10
+
11
+ SOURCE_DIR = relative_to_root('spec/fixtures')
12
+ DEST_DIR = relative_to_root('spec/dest')
13
+
14
+ def source_dir(*files)
15
+ File.join(SOURCE_DIR, *files)
16
+ end
17
+
18
+ def dest_dir(*files)
19
+ File.join(DEST_DIR, *files)
20
+ end
21
+
22
+ def config(overrides = {})
23
+ Jekyll.configuration({
24
+ "source" => source_dir,
25
+ "destination" => dest_dir,
26
+ "url" => "http://example.org"
27
+ }).merge(overrides)
28
+ end
29
+
30
+ def site(configuration = config)
31
+ Jekyll::Site.new(configuration)
32
+ end
33
+
34
+ binding.pry
data/script/release ADDED
@@ -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
@@ -0,0 +1,9 @@
1
+ timezone: UTC
2
+
3
+ defaults:
4
+ -
5
+ scope:
6
+ path: ""
7
+ type: page
8
+ values:
9
+ layout: some_default
@@ -0,0 +1,5 @@
1
+ ---
2
+ ---
3
+ {% for t in page.test %}
4
+ {{ t | smartify }}<br />
5
+ {% endfor %}
@@ -0,0 +1,8 @@
1
+ ---
2
+ test:
3
+ - "It's working"
4
+ - "Ellipsis..."
5
+ - "#hashtag"
6
+ ---
7
+
8
+ Each test should be an item in `page.test`
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe(Jekyll) do
4
+ let(:overrides) do
5
+ {
6
+ "source" => source_dir,
7
+ "destination" => dest_dir,
8
+ "url" => "http://example.org",
9
+ }
10
+ end
11
+ let(:config) do
12
+ Jekyll.configuration(overrides)
13
+ end
14
+ let(:site) { Jekyll::Site.new(config) }
15
+ let(:contents) { File.read(dest_dir("index.html")) }
16
+ before(:each) do
17
+ site.process
18
+ end
19
+
20
+ it "converts quotes into curly quotes" do
21
+ expect(contents).to match /It&rsquo;s working/
22
+ expect(contents).to_not match /It's working/
23
+ end
24
+
25
+ it "converts dots into an ellipsis" do
26
+ expect(contents).to match /Ellipsis&hellip;/
27
+ expect(contents).to_not match /Ellipsis\.\.\./
28
+ end
29
+
30
+ it "does not convert to Markdown" do
31
+ expect(contents).to match /#hashtag/
32
+ end
33
+ end
@@ -0,0 +1,21 @@
1
+ require 'jekyll'
2
+ require File.expand_path('../lib/jekyll-smartify', File.dirname(__FILE__))
3
+
4
+ Jekyll.logger.log_level = :error
5
+
6
+ RSpec.configure do |config|
7
+ config.run_all_when_everything_filtered = true
8
+ config.filter_run :focus
9
+ config.order = 'random'
10
+
11
+ SOURCE_DIR = File.expand_path("../fixtures", __FILE__)
12
+ DEST_DIR = File.expand_path("../dest", __FILE__)
13
+
14
+ def source_dir(*files)
15
+ File.join(SOURCE_DIR, *files)
16
+ end
17
+
18
+ def dest_dir(*files)
19
+ File.join(DEST_DIR, *files)
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-smartify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Pat Hawks
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redcarpet
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
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: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.6'
83
+ description:
84
+ email: pat@pathawks.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - ".gitignore"
90
+ - ".travis.yml"
91
+ - Gemfile
92
+ - LICENSE
93
+ - README.md
94
+ - Rakefile
95
+ - jekyll-smartify.gemspec
96
+ - lib/jekyll-smartify.rb
97
+ - script/bootstrap
98
+ - script/cibuild
99
+ - script/console
100
+ - script/release
101
+ - spec/fixtures/_config.yml
102
+ - spec/fixtures/_layouts/some_default.html
103
+ - spec/fixtures/index.html
104
+ - spec/jekyll-smartify_spec.rb
105
+ - spec/spec_helper.rb
106
+ homepage: https://github.com/pathawks/jekyll-smartify
107
+ licenses:
108
+ - MIT
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubyforge_project:
126
+ rubygems_version: 2.4.5
127
+ signing_key:
128
+ specification_version: 4
129
+ summary: Adds smartify filter to Jekyll.
130
+ test_files:
131
+ - spec/fixtures/_config.yml
132
+ - spec/fixtures/_layouts/some_default.html
133
+ - spec/fixtures/index.html
134
+ - spec/jekyll-smartify_spec.rb
135
+ - spec/spec_helper.rb