liquid-md5 0.0.1

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: 3071bc1064654c416b31c31f0c2d2e2c4df8ad36
4
+ data.tar.gz: a723dec823e92536c768dfae796e5a3a040d3c6f
5
+ SHA512:
6
+ metadata.gz: 81d9884032c8921aaa38f9779237e3b1a5575333a367e83d1d47f537c54d2b5ecc83324b77d2522baf7ed531e55f24c806a868e013150f9a2edde3067cdf6f36
7
+ data.tar.gz: f2062ad15b3ae9c520ada8834d9a9b4a47ee03cb42fd78b6ddb1821a4fa1678e3353a69085ad178d9e16a01897e09778914bbc545cd53bee41bffe83535c1bfa
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ Gemfile.lock
3
+ spec/dest
4
+ .bundle
@@ -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,20 @@
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 of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ # liquid-md5
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/liquid-md5.svg)](https://rubygems.org/gems/liquid-md5)
4
+ [![Build Status](https://img.shields.io/travis/pathawks/liquid-md5/master.svg)](https://travis-ci.org/pathawks/liquid-md5)
5
+ [![Dependency Status](https://img.shields.io/gemnasium/pathawks/liquid-md5.svg)](https://gemnasium.com/pathawks/liquid-md5)
6
+
7
+ *A Liquid filter that outputs an MD5 hash*
8
+
9
+ ```
10
+ {{ site.email | md5 }}
11
+ ```
12
+
13
+ Can be useful for generating Gravatar URLs from email addresses.
14
+ ```
15
+ http://gravatar.com/avatar/{{ site.email | downcase | md5 }}?s=144
16
+ ```
@@ -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,9 @@
1
+ require 'digest/md5'
2
+
3
+ module MDhash
4
+ def md5(input)
5
+ Digest::MD5.hexdigest input.strip
6
+ end
7
+ end
8
+
9
+ Liquid::Template.register_filter(MDhash)
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "liquid-md5"
5
+ spec.summary = "Adds md5 filter to Liquid."
6
+ spec.version = "0.0.1"
7
+ spec.authors = ["Pat Hawks"]
8
+ spec.email = "pat@pathawks.com"
9
+ spec.homepage = "https://github.com/pathawks/liquid-md5"
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_runtime_dependency "liquid", [">= 2.5", "< 4.0"]
18
+
19
+ spec.add_development_dependency "jekyll", [">= 2.0", "< 4.0"]
20
+ spec.add_development_dependency "rspec", "~> 3.0"
21
+ spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ end
@@ -0,0 +1,3 @@
1
+ #! /bin/bash
2
+
3
+ bundle install
@@ -0,0 +1,3 @@
1
+ #! /bin/bash
2
+
3
+ bundle exec rspec
@@ -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
@@ -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 }} {{ t | md5 }}<br />
5
+ {% endfor %}
@@ -0,0 +1,7 @@
1
+ ---
2
+ test:
3
+ - "test@example.com"
4
+ - "space@example.com "
5
+ ---
6
+
7
+ Each test should be an item in `page.test`
@@ -0,0 +1,27 @@
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 source into an MD5 hash" do
21
+ expect(contents).to match /test@example.com 55502f40dc8b7c769880b10874abc9d0/
22
+ end
23
+
24
+ it "strips whitespace from source" do
25
+ expect(contents).to match /space@example.com 1cb77a950d8c54fb709f3aaf5a6dbfd1/
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ require 'jekyll'
2
+ require File.expand_path('../lib/md5', 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,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: liquid-md5
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-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: liquid
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '4.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '2.5'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '4.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: jekyll
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '2.0'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '4.0'
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '2.0'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '4.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: rspec
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '3.0'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3.0'
67
+ - !ruby/object:Gem::Dependency
68
+ name: rake
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: bundler
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '1.6'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '1.6'
95
+ description:
96
+ email: pat@pathawks.com
97
+ executables: []
98
+ extensions: []
99
+ extra_rdoc_files: []
100
+ files:
101
+ - ".gitignore"
102
+ - ".travis.yml"
103
+ - Gemfile
104
+ - LICENSE
105
+ - README.md
106
+ - Rakefile
107
+ - lib/md5.rb
108
+ - liquid-md5.gemspec
109
+ - script/bootstrap
110
+ - script/cibuild
111
+ - script/console
112
+ - script/release
113
+ - spec/fixtures/_config.yml
114
+ - spec/fixtures/_layouts/some_default.html
115
+ - spec/fixtures/index.html
116
+ - spec/liquid-md5_spec.rb
117
+ - spec/spec_helper.rb
118
+ homepage: https://github.com/pathawks/liquid-md5
119
+ licenses:
120
+ - MIT
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.2.2
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: Adds md5 filter to Liquid.
142
+ test_files:
143
+ - spec/fixtures/_config.yml
144
+ - spec/fixtures/_layouts/some_default.html
145
+ - spec/fixtures/index.html
146
+ - spec/liquid-md5_spec.rb
147
+ - spec/spec_helper.rb