jekyll-jsminify 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/jekyll-jsminify.rb +57 -0
  3. metadata +115 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 90bfc88cd041d384ad261dc0d9d1dfaf09543b66
4
+ data.tar.gz: 98ab4e29ab6ab774b578d29fface2de3f04c9493
5
+ SHA512:
6
+ metadata.gz: 6a9895359210d1d57761a5e69602a9ac3ed12448d643c4023af6bae685f0e465e2bb5aaad94ef273af6b4d4758e52de0fff71b745c27d11c36e196a79509583a
7
+ data.tar.gz: 1f78e4832895d9ec113d45a5a0f005e96205871b6d6f04230d1134520ccfca230901f1dc2faab32bbad4fc13aac331721a7d0617e77c5f7a4bd52d8feca6a268
@@ -0,0 +1,57 @@
1
+ require 'uglifier'
2
+
3
+ DEFAULT_UGLIFY_OPTS = {
4
+ "jsminify" => {
5
+ :comments => :none
6
+ }
7
+ }
8
+
9
+ module Jekyll
10
+ module Converters
11
+ class JSMinify < Converter
12
+ safe true
13
+ priority :lowest
14
+
15
+ def initialize(config={})
16
+ @config = DEFAULT_UGLIFY_OPTS.merge config
17
+ end
18
+
19
+ def matches(ext)
20
+ ext.downcase == ".js"
21
+ end
22
+
23
+ def output_ext(ext)
24
+ ".js"
25
+ end
26
+
27
+ def convert(content)
28
+ Uglifier.new(@config['jsminify']).compile content
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ module Jekyll
35
+ module Converters
36
+ class CSMinify < CoffeeScript
37
+ safe true
38
+ priority :lowest
39
+
40
+ def initialize(config={})
41
+ @config = DEFAULT_UGLIFY_OPTS.merge config
42
+ end
43
+
44
+ def matches(ext)
45
+ ext.downcase == ".coffee"
46
+ end
47
+
48
+ def output_ext(ext)
49
+ super
50
+ end
51
+
52
+ def convert(content)
53
+ Uglifier.new(@config['jsminify']).compile super
54
+ end
55
+ end
56
+ end
57
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-jsminify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Garen J. Torikian
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: uglifier
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jekyll
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description:
84
+ email:
85
+ - gjtorikian@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - lib/jekyll-jsminify.rb
91
+ homepage: https://github.com/gjtorikian/jekyll-jsminify
92
+ licenses:
93
+ - MIT
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.2.2
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: A JavaScript and CoffeeScript minifier for Jekyll.
115
+ test_files: []