cjohansen / juicer

A command line tool for JavaScript and CSS developers
630 stars 47 forks source link

asset hosts- ghost feature? #24

Closed shucke closed 14 years ago

shucke commented 14 years ago

Try as I might I can not get asset hosts to work, one of the main reasons to try your juice. I just get either the relative or absolute urls, whatever I enter in my css. As I under stand it I should be getting http://images1.example.com/skins/images/image.png or similar. yes? Is there some magic to this? It is quite difficult trying to decipher the instruction manual because the references to relative and absolute and what is relative to what, and absolute to what. perhaps some examples might be appropriate or one that clearly delineates each piece of the puzzle. After banging my head on the desk for 5 or 6 hours I just feel like an idiot not being able to make the asset hosts work.

thanks

cjohansen commented 14 years ago

Hi,

In some sort of weird coincidence, I received a pull request containing fixes to the asset hosts implementation today. I've pulled and prepared 1.0.4 which should hit gem servers tomorrow. I'll test and try to help you out with the command tomorrow. Sorry for the inconvenience!

shucke commented 14 years ago

Nah, no inconvenience my friend, appreciate your work, very nice tool Did finally figure out that the secret was the relative paths. It seems to block you unless you use relative, is that correct? something like that. I ended up rolling through my css and posting that but now am trying to debug a bunch of jquery add-ons. Interesting how many errors jquery throws when running it through jslint. just goes to show you, everybody's got issues. Keep up the good work and I will grab that update when it hits the shelves. enjoy and thanks

cjohansen commented 14 years ago

I used the following command: juicer merge -f --all-hosts-local -h http://host1,http://host2 -b -d . design/css/my.css

This works for all URL's already absolute, but it seems a there's a bug here. Any relative URL's are mapped to absolute, but they aren't given host names. I have to look into this and provide a fix.

cjohansen commented 14 years ago

It seems that relative urls don't have asset hosts added. I've added a fix for it, but I need to test it more before I can release. If you want to try it, clone the repo and build juicer:

git clone git@github.com:cjohansen/juicer.git cd juicer rake build gem install pkg/juicer-1.0.4.gem

shucke commented 14 years ago

gave it a try but your system threw me out like the bum I am...

This would be the first time I have used git, and my experience with modern (read linux or osx) compilers and the build process is fairly limited having been pampered with windows and dev studio type situations for most of my 25 year off and on pro and amateur career so please bear with the noobness... This fix is timely however as I have updated all urls of static content to run as relative for the simple reason that I need the same web to run under both standard and ssl connections and therefore the use of //staticsubdomain.domain.com is in order...

Hope I can access soon. thank you

The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? y Please type 'yes' or 'no': yes Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly

shucke commented 14 years ago

I should be more clear on what I am, and I would imagine lots of others will need to do because I am not sure that your setup to be able to do it yet...

Regarding absolute vs. relative vs. the third option which I have heard referred to as fixed relative or absolute relative or absolutely ridiculous, there needs to be the third option for those who run sites under both open and ssl connections. When an absolute url of say, http://static.domain.com is connected in ssl we get the browser errors and IE claiming an insecure connection. If we try and use relative paths we have no way to provide best practice urls to force static content to a cookieless domain and/or cdn. So by providing the subdomain without the connection type (ie. http, https) we can allow the flexibility of a dual connected website along with the best practices for speeding up our website. Can you dig it man? I knew you could.

So what say you, all in favor of making sure this coolest of tools can do the duo connection raise your right leg, those opposed just keep ya pie holes shut...

seriously, I am not sure if yours can do it already, and in my case no biggie because I already went through and modified all my links to do the duo, but I hope that it can go this route, would probably be so helpful to so many.

keep it real!

cjohansen commented 14 years ago

This issue should be fixed with 1.0.5 which was just released