Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Nov 6, 2009
1 parent 027ebe9 commit cc37486
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/asset_trip/file_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def write!(contents)
end

end
end
end
2 changes: 1 addition & 1 deletion lib/asset_trip/url_rewriter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def rewrite(contents)
def setup_fake_controller_for_asset_host_computation
environment = {}
environment["HTTPS"] = "on" if @scheme == "https"
@controller = OpenStruct.new(:request => ActionController::Request.new(environment)) # Used by Rails compute_asset_host method from ActionView::Helpers::AssetTagHelper
@controller = OpenStruct.new(:request => ActionController::Request.new(environment)) # Used by Rails compute_asset_host method from ActionView::Helpers::AssetTagHelper
end

def add_asset_host_to_path(path)
Expand Down
16 changes: 7 additions & 9 deletions spec/integration/bundle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module AssetTrip

asset("signup.ssl.css").should have_contents('url(https://cdn1.example.com/foo.jpg)')
end

it "respects ssl? method of request in asset proc" do
asset_proc = Proc.new { |source, request|
if request.ssl?
Expand All @@ -150,16 +150,15 @@ module AssetTrip

asset("signup.ssl.css").should have_contents('url(https://assets.example.com/foo.jpg)')
end

it "does not write a new bundle if the package has not expired" do

it "does not write a new bundle if the package has not expired" do
install_js_config <<-CONFIG
js_asset "signup" do
include "main.js"
end
CONFIG
AssetTrip.bundle!

asset_mtime = 5.minutes.ago
source_mtime = 10.minutes.ago
asset("signup.js").utime(asset_mtime, asset_mtime)
Expand All @@ -168,27 +167,26 @@ module AssetTrip
AssetTrip.bundle!
asset("signup.js").mtime.to_i.should == asset_mtime.to_i
end

it "should use the most recent package to detect mtimes for expiry" do
install_js_config <<-CONFIG
js_asset "signup" do
include "main.js"
end
CONFIG
AssetTrip.bundle!

asset_mtime = 5.minutes.ago
source_mtime = 10.minutes.ago
oldest_asset_mtime = 15.minutes.ago

asset("signup.js").utime(asset_mtime, asset_mtime)
app_javascript("main.js").utime(source_mtime, source_mtime)
create_asset("46/123431bdc/signup.js", :mtime => oldest_asset_mtime)

AssetTrip.bundle!
assets("signup.js").map { |asset| asset.mtime.to_i }.sort.should == [oldest_asset_mtime.to_i, asset_mtime.to_i]
end

end

it "minifies JavaScript using the YUI Compressor" do
Expand Down
2 changes: 1 addition & 1 deletion spec/support/sandbox_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def setup_sandbox_app!(around = :all)

end
end
end
end

0 comments on commit cc37486

Please sign in to comment.