queston has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
reset has joined #ruby
bklane has joined #ruby
nbouscal has joined #ruby
zastern_ has quit [Remote host closed the connection]
fomatin has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
bionoid has joined #ruby
heftig has quit [Quit: Quitting]
Es0teric has joined #ruby
Es0teric has quit [Client Quit]
heftig has joined #ruby
Inside has quit [Ping timeout: 246 seconds]
arya_ has quit [Ping timeout: 248 seconds]
fridim__ has joined #ruby
nomenkun has joined #ruby
arya_ has joined #ruby
nomenkun has quit [Ping timeout: 268 seconds]
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
bradhe has quit [Remote host closed the connection]
swordsmanz has quit [Quit: swordsmanz]
bradhe has joined #ruby
lutfidemirci has joined #ruby
pootler_ has quit [Quit: leaving]
pootler has joined #ruby
devoldmx has quit [Ping timeout: 252 seconds]
generalissimo has joined #ruby
<popl>
was it weird for anyone here that < is for subclassing in ruby?
devoldmx has joined #ruby
<dominikh>
why?
GeissT has joined #ruby
zigomir_ has quit [Ping timeout: 276 seconds]
banjara has quit [Quit: Leaving.]
Emmanuel_Chanel has joined #ruby
<popl>
Are you asking why I am asking?
generalissimo has quit [Remote host closed the connection]
<dominikh>
yeah
havenwood has joined #ruby
<dominikh>
or why you'd think it would be weird for anyone
<popl>
I'm just wondering if I'm all alone.
<dominikh>
why is it weird to you?
<havenwood>
what would be weird, i'm curious?
bradhe has quit [Ping timeout: 256 seconds]
<dominikh>
havenwood: popl │ was it weird for anyone here that < is for subclassing in ruby?
marr has quit [Ping timeout: 268 seconds]
<popl>
Well, not weird in the sense that "someone picked that, how peculiar" because someone implementing a language could pick like § for the purpose (for all I care -- it's arbitrary)
vlad_starkov has quit [Read error: Connection reset by peer]
timonv has joined #ruby
vlad_starkov has joined #ruby
Columcil1e is now known as Columcille
jorge has joined #ruby
Kelet has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
<Kelet>
Hi, assuming I have a relatively simple program, not needing to be 'deployed' or anything, is there any preferred directory structure? I've just been using file.rb and then running file.rb. I see a lot of people have a lib directory, etc.
<Mon_Ouie>
A lot of Ruby stuff is distributed using gem, which has a standard project directory
predator117 has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
<Mon_Ouie>
If it's just a single file I probably wouldn't bother though
<Kelet>
No it is 3-4 files
<Kelet>
I'll take a look though
<Kelet>
It's the implementation of an algorithm which computes some geometrical stuff, and then draws an animated image using quick_magick
<Mars`>
just put them in a lib folder. Made a module and you can put the executable in bin/ which will call the library.
tomsthumb has joined #ruby
jorge has quit [Ping timeout: 240 seconds]
<Kelet>
Should my 'controller' file be in the lib folder?
<Kelet>
For example, the actual file that I run?
<Kelet>
Or should it be in the main folder?
<Kelet>
I've seen it done both ways
<Mon_Ouie>
The file you actually run is the executable, in the bin/ folder
akemrir has joined #ruby
<Mon_Ouie>
Most of the time people tend to make it very trivial, e.g. require 'myapp/cli'; MyAPP::CLI.run(ARGV)
<Mon_Ouie>
And have all the real code in lib
<Kelet>
sometimes I see a 'test' folder and sometimes I see a 'spec' folder do they serve different purposes or is it the same?
<Mon_Ouie>
They're the same, people who use libraries like RSpec sometimes call it spec rather than test
tomsthumb has quit [Client Quit]
statarb3 has joined #ruby
<Kelet>
If I have a file in bin, and then a file in lib called 'calculator.rb', can I do require_relative 'calculator.rb' from the bin file? Or do I have to do require_relative '../lib/calculator.rb'
ntus1017 has joined #ruby
<Kelet>
I see it done like the former sometimes but it's not working for me
<Kelet>
think I'm doing something wrong
<Mon_Ouie>
You don't need require_relative if you're using rubygems because it sets up your $LOAD_PATH properly
predator117 has joined #ruby
marr has quit [Ping timeout: 268 seconds]
timonv has quit [Remote host closed the connection]
statarb3 has quit [Ping timeout: 268 seconds]
viszu has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.1]
jefflyne has joined #ruby
jefflyne has quit [Max SendQ exceeded]
jefflyne has joined #ruby
marcgg has quit [Read error: No route to host]
marcgg has joined #ruby
browndawg has joined #ruby
hogeo has quit [Remote host closed the connection]
jimg has joined #ruby
Banistertab has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
kasper has quit [Remote host closed the connection]
Spami has joined #ruby
pierre1 has quit [Quit: Leaving]
hogeo has joined #ruby
zodiak has quit [Ping timeout: 248 seconds]
kraljev1 has left #ruby [#ruby]
hamed_r has joined #ruby
hogeo has quit [Remote host closed the connection]
rezzack has quit [Ping timeout: 260 seconds]
hogeo has joined #ruby
sayan has joined #ruby
jimg has quit [Remote host closed the connection]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
hamakn has joined #ruby
hogeo has quit [Remote host closed the connection]
jimg has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
scrollback has quit [Remote host closed the connection]
scrollback has joined #ruby
zastern has quit [Ping timeout: 256 seconds]
Mars` has quit [Ping timeout: 256 seconds]
KRF has quit [Quit: No Ping reply in 180 seconds.]
Mars____ has quit [Ping timeout: 276 seconds]
KRF has joined #ruby
jbpros has quit [Quit: jbpros]
Jackneill has joined #ruby
BizarreCake has joined #ruby
spider-mario has joined #ruby
itsovar has joined #ruby
atno has quit [Read error: Connection reset by peer]
agent_white has quit [Quit: leaving]
<itsovar>
class Foo; def initialize( bar ) ; @bar = bar ; end ; end
<itsovar>
Shouldn't it pretty much always be "@bar = bar.dup"? Is there a best practice?
<r0bgleeson>
itsovar: you should never mutate 'bar' thats for sure.
<r0bgleeson>
if you dont mutate it there's no need to dup.
cj3kim has quit [Remote host closed the connection]
bionoid has joined #ruby
<itsovar>
r0bgleeson: don't you think it's a trap waiting to happen when the class grows?
jimg_ has quit [Remote host closed the connection]
jorge has joined #ruby
<r0bgleeson>
itsovar: there's also the issue that, the caller might mutate the argument later on (which would mutate the internal state of Foo)
<r0bgleeson>
itsovar: i don't see it done often though
jds_ has joined #ruby
<itsovar>
r0bgleeson: yeah
jimg_ has joined #ruby
lutfidemirci has joined #ruby
adamholt_ is now known as adamholt
<itsovar>
That seems a big pitfall. I'm taking a look at Rail's source and it seems there isn't a standard guideline about that.
jorge has quit [Ping timeout: 246 seconds]
jds_ has quit [Remote host closed the connection]
<r0bgleeson>
im sure there's a counter argument
<r0bgleeson>
its common in rack middle to do a dup though, and a standard thing to do
<r0bgleeson>
middleware*
Banistertab has quit [Ping timeout: 256 seconds]
<r0bgleeson>
well, common but in a different way, you'd say dup.call(env)
<itsovar>
r0bgleeson: nice, I didn't know.
jimg_ has quit [Remote host closed the connection]
jimg_ has joined #ruby
mercwithamouth has joined #ruby
ananthakumaran has quit [Ping timeout: 256 seconds]
jefflyne has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
RORgasm has joined #ruby
ananthakumaran has joined #ruby
jimg_ has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 268 seconds]
jimg_ has joined #ruby
mneorr has joined #ruby
dotemacs has joined #ruby
RORgasm has quit [Ping timeout: 276 seconds]
eka has joined #ruby
fcoury__ has joined #ruby
bionoid has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
nikeita has joined #ruby
sayan has quit [Ping timeout: 246 seconds]
Shirakawasuna has quit [Quit: Leaving]
zmike123 has joined #ruby
emergion has joined #ruby
sprite-- has quit [Ping timeout: 250 seconds]
kasper has joined #ruby
Roa has quit [Ping timeout: 246 seconds]
k3rn3lito has quit [Ping timeout: 246 seconds]
statarb3 has quit [Remote host closed the connection]
kasper has quit [Ping timeout: 256 seconds]
sayan has joined #ruby
arya_ has quit [Ping timeout: 246 seconds]
mikewintermute has quit [Quit: mikewintermute]
cj3kim has joined #ruby
sayan has quit [Read error: Connection reset by peer]
kayloos has joined #ruby
jimg_ has quit [Remote host closed the connection]
freeayu has quit [Read error: Connection reset by peer]
arya has joined #ruby
maetthew has joined #ruby
gianlucadv has joined #ruby
relix has joined #ruby
Roa has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
k3rn3lito has joined #ruby
arya has quit [Ping timeout: 264 seconds]
yashshah has joined #ruby
nfisher has joined #ruby
Mars____ has joined #ruby
lutfidemirci has quit [Remote host closed the connection]
popl has joined #ruby
arya has joined #ruby
itsovar has quit [Quit: Page closed]
jimg has quit [Remote host closed the connection]
paissad has joined #ruby
Mars____ has quit [Ping timeout: 276 seconds]
jorge has joined #ruby
yashshah has quit [Ping timeout: 252 seconds]
jorge has quit [Ping timeout: 256 seconds]
arya has quit [Ping timeout: 256 seconds]
bionoid has joined #ruby
workmad3 has joined #ruby
dankest has joined #ruby
arya has joined #ruby
AlbireoX has joined #ruby
marcgg has quit [Read error: Connection reset by peer]
browndawg has quit [Quit: Leaving.]
kayloos has quit [Remote host closed the connection]
marcgg has joined #ruby
hamed_r has quit [Quit: Leaving]
Trynemjoel has quit [Ping timeout: 245 seconds]
jds_ has joined #ruby
m8 has joined #ruby
akashj87 has joined #ruby
wesside has quit [Ping timeout: 260 seconds]
Kar- has joined #ruby
yashshah has joined #ruby
jds_ has quit [Ping timeout: 264 seconds]
kevinykchan has quit [Quit: Computer has gone to sleep.]
tonini has joined #ruby
tonini has quit [Client Quit]
yashshah has quit [Ping timeout: 246 seconds]
akashj87 has quit [Read error: Operation timed out]
bionoid has quit [Remote host closed the connection]
tonini has joined #ruby
dankest has quit [Quit: Leaving...]
Taranis has joined #ruby
Deele has joined #ruby
jimg has joined #ruby
icecandy has quit [Remote host closed the connection]
_daniel-s__ has joined #ruby
<Kelet>
how come I implement enumerable, provide each, my collection type has <=>, i have sort but not sort!
<Kelet>
what am I missing to get sort?
<Kelet>
err
<Kelet>
sort!
sepp2k has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
daniel-s__ has quit [Ping timeout: 256 seconds]
<Mon_Ouie>
There's no automatic way of having sort! being defined
cj3kim has quit [Remote host closed the connection]
popl has quit [Quit: "People remain what they are even if their faces fall apart."]
<Mon_Ouie>
Notice it would require a way of removing and adding items to your collection, which Enumerable doesn't know about (it just knows how to iterate)
AlSquire has quit [Ping timeout: 256 seconds]
BRMatt has joined #ruby
viszu has quit [Read error: Connection reset by peer]
AlSquire has joined #ruby
jimg has quit [Ping timeout: 268 seconds]
Speck has left #ruby ["Konversation terminated!"]
zmike123 has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 268 seconds]
boblu has joined #ruby
kevinykchan has joined #ruby
io_syl has joined #ruby
jimg has joined #ruby
arya has quit [Ping timeout: 256 seconds]
viszu has joined #ruby
jimg has quit [Ping timeout: 268 seconds]
zmike123 has joined #ruby
arya has joined #ruby
marcgg has quit [Ping timeout: 256 seconds]
jorge has joined #ruby
marcgg has joined #ruby
ntus1017 has quit [Remote host closed the connection]
idank has joined #ruby
<idank>
in Python, if I call repr on a string with quotes, it escapes the quotes and wraps the result in another set of quotes, e.g. repr('"foo"') = '\'"foo"\''
<idank>
what's the equivalent in Ruby?
slash_quit is now known as slash_nick
<heftig>
inspect
<idank>
heftig: thanks
jorge has quit [Ping timeout: 256 seconds]
<heftig>
idank: depending on what you want to do with it, there's also shellescape
<idank>
inspect seems to be what I want
msuszczy has joined #ruby
Spooner has joined #ruby
tonini has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
zmike123 has quit [Ping timeout: 246 seconds]
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
bubblehead has joined #ruby
r0bgleeson has quit [Ping timeout: 264 seconds]
kofno has quit [Remote host closed the connection]
kofno has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
bubblehead has quit [Ping timeout: 264 seconds]
ChristianS has quit [Excess Flood]
ChristianS has joined #ruby
jefflyne has joined #ruby
Spami has joined #ruby
arya has quit [Ping timeout: 264 seconds]
jds_ has joined #ruby
rrva has quit [Quit: Lost terminal]
Beoran_ has joined #ruby
arya has joined #ruby
jcarouth has quit [Ping timeout: 245 seconds]
canton7 has joined #ruby
yusup has joined #ruby
yusup has quit [Client Quit]
dodosan has quit [Remote host closed the connection]
zmike123 has joined #ruby
Mon_Ouie has quit [Read error: Connection reset by peer]
Beoran__ has quit [Ping timeout: 248 seconds]
ananthakumaran has quit [Quit: Leaving.]
nikeita has quit [Ping timeout: 264 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
jcarouth has joined #ruby
apeiros has joined #ruby
nikeita has joined #ruby
niklasb has joined #ruby
PSKOSINSKI has joined #ruby
emmanuelux has joined #ruby
robustus has quit [Ping timeout: 248 seconds]
robustus has joined #ruby
arya has quit [Ping timeout: 256 seconds]
monkegjinni has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BRMatt has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
arya has joined #ruby
dawkirst has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
yoshie902a has joined #ruby
nfisher has quit [Ping timeout: 260 seconds]
redgirl has joined #ruby
Neomex has joined #ruby
ananthakumaran has joined #ruby
codecop has joined #ruby
statarb3 has joined #ruby
statarb3 has joined #ruby
nfisher has joined #ruby
_Andres has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
monkegjinni has quit [Remote host closed the connection]
justsee_ has quit [Ping timeout: 248 seconds]
roadt has quit [Ping timeout: 256 seconds]
jorge has joined #ruby
dsafsdf has joined #ruby
<dsafsdf>
what would be the best way to get everything in a sentence after a certain trigger word?
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
<dsafsdf>
would it be to split it ?
<canton7>
>> "this is a sentence"[/is\s+(.*)$/, 1]
<canton7>
apeiros's \bis\s+ is the best of the bunch
jmimi has joined #ruby
<apeiros>
hm, I think I'd actually prefer \bis\b
<apeiros>
I didn't pay attention to the rhs of 'is' in your original regex and liked your second one
Neomex has quit [Quit: Neomex]
<canton7>
The \s+ was to swallow the space after the trigger word, but yeah that fails if there's punctuation there instead...
fgo has quit [Remote host closed the connection]
viszu has quit [Quit: Leaving.]
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
Lewis has quit [Remote host closed the connection]
jmimi has quit [Ping timeout: 246 seconds]
idank has left #ruby [#ruby]
<apeiros>
canton7: hm, good point too. would depend then on what exactly "everything" means in "everything in a sentence after a certain trigger word"
yoshie902a has left #ruby [#ruby]
freeayu has joined #ruby
arya has quit []
sambao21 has quit [Quit: Computer has gone to sleep.]
jefflyne has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
jmimi has joined #ruby
nettoweb has joined #ruby
moos3 has joined #ruby
xargoon has quit [Ping timeout: 256 seconds]
xargoon has joined #ruby
lutfidemirci has joined #ruby
<dsafsdf>
im a bit confused about something. how do i check if a sentence contains a list of words (doesnt have ot be all of them) and which ones it contians
Mon_Ouie has quit [Ping timeout: 268 seconds]
<apeiros>
dsafsdf: what did you try?
<apeiros>
and what part are you confused about?
<dsafsdf>
i tried putting an array after .include?
<dsafsdf>
so sentence.include? ["word1", "word2"]
mengu has joined #ruby
<apeiros>
String#include? doesn't accept an array as argument
<apeiros>
but I guess you found that out too
<dsafsdf>
yeah
<dsafsdf>
so im not sure how to do that
<apeiros>
you can iterate over your words
<heftig>
""If you keep anything long enough, you can throw it away.".downcase.scan(/\w+/) & ["away", "keep", "you", "bananas"]
<apeiros>
and test each individual word whether it's included
<heftig>
whoops
<heftig>
"If you keep anything long enough, you can throw it away.".downcase.scan(/\w+/) & ["away", "keep", "you", "bananas"]
<heftig>
and to demonstrate,
<heftig>
>> "If you keep anything long enough, you can throw it away.".downcase.scan(/\w+/) & ["away", "keep", "you", "bananas"]
denver has quit [Remote host closed the connection]
subbyyy has joined #ruby
alx- has joined #ruby
bionoid has quit [Remote host closed the connection]
ayaz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bionoid has joined #ruby
Zolo has quit [Remote host closed the connection]
kevinykchan has quit [Quit: Computer has gone to sleep.]
jds_ has joined #ruby
samuel02 has quit [Remote host closed the connection]
bionoid has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 276 seconds]
Kruppe has joined #ruby
nikeita has quit [Quit: sleep]
wsterling has quit [Remote host closed the connection]
KhalilC has joined #ruby
jds_ has quit [Ping timeout: 246 seconds]
ayaz has joined #ruby
reindeerflotilla has joined #ruby
splittingred has joined #ruby
reindeerflotilla has quit [Client Quit]
danslo has joined #ruby
jorge has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
hogeo has joined #ruby
Peej has quit [Ping timeout: 252 seconds]
DestinyAwaits has joined #ruby
jorge has quit [Ping timeout: 256 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
threesome has joined #ruby
hogeo_ has joined #ruby
hogeo has quit [Read error: Connection reset by peer]
_Andres has joined #ruby
lkba has joined #ruby
hogeo_ has quit [Read error: Connection reset by peer]
hogeo has joined #ruby
icecandy has joined #ruby
nikeita has joined #ruby
simon__ has joined #ruby
fess has quit [Read error: Connection reset by peer]
jefflyne has joined #ruby
Zolo has joined #ruby
<simon__>
Hello. In python i can do bool(a_string), which will return false if the string is empty and true otherwise. How can I do the same thing in ruby?
fess has joined #ruby
<apeiros>
String#empty?
<apeiros>
since global functions-- in OO
sailias has joined #ruby
<simon__>
apeiros: Cool, thanks. But now imagine that the strings can be either nil or a string, how to do the same thing? I want to xor two strings, so I can validate that both strings are either set or unset.
<apeiros>
simon__: a) normalize your data, b) str && !str.empty?, c) (in rails, but easy to add to plain ruby) str.blank?
<apeiros>
note that rails' String#blank? is also true for whitespace-only strings
fridim__ has joined #ruby
<simon__>
Cheers.
kaichanvong has left #ruby [#ruby]
AlbireoX has quit [Remote host closed the connection]
kofno has joined #ruby
wallerdev has joined #ruby
freeayu has quit [Remote host closed the connection]
kofno has quit [Ping timeout: 276 seconds]
browndawg has quit [Quit: Leaving.]
teddyp1cker has joined #ruby
BizarreCake has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
alx- has quit [Quit: alx-]
arya has joined #ruby
MrZYX is now known as MrZYX|off
bionoid has joined #ruby
horrror has joined #ruby
<horrror>
What's the fastest way to append a prefix + suffix to each item in an array?
<canton7>
myarray.map{ |x| "prefix#{x}suffix" }
MrZYX|off is now known as MrZYX
nikeita has quit [Quit: bye bye]
wsterling has joined #ruby
<horrror>
canton7: thanks
<horrror>
just a small followup; is it much faster than array_to_search.each {|item| item = '"' + item '"@eng" }?
Kruppe has quit [Remote host closed the connection]
<canton7>
apart from the fact that yours won't do anything?
<MrZYX>
that simply wouldn't work
Kruppe has joined #ruby
zastern has joined #ruby
ferdev has quit [Ping timeout: 245 seconds]
ferdev_ has joined #ruby
<apeiros>
horrror: ri Benchmark
bubblehead has joined #ruby
ffio has joined #ruby
wsterling has quit [Remote host closed the connection]
<apeiros>
since the name 'tables' is already taken - any good name for reading csv/xls/xlsx files into a table datastructure and writing those files too?
zastern has quit [Ping timeout: 268 seconds]
<MrZYX>
sheets ?
<apeiros>
reminds me of beds :) ok, that's an option
<apeiros>
already taken too
bionoid has quit [Remote host closed the connection]
<MrZYX>
datasheets if you like it more explicit
<apeiros>
nice, looks similar to what I did
kasper has quit [Remote host closed the connection]
<MrZYX>
or tablesheets
jipp has joined #ruby
roadt has quit [Read error: Connection reset by peer]
<RobW_>
That's a liquid plugin. There's a bunch of instance variables, but also that attributes array.
* apeiros
assumes that RobW_ means "local variable" by saying "regular variable"
* dr_bob
assumes the same. ;-)
<RobW_>
apeiros: Most likely, thanks.
<veco>
attributes is scoped to initialize. it won't be available anywhere else in the class
<mixmix>
How can I get the minimum of an array of numbers, when the array contains NaN? [2, 0.0/0.0, 5, 1].min gives an error.
lindenle has quit [Quit: This computer has gone to sleep]
lutfidemirci has quit [Remote host closed the connection]
<dr_bob>
RobW_, you use instance variables if the data is part of the instance's state. Instance variables live longer than the method call - as opposed to local variables.
<RobW_>
veco: Thanks. Ruby != javascript. Sometimes confusing.
<apeiros>
mixmix: .select first or min_by
<RobW_>
dr_bob: Thank you.
lutfidemirci has joined #ruby
swordsmanz has joined #ruby
<RobW_>
Makes sense now.
decoponio has quit [Quit: Leaving...]
<Flobin>
hey apeiros, about my previous question (although this question might be a YAML question): what if the string to be translated has a comma in it?
sarkis has quit [Quit: leaving]
<Flobin>
does that matter? I'm using sublime text 2 and its syntax highlighting seems to indicate that it does
<apeiros>
Flobin: shouldn't matter. and yes, read YAML specs.
<Flobin>
okay thanks
<apeiros>
if it complains about a syntax error, you can try quoting
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Veejay>
Yeah it doesn't matter, I do it all the time
<apeiros>
also note that certain strings require quoting, since e.g. "No" is interpreted as boolean false in yaml.
<Hanmac>
mixmix:
bubblehead has quit [Read error: Connection reset by peer]
vigintas has quit [Remote host closed the connection]
statarb3 has quit [Quit: Leaving]
vigintas has joined #ruby
ly- has joined #ruby
tjbiddle_ has joined #ruby
lindenle has quit [Quit: This computer has gone to sleep]
goganchic has quit []
jds_ has quit [Ping timeout: 268 seconds]
tjbiddle has quit [Ping timeout: 268 seconds]
tjbiddle_ is now known as tjbiddle
dmiller has quit [Remote host closed the connection]
jds_ has joined #ruby
ntus1017 has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
arya has quit [Ping timeout: 246 seconds]
sideshowcoder has quit [Read error: Operation timed out]
arya has joined #ruby
zmike123 has quit [Read error: Operation timed out]
wsterling has joined #ruby
v0n has joined #ruby
serp` has quit [Quit: serp`]
jds_ has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 246 seconds]
sideshowcoder has joined #ruby
choobie has quit [Ping timeout: 246 seconds]
dankest has joined #ruby
marcgg_ has joined #ruby
marcgg has quit [Read error: Connection reset by peer]
cooldman224 has joined #ruby
r0bgleeson has joined #ruby
v0n has quit [Read error: Operation timed out]
rickruby has joined #ruby
IceDragon has joined #ruby
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
wsterling has quit [Remote host closed the connection]
zmike123 has joined #ruby
subbyyy has joined #ruby
choobie has joined #ruby
choobie has joined #ruby
choobie has quit [Changing host]
wargasm has quit [Ping timeout: 268 seconds]
ananthakumaran has quit [Quit: Leaving.]
ner0x has quit [Quit: Leaving]
tonini has joined #ruby
icecandy has quit [Remote host closed the connection]
mikewintermute has quit [Quit: mikewintermute]
dmiller has joined #ruby
samuel02 has joined #ruby
cooldman224 has quit [Read error: Connection reset by peer]
vikhyat has joined #ruby
cooldman224 has joined #ruby
relix has joined #ruby
relix has quit [Max SendQ exceeded]
relix has joined #ruby
kasper has quit [Remote host closed the connection]
airlok has quit [Remote host closed the connection]
dmiller has quit [Ping timeout: 276 seconds]
freerobby has quit [Quit: Leaving.]
airlok has joined #ruby
pkrnj has joined #ruby
phrozensilver has joined #ruby
relix has quit [Ping timeout: 276 seconds]
kasper has joined #ruby
ly- has quit [Remote host closed the connection]
milardovich has joined #ruby
tonini has quit [Ping timeout: 248 seconds]
vikhyat has quit [Ping timeout: 246 seconds]
jalcine has quit [Excess Flood]
wargasm has joined #ruby
nettoweb has quit [Quit: nettoweb]
icecandy has joined #ruby
sz has joined #ruby
sz is now known as sgz
lutfidemirci has joined #ruby
RORgasm has joined #ruby
vigintas has quit [Ping timeout: 246 seconds]
rickruby has quit [Remote host closed the connection]
<sgz>
Hello, I want to match a a certain pattern, eg: everything that starts with 'match' and have the lines starting with one or more spaces being included to (see: http://pastie.org/8095099 ) - how can I do that in ruby?
geoffw8_ has joined #ruby
<Mon_Ouie>
Regular expressions would probably be the solution here
<r0bgleeson>
sgz: it seems like you have a little language there, where 'match' starts an expression, 'and' continues it, & anything else stops it.
rickruby has joined #ruby
<Mon_Ouie>
I'm guessing the 'and' might just be from the example though
<r0bgleeson>
oh
generali_ has joined #ruby
RORgasm has quit [Ping timeout: 276 seconds]
<r0bgleeson>
Mon_Ouie: it even sounds like there is assignment in there though
<r0bgleeson>
"a as" "b as"
<popl>
it's alllll speculation
randym_ has joined #ruby
<sgz>
r0bgleeson: trying to do it with a regex, but unable to get the right result.
<r0bgleeson>
yeah i am probably wrong
<r0bgleeson>
but it reminded me of gherkin
<popl>
no, that wasn't what I was implying r0bgleeson
<popl>
you could very well be entirely correct!
workmad3 has joined #ruby
generalissimo has quit [Ping timeout: 256 seconds]
<Mon_Ouie>
You can easily find the match lines with /^match/, then look for the next line that doesn't start with a space with /^\S/ — all the lines in between would therefore start with a space
james__ has quit [Ping timeout: 248 seconds]
jmimi has left #ruby [#ruby]
_maes_ has quit [Read error: Connection reset by peer]
vikhyat has joined #ruby
james__ has joined #ruby
harrymoreno has joined #ruby
espinet has joined #ruby
<espinet>
is there a way to get 2 ruby modules to inherit the parent module? similar to class inheritance
<davidcelis>
espinet: use include and extend?
<sgz>
Mon_Ouie: any example somehwere? or can you paste one?
araujo has quit [Ping timeout: 246 seconds]
<r0bgleeson>
espinet: you include the module in the two other modules
<espinet>
aye, thanks
araujo has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
<popl>
sgz: there's http://rubular.com if you want to test a regular expression on the web.
<popl>
you might find that useful. :)
<sgz>
popl: that's what I'm doing right now, but stuck :)
axeman__ has joined #ruby
Kruppe has quit [Remote host closed the connection]
<popl>
sgz: Well you're being really vague so that makes it hard to help you. Is that your real data?
Godricglow has joined #ruby
airlok has quit [Remote host closed the connection]
<Mon_Ouie>
sgz: My idea is to just use /^match.*$/ and /^\S/, with String#match with an index from which to match
Kruppe has joined #ruby
axeman_ has quit [Ping timeout: 256 seconds]
Jackneill has quit [Remote host closed the connection]
Godricglow has left #ruby [#ruby]
<Mon_Ouie>
so begin = str.match(/^match.*$/, i); end = str.match(/^\S/, i + 1)
wargasm1 has joined #ruby
wargasm has quit [Read error: No route to host]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 246 seconds]
zmike123 has quit [Quit: ~]
butblack has joined #ruby
rickruby has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
eldariof has quit [Ping timeout: 246 seconds]
kyleisntwild has quit [Quit: Leaving]
<RubyPanther>
/(?:^match)|\s{2}/
<RubyPanther>
oops maybe /^(?:match|\s+)/
Hanmac has quit [Ping timeout: 260 seconds]
<r0bgleeson>
that's flawed
<r0bgleeson>
because now it will match on spaces, even if a 'match' is not nesting
marcgg_ has quit [Read error: No route to host]
marcgg has joined #ruby
<popl>
parsing with regex is hard
momomomomo has joined #ruby
jds_ has joined #ruby
mercwithamouth has joined #ruby
whowantstolivefo has joined #ruby
DenSchub has joined #ruby
<morf_>
nothing is easy
<r0bgleeson>
he has a little language from what I see, a regex is quick + works but if you look at the text it seems to have assignments & contexts (where "match
arya has quit []
dodosan has joined #ruby
<r0bgleeson>
starts a context")
r0bgleeson has quit [Quit: WeeChat 0.3.8]
arya has joined #ruby
r0bgleeson has joined #ruby
jds_ has quit [Ping timeout: 256 seconds]
<popl>
morf_: sorry. my implication was that regular expressions may not be the correct tool for this job.
mercwithamouth has quit [Ping timeout: 246 seconds]
<morf_>
do you think i really care?
<popl>
perhaps I was too subtle.
<popl>
you commented, so I thought you might.
paissad has quit [Quit: This computer has gone to sleep]
mahmoudimus has joined #ruby
<r0bgleeson>
did my last message get through?
<r0bgleeson>
about his text
<Mon_Ouie>
Last thing you said: <r0bgleeson> starts a context")
<popl>
12:45 < r0bgleeson> starts a context")
<r0bgleeson>
yeah ok thanks
paissad has joined #ruby
<RubyPanther>
yeah recursive descent is more appropriate than regex for multiline conditionals
<pontiki_>
what about using a flip-flop? will that work there?
mklappstuhl has quit [Remote host closed the connection]
airlok has joined #ruby
arya has quit [Ping timeout: 256 seconds]
<r0bgleeson>
Mon_Ouie: I hadn't even seen MatchData#end before
wsterling has quit [Ping timeout: 252 seconds]
marcgg has quit [Read error: Connection reset by peer]
marcgg has joined #ruby
denver has quit [Remote host closed the connection]
RichardBaker has joined #ruby
jalcine- has joined #ruby
jalcine- has quit [Excess Flood]
jalcine- has joined #ruby
saarinen has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
arya has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
Hanmac has joined #ruby
espinet has quit [Quit: espinet]
Thermo has joined #ruby
saarinen has quit [Quit: saarinen]
Hanmac1 has quit [Ping timeout: 264 seconds]
jbpros has joined #ruby
axeman_ has quit [Remote host closed the connection]
axeman_ has joined #ruby
JZTech101 has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
apeiros has quit [Ping timeout: 248 seconds]
nbouscal has joined #ruby
axeman_ has quit [Ping timeout: 268 seconds]
Davey has quit [Quit: Computer has gone to sleep.]
MrZYX|off is now known as MrZYX
<Veejay>
Is it a good idea (or even possible) to completely remove the STUPID system Ruby on Mac OS X?
<Veejay>
I hate even the idea of it
vlad_sta_ has joined #ruby
<Mon_Ouie>
I doubt it's a good idea, some system code might rely on it being there
<Veejay>
Thank you Mon_Ouie, will follow that piece of advice
<Veejay>
Though I do wonder why Apple would lock us up like this
<Veejay>
As long as a Ruby is installed, why should it matter?
yacks has joined #ruby
<Veejay>
(Yes, I am being capricious)
<momomomomo>
Veejay: the system ruby may be used for system things.
<Veejay>
momomomomo: I totally understand that
<Veejay>
But a Ruby is a Ruby, isn't it? Unless they rely on some older version of Ruby which features that have been deprecated since
<Mon_Ouie>
You can change your environment variable so as to use whichever ruby version you want though
<Veejay>
Which is possible
<Veejay>
Mon_Ouie: Oh I have rbenv all set up
<Veejay>
With JRuby, MRI 2.0, Rubinius and tons of other exotic Rubies
<momomomomo>
No; just like anything, version management is essential because upgrades/downgrades can change expected functionality
vlad_starkov has quit [Ping timeout: 248 seconds]
<momomomomo>
It's that simple.
ToApolytoXaos has quit [Quit: Leaving]
zz_pinage404 is now known as pinage404
blueBoxerWall has joined #ruby
brianherman has joined #ruby
blueBoxerWall has left #ruby [#ruby]
<r0bgleeson>
Veejay: that apple ship ruby is a great, and they do use ruby in their own scripts, which are 1.8 for now
<r0bgleeson>
so you cant just drop in any ruby
<r0bgleeson>
and it wouldnt make sense for them to be expected to do that, just use one version & know it works
mars__ has quit [Ping timeout: 248 seconds]
<Veejay>
r0bgleeson: Apple shipping Ruby is a great thing and all, word
<Veejay>
But come on
<Veejay>
In 2013 and with like 60 billions in the bank, they can't somehow manage to upgrade the version?
<r0bgleeson>
Veejay: you can remove the system ruby, and make 'ruby' available, 1.9 or whatever you want, there's nothing to stop you, there's no assurance it'll continue to work though
<Veejay>
Not that it matters then again, I was just wondering
<r0bgleeson>
maverick has updated to 2.0.0
<r0bgleeson>
and not updating to 1.9 is not so simple either
<r0bgleeson>
macruby was their 1.9, but it is no longer under apples care
<Veejay>
They're at 2.0?
<Veejay>
Well, awesome then
<r0bgleeson>
on maverick yeah
<Veejay>
Well done Apple
<Veejay>
I just got served
<r0bgleeson>
and i think it was the intention for macruby to be the 1.9 implementation of ruby but the developer who worked at apple moved on and no one took it up from inside apple, so i think that's why the 1.9 series was missing
Dreamer3 has quit [Read error: Connection reset by peer]
<Veejay>
Well, now I know
<Veejay>
Thanks for the additional information, nice touch
<Veejay>
Awesome that they'll be shipping 2.0
danneu has joined #ruby
blackmesa has joined #ruby
sgz has quit [Quit: Page closed]
allsystemsarego has quit [Quit: Leaving]
jimg has joined #ruby
pipework has joined #ruby
<pontiki_>
so, no, flip-flop won't work in sgz's case
Davey has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
<sgz> Hello, I want to match a a certain pattern, eg: everything that starts with 'match' and have the lines starting with one or more spaces being included to
Al__ has quit [Client Quit]
RobW_ has quit [Quit: RobW_]
<blast_hardcheese>
Coming from a Python background here, please pardon my ignorance; I'm trying to use some software available via gem, but I am completely lost.
RobW_ has joined #ruby
PSKOSINSKI has quit [Remote host closed the connection]
<blast_hardcheese>
I'm attempting to use gem in a standalone way in my own home directory,
<pontiki_>
which gem
<blast_hardcheese>
with its own version of ruby, independant of the system Ruby
<pontiki_>
blast_hardcheese: do you know about rbenv or rvm?
PSKOSINSKI has joined #ruby
<blast_hardcheese>
pontiki_: It should work with anything, right? The program I'm trying to use is called "cocoapods"
Deele has quit [Ping timeout: 240 seconds]
<popl>
blast_hardcheese: are you the same blasthardcheese from #bash?
<blast_hardcheese>
pontiki_: I have heard of rvm, but the last time I tried to use it didn't go too well.
<pontiki_>
heh, that happens
<pontiki_>
which OS do you run?
<popl>
I was advised that rvm is very spaghetti and to avoid it.
<blast_hardcheese>
popl: No, he started using my nick a couple years ago, unfortunately.
acook8103 has joined #ruby
<blast_hardcheese>
pontiki_: Typically I run Debian, but I'm starting to do more iPhone development again, so I'm back on the Mac.
wargasm has joined #ruby
<pontiki_>
it's funny, cause when i started, everyone said "USE RVM!! ALL THE RVM"
<pontiki_>
there's also chruby
<blast_hardcheese>
I'm really hoping for something like Python's virtualenv, which uses shell goodness to point all relevant environment vars at the right places, only when you need it though.
Myk267 has quit [Remote host closed the connection]
<pontiki_>
that would be rvm :/
<blast_hardcheese>
oh dear.
Liothen has quit [Remote host closed the connection]
<blast_hardcheese>
What's the difference between rvm and chruby then?
<pontiki_>
chruby is dead stupid
<pontiki_>
you call it to change the ruby version
<blast_hardcheese>
Oh, it just swaps the symlinks.
<pontiki_>
nothing automatic, nothing remembered from login to login
<blast_hardcheese>
Seems dangerous, switching the system Ruby version.
horofox_ has joined #ruby
<pontiki_>
it's not
<pontiki_>
it does run that early
<pontiki_>
you run it in your term
<blast_hardcheese>
Oh, that sounds like exactly what I want then
<pontiki_>
but then -- if you have apps that launch from launchd, they only get system ruby
<pontiki_>
so like say you're using subl or tm, the ruby they will run to do stuff is the system ruby
<blast_hardcheese>
Fortunately I don't have any launchd needs for ruby
<blast_hardcheese>
just in my shell.
<pontiki_>
that means you can't run rake from them either
<pontiki_>
and have it use the same ruby
<blast_hardcheese>
sorry, from what?
<popl>
rake is the ruby build systm
<pontiki_>
from an editor like Sublime Text 2 or TextMate
<popl>
*system
<blast_hardcheese>
Fortunately I do not do such things
<blast_hardcheese>
I seriously only need it for the terminal :)
RORgasm has joined #ruby
<popl>
if you have ruby installed you have rake installed and should be able to read the man page
<pontiki_>
good enough then
<popl>
I haven't learned about it really.
nettoweb has joined #ruby
<pontiki_>
you could stick a line in your .bash_profile to run it if you always want that particular version when you log in
<pontiki_>
there's pro and con to that, of course
<blast_hardcheese>
right
<blast_hardcheese>
I've got that kind of stuff set up for other things
mikewintermute has joined #ruby
<pontiki_>
anywho, chruby can be gotten from homebrew on the mac
<blast_hardcheese>
Oh, sweet, chruby is available for homebrew
<pontiki_>
^^ :>
samuel02 has quit [Remote host closed the connection]
dodosan has quit [Remote host closed the connection]
RORgasm has quit [Ping timeout: 276 seconds]
<blast_hardcheese>
This might actually be good
Zolo has quit [Remote host closed the connection]
Spami has joined #ruby
Spami has joined #ruby
TheDick has joined #ruby
Zolo has joined #ruby
ntus1017 has quit [Remote host closed the connection]
wmoxam has joined #ruby
generali_ has quit [Remote host closed the connection]
RORgasm has joined #ruby
airlok has quit [Remote host closed the connection]
Davey has joined #ruby
Zolo has quit [Ping timeout: 276 seconds]
Davey has quit [Client Quit]
tylersmith has joined #ruby
osvico has joined #ruby
swordsmanz_ has joined #ruby
swordsmanz has quit [Ping timeout: 260 seconds]
swordsmanz_ is now known as swordsmanz
RORgasm has quit [Ping timeout: 268 seconds]
phrozensilver has joined #ruby
marr has joined #ruby
nettoweb has quit [Quit: nettoweb]
erry is now known as zombierry
dmiller has joined #ruby
generalissimo has joined #ruby
Astralum has quit [Ping timeout: 256 seconds]
IceDragon has quit [Ping timeout: 268 seconds]
hadees has joined #ruby
ttyr3 has joined #ruby
kidoz has joined #ruby
_e_ has joined #ruby
Mars` has joined #ruby
aqil has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
icecandy has quit [Remote host closed the connection]
rehat has quit [Remote host closed the connection]
lindenle has joined #ruby
_e_ has quit [Client Quit]
Astralum has joined #ruby
icecandy has joined #ruby
mars__ has joined #ruby
daniel_hinojosa has joined #ruby
kirun has quit [Quit: Client exiting]
icecandy has quit [Remote host closed the connection]
postmodern has joined #ruby
havenwood has joined #ruby
ttyr3 has quit [Quit: leaving]
kidoz has quit [Quit: Ухожу я от вас]
<blast_hardcheese>
It worked!
<blast_hardcheese>
This is great!
<blast_hardcheese>
pontiki_: Thanks a bunch
wmoxam has quit [Ping timeout: 260 seconds]
spider-mario has quit [Read error: Connection reset by peer]
codezombie has quit [Ping timeout: 248 seconds]
IceDragon has joined #ruby
JZTech101 has joined #ruby
Inside has joined #ruby
<Inside>
heyo
<Inside>
is there a gem for printing debug info to console?
<apeiros_>
Inside: like Kernel#puts, #p, #pp?
<Inside>
I guess I'm looking for something like debug_print(:some_section_name, stuff to pring here)
<Inside>
and then at the start of the program you specify it the sections to print debug info from.. this way I'm not always putting puts everywhere and then sticking a # in front ;D
<Inside>
Or.. something more fancy than that, I guess.
kasper has quit [Remote host closed the connection]
jefflyne has joined #ruby
kasper has joined #ruby
arya has quit [Ping timeout: 246 seconds]
morf_ has quit [Quit: A metaphysical dichotomy has caused this unit to overload and shut down.]