Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

THE UNSTOPPABLE POWER OF RUBY

Name: Anonymous 2009-10-03 4:24

Watch and learn, you low-life punks:


!/usr/bin/ruby

class Shell
  def self.method_missing(name,*args)
    cmd = name.to_s;
    args.each { |a| cmd += " " + a }
    output = `#{cmd}`.split("\n")
    return output
  end
end

puts Shell.ls("-al");
puts
puts Shell.uname("-a");

Name: Anonymous 2009-10-03 4:24

fail. GTFO

Name: Anonymous 2009-10-03 4:24

in before missing # in shebang

Name: Anonymous 2009-10-03 4:41

Why didn't you make them kernel methods so that you don't have to spend all that time typing "Shell" to invoke them? You are a poor programmer.

Name: Anonymous 2009-10-03 4:48

[quote]    return output
  end
[/quote]

-10 style points
GTFO

Name: Anonymous 2009-10-03 4:49

>>5
fuckkkkkkkk i fucked it up realllll good didn't i

Name: Anonymous 2009-10-03 5:02

>>5
Oh because I didnt make use of the implicit return?

Name: Anonymous 2009-10-03 5:07

fixed


class Shell
  def self.method_missing(name,*args)
    `#{name.to_s + " " + args.join(" ")}`.split("\n")
  end
end

Name: Anonymous 2009-10-03 5:31

Where is that Amazing Anus fellow? I enjoyed his banter.

Name: Haxus the Amazing Anus 2009-10-03 5:33

Haxus the Amazing Anus

Name: Anonymous 2009-10-03 7:16

Nice party trick, David. I wish I could go back in time and prevent you from making it the core architecture pattern of web 2.0.

Name: Anonymous 2009-10-03 19:02

>>11
This was pure ruby, not rails.

I am thinking about writing something codenamed Trolling on Rails to aid in crapflooding or meme-insertion etc etc

Name: Anonymous 2009-10-03 19:27

def Object.const_missing(name)
  if (not Object.constants.include?(name.capitalize.to_sym))
    m = Module.new do
      def self.method_missing(name, &block)
        self.class.send(:define_method, name, &block)
        true
      end
    end
    Object.const_set(name.capitalize, m)
  end
end


Party.trick {|x, y| puts x+y}
Party.trick 2,3

Name: Anonymous 2009-10-03 19:56

>>12
etc etc
Back to /./, please.

Name: Anonymous 2009-10-03 20:26

Fjölnir on Fjords has superseded RoR as the state-of-the-art in Web technology.

Name: Anonymous 2009-10-03 20:52

>>15
GRUNNER

Name: Anonymous 2009-10-04 0:46

>>16
in Norwegian, grunner means 'reasons'

Name: Anonymous 2009-10-04 0:48

   
これは、NULLは無効です。

Name: Anonymous 2009-10-04 0:54

Name: Anonymous 2009-10-04 1:24

http://code.google.com/p/mjollnir/
Future goals:
     Better runtime error messages (stack traces etc.)
     Support more of "GRUNNUR" and other libraries

Name: Anonymous 2009-10-04 1:34

Name: Anonymous 2009-10-04 1:44

>>21
Actually, in Iceland, it goes DD/MM/YY, not MM/DD/YY, so that means it was updated 17-5th-2009 in the U.S. date format.

Name: Anonymous 2009-10-04 5:10

>>20,21
;_;

Name: Anonymous 2009-10-04 5:11

>>22
What the hell are you talking about?! You're crazy!

Name: Anonymous 2009-10-04 10:55

"GRUNNUR". IHBT.

Name: GJSussman !xpQSO2ECEY 2009-10-16 14:51

>>21
Not quite.

Name: Anonymous 2010-11-15 11:16

Name: Anonymous 2011-02-02 23:36


Don't change these.
Name: Email:
Entire Thread Thread List