jekyll-minifier 0.1.8 → 0.1.9

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: 117cf6a5e022dd3c282ac194330042d5929e3ef4653e7c5da400b2feb6c34b7f
4
- data.tar.gz: 36d20a781a57b322bfedbef53b22e8051515099e0555482a899513c0ff7ec593
3
+ metadata.gz: b1a6245b043d0258670069a682586cebd962bfa2e3f2bc309983fe5a7af43c5f
4
+ data.tar.gz: ae646b7490b07d6d807f5a8eb598614ded4c6d428ad201eeb129812983b0fad5
5
5
  SHA512:
6
- metadata.gz: 22d694decf4e5c470fe9c65723b29d45837cb1061261feabe6bbff3ce30bfc512e0c414d63c43a5b5d21cd7636a0f693d40e6b64eee6dd568fbbf2ef2783b097
7
- data.tar.gz: b6fe3b3590df38637c5a7f4dc806c04f445a4b413d9c5fd2ccde4cc76423f78dbaa91000a94f38f843a8dd0c59b206835a65c850302a67895ec45e3ee95006e2
6
+ metadata.gz: eef57564f407f07c5f1d18ef53f70123861d518d538f23ed3eb24614d706d4aa63f2e0cb721b42b56ab2b668bcc1bd72eef83613580c898b67261d33f5270776
7
+ data.tar.gz: 88f3ae6eca8a2437a79e2ebf2d63fba98e96da80e3c318bf111493245b0bfdda2b1aead5ed03e5ee9de430dacc37452d271b9af01c6bb33e09bf960e643bb40a
data/README.md CHANGED
@@ -8,7 +8,7 @@ This was created due to the previous minifier (jekyll-press) not being CSS3 comp
8
8
 
9
9
  Note: this is my first ever gem, I'm learning, so feedback is much appreciated.
10
10
 
11
- ** This minifier now only runs when JEKYLL_ENV="production" is set in the enviornment **
11
+ ** This minifier now only runs when JEKYLL_ENV="production" is set in the environment **
12
12
 
13
13
  Easy to use, just install the jekyll-minifier gem:
14
14
 
@@ -39,7 +39,7 @@ module Jekyll
39
39
  if ( !opts.nil? )
40
40
  # Javascript Arguments
41
41
  js_args += opts[:uglifier_args] if opts.has_key?(:uglifier_args)
42
-
42
+
43
43
  # HTML Arguments
44
44
  html_args[:remove_spaces_inside_tags] = opts['remove_spaces_inside_tags'] if opts.has_key?('remove_spaces_inside_tags')
45
45
  html_args[:remove_multi_spaces] = opts['remove_multi_spaces'] if opts.has_key?('remove_multi_spaces')
@@ -63,7 +63,7 @@ module Jekyll
63
63
  html_args[:preserve_patterns] += [/<\?php.*?\?>/im] if opts['preserve_php'] == true
64
64
  html_args[:preserve_patterns] += opts[:preserve_patterns].map { |pattern| Regexp.new(pattern)} if opts.has_key?(:preserve_patterns)
65
65
  end
66
-
66
+
67
67
  html_args[:css_compressor] = CSSminify2.new()
68
68
 
69
69
  if ( !js_args.nil? )
@@ -95,7 +95,7 @@ module Jekyll
95
95
  compressor = Uglifier.new()
96
96
  end
97
97
 
98
- output_file(path, compressed.compile(content))
98
+ output_file(path, compressor.compile(content))
99
99
  else
100
100
  output_file(path, content)
101
101
  end
@@ -19,7 +19,7 @@ layout: null
19
19
  <!--[if lt IE 9]><script src="//cdn.jsdelivr.net/g/html5shiv@3.7.3,respond@1.4.2" crossorigin="anonymous"></script><![endif]-->
20
20
  <link rel="stylesheet" href="{{ site.baseurl | prepend: site.url }}/assets/css/style.css">
21
21
  <link rel="alternate" type="application/atom+xml" title="Example.com" href="{{ site.baseurl | prepend: site.url }}/atom.xml">
22
-
22
+ <script type="text/javascript" src="{{ site.baseurl | prepend: site.url }}/assets/js/script.js"></script>
23
23
  </head>
24
24
  <body class="layout-reverse sidebar-overlay">
25
25
  {% include sidebar.html %}
@@ -0,0 +1,4 @@
1
+ var sampleFunction = function() {
2
+ console.log('This is sample.');
3
+ };
4
+ sampleFunction();
@@ -22,6 +22,8 @@ describe "JekyllMinifier" do
22
22
  let(:site) { Jekyll::Site.new(config) }
23
23
  let(:context) { make_context(site: site) }
24
24
  before(:each) do
25
+ allow(ENV).to receive(:[]).and_call_original
26
+ allow(ENV).to receive(:[]).with('JEKYLL_ENV').and_return('production')
25
27
  site.process
26
28
  end
27
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-minifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - DigitalSparky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -150,6 +150,7 @@ files:
150
150
  - spec/fixtures/_posts/2013-04-03-test-review-2.markdown
151
151
  - spec/fixtures/_posts/2015-01-01-random.markdown
152
152
  - spec/fixtures/assets/css/style.css
153
+ - spec/fixtures/assets/js/script.js
153
154
  - spec/fixtures/atom.xml
154
155
  - spec/fixtures/index.html
155
156
  - spec/jekyll-minifier_spec.rb
@@ -191,6 +192,7 @@ test_files:
191
192
  - spec/fixtures/_posts/2013-04-03-test-review-2.markdown
192
193
  - spec/fixtures/_posts/2015-01-01-random.markdown
193
194
  - spec/fixtures/assets/css/style.css
195
+ - spec/fixtures/assets/js/script.js
194
196
  - spec/fixtures/atom.xml
195
197
  - spec/fixtures/index.html
196
198
  - spec/jekyll-minifier_spec.rb