fingerjam 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
data/fingerjam.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fingerjam}
8
- s.version = "0.2.1"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steve Hoeksema"]
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/fingerjam.rb",
31
31
  "lib/fingerjam/base.rb",
32
32
  "lib/fingerjam/capistrano.rb",
33
+ "lib/fingerjam/fix_jammit_encoding.rb",
33
34
  "lib/fingerjam/helpers.rb",
34
35
  "lib/fingerjam/jammit.rb",
35
36
  "lib/fingerjam/railtie.rb",
@@ -3,7 +3,7 @@ Capistrano::Configuration.instance(:must_exist).load do
3
3
  namespace :fingerjam do
4
4
 
5
5
  desc "Package, lock and upload assets"
6
- task :upload, { :roles => :web } do
6
+ task :upload_public, { :roles => :web } do
7
7
  run_locally "rake fingerjam:package"
8
8
  run_locally "rake fingerjam:lock"
9
9
 
@@ -20,8 +20,15 @@ Capistrano::Configuration.instance(:must_exist).load do
20
20
  top.upload(lockfile, File.join(release_path, "config", "assets.lock.yml"))
21
21
  end
22
22
 
23
+ desc "Upload lockfile"
24
+ task :upload_lockfile, { :roles => :app } do
25
+ lockfile = File.realpath(File.join("config", "assets.lock.yml"))
26
+ top.upload(lockfile, File.join(release_path, "config", "assets.lock.yml"))
27
+ end
28
+
23
29
  end
24
30
 
25
- after "deploy:finalize_update", "fingerjam:upload"
31
+ after "deploy:finalize_update", "fingerjam:upload_public"
32
+ after "deploy:finalize_update", "fingerjam:upload_lockfile"
26
33
 
27
34
  end
@@ -0,0 +1,18 @@
1
+ # Monkey patch Jammit to fix encoding issue
2
+ module Jammit
3
+
4
+ class Compressor
5
+
6
+ def compress_js(paths)
7
+ if (jst_paths = paths.grep(Jammit.template_extension_matcher)).empty?
8
+ js = concatenate(paths)
9
+ else
10
+ js = concatenate(paths - jst_paths) + compile_jst(jst_paths)
11
+ end
12
+ js = js.force_encoding('utf-8')
13
+ Jammit.compress_assets ? @js_compressor.compress(js) : js
14
+ end
15
+
16
+ end
17
+
18
+ end
data/lib/fingerjam.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "fingerjam/base"
2
2
  require "fingerjam/helpers"
3
3
  require "fingerjam/jammit"
4
- require "fingerjam/railtie.rb"
4
+ require "fingerjam/railtie"
5
+ require "fingerjam/fix_jammit_encoding"
@@ -6,8 +6,7 @@ namespace :fingerjam do
6
6
 
7
7
  desc "Package assets with Jammit"
8
8
  task :package => :environment do
9
- # Jammit.package!(:force => true)
10
- `jammit -f`
9
+ Jammit.package!(:force => true)
11
10
  end
12
11
 
13
12
  desc "Lock packages to assets.lock.yml"
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 1
9
- version: 0.2.1
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Steve Hoeksema
@@ -139,6 +139,7 @@ files:
139
139
  - lib/fingerjam.rb
140
140
  - lib/fingerjam/base.rb
141
141
  - lib/fingerjam/capistrano.rb
142
+ - lib/fingerjam/fix_jammit_encoding.rb
142
143
  - lib/fingerjam/helpers.rb
143
144
  - lib/fingerjam/jammit.rb
144
145
  - lib/fingerjam/railtie.rb
@@ -159,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
160
  requirements:
160
161
  - - ">="
161
162
  - !ruby/object:Gem::Version
162
- hash: 3010274029174475206
163
+ hash: -2735618090215588831
163
164
  segments:
164
165
  - 0
165
166
  version: "0"