frozen-filters 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/LICENSE.txt +25 -0
  4. data/README.md +64 -0
  5. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b165a0212aff0bea581304fd91dcd2e476f4d4492c2f20a0b1dc121b00942513
4
- data.tar.gz: 93e6a6ee246da962eeb235eadfdf2a11579de1bbe5b51538e11cb63315edd885
3
+ metadata.gz: 9ef57c3f85f527856693505c2e2c78825621460f397faef4cf25180a121c02da
4
+ data.tar.gz: 182d3df6cd704cd6c8280053defab0a74740d5a723b61cb591cedc2ab533a73a
5
5
  SHA512:
6
- metadata.gz: 914179ec309c8fdc9f18876f5d17c02f0c242ea2051a05091b133ae79ebc37cf6c4faef7e708b064a6f3d4251f7e18c375822bacd2f5054c297e09456d8bb98e
7
- data.tar.gz: a2aed00604fe7531a19cd29776991ade4568f2b8c2e0fb612242517056d8354aa9cc4aefadd159287347b46719dad771d8e078545b447ad2df5b5b94731cd73a
6
+ metadata.gz: 27c984064e05a2ecfb0ff37bfb57d3ac4c72261230d1a3257dcf7948b92f6b4742e7034d7047f1f8c59c509c0bfb11d925f8f595ad0e8ce062e9d62667666ce7
7
+ data.tar.gz: da1ff4689ac0d0949773f77f8c22f3bbbdf622e50b7aadbde9a5b8e37a3edfca727531e05922ebd0684161dd9ac788f981e0fcb46a96b9d489a260b712344ea6
@@ -0,0 +1,15 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.2.0] -
8
+ ### Added
9
+ - Add jekyllrb and installation information to README.md.
10
+ - Add badge to README.md.
11
+
12
+
13
+ ## [0.1.0] -
14
+ ### Added
15
+ - Add filters: remove_ext, remove_qs, extract_basename, extract_dirname, extract_protocol.
@@ -0,0 +1,25 @@
1
+ MIT License+uuid License
2
+
3
+ For details of these license see
4
+ https://github.com/a-bentofreire/uuid-licenses/blob/master/MIT-uuid-license.md
5
+
6
+
7
+ Copyright (c) 2018 Alexandre Bento Freire
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice, the uuid, and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ ## Description
2
+ [![Gem Version](https://badge.fury.io/rb/frozen-filters.svg)](https://badge.fury.io/rb/frozen-filters)
3
+
4
+ Liquid filters for shopify [liquid](https://github.com/shopify/liquid) template engine.
5
+ This ruby gem is a port of [frozen-filters-js](https://github.com/a-bentofreire/frozen-filters-js).
6
+
7
+ ## Installation
8
+ `gem install frozen-filters`
9
+
10
+ ## Usage
11
+
12
+ Usage outside `jekyllrb`:
13
+
14
+ ```ruby
15
+ require 'liquid'
16
+ require 'frozen-filters'
17
+
18
+ vars = {
19
+ 'url' => 'http://www.example.com/first/second/index.html?param1=value1&param2=value2'
20
+ }
21
+
22
+ @template = Liquid::Template.parse('{{ url | remove_ext }}')
23
+ @template.render(vars) # http://www.example.com/first/second/index?param1=value1&param2=value2
24
+ ```
25
+
26
+ Usage within `jekyllrb`:
27
+
28
+ - Add to blog `Gemfile`:
29
+ ```ruby
30
+ gem "frozen-filters", "~> 0.2.0"
31
+ ```
32
+ - Add to `plugins` section of blog `_config.yml`:
33
+ ```ruby
34
+ - frozen-filters
35
+ ```
36
+ - Use the filters on any liquid page.
37
+ e.g.
38
+ ```html
39
+ {{ "/assets/main.css" | remove_ext }}
40
+ ```
41
+
42
+ ## Filters
43
+
44
+ - `remove_ext` - Removes the extension part of an url.
45
+ e.g. `http://www.example.com/first/second/index?param1=value1&param2=value2`.
46
+
47
+ - `remove_qs` - Removes the query string part of an url. e.g. `http://www.example.com/first/second/index.html`.
48
+ - `extract_basename` - Returns the basename of an url. e.g. `index.html`.
49
+ - `extract_dirname` - Returns the dirname of an url. e.g. `first/second`.
50
+ - `extract_protocol` - Returns the protocol. e.g. `http`.
51
+
52
+ ## Internationalization
53
+
54
+ The url filters support domains and paths with non-latin characters.
55
+ e.g. `http://吃.高雄/第一/第二/首頁.html?param1=value1&param2=value2`.
56
+
57
+ ## Copyrights
58
+
59
+ © 2018 [Alexandre Bento Freire](https://www.a-bentofreire.com)
60
+
61
+
62
+ ## License
63
+
64
+ [MIT License+uuid License](https://github.com/a-bentofreire/uuid-licenses/blob/master/MIT-uuid-license.md)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frozen-filters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Bento Freire
@@ -24,12 +24,17 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
- description:
27
+ description: |2
28
+ frozen-filters adds filters for url processing to the liquid template engine.
29
+ Designed to be used with jekyll.
28
30
  email: devpieces@a-bentofreire.com
29
31
  executables: []
30
32
  extensions: []
31
33
  extra_rdoc_files: []
32
34
  files:
35
+ - CHANGELOG.md
36
+ - LICENSE.txt
37
+ - README.md
33
38
  - lib/frozen-filters.rb
34
39
  homepage: https://github.com/a-bentofreire/frozen-filters
35
40
  licenses: