-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added optional support for CORS requests for assets on rackspace #149
Open
fountainheadpro
wants to merge
16
commits into
AssetSync:master
Choose a base branch
from
fountainheadpro:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6cb0ac9
added rackspace support for CORS
fountainheadpro 81b5a0a
added CORS headers for rackspace
fountainheadpro 5d0df14
fixed mime type definition
fountainheadpro 62400e8
Update README.md
fountainheadpro 4cd314a
Update README.md
fountainheadpro ca7562f
it will upload all the files.
fountainheadpro a6de896
Merge branch 'master' of github.com:fountainheadpro/asset_sync
fountainheadpro 357b56f
multimime fix
fountainheadpro 8ef9537
multimime fix
fountainheadpro bab67c0
multimime fix
fountainheadpro cc0e0ae
multimime fix
fountainheadpro 4831ec1
multimime fix
fountainheadpro c635bea
error handling
fountainheadpro c4cbf31
rebase plus two new features added: warn_on_failure - suppresses fail…
fountainheadpro d441b19
changed mime resolution to always use mime-types
fountainheadpro 4f994cf
fix for warn_on_failure condition
fountainheadpro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module AssetSync | ||
VERSION = "0.5.4" | ||
VERSION = "0.5.5" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
def bucket(name) | ||
options = { | ||
:provider => 'rackspace', | ||
:rackspace_username => ENV['RACKSPACE_USERNAME'], | ||
:rackspace_api_key => ENV['RACKSPACE_API_KEY'] | ||
} | ||
|
||
connection = Fog::Storage.new(options) | ||
connection.directories.get(ENV['FOG_DIRECTORY'], :prefix => name) | ||
end | ||
|
||
def execute(command) | ||
app_path = File.expand_path("../../dummy_app", __FILE__) | ||
Dir.chdir app_path | ||
`#{command}` | ||
end | ||
|
||
describe "AssetSync" do | ||
|
||
before(:each) do | ||
@prefix = SecureRandom.hex(6) | ||
end | ||
|
||
after(:each) do | ||
@directory = bucket(@prefix) | ||
@directory.files.each do |f| | ||
f.destroy | ||
end | ||
end | ||
|
||
it "sync" do | ||
execute "rake ASSET_SYNC_PREFIX=#{@prefix} assets:precompile" | ||
bucket(@prefix).files.size.should == 5 | ||
|
||
app_js = bucket(@prefix).files.get("#{@prefix}/application.js") | ||
app_js.content_type.should == "text/javascript" | ||
app_js.origin.should == 'mysite.com' | ||
app_js.access_control_allow_origin.should == '' | ||
|
||
app_js_gz = bucket(@prefix).files.get("#{@prefix}/application.js.gz") | ||
app_js_gz.content_type.should == "text/javascript" | ||
app_js_gz.content_encoding.should == "gzip" | ||
|
||
app_js_gz.content_encoding.should == "gzip" | ||
end | ||
|
||
it "sync with enabled=false" do | ||
execute "rake ASSET_SYNC_PREFIX=#{@prefix} ASSET_SYNC_ENABLED=false assets:precompile" | ||
bucket(@prefix).files.size.should == 0 | ||
end | ||
|
||
it "sync with gzip_compression=true" do | ||
execute "rake ASSET_SYNC_PREFIX=#{@prefix} ASSET_SYNC_GZIP_COMPRESSION=true assets:precompile" | ||
bucket(@prefix).files.size.should == 3 | ||
|
||
app_js = bucket(@prefix).files.get("#{@prefix}/application.js") | ||
app_js.content_type.should == "text/javascript" | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be raise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed.