jekyll-uj-powertools 1.0.0 → 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: e90145bcdbad261602234c4de838d92f316eeb59f96c89cba223d655014a51fc
4
- data.tar.gz: 73a8176daa5ad5e4706349949e31ef6fe7fabd69547d731a6652f43cfb5ce56c
3
+ metadata.gz: 5c3efb8fb31c1f6806df49c54c2fb1e66481d1a890b2d18171c01a5b370c0187
4
+ data.tar.gz: 5fc03c5c867b1e3ba1e6dfc368a19e38f7f3eec0bc58ec196353a24c032f6637
5
5
  SHA512:
6
- metadata.gz: d6d53038e009eb6f1a3fcd0172a093c2f4e4fca9d203b598dba5a4242fac20f7afe22456813a22f7894b7c0be85822a1ac3e9ec0371a4e66c38520b8c16ad1d5
7
- data.tar.gz: c1d437bb20f57ba35823a2209139de711687113303d61810363bbbbc3697a6c98c5531cc1300375235f344e54ccb51fe85d07f3f7f98b8edbf0af0e12ecfe5b4
6
+ metadata.gz: 0dc2f8936ae1a5cd47f7080defeabb867c901012db5ac147a90c6d5be3e76d781f14c7d224be4719686d076ab28d86564e91eb3b86ee022fcc6b6b7217933363
7
+ data.tar.gz: 1a7b25486b7b12389628e4b5a73570c7ef6e7d43778ca4a243a97bf891c5b6a865afd287c22d005e40654df74ecac0ed3a2946addee5e5a503c902c5642b052a
data/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  ## Features
28
28
  * Powerful utility for Jekyll sites
29
- * `remove_ads` filter to remove ads from a string
29
+ * `strip_ads` filter to remove ads from a string
30
30
  * `json_escape` filter to escape JSON characters
31
31
 
32
32
  # Jekyll::uj-powertools
@@ -46,13 +46,13 @@ gem install jekyll-uj-powertools
46
46
  ```
47
47
 
48
48
  ## Usage
49
- Now you can use the `remove_ads` and `json_escape` filters in your Jekyll site:
49
+ Now you can use the `strip_ads` and `json_escape` filters in your Jekyll site:
50
50
 
51
- ### `remove_ads` Filter
51
+ ### `strip_ads` Filter
52
52
  Remove ads from a string, such as a blog post or article.
53
53
 
54
54
  ```liquid
55
- {{ post.content | remove_ads }}
55
+ {{ post.content | strip_ads }}
56
56
  ```
57
57
 
58
58
  ### `json_escape` Filter
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module UJPowertools
3
- VERSION = "1.0.0"
4
- end # module UJPowertools
5
- end # module Jekyll
3
+ VERSION = "1.0.2"
4
+ end
5
+ end
@@ -2,8 +2,8 @@ require "jekyll"
2
2
 
3
3
  module Jekyll
4
4
  module UJPowertools
5
- def remove_ads(input)
6
- input.gsub(/<[^>]*class="uj-vert-unit"[^>]*>.*?<\/[^>]*>/m, '')
5
+ def strip_ads(input)
6
+ input.gsub(/\{% include \/master\/modules\/adunits[^%]*%\}/, '')
7
7
  end
8
8
 
9
9
  def json_escape(value)
@@ -8,15 +8,15 @@ RSpec.describe Jekyll::UJPowertools do
8
8
 
9
9
  let(:dummy) { DummyClass.new }
10
10
 
11
- # describe '.remove_ads' do
12
- # it 'removes ads from the string' do
13
- # expect(dummy.remove_ads('This is an ad! Buy now!')).to eq('This is an !')
14
- # end
11
+ describe '.strip_ads' do
12
+ it 'removes ads from the string' do
13
+ expect(dummy.strip_ads('{% include /master/modules/adunits/adsense-in-article.html index="0" %} This is content')).to eq(' This is content')
14
+ end
15
15
 
16
- # it 'returns the original string if no ads are present' do
17
- # expect(dummy.remove_ads('No ads here')).to eq('No ads here')
18
- # end
19
- # end
16
+ it 'returns the original string if no ads are present' do
17
+ expect(dummy.strip_ads('No ads here')).to eq('No ads here')
18
+ end
19
+ end
20
20
 
21
21
  describe '.json_escape' do
22
22
  it 'escapes double quotes in JSON string' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-uj-powertools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITW Creative Works