RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

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!

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! :-)

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’”

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)…

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in