jekyll-wns 4.0.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88c6a307f9dcfa02534630dd00aaa8934a9d53793d3eaee4b44a5e7e349374be
4
- data.tar.gz: 70fd68ab8f8cc9c6e387b7067d06680ea01ecd3ac26e55e525c9335e77df2e3e
3
+ metadata.gz: 310b65aa25c9965524dcd5fd5e4f1b744fbf6d7640403ffa0c2ca257dae4c246
4
+ data.tar.gz: ac7e510fd0c70e90df4fe5e51961ee4e691c787c5de5451cd40c38b56eed8c06
5
5
  SHA512:
6
- metadata.gz: 9dfa46f956900df775184338cd195b7fa8c7f1e91dfd0d729024d196d9bf71fe70e5a6dd11d5a1fd917641478ab7d2e804184875319764ec1d21830c3a297d26
7
- data.tar.gz: 7a7389c4347905765cf9edcd32848ba86f65c786f6c12a085165f8e416d5c48a280b30fdc64ba91ef8236b773f6cd68629326b5b85ac39c6eb8594ebba95f5ba
6
+ metadata.gz: b84558f5db3a205b2fb788040ba239ff6ec6247c3a200c0e023e7e792f9782bd9eb482fd604e8de90a31859b9e73d2abbfe8be05200bda21cf05297b9dcead3b
7
+ data.tar.gz: 9d35693e10e8ce1667a2fb971dd7f832f8522988c044d5a33980233b3fc334b9fade0e29966dc7d6926d49b6ba3070838a383804c24a77029121ad459131f5e3
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ gem "ruby-mp3info", "~> 0.8.10"
data/jekyll-wns.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-wns"
5
- spec.version = "4.0.1"
5
+ spec.version = "4.1.0"
6
6
  spec.authors = ["Thai Chung"]
7
7
  spec.email = ["mail@0xReki.de"]
8
8
  spec.summary = "Collection of Filters, Tags and Hooks I use."
@@ -10,4 +10,6 @@ Gem::Specification.new do |spec|
10
10
  spec.licenses = "MIT"
11
11
 
12
12
  spec.files = `git ls-files -z`.split("\x0")
13
+
14
+ spec.add_dependency("ruby-mp3info", "~> 0.8.10")
13
15
  end
data/lib/jekyll-wns.rb CHANGED
@@ -6,7 +6,7 @@ require_relative 'jekyll-wns/assets/label_unicode'
6
6
  require_relative 'jekyll-wns/assets/quads'
7
7
 
8
8
  require_relative 'jekyll-wns/assets/digest_filters'
9
- require_relative 'jekyll-wns/assets/file_properties_filter'
9
+ require_relative 'jekyll-wns/assets/file_property_filters'
10
10
  require_relative 'jekyll-wns/assets/quads_filter'
11
11
 
12
12
  require_relative 'jekyll-wns/assets/ruby_tag'
@@ -0,0 +1,39 @@
1
+ require 'mp3info'
2
+
3
+ module WNS
4
+ module FilePropertyFilters
5
+ def file_size(path)
6
+ source = Jekyll.configuration({})['source']
7
+
8
+ unless source.empty?
9
+ source += '/'
10
+ else
11
+ source = ''
12
+ end
13
+ full_path = source + path
14
+
15
+ unless path.nil?
16
+ File.size full_path
17
+ else
18
+ 0
19
+ end
20
+ end
21
+
22
+ def mp3_duration(path)
23
+ source = Jekyll.configuration({})['source'] || ''
24
+
25
+ unless source.empty?
26
+ source += '/'
27
+ else
28
+ source = ''
29
+ end
30
+ full_path = source + path
31
+
32
+ unless path.nil?
33
+ Mp3Info.open(full_path).length.to_i
34
+ else
35
+ 0
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,3 +1,3 @@
1
1
  Liquid::Template.register_filter(WNS::QuadsFilter)
2
2
  Liquid::Template.register_filter(WNS::DigestFilters)
3
- Liquid::Template.register_filter(WNS::FilePropertiesFilter)
3
+ Liquid::Template.register_filter(WNS::FilePropertyFilters)
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-wns
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thai Chung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-06-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby-mp3info
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.10
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.10
13
27
  description:
14
28
  email:
15
29
  - mail@0xReki.de
@@ -27,7 +41,7 @@ files:
27
41
  - lib/jekyll-wns.rb
28
42
  - lib/jekyll-wns/assets/abbreviations.rb
29
43
  - lib/jekyll-wns/assets/digest_filters.rb
30
- - lib/jekyll-wns/assets/file_properties_filter.rb
44
+ - lib/jekyll-wns/assets/file_property_filters.rb
31
45
  - lib/jekyll-wns/assets/label_unicode.rb
32
46
  - lib/jekyll-wns/assets/quads.rb
33
47
  - lib/jekyll-wns/assets/quads_filter.rb
@@ -1,7 +0,0 @@
1
- module WNS
2
- module FilePropertiesFilter
3
- def file_size(path)
4
- File.size path
5
- end
6
- end
7
- end