Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixes public root bug with Jammit 0.6.5

The way Jammit defines the public root was changed in
documentcloud/jammit@b6ff4f0
  • Loading branch information...
commit ec633102f999d05e4e2e4832540025d9c7430e8a 1 parent 81eb06c
Vesa Vänskä authored
8  lib/kumade/packagers/jammit_packager.rb
@@ -6,7 +6,7 @@
6 6
 module Kumade
7 7
   class JammitPackager
8 8
     def self.assets_path
9  
-      File.join(Jammit::PUBLIC_ROOT, Jammit.package_path)
  9
+      File.join(public_root, Jammit.package_path)
10 10
     end
11 11
 
12 12
     def self.installed?
@@ -16,5 +16,11 @@ def self.installed?
16 16
     def self.package
17 17
       Jammit.package!
18 18
     end
  19
+
  20
+    private
  21
+
  22
+    def self.public_root
  23
+      defined?(Jammit.public_root) ? Jammit.public_root : Jammit::PUBLIC_ROOT
  24
+    end
19 25
   end
20 26
 end
3  spec/kumade/packagers/jammit_packager_spec.rb
@@ -7,7 +7,8 @@
7 7
 
8 8
   it_should_behave_like "packager"
9 9
 
10  
-  its(:assets_path) { should == File.join(Jammit::PUBLIC_ROOT, Jammit.package_path) }
  10
+  let(:jammit_public_root) { defined?(Jammit.public_root) ? Jammit.public_root : Jammit::PUBLIC_ROOT }
  11
+  its(:assets_path) { should == File.join(jammit_public_root, Jammit.package_path) }
11 12
 
12 13
   it "knows how to package itself" do
13 14
     ::Jammit.stubs(:package!)

0 notes on commit ec63310

Please sign in to comment.
Something went wrong with that request. Please try again.