ee_jammit 0.6.6

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.
@@ -0,0 +1,14 @@
1
+ # Rails 3 configuration via Railtie
2
+
3
+ if defined?(Rails::Railtie)
4
+ module Jammit
5
+ class Railtie < Rails::Railtie
6
+
7
+ initializer :jammit_routes do |app|
8
+ # Add a Jammit route for the reloader.
9
+ app.routes_reloader.paths << File.join(File.dirname(__FILE__), "..", "..", "rails", "routes.rb")
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,23 @@
1
+ module Jammit
2
+
3
+ # Rails 2.x routing module. Rails 3.x routes are in rails/routes.rb.
4
+ module Routes
5
+
6
+ # Jammit uses a single route in order to slow down Rails' routing speed
7
+ # by the absolute minimum. In your config/routes.rb file, call:
8
+ # Jammit::Routes.draw(map)
9
+ # Passing in the routing "map" object.
10
+ def self.draw(map)
11
+ map.jammit "/#{Jammit.package_path}/:package.:extension", {
12
+ :controller => 'jammit',
13
+ :action => 'package',
14
+ :requirements => {
15
+ # A hack to allow extension to include "."
16
+ :extension => /.+/
17
+ }
18
+ }
19
+ end
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,17 @@
1
+ # Wraps sass' css compressor to use the same API as the rest of
2
+ # Jammit's compressors.
3
+ class Jammit::SassCompressor
4
+ # Creates a new sass compressor. Jammit::SassCompressor doesn't use
5
+ # any options, the +options+ parameter is there for API
6
+ # compatibility.
7
+ def initialize(options = {})
8
+ end
9
+
10
+ # Compresses +css+ using sass' CSS parser, and returns the
11
+ # compressed css.
12
+ def compress(css)
13
+ root_node = ::Sass::SCSS::CssParser.new(css).parse
14
+ root_node.options = {:style => :compressed}
15
+ root_node.render.strip
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ class Jammit::Uglifier < ::Uglifier
2
+ alias :compress :compile
3
+ end
@@ -0,0 +1,10 @@
1
+ if defined?(Rails::Application)
2
+ # Rails3 routes
3
+ Rails.application.routes.draw do
4
+ match "/#{Jammit.package_path}/:package.:extension",
5
+ :to => 'jammit#package', :as => :jammit, :constraints => {
6
+ # A hack to allow extension to include "."
7
+ :extension => /.+/
8
+ }, :via=>[:get]
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ee_jammit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.6
5
+ platform: ruby
6
+ authors:
7
+ - Jeremy Ashkenas
8
+ - Brenda Strech
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cssmin
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 1.0.2
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.0.2
28
+ - !ruby/object:Gem::Dependency
29
+ name: jsmin
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: 1.0.1
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.0.1
42
+ description: ! " Enphase Fork to get the Rails 4 route compatibility\n Jammit
43
+ is an industrial strength asset packaging library for Rails,\n providing both
44
+ the CSS and JavaScript concatenation and compression that\n you'd expect, as
45
+ well as YUI Compressor and Closure Compiler compatibility,\n ahead-of-time gzipping,
46
+ built-in JavaScript template support, and optional\n Data-URI / MHTML image embedding.\n"
47
+ email: jeremy@documentcloud.org
48
+ executables:
49
+ - jammit
50
+ extensions: []
51
+ extra_rdoc_files:
52
+ - README
53
+ files:
54
+ - LICENSE
55
+ - README
56
+ - bin/jammit
57
+ - jammit.gemspec
58
+ - lib/jammit.rb
59
+ - lib/jammit/command_line.rb
60
+ - lib/jammit/compressor.rb
61
+ - lib/jammit/controller.rb
62
+ - lib/jammit/cssmin_compressor.rb
63
+ - lib/jammit/dependencies.rb
64
+ - lib/jammit/helper.rb
65
+ - lib/jammit/jsmin_compressor.rb
66
+ - lib/jammit/jst.js
67
+ - lib/jammit/middleware.rb
68
+ - lib/jammit/packager.rb
69
+ - lib/jammit/railtie.rb
70
+ - lib/jammit/routes.rb
71
+ - lib/jammit/sass_compressor.rb
72
+ - lib/jammit/uglifier.rb
73
+ - rails/routes.rb
74
+ homepage: http://documentcloud.github.com/jammit/
75
+ licenses: []
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options:
79
+ - --title
80
+ - Jammit
81
+ - --exclude
82
+ - test
83
+ - --main
84
+ - README
85
+ - --all
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project: jammit
100
+ rubygems_version: 2.3.0
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Industrial Strength Asset Packaging for Rails
104
+ test_files: []