Skip to content
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

What do you suggest to disable asset_sync? (precompile => PhoneGap) #66

Closed
webmat opened this issue Apr 24, 2012 · 4 comments
Closed

What do you suggest to disable asset_sync? (precompile => PhoneGap) #66

webmat opened this issue Apr 24, 2012 · 4 comments

Comments

@webmat
Copy link
Contributor

webmat commented Apr 24, 2012

Hey guys,

I love the simplicity of asset_sync. I've recently set it up to deploy my mobile web app's assets to a CDN and it works like a charm!

However I need to precompile my assets for a PhoneGap app, and I can't find any obvious way to simply turn off AssetSync in that scenario.

I've created a dummy config/environments/hybrid.rb to tweak the asset pipeline for my app's needs.

I've tried creating config/initializers/asset_sync.rb and wrapping the config block in a if that checks for the proper Rails.env, but precompilation still fails with Fog provider can't be blank, Fog directory can't be blank.

Any suggestions?

I'm currently looking at the code to see if I can figure out a clean patch I could contribute. But if you already have something in mind, I'd love to hear about it.

Thanks!

@davidjrice
Copy link
Contributor

You'd likely want a custom Rakefile that only enhances the assets:precompile task for deployment environments.

Check out the existing Rakefile and basically add an asset_sync.rake in your project and wrap it with an if clause for something like ENV['RAILS_ENV'] == 'production'

We could perhaps bring this into the gem somehow, but I'm not sure what assumptions I want to make on this...

On Tuesday, 24 April 2012 at 18:56, Mathieu Martin wrote:

Hey guys,

I love the simplicity of asset_sync! I've recently set it up to deploy my mobile web app's assets to a CDN and it works like a charm!

However I need to precompile my assets for a PhoneGap app, and I can't find any obvious way to simply turn off AssetSync in that scenario.

I've created a dummy config/environments/hybrid.rb to tweak the asset pipeline for my app's needs.

I've tried creating config/initializers/asset_sync.rb and wrapping the config block in a if that checks for the proper Rails.env, but precompilation still fails with Fog provider can't be blank, Fog directory can't be blank.

Any suggestions?

I'm currently looking at the code to see if I can figure out a clean patch I could contribute. But if you already have something in mind, I'd love to hear about it.

Thanks!


Reply to this email directly or view it on GitHub:
#66

@webmat
Copy link
Contributor Author

webmat commented Apr 24, 2012

Holy Guacamole, thanks for the quick response :-)

I'm actually in the process of testing a patch that would add a config option named "enabled" that would of course default to true.

I'll let you know if it works to my liking. If so, feel free to merge, comment or ignore :-)

Cheers

@webmat
Copy link
Contributor Author

webmat commented Apr 24, 2012

Let me know what you think. I'll amend the commit based on your feedback if you think this has value.

@davidjrice
Copy link
Contributor

Closing this in favor of the pull request.

webmat added a commit to webmat/asset_sync that referenced this issue May 2, 2012
Useful when precompiling to export to a hybrid mobile app such as PhoneGap.
Would fix issue AssetSync#66.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants