<lianj>
sorry to say, but because you didn't understood the ruby object model yet. then its not screwed up
<madhadron>
lianj: I didn't realize that namespaces and classes are entirely conflated. Now that I understand it, I think it's a design error.
outoftime has quit [Quit: Leaving]
outoftime has joined #ruby-lang
outoftime has quit [Read error: Connection reset by peer]
<lianj>
madhadron: there are no namespaces
davidbalbert is now known as davidbalber|away
<micaeked>
madhadron: it seems like you have some expectations about how things should work. if you have some time later, consider reading "metaprogramming ruby" or something else which explains the object model
<banisterfiend>
madhadron: you're thinking about things wrongly, ruby doesn't have 'functions', it's a pure object oriented language, it only has methods
<micaeked>
banisterfiend: nope
<micaeked>
banisterfiend: lambda
<madhadron>
micaeked: That's…sort of a function.
<micaeked>
yes, lambda/proc is just a function
<banisterfiend>
micaeked: you can use lambdas as functions, but 1. they're anonymous 2. they're very different syntactically and often awkward to use
<madhadron>
micaeked: proc is *not* a function.
<madhadron>
It's a procedure call with strange redefinition of the semantics of return.
<banisterfiend>
micaeked: but more importantly they haven't got any traction in the ruby community as 'functions', i've pretty much never seen someone use a lambda as one would use a 'function' in a traditional language
<micaeked>
fuck the "ruby community". the language is nice
<madhadron>
micaeked: Anyway, my expectations were from Smalltalk, where I can package classes into namespaces.
<banisterfiend>
micaeked: so... how do you use lambdas as functions, you realize if you assign them to a local they're going to disappear outside that scope, so what do you do? assign them to constants?
andrewhl has joined #ruby-lang
<madhadron>
But then, I've already been bitten by modules before, such as not being able to control the order of superclass invocation.
<micaeked>
banisterfiend: no. they are anonymous functions. i use them when i need anonymous functions
<madhadron>
I think the better statement is that there are no variables besides instance variables.
<banisterfiend>
micaeked: yes, they're anonymous functions, they're similar to anonymous functions in other languages, they're not really a replacemtn for regular functions, as yo would have them in C and probably even python (though im not that famliar iwth python)
<micaeked>
madhadron: wut? local variables
<madhadron>
madhadron: No variables outside method scope that aren't instance variables.
<madhadron>
Whoops, to micaeked
<micaeked>
madhadron: yep, you can have local variables in class/module scope
<madhadron>
micaeked: Okay, yes.
<micaeked>
madhadron: again, if you want to do something interesting with the language, you're gonna have to know the object model
<banisterfiend>
madhadron: smalltalk has a concept of function being distinct from methods?
<madhadron>
banisterfiend: No. Smalltalk has blocks and that's it.
<banisterfiend>
madhadron: cool
<madhadron>
micaeked: I'm not trying to do something interesting with it. I'm trying to write a bloody SDK to join a set of five other SDKs in other languages. By design, the code is supposed to be as simple as possible.
<madhadron>
This isn't even core code of the SDK
<madhadron>
It's handling fallthrough for Nokogiri to REXML if Nokogiri isn't present
<madhadron>
and as I inherited the first version of this code, everything's in one module, as if it were a namespace
<madhadron>
I have no idea if that's good practice or bad, but I'm stuck with it.
<banisterfiend>
madhadron: so what problems are you having using modules as namespaces?
sj26 has quit [Quit: Rainbows!]
<madhadron>
banisterfiend: Say I have a method f on the module. I need to call it during the module's instantiation (outside of method definitions), and I need to call it also from outside the module elsewhere, such as in the test suite.
itsmeduncan has quit [Quit: itsmeduncan]
<banisterfiend>
madhadron: modules aren't instantiated, what do you mean?
<madhadron>
Apparently I will have to call it as a method of the module from outside if I want to use it during instantiation at all, which will seriously violate principle of least surprise.
<madhadron>
banisterfiend: module A def f() … end f() end
<banisterfiend>
madhadron: but how are you 'instantiating' that?
<madhadron>
The module is evaluated and created in the Ruby runtime as an object in its own right.
<madhadron>
Actually, it's module A def self.f() … end f() end, as someone pointed out
<banisterfiend>
madhadron: Yeah, basically the module body is executable code, so methods are only defined as they're encounntered (where the 'def' is read), but you're wanting to call a method before it's actually been created?
agile has joined #ruby-lang
<madhadron>
Apparently, yes.
<madhadron>
Oh well. The hack solution is just to duplicate the code and forget about the whole problem.
towski has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
<banisterfiend>
madhadron: you're likely porting across patterns from ruby that dont work here, im sure there's an elegant ruby-ish solution for you
ryanf has joined #ruby-lang
<banisterfiend>
from other languages*
benanne has quit [Quit: kbai]
sailias has joined #ruby-lang
<havenn>
madhadron: What are you trying to do exactly? Extend a module into another module?
<madhadron>
havenn: No. There's only one module. The module is acting as a namespace.
<madhadron>
banisterfiend: Probably. However, I've been sufficiently underwhelmed with the language where I have no interest in learning it well or ever using it again. Almost no documentation, bizarre inconsistencies in the libraries...
pkrnj has quit [Quit: Computer has gone to sleep.]
<madhadron>
havenn: I just did a hack where I duplicated code.
<madhadron>
So, thanks everyone for suggestions.
<lianj>
madhadron: now you entered the trollzone finally
<banisterfiend>
madhadron: well if you come from a smalltalk background that's probably fair
<havenn>
madhadron: Ruby has an ISO spec.
davidbalber|away is now known as davidbalbert
<madhadron>
lianj: Oh, I probably entered that a long while back.
<banisterfiend>
madhadron: but as far as non-smalltalk languages go it's pretty cool
<madhadron>
banisterfiend: I'm primarily a Lisp and Haskell guy. Smalltalk was a sideline for me, but was my analogy for Ruby.
<madhadron>
The closest model I had, since Python's rather farther off.
<banisterfiend>
madhadron: the fact that module/class bodies are executable code like any other code in ruby is actually pretty cool, it allows us to call class methods in there that do metaprogramming stuff, like generate instance methods. That's how attr_accessor and pals work
karasawa has quit [Ping timeout: 265 seconds]
<banisterfiend>
madhadron: if what you're asking was possible, then i guess module/class bodies wouldn't be just normal executable code, and some of the metaprogramming tricks we do in there to set up the class wouldn't work
<madhadron>
banisterfiend: Yes. The PLT Racket object system's probably a better model to think about it with than any other I know.
<madhadron>
and they do some delightful metaprogramming tricks using executable class bodies.
itsmeduncan has joined #ruby-lang
<madhadron>
Though they don't actually have a constructor method. You would do a lot of the tricks in Ruby via metaclasses.
<madhadron>
Anyway, thanks to you all. Apologies for being so acerbic.
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
<charliesome>
madhadron: you might be more at home like this: http://eval.in/6113
drollwit has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
<madhadron>
I'd be even more at home with generic functions, but thanks. (: I've seen openstruct, but I'm trying to get away with no external library dependencies.
drollwit has quit [Remote host closed the connection]
richardburton has joined #ruby-lang
drollwit has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 255 seconds]
<madhadron>
banisterfiend: Incredibly useful. Been used to fix stuff in Common Lisp for years.
<madhadron>
And hooks in emacs.
<banisterfiend>
madhadron: cool. But the nice thing about ruby (IMO) is that you can do all that stuff without macros, and you can do it with a really clean syntax that makes it look like they're actual language keywords
richardburton has quit [Ping timeout: 265 seconds]
<madhadron>
banisterfiend: advice in CL and hooks in emacs aren't macros either.
<madhadron>
advice is actually introspection into the runtime
<banisterfiend>
ah ok, what is advice?
<madhadron>
It modifies existing objects
<madhadron>
So if I know that a particular function in a particular system has a bug on certain input values
emocakes has quit [Quit: emocakes]
<madhadron>
I can define advice to the system for that case which will patch it up
<banisterfiend>
madhadron: so it's like a before hook?
<madhadron>
banisterfiend: It can be. You can use it as a straightforward around wrapper
<banisterfiend>
madhadron: interesting, but is 'advice' built into the language or is it just pattern?
<madhadron>
banisterfiend: Well, it's part of the standard library under defadvice
<madhadron>
Emacs Lisp has it, too
<banisterfiend>
cool
mercwithamouth has joined #ruby-lang
<madhadron>
Might be easier to play with there instead of powering up a CL system. And hooks like before and after are the bread and butter of emacs modes.
<madhadron>
Anyway, thanks, all. Time for me to go home.
madhadron has quit [Quit: Leaving.]
<banisterfiend>
that was interesting, a guy who doesn't like ruby who wasn't a dick about it
sailias has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
bantic has quit [Quit: bantic]
<micaeked>
meh. i find holier-than-thou worse than a dick. it's easier to point out a dick and ignore them
rins has quit [Ping timeout: 265 seconds]
KA_ has quit [Quit: KA_]
KA_ has joined #ruby-lang
justinram has quit [Remote host closed the connection]
ivanoats has quit [Remote host closed the connection]
__butch__ has quit [Quit: Leaving.]
banisterfiend has quit [Ping timeout: 256 seconds]
brianpWins has quit [Quit: brianpWins]
guns has joined #ruby-lang
stevechiagozie has quit [Quit: Computer has gone to sleep.]
marr has quit [Ping timeout: 260 seconds]
srbaker has joined #ruby-lang
rcvalle has quit [Quit: Leaving]
sush24 has joined #ruby-lang
davidbalbert is now known as davidbalber|away
gregmoreno has quit [Remote host closed the connection]
mpan has quit [Quit: Leaving]
drollwit has quit [Remote host closed the connection]
drollwit has joined #ruby-lang
itsmeduncan has quit [Quit: itsmeduncan]
karasawa has joined #ruby-lang
micaeked has quit [Quit: WeeChat 0.3.9.2]
alec has quit [Ping timeout: 246 seconds]
stevechiagozie has joined #ruby-lang
karasawa has quit [Ping timeout: 265 seconds]
dvorak has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
heftig has quit [Ping timeout: 245 seconds]
heftig has joined #ruby-lang
blahwoop has quit [Ping timeout: 276 seconds]
drollwit has quit [Remote host closed the connection]
<tubbo>
means my configuration here is just screwed up
<tubbo>
oh wait
<tubbo>
362??
<tubbo>
i'm on 327
<imperator>
i used the redcarpet gem, not head
<tubbo>
lemme upgrade
<tubbo>
lol
heftig has joined #ruby-lang
<tubbo>
yeah all of this was working before
<tubbo>
so that's why it's so puzzling
Rarrikins has quit [Ping timeout: 248 seconds]
dhsmith has quit [Remote host closed the connection]
joshcheek has joined #ruby-lang
brianpWins has joined #ruby-lang
neocoin has quit [Read error: Connection reset by peer]
neocoin has joined #ruby-lang
Rarrikins has joined #ruby-lang
<joshcheek>
Hi, I have some code that doesn't parse but seems like it should. Am I missing something, or is this a bug? https://gist.github.com/4480680
Rarrikins_x has joined #ruby-lang
<imperator>
tubbo, gotta run, good luck
neocoin_ has joined #ruby-lang
<tubbo>
thanks for your help man :)
Rarrikins_x_n has joined #ruby-lang
alvaro_o_ has quit [Quit: Ex-Chat]
<tubbo>
joshcheek: well, and/&& aren't exactly the same thing
<tubbo>
joshcheek: and implies a control flow, while && evaluates a boolean expression
Rarrikins has quit [Ping timeout: 255 seconds]
neocoin has quit [Ping timeout: 276 seconds]
<tubbo>
in that case, `return` breaks you out of the boolean expression
<tubbo>
but when you do `and return`, it is telling ruby to continue and return 1 if the previous expression is true
<tubbo>
does that make sense?
<tubbo>
(it totally didn't for me at first either lol)
<joshcheek>
But `1 && (return 1)` works.
Rarrikins_x has quit [Ping timeout: 276 seconds]
<tubbo>
i had to shoot myself in the foot to find out
<tubbo>
joshcheek: yeah, because `1 && ()` is a boolean expression. `return 1` is an expression inside ()
<tubbo>
so `return 1` returns 1. you're now doing `1 && (1)`
<tubbo>
which works :)
Rarrikins_x_n_g has joined #ruby-lang
<joshcheek>
You're saying that `(return 1)` evaluates to 1, as in the return statement returns from the parentheses?
dhsmith has joined #ruby-lang
Rarrikins_x_n has quit [Ping timeout: 255 seconds]
<joshcheek>
tubbo: you can't put a return in the middle of irb, it needs a context. E.g. `-> { 1 && (return 1) }.call`
<tubbo>
ah
wmoxam has quit [Remote host closed the connection]
<tubbo>
joshcheek: well in any case, i think when you do 1 && return, it will immediately break you out of the statement
<tubbo>
which might be what is causing your problem
<joshcheek>
Idk, the inconsistency causes me to think it's a bug.
Rarrikins_x_n_g has quit [Ping timeout: 255 seconds]
imajes has quit [Excess Flood]
Rarrikins_x_n_g has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
<tubbo>
nah i think it's that return
<tubbo>
because -> { 1 && return }.call => nil
imajes has joined #ruby-lang
jbsan has quit [Quit: jbsan]
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
<tubbo>
return is saying "break out of the boolean expression now" and it seems to stop parsing everything after it as an argument
hell_razer has quit [Ping timeout: 255 seconds]
KA_ has quit [Quit: KA_]
Rarrikins_x_n_g has quit [Ping timeout: 260 seconds]
Rarrikins has joined #ruby-lang
ivanoats has quit [Ping timeout: 256 seconds]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
Rarrikins_n has joined #ruby-lang
Rarrikins has quit [Ping timeout: 240 seconds]
<joshcheek>
tubbo: Was thinking that since return is a keyword, it might actually parse like `1 && return (1)` and the `&&` might bind higher than the adjacency of the `(1)`. But Ripper doesn't make sense to me: http://pastie.org/5645765
<joshcheek>
Really I just want to be able to identify, given a line of code, whether it will return so that I can know whether I can assign it to a variable/pass to a method http://pastie.org/5645771
Rarrikins has joined #ruby-lang
Rarrikins_n has quit [Ping timeout: 276 seconds]
mistym has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby-lang
karasawa has quit [Ping timeout: 260 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
guns has quit [Quit: guns]
m3nd3s has quit [Remote host closed the connection]
alec__ has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
sush24 has joined #ruby-lang
bfreeman has joined #ruby-lang
rins has joined #ruby-lang
jtoy has joined #ruby-lang
srbaker has joined #ruby-lang
jtoy has quit [Client Quit]
srbaker has quit [Quit: Computer has gone to sleep.]
jonahR has quit [Quit: jonahR]
alan_sebastian has joined #ruby-lang
alan_sebastian has quit [Client Quit]
gokul has joined #ruby-lang
rins has quit [Ping timeout: 276 seconds]
ivanoats has joined #ruby-lang
rsl has quit [Quit: Computer has gone to sleep.]
breakingthings has quit []
sush24 has quit [Quit: This computer has gone to sleep]
ivanoats has quit [Remote host closed the connection]
blahwoop has joined #ruby-lang
dwu1 has joined #ruby-lang
tubbo has quit [Ping timeout: 264 seconds]
vlad_starkov has joined #ruby-lang
ivanoats has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 248 seconds]
gjaldon has quit [Ping timeout: 246 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
sailias has quit [Quit: Leaving.]
Nisstyre has quit [Remote host closed the connection]
Weems has quit [Read error: Connection reset by peer]
firefux has joined #ruby-lang
wellnowwhat has joined #ruby-lang
wellnowwhat has left #ruby-lang [#ruby-lang]
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
itsmeduncan has quit [Quit: itsmeduncan]
Ender___ has joined #ruby-lang
havenn has quit [Remote host closed the connection]
Ender___ has quit [Remote host closed the connection]
Ender___ has joined #ruby-lang
Ender___ has quit [Client Quit]
havenn has joined #ruby-lang
havenn has quit [Read error: No route to host]
bubonicpestilenc has joined #ruby-lang
<bubonicpestilenc>
hey all
<bubonicpestilenc>
is there a way to automatically install required gems?
havenn has joined #ruby-lang
<bubonicpestilenc>
e.g. i have require "a"; req "b"; req "c"; inside common.rb and when i run `ruby main.rb" i wish to install a, b, c gems automatically
vlad_starkov has joined #ruby-lang
bubonicpestilenc has quit [Client Quit]
mjio has quit []
mjio has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
mercwithamouth has joined #ruby-lang
ryanf_ has joined #ruby-lang
Rarrikins_l_e has quit [Ping timeout: 255 seconds]
ivanoats has quit [Remote host closed the connection]
<gnufied>
in which world it is okay to break API in minor release?
<charliesome>
in ruby
<charliesome>
rails is going to be breaking the best api ever soon :(
alec has quit [Quit: back at putzis, slothrop curls in a wide crisp sheeted bed beside solange, asleep and dreaming about zwolfkinder, and bianca smiling, he and she riding on the wheel, their compartment become a room, one hes never seen, a room in a great complex of apartm]
<andrewvos>
judofyr: What *is* real?
richardburton has quit [Quit: Leaving.]
alec has joined #ruby-lang
<gnufied>
charliesome: I feel rails is a headless chicken.
<andrewvos>
Rails is one million headles chickens.
<gnufied>
with no one really having a say in, what should go and what should not. it is party for all.
<gnufied>
enough ranting for a day, I think. but really sad panda here.
<andrewvos>
gnufied: Why are you sad?
agnitio has joined #ruby-lang
<gnufied>
that is a good question.
<andrewvos>
I'm sad because I've quit smoking and my patch is falling off.
18VAANK2W has joined #ruby-lang
<andrewvos>
Shit is about to get real
<rue|w>
Hold it in place between your forehead and a table
<gnufied>
andrewvos: sorry, I have this biggish app which uses has_many :through quite a bit. and #7661 upset quite a few things
<jammi>
andrewvos: try ecigs
<andrewvos>
rue|w: I may just eat it
<andrewvos>
gnufied: I can't possibly imagine what :through does :/
<andrewvos>
jammi: I have tried them. Thing is, I would rather just go cold turkey than look like a tool with one of those giant fake cigarettes.
<jammi>
patches and gum get you either too much or too little; adminstration is difficult or impossible
jds_ has quit [Ping timeout: 255 seconds]
<jammi>
nah, less that a cig smoker
retro|cz has joined #ruby-lang
<jammi>
besides, it's a thing where you need to think of your priorities over what ypu think others think abput you
setmeaway has quit [Ping timeout: 240 seconds]
gianlucadv has quit [Read error: Connection reset by peer]
jacktrick has joined #ruby-lang
workmad3 has joined #ruby-lang
gianlucadv has joined #ruby-lang
crazyhorse18 has joined #ruby-lang
<crazyhorse18>
hey has ruby got some built in escaping functions for strings
<crazyhorse18>
e.g. lets say i have the string blabla'blabla get it to change to bla\'bla or should i just use gsub?
GarethAdams has joined #ruby-lang
jxie has joined #ruby-lang
Rarrikins_l_e has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<judofyr>
crazyhorse18: you can use str.inspect
<judofyr>
crazyhorse18: str.inspect[1..-2] to remove the quotes
<judofyr>
crazyhorse18: but it depends on *how* you want to escape it though
emocakes has joined #ruby-lang
<judofyr>
crazyhorse18: e.g. shell escaping should use shellwords, SQL escaping should use Sequel/ActiveRecord.
<badeball>
removing characters of semantic meaning is not the same as escaping. by removing characters, you are effectively breaking the data and it can never be shown to the user as they inputed it.
<crazyhorse18>
yeah it's for shell escaping
<crazyhorse18>
well.. piping commands over ssh techniqually
<badeball>
crazyhorse18: you don't need quotes when using Shellwords. command = "echo #{Shellwords.escape(content)} #{append} #{file_path_and_name}"
micaeked has quit [Quit: WeeChat 0.3.9.2]
havenn_ has quit [Remote host closed the connection]
<crazyhorse18>
oh ok
<badeball>
from the previously linked doc: «Note that a resulted string should be used unquoted and is not intended for use in double quotes nor in single quotes.»
havenn has joined #ruby-lang
<crazyhorse18>
ok testing it out
stevechiagozie has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 264 seconds]
jacktrick has quit [Quit: Leaving]
<crazyhorse18>
judofyr, badeball: worked very nicely
<judofyr>
crazyhorse18: shouldn't append_remote_file call create_remote_file with sudo=true ?
<judofyr>
err
<judofyr>
append=true
<crazyhorse18>
good spotting watson
<crazyhorse18>
yeah hadn't tested that yet
io_syl has quit [Quit: Computer has gone to sleep.]
<injekt>
huzzah
cultureulterior_ has joined #ruby-lang
havenn has joined #ruby-lang
megha has joined #ruby-lang
havenn has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
zarubin has quit [Ping timeout: 252 seconds]
security has joined #ruby-lang
retro|cz has quit [Ping timeout: 248 seconds]
security is now known as fire
megha has quit [Read error: Operation timed out]
srji has joined #ruby-lang
zarubin has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
jbsan has quit [Quit: jbsan]
zarubin has quit [Ping timeout: 264 seconds]
setmeaway has joined #ruby-lang
zarubin has joined #ruby-lang
zarubin has quit [Read error: Connection reset by peer]
zarubin has joined #ruby-lang
jacktrick has joined #ruby-lang
zarubin has quit [Read error: Connection reset by peer]
leopard_me has joined #ruby-lang
zarubin has joined #ruby-lang
havenn has joined #ruby-lang
wallerdev has joined #ruby-lang
fire has quit [Quit: WeeChat 0.3.9.2]
zarubin has quit [Read error: Connection reset by peer]
zarubin has joined #ruby-lang
wallerdev has quit [Client Quit]
karasawa has quit [Ping timeout: 276 seconds]
havenn has quit [Ping timeout: 276 seconds]
karasawa has joined #ruby-lang
<gokul>
How I append text at the begining of a file ? this -- > File.open("test", "r+") { |f| f.write "text" } is not working as I expected ( removes a character from the next line)
Haribhau has joined #ruby-lang
Haribhau has quit [Client Quit]
<judofyr>
gokul: prepending isn't easy
<judofyr>
gokul: you pretty much have to create a new file
<heftig>
create a new file, copy all the contents from the old file, then rename the new file over the old file
<gokul>
Yeah, I thought there might be a cleaner way.
m3nd3s has quit [Remote host closed the connection]
bradland has quit [Quit: bradland]
wallerdev has joined #ruby-lang
Spaceghostc2c_ has joined #ruby-lang
KA__ has quit [Quit: KA__]
Rarrikins_x_m_w_ has quit [Ping timeout: 276 seconds]
Rarrikins has joined #ruby-lang
bantic_ has joined #ruby-lang
bantic has quit [Read error: Connection reset by peer]
bantic_ is now known as bantic
Rarrikins has quit [Ping timeout: 252 seconds]
Rarrikins has joined #ruby-lang
kiddorails has joined #ruby-lang
kiddorails has quit [Read error: Connection reset by peer]
karasawa has quit [Quit: leaving]
karasawa has joined #ruby-lang
bfreeman_ has joined #ruby-lang
mrsolo has joined #ruby-lang
__butch__ has joined #ruby-lang
wyhaines has joined #ruby-lang
Rarrikins has quit [Ping timeout: 246 seconds]
Rarrikins has joined #ruby-lang
Paradox has quit [Ping timeout: 245 seconds]
bfreeman has quit [Ping timeout: 248 seconds]
TerabyteST has quit [Quit: terabytest]
emocakes has joined #ruby-lang
crosspath has quit [Quit: Konversation terminated!]
Paradox has joined #ruby-lang
Rarrikins has quit [Ping timeout: 248 seconds]
Rarrikins has joined #ruby-lang
megha has joined #ruby-lang
anachronistic has joined #ruby-lang
kiddorails has joined #ruby-lang
srji has quit [Ping timeout: 248 seconds]
__butch__ has quit [Quit: Leaving.]
__butch__ has joined #ruby-lang
Spaceghostc2c_ is now known as Spaceghostc2c
RickHull has joined #ruby-lang
gnufied1 has joined #ruby-lang
io_syl has joined #ruby-lang
mrsolo has quit [Quit: This computer has gone to sleep]
alvaro_o has joined #ruby-lang
mrsolo has joined #ruby-lang
rondale_sc has joined #ruby-lang
workmad3 has quit [Ping timeout: 248 seconds]
melter has joined #ruby-lang
kogent has joined #ruby-lang
karasawa has quit [Ping timeout: 248 seconds]
davidbalbert is now known as davidbalber|away
jtoy has quit [Quit: jtoy]
digital-ghost has joined #ruby-lang
jtoy has joined #ruby-lang
digital-ghost has left #ruby-lang [#ruby-lang]
megha has quit [Quit: WeeChat 0.3.9.2]
GarethAdams has quit [Quit: Leaving...]
ivanoats has joined #ruby-lang
srji has joined #ruby-lang
kiddorails has quit [Ping timeout: 252 seconds]
pkrnj has joined #ruby-lang
dankest has joined #ruby-lang
karasawa has joined #ruby-lang
cultureulterior_ has quit [Quit: cultureulterior_]
mercwithamouth has quit [Ping timeout: 252 seconds]
elux has quit [Quit: Bye!]
harmon has joined #ruby-lang
goshakkk has joined #ruby-lang
mercwithamouth has joined #ruby-lang
dous has quit [Ping timeout: 255 seconds]
kiddorails has joined #ruby-lang
retro|cz has quit [Ping timeout: 248 seconds]
jtoy has quit [Quit: jtoy]
harmon has quit [Client Quit]
harmon has joined #ruby-lang
<harmon>
Hi Rubyists! Anyone know of a Gem to generate an Entity Relationship Diagram after running a piece of code? One that is dynamic, not like Railroad or something Rails specific.
m3nd3s has joined #ruby-lang
kiddorails has quit [Ping timeout: 248 seconds]
<apeiros_>
uh, railroad is dynamic?
<apeiros_>
you may want to take a look at dot (the language)
<harmon>
Hmm... well, I was hoping not to have to write the ruby library myself, but if I do, I will definitely check it out! Thanks
hahuang65_ has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
mistym is now known as mistym_lunch
srji_ has joined #ruby-lang
bantic has quit [Read error: Connection timed out]
bantic has joined #ruby-lang
srji has quit [Ping timeout: 248 seconds]
jano has joined #ruby-lang
jano has left #ruby-lang [#ruby-lang]
mrsolo has quit [Quit: This computer has gone to sleep]
kiddorails has joined #ruby-lang
KA__ has joined #ruby-lang
mrsolo has joined #ruby-lang
rippa has joined #ruby-lang
kogent has quit [Quit: kogent]
davidbalber|away is now known as davidbalbert
kogent has joined #ruby-lang
jtoy has joined #ruby-lang
gnufied1 has quit [Quit: Leaving.]
alvaro_o_ has joined #ruby-lang
alvaro_o has quit [Read error: Connection reset by peer]
Rarrikins has quit [Ping timeout: 276 seconds]
kiddorails has quit [Read error: Connection reset by peer]
sepp2k has quit [Read error: Connection reset by peer]
justinram has quit [Ping timeout: 248 seconds]
gregmoreno has quit [Read error: Connection reset by peer]
justinram has joined #ruby-lang
gregmoreno has joined #ruby-lang
ivanoats has quit [Remote host closed the connection]
<RickHull>
question about minitest/spec -- it seems geared for somewhat general statements, but i have a specific test case written in plain ruby, no assertions even
kogent has quit [Remote host closed the connection]
tbuehlmann has joined #ruby-lang
<lianj>
RickHull: require 'minitest/autorun'
<RickHull>
ah ok
kogent has joined #ruby-lang
bfreeman_ has joined #ruby-lang
bfreeman has quit [Read error: Connection reset by peer]
solars has quit [Ping timeout: 240 seconds]
kogent has quit [Quit: kogent]
bzb has joined #ruby-lang
benanne has joined #ruby-lang
sepp2k1 has quit [Read error: Connection reset by peer]
<yorickpeterse>
andrewvos: if this is related to bacon, it has nested contexts
<yorickpeterse>
they just weren't displayed correctly until in the most recent version
<andrewvos>
yorickpeterse: I know
<andrewvos>
That was my point.
<andrewvos>
I want them for some tests I was writing.
<andrewvos>
wanted*
sepp2k has joined #ruby-lang
pbjorklund has joined #ruby-lang
<blahwoop>
is httparty better or nokogiri
wmoxam has joined #ruby-lang
<andrewvos>
blahwoop: They are dofferent things.
<andrewvos>
different
<andrewvos>
*
<yorickpeterse>
what the fuck
<yorickpeterse>
httpary is an HTTP library, Nokogiri is for parsing XML
srji has joined #ruby-lang
<blahwoop>
o
<blahwoop>
noob question
<blahwoop>
dont ban me
<yorickpeterse>
wat
chrismcg has joined #ruby-lang
<blahwoop>
ithought they were both for scraping sites
KA_ has joined #ruby-lang
dankest|away is now known as dankest
<blahwoop>
just ignore me
<blahwoop>
no clue wtf im talkin about lol
carloslopes has joined #ruby-lang
<havenn>
blahwoop: Nokogiri is the premier HTTP/XML parser gem while HTTParty is one good choice amongst many HTTP/REST API gems (Faraday, Rest-Client, Mechanize, etc. being other very nice gem options)
<RickHull>
i can think of some non-slick ways to do this, but is there a slick way to tell if a number is a power of 2?
Axsuul has quit [Remote host closed the connection]
<RickHull>
a ceiling at e.g. 2**10 is fine
<RickHull>
validating key lengths. was going to do key % 8 == 0
<manveru>
yorickpeterse: i never used anything like that
<manveru>
but yes, that sounds horrible :P
<yorickpeterse>
that's the HTTParty API sadly
<manveru>
it's bad enough that i have to do that in FFI
<yorickpeterse>
Faraday is a bit better but it feels like a fat pig to me
<havenn>
yorickpeterse: Hard for a jack-of-all-trades to be skinny!
<yorickpeterse>
The only gripe I have with httpclient is that status verification is a pita
<yorickpeterse>
from the top of my head it was something like HTTPClient.valid_status(response.status) or something along those lines
nyuszika7h has quit [Remote host closed the connection]
Nisstyre has joined #ruby-lang
<yorickpeterse>
whereas all the others just have `response.success?`
<manveru>
my old boss wrote the rest gem that wraps excon, net::http, rest_client, and typhoeus
bzb_ has joined #ruby-lang
<manveru>
hm
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
carloslopes has joined #ruby-lang
<yorickpeterse>
manveru: did you find a new job yet?
nyuszika7h has joined #ruby-lang
<manveru>
no
<havenn>
manveru: Yeah, Nahi left Typhoeus off his comparison - I think cause he said they were working on a major rewright and he'd include it next time.
<yorickpeterse>
hrm
srji has quit [Ping timeout: 248 seconds]
<manveru>
doing a couple of interviews while working on rubyists stuff
<havenn>
*write*
ivanoats has quit [Remote host closed the connection]
<manveru>
no big fan of typhoeus, they change their api a lot it seems
<yorickpeterse>
Ah found it: HTTP::Status.successful?(response.status)
tshine has quit [Ping timeout: 252 seconds]
<manveru>
oh well, that's not too bad
<manveru>
just hard to remember
<manveru>
and hard to find
<manveru>
but they can always make it more comfortable later if many complain :)
<manveru>
in my experience not many check response status or handle them...
<yorickpeterse>
sadly
rdw200169 has quit [Read error: Connection reset by peer]
GarethAdams has joined #ruby-lang
GarethAdams has quit [Changing host]
GarethAdams has joined #ruby-lang
rdw200169 has joined #ruby-lang
towski has joined #ruby-lang
<yorickpeterse>
manveru: I have a Ruby meetup next week, I'll see if anybody is looking for Ruby devs that can work remote
ssl_ has quit [Remote host closed the connection]
<blahwoop>
whats considered a junior ruby dev?
<blahwoop>
2 years?
<yorickpeterse>
Usually juniors are people who start their first job
<havenn>
^
<yorickpeterse>
it's not directly tied into age/years of experience
<yorickpeterse>
though that depends a bit from job to job I think
<blahwoop>
i see
<manveru>
yorickpeterse: cool, thanks :)
<blahwoop>
i went through a web dev course recently
<manveru>
yorickpeterse: no doubt booking.com guys will be there...
<blahwoop>
tryin to get an internship or something where i can learn
<havenn>
blahwoop: NYC? Apply to CodeSchool?
<blahwoop>
i went through GA's dev immersive
<yorickpeterse>
manveru: actually I haven't seen them on any yet
<yorickpeterse>
At least not on the Ruby specific ones
ivanoats has joined #ruby-lang
<blahwoop>
is code school worth the 25 bucks
bantic has quit [Read error: Connection timed out]
<havenn>
blahwoop: Oops, I meant HackerSchool!
<blahwoop>
general assembly paid for our peepcode sub
<manveru>
yorickpeterse: ok, i know they always look for perl and go devs
<yorickpeterse>
"LEARN TO CODE. GET A JOB.GUARANTEED." that's a pretty bold statement
<yorickpeterse>
unless you hire the people yourself :)
<havenn>
blahwoop: You should really talk to the HackerSchool folks, its free and free lunch - they get paid if you get a job.
<havenn>
ivanoats: Nice!
<manveru>
yorickpeterse: i have the feeling it's true for the US
<blahwoop>
ill submit my late application
<blahwoop>
their fizzbuzz isn't too bad
<yorickpeterse>
ivanoats: small tip: teach Ruby not Rails, then teach X
<havenn>
ivanoats: How much do you screen applicants?
aedorn has joined #ruby-lang
<ivanoats>
yorickpeterse: I agree, but codefellows starts with Rails. The UW Certificate in Ruby, which I also teach for, starts with ruby http://abid.es/uwrubycert
<yorickpeterse>
heh, certificates
<ivanoats>
but that's a 30 week program
<blahwoop>
damn
<manveru>
wow
<blahwoop>
when i search nyc ruby i only get meetups
<ggreer>
I think someone's github profile is more interesting than any cert
<ivanoats>
havenn: I'm not screening for codefellows so I can't really say much about it. Online profile, application, etc.
<manveru>
issue with certs is that there seems to be no cert for good certs :)
<havenn>
"TURKTRUST Officials Say No Evidence of Malice in Certificate Incident"
<blahwoop>
thanks
<ggreer>
fortunately, chrome has a whitelist of CAs for many popular domains
<ivanoats>
To be honest, I have seen some certifications that weren't worth much. But one from a large accredited public university (Univ. of Washington) is good!
<ggreer>
so you can't MitM google.com if the client is chrome
<manveru>
i think i did a ruby cert once, took 15 minutes on freelancer.com, and most questions were so awful, i wanted to quit like 4 times :P
<yorickpeterse>
these days certificates come in the form of forks and stars on Github
<manveru>
so i spend around 10 minutes of that time writing comments about how awful it is
<yorickpeterse>
oh and shiny build status images
<manveru>
yeah
zeisler has joined #ruby-lang
<manveru>
do we have one?
<yorickpeterse>
For Ramaze? No
<blahwoop>
i thought it was stackoverflow rep
<blahwoop>
lol
<yorickpeterse>
cbf adding one, not very useful either
bantic has joined #ruby-lang
<havenn>
blahwoop: Note, Github!
<manveru>
SO is very tedious
<yorickpeterse>
We get Email spammed anyway if it breaks
<havenn>
s/Note/Nope
cjs226 has quit []
<manveru>
yorickpeterse: just for people to know
<manveru>
plus it looks neat
slyphon has quit [Ping timeout: 240 seconds]
JMcAfreak has quit [Quit: They're coming to take me away, ha-haa!]
<manveru>
anw, heading home, bbl
JMcAfreak has joined #ruby-lang
bzb_ has quit [Quit: Leaving]
willdrew_ has quit [Remote host closed the connection]
rondale_sc has quit [Quit: rondale_sc]
charliesome has joined #ruby-lang
ssl has joined #ruby-lang
goshakkk has quit [Quit: Computer has gone to sleep.]
xalei has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby-lang
m3nd3s has joined #ruby-lang
imperator has quit [Quit: This computer has gone to sleep]
pkrnj has joined #ruby-lang
blahwoop has quit [Ping timeout: 245 seconds]
kogent has joined #ruby-lang
kogent has quit [Remote host closed the connection]
kogent has joined #ruby-lang
bzb has quit [Quit: Leaving]
m3nd3s has quit [Remote host closed the connection]
serhart has quit [Quit: Leaving.]
dankest is now known as dankest|away
toretore has quit [Quit: Leaving]
sush24 has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
asdfqwer has joined #ruby-lang
<freedrull>
if your class has two internal collaborators(i.e. not passed in) whats a good way to test that without mocking? should i rethink my design?
agarie has joined #ruby-lang
havenn has quit [Ping timeout: 255 seconds]
davidbalbert is now known as davidbalber|away
<injekt>
freedrull: test the public api which in turn should test your internals
bantic has quit [Read error: Connection reset by peer]
bantic has joined #ruby-lang
tomzx has joined #ruby-lang
thone has joined #ruby-lang
toretore has joined #ruby-lang
<freedrull>
injekt: now im gonna end up with some deep stubbing....bleh...
RickHull has left #ruby-lang [#ruby-lang]
<injekt>
freedrull: why?
wyhaines has quit [Remote host closed the connection]
slyphon has joined #ruby-lang
zmack has quit [Remote host closed the connection]
<freedrull>
injekt: said collaborators have more dependecies
headius has quit [Quit: headius]
<injekt>
freedrull: that means nothing to me
<injekt>
freedrull: show some code
dankest|away is now known as dankest
<freedrull>
sorry, ill try to come up with more specific questions, need to think more...
spuk has joined #ruby-lang
Nisstyre has quit [Ping timeout: 256 seconds]
m3nd3s has joined #ruby-lang
dustint has quit [Quit: Leaving]
srji has joined #ruby-lang
thone has quit [Ping timeout: 265 seconds]
thone has joined #ruby-lang
zhul_mechanos has quit [Quit: zhul_mechanos]
breakingthings has quit []
jtoy has quit [Quit: jtoy]
srji has quit [Ping timeout: 248 seconds]
blacktulip has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
JMcAfreak has quit [Quit: leaving]
mistym has quit [Remote host closed the connection]
bantic has quit [Quit: bantic]
zenspider has quit [Quit: Terminated with extreme prejudice - dircproxy 1.1.0]
davidbalber|away is now known as davidbalbert
ivanoats has quit [Remote host closed the connection]
asdfqwer has quit []
slyphon has quit [Ping timeout: 255 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
m3nd3s has quit [Remote host closed the connection]
spuk has quit [Ping timeout: 255 seconds]
serhart has joined #ruby-lang
spuk has joined #ruby-lang
srji has joined #ruby-lang
Nisstyre has joined #ruby-lang
benanne has quit [Quit: kbai]
dankest has quit [Quit: Leaving...]
srji has quit [Client Quit]
sailias has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
slyphon has joined #ruby-lang
jtoy has joined #ruby-lang
workmad3 has quit [Ping timeout: 265 seconds]
emocakes has quit [Quit: emocakes]
mjio has joined #ruby-lang
xsdg has quit [Ping timeout: 276 seconds]
apeiros_ has quit [Remote host closed the connection]
KA_ has quit [Quit: KA_]
jtoy has quit [Quit: jtoy]
KA_ has joined #ruby-lang
mpan has joined #ruby-lang
xsdg has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 255 seconds]
ssl has quit [Remote host closed the connection]
mercwithamouth has joined #ruby-lang
rins has quit [Ping timeout: 255 seconds]
dankest has joined #ruby-lang
dous has joined #ruby-lang
dous has joined #ruby-lang
Nisstyre has quit [Ping timeout: 260 seconds]
nkr has quit [Remote host closed the connection]
stevechiagozie has quit [Quit: Computer has gone to sleep.]