Permalink
Browse files

Make asset_hash work without Rails

  • Loading branch information...
donaldpiret committed Aug 25, 2011
1 parent 57d4a56 commit 12785aa50f8334ec6c68df7e562d7352b8e6ea90
Showing with 3 additions and 3 deletions.
  1. +1 −1 asset_hash.gemspec
  2. +1 −1 lib/asset_hash.rb
  3. +1 −1 test/asset_hash_test.rb
View
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.summary = "Asset hasher for Cloudfront custom origin domain asset hosting."
s.description = "This gem allows you to copy your static assets to include a unique hash in their filename. By using this and modifying your Rails asset path you can easily enable your Rails application to serve static content using CloudFront with a custom origin policy."
s.files = Dir["{app,lib,config}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.textile"]
- s.version = "0.2.1"
+ s.version = "0.2.2"
s.author = "Donald Piret"
s.email = "donald@donaldpiret.com"
s.homepage = "http://donaldpiret.com"
View
@@ -28,7 +28,7 @@ def self.gzip_types
end
def self.path_prefix
- File.join Rails.root, 'public'
+ defined?(Rails) ? File.join(Rails.root, 'public') : ''
end
def self.asset_paths=(paths)
View
@@ -1,4 +1,4 @@
-require 'test_helper'
+require File.expand_path("../test_helper", __FILE__)
class AssetHashTest < ActiveSupport::TestCase
#setup :clear_resource_directories

0 comments on commit 12785aa

Please sign in to comment.