http_require == require files over HTTP
Astrails http_require Wouldn’t it be cool if you could just require “http://my-host/my-lib.rb” in ruby? Now You Can! Using our “http_require” gem! :-)
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Astrails http_require Wouldn’t it be cool if you could just require “http://my-host/my-lib.rb” in ruby? Now You Can! Using our “http_require” gem! :-)
Comments
It is an interesting concept but I don’t know if I want my dependencies to be distributed across the internet. How does this work with gems that need to be compiled?
That was a stupid question… looks like this doesn’t load gems.
This isn’t meant to replace your standard dependencies (at least not yet :) but rather as a way to run some simple scripts directly from the web. This installation/bootstrap scripts etc.
Another idea is that you can forward localhost webserver to a remote ssh and run a local script there w/o any download by running smth like ssh ruby -e “require ‘http://localhost:forward_port/local_path/script.rb’”
It’s been done: http://fhwang.net/2005/11/01/urirequire-I-got-yer-Web-2-0-right-here
Pff.. do you really want to do THAT?!?!
This is not a security risk..nope…not at all…
module Kernel alias :require_without_http :require” end
No, thanks.
Aside from the security implications, core library hacking, etc., you’re also putting yourself in a position where your code relies on a particular HTTP server working (forever)…
And again, more robustly:
http://groups.google.com/group/ruby-talk-google/browse_thread/thread/dbae337818d8d4b0/32bbd220ccac5399?hl=en&lnk=gst&q=remote+require#32bbd220ccac5399
Post a comment