<nhhagen>
bnagy: mostly I'm using this as a case to learn some ruby
<bnagy>
you can use a KV store as a lazy uniqing tool
chrisseaton has joined #ruby
LadyRainicorn has quit [Ping timeout: 272 seconds]
parduse has quit [Read error: Connection reset by peer]
<nhhagen>
bnagy: elasticsearch is the destination, if I se the the key to be "place" then it will take care of that for me, but i a production scenario this info will probably be pulled from some kind of DB, cleaned and ready
apeiros has quit []
cbetta is now known as cbetta_afk
cashnguns has joined #ruby
<bnagy>
also if it's mapreducey type stuff it's sometimes easier just to live with the dups, they fall out in reduce anyway
<nhhagen>
bnagy: yep, I work with search engines on a daily basis
MatthewsFace has quit [Quit: This computer has gone to sleep]
sethen has joined #ruby
<bnagy>
if the value were a ref to something else then you might see weirdness
vlad_starkov has joined #ruby
_HolyCow1 has joined #ruby
kep has quit [Quit: WeeChat 0.4.2]
<maxhodak>
hmm. the toy example works with .clone, but my real code doesn't. calling `myfunction(data.clone)` still ends up in `data` being mutated as a side-effect
<maxhodak>
`data` should just be a hash
<bnagy>
well we can't debug code we can't see
<bnagy>
but you could try the old deep_copy trick
_HolyCow has quit [Ping timeout: 265 seconds]
<bnagy>
where you roundtrip through Marshal.dump / load
virt|away has quit []
<bnagy>
it's relatively expensive though
<maxhodak>
let me find the simplest block to reproduce here.
RagingDave has joined #ruby
RagingDave has quit [Remote host closed the connection]
fmcgeough has joined #ruby
<bnagy>
honestly, though, simplest is likely "don't do that"
<bnagy>
like, don't write to a hash you're being passed
<bnagy>
you could eg make a shadow hash just to keep modified copies of the entries you want
<Fractional>
godd2: Thank you very much, it works flawlessly!
<Fractional>
flawless*
wald0 has quit [Quit: Lost terminal]
heidi has joined #ruby
MatthewsFace has joined #ruby
IceyEC has quit [Ping timeout: 253 seconds]
IceyEC_ is now known as IceyEC
havenwood has joined #ruby
<Fractional>
I'm logging off. Take care and thanks for today! :)
Fractional has quit [Quit: Leaving]
sparrovv has quit [Remote host closed the connection]
mr_red has joined #ruby
zxd has joined #ruby
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
sassamo has joined #ruby
nateberkopec has quit [Quit: Leaving...]
eka has quit [Quit: Computer has gone to sleep.]
diegoviola has joined #ruby
<godd2>
shevy: ocra helps you package your game for distribution. It bundles up a ruby interpreter to the exe it generates so the person doesn't have to install ruby or worry about dependencies
MatthewsFace has quit [Ping timeout: 245 seconds]
<godd2>
but it only makes an executable for windows
maletor has quit [Quit: Computer has gone to sleep.]
MatthewsFace has joined #ruby
stryek has quit [Ping timeout: 245 seconds]
petey has joined #ruby
zxd has quit [Ping timeout: 272 seconds]
sepp2k has quit [Read error: Connection reset by peer]
zeade has quit [Quit: Leaving.]
_Andres has joined #ruby
sassamo has quit [Ping timeout: 272 seconds]
sassamo has joined #ruby
troyready has quit [Ping timeout: 252 seconds]
olivier_bK has quit [Ping timeout: 252 seconds]
Targen has quit [Ping timeout: 272 seconds]
AlSquirrel has quit [Quit: This computer has gone to sleep]
Testing1231 has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
Testing1231 has quit [Client Quit]
top4o has quit [Quit: ChatZilla 0.9.90.1 [Firefox 26.0/20131205075310]]
nhhagen has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
godd2 has quit [Ping timeout: 272 seconds]
maletor has joined #ruby
Virtualize has quit [Quit: Leaving...]
timonv has joined #ruby
shadoi has joined #ruby
sassamo has quit [Remote host closed the connection]
sassamo has joined #ruby
vikhyat has joined #ruby
nhhagen has quit [Ping timeout: 260 seconds]
smathieu has quit [Remote host closed the connection]
_Andres has quit [Read error: Connection reset by peer]
smathieu has joined #ruby
Animawish has quit [Quit: Animawish]
jdguzman has joined #ruby
timonv has quit [Ping timeout: 246 seconds]
mmcdaris has quit [Remote host closed the connection]
nhhagen has joined #ruby
stetho has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Deele has quit [Ping timeout: 260 seconds]
heidi1 has joined #ruby
mneorr_ has joined #ruby
fedesilva has joined #ruby
framling has joined #ruby
asteros has quit [Quit: asteros]
heidi has quit [Read error: Connection reset by peer]
asteros has joined #ruby
habanany has joined #ruby
danshultz has joined #ruby
mneorr has quit [Ping timeout: 272 seconds]
IceyEC has quit [Quit: IceyEC]
nhhagen has quit [Ping timeout: 252 seconds]
mneorr_ has quit [Ping timeout: 245 seconds]
gja has joined #ruby
thedonvaughn has quit [Ping timeout: 252 seconds]
SupaYoshi has quit []
sailias has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
dukz has quit [Remote host closed the connection]
dukz has joined #ruby
dukz has quit [Remote host closed the connection]
lmickh has quit [Remote host closed the connection]
dj21 has quit [Remote host closed the connection]
thedonvaughn has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
fedesilva has quit [Remote host closed the connection]
jasonpp has left #ruby [#ruby]
amclain has joined #ruby
sailias has quit [Read error: Connection reset by peer]
sailias has joined #ruby
lyanchih_ has quit [Quit: lyanchih_]
gja has quit [Quit: This computer has gone to sleep]
petey has quit [Remote host closed the connection]
tonni_ has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby
agent_white has quit [Ping timeout: 272 seconds]
fijimunkii has joined #ruby
asteros has joined #ruby
mikepack has joined #ruby
tonni has joined #ruby
maletor has joined #ruby
byprdct has joined #ruby
Lewix has joined #ruby
<bnagy>
post returns nil
agent_white has joined #ruby
<bnagy>
you're using puts, which prints the output, but the puts method returns nil
rezzack has quit [Ping timeout: 276 seconds]
lioninawhat has joined #ruby
<Butcho>
indeed, thanks
Trynemjoel has joined #ruby
ewnd9 has joined #ruby
cixelsyd has joined #ruby
lachesis has joined #ruby
IcyDragon has joined #ruby
cixelsyd has left #ruby [#ruby]
gregoriokusowski has quit [Quit: gregoriokusowski]
nhhagen has joined #ruby
mikepack has quit [Ping timeout: 245 seconds]
cbetta is now known as cbetta_afk
mocfive has joined #ruby
Hanmac1 has joined #ruby
nari has joined #ruby
IceDragon has quit [Ping timeout: 272 seconds]
carif has quit [Ping timeout: 245 seconds]
mneorr has quit [Remote host closed the connection]
havenwood has joined #ruby
mneorr has joined #ruby
Hanmac has quit [Ping timeout: 272 seconds]
reset has quit [Quit: Leaving...]
reset has joined #ruby
<Butcho>
so I just change puts to return and it returns the json. cool beans
nhhagen has quit [Ping timeout: 272 seconds]
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
asteros has quit [Quit: asteros]
wildroman2 has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
mneorr has quit [Ping timeout: 272 seconds]
mocfive has quit [Remote host closed the connection]
reset has quit [Ping timeout: 245 seconds]
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
crazymykl has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
freezey has joined #ruby
firewater5 has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<firewater5>
Can you include a comma inside a #{parameter} thing?
<firewater5>
Example:
havenwood has quit [Ping timeout: 245 seconds]
<pontiki>
if it's valid ruby syntax
<firewater5>
"Hello, #{parameter}"
<firewater5>
Can you have the parameter inside that thing, or is there not a way to really do that?
<pontiki>
that's not inside the #{parameter} thing
<firewater5>
I know its not.
wildroman2 has quit [Remote host closed the connection]
<pontiki>
it's in the string, alongside the #{parameter} thing
<firewater5>
I'm saying is there a way to make it though?
<firewater5>
Yes, I know that.
<pontiki>
whatever is inside #{} has be valid ruby syntax
<pontiki>
it's just another block, basically
<firewater5>
Or not really and if you want to vary a sentence based off of a certain thing happening, you would have to use if or cases?
fgo has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
<pontiki>
or write a method to put inside the #{} that returns what you'd like
<firewater5>
So, basically, if I wanted to just say "hello" in one case and "hello, #{name}" with a comma in another, I would have to use if cases basically?
<firewater5>
It seems the simplest way of doing it, and it does solve my problem.
<firewater5>
But, I am just checking to see if there is another way or if that is the best way I guess.
alexfreidah has quit [Ping timeout: 252 seconds]
byprdct has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vikhyat has quit [Read error: Connection reset by peer]
<pontiki>
do the simplest thing that works
vikhyat has joined #ruby
himsin has joined #ruby
himsin has quit [Client Quit]
freezey has quit [Remote host closed the connection]
<firewater5>
Ok, I guess the simpliest way I can think of is an if else thing then.
vikhyat has quit [Read error: Connection reset by peer]
kiri has quit [Ping timeout: 272 seconds]
mikepack has quit [Ping timeout: 246 seconds]
Spami has joined #ruby
vikhyat has joined #ruby
kiri has joined #ruby
nhhagen has joined #ruby
yasushi has joined #ruby
browndawg has quit [Quit: Leaving.]
vikhyat has quit [Read error: Connection reset by peer]
Deele has joined #ruby
i_s has joined #ruby
yasushi has quit [Remote host closed the connection]
vikhyat has joined #ruby
yasushi has joined #ruby
nhhagen has quit [Ping timeout: 245 seconds]
shadoi has quit [Quit: Leaving.]
vikhyat has quit [Read error: Connection reset by peer]
bluepojo has quit [Read error: Connection reset by peer]
vikhyat has joined #ruby
vikhyat has quit [Remote host closed the connection]
vikhyat has joined #ruby
cads has quit [Read error: Operation timed out]
i_s has quit [Ping timeout: 252 seconds]
snath has quit [Read error: Connection reset by peer]
vikhyat has quit [Read error: Connection reset by peer]
pu22l3r has quit [Ping timeout: 248 seconds]
samsonasu has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
vikhyat has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
snath has joined #ruby
ahmedelgabri has joined #ruby
Virtualize has joined #ruby
mneorr has joined #ruby
vikhyat has joined #ruby
cjsarette has quit [Ping timeout: 245 seconds]
havenwood has quit []
alexfreidah has joined #ruby
figgleberry has quit [Ping timeout: 252 seconds]
sLi_ has quit [Remote host closed the connection]
vikhyat has quit [Read error: Connection reset by peer]
Virtualize has quit [Ping timeout: 272 seconds]
vikhyat has joined #ruby
pu22l3r has joined #ruby
alexfreidah has quit [Ping timeout: 248 seconds]
thenovices has joined #ruby
timonv has joined #ruby
brunops has joined #ruby
mykeus has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
h0lyalg0rithm has joined #ruby
h0lyalg0rithm has quit [Max SendQ exceeded]
h0lyalg0rithm has joined #ruby
jcarouth has quit [Excess Flood]
jcarouth has joined #ruby
sparrovv has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
thenovices has quit [Ping timeout: 272 seconds]
h0lyalg0rithm has quit [Client Quit]
timonv has quit [Ping timeout: 252 seconds]
vikhyat has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
dseitz has joined #ruby
dseitz has quit [Max SendQ exceeded]
cads has joined #ruby
binw has quit [Read error: Connection reset by peer]
sparrovv has quit [Ping timeout: 260 seconds]
mneorr has quit [Remote host closed the connection]
sassamo has joined #ruby
dukz has quit [Remote host closed the connection]
mneorr has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
petey has quit [Remote host closed the connection]
Alina-malina has joined #ruby
vikhyat has joined #ruby
vikhyat has quit [Remote host closed the connection]
xpirator has joined #ruby
binw has joined #ruby
vikhyat has joined #ruby
dseitz has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
sassamo has quit [Ping timeout: 276 seconds]
mneorr has quit [Ping timeout: 272 seconds]
mlpinit has quit [Remote host closed the connection]
yasushi has quit [Remote host closed the connection]
danshultz has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
thenovices has joined #ruby
nateberkopec has quit [Quit: Leaving...]
gregoriokusowski has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby
lioninawhat has quit [Read error: Operation timed out]
danshultz has quit [Ping timeout: 260 seconds]
AllusiveGold has joined #ruby
<AllusiveGold>
Resolve anyones skype name into an IP address using "http://ct.lefs.me/skype/resolve.php?id=USERNAME" free skype resolver, fast and accurate! || DivineStresser.com for 150Gbps network stress testing!
<prateekp>
Nilium: helpful link ... but what i have in my application(not online though) is ... you can add anything thats useful or related to certain algorithm
<Nilium>
5 points to lewellyn for the most out of context question so far
terrellt_ has quit [Read error: Connection reset by peer]
hl has joined #ruby
sensen has joined #ruby
jbueza has joined #ruby
<lewellyn>
Nilium: context is the url.
<bnagy>
also, trigger warning, orphans and foundlings
maletor has quit [Quit: Computer has gone to sleep.]
<prateekp>
like if you get a blog o quick sort and you wanted to add to this repository... then you can commit that article and then it would be linked up in repository
<prateekp>
blog on* quick sort
agent_white has quit [Read error: Connection reset by peer]
<bnagy>
well that sounds like the best thing ever
<Nilium>
The only blog post about quicksort I could imagine wanting to store is the one that utterly demolishes the Haskell sorting tutorial thing.
<bnagy>
just think of it! Unlimited links to information about useless sorting algorithms could be mine at a touch!
<bnagy>
just how DO I implement Bubble Sort? These are the questions that need answers!
<prateekp>
thans bnagy :)
agent_white has joined #ruby
lethjakm1 has joined #ruby
brunops has joined #ruby
<prateekp>
bnagy : hmm agree ... so there are good sites which contain lots of information
<prateekp>
like the one Nilium showed
<prateekp>
but are never showed on googl
<bnagy>
no seriously. You'll soon eclipse Wikipedia. It will be the global font of Algorithmic Elucidation
<prateekp>
or like this one rosettacode.org/wiki/Quicksort
<Nilium>
Those both come up on Google pretty quickly for me.
lethjakman has quit [Ping timeout: 272 seconds]
<prateekp>
hmm Nilium: rosetta comes for me as well
<prateekp>
but not nist
<Nilium>
It is really unpleasant being unable to drink anything other than luke-warm water.
krz has joined #ruby
maletor has joined #ruby
<prateekp>
Nilium : might be google uses ur history to customize search
<prateekp>
google is doing that
speakingcode has quit [Quit: Changing server]
<Nilium>
Not might be, they do.
<prateekp>
hmm exactly
calimike has joined #ruby
<Nilium>
Which is why when I search for tits, they actually bring up bird links, because I spend a lot of time searching for info on birds.
<prateekp>
yes hhaha
<bnagy>
...
<prateekp>
:)
timonv has joined #ruby
mmcdaris has joined #ruby
<bnagy>
that's how Nilium gets all the chicks
<prateekp>
actually before starting this project. I thought that there should be repository of information
Jdubs has quit [Remote host closed the connection]
<lethjakm1>
ahhh spaceship
<lethjakm1>
thank you
<agent_white>
It's a comparison operator. Try doing ` "abc" <=> "ab" and "abc" <=> "acbd"`
amclain has quit [Quit: Leaving]
<lethjakm1>
ooooooo
<agent_white>
lethjakm1: For those wierd operators, best bet is to Google them in a parens, aka "<=>", so it's searching for that string. :)
<lethjakm1>
I tried that...not sure why it didn't work for me
<agent_white>
erm Gooble them in a " "'s ;P
brunops has joined #ruby
<lethjakm1>
are there any other weird operators for ruby?
<marcofernandez>
it makes easy to sorting collections
<bnagy>
~> is pretty weird
<bnagy>
->
<marcofernandez>
lambda?
<bnagy>
yeah we call it the 'retarded lambda' operator
<lethjakm1>
how's it different from a lambda?
<agent_white>
It's not, just a different way to say it ;)
<bnagy>
because unretarded lambda is the character sequence 'lambda'
<agent_white>
Just like blocks with doend {}
<lethjakm1>
hrm, I'm also looking at this gem: https://github.com/libgit2/rugged and it has an include Enumerable and I can't seem to find where it's coming from. anyone know what the include Enumerable does?
<lethjakm1>
I don't think it's a part of the ruby langauge but I don't see anywhere for it to be including from...
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
stetho has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lachesis has joined #ruby
camilasan has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
petey has quit [Ping timeout: 272 seconds]
kate_r_ has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
kate_r_ has quit [Client Quit]
Txandy is now known as Txandy|away
Txandy|away is now known as Txandy
soba has quit [Ping timeout: 260 seconds]
zz_N00D has quit [Ping timeout: 248 seconds]
cj3kim has joined #ruby
dukz has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
dukz has joined #ruby
SHyx0rmZ has quit [Ping timeout: 252 seconds]
sergicles has quit [Quit: sergicles]
Xeago has joined #ruby
bricker`LA has quit [Ping timeout: 245 seconds]
dukz has quit [Ping timeout: 252 seconds]
dukz has joined #ruby
bricker`LA has joined #ruby
vikhyat has quit [Remote host closed the connection]
vikhyat has joined #ruby
vikhyat has quit [Remote host closed the connection]
yacks has quit [Quit: Leaving]
fire has quit [Quit: WeeChat 0.4.1]
CodeBunny has quit [Quit: CodeBunny got lost. Send help!]
mikepack has joined #ruby
centrx has quit [Quit: Leaving]
bricker`LA has quit [Remote host closed the connection]
bricker`LA has joined #ruby
andikr has joined #ruby
ndrei has quit [Ping timeout: 245 seconds]
jprovazn has joined #ruby
mikepack has quit [Ping timeout: 272 seconds]
zipper has quit [Ping timeout: 248 seconds]
tesuji has joined #ruby
artmann has quit [Quit: No Ping reply in 180 seconds.]
ndrei has joined #ruby
artmann has joined #ruby
lyanchih_ has quit [Quit: lyanchih_]
camilasan has quit [Ping timeout: 252 seconds]
aganov has joined #ruby
sassamo has joined #ruby
zipper has joined #ruby
w1xz has joined #ruby
<lethjakman>
I tried googling := too and couldn't come up with anything, what does that do?
whomp has quit [Ping timeout: 252 seconds]
kevinykchan has joined #ruby
lyanchih_ has joined #ruby
relix has joined #ruby
sassamo has quit [Ping timeout: 265 seconds]
ndrei has quit [Ping timeout: 272 seconds]
ndrei has joined #ruby
bhaak has joined #ruby
h_kon has joined #ruby
kobain_ has joined #ruby
rdark has joined #ruby
kobain has quit [Ping timeout: 265 seconds]
LekeFly has joined #ruby
Hanmac1 has joined #ruby
luckyruby has joined #ruby
theRoUS` has quit [Quit: Coyote finally caught me]
Hanmac has quit [Ping timeout: 246 seconds]
Dorf has quit [Ping timeout: 260 seconds]
<bricker`LA>
lethjakman: nothing, I think that's Smalltalk
razibog has joined #ruby
zipper has quit [Ping timeout: 252 seconds]
<lethjakman>
hrm....ok
<lethjakman>
weird
razibog has quit [Client Quit]
<lethjakman>
wonder where I saw that
i_s has quit [Remote host closed the connection]
zipper has joined #ruby
<lethjakman>
thanks bricker`LA :)
i_s has joined #ruby
nhhagen has joined #ruby
predator117 has quit [Ping timeout: 272 seconds]
zigomir has joined #ruby
predator117 has joined #ruby
noname001__ has joined #ruby
blaxter_ has joined #ruby
sandGorgon has quit [Ping timeout: 248 seconds]
sectionme has joined #ruby
seoaqua has joined #ruby
senayar has quit []
prateekp has quit [Quit: Page closed]
vikhyat has joined #ruby
senayar has joined #ruby
mercwithamouth has joined #ruby
blaxter_ is now known as blaxter
<bhaak>
I'm reading out of a database and one value is a nullable boolean. so I can get nil, true or false in Ruby. but I want that to map to a proper boolean. "value == true" or "value && true" do the correct mapping but both expressions look kind of odd
mneorr has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<bhaak>
"value == true" looks even worse than the other one but I guess that comes from the fact that this is a horrible idea in Java
vikhyat has quit [Read error: Connection reset by peer]
i_s has quit [Ping timeout: 245 seconds]
vikhyat has joined #ruby
jovon_ has quit [Quit: Leaving]
fwaokda has quit []
thenovices has joined #ruby
seoaqua has quit [Ping timeout: 252 seconds]
<RTG`>
bhaak: nil evaluates to false
<bricker`LA>
bhaak: or you could make the database column not null if possible
<pontiki>
the := assignment began way back in Algol, i think
brunops has joined #ruby
<lethjakman>
pontiki: what did it do there?
<pontiki>
variable assignment, same as in Smalltalk
<dseitz>
bhaak If these are ruby expressions, you could map false/true using !!
<lethjakman>
dseitz: that's an interesting idea...could you show me how you would do that?
<lethjakman>
I know it's not my question but I'm curious
<dseitz>
!!nil => false
<bhaak>
oops, nil && true doesn't return true. I must have tested something wrong
renklaf_ has joined #ruby
<pontiki>
it shouldn't...
kobain_ has quit []
<bhaak>
RTG`: I want the actual "false" value not just the "falsy" value as I feed the mapped values back into another table
thenovices has quit [Ping timeout: 246 seconds]
r0ber has joined #ruby
<bhaak>
dseitz: yes, !! works too. although also not very pretty but much better than "== true" :-)
ahmedelg_ has quit [Remote host closed the connection]
<dseitz>
It's not pretty, but it's well-known
seoaqua has joined #ruby
<pontiki>
bhaak: if you really do want just a boolean, not a tri-state, make the db field not null
<bhaak>
I know it mostly from C so it's a bit tainted. that's why it didn't occur to me to use it. thx
<lethjakman>
dseitz: ohhhh yeah I get that, I thought you meant something else.
<dseitz>
oh
<bhaak>
pontiki: not possible. the source database is a legacy db outside of my reach and the code is part of a migration program.
<pontiki>
bhaak: then i would suggest abstracting it
mengu has quit [Remote host closed the connection]
tylersmith has joined #ruby
vikhyat has quit [Remote host closed the connection]
<lethjakman>
dseitz: you could monkey patch Object....not sure how frowned upon that would be though and add a .to_b method or something.
<bhaak>
the real WTF is that the tri-state value is directly shown to the user in the UI of the legacy app, the NULL value being a greyed out checkbox. I have a hard time imagining what the users think this checkbox means when it's greyed out
_HolyCow1 has joined #ruby
<pontiki>
monkeypatching Object...
aqua_ has joined #ruby
<pontiki>
whoa, bhaak
Apocalypse has quit [Ping timeout: 252 seconds]
<dseitz>
Rails already does that, .blank? :)
kenndel_ has joined #ruby
<lethjakman>
dseitz: isn't that just string?
<bhaak>
blank? is on Object?
<pontiki>
Rails is chock-full of metaprogramming
<bhaak>
pontiki: what do you mean with abstracting it?
<lethjakman>
I kinda feel like .to_b would be nice, there's a lot of times I would like that.
<lethjakman>
or you could just define a method to wrap it with...
zxd has joined #ruby
kizzx21 has joined #ruby
_HolyCow has quit [Ping timeout: 252 seconds]
<lethjakman>
I've done similar things when I needed a true nil.
Apocalypse has joined #ruby
<pontiki>
bhaak: if you migration code doesn't have to know about the tri-stateness of it, you can make a wrapper for it, creating an abstraction layer for that field
<dseitz>
It's around the level of object
<dseitz>
tests for '', "", [], {}, nil, etc.
mengu has joined #ruby
seoaqua has quit [Ping timeout: 246 seconds]
mengu has quit [Changing host]
mengu has joined #ruby
kenndel has quit [Ping timeout: 245 seconds]
<pontiki>
bhaak: it's just a suggestion rather than have to deal with the tri-stateness all over
<dseitz>
code is something like empty? || !self
<dseitz>
with a test to make sure empty? doesn't explode I think
<pontiki>
blank?() is defined on a number of classes
<bhaak>
lethjakman: there's a gem for that :) obviously named "t_b". but usually this is considered bad as truthy and falsey give you 99% of all use cases and is much more clean (and has better performance) than calling to_b
tylersmith has quit [Ping timeout: 264 seconds]
<pontiki>
haha
brunops has quit [Ping timeout: 252 seconds]
<pontiki>
"THere's a gem for that!"
<pontiki>
now i feel dirty
aqua_ has quit [Ping timeout: 272 seconds]
<bhaak>
paontiki: ah, well, the mapping already happens in a DSL and adding one line of code for the rare cases where the booleans have tri-state is okay.
dogonthesun has quit [Quit: Computer has gone to sleep.]
<pontiki>
i wonder why ppl come in #ruby to ask questions about every other language on the planet
<mhenrixon>
@luckyruby Now we are talking each element is a day and the attributes describe that day like they should
jaimef has joined #ruby
<bhaak>
luckyruby: usually, it's more a matter of taste as it is more or less the same when you can only have one value. I prefer child elements when I have to use xpaths to access them. xpaths selection for attributes is a bit of pain to me as I have to always look it up.
roolo has joined #ruby
<pontiki>
pro tip: use JSON
<luckyruby>
pontiki: sorry if it seems off topic but I'd prefer a rubyist's take on xml
Lewix has quit [Remote host closed the connection]
<bhaak>
a rubyist's take on xml is "don't use it"
<luckyruby>
lol, i wish it was optional
akemrir has joined #ruby
<luckyruby>
I'd much prefer json
Lewix has joined #ruby
<pontiki>
anytime i have to deal with XML, i get shut of it as fast as possible
ss_ has quit [Remote host closed the connection]
chomskiii has joined #ruby
ch0mskiii has quit [Read error: Connection reset by peer]
ss_ has joined #ruby
Macaveli has joined #ruby
Macaveli has quit [Remote host closed the connection]
troessner has joined #ruby
craigp has joined #ruby
<pontiki>
anyway, that xml, <open> or open= is redundant
<luckyruby>
I'll implement a json solution as well and see if that's an option with Priceline
sparrovv has joined #ruby
<pontiki>
you wouldn't have open and close times if they were not open
aryaching has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
sectionme has quit [Ping timeout: 246 seconds]
monzie has joined #ruby
browndawg1 has joined #ruby
monzie has quit [Client Quit]
pranny has joined #ruby
monzie has joined #ruby
<monzie>
Hello everyone!
thenovices has joined #ruby
sectionm1 has quit [Ping timeout: 260 seconds]
sectionme has joined #ruby
claymore has quit [Ping timeout: 272 seconds]
Wolland has quit [Remote host closed the connection]
monzie has left #ruby [#ruby]
browndawg has quit [Ping timeout: 276 seconds]
eka has joined #ruby
DJJeff has quit [Read error: Connection reset by peer]
claymore has joined #ruby
aryaching has joined #ruby
fgo_ has joined #ruby
fgo has quit [Ping timeout: 272 seconds]
sectionme has quit [Remote host closed the connection]
camilasan has quit [Remote host closed the connection]
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
camilasan has joined #ruby
ocline``` has joined #ruby
mengu has quit [Read error: Connection timed out]
dogonthesun has joined #ruby
thenovices has quit [Ping timeout: 272 seconds]
mengu has joined #ruby
mhenrixon has joined #ruby
Cache_Money1 has quit [Quit: Leaving]
bricker`LA has joined #ruby
tvw has joined #ruby
aryaching_ has joined #ruby
Beoran_ has joined #ruby
amritanshu_RnD has joined #ruby
ocline`` has quit [Ping timeout: 272 seconds]
camilasan has quit [Ping timeout: 252 seconds]
petey has joined #ruby
ahawkins has joined #ruby
aryaching has quit [Ping timeout: 248 seconds]
Beoran__ has quit [Ping timeout: 252 seconds]
bricker`LA has quit [Ping timeout: 245 seconds]
petey has quit [Ping timeout: 260 seconds]
sparrovv_ has quit [Remote host closed the connection]
nhhagen has joined #ruby
cascalheira has joined #ruby
camilasan has joined #ruby
drumusician has joined #ruby
senayar_ has joined #ruby
zeeraw has joined #ruby
monkegjinni has joined #ruby
Giorgio has quit [Quit: Leaving]
fixl has quit [Remote host closed the connection]
MrZYX|off is now known as MrZYX
aryaching has joined #ruby
nhhagen has quit [Ping timeout: 252 seconds]
chrisseaton has joined #ruby
aryaching_ has quit [Ping timeout: 252 seconds]
yjmsf20 has quit [Quit: leaving]
senayar has quit [Ping timeout: 252 seconds]
lkba has joined #ruby
samuel02 has joined #ruby
yjmsf20 has joined #ruby
colonolGron has joined #ruby
mansi has joined #ruby
ss_ has joined #ruby
ozgun has joined #ruby
guilund has joined #ruby
<samuel02>
hi, I'm creating some service objects that inherits from an interface object, both service objects are going to implement one method each in their own way but I want to wrap both methods in one begin block, is this a good way to do this: https://gist.github.com/samuel02/64867c98df47a14da172
shime has quit [Ping timeout: 252 seconds]
_Andres has quit [Read error: Connection reset by peer]
_5kg has joined #ruby
mansi has quit [Ping timeout: 260 seconds]
relix has quit [Read error: Connection reset by peer]
urbanslug has quit [Remote host closed the connection]
relix has joined #ruby
urbanslug has joined #ruby
ahawkins has quit [Quit: leaving]
nari has joined #ruby
chrisseaton has quit []
sensen has quit [Quit: leaving]
mikepack has joined #ruby
mojjojo has joined #ruby
chrisseaton has joined #ruby
arturaz has joined #ruby
mikepack has quit [Ping timeout: 252 seconds]
ss_ has quit [Remote host closed the connection]
marcgg has joined #ruby
ss_ has joined #ruby
<aagdbl>
samuel02, seems like a sort of anti-pattern
mklappst_ has joined #ruby
po10_ has joined #ruby
sassamo has joined #ruby
<aagdbl>
Is it possible for you separate the implementer and user interfaces for the class?
ewnd9 has joined #ruby
marcgg_ has quit [Ping timeout: 252 seconds]
<aagdbl>
then users will call method foo which will call bar inside a begin rescue
<workmad3>
^^ implement a 'do_foo' method or similar as your implementation
<aagdbl>
eg. the public interface for a class object is "new". but implementors write "initialize"
w1xz has joined #ruby
ss_ has quit [Ping timeout: 248 seconds]
<samuel02>
aagdbl, sure that sounds good. Why is it better?
_tpavel has joined #ruby
mklappstuhl has quit [Ping timeout: 245 seconds]
<samuel02>
I really want to get better at ruby patterns
<workmad3>
samuel02: it makes it easier to write classes that conform to your style
po10 has quit [Ping timeout: 252 seconds]
<samuel02>
ok, true
<workmad3>
samuel02: with your current method, people need to implement and somehow know that they implement method X and then wrap the body in 'super do end'
<samuel02>
how common are interface classes in ruby?
<workmad3>
not that common
<samuel02>
workmad3, true
<samuel02>
is there a reason not to use them?
<workmad3>
it's the sort of thing generally handled with a mixin instead
<samuel02>
do you care to explain how this would have been done in a mixin instead?
<workmad3>
samuel02: it's not really an inheritance relationship... B and C don't really have an 'IS A' relationship to A, they merely implement a compatible interface
<samuel02>
basically what I'm doing is a FileStorage object where one will use Amazon S3 and the other object will be diskbased
<workmad3>
samuel02: module A; <same implementation>; end; class B; include A; <same stuff>; end
<samuel02>
ok
<samuel02>
so maybe I'm overcomplicating stuff..
DaniG2k has joined #ruby
sassamo has quit [Ping timeout: 272 seconds]
<shevy>
yes!
<workmad3>
samuel02: from what you're doing, I'd be tempted to reverse it personally
<aagdbl>
samuel02, since you mentioned interfaces, do come from a Java background?
<shevy>
yes!
<samuel02>
workmad3, ok
<workmad3>
samuel02: so that you deal with a FileStorage object that has the expected interface, and that has a StorageBackend (e.g S3, FileSystem) that gets plugged in
ahmedelgabri has quit [Remote host closed the connection]
<samuel02>
aagdbl, not really. I guess that's where I learned to work with interfaces though
sepp2k has joined #ruby
<aagdbl>
samuel02, so think of it this way. A class could implement multiple interfaces. Would it be correct to call super in Java?
<workmad3>
samuel02: the storage backend then doesn't need to include or inherit from anything, it just needs to have a couple of known methods (duck typed interface)
<samuel02>
workmad3, sounds smart
<samuel02>
aagdbl, yeah
<samuel02>
workmad3, ok
tkuchiki has quit [Remote host closed the connection]
<workmad3>
samuel02: and someone using it can just pass in a backend when creating a FileStorage object to interact with (or rely on a default)
<aagdbl>
samuel02, it would be ok to call super in java from your interface method?
tkuchiki has joined #ruby
<workmad3>
interfaces in java can't have implementation
<samuel02>
correct
<aagdbl>
by interface method I mean a method part of an interface
<samuel02>
aagdbl, in Java the methods are usually abstract methods without implementation
<samuel02>
i.e. in an interface
<workmad3>
samuel02: that's an abstract class, not an interface, in java
colonolGron has quit [Ping timeout: 272 seconds]
<samuel02>
that's right, I'm getting all confused
<aagdbl>
the base class of an object is completely unknown. you shouldnt be calling super in a method that is part of an interface implementation in Java
<aagdbl>
or at least, not mandating it
<samuel02>
ok
<samuel02>
thanks both of you
<aagdbl>
actually lets put it this way - you shouldnt have a base class mandate what a subclass implementation should do to achieve common behaviour
<samuel02>
ok, that sounds reasonable
<samuel02>
I'm gonna change the implementation according to the advice from workmad3
tkuchiki has quit [Ping timeout: 276 seconds]
kreantos has quit [Ping timeout: 252 seconds]
urbanslug has quit [Ping timeout: 252 seconds]
<samuel02>
by the way, this is all in a gem that may be used in a Rails app, do you think I handle the logging part correctly
<samuel02>
?
sepp2k has quit [Quit: Konversation terminated!]
shime has joined #ruby
mercwithamouth has joined #ruby
senayar_ has quit [Remote host closed the connection]
kreantos has joined #ruby
Panicky has joined #ruby
kate_r has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ahmedelgabri has joined #ruby
freerobby has joined #ruby
freerobby has quit [Client Quit]
gomix has quit [Ping timeout: 272 seconds]
freerobby has joined #ruby
clevermatt has quit [Remote host closed the connection]
<workmad3>
samuel02: make sure you can handle a logger being passed in, if one isn't then use Rails.logger if Rails is defined otherwise create a Logger on stdout
thenovices has joined #ruby
<samuel02>
apeiros, yes
<samuel02>
workmad3, ok thanks
drumusician has quit [Read error: Connection reset by peer]
<workmad3>
samuel02: Rails.logger will fail if Rails isn't loaded
<samuel02>
workmad3, ok
drumusician has joined #ruby
w1xz has quit [Ping timeout: 272 seconds]
clevermatt has joined #ruby
<apeiros>
samuel02: if that's the whole thing, then IMO the solution is rather poor, sorry.
<workmad3>
samuel02: you need to structure something around 'if defined?(Rails)'
<apeiros>
forced inheritance is a bad thing. it could be solved nicer with just a module.
<samuel02>
yeah ok
kate_r has joined #ruby
<workmad3>
apeiros: that's already been covered ;)
<samuel02>
apeiros, workmad3 has already helped me with that :)
<samuel02>
thanks though
<samuel02>
do any of you have any good tips on books to read to get better at patterns in ruby?
dachi_ has left #ruby [#ruby]
dachi_ has joined #ruby
bluenemo has joined #ruby
<workmad3>
samuel02: Practical Object Oriented Design with Ruby
mklappst_ has quit [Remote host closed the connection]
<samuel02>
ok, going to order it right away :)
<DaniG2k>
hmm I was looking into the same thing actually
max96at has joined #ruby
<workmad3>
samuel02: also consider Growing Object Oriented Software (examples are in java), maybe Ruby Design Patterns and Refactoring: Ruby Edition
<apeiros>
and if it has already been said - good, then I +1 that :D
freerobby has quit [Client Quit]
<workmad3>
apeiros: still need to do something with 'defined?(Rails)' to prevent an issue with Rails not being present ;)
<apeiros>
workmad3: ah, yes, if use outside rails is a concern, then definitively
urbanslug has joined #ruby
<apeiros>
I also don't like the fact that setting logger to nil is not respected
thenovices has quit [Ping timeout: 272 seconds]
<apeiros>
I f'ing hate undisablable (is that a word?) logging
<shevy>
hehe
<shevy>
blable is a good word, I approve
colonolGron has joined #ruby
<workmad3>
apeiros: same, but to me that's an issue when it doesn't respect the set log level rather than setting a logger to nil
<apeiros>
shevyblable. fits.
<apeiros>
workmad3: naw, setting the logger to nil should work everywhere IMO
<DaniG2k>
workmad3: that book (Ruby design patterns) is from 2012...is it still worth buying
<workmad3>
DaniG2k: that's one I haven't read tbh
<apeiros>
DaniG2k: you consider 2012 old for a book? o0
<DaniG2k>
I suppose the concepts are the same
<DaniG2k>
well, software book, yes
<workmad3>
DaniG2k: hehe :) for christmas I got a 'software book' from the 80's
<apeiros>
concepts in software don't change that fast either…
<workmad3>
DaniG2k: Smalltalk Best Practice Patterns
<DaniG2k>
workmad3: which one
<DaniG2k>
:D
<workmad3>
DaniG2k: not to mention things like Refactoring from the 90's
<apeiros>
workmad3: I've a pascal book from around 1975 :D
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lyanchih has quit [Ping timeout: 252 seconds]
<workmad3>
DaniG2k: my basic rule of thumb is that books on specific technologies obsolete quickly, while books on concepts stay valid for decades even if they have examples in an older language
zeeraw has joined #ruby
<apeiros>
+1
<DaniG2k>
workmad3: hmm ok. I might consider buying it
clevermatt has quit [Remote host closed the connection]
alexherbo2 has quit [Quit: WeeChat 0.4.3-dev]
w4pm has quit [Ping timeout: 245 seconds]
yasushi has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
krawchyk has joined #ruby
thenovices has joined #ruby
mark_locklear has joined #ruby
marcgg_ has joined #ruby
jkamenik has joined #ruby
Megtastique has joined #ruby
JaTochNietDan has joined #ruby
huttan_ has joined #ruby
habanany has quit [Ping timeout: 252 seconds]
alexherbo2 has joined #ruby
ComingHome has joined #ruby
huttan has quit [Ping timeout: 248 seconds]
huttan_ is now known as huttan
<ComingHome>
chile chhile lindo!
<ComingHome>
lindo como el sol xd
thenovices has quit [Ping timeout: 245 seconds]
marcgg has quit [Ping timeout: 245 seconds]
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kreantos has quit [Ping timeout: 272 seconds]
senayar has joined #ruby
tyl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wallerdev has quit [Quit: wallerdev]
urbanslug has quit [Ping timeout: 248 seconds]
petey has joined #ruby
urbanslug has joined #ruby
vitornascimento has joined #ruby
popl has quit [Read error: Operation timed out]
<shevy>
Hanmac pretty cool idea
_Andres has joined #ruby
kreantos has joined #ruby
xpirator has quit [Quit: Leaving...]
xpirator has joined #ruby
Targen has joined #ruby
petey has quit [Ping timeout: 245 seconds]
xpirator has quit [Client Quit]
<Hanmac>
shevy: i want AR glasses where you does not know if that what you see is real or not ;P
<apeiros>
Hanmac: get occulus rift?
stryek has joined #ruby
<shevy>
no
<shevy>
get drunk
<shevy>
is cheaper
<Hanmac>
apeiros: occulus is VR not AR ;P
<shevy>
Hanmac I kinda stopped gaming for the most part myself, not enough time :(
ComingHome has quit [Quit: Lost terminal]
_Andres has quit [Read error: Connection reset by peer]
<Hanmac>
shevy i dont think about gaming at the point ... just image about visual interfaces on puplic places ...
<Hanmac>
or for the ökos it can show you trees where they are not ;D
breakingthings has joined #ruby
Sammael has quit [Ping timeout: 252 seconds]
<apeiros>
Hanmac: that's a pointless distinction if the AR is indistinguishable from VR…
<apeiros>
(which is what you requested)
colonolGron has quit [Read error: Connection reset by peer]
aryaching has quit [Ping timeout: 252 seconds]
dachi_ has quit [Ping timeout: 252 seconds]
<Hanmac>
currently VR tech only shows you the VR part, not the "real life", i want some interface where VR and real are so connected, that you cant tell the difference without removing the glasses (or disabling the interface)
ahmedelgabri has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
nhhagen has joined #ruby
ahmedelgabri has joined #ruby
dachi_ has joined #ruby
phutchins has joined #ruby
sambao21 has joined #ruby
<phutchins>
Is there a quicker or easier way to check if a variable is nil and check its value? I.E. if (!my_var.nil? && !my_var.empty?)
fedesilva has joined #ruby
timonv has quit [Remote host closed the connection]
phansch has joined #ruby
<shevy>
what would be cool would be more games in ruby
<shevy>
phutchins that seems to be covered by the rails addon .blank? I think
<shevy>
but in standard ruby ... not sure
<shevy>
you mean, to check if a variable is not nil, or?
<Hanmac>
phutchins: i think one of the coolest ways would be like that: if(!(my_var=String(my_var)).empty?)
urbanslug has quit [Ping timeout: 272 seconds]
<shevy>
ewww
<shevy>
why are Hanmac's examples always less readable
aryaching has joined #ruby
<shevy>
I think he is doing that on purpose with a grin on his face
Lewix has quit [Remote host closed the connection]
clevermatt has joined #ruby
<phutchins>
Hanmac: ah, wrapping it in string would ensure its not nul
ahmedelg_ has joined #ruby
<Hanmac>
phutchins: String(nil) #=> ""
ahmedelgabri has quit [Ping timeout: 272 seconds]
<phutchins>
right
Lewix has joined #ruby
JaTochNietDan has quit [Quit: Right.]
r0ber has quit [Quit: Saliendo]
<phutchins>
this is a rails config file so the .blank may work
<phutchins>
not sure if its availabel in that context
timonv_ has joined #ruby
lioninawhat has quit [Ping timeout: 248 seconds]
MrPopinjay has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
burlyscudd has joined #ruby
_tpavel has quit [Read error: Operation timed out]
nateberkopec has joined #ruby
monkegjinni has joined #ruby
mikepack has joined #ruby
<MrPopinjay>
Hi all. I have a question about array slicing. What's the difference between the ones returning [] and the ones returning nil in this? https://gist.github.com/lpil/e9a469d742cab5aa4553 Thank you
yarou has joined #ruby
Lewix has quit [Ping timeout: 248 seconds]
urbanslug has joined #ruby
_Andres has joined #ruby
Deejay_ has joined #ruby
dkamioka has joined #ruby
end_guy has joined #ruby
mikepack has quit [Ping timeout: 252 seconds]
ffranz has joined #ruby
razibog has joined #ruby
<w|t>
We seem to have missed the gist of that gist you were looking for.
Hanmac1 has joined #ruby
marcgg has joined #ruby
mehlah has quit [Quit: Leaving...]
monkegji_ has joined #ruby
enebo has joined #ruby
<MrPopinjay>
w|t: sorry, let me repost
<MrPopinjay>
Hi all. I have a question about array slicing. What's the difference between the ones returning [] and the ones returning nil in this? http://bpaste.net/show/HXnQUJ1JvYMwJN5UDVd3/ Thank you
<MrPopinjay>
I didn't realise that gist wasn't anon
<MrPopinjay>
Silly me :)
monkegjinni has quit [Read error: Connection reset by peer]
<apeiros>
MrPopinjay: I have no special insight into the decision making of the language designers.
<MrPopinjay>
haha, ok :)
kaldrenon has quit [Remote host closed the connection]
<apeiros>
I'm not sure I'd handle this particular case the same way
<apeiros>
probably not
<CorySimmons>
apeiros: Is "I'm trying to convert pdf to svg. Is that possible?" what you were answering when you said "(and yes, that's one of the questions in the list of silly questions)"
kobain has joined #ruby
monkegjinni has joined #ruby
<apeiros>
CorySimmons: I refered to "has anyone ever used X?", that's one of the silly questions.
<shevy>
CorySimmons most of the time I convert .pdf into pure text files
<CorySimmons>
shevy: I'm trying to go from .ai (with PDF editing capabilities) to <svg> :[
<MrPopinjay>
shevy: Could you recommend a tool for that? :)
<shevy>
first answer is to suggest using inkscape
<shevy>
CorySimmons I have no idea what .ai is, sorry
<apeiros>
given that pdf is a series of printing instructions, it would seem that it should be possible to convert it to svg. might not be a good idea, though.
<MrPopinjay>
Adobe illustrator?
<CorySimmons>
shevy: I can convert .ai to .pdf by changing the extension. But no real tool offers .ai conversion.
<CorySimmons>
MrPopinjay: Yes
<apeiros>
CorySimmons: eh, what?
gomix has joined #ruby
<MrPopinjay>
hehe
<apeiros>
CorySimmons: that's most certainly bollocks. .ai and .pdf are not compatible formats afaik.
<shevy>
MrPopinjay the pdf->text ? there is ... pdf convert tools... pdftotext
netQT has joined #ruby
<MrPopinjay>
I wonder if mupdf does it. I do like mupdf
<shevy>
lol
<shevy>
mooooooopdf
<shevy>
approved by cows
<shevy>
it would be cool if we would have more ruby tools for manipulating pdf files
<shevy>
not just prawn and then... nothing else :P
<MrPopinjay>
echo '<3 moooooopdf' | cowsay
<shevy>
CorySimmons I guess if you just rename the extension alone, it is not a real conversion
bluOxigen has joined #ruby
netQT has quit [Read error: Connection reset by peer]
<shevy>
CorySimmons can't you simply abandon .ai altogether?
nhhagen has quit [Remote host closed the connection]
<MrPopinjay>
I do a fair amount of pdf editing (I work in print) and generally the tools that do it are either terrible or really expensive. I'd like to see more work done on a stand alone OSS pdf editor :)
<lewellyn>
apeiros: tell that to adobe :)
browndawg has joined #ruby
razibog has quit [Ping timeout: 272 seconds]
<lewellyn>
shevy: i expect anyone who spends significant time in illustrator would say "no" without giving you a chance to finish that question.
<shevy>
poor guys
<shevy>
adobe slaves!
<lewellyn>
there are no real alternatives.
<MrPopinjay>
mmm
<MrPopinjay>
Depends what you're doing
<shevy>
you could become pimp slaves instead!!!
<shevy>
I mean gimp
<tobiasvl>
pimp slaves
<MrPopinjay>
Adobe people try to crowbar their favourite tool into any situation
<lewellyn>
gradient meshes are rightly the top item.
<MrPopinjay>
ai to svg?
<shevy>
water to wine
<MrPopinjay>
I just opened illustrator, it saves to svg
<shevy>
lead to gold
LekeFly has joined #ruby
RobertBrewitz has joined #ruby
<shevy>
perhaps CorySimmons has a certain noob factor
<lewellyn>
MrPopinjay: indeed it does. even compliant SVG which are still editable as if they were AI files.
<shevy>
:>
<MrPopinjay>
Am I not understanding the problem? What needs to be done?
<shevy>
MrPopinjay you are on windows?
<MrPopinjay>
OSX at work
<shevy>
MrPopinjay I think it all started that CorySimmons wanted some ruby-related tool (or pure ruby or something)
RobertBrewitz has left #ruby [#ruby]
<MrPopinjay>
It'll never happen
<shevy>
he used MiniMagick before if I remember correctly
<shevy>
hehehehe
_maes_ has joined #ruby
<MrPopinjay>
paaaain
arietis has quit [Quit: Computer has gone to sleep.]
<lewellyn>
i expect that no one in rubyland has bothered going through both the ai and svg specs sufficiently
<shevy>
I am going to hire you as the weatherman MrPopinjay
<shevy>
I like your forecasts already
po10_ has quit [Quit: /]
vlad_starkov has joined #ruby
<shevy>
I never went through any spec at all
<shevy>
they are so boring!
<MrPopinjay>
Do adobe products have a CLI?
monkegjinni has quit [Remote host closed the connection]
<banister>
MrPopinjay prolly
Txandy has joined #ruby
<lewellyn>
inkscape, irritatingly, can't even render certain SVGs which are totally valid and render fine elsewhere which are created with AI.
<MrPopinjay>
I should look into that
<MrPopinjay>
I'm currently trying to automate my entire day job with ruby
ixolit has left #ruby [#ruby]
<lewellyn>
"hm. we know we don't support this feature, so we're going to totally ignore it even though we can do a reasonable representation of it!" :P
<lewellyn>
MrPopinjay: you're on a mac. you have automator and applescript ;)
<shevy>
ok I now checked where pdftotext is
<MrPopinjay>
lewellyn: yeah, but this way I'm learning something useful
<shevy>
MrPopinjay, it is part of poppler: "pdfdetach,pdffonts,pdfimages,pdfinfo,pdfseparate,pdftocairo,pdftohtml,pdftoppm,pdftops,pdftotext,pdfunite,poppler-glib-demo", URL at http://poppler.freedesktop.org/poppler-0.24.5.tar.xz
<lewellyn>
MrPopinjay: adobe products used to have large applescript dictionaries.
<shevy>
MrPopinjay I use ruby as glue language for EVERYTHING!
<MrPopinjay>
That's the plan
<shevy>
imagine if we could even control any GUI from the commandline
<MrPopinjay>
Though having said that, I think most the things I can automate that I might use adobe rubbish for I could do with other external applications, ones that are better suited to this sort of thing
monkegjinni has joined #ruby
<lewellyn>
MrPopinjay: you don't like ASS? :)
<shevy>
what is ass
<lewellyn>
applescript studio.
<lewellyn>
now part of xcode.
VTLob has joined #ruby
<shevy>
wait
<lewellyn>
how that ever got approved is beyond me.
<shevy>
isn't xcode something for OSX?
<lewellyn>
06:24 MrPopinjay: OSX at work
<shevy>
yeah but I mean in regards to ASS
<shevy>
you OSXers are confusing
<lewellyn>
ASS is inherently for OSX. so being part of XCode is sane.
vlad_starkov has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
bluOxigen has quit [Read error: Connection reset by peer]
<lewellyn>
OS 9 and below had Script Editor instead.
vlad_starkov has joined #ruby
<MrPopinjay>
shevy: make it so
<MrPopinjay>
Right, I'm gunna go have lunch. Goodbye all, it's been a pleasure, as always.
bluOxigen has joined #ruby
marcgg_ has joined #ruby
<MrPopinjay>
I'm not really an OSXer
<MrPopinjay>
I'm a Linux guy.
<MrPopinjay>
But it's this or Windows, and I sure as hell know what I'm doing in this situation
gregoriokusowski has quit [Quit: gregoriokusowski]
<lewellyn>
i never wanted to be an $operatingSystem guy... i wanted to be a LUMBERJACK!
fijimunkii has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Remote host closed the connection]
gregoriokusowski has joined #ruby
<MrPopinjay>
baii
MrPopinjay has quit [Quit: leaving]
marcgg has quit [Read error: No route to host]
<soahccc>
We have the same OS choice as google
marcgg__ has joined #ruby
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
marcgg has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
jokke[away] is now known as jokk
fedez77 has quit [Read error: Connection reset by peer]
jokk is now known as jokke
marcgg_ has quit [Ping timeout: 245 seconds]
<soahccc>
shevy: I have seen linux desktops way better than OS X but they always needed like years to accomplish this perfection
nhhagen has joined #ruby
tyl has joined #ruby
fedez77 has joined #ruby
samsonasu has joined #ruby
<shevy>
soahccc well the problem is that gnome, kde and partially ubuntu/unity are shaping most of the linux desktop
bjhaid has joined #ruby
<Morrolan>
Pft, fancy clicky stuff.
<soahccc>
working clicking stuff
<Morrolan>
My non-clicky WM works too. :P
Xeago_ has joined #ruby
mansi has joined #ruby
poseid has joined #ruby
<Morrolan>
'course it's got a different target audience.
<soahccc>
The best imho is that I can use my normal shortcuts in my terminal :)
marcgg__ has quit [Read error: No route to host]
<poseid>
so, I want to define a time window in unit of days, but subtracting 4.weeks.ago - DateTime.now doesnt really work
Fire-Dragon-DoL has joined #ruby
<poseid>
what would be the ruby way to do this?
ace_striker has quit [Ping timeout: 272 seconds]
marcgg has joined #ruby
sLi_ has joined #ruby
<soahccc>
poseid: what is your desired output? x days?
<poseid>
yes, it is for statistics
nettoweb has joined #ruby
<poseid>
like x events/day, or 100 days over the last 4 weeks, etc
<poseid>
I am having access to ActiveSupport maybe I should read the docs there
Xeago has quit [Ping timeout: 260 seconds]
dblessing has joined #ruby
<soahccc>
poseid: well you substract and end up with a negative date
po10 has joined #ruby
dogonthesun has joined #ruby
Advocation has quit [Quit: Advocation]
LiohAu has joined #ruby
ixti has joined #ruby
camilasan has quit [Remote host closed the connection]
<LiohAu>
what is the syntax to call a method B defined in a module A ? A.B ?
<poseid>
ok, maybe I should use strings, and convert those to dates myself.
kevind_ has joined #ruby
Sammael has joined #ruby
chrisseaton has quit []
bjhaid has quit [Quit: Leaving.]
dogonthesun has quit [Client Quit]
bjhaid has joined #ruby
Virtualize has quit [Read error: Connection reset by peer]
Virtualize|away has joined #ruby
<Morrolan>
LiohAu: A::b() or A.b() both work. Mainly a matter of preference.
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
nettoweb has quit [Quit: nettoweb]
nettoweb has joined #ruby
drumusician has quit [Quit: Leaving]
rudisimo has joined #ruby
nettoweb has quit [Client Quit]
avalarion has quit [Read error: Connection reset by peer]
drumusician_ has joined #ruby
nettoweb has joined #ruby
nettoweb has quit [Client Quit]
OdNairy has quit [Ping timeout: 265 seconds]
nhhagen has quit [Remote host closed the connection]
kpshek has quit []
drumusician_ has quit [Client Quit]
mlpinit has joined #ruby
<shevy>
soahccc you can use normal shortcuts in the terminal?
camilasan has joined #ruby
burlyscudd has quit [Quit: Leaving.]
monkegjinni has quit [Remote host closed the connection]
po10 has quit [Ping timeout: 245 seconds]
<soahccc>
shevy: Well on OS X you do everything with CMD (which would be the windows key) so, cmd+c, cmd+v. They don't collide with the terminal specific shortcuts like ctrl-c for interrupt
<Morrolan>
Is that even complex enough to warrant adding a dependency? Quick & dirty solution would be to scan for /[A-Z][a-z]+/, call downcase on each, then join with '_' as separator.
mansi_ has joined #ruby
mansi_ has quit [Remote host closed the connection]
mansi has quit [Read error: Connection reset by peer]
<apeiros>
DouweM: subjective. writing my own methods is overkill :-)
bluenemo has quit [Remote host closed the connection]
chrisseaton has joined #ruby
<Morrolan>
Or, in case of camelCase rather than CamelCase, make the first uppercase letter optional.
mansi has joined #ruby
<apeiros>
(+maintaining)
mansi has quit [Read error: Connection reset by peer]
<DouweM>
it's got logic for acronyms and :: that you probably won't need.
Cephalostrum has joined #ruby
bricker`LA has quit [Ping timeout: 276 seconds]
bluOxigen has quit [Ping timeout: 248 seconds]
nhhagen has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
nhhagen has joined #ruby
mary5030 has joined #ruby
kai1 has joined #ruby
kai1 has left #ruby [#ruby]
nwertman has quit [Quit: Lost terminal]
petey has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
CorySimmons has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.2]
Doc_X is now known as Doc_XI
nhhagen has quit [Read error: Connection reset by peer]
allaire has joined #ruby
himsin has joined #ruby
himsin has quit [Client Quit]
tesuji has quit [Ping timeout: 272 seconds]
w4pm has joined #ruby
nateberkopec has joined #ruby
nhhagen has joined #ruby
ahmedelgabri has joined #ruby
ms_steampunk has joined #ruby
<ms_steampunk>
Hey guys, quick question. If you make a gem, and let's assume it's a working gem, you can both require it from terminal and from a file without any added code right?
<ms_steampunk>
I'm trying to explain to someone that you don't have to "implement" differently for both methods of require IIRC.
Hobogrammer has quit [Ping timeout: 272 seconds]
arturaz has quit [Remote host closed the connection]
<Morrolan>
"Require from terminal"?
<ms_steampunk>
Ah sorry I meant lets say
<Morrolan>
Do you mean from within an interactive Ruby shell (e.g. irb, pry)?
<ms_steampunk>
You're in IRB
<ms_steampunk>
Yeah
nhhagen has quit [Remote host closed the connection]
<Morrolan>
In this case - yes.
<ms_steampunk>
So it IS the same thing/action being done?
dnorthrup has joined #ruby
<Morrolan>
Yes.
nhhagen has joined #ruby
kep has quit [Quit: WeeChat 0.4.2]
deception has joined #ruby
w4pm has quit [Ping timeout: 248 seconds]
ahmedelgabri has quit [Ping timeout: 246 seconds]
<ms_steampunk>
Thanks Morrolan
<Morrolan>
:)
<ms_steampunk>
Now just to convince him that I am right lol
acrussell has joined #ruby
<Morrolan>
I certainly wonder why he thought that it'd be different. :P
OdNairy has quit [Ping timeout: 246 seconds]
<Morrolan>
The easiest way to convince him is probably to just show him.
<ms_steampunk>
I don't know haha. He said he's been using Rails too long and haven't done Ruby in a while.
<Morrolan>
Rails probably does something funky with the load path when using its console vs starting the server, but I'm not sure. :)
Doc_X has joined #ruby
<apeiros>
lewellyn: so that file can indeed be "converted" to a pdf by a mere rename?
ewnd9 has quit [Read error: Connection reset by peer]
<soahccc>
Morrolan: No but if you install gems via bundler you can't require them within a irb/pry session which is not in you bundle context unless it is also installed via gem command
ewnd9 has joined #ruby
<apeiros>
lewellyn: but even if - the existence of the checkbox implies that while some .ai files may be .pdf compatible, it's not all .ai files which are. so the extension alone is insufficient.
heftig has quit [Ping timeout: 246 seconds]
IceyEC has joined #ruby
Doc_XI has quit []
ayumin has joined #ruby
OdNairy has joined #ruby
<ms_steampunk>
soahccc so if I gem install nokogiri, I can use it in irb
tobago has quit [Remote host closed the connection]
<soahccc>
yes
<petey>
I'm currently using angular and google spreadsheet as a backend to pull all the data onto the page. I want to try doing it differently. The data is changed once every few weeks, but it can't be static. Can I do this more efficiently with Ruby?
<lewellyn>
apeiros: the checkbox is checked by default. and the files begin with: %PDF-1.5
<petey>
I want to be able to make changes in the google spreadsheet and have them appear on refresh, for example.
<Morrolan>
soahccc: Won't Bundler install to $GEM_HOME by default?
brunops has quit [Ping timeout: 272 seconds]
<ms_steampunk>
soahccc and when you mean installed by bundler its 'require nokogiri' in a file right and then running bundle install ?
<apeiros>
lewellyn: default or not doesn't matter. it means not all .ai files are pdf compatible.
<Morrolan>
ms_steampunk: Need to add it to the Gemfile for Bundler to do anything about it.
pu22l3r_ has joined #ruby
<ms_steampunk>
Oh okay thanks Morrolan!
<lewellyn>
apeiros: the question specifically stated that it was regarding the default case.
bean__ has joined #ruby
* apeiros
off for commute
apeiros has quit []
<soahccc>
Morrolan: you're right I can use the gems installed by bundler. It was the other way around which doesn't work since bundler complains :)
akemrir has joined #ruby
rippa has joined #ruby
vlad_starkov has joined #ruby
burlyscudd has joined #ruby
guilund has joined #ruby
tagrudev has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
dweeb_ has quit [Quit: Computer has gone to sleep.]
kreantos has quit [Ping timeout: 245 seconds]
MatthewsFace has joined #ruby
avalarion has joined #ruby
MrZYX is now known as MrZYX|off
fantazo has quit [Ping timeout: 245 seconds]
sergicles has quit [Quit: sergicles]
arietis has joined #ruby
kcombs has quit [Remote host closed the connection]
tylersmith has joined #ruby
user258467 has joined #ruby
fedesilva has joined #ruby
brunops has joined #ruby
<zxd>
http://pastebin.com/Ts6gGAq4 anyone know why it dosen't read #{user['home']} variable under ruby_block and git ?
MrZYX|off is now known as MrZYX
vlad_starkov has quit [Remote host closed the connection]
kreantos has joined #ruby
yasushi has quit [Remote host closed the connection]
pranny has joined #ruby
pranny has quit [Client Quit]
vlad_starkov has joined #ruby
Jdubs has joined #ruby
SCommette has joined #ruby
sergicles has joined #ruby
Jdubs has quit [Remote host closed the connection]
Jdubs has joined #ruby
Virtualize|away has quit [Read error: Connection reset by peer]
<zxd>
test
Virtualize has joined #ruby
<tobiasvl>
zxd: 1. what does it do instead? is the code being run, but the string isn't interpolated? 2. are you sure user['home'] is set?
<zxd>
it is set in the first block if user['git_user'] && user['git_user']['enabled']
<zxd>
I could be wrong
<workmad3>
zxd: that doesn't set anything
vlad_starkov has quit [Remote host closed the connection]
<workmad3>
zxd: that just checks if the user has a couple of attributes (not the one you're interpolating)
<zxd>
including home no ?
CorySimmons has joined #ruby
<workmad3>
no
CaptainJet has joined #ruby
<zxd>
it passes home to the git_user resource
<zxd>
hmm
starkhalo has joined #ruby
<workmad3>
zxd: that doesn't mean it's set, just that the git_user resource has a default that can be used there if home has no varue
<workmad3>
*value
atmosx has joined #ruby
<workmad3>
zxd: the real thing to tell if it's been set... did you add a 'home' key to the item in the data bag?
<zxd>
yes
<workmad3>
zxd: prove it with a pastie ;)
crystal77 has joined #ruby
<zxd>
oh man
<zxd>
I didn't
<workmad3>
there you go ;)
<crystal77>
Hi, is there a guide that will explain the difference between gems, gemsets, rvm, rake, etc. All the tutorials I read assume pre-existing knowledge, and I'm at a loss.
<zxd>
there's only id and other stuff user cookbook auto appends /home + user
Bira has joined #ruby
dweeb_ has joined #ruby
lmickh has joined #ruby
vlad_starkov has joined #ruby
allaire has quit []
<MrZYX>
crystal77: gems are ruby libraries, rvm is a tool to manage multiple installations of ruby, gemsets is a feature of rvm (not ruby), rake is a tool to run tasks written in ruby, much like make
lmickh has quit [Remote host closed the connection]
Virtualize has quit [Quit: Leaving...]
OdNairy has quit [Ping timeout: 248 seconds]
Sid05 has quit [Ping timeout: 252 seconds]
aryaching has quit []
<crystal77>
Hmm. I understand RVM, and gems (used them before). And I'm learning about unit tests, but again, no tutorials cover how to learn them, just why they're good to use. Always wonder how people learned about unit tests, probably in Uni.
<ericwood>
lol nope
<LastWhisper>
crystal77: what do you want to learn about unit tests
ewnd9 has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ericwood>
uni doesn't teach you shit about testing
mikeg has joined #ruby
<LastWhisper>
i am an automation engineer full time... i never learend about it in uni
<LastWhisper>
haha
<crystal77>
Nice! How did you learn it?
ewnd9 has joined #ruby
<LastWhisper>
slow and steady :P
<ericwood>
reading things like the railsguides on testing
<crystal77>
And I think before I dive into that stuff, I should learn ruby first, as that's my biggest hurdle.
<LastWhisper>
What specifically do you want to learn?
ewnd9 has quit [Remote host closed the connection]
<crystal77>
everything :x
<ericwood>
yeah please learn ruby first!
<LastWhisper>
What do you want to test?
<crystal77>
I keep running back to PHP, because it's my comfort zone, and I want to get out of it. ):
<ericwood>
okay let's forget about testing for a second
<ericwood>
you should pick up the language first
<ericwood>
then we'll talk about unit testing
mikepack has joined #ruby
<crystal77>
Makes sense. Pickaxe book?
<MrZYX>
or RVM or Gems or anything else
<ericwood>
sure
freezey has quit [Remote host closed the connection]
<crystal77>
Or Codecademy? Or whatever? Tutorial overload, there are wayyyy too many tutorials out there.
po10 has joined #ruby
<LastWhisper>
crystal77: I knew very basic ruby
<MrZYX>
well, do you have a preferred style?
pranny has joined #ruby
pranny has quit [Client Quit]
<LastWhisper>
and started writing tests in watir
<LastWhisper>
and just learned as i went
<crystal77>
I only learn by doing, not by reading/watching videos.
<LastWhisper>
i dont really use watir any more, ive switched to capybara, but watir is still very useful
dogonthesun has joined #ruby
<shevy>
I got a table
<MrZYX>
crystal77: maybe go through tryruby.org and then go straight to the ruby koans
ewnd9 has joined #ruby
<MrZYX>
and ask us all the dumb questions you'll get in that process
<shevy>
I want this table to become a 2D-plot
lmickh has joined #ruby
<ericwood>
I hate video tutorials
<shevy>
is there a simple way from the commandline to display this or otherwise create images or similar, ideally from using ruby?
chrisseaton has quit []
snath has quit [Ping timeout: 248 seconds]
dukz has quit [Remote host closed the connection]
_maes_ has joined #ruby
aryaching has joined #ruby
<ericwood>
there's libraries for generating SVGs
sassamo has joined #ruby
<ericwood>
that might be a decent approach
wildroman2 has quit [Remote host closed the connection]
mikepack has quit [Ping timeout: 252 seconds]
devdazed has quit [Quit: Bye]
Shidash has joined #ruby
<shevy>
hmm let me think
<Takumo>
hmm still not cracked this whole attribute readers thing
freezey has joined #ruby
eleve has quit [Quit: eleve]
fantazo has joined #ruby
<shevy>
Takumo what's with it. attr_reader :foo - that is all :)
ace_striker has joined #ruby
<Takumo>
It's mostly based on the twitter gem, I've got an object that is created from a JSON object returned by a REST API
<shevy>
ewwwww
ace_striker has quit [Changing host]
ace_striker has joined #ruby
ace_striker has quit [Changing host]
ace_striker has joined #ruby
devdazed has joined #ruby
<Takumo>
well I want a clean way that I can create an object with some attributes (i.e. :account_id ) currently they all live in a hash of @attrs
dj21 has joined #ruby
<MrZYX>
Look at OpenStruct
<workmad3>
shevy: regarding your 2d plot... it might be amenable to formatting with graphviz
chrisseaton has joined #ruby
<dj21>
is shellescape enough to prevent shell injection?
dukz has joined #ruby
<Doc_X>
bbssysop: yeah, i'd just drop the JSON into a file, do 'knife role from file role.json' and add it that way. Ruby DSL, while interesting, is not what i've used or would suggest.
nhhagen has quit [Remote host closed the connection]
<Doc_X>
but that's just me, i could be wrong :-)
jprovazn has quit [Quit: Leaving]
guilund_ has joined #ruby
<Doc_X>
damn, wrong channel :(
<Takumo>
Is there a better way to create objects based on a REST API with attr_readers ?
<workmad3>
dj21: afaik, just using the multi-arg forms of system and exec stop shell injection
CaptainJet has quit []
<MrZYX>
Takumo: look at OpenStruct
<workmad3>
dj21: e.g. system("foobar", "arg1", "arg2", ...)
<shevy>
workmad3 good idea
<dj21>
this makes me nervous
<Takumo>
MrZYX: is that 1.8.7 compatible?
<shevy>
I once used graphviz like 8 years ago but only for circle----circle---circle drawings
<dj21>
i have to pass user input into a shell
nwertman has joined #ruby
<dj21>
shudder
<crystal77>
MrZYX: haha alright then
<Takumo>
dj21: No you don't, your solution is clearly flawed if you're doing that...
<workmad3>
dj21: as arguments to a command?
guilund has quit [Ping timeout: 260 seconds]
jlast has joined #ruby
<dj21>
Takumo: need to take a screenshot of a webpage. thinking of piping a url to cutycapt, got a better idea?
<dj21>
and the capit gem won't cut it
<MrZYX>
Takumo: I don't care and so shouldn't you. Ruby 1.8 is EOL, some company picking up emergency security patches doesn't change that
<workmad3>
dj21: system("cutycapt", user_url)
samsonasu has quit [Quit: samsonasu]
<dj21>
does that return from stdout?
<workmad3>
dj21: or whatever the setup of the command is ;)
burlyscudd has joined #ruby
<Takumo>
MrZYX: It's still the newest Ruby available in may distros
arietis has quit [Quit: Computer has gone to sleep.]
<MrZYX>
in many stupid distros
<MrZYX>
don't know a single sane one
<shevy>
debian!!!
<sec^nd>
What is the best way to merge a scalar value in yaml?
<soahccc>
Takumo: even debian, DEBIAN, I mean debian has 1.9
<Morrolan>
Unless you're on oldstable. :P
<shevy>
sec^nd what is a scalar value in ruby?
samsonasu has joined #ruby
<Morrolan>
Or *cough* CentOS 5.
<shevy>
Morrolan dinosaurstable 2.0!
dogonthesun has quit [Quit: Computer has gone to sleep.]
<sec^nd>
shevy: I'm using YAML
<shevy>
huh
<shevy>
I thought you were using ruby
<workmad3>
dj21: it's just a normal system() call
<dj21>
(shudder)
<Hanmac>
CentOS ... from a long time ago before Stone was invented ...
<dj21>
i guess i want IO::popen
kep has joined #ruby
<Takumo>
well then, 1.9.3 minimum it is
jlast has quit [Read error: Operation timed out]
<workmad3>
dj21: it's a normal system call that's passing arguments as separate params so they're correctly escaped ;)
<workmad3>
dj21: e.g. 'system("echo", "*")' echos out '*' rather than a directory listing
sambao21 has quit [Quit: Computer has gone to sleep.]
dogonthesun has joined #ruby
petey has quit [Remote host closed the connection]
dogonthesun has quit [Client Quit]
fantazo has quit [Ping timeout: 245 seconds]
petey has joined #ruby
sambao21 has joined #ruby
rayners has joined #ruby
<Hanmac>
dj21 & workmad3 whats why there is a difference between 'system("echo", "*")' and 'system("echo *")'
mhenrixon has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<workmad3>
dj21: however, if you want access to the IO streams then yeah IO::popen is what you want, I believe
poseid has joined #ruby
[_aeris_] is now known as _aeris_
<poseid>
what is the fastest way to see the help for a class, e.g. DateTime from the console?
terrellt has quit [Read error: Connection reset by peer]
<Takumo>
i.e. MyGem::MyResource < ::OpenStruct
<MrZYX>
Takumo: if the API is _very_ unstable
sparrovv has quit [Remote host closed the connection]
<MrZYX>
I guess I'd rather use normal structs
<Hanmac>
Takumo: about "sensible" are you scared that someone might touch your code?
gregoriokusowski has joined #ruby
<Takumo>
Hanmac: its a gem, so I want it to be clean and stable
<Takumo>
anyway, Struct sounds likea better place to go
* Hanmac
is the wrong person to ask about "clean" and "stable" ;D (ask shevy he can prof my point ;P )
billiam has joined #ruby
CorySimmons has quit [Quit: Leaving.]
MrThePlague has joined #ruby
tkuchiki has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
tkuchiki has joined #ruby
starkhalo has quit [Ping timeout: 260 seconds]
rootshift has joined #ruby
<shevy>
I am the wrong person to ask about OpenStruct
<shevy>
Takumo, ask apeiros
ace_striker has quit [Ping timeout: 272 seconds]
Hobogrammer_ is now known as Hobogrammer
mityaz has joined #ruby
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vlad_starkov has joined #ruby
<Takumo>
well I just want a way that I can take a hash and make it into an object (so I can add methods) with accessor methods for all the data...
freezey has quit [Remote host closed the connection]
camilasan has quit []
burlyscudd has quit [Quit: Leaving.]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
tkuchiki has quit [Ping timeout: 252 seconds]
camilasan has joined #ruby
albertgrala has joined #ruby
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
alexfreidah has joined #ruby
dscrd has joined #ruby
cascalheira has joined #ruby
<apeiros>
Takumo: see OpenStruct
aspires has joined #ruby
ephemerian has quit [Quit: Leaving.]
starkhalo has joined #ruby
juarlex has joined #ruby
geggam has joined #ruby
<Takumo>
apeiros: Ok so I could just extend OpenStruct to add my own helper methods?
nvrch has quit [Quit: nvrch]
<apeiros>
I wouldn't extend OpenStruct. I'd inherit from it.
<apeiros>
(not the same)
TMM has quit [Quit: Ex-Chat]
<Takumo>
that's what I meant
vlad_starkov has quit [Remote host closed the connection]
<Takumo>
MyGem::MyClass < ::OpenStruct (as opossed to MyGem::MyClass; extend ::OpenStruct)
freezey has joined #ruby
<shevy>
is openstruct like a prototypic object? can you clone from it?
alexfreidah has quit [Ping timeout: 252 seconds]
<workmad3>
Takumo,apeiros: wouldn't a plain Struct be better for inheriting into your own objects? e.g. 'class Foo < Struct.new(:bar, :buzz)'
saarinen has joined #ruby
<apeiros>
workmad3: depends on his details. personally I avoid OpenStruct as it used to leak. Not sure whether that got better.
<Takumo>
workmad3: possibly, but you do have to contend with then having Struct.new(:foo , :bar , :baz , :buzz , ...[100 more arguments])...
<apeiros>
I recommended OpenStruct based on his requirement to go from Hash to Object with all keys available as accessors
<workmad3>
ah, true
zeade has joined #ruby
chomskiii has quit [Read error: Connection reset by peer]
agjacome has quit [Ping timeout: 246 seconds]
Czupa has joined #ruby
chomskiii has joined #ruby
<apeiros>
if his keys are always the same, as Struct would IMO be better, yes. less space, faster, better exceptions (e.g. on typoed attr names)
MatthewsFace has joined #ruby
claymore has quit [Ping timeout: 260 seconds]
<Takumo>
that said this API will never change, its not changed in 8 years
pel_daniel has quit [Read error: No route to host]
aspiers has quit [Ping timeout: 260 seconds]
MatthewsFace has quit [Client Quit]
mercwithamouth has joined #ruby
<shevy>
quiz: how many methods do you think does BasicObject have
<shevy>
omg...
<shevy>
undefined method `send' for #<BasicObject:0x88c73ac> (NoMethodError)
andikr has quit [Read error: Connection reset by peer]
<apeiros>
:)
moted has joined #ruby
lethjakman has quit [Ping timeout: 265 seconds]
<shevy>
how can I invoke the method ! on BasicObject without send?
<shevy>
Hanmac help me out, that's obfuscated code that you'd like
<apeiros>
it has more than I'd have estimated (I'd have guessed 4)
<cout>
shevy: use ffi to call rb_funcall
<Hanmac>
shevy: i know lets see if you get the answer yourself
<apeiros>
I didn't expect ==, !=, ! and equal?
<shevy>
damn
<Hanmac>
>> "bot-test"
gr33n7007h has quit [Read error: Operation timed out]
<shevy>
cout hmm let me think ...
whomp has joined #ruby
pel_daniel has joined #ruby
ghr has quit [Quit: Computer has gone to sleep.]
<Hanmac>
shevy: BasicObject.instance_methods[-2]
claymore has joined #ruby
<shevy>
wah
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
* Hanmac
prefers helper macros and templates for the Data_Get_Struct macros ... with that its much more fun ;P
sassamo has quit [Remote host closed the connection]
nwertman has joined #ruby
mneorr has joined #ruby
sassamo has joined #ruby
mneorr has quit [Remote host closed the connection]
heidi has joined #ruby
mneorr has joined #ruby
<shevy>
is that what you use in rxw
rdark has quit [Quit: leaving]
kobain has quit [Ping timeout: 252 seconds]
<sn0wb1rd>
Is it possible to skip the after(:all) block in rspec if there is a failure in tests?
enebo has joined #ruby
yacks has quit [Quit: Leaving]
i_s has joined #ruby
adthul__ has joined #ruby
rickruby has joined #ruby
yfeldblum has joined #ruby
Anonomastos has quit [Quit: Quitte]
smathieu has joined #ruby
<Hanmac>
shevy: yes ... unwrap<T*> templates that doing the Data_Get_Struct and other nice stuff for you, and _self macros that makes them inside a method more easier ...
sassamo has quit [Ping timeout: 248 seconds]
adthul_ has quit [Ping timeout: 245 seconds]
<Hanmac>
shevy for sample the unwrap templates does much more than Data_Get_Struct, for primitive types like Color, Size, Point, Rect and other it also works for "similar" classes, that means functions that want WX::Color does also work with other color objects (from other libs or self defined) ... some classes like WX::Bitmap and WX::Image does automaticlly look for files if you give them a String
freezey has quit [Remote host closed the connection]
mocfive has quit [Remote host closed the connection]
dweeb_ has joined #ruby
tvw has quit [Read error: Operation timed out]
<soahccc>
jruby can't do that? :( NoMethodError: undefined method `signame' for Signal:Module
<mostlybadfly>
Has anyone had any luck with using a chromebook for programming?
tvw has joined #ruby
mocfive has joined #ruby
<RubyPanther>
Hanmac: It's great, it is such a good stdlib that it makes sense what you're doing even where it is not something I would ever want to do lol
chrisseaton has joined #ruby
adthul has quit [Ping timeout: 272 seconds]
jlebrech has quit [Quit: Konversation terminated!]
mengu has quit [Remote host closed the connection]
interactionjaxsn has quit [Remote host closed the connection]
kebabski has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
carraroj has quit [Quit: Konversation terminated!]
burlyscudd has quit [Quit: Leaving.]
petey has joined #ruby
freezey has quit [Remote host closed the connection]
zeropx has quit [Quit: has left the room … Or did he?]
freezey has joined #ruby
petey has quit [Remote host closed the connection]
akemrir has quit [Quit: WeeChat 0.4.2]
ambushsabre has quit [Quit: rip]
ayumin has quit [Remote host closed the connection]
kobain has joined #ruby
ayumin has joined #ruby
Bira has quit [Ping timeout: 276 seconds]
centrx has quit [Quit: Leaving]
emptymag00 is now known as gladmynameisntmi
Hanmac1 has joined #ruby
gladmynameisntmi is now known as mikesucks
alvaro_o has joined #ruby
mikesucks has left #ruby ["Leaving"]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
Bira has joined #ruby
tt1187 has joined #ruby
SCommette has quit [Quit: SCommette]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Bira_ has joined #ruby
Hanmac has quit [Ping timeout: 246 seconds]
zipper has joined #ruby
burlyscudd has joined #ruby
rayners has quit [Ping timeout: 252 seconds]
Shidash has joined #ruby
kaldrenon has joined #ruby
ayumin has quit [Ping timeout: 265 seconds]
Shidash has quit [Client Quit]
iamjarvo has joined #ruby
Bira has quit [Ping timeout: 245 seconds]
subbyyy_ has quit [Ping timeout: 252 seconds]
zipper has quit [Client Quit]
petey has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Spami has quit [Quit: This computer has gone to sleep]
EngierkO has joined #ruby
Hanmac has joined #ruby
EngierkO has quit [Max SendQ exceeded]
EngierkO has joined #ruby
SCommette has joined #ruby
juarlex has quit [Remote host closed the connection]
interactionjaxsn has joined #ruby
axl_ has joined #ruby
mansi has quit [Ping timeout: 272 seconds]
sassamo has quit [Ping timeout: 272 seconds]
alexherb1 has joined #ruby
<shevy>
soahccc curiously enough, the pickaxe mentioned RUBY_VERSION but I cant recall that it mentioned RUBY_DESCRIPTION at the same page
<shevy>
mneorr you can always #reverse
mikepack has quit [Remote host closed the connection]
whomp has joined #ruby
Hobogrammer has quit [Ping timeout: 252 seconds]
postmodern has joined #ruby
DarthGandalf has quit [Ping timeout: 272 seconds]
* Hanmac
wanted an reverse sort but it is not in code ;(
<shevy>
and use File.basename
<shevy>
and split up to the first .
vim_shim_ has quit [Read error: Connection reset by peer]
redmenace has joined #ruby
assurbanipal has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
<shevy>
mneorr it often is easier if you give us sample input, and desired output precisely, then we can tell you what ruby code should be used in between :)
ephemerian has joined #ruby
vim_shim_ has joined #ruby
<soahccc>
shevy: don't you mean the last .
<shevy>
soahccc I am no longer sure
<shevy>
how he wanted to sort "z" vs "Z"
aspires has joined #ruby
<Hanmac>
yeah, give us the input, and the output and we do the putput ;P
subbyyy_ has joined #ruby
<soahccc>
gist is down for me
bluOxigen has joined #ruby
Czupa has quit [Ping timeout: 252 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
sassamo has joined #ruby
petey has quit [Remote host closed the connection]
adthul_ has quit [Ping timeout: 265 seconds]
joast has joined #ruby
whomp has quit [Ping timeout: 276 seconds]
petey has joined #ruby
yfeldblum has joined #ruby
ambushsabre has joined #ruby
vky has joined #ruby
adthul_ has joined #ruby
<shevy>
as long as it it's not what is in your pants that is down
mansi has joined #ruby
heidi is now known as heidi-ramen
smathieu has quit []
echevemaster has joined #ruby
Animawish has joined #ruby
whomp has joined #ruby
Animawish has left #ruby [#ruby]
burlyscudd has quit [Quit: Leaving.]
kate_r has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
IcyDragon has joined #ruby
_Andres has quit [Read error: Connection reset by peer]
coder_neo has quit [Quit: Leaving]
DarthGandalf has joined #ruby
mikepack has joined #ruby
IceDragon has quit [Ping timeout: 245 seconds]
IcyDragon is now known as IceDragon
ClientAlive has joined #ruby
tyl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ahmedelgabri has quit []
tyl has joined #ruby
mark_locklear has quit [Ping timeout: 245 seconds]
subbyyy_ has quit [Ping timeout: 246 seconds]
<shevy>
Hanmac I am now writing a class called UpdateGemspec which will update all my .gemspec files
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
ClientAlive has quit [Ping timeout: 246 seconds]
ClientAlive has joined #ruby
gigetoo has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
nhhagen has joined #ruby
gregoriokusowski has quit [Quit: gregoriokusowski]
gigetoo has joined #ruby
tyl has quit [Ping timeout: 276 seconds]
sparrovv has quit [Remote host closed the connection]
weems has quit [Quit: Leaving]
txdv has quit [Read error: Operation timed out]
Hobogrammer has joined #ruby
heidi-ramen has quit [Quit: Leaving.]
weems has joined #ruby
burlyscudd has joined #ruby
siwica has quit [Quit: siwica]
wildroman2 has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
iamjarvo has quit [Ping timeout: 252 seconds]
ClientAlive has quit [Ping timeout: 276 seconds]
DaZ has joined #ruby
CodeBunny has quit [Read error: Connection reset by peer]
ClientAlive has joined #ruby
Hanmac has quit [Ping timeout: 276 seconds]
chrisseaton has quit [Ping timeout: 245 seconds]
sparrovv_ has joined #ruby
senayar has joined #ruby
Czupa has joined #ruby
adthul__ has joined #ruby
senayar has quit [Remote host closed the connection]
Xeago has joined #ruby
karl___ has joined #ruby
ClientAlive has quit [Ping timeout: 252 seconds]
Xeago has quit [Remote host closed the connection]
senayar has joined #ruby
codezomb has joined #ruby
<karl___>
I want to use regex to pull out a part of a string (I can do this), and then puts the matched string followed by the unmatched string (don't know how to do this). What is the proper way to get the portion of the string not matching the regex (inverse match, i suppose)?
adthul_ has quit [Ping timeout: 245 seconds]
<shevy>
not sure if there is a way for inverse matching
<mostlybadfly>
Any answers on the chromebook thing?
<shevy>
but you could use multiple () match groups and access these via $1 $2 $3
tvw has quit []
<shevy>
or via [1] [2] etc..
<karl___>
shevy: that sounds like it might be a good solution
<shevy>
karl___ can you give example input string, and desired output you wish to achieve
burlyscudd has quit [Ping timeout: 245 seconds]
rickruby has quit [Remote host closed the connection]
<karl___>
sure; in each case, the input string is the same: IP, username/password
<karl___>
e.g., 127.0.0.1 root/password
top4o has joined #ruby
CodeBunny has joined #ruby
<karl___>
i would like to regex the IP address, perform a DNS lookup, and then insert the DNS hostname in the middle between the IP and username/password
mansi has quit [Read error: Connection reset by peer]
b00stfr3ak has joined #ruby
mansi has joined #ruby
cbetta_afk is now known as cbetta
<MrZYX>
karl___: can't you just split by /?
Czupa has quit [Ping timeout: 252 seconds]
<MrZYX>
and space
lorelei_ has joined #ruby
mocfive has joined #ruby
mocfive has quit [Remote host closed the connection]
brandonjmckay has quit [Quit: Computer has gone to sleep.]
adthul_ has joined #ruby
<lectrick>
Anyone know of a gem or just a block of Ruby code that does Reed-Solomon error correction? (Or another error correction code)
<MrZYX>
note also that you can do what you wrote, it's just an instance variable for the class objects singleton class and not for the objects made from your class
<Foomusic>
it's not about hardness, it's about beauty, MrZYX
<apeiros>
Foomusic: having a method which cleanly encapsulates initialization is beatiful
<apeiros>
*beautiful
<MrZYX>
^
securitycrush has quit [Remote host closed the connection]
<Foomusic>
it is unless you are forced to create such a method to initialize one single variable
<apeiros>
Foomusic: especially in a language where the whole class body is ordinary code - not some special mojo jojo like in other languages.
Czupa has joined #ruby
<apeiros>
Foomusic: and suddenly we're talking about hardness again :-p
<Foomusic>
class Foo @bar = 1; end is x10 times more beautiful than class Foo def initialize @bar = 1; end end
<apeiros>
Foomusic: anyway, the short answer is: no, there is no other way. the long answer is: you can monkey patch Module (or Class), adding some meta-code to simplify initializer creation.
araujo has quit [Remote host closed the connection]
<apeiros>
Foomusic: that's just, like, your opinion :-p
Zai00 has joined #ruby
<Foomusic>
hehe, ok
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
Advocation has joined #ruby
petertretyakov has quit [Remote host closed the connection]
<Foomusic>
I just wanted to be sure there was only the "traditional" method
<Foomusic>
thanks
<apeiros>
e.g. you could create something like: class Foo; initializes :@bar, 1; end
adthul__ has quit [Ping timeout: 260 seconds]
Lewix has quit [Remote host closed the connection]
Bira_ has quit [Remote host closed the connection]
<apeiros>
ah, too sad, @bar is not eligible for 1.9 hash syntax :(
<apeiros>
no `initializes @bar: 1`
Lewix has joined #ruby
Jake232 has joined #ruby
sLi_ has quit [Remote host closed the connection]
CodeBunny has quit [Quit: CodeBunny got lost. Send help!]
yfeldblum has quit [Remote host closed the connection]
juarlex has joined #ruby
Zai00 has left #ruby [#ruby]
<Foomusic>
oh, I just remembered
nhhagen has quit [Remote host closed the connection]
rootshift has joined #ruby
<Foomusic>
is it planned to add list comprehension in the future?
freezey has joined #ruby
<Foomusic>
it's not that I like it too much, but it's the number 1 thing pythonist say ruby lacks
phansch has joined #ruby
<Foomusic>
pythonists*
brandonjmckay has joined #ruby
Hanmac has joined #ruby
artmann has quit [Quit: No Ping reply in 180 seconds.]
timonv has quit [Remote host closed the connection]
<apeiros>
Foomusic: I hope not
<Foomusic>
why?
<apeiros>
because artificial syntax << proper methods
Spami has joined #ruby
<Foomusic>
it could be done with proper methods I guess
<apeiros>
I'm a big fan of rubys approach to use little syntax
mansi has quit [Read error: Connection reset by peer]
<apeiros>
hard to balance it right
mansi has joined #ruby
parduse has joined #ruby
nhhagen has joined #ruby
<godd2>
Hey all, I'm reading The RSpec book, and I got hung up on something. on page 85 it says "The output allows the messages it receives when we call start() because it uses as_null_object." But I don't understand. The output allows the messages to -what-?
<Foomusic>
btw, I don't think it would be more artificial than a block like { ... }
terrellt_ is now known as terrellt
<s2013>
if i have an array [1,2,3] how do sum each element to the one before it? so its like [1,3,6]
<shevy>
Foomusic {} also means hash though
<s2013>
kind of like fibonacci sequence
aspires has quit []
petey has quit [Remote host closed the connection]
phutchins has quit [Read error: Operation timed out]
<Foomusic>
shevy, I know, I said "a block"
Loaft has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<godd2>
Foomusic: What do you want to be able to do as a list comprehension that you can't do with Array#map ?
petey has joined #ruby
heidi has joined #ruby
fedez77 has quit [Ping timeout: 272 seconds]
<Foomusic>
what do you want to do with a map that you can't do with a loop? godd2
<godd2>
Nothing because a map is a loop
<Foomusic>
"a loop" like in "loop do"
szerated_ has quit [Ping timeout: 265 seconds]
<godd2>
I guess what I meant to ask was how is map not offering list comprehension functionality?
<apeiros>
Foomusic: correct. block is also added syntax. but as I said, the key is in not adding too much syntax.
SCommette has quit [Quit: SCommette]
acrussell has left #ruby [#ruby]
rickruby has joined #ruby
<Foomusic>
yeah, I know what you mean. I'm a big fan of it too apeiros
<reactormonk>
is it possible to somehow compress lines of JSON so I can still append them to a file? Separate them by zero bytes?
centrx has joined #ruby
<Foomusic>
but {} syntax is pretty close to list comp.
kpshek has joined #ruby
SCommette has joined #ruby
<reactormonk>
... after gzipping them
mneorr has joined #ruby
<apeiros>
reactormonk: tar?
gregoriokusowski has quit [Quit: gregoriokusowski]
yekta has quit [Remote host closed the connection]
<reactormonk>
apeiros, tar doesn't compress and the JSON is streamed
<apeiros>
reactormonk: you said after you gzipped the line
<Foomusic>
a = { i+1 for i in [1,2,3,4,5] if i%2==0 }
<Foomusic>
it's aaaaaaaalmost there :P
<apeiros>
so the data already is compressed and all you need is a container which can separate its parts
<apeiros>
been a while since I implemented a tar parser, but iirc it can be streamed
<apeiros>
might be that gzipped data itself is streamable
<apeiros>
never looked into that
<centrx>
Foomusic, There is also i.even?
<Foomusic>
yep, I just wanted to make it close to python :P
<apeiros>
Foomusic: if you want to code python, just use python
<reactormonk>
apeiros, the data arrives as zmq message, I'm not sure I can just concat those
<shevy>
I have never seen for used inside {}
<Foomusic>
haha, no. I don't like python
e62 has quit [Ping timeout: 276 seconds]
<apeiros>
Foomusic: maybe there's a reason :-p
iamjarvo has joined #ruby
<Foomusic>
anyway, I was just saying, thanks for your answers guys!
ohwhoa has quit [Quit: woah!]
aspires has joined #ruby
dvarrui has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
mneorr has joined #ruby
<reactormonk>
apeiros, so tar what together exactly?
<mneorr>
@shevy sry, had a lunch break
prc has joined #ruby
<shevy>
mneorr I dont remember what we spoke about anyway :D
<mneorr>
about dir.glob :)
<mneorr>
i've ended up doing Dir.glob("**/*.xcworkspace").sort_by(&:length).first
pu22l3r__ has joined #ruby
<apeiros>
reactormonk: the gzipped json parts. but now you said you have zmq. not sure how that fits in with you saying you had a stream.
lorelei_ has quit [Ping timeout: 252 seconds]
<shevy>
ah now I remember
<apeiros>
I haven't used zmq, but I thought it was based on discrete messages, not streams
Txandy is now known as Txandy|away
<Hanmac>
mneorr: look at min_by
zumba_addict has joined #ruby
pu22l3r_ has quit [Ping timeout: 272 seconds]
<reactormonk>
apeiros, I have a stream of distinct messages
<zumba_addict>
hi folks, we have an app listening on port 9292. It works when connecting to http://localhost:9292. How do I get this connection to work though? https://localhost:9292
<reactormonk>
zumba_addict, ohh, ssl is a different biest
assurbanipal has quit [Remote host closed the connection]
<zumba_addict>
ok
<zumba_addict>
how do I get it work?
<reactormonk>
what server do you use?
Czupa has quit [Remote host closed the connection]
<zumba_addict>
btw, it's for our own local development
<reactormonk>
you'll have to do different stuff locally and in production
<zumba_addict>
reactormonk: we don't have any issues in apache. The only issue is on our local development laptop
pu22l3r__ has quit [Ping timeout: 272 seconds]
endash has joined #ruby
endash has quit [Client Quit]
<reactormonk>
zumba_addict, why would that be relevant? Just force SSL in production and you're golden.
<zumba_addict>
I mean, everything is working great in remote apache but not from our local ruby setup
Txandy|away is now known as Txandy
vlad_starkov has joined #ruby
Bira has joined #ruby
<zumba_addict>
it's because of the ie9 crappy browser
nhhagen has quit [Remote host closed the connection]
<reactormonk>
huh?
<zumba_addict>
here
<zumba_addict>
we have a file where we define our REST endpoint
mocfive has joined #ruby
<zumba_addict>
we have 2 remote dev servers. One is running on https and the other is regular http
<benzrf>
when i do 'def foo; a = 3; b = 4; proc {a}; end;'
<shevy>
benzrf is here, let's pretend that we are idling
<benzrf>
when i call foo
<benzrf>
obviously a will not be gc'd
<benzrf>
[ignore that its fixnums w/e]
dangerousdave has quit []
<benzrf>
but will b be gc'd
wudofyr has joined #ruby
dominikh has left #ruby ["WeeChat 0.4.1"]
wudofyr has quit [Remote host closed the connection]
<benzrf>
does ruby pay attention to what you closed over?
<benzrf>
or does it just preserve the context entirely?
wudofyr has joined #ruby
<bnagy>
good question. I don't know.
mocfive has quit [Remote host closed the connection]
<bnagy>
my guess is that you'd get the whole binding
<apeiros>
ruby is usually pretty naive
timonv has quit [Ping timeout: 245 seconds]
<benzrf>
ha
<apeiros>
so I'd assume it closes over everything
wudofyr has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<benzrf>
dang thats bad news
<bnagy>
you could write up a test using strings with a magic value and walk objectspace for a while afterwards
<benzrf>
hmmm
petey has quit [Remote host closed the connection]
<benzrf>
i dont know how to use ObjectSpace
<bnagy>
well now's your chance
<benzrf>
:I
<apeiros>
though, since 1.9, the level of optimization has been raised from version to version
lorelei_ has joined #ruby
petey has joined #ruby
lorelei_ has quit [Changing host]
lorelei_ has joined #ruby
<apeiros>
one reason to close over everything: eval
<apeiros>
and `alias whatever eval`
<benzrf>
:{
<apeiros>
it's not too easy to optimize
shevy has quit [Quit: ""]
<bnagy>
yeah, very hard for the compiler to statically determine that something in the binding can't ever be ref'd
mityaz has quit [Quit: See ya!]
<apeiros>
one variant would be to have an eval keyword, which is powerful enough to be used as base for the implementation of all other eval forms (instance_eval, instance_exec, class_eval etc.)
<apeiros>
then trace added method signatures for evals
<apeiros>
and optimize all closures which don't use any form of eval
bluOxigen has quit [Ping timeout: 272 seconds]
<apeiros>
I might have missed two dozen corner cases in that outline, though.
<apeiros>
s/corner/edge/
<bnagy>
surely that can't be the only tricky case
yjmsf20_ has joined #ruby
tjaco has quit [Ping timeout: 248 seconds]
<benzrf>
wait wat
<benzrf>
def make_clozure a = "shit" b = "ok" p a.object_id
<bnagy>
I don't know what the guarantees are on object id reuse
<benzrf>
yep the entire scope is preserved when a block is passed out
e62 has joined #ruby
lele has joined #ruby
<benzrf>
can it detect whether the block is only a downward arg?
vlad_starkov has quit [Remote host closed the connection]
monkegjinni has joined #ruby
<apeiros>
a gc run doesn't guarantee collection, mind you (in ruby <2.1's implementation it does, I think - but doesn't mean all implementations do)
<benzrf>
oh wait
<benzrf>
if it considers the block obj a pointer to the entire scope
<reactormonk>
apeiros, what does 2.1 bring?
<benzrf>
then it does not matter whether it can tell a downwards arg
<benzrf>
derp
<apeiros>
reactormonk: a new gc
<reactormonk>
apeiros, which does?
<apeiros>
and a couple of other stuff, there are good sites listing them ;-)
<apeiros>
generational gc
<MrZYX>
what about def foo; a="notgcd"; a = "gcd"; build(a); end; def build(a); proc { a }; end; ? am I too naive?
<bnagy>
inch by inch MRI crawls closer to being a crappy version of the JVM ;)
<MrZYX>
one of course s/a/b/
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
<Hanmac>
bnagy i dont care about JVM as long it isw without java ,P
<benzrf>
MrZYX: my guess is that a proc is considered to be referencing the scope in which it was created
<bnagy>
Hanmac: liar
<benzrf>
MrZYX: that seems like the simplest approach...
<bnagy>
otherwise you would have switched to jruby
Cephalostrum has joined #ruby
Cephalostrum has quit [Client Quit]
<bnagy>
you will never leave MRI because otherwise you couldn't write your crazy C++ extensions :)
<Hanmac>
bnagy thats right ... but most of them work on rubinius too
<benzrf>
i will when you tell me something i can make
Cephalostrum has joined #ruby
Cephalostrum has quit [Max SendQ exceeded]
<bnagy>
hey what's the last thing you need to do to push a gem from github to being gem install-able?
tvw has quit [Remote host closed the connection]
<shevy>
benzrf hmm
Cephalostrum has joined #ruby
<shevy>
bnagy I don't know! I always do things like this: rubygen bla.rb (rubygen creates a skeleton for a new class for me), modify bla.rb, turnitintogem bla.rb # turnitinto gem will create project structure + .gemspec and open that .gemspec in my editor, then I fill up some more things into .gemspec, like description, then exit editor, "pgem" to make gem and publish it - done!
<shevy>
benzrf a game would be great
<shevy>
benzrf or a smaller gem before you make a game
<shevy>
benzrf well don't sulk, get the ideas in for a new game!
spider-mario has quit [Remote host closed the connection]
Cephalostrum has quit [Client Quit]
<bnagy>
MrZYX: ok thanks. signup + gem push.
<MrZYX>
yup
<bnagy>
way easier than I expected given the byzantine collection of tools people use to actually create gems :)
mocfive has joined #ruby
Jdubs_ has joined #ruby
gregoriokusowski has joined #ruby
chomskiii has quit [Read error: Connection reset by peer]
nhhagen has joined #ruby
rickruby has quit [Remote host closed the connection]
yjmsf20 has joined #ruby
chomskiii has joined #ruby
w4pm has quit [Ping timeout: 272 seconds]
habanany has joined #ruby
IceyEC has quit [Quit: IceyEC]
<shevy>
hehe
Jdubs__ has joined #ruby
jaimef has quit [Excess Flood]
MrZYX is now known as MrZYX|off
Jdubs has quit [Ping timeout: 276 seconds]
yjmsf20 has quit [Client Quit]
jaimef has joined #ruby
drumusician has joined #ruby
Jdubs_ has quit [Ping timeout: 272 seconds]
subbyyy_ has joined #ruby
ozgun has quit [Quit: Leaving]
nhhagen has quit [Ping timeout: 252 seconds]
maycon_ has joined #ruby
maycon_ has joined #ruby
maycon_ has quit [Changing host]
lorelei_ has quit [Ping timeout: 272 seconds]
shadoi has quit [Quit: Leaving.]
<shevy>
s.add_dependency "foobar", ">= 1.0.0"
<shevy>
this is valid entry in a .gemspec file?
<benzrf>
wouldnt it be possible to make a dsl that lets you directly write a gemfile like 'sinatra >= 3'
DarthGandalf has quit [Ping timeout: 252 seconds]
szerated_ has quit [Quit: Ex-Chat]
<benzrf>
instead of gem 'sinatra', '>= 3'
szerated_ has joined #ruby
<centrx>
shevy, foobar is only at version 0.0.1
darthdeus has quit [Read error: Connection reset by peer]
<shevy>
:P
darthdeus has joined #ruby
unixpro1970 has quit [Quit: unixpro1970 has off IRC]
<shevy>
benzrf probably
rootshift has quit [Read error: Connection reset by peer]
<shevy>
benzrf but gem evolves at snail speed
vlad_starkov has joined #ruby
<shevy>
also remember in 1.8.x it was not integrated
<shevy>
it's an AFTERTHOUGHT
maycon has quit [Ping timeout: 260 seconds]
Bira has joined #ruby
deception has quit [Quit: Goodbye]
kaldrenon has quit [Remote host closed the connection]
cjsarette has joined #ruby
mengu has quit []
Hien_ has quit [Ping timeout: 252 seconds]
aspires has quit []
gl- has quit [Ping timeout: 246 seconds]
vlad_starkov has quit [Remote host closed the connection]
JaTochNietDan has quit [Ping timeout: 252 seconds]
Hien has joined #ruby
gl- has joined #ruby
kep has quit [Quit: WeeChat 0.4.2]
wedgeV has joined #ruby
rootshift has joined #ruby
Cephalostrum has joined #ruby
aspires has joined #ruby
JaTochNietDan has joined #ruby
chinkung has joined #ruby
vky has quit [Quit: ChatZilla 0.9.90.1 [Firefox 28.0a2/20140110004002]]
tyl has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
nhhagen has joined #ruby
redmenace has joined #ruby
kung has quit [Ping timeout: 245 seconds]
shadoi has joined #ruby
sethen has quit [Ping timeout: 252 seconds]
thoraxe has joined #ruby
mikepack has quit [Remote host closed the connection]
Cephalostrum has quit [Client Quit]
fijimunkii has joined #ruby
DarthGandalf has joined #ruby
<thoraxe>
i am dealing with some pretty old code, and I think I may have run across some ruby version syntax changes. Here's the code: https://gist.github.com/thoraxe/f2b4e61f374f854608ed -- I get an error at line 33: syntax error, unexpected ':', expecting keyword_then or ';' or '\n' (SyntaxError)
wedgeV has quit [Quit: wedgeV]
Cephalostrum has joined #ruby
<apeiros>
thoraxe: `if condition.is_a?(Array):` is not valid syntax. remove the `:` at the end.
<RubyPanther>
kill it, before it gets to the children!
szerated_ has quit [Ping timeout: 265 seconds]
Dorf2 has joined #ruby
synergy__ has joined #ruby
<Hamburglr>
how can I run mechanize and mail gems in the same script? I get this error: Unable to activate mail-2.5.4, because mime-types-2.0 conflicts with mime-types (~> 1.16)
pel_daniel has joined #ruby
kenndel has quit [Read error: Connection reset by peer]
dekz__ has joined #ruby
szerated_ has joined #ruby
SCommette has quit [Quit: SCommette]
sassamo has quit [Ping timeout: 248 seconds]
freerobby has quit [Quit: Leaving.]
sh1ps has joined #ruby
justsee_ has joined #ruby
sassamo has joined #ruby
deavidsedice has joined #ruby
TheTFEF has joined #ruby
ambushsabre has joined #ruby
mneorr_ has joined #ruby
soahccc_ has joined #ruby
kewubenduben has joined #ruby
lioninawhat has joined #ruby
_aeris has joined #ruby
lioninawhat has quit [Remote host closed the connection]
e62 has quit [Ping timeout: 252 seconds]
combinatirix has joined #ruby
shadoi has joined #ruby
peregrine81_ has joined #ruby
diegovio1 has joined #ruby
akitada_ has joined #ruby
pcya9111 has joined #ruby
mr_red- has joined #ruby
thumpba has quit [Remote host closed the connection]
telling_ has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
Trickydee has joined #ruby
sparrovv has joined #ruby
thumpba has joined #ruby
Rennex_ has joined #ruby
niftylettuce_ has joined #ruby
isieo has joined #ruby
thumpba has quit [Remote host closed the connection]
mlpinit_ has quit [Remote host closed the connection]
heidi1 has joined #ruby
szerated_ has quit [Ping timeout: 265 seconds]
sarlalian has joined #ruby
heidi has quit [Ping timeout: 245 seconds]
kevind has quit [Quit: kevind]
Thanatermesis has quit [Read error: Operation timed out]
<centrx>
speakingcode-wor, Does it do the same if you send it to to_a before uniq
mlpinit has quit [Ping timeout: 248 seconds]
Aryasam has joined #ruby
thenovices has quit [Ping timeout: 246 seconds]
_aeris is now known as _aeris_
petey has quit [Ping timeout: 252 seconds]
wald0 has quit [Ping timeout: 248 seconds]
momomomomo has quit [Quit: momomomomo]
wildroman2 has quit [Remote host closed the connection]
recurrence has quit [Ping timeout: 272 seconds]
TheMoonMaster_ is now known as TheMoonMaster
brandonjmckay has quit [Remote host closed the connection]
_aeris_ is now known as [_aeris_]
brandonjmckay has joined #ruby
<speakingcode-wor>
centrx: let me see
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
<speakingcode-wor>
centrx: that did it thanks
petey has joined #ruby
<speakingcode-wor>
i guess b/c it's an AR result set and not a true array?
<bnagy>
hooray for AR
dscrd has quit [Quit: .]
<speakingcode-wor>
so my question then is when doing uniq{|s| s.abrv} what IS s, and s.abrv, and what's going on behind the scenes to make that not work? heh
<soahccc>
centrx: What do you mean? It has some commands which could eventually collide with yours but this is very unlikely and if it happens you can un/remap the commands
<soahccc>
This would only affect your terminal not your app