vintik has quit [Remote host closed the connection]
ascarter_ has joined #ruby-lang
ascarter has quit [Ping timeout: 245 seconds]
ascarter_ has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
Jaood has left #ruby-lang [#ruby-lang]
ddv has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby-lang
RobertBirnie has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby-lang
kyy has joined #ruby-lang
tkuchiki has quit [Ping timeout: 264 seconds]
ddv has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
hahuang61 has joined #ruby-lang
mykoweb has quit [Remote host closed the connection]
centrx has joined #ruby-lang
mykoweb has joined #ruby-lang
marr has quit []
mykoweb has quit [Ping timeout: 260 seconds]
jamesfordummies has joined #ruby-lang
mistym has quit [Remote host closed the connection]
rmcafee has quit [Quit: rmcafee]
djbkd has quit [Quit: My people need me...]
sarkyniin has quit [Ping timeout: 250 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesfor_ has joined #ruby-lang
jamesfordummies has quit [Read error: Connection reset by peer]
Mandros has left #ruby-lang [#ruby-lang]
|jemc| has joined #ruby-lang
Atttwww has quit [Ping timeout: 260 seconds]
tkuchiki has joined #ruby-lang
jamesfor_ has quit [Ping timeout: 250 seconds]
elia has quit [Quit: Computer has gone to sleep.]
jamesfordummies has joined #ruby-lang
<cmhobbs>
is there a good way to replace an error with another one? for example, i know that a method i'm calling might return NameError, but I'd like to wrap that error in an error object with a little more information
<cmhobbs>
right now i've got it in a rescue block sort of like: begin; potentially_bad_method; rescue NameError; raise DecoratedError
<cmhobbs>
; end
<cmhobbs>
though that feels kind of gross
<cmhobbs>
it feels bad because it's hard to test
weems|mac has quit [Quit: weems|mac]
chouhoulis has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
palar has quit [Remote host closed the connection]
alexju has quit [Remote host closed the connection]
jmeeuwen has joined #ruby-lang
omosoj has quit [Ping timeout: 255 seconds]
michaeldeol has quit [Ping timeout: 245 seconds]
ur5us has quit [Remote host closed the connection]
amclain has joined #ruby-lang
centrx has quit [Quit: Mead error: Connection reset by beer]
Miphix has joined #ruby-lang
vintik has joined #ruby-lang
s1kx has joined #ruby-lang
ur5us has joined #ruby-lang
emmesswhy has joined #ruby-lang
torrieri has joined #ruby-lang
agrinb has joined #ruby-lang
alexju has joined #ruby-lang
agrinb has quit [Ping timeout: 250 seconds]
jbardin has quit [Quit: jbardin]
nofxx_ has quit [Remote host closed the connection]
omosoj has joined #ruby-lang
emmesswhy has quit [Quit: Leaving]
emmesswhy has joined #ruby-lang
emmesswhy has quit [Client Quit]
sharpmachine has joined #ruby-lang
RobertBirnie has joined #ruby-lang
lcdhoffman has joined #ruby-lang
sharpmachine has quit [Ping timeout: 264 seconds]
emmesswhy has joined #ruby-lang
emmesswhy has quit [Client Quit]
lcdhoffman has quit [Client Quit]
hahuang61 has quit [Ping timeout: 255 seconds]
wallerdev has quit [Quit: wallerdev]
emmesswhy has joined #ruby-lang
emmesswhy has quit [Client Quit]
amystephen has quit [Quit: amystephen]
jamesfor_ has joined #ruby-lang
jamesfordummies has quit [Ping timeout: 250 seconds]
tlr_464 has quit [Remote host closed the connection]
johnpclaus has quit []
Cakey has joined #ruby-lang
agrinb has joined #ruby-lang
torrieri_ has joined #ruby-lang
InfraRuby has left #ruby-lang [#ruby-lang]
jgpawletko has quit [Quit: jgpawletko]
rmcafee has joined #ruby-lang
torrieri has quit [Ping timeout: 255 seconds]
vintik has quit [Remote host closed the connection]
rmcafee has quit [Client Quit]
emmesswhy has joined #ruby-lang
RobertBirnie has quit [Ping timeout: 244 seconds]
dmitrykorotkov has quit [Remote host closed the connection]
emmesswhy has quit [Client Quit]
RobertBirnie has joined #ruby-lang
heavyhorse has joined #ruby-lang
emmesswhy has joined #ruby-lang
hgl has joined #ruby-lang
hahuang61 has joined #ruby-lang
spuk has quit [Ping timeout: 250 seconds]
heavyhorse has quit [Quit: Computer has gone to sleep]
heavyhorse has joined #ruby-lang
koderok has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
spuk has joined #ruby-lang
cmhobbs has quit [Quit: Leaving]
heavyhorse has quit [Ping timeout: 255 seconds]
bunk__ has quit [Remote host closed the connection]
bunk__ has joined #ruby-lang
RobertBirnie has quit [Ping timeout: 255 seconds]
bunk__ has quit [Ping timeout: 250 seconds]
RobertBirnie has joined #ruby-lang
omosoj has quit [Quit: Leaving]
davispuh has quit [Ping timeout: 245 seconds]
kyy has quit [Ping timeout: 246 seconds]
jamesfor_ has quit []
bunk__ has joined #ruby-lang
Cakey has quit [Ping timeout: 255 seconds]
koderok has quit [Ping timeout: 240 seconds]
michaeldeol has joined #ruby-lang
bunk___ has joined #ruby-lang
bunk__ has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Quit: Konversation terminated!]
bunk___ has quit []
Atttwww has joined #ruby-lang
emmesswhy has quit [Quit: Leaving]
weems|mac has joined #ruby-lang
sharpmachine has joined #ruby-lang
t_ has quit [Ping timeout: 250 seconds]
t_ has joined #ruby-lang
zz_anildigital is now known as anildigital
Cakey has joined #ruby-lang
sharpmachine has quit [Ping timeout: 244 seconds]
gix has quit [Ping timeout: 250 seconds]
gix has joined #ruby-lang
canton7 has quit [Ping timeout: 256 seconds]
MichD has quit [Ping timeout: 255 seconds]
marcel has quit [Ping timeout: 245 seconds]
lucas has quit [Ping timeout: 245 seconds]
henrikhodne has quit [Ping timeout: 256 seconds]
canton7 has joined #ruby-lang
marcel has joined #ruby-lang
lucas has joined #ruby-lang
EvilJStoker has quit [Ping timeout: 244 seconds]
_dyrim has quit [Ping timeout: 240 seconds]
JoL1hAHN has quit [Ping timeout: 240 seconds]
EvilJStoker has joined #ruby-lang
MichD has joined #ruby-lang
rcvalle has quit [Quit: rcvalle]
saarinen has joined #ruby-lang
agrinb has quit [Remote host closed the connection]
anildigital is now known as zz_anildigital
agrinb has joined #ruby-lang
palar has quit [Remote host closed the connection]
InfraRuby has joined #ruby-lang
james has joined #ruby-lang
james is now known as Guest48338
Guest48338 is now known as jamesfordummies
agrinb has quit [Ping timeout: 240 seconds]
kaiwren has joined #ruby-lang
emmesswhy has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
zz_anildigital is now known as anildigital
frank_o has joined #ruby-lang
JoL1hAHN has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
anildigital is now known as zz_anildigital
agrinb has joined #ruby-lang
sent-hil has joined #ruby-lang
_whitelogger_ has joined #ruby-lang
canton7 has joined #ruby-lang
EvilJStoker has joined #ruby-lang
marcel has joined #ruby-lang
MichD has joined #ruby-lang
hgl has quit [Ping timeout: 255 seconds]
mbr__ has joined #ruby-lang
heftig has quit [Ping timeout: 250 seconds]
vintik has joined #ruby-lang
mbr has quit [Ping timeout: 256 seconds]
matti has quit [Ping timeout: 256 seconds]
matti has joined #ruby-lang
jxport_ has quit [Ping timeout: 260 seconds]
heftig has joined #ruby-lang
jxport has joined #ruby-lang
agrinb has quit [Remote host closed the connection]
cmhobbs has joined #ruby-lang
ascarter has joined #ruby-lang
bungoman has joined #ruby-lang
bungoman has quit [Client Quit]
JoL1hAHN has joined #ruby-lang
charliesome has joined #ruby-lang
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
RobertBirnie has joined #ruby-lang
cmhobbs has quit [Remote host closed the connection]
zz_anildigital is now known as anildigital
_ht has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
crdpink has left #ruby-lang ["p term"]
<imajes>
any ruby peeps still awake? :)
apeiros has quit [Remote host closed the connection]
tkuchiki_ has joined #ruby-lang
apeiros has joined #ruby-lang
anildigital is now known as zz_anildigital
zz_anildigital is now known as anildigital
tkuchiki has quit [Ping timeout: 255 seconds]
apeiros has quit [Ping timeout: 240 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #ruby-lang
wallerdev has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kyb3r_ has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
jhass|off has quit [Ping timeout: 250 seconds]
emmesswhy has joined #ruby-lang
anildigital is now known as zz_anildigital
cklee has quit [Quit: Connection closed for inactivity]
sharpmachine has joined #ruby-lang
sepp2k has joined #ruby-lang
amclain has quit [Quit: Leaving]
sharpmachine has quit [Ping timeout: 255 seconds]
zz_anildigital is now known as anildigital
seban has joined #ruby-lang
seban has left #ruby-lang [#ruby-lang]
apeiros has joined #ruby-lang
sebangdpl has joined #ruby-lang
vintik has quit [Remote host closed the connection]
<sebangdpl>
Hi, I got a question. How I can override, redefine operator || (double pipe) for instances of String class?
henrikhodne has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
palar has joined #ruby-lang
anildigital is now known as zz_anildigital
mistym_ has joined #ruby-lang
tkuchiki_ has quit [Remote host closed the connection]
<apeiros>
sebangdpl: you can't
_dyrim has joined #ruby-lang
<apeiros>
|| is syntax, not a method
yfeldblum has quit [Ping timeout: 240 seconds]
arBmind has joined #ruby-lang
tkuchiki has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
clauswitt has joined #ruby-lang
clauswitt has quit [Client Quit]
palar has quit [Ping timeout: 255 seconds]
<sebangdpl>
apeiros: I can't? Why?
<apeiros>
08:02 apeiros: || is syntax, not a method
AKASkip has joined #ruby-lang
jamesfordummies has quit [Remote host closed the connection]
[spoiler] has joined #ruby-lang
jamesfordummies has joined #ruby-lang
jamesfordummies has quit [Client Quit]
<sebangdpl>
apeiros: now I am sad. It is not good message to start a day. But I understand now. Before I thought it is from Kernel module or sth like that.
<sebangdpl>
where I can find implementation of ||, does it have official name? :)
<apeiros>
probably in parse.y
<apeiros>
sebangdpl: why would you want to redefine || anyway?
RobertBirnie has joined #ruby-lang
mbr__ is now known as mbr
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
michaeldeol has joined #ruby-lang
skade has joined #ruby-lang
<sebangdpl>
apeiros: I was just curious if it is possible. I saw code like a.present? ? a : b, where a = "" I wonder if it could be handled by || operator instead
maximeshr has joined #ruby-lang
hakunin_ has quit [Read error: Connection reset by peer]
hakunin has joined #ruby-lang
vintik has joined #ruby-lang
brianpWins has joined #ruby-lang
AKASkip has quit [Ping timeout: 264 seconds]
<apeiros>
sebangdpl: you can use a.presence || b
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Missphoenix has joined #ruby-lang
tbuehlmann has joined #ruby-lang
Miphix has quit [Ping timeout: 264 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
worm` has joined #ruby-lang
frank_o has quit [Ping timeout: 250 seconds]
<worm`>
hello, first time ruby user here... What would be a good resource to get me started? I have a background in java, php and js
frank_o has joined #ruby-lang
relix has joined #ruby-lang
<worm`>
I mean something other than the official docs, like a book or somethin
vondruch has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
heftig has quit [Ping timeout: 250 seconds]
sMecKs has quit [Read error: Connection reset by peer]
sent-hil has quit [Quit: Connection closed for inactivity]
vintik has quit [Remote host closed the connection]
solars has joined #ruby-lang
Bwild has quit [Ping timeout: 245 seconds]
AKASkip has joined #ruby-lang
Bwild has joined #ruby-lang
|jemc| has quit [Ping timeout: 260 seconds]
clauswitt has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bougyman has quit [Read error: Connection reset by peer]
marcel has quit [Ping timeout: 260 seconds]
lucas has quit [Ping timeout: 260 seconds]
<maloik>
worm`: there's tons of places, I don't know the best way though
vondruch has quit [Ping timeout: 260 seconds]
<maloik>
there's codecademy, treehouse, tutorial sites like that
lucas has joined #ruby-lang
frank_o has quit [Ping timeout: 245 seconds]
<maloik>
thoughtbot has (had?) a resource called Paths or something like that too
mistym_ has quit [Remote host closed the connection]
palar has quit [Remote host closed the connection]
bffff_ has quit [Quit: Connection closed for inactivity]
stardiviner has joined #ruby-lang
bin7me has quit [Read error: Connection reset by peer]
<ruby-lang787>
o , so //title returned the only one node that was a direct descendant of book!! yaay!!
<jhass>
//title would return all title nodes anywhere below the node you call .at/.xpath on
<jhass>
if you only want book titles //book/title would be safer
<yorickpeterse>
jhass: neg, //title returns *all* title nodes *anywhere*
<yorickpeterse>
Not just from the current context node
<matti>
Ohai yorickpeterse
<yorickpeterse>
matti: hai
<jhass>
oh, // really evades current context too? hm
<ruby-lang787>
:O but wait, then i my program , in ruby, i get the same title text if i use //, i either put simply title or .//title
<ruby-lang787>
*in not i
clauswitt has joined #ruby-lang
<ruby-lang787>
is it because i am doing it the DOM tree way and not the SAX way or like XPath.each way??
<ruby-lang787>
such a mess, i am :
sharpmachine has joined #ruby-lang
<jhass>
I don't know, I'd simply do something like xml.xpath('//book').map {|book| book.at('title').text }
<jhass>
oh, you're using rexml?
<ruby-lang787>
for now jhass, i will switch to nokogiri, but i only have an hour left
benlovell has quit [Ping timeout: 240 seconds]
<ruby-lang787>
rexml' documentation is blurry
<jhass>
so your code should work already, doesn't it?
sharpmachine has quit [Ping timeout: 256 seconds]
<ruby-lang787>
yes it does, but i cannot understand why using elements['title'] works but elements["//title"] return the first title everytime
<jhass>
because // evades context, as yorickpeterse said
<jhass>
it start's searching at the document root again
<jhass>
and since [] only returns the first result
<jhass>
you only get the first title
Sgeo has quit [Read error: Connection reset by peer]
<ruby-lang787>
i see.
dangerou_ has joined #ruby-lang
taiansu has quit [Remote host closed the connection]
elia has joined #ruby-lang
taiansu has joined #ruby-lang
<ruby-lang787>
i now need to find a way to sort the results, if i do a sort! on elements.to_a() then it throws an error, so i guess i would need something like <=> , i read it this morning, although i am not sure
taiansu has quit [Remote host closed the connection]
<jhass>
sort by what?
taiansu has joined #ruby-lang
<ruby-lang787>
first character of the title text
<jhass>
I'd do xml.elements.to_enum(:each, "//book").sort_by {|book| book.elements["title"].text[0] }.map {|book| "#{book.elements["title"].text} - by #{book.elements["author"].text}" } or something
<ruby-lang787>
wow, although i don't understand .. to_enum i undrstand, what is that :each
miqui has quit [Remote host closed the connection]
<ruby-lang787>
i mean is there a documentation where i can have the necessary knowledge to understand it
<jhass>
it creates a Enumerator for the each method. The additional arguments ("//books" in this case) is passed to each
benlovell has joined #ruby-lang
amystephen has joined #ruby-lang
<jhass>
since REXMLs each is incapable of not receiving a block I used that trick
palar has joined #ruby-lang
<ruby-lang787>
sounds cool, i am yet to discover it..
<jhass>
oh well, looks like you can also write xml.get_elements("//book").sort_by...
dangerousdave has quit []
<ruby-lang787>
where did you look?
Forgetful_Lion has quit [Quit: ChatZilla 0.9.90.1 [Firefox 31.0/20140716183446]]
<stardiviner>
How to define a singleton class?
<darix>
stardiviner: why do you need one?
<jhass>
ruby-lang787: just toyed around with pry
<stardiviner>
darix: I found Ruby has singleton methods, I want to know about singleton class.
<ruby-lang787>
you need something like a static variable boolean, after you create an object set its value to false, so that next time you want to instantaniate an object, you check if its value is true then instantaniate else don't
<jhass>
stardiviner: you can't, ruby automatically creates them on access. You can get an objects singleton class with obj.singleton_class
<ruby-lang787>
o
<darix>
stardiviner: did you google for it? the answer is like in top 2 results
<darix>
jhass: there is the singleton module ... which might be what he is after?
taiansu has quit [Remote host closed the connection]
alexju has joined #ruby-lang
<stardiviner>
darix: there is singleton module ? never heard, what is that?
<jhass>
okay, maybe we should find out if he's talking about the singleton pattern or the ruby detail
<jhass>
"singleton method" kinda implied the later to me
<stardiviner>
jhass: I just want to learn more metaprogramming about ruby
<jhass>
so not the design pattern?
<jhass>
good, as said .singleton_class gives you an objects singleton class
Maitiu has joined #ruby-lang
<jhass>
you can get into a class definition for a singleton class with class << obj; end
<stardiviner>
jhass: I see. what about singleton module?
<jhass>
stardiviner: the singleton stdlib provides the Singleton module which you can mix into your class to implement the Singleton design pattern which has nothing to do with an objects singleton class which is also sometimes called metaclass or eigenclass
dwknoxy has joined #ruby-lang
<stardiviner>
jhass: Oh, that's the singleton module (Singleton), I thought that it is something like singleton class. I checked on Singleton when learning singleton methods.
shinnya has joined #ruby-lang
vondruch has joined #ruby-lang
<[spoiler]>
jhass, always found the word "eigenclass" weird lol
<jhass>
well, for a german it kinda makes sense ;P
<jhass>
I try to only use singleton class, since that's how core calls it now
elia has quit [Quit: Computer has gone to sleep.]
<stardiviner>
singleton class is good.
<stardiviner>
eigenclass make newbie don't know what it is.
imperator has joined #ruby-lang
<imperator>
good morning
DivineEntity has quit [Quit: leaving]
yatish27 has quit []
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
igalic has quit [Remote host closed the connection]
benlovell has quit [Quit: leaving]
heavyhorse has joined #ruby-lang
<imperator>
what's a good, automated way for users to be notified of a new release of a particular gem?
<imperator>
rss subscription via rubygems.org?
<whitequark>
gemnasium.com ? rubygems.org rss?
<imperator>
ok, thanks
toertore has joined #ruby-lang
elia has joined #ruby-lang
toretore has quit [Ping timeout: 260 seconds]
_elia has joined #ruby-lang
taiansu has joined #ruby-lang
Miphix has joined #ruby-lang
elia has quit [Ping timeout: 255 seconds]
magikfx has joined #ruby-lang
karamazov has joined #ruby-lang
dangerou_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Ping timeout: 250 seconds]
<ruby-lang787>
.text[0] is not possible i think, gives an error that not method is defined
source47 has joined #ruby-lang
<source47>
hi. i was wondering if this would work in a .yml file? license_key: "<%=ENV['NEWRELIC_API_KEY']%>"
<yorickpeterse>
source47: not unless you also parse the ERB in the YAMLfile
<yorickpeterse>
* YAML file
<jhass>
ruby-lang787: do I need to make a screenshot of my terminal showing it working? :P
taiansu has quit [Ping timeout: 264 seconds]
<darix>
jhass: gist is a good enough screenshot for this ;)
<darix>
source47: you can set that field in the hash after you loaded the config
chouhoul_ has quit [Remote host closed the connection]
<ruby-lang787>
no, i am saying, i must be doing wrong..
vondruch has joined #ruby-lang
<darix>
ruby-lang787: does it say .text[0] is not defined on nil?
<ruby-lang787>
what is meant by not-set, if u are implying that <title> attribute isn't there, then no, its not that case.
<jhass>
ruby-lang787: you're iterating number of book's times over all elements
<jhass>
I already gave you working code...
<ruby-lang787>
yes. i mean i am thinking like this, for each book element , get the title and the author element
<jhass>
xml.elements.each("//book") this line doesn't change xml or xml.elements
<jhass>
it's still the same inside the block
<jhass>
so calling it again will give you all elements, not just books
<jhass>
which you then sort
<jhass>
and some of these elements don't have a child element title
<jhass>
so you get nil
<jhass>
and I still don't get why you think you need to modify working code...
torrieri_ has quit [Quit: Leaving...]
<ruby-lang787>
so |book| book == xml.elements?
<jhass>
what? no
<ruby-lang787>
ino , "{}" this part i didnot understand
<ruby-lang787>
*no not ino
<ruby-lang787>
sorry ignore the last messages
<jhass>
xml.get_elements("//book").sort_by {|book| book.elements["title"].text[0] }.map {|book| "#{book.elements["title"].text} - by #{book.elements["author"].text}" } will return you an array of the strings you want in the order you want
<jhass>
{|foo| } is the same as do |foo| end
<ruby-lang787>
i undersatnd that , but "it's still the same inside the block" i don't get
<ruby-lang787>
no ok i get it
<ruby-lang787>
xml is same inside and outside the block
fullybaked has quit []
alexju has quit [Remote host closed the connection]
miqui has joined #ruby-lang
<ruby-lang787>
oh now i understand
<ruby-lang787>
so sort first returns an array which is mapped to another array, with that text bookname by- author . so i store it in an array , and do a simple .each
malconis has joined #ruby-lang
InfraRuby has joined #ruby-lang
<jhass>
for example, you can save the map if all you do with it is an each in the method
dangerou_ has joined #ruby-lang
<ruby-lang787>
yes i did that. :)
<ruby-lang787>
thanks for bearing up with me, i am slow at understanding things..
<ruby-lang787>
bye
kaiwren has quit [Quit: kaiwren]
taiansu has joined #ruby-lang
Guest23152 is now known as `micro
fullybaked has joined #ruby-lang
ruby-lang787 has quit [Ping timeout: 246 seconds]
diegoviola has joined #ruby-lang
hellangel7 has joined #ruby-lang
InfraRuby has left #ruby-lang [#ruby-lang]
frank_o has joined #ruby-lang
torrieri has joined #ruby-lang
ta has quit [Remote host closed the connection]
torrieri has quit [Read error: Connection reset by peer]
torrieri_ has joined #ruby-lang
benlovell has joined #ruby-lang
qba73 has quit []
hellangel7 has quit [Remote host closed the connection]
taiansu has quit [Ping timeout: 245 seconds]
hellangel7 has joined #ruby-lang
[spoiler] has quit [Quit: Leaving]
spastorino has joined #ruby-lang
hellangel7 has quit [Remote host closed the connection]
dangerou_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dangerousdave has joined #ruby-lang
momomomomo has joined #ruby-lang
thomasxie has joined #ruby-lang
dangerousdave has quit [Client Quit]
thomasxie has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
charliesome has joined #ruby-lang
shinnya has quit [Ping timeout: 272 seconds]
loincloth has joined #ruby-lang
sharpmachine has joined #ruby-lang
chouhoulis has joined #ruby-lang
maximeshr has quit [Quit: Lost terminal]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sharpmachine has quit [Ping timeout: 240 seconds]
jds has joined #ruby-lang
ledestin_ has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
frank_o has quit [Ping timeout: 272 seconds]
btiefert has quit [Read error: Connection reset by peer]
ledestin has quit [Ping timeout: 250 seconds]
ledestin_ is now known as ledestin
taiansu has joined #ruby-lang
agrinb has joined #ruby-lang
imperator has quit [Quit: Valete!]
ldnunes has joined #ruby-lang
nathanstitt has joined #ruby-lang
yatish27 has joined #ruby-lang
momomomomo has quit [Ping timeout: 250 seconds]
InfraRuby has joined #ruby-lang
dangerousdave has joined #ruby-lang
taiansu has quit [Ping timeout: 272 seconds]
jsaak has joined #ruby-lang
ohsix has quit [Read error: Connection reset by peer]
taiansu has joined #ruby-lang
diegoviola has quit [Read error: Connection reset by peer]
diegovio1 has joined #ruby-lang
james has joined #ruby-lang
james is now known as jamesfordummies
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegovio1 is now known as diegoviola
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
cmhobbs has joined #ruby-lang
davispuh has joined #ruby-lang
toertore has quit [Quit: Leaving]
toretore has joined #ruby-lang
alexju has joined #ruby-lang
dangerousdave has quit [Ping timeout: 255 seconds]
goatish_mound is now known as rsl
djdeaf has joined #ruby-lang
source47 has quit [Ping timeout: 246 seconds]
<djdeaf>
Hi Buddies, Any good source for implementing Youtube APIs using Ruby Code? I've looked over the google documentation but still having difficulties with getting started.
<djdeaf>
It is way more complexed than I had in mind. I'm looking for the basics of getting started with the API. For example - how to access Youtube API and get a list of all popular videos. simople
<jamesfordummies>
so you just want the youtube API docs?
mistym has joined #ruby-lang
<djdeaf>
No, I went over them. But I cant seem to understand how to start working with it
<djdeaf>
I wanna build a ruby (not rails) program that access Youtube with my DeveloperKey and use the API
<jamesfordummies>
djdeaf: what didnt you understand?
<djdeaf>
The initial configuration.
<djdeaf>
I'm talking about the basics and every example I see has too much complications
<jamesfordummies>
the configuration will probably necessary no matter what
<djdeaf>
Configuratin => how to set up the call for the api
karamazov has quit [Remote host closed the connection]
momomomomo has joined #ruby-lang
<jamesfordummies>
what do you mean by set up the call? the auth setup?
sharpmachine has joined #ruby-lang
taiansu has quit [Remote host closed the connection]
gpg_ has joined #ruby-lang
<gpg_>
1+1==2 ? puts "true": puts "false"
<gpg_>
whats wrong with this
mistym has quit [Remote host closed the connection]
RobertBirnie has joined #ruby-lang
agrinb has quit [Remote host closed the connection]
<gpg_>
hello
<canton7>
it's not normally what you use a ternary operator for, but it should work
danijoo has quit [Read error: Connection reset by peer]
<jhass>
I guess "true : puts "false" is parsed as an argument to puts
<canton7>
you'd normally return a value from it, and puts the value - i.e. puts 1 + 1 == 2 ? "true" : "false"
sharpmachine has quit [Remote host closed the connection]
anjen has joined #ruby-lang
solars has quit [Ping timeout: 240 seconds]
mistym has joined #ruby-lang
vladgh has joined #ruby-lang
vladgh has quit [Client Quit]
<anjen>
Hi all, I'm trying to debug a lib function that works with directory entries (ie, /lib/somename.rb), on my eww!Windows development system and have not figured out how to access the RAILS_ENV so I can easily switch between behavior for the local windows box and that of the linux server. Right now, I have to comment out "local" lines when deploying to staging, then once back swap the commenting from the local to linux-oriente
<anjen>
d lines. Anyone have a simple solution (aside from "dump windows")?
<anjen>
oops, sorry for long winded post
jamesfordummies has quit [Ping timeout: 240 seconds]
michaeldeol has joined #ruby-lang
alexju has quit [Remote host closed the connection]
agrinb_ has joined #ruby-lang
qba73 has joined #ruby-lang
agrinb has quit [Ping timeout: 245 seconds]
skade has quit [Quit: Computer has gone to sleep.]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vondruch has quit [Ping timeout: 272 seconds]
<anjen>
Oh well, thanks anyway.
anjen has quit [Quit: anjen]
vladgh has joined #ruby-lang
lcdhoffman has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has joined #ruby-lang
vladgh has quit [Remote host closed the connection]
sharpmachine has quit [Remote host closed the connection]
<NemesisD>
ah ok
<jhass>
nowadays just ignore it
<NemesisD>
a misquoted string actually caused a date to be ignored
tbuehlmann has quit [Remote host closed the connection]
<yxhuvud>
it was the way to do it before 1.9 came around and changed string indexing.
<NemesisD>
where("created on" > ?", 1.month.ago), queried for where(true, 1.month.ago), which was ignored
<jhass>
lol
alexju has joined #ruby-lang
magikfx has quit [Quit: Computer has gone to sleep.]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
wallerdev has joined #ruby-lang
seamon has quit [Quit: Zzzzzzz]
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vintik has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
djbkd has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
michaeldeol has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
vintik has quit [Ping timeout: 240 seconds]
karamazov has quit [Remote host closed the connection]
arBmind has joined #ruby-lang
alexju has quit [Ping timeout: 244 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
yfeldblum has quit [Ping timeout: 240 seconds]
taiansu has quit [Quit: Leaving...]
anildigital is now known as zz_anildigital
alexju has joined #ruby-lang
mykoweb has joined #ruby-lang
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
davispuh has quit [Ping timeout: 245 seconds]
lcdhoffman has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
mistym has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
alexju_ has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
alexju has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby-lang
vintik has joined #ruby-lang
sharpmachine has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
lcdhoffman has joined #ruby-lang
alexju_ has quit [Read error: Connection reset by peer]
alexju has joined #ruby-lang
jamesfordummies has quit [Remote host closed the connection]
eeezkil has quit [Read error: No route to host]
jbardin has quit [Quit: jbardin]
ta_ has joined #ruby-lang
alexju has quit [Ping timeout: 264 seconds]
alexju has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
ta has quit [Ping timeout: 240 seconds]
CaptainJet has quit [Ping timeout: 240 seconds]
lcdhoffman has joined #ruby-lang
alexju_ has joined #ruby-lang
vintik has quit [Remote host closed the connection]
RobertBirnie has quit [Ping timeout: 240 seconds]
lcdhoffman has quit [Client Quit]
mistym has joined #ruby-lang
alexju has quit [Ping timeout: 245 seconds]
CaptainJet has joined #ruby-lang
seamon has joined #ruby-lang
_ht has quit [Read error: Connection reset by peer]
face has joined #ruby-lang
vintik has joined #ruby-lang
djdeaf has joined #ruby-lang
faces has quit [Ping timeout: 255 seconds]
RobertBirnie has joined #ruby-lang
workmad3 has joined #ruby-lang
hellangel7 has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
symm- has quit [Ping timeout: 245 seconds]
symm- has joined #ruby-lang
centrx has joined #ruby-lang
momomomomo has joined #ruby-lang
MichD is now known as michd
djdeaf has quit [Quit: djdeaf]
sepp2k has quit [Read error: Connection reset by peer]
omosoj has quit [Ping timeout: 264 seconds]
jbardin has joined #ruby-lang
toastyne_ has joined #ruby-lang
maximeshr has quit [Ping timeout: 260 seconds]
chouhoul_ has quit [Remote host closed the connection]
frank_o has joined #ruby-lang
chouhoulis has joined #ruby-lang
toastynerd has quit [Ping timeout: 244 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<frank_o>
Hello! I'm trying to parse this API using Hashie so I can do `hash.deep_fetch :product_image, :url` instead of `hash['productImage']['url']` -- https://gist.github.com/frankie-loves-jesus/11058955 -- but why am I getting `Could not fetch path (product_image > url) at product_image`?
DEac- has quit [Read error: Connection reset by peer]
DEac- has joined #ruby-lang
<centrx>
frank_o, What does the hash actually look like?
<centrx>
frank_o, If it is from this JSON, the JSON keys are in camelCase, while your fetches are in snake_case
dangerousdave has joined #ruby-lang
<frank_o>
centrx: I thought the < Hashie::Trash would convert it though?
mikecmpbll has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
<centrx>
frank_o, I gather Hashie::Trash is supposed to be inherited by the object in question itself
<centrx>
frank_o, Also, for some reason your error message says "hash", but your code has "mash"
<centrx>
frank_o, In any event, they are freshly created from:
<centrx>
hashes = JSON.parse(response)
<centrx>
mashes = Hashie::Mash.new(hashes)
dangerousdave has quit [Client Quit]
ti-wali has quit [Remote host closed the connection]
<frank_o>
centrx: That error message might have been from before I renamed hash to mash
lcdhoffman has joined #ruby-lang
<frank_o>
Sorry about that
miqui has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 264 seconds]
<frank_o>
centrx: So something like `product = Product.new < Hashie::Trash`?
<centrx>
frank_o, Probably yes
<centrx>
Maybe <<
<centrx>
or extend/include
omosoj has joined #ruby-lang
<frank_o>
sounds good one sec
<frank_o>
centrx: undefined method `<<' for #<Product:0x0000000227ce58> sadly
<centrx>
frank_o, I think you can set that as a custom reader in Hashie
symm- has quit [Read error: Connection reset by peer]
<centrx>
frank_o, So if you are using ActiveSupport/Rails, it's just str.underscore
<frank_o>
centrx: previously I was using https://github.com/tcocca/rash to automatically translate firstName to first_name, maybe i should go back to that
<frank_o>
some dude however said i should look into trash instead, but if that means i actually have to include all those camel cased names in my model, id rather not
<frank_o>
hold up lemme see
alexju_ has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
<frank_o>
centrx: custom reader in Hashie? how so?
snsei has joined #ruby-lang
<centrx>
frank_o, I don't know, I just found it in the docs somewhere
centrx has quit [Quit: Mead error: Connection reset by beer]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
heftig has joined #ruby-lang
davispuh has joined #ruby-lang
emmesswhy has joined #ruby-lang
mistym_ is now known as mistym
solars has quit [Ping timeout: 250 seconds]
charliesome has joined #ruby-lang
elia has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
RobertBirnie has quit [Ping timeout: 256 seconds]
sMecKs has joined #ruby-lang
Hinkdogg has joined #ruby-lang
jamesfor_ has joined #ruby-lang
jamesfor_ has quit [Remote host closed the connection]
RobertBirnie has joined #ruby-lang
mykoweb has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
davispuh has quit [Ping timeout: 245 seconds]
hplar has joined #ruby-lang
NemesisD has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mykoweb has quit [Ping timeout: 240 seconds]
Sgeo has joined #ruby-lang
MikaAK has joined #ruby-lang
MikaAK has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 250 seconds]
Caius has quit [Ping timeout: 244 seconds]
GarethAdams has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
gnufied has joined #ruby-lang
Caius has joined #ruby-lang
GarethAdams has joined #ruby-lang
arBmind1 has joined #ruby-lang
<jbardin>
heya all, what is the current school of though around RUBY_HEAP_MIN_SLOTS, RUBY_HEAP_SLOTS_INCREMENT, RUBY_HEAP_SLOTS_GROWTH_FACTOR, RUBY_GC_MALLOC_LIMIT settings… do they apply at all to mri-ruby-1.9.3?
Mon_Ouie has quit [Ping timeout: 250 seconds]
arBmind has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
jamesfordummies has joined #ruby-lang
danijoo has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesfor_ has joined #ruby-lang
torrieri_ has quit [Quit: Leaving...]
jamesfordummies has quit [Ping timeout: 272 seconds]
toastyne_ has quit [Remote host closed the connection]
ter_464 has joined #ruby-lang
toastynerd has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
dorei has quit []
devgiant has quit [Quit: Leaving]
toastynerd has joined #ruby-lang
ssimpkin has joined #ruby-lang
heavyhorse has joined #ruby-lang
|jemc| has quit [Ping timeout: 250 seconds]
toastynerd has quit [Ping timeout: 240 seconds]
lcdhoffman has joined #ruby-lang
toastynerd has joined #ruby-lang
<Hinkdogg>
Hello everybody, I am new to coding and I am wondering if anybody has a few minutes helping me solve some code
toastynerd has quit [Remote host closed the connection]
jhass is now known as jhass|off
<zenspider>
Hinkdogg: just ask
mikecmpbll has quit [Quit: ciao.]
<Hinkdogg>
I have an array of about 25 names and I need to break this array up into groups of 4
chichou has joined #ruby-lang
<jbardin>
Enumerable#partition?
toastynerd has joined #ruby-lang
<Hinkdogg>
I am trying to use array.each_slice(4).to_a but that is about as far as I got