jekyll-regex-replace 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +15 -0
- data/jekyll-regex-replace.gemspec +15 -0
- data/lib/jekyll-regex-replace.rb +12 -0
- metadata +63 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7303a96135c89bb8e31eb7e19d7836e839a06988af7ab01b5098d67859b77b9e
|
4
|
+
data.tar.gz: 60f5b79a77cba227457abe43f2e0b9ed2d3d95e6750045e0a413855122c56bb9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 24def38fbce14f95ff32db88bc65bf4df2e0ff6ff37998c6d2a853530f49b0da0b4e0e4661564bec434a46df7c625281df027fecd45b6c460430ff8a591f3bec
|
7
|
+
data.tar.gz: 7489cbe8b06cc786bbb1d404b69921c0cad315fec116fd99c993d91d344f69631b26871fbe5d9df8d05b1687829719d5eb45baacaf0b2f3304a7af8c33caf406
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Josh Davenport
|
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,15 @@
|
|
1
|
+
# Jekyll Regex Replace
|
2
|
+
Simple module to allow using regular expression replacing via liquid filters
|
3
|
+
|
4
|
+
|
5
|
+
```
|
6
|
+
{{ '1-a-test' | regex_replace: '^[0-9]*-', '' }}
|
7
|
+
```
|
8
|
+
|
9
|
+
## Install
|
10
|
+
|
11
|
+
Add the following to your `Gemfile` and then run `bundle install`.
|
12
|
+
|
13
|
+
```
|
14
|
+
gem 'jekyll-regex-replace'
|
15
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = "jekyll-regex-replace"
|
3
|
+
spec.version = '1.0.0'
|
4
|
+
spec.authors = ["Josh Davenport"]
|
5
|
+
spec.email = ["josh@joshdavenport.co.uk"]
|
6
|
+
spec.summary = 'Simple module to allow using regular expression replacing via liquid filters'
|
7
|
+
spec.homepage = 'https://github.com/joshdavenport/jekyll-regex-replace'
|
8
|
+
spec.license = "MIT"
|
9
|
+
spec.files = `git ls-files -z`.split("\x0")
|
10
|
+
spec.require_paths = ['lib']
|
11
|
+
|
12
|
+
spec.required_ruby_version = '>= 2.1.0'
|
13
|
+
|
14
|
+
spec.add_development_dependency 'jekyll', '>= 3.1'
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'liquid'
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module RegexReplace
|
5
|
+
def regex_replace(str, regex_search, value_replace)
|
6
|
+
regex = /#{regex_search}/
|
7
|
+
return str.sub(regex, value_replace)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
Liquid::Template.register_filter(Jekyll::RegexReplace)
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-regex-replace
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Josh Davenport
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-16 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: '3.1'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.1'
|
27
|
+
description:
|
28
|
+
email:
|
29
|
+
- josh@joshdavenport.co.uk
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- Gemfile
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- jekyll-regex-replace.gemspec
|
38
|
+
- lib/jekyll-regex-replace.rb
|
39
|
+
homepage: https://github.com/joshdavenport/jekyll-regex-replace
|
40
|
+
licenses:
|
41
|
+
- MIT
|
42
|
+
metadata: {}
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 2.1.0
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 2.7.4
|
60
|
+
signing_key:
|
61
|
+
specification_version: 4
|
62
|
+
summary: Simple module to allow using regular expression replacing via liquid filters
|
63
|
+
test_files: []
|