japr 0.4.1 → 0.4.2

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
- SHA1:
3
- metadata.gz: d8399905be227d867b7c97c93d2e93a799370edc
4
- data.tar.gz: 70edcd27fb26e4bca05c307a7ec3b509527e8316
2
+ SHA256:
3
+ metadata.gz: 2c502f6bf09019cda965a99c63ba1436a2c0f28c31cdf9576f976758d35776f0
4
+ data.tar.gz: 1c09cf0c0a536592d0f7420287f748da4dadcee4ad8889c2cbb9f9649388cbf3
5
5
  SHA512:
6
- metadata.gz: 5f2166720692d1f29c17c09292a5d6c5af4006ca9372138dab80bd465bb79b8ce81424478170de45e18cd0cf5196dc0e853bfbe1939693cfcd34b54f1d9f57e5
7
- data.tar.gz: 5b9cc66015a6074ea1264b3e9030dadac7cec3f579285d5944a46e5cc8b2e0e3956dfffda2faf000fcef95fe5cf4f184f3df9f3d1fa61b2911cab19a6e78f334
6
+ metadata.gz: 69fbc2ebbc9a87fa6c509c29b28d05419ff1fc15cb7c0698db2a18a17c8518067346cee838041e5a6288a9ae5a6dd4fcef9a72b24d5fec3bbbae651411e9d06d
7
+ data.tar.gz: 1ca3cefe238a48490d435da247338a9d5993860ac37853c26eff723b17cc4192d2fec7f67c16f2361a6b9f26e432e31430029449057eac91a47dbd35dcd1c56f
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
1
  # JAPR (Jekyll Asset Pipeline Reborn)
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/japr.png)](http://badge.fury.io/rb/japr)
4
- [![Build Status](https://travis-ci.org/janosrusiczki/japr.svg?branch=master)](https://travis-ci.org/janosrusiczki/japr)
5
- [![Coverage Status](https://coveralls.io/repos/janosrusiczki/japr/badge.png?branch=master)](https://coveralls.io/r/janosrusiczki/japr?branch=master)
6
- [![Dependency Status](https://gemnasium.com/janosrusiczki/japr.png)](https://gemnasium.com/janosrusiczki/japr)
3
+ [![Gem Version](https://img.shields.io/gem/v/japr.svg)](https://rubygems.org/gems/japr)
4
+ [![Build Status](https://img.shields.io/travis/janosrusiczki/japr/master.svg)](https://travis-ci.org/janosrusiczki/japr)
5
+ [![Coveralls Status](https://img.shields.io/coveralls/github/janosrusiczki/japr/master.svg)](https://coveralls.io/r/janosrusiczki/japr?branch=master)
7
6
 
8
- JAPR is a powerful asset pipeline that automatically collects, converts and compresses / minifies your site's JavaScript and CSS assets when you compile your [Jekyll](http://jekyllrb.com/) site.
7
+ **Update** On December 20, 2017 JAPR has been merged back into [Jekyll Asset Pipeline](https://github.com/matthodan/jekyll-asset-pipeline). As my time permits I'll try to maintain both repositories.
9
8
 
10
- This project is a fork of [Jekyll Asset Pipeline](https://github.com/matthodan/jekyll-asset-pipeline) by [Matt Hodan](https://github.com/matthodan) which, unfortunately, was pretty much abandonware.
9
+ JAPR is a powerful asset pipeline that automatically collects, converts and compresses / minifies your site's JavaScript and CSS assets when you compile your [Jekyll](http://jekyllrb.com/) site.
11
10
 
12
11
  ## Table of Contents
13
12
 
@@ -360,6 +359,10 @@ You can contribute to the JAPR by submitting a pull request [via GitHub](https:/
360
359
 
361
360
  If you have any ideas or you would like to see anything else improved please use the [issues section](https://github.com/janosrusiczki/japr/issues).
362
361
 
362
+ ## Changelog
363
+
364
+ See [the changelog](CHANGELOG.md).
365
+
363
366
  ## Community
364
367
 
365
368
  - Here is [GitHub's list of projects that use the gem](https://github.com/janosrusiczki/japr/network/dependents).
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Stdlib dependencies
2
4
  require 'digest/md5'
3
5
  require 'fileutils'
@@ -45,11 +47,11 @@ module JAPR
45
47
  # 'gzip' true = Create gzip versions,
46
48
  # false = Do not create gzip versions
47
49
  DEFAULTS = {
48
- 'output_path' => 'assets',
49
- 'display_path' => nil,
50
- 'staging_path' => '.asset_pipeline',
51
- 'bundle' => true,
52
- 'compress' => true,
53
- 'gzip' => false
50
+ 'output_path' => 'assets',
51
+ 'display_path' => nil,
52
+ 'staging_path' => '.asset_pipeline',
53
+ 'bundle' => true,
54
+ 'compress' => true,
55
+ 'gzip' => false
54
56
  }.freeze
55
57
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Holds an asset (file)
3
5
  class Asset
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Base class for asset compressors
3
5
  # See https://github.com/janosrusiczki/japr#asset-compression
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Base class for asset converters
3
5
  # See https://github.com/janosrusiczki/japr#asset-preprocessing
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  # Contains overrides for the needed Jekyll:Site methods
3
5
  # The actual code is in JAPR::JekyllSiteExtensions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Contains overrides for the needed Jekyll:Site methods
3
5
  # Included in Jekyll::Site
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # This is a Liquid tag block extension
3
5
  # See documentation here:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This comment is needed, otherwise Rubocop complains because of the
2
4
  # register_tag below and a verbose comment is better than a :nodoc: :)
3
5
  module JAPR
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This comment is needed, otherwise Rubocop complains because of the
2
4
  # register_tag below and a verbose comment is better than a :nodoc: :)
3
5
  module JAPR
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Helper module used by JAPR::AssetTag as well as
3
5
  # classed derived from it (Liquid tag block extensions)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Allows classes that extend this to return an array of their subclasses
3
5
  module SubclassTracking
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # The pipeline itself, the run method is where it all happens
3
- # rubocop:disable ClassLength
5
+ # rubocop:disable Metrics/ClassLength
4
6
  class Pipeline
7
+ # rubocop:enable Metrics/ClassLength
5
8
  class << self
6
9
  # Generate hash based on manifest
7
10
  def hash(source, manifest, options = {})
@@ -10,9 +13,9 @@ module JAPR
10
13
  Digest::MD5.hexdigest(YAML.safe_load(manifest).map! do |path|
11
14
  "#{path}#{File.mtime(File.join(source, path)).to_i}"
12
15
  end.join.concat(options.to_s))
13
- rescue StandardError => se
14
- puts "Failed to generate hash from provided manifest: #{se.message}"
15
- raise se
16
+ rescue StandardError => e
17
+ puts "Failed to generate hash from provided manifest: #{e.message}"
18
+ raise e
16
19
  end
17
20
  end
18
21
 
@@ -20,9 +23,9 @@ module JAPR
20
23
  # This is called from JAPR::LiquidBlockExtensions.render or,
21
24
  # to be more precise, from JAPR::CssAssetTag.render and
22
25
  # JAPR::JavaScriptAssetTag.render
23
- # rubocop:disable ParameterLists
26
+ # rubocop:disable Metrics/ParameterLists
24
27
  def run(manifest, prefix, source, destination, tag, type, config)
25
- # rubocop:enable ParameterLists
28
+ # rubocop:enable Metrics/ParameterLists
26
29
  # Get hash for pipeline
27
30
  hash = hash(source, manifest, config)
28
31
 
@@ -33,12 +36,12 @@ module JAPR
33
36
  puts "Processing '#{tag}' manifest '#{prefix}'"
34
37
  pipeline = new(manifest, prefix, source, destination, type, config)
35
38
  process_pipeline(hash, pipeline)
36
- rescue StandardError => se
39
+ rescue StandardError => e
37
40
  # Add exception to cache
38
- cache[hash] = se
41
+ cache[hash] = e
39
42
 
40
43
  # Re-raise the exception
41
- raise se
44
+ raise e
42
45
  end
43
46
  end
44
47
 
@@ -81,9 +84,9 @@ module JAPR
81
84
  end
82
85
 
83
86
  # Initialize new pipeline
84
- # rubocop:disable ParameterLists
87
+ # rubocop:disable Metrics/ParameterLists
85
88
  def initialize(manifest, prefix, source, destination, type, options = {})
86
- # rubocop:enable ParameterLists
89
+ # rubocop:enable Metrics/ParameterLists
87
90
  @manifest = manifest
88
91
  @prefix = prefix
89
92
  @source = source
@@ -118,10 +121,10 @@ module JAPR
118
121
  File.dirname(full_path))
119
122
  end
120
123
  end
121
- rescue StandardError => se
124
+ rescue StandardError => e
122
125
  puts 'Asset Pipeline: Failed to load assets from provided ' \
123
- "manifest: #{se.message}"
124
- raise se
126
+ "manifest: #{e.message}"
127
+ raise e
125
128
  end
126
129
 
127
130
  # Convert assets based on the file extension if converter is defined
@@ -156,10 +159,10 @@ module JAPR
156
159
  if File.extname(asset.filename) == ''
157
160
  asset.filename = "#{asset.filename}#{@type}"
158
161
  end
159
- rescue StandardError => se
162
+ rescue StandardError => e
160
163
  puts "Asset Pipeline: Failed to convert '#{asset.filename}' " \
161
- "with '#{klass}': #{se.message}"
162
- raise se
164
+ "with '#{klass}': #{e.message}"
165
+ raise e
163
166
  end
164
167
 
165
168
  # Bundle multiple assets into a single asset
@@ -182,10 +185,10 @@ module JAPR
182
185
 
183
186
  begin
184
187
  asset.content = klass.new(asset.content).compressed
185
- rescue StandardError => se
188
+ rescue StandardError => e
186
189
  puts "Asset Pipeline: Failed to compress '#{asset.filename}' " \
187
- "with '#{klass}': #{se.message}"
188
- raise se
190
+ "with '#{klass}': #{e.message}"
191
+ raise e
189
192
  end
190
193
  end
191
194
  end
@@ -223,10 +226,10 @@ module JAPR
223
226
  File.open(File.join(directory, asset.filename), 'w') do |file|
224
227
  file.write(asset.content)
225
228
  end
226
- rescue StandardError => se
229
+ rescue StandardError => e
227
230
  puts "Asset Pipeline: Failed to save '#{asset.filename}' to " \
228
- "disk: #{se.message}"
229
- raise se
231
+ "disk: #{e.message}"
232
+ raise e
230
233
  end
231
234
  end
232
235
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Base class for the tag templates
3
5
  # See https://github.com/janosrusiczki/japr#templates
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Default output for CSS assets
3
5
  class CssTagTemplate < JAPR::Template
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Default output for JavaScript assets
3
5
  class JavaScriptTagTemplate < JAPR::Template
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
4
  # Contains helper methods used by the tag template classes
3
5
  module TemplateHelper
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JAPR
2
- VERSION = '0.4.1'.freeze
4
+ VERSION = '0.4.2'
3
5
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: japr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hodan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-08 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.5'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.5'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: liquid
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -107,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
113
  requirements:
108
114
  - - ">="
109
115
  - !ruby/object:Gem::Version
110
- version: 2.1.0
116
+ version: 2.3.0
111
117
  required_rubygems_version: !ruby/object:Gem::Requirement
112
118
  requirements:
113
119
  - - ">="
@@ -115,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
121
  version: '0'
116
122
  requirements: []
117
123
  rubyforge_project:
118
- rubygems_version: 2.6.14
124
+ rubygems_version: 2.7.8
119
125
  signing_key:
120
126
  specification_version: 4
121
127
  summary: A powerful asset pipeline for Jekyll that bundles, converts, and minifies