nanoyak has quit [Quit: Computer has gone to sleep.]
arya_ has joined #ruby
testcore has quit [Ping timeout: 264 seconds]
marr has quit [Ping timeout: 250 seconds]
bootstrappm has quit [Ping timeout: 240 seconds]
sepp2k has quit [Ping timeout: 240 seconds]
<gzl>
hm, am I missing something? shouldn't /[^\/]\d+/ match "numbers not preceded by a forward slash"?
lmickh has quit [Remote host closed the connection]
aspires has quit []
razum2um has quit [Quit: Leaving.]
sambao21 has quit [Quit: Computer has gone to sleep.]
<centrx>
gzl, the + means 0 or 1 digit
AntelopeSalad has quit [Quit: Leaving]
testcore has joined #ruby
Kricir has joined #ruby
<gzl>
centrx: ? no, it means "1 or more digit". also, the digits aren't the problem, it's that [^\/] doesn't seem to be matching "any character except for /"
Wolland has quit [Remote host closed the connection]
Wolland has joined #ruby
larissa has joined #ruby
GriffinHeart has quit [Ping timeout: 240 seconds]
gbaway has quit [Ping timeout: 256 seconds]
ghr has quit [Ping timeout: 240 seconds]
gbaway has joined #ruby
djbkd has quit [Remote host closed the connection]
eyeamaye has quit [Quit: Leaving.]
bogeyd6 has joined #ruby
tus has joined #ruby
ebragaparah has joined #ruby
djbkd has joined #ruby
aspires has joined #ruby
gbaway has quit [Ping timeout: 240 seconds]
tkuchiki has quit [Remote host closed the connection]
mr_snowf1ake has joined #ruby
lyuzashi has joined #ruby
eyeamaye has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
sevenseacat has joined #ruby
oo_ has joined #ruby
IcyDragon has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
it_tard has quit [Ping timeout: 245 seconds]
IceDragon has quit [Ping timeout: 240 seconds]
bmurt has quit []
<benzrf>
razieliyo: it's not all that awesome
<benzrf>
razieliyo: it just seems so because you come from somewhere bad
<benzrf>
or so i assume, judging by the fact that you tried to compare 0 & nil
Photism has quit [Quit: Leaving]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<razieliyo>
benzrf, I just find it funny to have so many builtin ways to do that simple thing
namxam has joined #ruby
bruno- has joined #ruby
<benzrf>
tfw timtowtdi
<benzrf>
razieliyo: no, they all do different things
landodger has joined #ruby
<benzrf>
it's just that the different things overlap in this area
<razieliyo>
expresiveness
mehlah_ has quit [Quit: Leaving...]
britneywright has joined #ruby
landodger has quit [Client Quit]
landodger has joined #ruby
lukec has quit [Quit: lukec]
frellnet has joined #ruby
thumpba has joined #ruby
bronson has quit [Quit: bronson]
namxam has quit [Ping timeout: 264 seconds]
darkxploit has quit [Ping timeout: 240 seconds]
bruno- has quit [Ping timeout: 250 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
frellnet_ has joined #ruby
aspires has quit []
gbaway has joined #ruby
phinfone_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
phinfonet has quit [Ping timeout: 264 seconds]
timgauthier has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mostlybadfly has joined #ruby
IcyDragon is now known as IceDragon
thumpba has quit [Ping timeout: 264 seconds]
carif has joined #ruby
frellnet has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby
<centrx>
razieliyo, benzrf is a haskell heretic
kireevco has quit [Quit: Leaving.]
<razieliyo>
centrx, haha
<pontiki>
are you saying he's apostate?
<centrx>
he's definitely aprostate
centrx has quit [Quit: Mead error: Connection reset by beer]
gbaway has quit [Ping timeout: 256 seconds]
Kricir has joined #ruby
Channel6 has joined #ruby
j_mcnally has joined #ruby
<benzrf>
im not a heretic
<benzrf>
YOURE a heretic
Kricir has quit [Remote host closed the connection]
<benzrf>
with your dynamic typing and your mutable state
<AlexRussia>
where good manual about sockets in ruby?
krz has joined #ruby
<czaks>
s = TCPSocket.new("host", port)
<czaks>
and treat s as file
mikesplain has joined #ruby
nmokru has quit [Quit: nmokru]
<AlexRussia>
ok
<czaks>
srv = TCPServer.new("::", port)
<czaks>
while s = srv.accept
<czaks>
and treat here s as file
<czaks>
end
<czaks>
good night
<AlexRussia>
g8
helpa has joined #ruby
helpa has quit [Remote host closed the connection]
wallerdev has joined #ruby
helpa has joined #ruby
lukec has joined #ruby
binaryhat has quit [Quit: Leaving]
bato has joined #ruby
bogeyd6 has quit [Quit: Leaving]
mikepack has quit [Remote host closed the connection]
bogeyd6 has joined #ruby
binaryhat has joined #ruby
peret has quit [Ping timeout: 250 seconds]
andrewjanssen has quit [Quit: Leaving...]
cesare has quit [Ping timeout: 264 seconds]
jfran has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
Rylee has quit [Ping timeout: 250 seconds]
yeticry_ has quit [Quit: leaving]
djbkd has quit [Remote host closed the connection]
eyeamaye has quit [Quit: Leaving.]
Nilium has quit [Ping timeout: 264 seconds]
robustus has quit [Ping timeout: 250 seconds]
deric_skibotn has quit [Ping timeout: 272 seconds]
Rylee has joined #ruby
lucianosousa has joined #ruby
robustus has joined #ruby
krz has quit [Quit: WeeChat 0.4.3]
Rylee has quit [Remote host closed the connection]
sputnik1_ has joined #ruby
Nilium has joined #ruby
michaelchum has quit [Quit: Connection closed for inactivity]
chipotle has quit [Quit: cya]
Rylee has joined #ruby
sputnik1_ has quit [Client Quit]
sputnik1_ has joined #ruby
ziyadb has quit [Quit: Connection closed for inactivity]
ghr has joined #ruby
SilkFox_ has quit [Ping timeout: 240 seconds]
ebragaparah has quit [Remote host closed the connection]
sputnik1_ has quit [Remote host closed the connection]
lukec has quit [Quit: lukec]
lw has quit [Quit: s]
sputnik1_ has joined #ruby
eyeamaye has joined #ruby
hgl has joined #ruby
Wolland has quit [Remote host closed the connection]
ghr has quit [Ping timeout: 264 seconds]
pu22l3r has joined #ruby
Kricir has joined #ruby
snath has joined #ruby
dvbbot has joined #ruby
vindictive27 has joined #ruby
edgarjs_afk is now known as edgarjs
hamakn_ has quit [Remote host closed the connection]
troyready has quit [Ping timeout: 245 seconds]
jmbrown412 has joined #ruby
dda has joined #ruby
dvbbot has quit [Ping timeout: 264 seconds]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Fire-Dragon-DoL has quit [Quit: Leaving.]
bricker`work has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
Hanmac has joined #ruby
sailias has quit [Ping timeout: 240 seconds]
dc has joined #ruby
SilkFox_ has joined #ruby
hadees has joined #ruby
mmoretti has joined #ruby
dvbbot has joined #ruby
Hanmac1 has quit [Ping timeout: 264 seconds]
saarinen has quit [Quit: saarinen]
njs126 has quit [Quit: Leaving]
mmoretti has quit [Client Quit]
bmurt has joined #ruby
Kricir has quit [Ping timeout: 240 seconds]
namxam has joined #ruby
hgl has quit [Read error: Connection reset by peer]
braincra- has joined #ruby
hgl has joined #ruby
ziyadb has joined #ruby
tokik has joined #ruby
kireevco has joined #ruby
mikesplain has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SilkFox_ has quit [Ping timeout: 240 seconds]
eyeamaye has quit [Quit: Leaving.]
braincrash has quit [Ping timeout: 272 seconds]
codeurge has quit [Quit: Sleep.]
amacou has joined #ruby
eyeamaye has joined #ruby
pu22l3r has quit [Read error: Connection reset by peer]
chipotle has joined #ruby
thumpba has joined #ruby
hgl has quit [Client Quit]
namxam has quit [Ping timeout: 240 seconds]
pu22l3r has joined #ruby
awc737 has joined #ruby
awc737 has quit [Max SendQ exceeded]
awc737 has joined #ruby
yetanotherdave has quit [Ping timeout: 264 seconds]
Steve49 has joined #ruby
amacou has quit [Ping timeout: 250 seconds]
mikepack has joined #ruby
Steve49 has quit [Client Quit]
hamakn has joined #ruby
lw has joined #ruby
hgl has joined #ruby
hgl has quit [Remote host closed the connection]
lw has quit [Max SendQ exceeded]
hgl has joined #ruby
peret has joined #ruby
lw has joined #ruby
hadees has quit [Quit: hadees]
yeticry has joined #ruby
pu22l3r has quit [Remote host closed the connection]
saarinen has joined #ruby
ehlovader has quit [Ping timeout: 240 seconds]
fabrice31 has joined #ruby
sputnik1_ has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
sputnik1_ has joined #ruby
hadees has joined #ruby
sputnik1_ has quit [Client Quit]
hadees has quit [Client Quit]
ehlovader has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
NinoScript has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
dc has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 245 seconds]
dc has joined #ruby
brianstorti has joined #ruby
advorak has joined #ruby
tkuchiki_ has joined #ruby
kireevco has quit [Quit: Leaving.]
arnellebalane has joined #ruby
peret has quit [Ping timeout: 256 seconds]
<agent_white>
AlexRussia: Check out the Ruby docs. They actually have as good of examples as any site.
Pharaoh2 has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
<advorak>
I'm piping output from a program ('umessage') to a ruby script ('udata.rb') ... The problem is that my program doesn't seem to be receiving all of the output I expect it to receive from umessage STDOUT to udata.rb STDIN ... It's consistently skipping data ... any hints as to what I'm doing wrong? https://gist.github.com/advorak/38647fa0752399beaf64
<advorak>
Am I expecting STDIN to buffer when it is not? Do I not understand how STDIN works?
<sevenseacat>
dunno why it says 0 times, thats a bit odd
Poky has joined #ruby
dawkirst has quit [Remote host closed the connection]
whyy has quit [Remote host closed the connection]
jdj_dk has quit [Remote host closed the connection]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
whyy has joined #ruby
fabrice31_ has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
naw has joined #ruby
<puppeh>
rspec-rails
parzo has quit [Ping timeout: 256 seconds]
naw has quit [Read error: Connection reset by peer]
parzo has joined #ruby
klaut has quit [Remote host closed the connection]
naw has joined #ruby
Lewix has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 256 seconds]
kalusn has joined #ruby
yacks has quit [Ping timeout: 240 seconds]
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
dingus_khan has joined #ruby
mehlah has joined #ruby
sdouglas has joined #ruby
banister has joined #ruby
naw has joined #ruby
whyy has quit [Ping timeout: 240 seconds]
naw has quit [Read error: Connection reset by peer]
dawkirst has joined #ruby
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
gaussblurinc1 has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
naw_ has joined #ruby
naw_ has quit [Read error: Connection reset by peer]
naw has quit [Read error: Connection reset by peer]
Asher1 is now known as Guest99020
naw has joined #ruby
LiohAu has joined #ruby
yfeldblu_ has joined #ruby
naw has quit [Read error: Connection reset by peer]
overmacht has joined #ruby
banister has quit [Ping timeout: 240 seconds]
overmacht has quit [Max SendQ exceeded]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
whyy has joined #ruby
arup_r has joined #ruby
sdouglas has quit [Ping timeout: 264 seconds]
Gooder has quit [Read error: Connection reset by peer]
naw has joined #ruby
sk87 has joined #ruby
berdish has joined #ruby
naw has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
cobakobodob has joined #ruby
naw has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Ping timeout: 240 seconds]
yfeldblu_ has quit [Remote host closed the connection]
naw has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
naw has joined #ruby
Black-Heaven has joined #ruby
yacks has joined #ruby
naw has quit [Read error: Connection reset by peer]
francisfish has joined #ruby
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
ghr has joined #ruby
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
<Black-Heaven>
Hi all, I try to refactor this test (https://github.com/CanCanCommunity/cancancan/blob/develop/spec/cancan/ability_spec.rb#L49:L54) by adding a stub on the block call like this: expect(block = double).to receive(:call).with(123) / ability.can :preview, :all, nil, block / but I fail to pass the block. Have you got any idea on how to do it? thanks by advance.
naw has joined #ruby
lethjakman has joined #ruby
naw has quit [Read error: Connection reset by peer]
arnellebalane has quit [Quit: leaving]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
ndrei has joined #ruby
parzo has quit [Read error: Connection timed out]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
parzo has joined #ruby
roolo has joined #ruby
Jake232 has joined #ruby
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
dawkirst has quit [Remote host closed the connection]
chipotle has quit [Quit: cya]
naw has joined #ruby
francisfish has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
jottr has joined #ruby
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
lethjakman has quit [Ping timeout: 250 seconds]
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
gaussblurinc1 has quit [Quit: Leaving.]
naw has joined #ruby
emergion has quit [Quit: Connection closed for inactivity]
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
naw has quit [Read error: Connection reset by peer]
naw has joined #ruby
djbkd has quit [Remote host closed the connection]
alem0lars has joined #ruby
NinoScript has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
olivier_bK has joined #ruby
makeable_ has joined #ruby
cleopatra has joined #ruby
sirene has joined #ruby
sirene has quit [Client Quit]
elaptics`away is now known as elaptics
claymore has quit [Ping timeout: 250 seconds]
_tpavel has quit [Ping timeout: 256 seconds]
GreatPotato has joined #ruby
alem0lars has quit [Client Quit]
<GreatPotato>
When i try to install a ruby gem i get the following:
<hendricius>
however i always get a method not defined error. i guess the scope is the class, not the instance
AlexRussia has quit [Quit: No Ping reply in 180 seconds.]
namxam has quit [Ping timeout: 250 seconds]
grug1 has joined #ruby
axl_ has quit [Client Quit]
diptanuc has quit [Ping timeout: 240 seconds]
<Hanmac>
hendricius: your deprecate_methods must be below the real godzilla_rocks
<hendricius>
Hanmac: :D thx!
robbyoconnor has joined #ruby
<hendricius>
next question - is there a better way of wrapping the method?
<hendricius>
i want to wrap a method, do something, then call the old method
grug1 has quit [Client Quit]
ndrei has joined #ruby
AlexRussia has joined #ruby
<banisterfiend>
hendricius do it like this: old_method = instance_method(method_name); define_method(method_name) do |*args, &block|; old_method.bind(self).call(*args, &block); #code; ;end
karupa is now known as zz_karupa
razum2um has quit [Ping timeout: 240 seconds]
MCDev has quit [Ping timeout: 250 seconds]
razum2um has joined #ruby
<hendricius>
banisterfiend: awesome, seems to work
<banisterfiend>
hendricius remember, if you believe in yourself, you can do anything.
<hendricius>
banisterfiend: this will work with all methods? or will we get some issues when having other arguments?
<canton7>
shevy, "An optional "..." can be used at the end of a file (useful for signaling an end in streamed communications without closing the pipe)."
namxam_ has quit [Remote host closed the connection]
Aaaal has quit [Quit: Aaaal]
compAz has quit [Remote host closed the connection]
bogeyd6 has quit [Ping timeout: 245 seconds]
havenwood has quit [Ping timeout: 264 seconds]
DrCode has quit [Remote host closed the connection]
ldnunes has joined #ruby
DrCode has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CpuID has quit [Quit: This computer has gone to sleep]
MCDev has quit [Read error: Connection reset by peer]
matchaw has joined #ruby
MCDev has joined #ruby
nuck has quit [Ping timeout: 240 seconds]
nuck has joined #ruby
<wasamasa>
doesn't look so
matchaw_ has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
parduse has quit [Ping timeout: 240 seconds]
soahccc^ has joined #ruby
Shidash has quit [Ping timeout: 240 seconds]
whyy has quit [Remote host closed the connection]
meinside has quit [Quit: Connection closed for inactivity]
<shevy>
hehe
dangerousdave has quit [Read error: Connection reset by peer]
mijicd has quit [Remote host closed the connection]
mijicd_ has quit [Remote host closed the connection]
dangerousdave has joined #ruby
MCDev has quit [Ping timeout: 250 seconds]
soahccc has quit [Ping timeout: 250 seconds]
bigkevmcd has quit [Quit: Ex-Chat]
<Cork>
is there a performance (time, cpu, memory) difference between proc and lambda?
bigkevmcd has joined #ruby
jdj_dk has quit [Remote host closed the connection]
Aaaal has joined #ruby
<shevy>
Cork probably a tiny one
<Cork>
in what direction? :D
<shevy>
proc I would assume to be faster because it must not perform argument counting
* Cork
nods
<Cork>
thx
<shevy>
it's always like simple logic: if a method you have invokes 10 other methods, and another method invokes only 9 of the same, then it should be, all other things being equal, faster
<apeiros>
I doubt there's a measurable difference
jottr_ has joined #ruby
p0sixpscl has joined #ruby
<shevy>
[a billion runs later]
andrewjanssen has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
Takle has quit [Remote host closed the connection]
mengu has joined #ruby
AlSquire has joined #ruby
jonno11 has joined #ruby
yalue has joined #ruby
sigurding has joined #ruby
whyy has joined #ruby
arup_r has quit [Remote host closed the connection]
arup_r has joined #ruby
dingus_khan has joined #ruby
namxam has joined #ruby
shtirlic has joined #ruby
namxam_ has joined #ruby
jottr_ has quit [Ping timeout: 245 seconds]
Aaaal has quit [Quit: Aaaal]
dingus_khan has quit [Ping timeout: 240 seconds]
LadyRainicorn has quit [Read error: Connection reset by peer]
namxam has quit [Ping timeout: 240 seconds]
berdish has quit [Read error: Connection reset by peer]
britneywright has joined #ruby
namxam_ has quit [Ping timeout: 245 seconds]
Sgeo has quit [Read error: Connection reset by peer]
konflikt has quit [Remote host closed the connection]
mooru has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sambao21 has quit [Quit: Computer has gone to sleep.]
tkuchiki has quit [Remote host closed the connection]
pietr0 has joined #ruby
sixxy has quit [Quit: Leaving]
pietr0 has quit [Client Quit]
pietr0 has joined #ruby
sambao21 has joined #ruby
chris123456789 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lw has quit [Read error: Connection reset by peer]
lw has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
{xenomorph} is now known as xenomorph
mikecmpbll has quit [Ping timeout: 245 seconds]
klaut has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
mikecmpbll has joined #ruby
timonv_ has quit [Remote host closed the connection]
amacou has quit [Remote host closed the connection]
timonv_ has joined #ruby
Takle has quit [Remote host closed the connection]
sigurding has quit [Quit: sigurding]
codabrink has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baroquebobcat has joined #ruby
theharshest has joined #ruby
renderful has quit [Remote host closed the connection]
bricker`work has joined #ruby
lukec has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
wallerdev has joined #ruby
maletor has joined #ruby
<jwing>
What would be the "proper" ruby style way of organizing (class / modules / etc) if you have a set of data that should be accessible / usable by 2 separate but similar method groups. I have though of Class A; DATADEFINED; Class B; METHODS; end; Class C; METHODS; end; end
St_Marx has quit [Quit: Ex-Chat]
<jwing>
but.. that means external access to the B & C methods must be done via an accessor the embedded B, C objects.
workmad3 has quit [Ping timeout: 250 seconds]
<shevy>
?
<jwing>
seems ugly
havenwood has quit [Remote host closed the connection]
rubytor has joined #ruby
<jwing>
Not to mention how Class A::B would be able to use Class A data fields.
stytown has joined #ruby
mark_locklear has joined #ruby
SilverKey has joined #ruby
<jwing>
in other words.. DATAVALUE needs to be accessed by a B:method as well as C:method (note that both are of same name)
<ccooke>
jwing: that's very difficult to parse
kaspergrubbe has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<jwing>
It's simply a set of data values and then 2 sets of methods.
codabrink has joined #ruby
<ccooke>
I *think* you're saying that you have some data in class A that you want to be usable from classes B and C
<jwing>
yes
lkba has joined #ruby
<ccooke>
and then you don't like the idea of accessing it from B and C
havenwood has joined #ruby
<jwing>
and.. you can consider that All A, B and C are related ... thus.. under one "object"
<ccooke>
which is off
<ccooke>
odd
SilkFox_ has joined #ruby
<ccooke>
it's very hard to be sure, but you seem to be edging towards a model that would be best dealt with by inheritance
<jwing>
well. I'd like the 'user' to only have to instantiate one object.. but be able to utilize all of the methods of B&C
<jwing>
but.. the problem w/ B&C is that they do share some method names
alem0lars has joined #ruby
<ccooke>
that is, you have class A which defines some data and access methods to it. Then you have class B that inherits from A, gets all of those methods and data, but can override them and apply its own
<ccooke>
oh, okay.
kiri has quit [Remote host closed the connection]
<jwing>
B & C would only need to 'read' the values of A
awc737 has joined #ruby
<ccooke>
... that sounds like a very confusing paradigm
shevy has quit [Ping timeout: 260 seconds]
St_Marx has joined #ruby
treehug88 has joined #ruby
renderful has joined #ruby
<ccooke>
So, basically, you want "object.foo" to end up either calling B#foo or C#foo depending on some hidden state?
<jwing>
in some languages.. Class A, Class A::B, Class A::C.. where when A is instantiated, you can call on A::B and A::C methods.
<jwing>
doesn't have to be hidden
<jwing>
i played w/ the idea of providing an accessor to B, C which would be instantiated when A was.
<jwing>
but..that solves access to B/C but not B/C -> A's data
alem0lars has quit [Client Quit]
olivier_bK has quit [Ping timeout: 255 seconds]
IceyEC_ is now known as IceyEC
<ccooke>
so the model that makes sense of this, I *think*, is a proxy/delegator model
<gregf_>
jwing, what you then need is a factory :/
<ccooke>
so you instantiate an instance of A which will delegate method calls to B or C based upon state
codabrink has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ccooke>
a factory is the simplest case of this, where the decision as to which set of methods you get can be made once upon instantiation of the object
namxam has joined #ruby
alex88 has quit [Quit: Leaving...]
sigurding has joined #ruby
<jwing>
how does B/C get read access to A's data?
<jwing>
A's data is global configuration info both B/C need
<ccooke>
jwing: the call goes through A, so A can pass the data in.
p0sixpscl has quit [Quit: p0sixpscl]
<ccooke>
in the factory model, that would mean A.new returns something that's the result of B.new(data_from_a)
<jwing>
true.. I could just pass it in on instantiation of the children
kopasetik has joined #ruby
<kopasetik>
what's the best way to store an api key while the rest of a project is on github?
<ccooke>
in the delegator model, every time you call a method on an instance of A, it will call B#method(data_from_a, args)
SilkFox_ has quit [Ping timeout: 272 seconds]
<jwing>
Is there a better way to do this in Ruby? I'm easily stealing concepts from what is enabled/supported in other languages.
<eam>
Hanmac: WOW
<jwing>
Ruby seems to have a different twist
Aaaal has quit [Quit: Aaaal]
SCHAAP137 has joined #ruby
mikepack has quit [Remote host closed the connection]
<ccooke>
jwing: there are some nice classes in the standard library that can help the delegator model. the factory model is very easy to implement
larissa has quit [Quit: Leaving]
<jwing>
ok. .thanks. :)
<ccooke>
jwing: but it'll look a lot like those models in other languages
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ccooke>
I still can't tell which one would work for you best, though
namxam has quit [Ping timeout: 250 seconds]
jlovick has joined #ruby
deric_skibotn has joined #ruby
<jwing>
I guess the main thing is that "A" doesn't know whether to use B's methodX vs C's methodX.
<jwing>
Rather, the user does
troyready has joined #ruby
<jwing>
i.e. the caller of A
<jhass>
kopasetik: define it in a .gitignore'd config file?
freerobby has joined #ruby
_2_happy has joined #ruby
<_2_happy>
hi
<ccooke>
jwing: well, A would have to know how to determine it
<ccooke>
jwing: for instance: "object.method( args, delegate_to: B)"
gaussblurinc1 has quit [Quit: Leaving.]
zorak_ has quit [Ping timeout: 240 seconds]
spyderma_ has quit [Remote host closed the connection]
carraroj has joined #ruby
<jwing>
yeah. that's why I was doing something like instantiate () b = B.new(); c = C.new(); end and def a() return a; end etc
mikepack has joined #ruby
diegoviola has joined #ruby
bigkevmcd has quit [Quit: home]
spyderman4g63 has joined #ruby
<jwing>
then.. A.b.methodX() could be accessible
<jwing>
but.. that seems pretty ugly
mikepack has quit [Remote host closed the connection]
omosoj has joined #ruby
ramfjord has joined #ruby
shevy has joined #ruby
Hanmac1 has joined #ruby
bricker`work has quit [Read error: Connection reset by peer]
<mostlybadfly>
Hola
bricker`work has joined #ruby
doodlehaus has quit []
Hanmac has quit [Ping timeout: 240 seconds]
Aaaal has joined #ruby
Zenigor has quit [Remote host closed the connection]
jottr_ has joined #ruby
Zenigor has joined #ruby
toastynerd has quit [Remote host closed the connection]
_2_happy has quit [Ping timeout: 264 seconds]
sigurding has quit [Quit: sigurding]
beneggett has joined #ruby
<kopasetik>
jhass: thanks for your answer
bradleyprice has joined #ruby
<kopasetik>
still a bit confused but better off than before
NinoScri_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tus has quit [Ping timeout: 240 seconds]
<jhass>
kopasetik: the two and a half schools are: 1) config file that isn't committed to the repo 2) reading from environment variable 3) support both
<kopasetik>
cool. what else does a config file usually contain?
gkra has joined #ruby
[Outcast] has joined #ruby
Guest99020 has quit [Quit: Leaving.]
renderful has quit [Remote host closed the connection]
gbaway has joined #ruby
rebelshrug has quit [Ping timeout: 264 seconds]
wallerdev has quit [Quit: wallerdev]
Hobogrammer has joined #ruby
bruno- has quit [Ping timeout: 264 seconds]
<jhass>
anything you want, really
konflikt has quit [Remote host closed the connection]
vadzimt has joined #ruby
Zebroid has joined #ruby
cesare has joined #ruby
wall has joined #ruby
terrell_t has joined #ruby
ghr has quit [Ping timeout: 264 seconds]
tvw has joined #ruby
<kopasetik>
jhass: cool. thanks!
GreatPotato has quit [Quit: GreatPotato]
konflikt has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
zigomir has quit [Remote host closed the connection]
jottr_ has quit [Ping timeout: 250 seconds]
freerobby has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
jkline has quit [Quit: jkline]
chrishough has joined #ruby
freerobby has joined #ruby
bruno- has joined #ruby
bradleyprice has quit [Remote host closed the connection]
konflikt has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<shevy>
I see eam is still playing around with it
<shevy>
slowly he begins to understand why && is more often used than and
<shevy>
unless one also uses ()
silentj has quit [Remote host closed the connection]
<shevy>
if foo.include?('yo') and ! bla.include?('yeah')
<eam>
the precedence issues are well understood I think, but this looks like a parser bug
p0sixpscl has joined #ruby
theharshest has quit [Quit: Leaving]
stytown has joined #ruby
<eam>
let me restate: this is a parser bug
<havenwood>
:O
<eam>
shevy: && and "and" precedence is a carryover from perl
namxam has quit [Ping timeout: 250 seconds]
<eam>
f() being syntactically different from f(()) is wrong any way you look at it
baroquebobcat has quit [Quit: baroquebobcat]
Eulipion has left #ruby [#ruby]
<shevy>
why?
bradleyprice has quit [Ping timeout: 250 seconds]
<shevy>
what is an empty ()
Shidash has quit [Quit: Leaving.]
bruno- has quit [Ping timeout: 245 seconds]
wallerdev has joined #ruby
<eam>
you can't be serious
Aaaal has quit [Quit: Aaaal]
roolo has joined #ruby
p0sixpscl has quit [Ping timeout: 250 seconds]
fabrice31 has joined #ruby
<shevy>
can you?
soulcake has joined #ruby
<eam>
shevy: you don't think this is a bug?
k0m has joined #ruby
olivier_bK has joined #ruby
<shevy>
Can't see a bug so far. Has this been reported to bugs.ruby-lang.org/projects/ruby-trunk for a definite answer?
Hanmac has joined #ruby
roolo has quit [Client Quit]
<eam>
shevy: not until I piece apart what specifically is wrong with the parser
dumdedum has quit [Quit: foo]
<eam>
I don't need to petition for an opinion to determine that this is bogus :P
<shevy>
There is probably more than one thing wrong with that parser
Hanmac1 has quit [Ping timeout: 264 seconds]
doub has joined #ruby
<eam>
yeah this thing is a beast
lukec has quit [Quit: lukec]
<eam>
I think I might just write a pre-processor to turn all ( into (( and all ) into ))
<eam>
and call it a day
fabrice31 has quit [Ping timeout: 255 seconds]
amacou has joined #ruby
chrishough has quit [Quit: chrishough]
<shevy>
hehehe
pu22l3r has quit [Ping timeout: 264 seconds]
soltysh has joined #ruby
vickleford has quit [Remote host closed the connection]
<doub>
I'm new to ruby, but I have to refactor a significant collection of scripts with a lot of redundancy. Instead of individual scripts, I'd like to write a single one that will take a name as argument and load some stuff (data and a bit of code) from the individual files. Should I rewrite my individual scripts as modules or is there a more appropriate way to load them (ideally in some kind of
<doub>
sandboxed environment)?
Notte has joined #ruby
phoo1234567 has quit [Remote host closed the connection]
nanoyak has joined #ruby
<soltysh>
hi there, I'm ruby newbie and here's the problem I'm having, I'm trying to write simple test for my web app, I've setup in http server using webrick in the setup method, but subequent calls to setup (I have a couple of those tests) fail with info Address already in use, I was wondering how can I setup the server only once per whole test class? or is there some other viable solution to this?
dawkirst has joined #ruby
amacou has quit [Ping timeout: 240 seconds]
toastynerd has joined #ruby
i_s has joined #ruby
spyderma_ has joined #ruby
<shevy>
doub are they in a common namespace
niharvey|brb is now known as niharvey
<doub>
shevy: i have a flat list of directories, with one script in each directory, all with the same name
<shevy>
ugh
<shevy>
that sounds awful
<doub>
and a main script that calls system("ruby -options path/to/myscript.rb")
<shevy>
that is indeed awful
<shevy>
what are these files doing?
olivier_bK has quit [Ping timeout: 256 seconds]
<shevy>
well honestly
baroquebobcat has joined #ruby
<shevy>
you could actually write a single file that does Dir['**/**.rb']
<shevy>
I mean
<doub>
it's a build system and they're running command line tools to package apps and drivers
<shevy>
Dir['**/**']
<shevy>
and if it is a .rb file, load it
spyderman4g63 has quit [Ping timeout: 245 seconds]
dawkirst has quit [Ping timeout: 240 seconds]
<doub>
i only need to run one of these, i just want to cut the redundancy and move all common code to one script, but still be able to "load" some specializations and parameters
<doub>
*one of these at a time
stytown has quit [Quit: stytown]
<shevy>
well a simple way is to write a base class
<shevy>
with that common code
Spami has joined #ruby
<shevy>
and have the other .rb files subclass from that
mehlah has quit [Quit: Leaving...]
<doub>
how would i load the file and instanciate the object given just the name of the subdir in a string?
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shevy>
I dont know how that .rb file looks
<shevy>
but if you have a path, you can require it right?
<shevy>
I dont even know if your .rb files are classes
gregf_ has quit [Quit: leaving]
Takle has joined #ruby
Hobogrammer has quit [Ping timeout: 255 seconds]
<doub>
i can change the way the .rb file looks like, all i need is to define a few "values" in there and read them, and a few "functions" and execute them
NinoScript_ is now known as NinoScript
<shevy>
if you can change them into a class then I would do so
gbaway has quit [Quit: I screamma, you screamma, we all screamma for ice cream!]
xcesariox has joined #ruby
elaptics is now known as elaptics`away
mercwithamouth has joined #ruby
gbaway has joined #ruby
Sou|cutter has joined #ruby
freerobby has quit [Ping timeout: 264 seconds]
gaussblurinc1 has joined #ruby
xcesariox has quit [Client Quit]
Takle has quit [Ping timeout: 256 seconds]
sputnik1_ has joined #ruby
<doub>
ok, thanks, i'll see on monday what i can do
lw has quit [Read error: Connection reset by peer]
Hobogrammer has joined #ruby
pu22l3r has joined #ruby
brandonshowers has joined #ruby
JohnFord has joined #ruby
geekbri has quit [Remote host closed the connection]
freerobby has joined #ruby
phoo1234567 has joined #ruby
phoo1234567 has quit [Max SendQ exceeded]
phoo1234567 has joined #ruby
RichardLitt has joined #ruby
renderful has joined #ruby
<RichardLitt>
Is <%= debug object %> is only rails, and what does it mean if it returns “…"?
zoosjuice has joined #ruby
chrishough has joined #ruby
kopasetik has quit [Remote host closed the connection]
frellnet has joined #ruby
lw has joined #ruby
andrewjanssen has joined #ruby
linojon_ has joined #ruby
linojon has quit [Read error: Connection reset by peer]
linojon_ is now known as linojon
gaussblurinc1 has quit [Quit: Leaving.]
diptanuc has quit [Ping timeout: 250 seconds]
grzywacz has quit [Quit: :wq]
<shevy>
RichardLitt that looks like erb code
ramfjord has quit [Ping timeout: 256 seconds]
<shevy>
RichardLitt this should be equal to a method call: debug(object)
<shevy>
you should look what object is though
<RichardLitt>
Thanks
<RichardLitt>
I don’t know the difference between erb and rb
b00stfr3ak has joined #ruby
<RichardLitt>
will look it up, good point. Might help me google better.
mordof_work has joined #ruby
<mordof_work>
http://www.ruby-doc.org/core-2.1.2/Range.html#method-i-step Was fiddling with Ranges and step just now… and the docs don't say anything about how step can be used as an array accessor point for ranges o.o is this just something weird, or is it intentional that (0..10).step[4] works?
nanoyak has quit [Quit: Computer has gone to sleep.]
SilkFox_ has joined #ruby
<jhass>
that's (0..10).step().[](4)
Asher has joined #ruby
<mordof_work>
jhass: interesting..
heftig has joined #ruby
<czaks>
NoMethodError: undefined method `[]' for #<Enumerator: 0..10:step>
yetanotherdave has quit [Ping timeout: 250 seconds]
zarul[afk] has quit [Ping timeout: 240 seconds]
<mordof_work>
czaks: what ruby version?
reset has joined #ruby
nanoyak has joined #ruby
lukec has joined #ruby
claymore has quit [Ping timeout: 240 seconds]
<mordof_work>
yeah, that got fixed in ruby 2.1.2
<mordof_work>
in 1.9.3 it works
jarto has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
arup_r has quit [Read error: Connection reset by peer]
<nobitanobi>
How do you make sure than when launching a Process.kill(9, pid), that process exist? https://gist.github.com/novito/21db2b2e6d05f00d605a - Sometimes I get `kill': No such process (Errno::ESRCH)
Aryasam has quit [Quit: Bye]
Aryasam has joined #ruby
heftig has quit [Quit: Quitting]
namxam has quit [Ping timeout: 250 seconds]
<shevy>
are you guys really faster with vim than e. g. with sublime?
bmurt has quit []
<nobitanobi>
I am shevy
heftig has joined #ruby
<jhass>
I hope you do send a regular SIGTERM first...
<jhass>
SIGKILL straight away is bad pratice
<shevy>
what if you have like a file with 2500 lines, and you wish to relocate line 115 to 255 to before the last end inside of that class nobitanobi?
geekbri has joined #ruby
jkline has joined #ruby
<nobitanobi>
shevy: that's not going to happen :)
<mozzarella>
115GY225GP
<eam>
nobitanobi: there's no way to do it
<nobitanobi>
jhass: I will look into that.
<jhass>
mozzarella: cool, where do I get in with that?
<nobitanobi>
eam: so how do you make sure that you don't leave zombie processes?
<eam>
nobitanobi: have the parent wait?
zarul has joined #ruby
<mozzarella>
shevy: you know sublime has a vintage mode, right?
<eam>
nobitanobi: killing a process has nothing to do with zombies
<nobitanobi>
eam: I have the parent waiting within a Timeout, so I guess I need to make sure it waits too if a raise
<mozzarella>
it's almost half as good as vim
<eam>
nobitanobi: if you're really worried, double-fork and let init clean it up
edgarjs_afk is now known as edgarjs
<nobitanobi>
eam: I am just concerned about the fact that if the PhantomJS process that I launch from Ruby, doesn't end within my Timeout, it will still be there running
bmurt has joined #ruby
<nobitanobi>
and I want to make sure I get rid of it.
yfeldblum has joined #ruby
<shevy>
mozzarella what is that? I was asking about vim mostly though, mind you, I am curious how vim users quickly reshuffle arbitrary chunks of data
<eam>
nobitanobi: kill -9 is fine, just ignore Errno::ESRCH
<shevy>
mozzarella it is vim that confuses me, not editors like sublime :)
bmurt has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
<mozzarella>
shevy: but sublime can act like vim if you want
geekbri has quit [Ping timeout: 250 seconds]
<shevy>
ugh
<shevy>
well actually no
<shevy>
you can't use the mouse in vim to select chunk of data right?
chipotle has joined #ruby
<shevy>
or can you with gpm
<mozzarella>
you can, but that's not optimal
<mozzarella>
115GY225GP
<nobitanobi>
eam: Thanks. Does this make sense to you? https://gist.github.com/novito/21db2b2e6d05f00d605a -- I need to spawn a PhantomJs, and make sure that if it doesn't finish within a Timeout, that process is terminated.
<shevy>
that is the vim command right?
<mozzarella>
goes to line 115, yank the line, goes to line 225, paste the line
<shevy>
nono
<nobitanobi>
shevy: you can (with gvim/mvim is fairly easy)
<jhass>
mozzarella: seriously, what's that code for?
<shevy>
it should select from 115-225 and then move to just before the last end
<mozzarella>
use visual mode if you want to yank more stuff
<nobitanobi>
shevy: what I have found most annoying with vim is searching stuff in a whole project (I love the sublime search feature)
<shevy>
haha
<mozzarella>
shevy: last end of what?
<shevy>
I usually run grep for search
eyeamaye has joined #ruby
<nobitanobi>
shevy: :)
<shevy>
mozzarella the last end of the project file in question, usually a .rb file; can have one or two last end, either a standalone class Foo; or a namespaced module Foo; class Foo
<eam>
nobitanobi: yeah that looks more or less fine
<nobitanobi>
eam: ok, more or less is fair enough :P
<nobitanobi>
I will just begin/rescue the kill of the process
CodeLicker has quit [Ping timeout: 250 seconds]
<mozzarella>
then 115GV225YG
CodeLicker has joined #ruby
<eam>
Process.kill 9, @pid rescue true # my code is littered with this
<mozzarella>
wait
<nobitanobi>
because I am guessing that if you spawn a process, and the parent exit, the child doesn't get kill automatically right?
<nobitanobi>
eam: LOVE THAT.
<shevy>
still not sure how you know where the before-last end is there
<eam>
nobitanobi: correct
SouL has quit [Read error: Connection reset by peer]
<mozzarella>
115GV225GyG
<nobitanobi>
eam: thanks
diegoviola has quit [Quit: WeeChat 0.4.3]
rtdp has quit [Ping timeout: 264 seconds]
bmurt has quit [Ping timeout: 255 seconds]
<mozzarella>
shevy: G goes to the end of the file
<nobitanobi>
what I like of vim is that every day I learn something new about it.
eyeamaye has quit [Remote host closed the connection]
<eam>
it's extremely annoying how often I have to use exception handling for normal flow control due to ruby standard library bits turning return codes into exceptions
<shevy>
right but that wend to the end of the file, which would not be equal to before-last end
<shevy>
*went
<nobitanobi>
eam: agree
<nobitanobi>
but that trick helps
<nobitanobi>
I will just make sure @pid exists
<nobitanobi>
thanks!
<shevy>
my last end is often like this:
zarul has quit [Ping timeout: 240 seconds]
<shevy>
if __FILE__ == $PROGRAM_NAME
<shevy>
Namespace::NameOfClass.new
<shevy>
end
arup_r has joined #ruby
<mozzarella>
yes, and?
bmurt has joined #ruby
<shevy>
you would have pasted at the wrong position
<mozzarella>
where do you want to paste it?
ndrei has quit [Ping timeout: 240 seconds]
<mozzarella>
the cursor ends up on the end line
relix has joined #ruby
<shevy>
mozzarella usually, I think in most files it would be 5 lines before the last end
<nobitanobi>
eam: do you like this one-liner: Process.kill(9, @pid) rescue true if @pid
<shevy>
though that number is not always correct
<sargas>
hello, when trying to install middleman after installing ruby 2.1.2 (via rbenv)
<mozzarella>
just move the cursor wherever you want to paste
<nobitanobi>
eam: wouldn't if @pid, return true if @pid is nil ?
geekbri has joined #ruby
<nobitanobi>
* return false.
Aryasam has quit [Ping timeout: 245 seconds]
namxam has joined #ruby
carraroj has quit [Ping timeout: 250 seconds]
Gonzih has joined #ruby
CodeLicker has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
<sargas>
shevy: I'll give it a try
<sargas>
shevy: Do I have to install a different version, other than ruby 2.1.2p95?
<eam>
nobitanobi: sure, I just like .nil? because ruby's "zero is true" behavior is confusing
<aep>
when you iterate over a has with each (i think it does that, its hidden for me), how do you access the key/value of what you get
<aep>
puts thething shows {a=>b}
<nobitanobi>
eam: good :)
<sargas>
shevy: Gotcha, sorry I didn't see your comment above
<shevy>
sargas I have no idea how debian works; but 1.9.1 refers to ABI, not version itself, so 2.1.2 seems wrong ABI, as it would have 2.1.0 or something
x1337807x has joined #ruby
CodeLicker has joined #ruby
davedev24_ has joined #ruby
<jhass>
aep: hash.each do |key, value|
<shevy>
sargas I think aptitude will realize which ruby version you currently use so just run the command
ctp has joined #ruby
<shevy>
sargas and keep in mind that it was the debian guys who modified your ruby; plain compile will have included mkmf
<shevy>
I call: "ue ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-3.15.6.tar.xz"
zigomir has quit [Remote host closed the connection]
gbaway has quit [Ping timeout: 264 seconds]
<shevy>
this will update a yaml file, download into a designated base directory (each program has its own subdirectory), then extract and (try to) install it
IcyDragon has joined #ruby
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hinderaker has quit [*.net *.split]
ddv has quit [*.net *.split]
Mattias has quit [*.net *.split]
kith has quit [*.net *.split]
Trynemjoel has quit [*.net *.split]
snapcase has quit [*.net *.split]
majoh has quit [*.net *.split]
j416 has quit [*.net *.split]
Mekkis has quit [*.net *.split]
matson has quit [*.net *.split]
parus has quit [*.net *.split]
Sthebig has quit [*.net *.split]
cherry_lin has quit [*.net *.split]
Mikalv has quit [*.net *.split]
ndrst has quit [*.net *.split]
ineb has quit [*.net *.split]
rtl has quit [*.net *.split]
cherry_lin has joined #ruby
charliesome has joined #ruby
parus has joined #ruby
Mikalv has joined #ruby
rtl has joined #ruby
IceDragon has quit [Ping timeout: 240 seconds]
<sargas>
shevy: yeah, along with the work, there is some learning involved too, which is great
<shevy>
it does not work 100% though, sometimes I have to add some manual work; some projects exist only as svn or git checkouts, other problems use different build systems... for GNU autoconfigure though, this approach works fairly well
kith has joined #ruby
matson has joined #ruby
ineb has joined #ruby
matson is now known as Guest5626
ndrst has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
Sthebig has joined #ruby
<sargas>
shevy: it is like you said, there many options
Georg3 has quit [Quit: Computer has gone to sleep.]
Georg3 has joined #ruby
sambao21 has joined #ruby
sambao21 has quit [Client Quit]
jkline has quit [Quit: jkline]
arrubin has joined #ruby
hmsimha has joined #ruby
sambao21 has joined #ruby
RichardLitt has quit [Quit: RichardLitt]
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
yeah
<shevy>
and interdependencies
<shevy>
like when you wish to compile statically
IcyDragon is now known as IceDragon
tacos1de has quit [Ping timeout: 264 seconds]
Notte has joined #ruby
zigomir has joined #ruby
tacos1de has joined #ruby
Georg3 has quit [Quit: Computer has gone to sleep.]
Atttwww has joined #ruby
thumpba has quit [Read error: Connection reset by peer]
brandonshowers has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zigomir has quit [Remote host closed the connection]
thumpba has joined #ruby
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
spider-mario has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
awkwords has quit [Ping timeout: 250 seconds]
<choke>
joke -- hmm i should nickname my other developer that haha ( but he's not in this channel 'cause he knows nothing about ruby -- he's a lowly php dev )
Gonzih has quit [Ping timeout: 240 seconds]
<choke>
which is why the name 'joke' would fit.. it's perfect for him...
nanoyak has joined #ruby
Wolland has joined #ruby
x1337807x has quit [Ping timeout: 250 seconds]
terrell_t has quit [Remote host closed the connection]
paulfm has quit []
adebabs has joined #ruby
nanoyak has quit [Client Quit]
Wolland has quit [Remote host closed the connection]
zoosjuice has quit [Ping timeout: 264 seconds]
Wolland has joined #ruby
soltysh has left #ruby ["WeeChat 0.4.2"]
alvaro_o has joined #ruby
fabrice31 has joined #ruby
yetanotherdave has joined #ruby
<sargas>
choke: lol
cDuff has joined #ruby
mikepack has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
brandonshowers has joined #ruby
<choke>
tell me i'm wrong? Before I started here, he hadn't ever written a single line of OOP code ( how can you be a programmer not using OOP? ).. not to mention any frameworks, PDO, or TDD... shame
<j_mcnally>
choke: u can be a functional programmer
<j_mcnally>
choke: and use Haskell or something
shtirlic has quit [Ping timeout: 240 seconds]
towbes has quit [Ping timeout: 256 seconds]
<wasamasa>
choke: well, what do you think kernel developers are
<wasamasa>
choke: not programmers?
<j_mcnally>
wasamasa: choke: or wordpress programmers
fabrice31 has quit [Ping timeout: 240 seconds]
<j_mcnally>
choke: or a really lame php / javascript programmer.
Dr3amc0d3r|away has quit [Quit: ZNC - http://znc.in]
<xybre>
A programmer writes code that runs and does what they intend. Nothing more. A software engineer structures their applications and systems in a way that makes them more robust, powerful, and maintanable. This may be OOP or something else, it may include TDD or it may include something else. A good engineer will use the strategy appropriate to the task.
<wasamasa>
oop is just a way of solving problems
<wasamasa>
there are times when it's not appropriate to use
<j_mcnally>
^ this
charliesome has quit [Ping timeout: 250 seconds]
<wasamasa>
also, oop as a term has been seriously watered down
<wasamasa>
fp, too
<j_mcnally>
also mvc
<wasamasa>
for example compare oop in ruby, js and java
bradleyprice has joined #ruby
konflikt has joined #ruby
zigomir has joined #ruby
lw has quit [Quit: s]
ctp has joined #ruby
charliesome has joined #ruby
<shevy>
ack
Shidash has joined #ruby
<shevy>
but js says it is prototypic!
Panicky has joined #ruby
pu22l3r has quit [Ping timeout: 256 seconds]
<wasamasa>
I'm not so sure about mvc, but the few bits I've seen all mean slightly different things depending on the language/framework
<wasamasa>
which is seriously confusing to me
<j_mcnally>
look at Ember MVC vs Rails MVC
maletor has quit [Quit: Computer has gone to sleep.]
<wasamasa>
^
<wasamasa>
that's the one I'm struggling with
<j_mcnally>
some would argue that ember is more MVVM
<wasamasa>
worked on an ember project first, now learning rails
<j_mcnally>
or MTVVM
amacou has joined #ruby
<j_mcnally>
but in the end most people consider it an MVC but its totally different than rails
<j_mcnally>
since "controllers" handle such little of the logic they are often viewed as View-Models
lolmaus has quit [Ping timeout: 256 seconds]
<j_mcnally>
or "Presenters"
andrewhl has joined #ruby
zigomir_ has joined #ruby
zoosjuice has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
Dr3amc0d3r|away has joined #ruby
lkba has joined #ruby
sambao21 has joined #ruby
spyderma_ has quit [Remote host closed the connection]
Shidash has quit [Quit: Leaving.]
nobitanobi has quit [Ping timeout: 255 seconds]
spyderman4g63 has joined #ruby
zigomir has quit [Ping timeout: 240 seconds]
zigomir_ has quit [Remote host closed the connection]
<arup_r>
When is the pattern useful ? did anyone use this in your code ?
<j_mcnally>
nahtnam: yeah u can for sure
centrx has joined #ruby
<shevy>
arup_r perhaps you must invoke super ?
<j_mcnally>
just clone the repo
<j_mcnally>
add Procfile with
mikepack_ has joined #ruby
<j_mcnally>
bot: [command to run]
<arup_r>
No no.. That I know. If you cal super it will call Array#new
<j_mcnally>
and then push the update repo to a heroku app
<j_mcnally>
and it should work
<arup_r>
But the point is what the use-case of this method ? shevy: Did you ever use it ?
<jhass>
arup_r: it says it returns self, not it returns self wrapped in a new array
zigomir has joined #ruby
charliesome has quit [Ping timeout: 256 seconds]
<arup_r>
There is another line below that line jhass
hadees has joined #ruby
beneggett has joined #ruby
renderful has quit [Remote host closed the connection]
<jhass>
okay, sure, but your array still has no data in it
<arup_r>
Which is a bit troublesome for me to understand the usefulness or what is the pattern ?
<hadees>
is there anyway to add an object to an array and have it return the index instead of the array
dawkirst has joined #ruby
shtirlic has quit [Client Quit]
Panicky has quit [Remote host closed the connection]
<arup_r>
hadees: You have to write your own
<jhass>
headius: however we might be able to come up with a solution to your real problem that doesn't require that method
charliesome has joined #ruby
<shevy>
arup_r I never had to subclass from Array
zigomir has quit [Remote host closed the connection]
Panicky has joined #ruby
<headius>
jhass: you mean hadees
<jhass>
headius: oh sorry, completion fail :)
mikepack has quit [Ping timeout: 256 seconds]
ebragaparah has joined #ruby
Georg3 has quit [Ping timeout: 264 seconds]
jcromartie has joined #ruby
RichardLitt has joined #ruby
<jhass>
arup_r: we have been at the "you reckon if you actually need it" point before, haven't we?
codabrink has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikepack_ has quit [Ping timeout: 255 seconds]
shtirlic has joined #ruby
<arup_r>
shevy: Yes.. Pro tips are don't do subclass of core class.. But doco is saying something.. But I am not getting the point of converting the a child object to its Parent class object in this way.. How special it is ? :(
carraroj has quit [Ping timeout: 255 seconds]
<jhass>
to_a's contract is to return an instance of Array
<jhass>
not an instance of a subclass of Array, an instance of Array itself
<jhass>
it just handled that case for you
beneggett has quit [Ping timeout: 260 seconds]
<arup_r>
jhass: it looks.. so... but still pointless or point is there I am not aware of.
dawkirst has quit [Ping timeout: 255 seconds]
jaackw has joined #ruby
<arup_r>
jhass: Wait.. In that case Kernel#Array is much consistent... It will wrap your object inside a Array and return to you..
<jhass>
Kernel#Array is a different method than #to_a
<nahtnam>
jhass: One more question. Would the procfile be `bot: web: bundle exec ruby bot.rb irc.freenode.net` or just `bot: ruby bot.rb irc.freenode.net`?
<arup_r>
But here in this case.. it will vanish the actual object.. and give a array instance ...in return
<jhass>
#to_a's contract is to return an instance of Array
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
can a monitor on linux easily be changed at runtime? or might I damage it ...
<nahtnam>
sorry, not jhass, j_mcnally
<j_mcnally>
nahtnam: the latter
<arup_r>
jhass: I agree with you..
<j_mcnally>
i think
<nahtnam>
j_mcnally: Ok.
<j_mcnally>
nahtnam: it looks like to run it on heroku ur gonna have to make a few edits to the way AR is setup
<j_mcnally>
im working on a fork right now
<j_mcnally>
ill holla at u when im done
lolmaus has joined #ruby
<nahtnam>
j_mcnally: Ok. Thanks! :)
<nahtnam>
Im kind of new to ruby
<arup_r>
But (1..2).to_a # => [1,2] similarly {1 => 2 }.to_a gives you [[1,2]] .. I am not loosing anything..
andrewhl has quit [Quit: andrewhl]
<arup_r>
But in my example as I shown top.. I am loosing my original instance...
yetanotherdave has quit [Read error: Connection reset by peer]
[Outcast] has quit [Quit: [Outcast]]
<jhass>
ylj
<jhass>
meh
<jhass>
you do loose the original instances in both of your examples
<jhass>
that you can reconstruct an identical instance doesn't matter
andrewhl has joined #ruby
<arup_r>
I am not talking about the object.. I am talking about the data...
charliesome has quit [Ping timeout: 255 seconds]
andrewhl has quit [Client Quit]
willbarrettdev has quit [Quit: Leaving]
<arup_r>
What Range object had, Array also have..
<jhass>
hash = {1 => 2}; hash.default = 0; hash.to_a # the default is lost
<arup_r>
What Hash object had, Array also have..
dda has joined #ruby
sailias has quit [Ping timeout: 240 seconds]
<shevy>
you are evil!
<arup_r>
jhass: painful ;)
beneggett has joined #ruby
jottr_ has quit [Ping timeout: 250 seconds]
charliesome has joined #ruby
sixxy has joined #ruby
amystephen has joined #ruby
shtirlic has quit [Ping timeout: 240 seconds]
etqqkoiflwhb has joined #ruby
lw has quit [Quit: s]
<etqqkoiflwhb>
anyone, can active record scopes/relation objects be serialized, so that they can be passed onto resque/sidekiq workers?
<centrx>
etqqkoiflwhb, All the steps in building a query/relation set variables, so if your serialization includes all those variables, then it should work properly.
bruno- has joined #ruby
mattmcclure has quit [Quit: Connection closed for inactivity]
jdj_dk has joined #ruby
nmokru has joined #ruby
mark_locklear has quit [Quit: Leaving]
maletor has joined #ruby
chrishough_ has joined #ruby
yeticry has quit [Ping timeout: 240 seconds]
joast has quit [Quit: Leaving.]
jkline has joined #ruby
chrishough has quit [Ping timeout: 264 seconds]
chrishough_ is now known as chrishough
konflikt has quit []
treehug88 has quit [Ping timeout: 256 seconds]
lw has joined #ruby
yeticry has joined #ruby
frankle has quit [Quit: Connection closed for inactivity]
jaackw has quit [Quit: Page closed]
<Sou|cutter>
etqqkoiflwhb: I would highly recommend sticking to serializing only basic data types (strings, numbers, arrays, hashes)
<shevy>
I want to know rails without learning rails
JohnFord has joined #ruby
<etqqkoiflwhb>
Sou|cutter: why?
agent_white has quit [Quit: leaving]
<arup_r>
jhass: had you ever used watir or selenium-webdriver ?
<jhass>
selenium only through capybara
<arup_r>
Ok.
nanoyak has joined #ruby
alem0lars has joined #ruby
<Sou|cutter>
etqqkoiflwhb: because their serialization won't change and it's easy to read
<etqqkoiflwhb>
ok
<arup_r>
Last time I discussed with you guys.. I am thinking for something how can I regularly check of anything got changed in the webpage or not?
agent_white has joined #ruby
frellnet has quit [Remote host closed the connection]
<arup_r>
There is 100% chance at any point of time the css rules or xpath may be changed
agent_white has quit [Client Quit]
joast has joined #ruby
dangerou_ has joined #ruby
<havenwood>
elves?
r0ok has quit [Quit: r0ok]
dangerousdave has quit [Read error: Connection reset by peer]
Neener54 has joined #ruby
twhittley has quit [Remote host closed the connection]
frellnet has joined #ruby
brandonshowers has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<arup_r>
What is working today. may not work tomorrow.. so what is the safest way to keep monitoring this before running the actual web bot
<Beoran_>
arup_r, send a http HEAD request, then check for tha Last-Modified header
zigomir has joined #ruby
<Beoran_>
however if you want to monitor servers, there's naigios
rdark has quit [Quit: leaving]
<arup_r>
No no..not servers.. or may be I don't know
zigomir has quit [Read error: Connection reset by peer]
twhittley has joined #ruby
<baweaver>
perl, and subsequently ruby, were made for things that were impractical in shell
toastynerd has quit [Remote host closed the connection]
<baweaver>
this is a one liner in bash, easily
zigomir has joined #ruby
shtirlic has joined #ruby
<arup_r>
jhass: changed it..
<jhass>
but in a more complex script do not shell out even for such simple stuff
omosoj has joined #ruby
<baweaver>
Indeed
<jhass>
there's FileUtils, File, Dir and IO for those purposes
<jhass>
or even shell stdlib
<baweaver>
cp file.txt new_file.txt
<arup_r>
File.open("#{__dir__}/out.txt", 'wb') do |file|
<baweaver>
done
<arup_r>
File.foreach("#{__dir__}/test.txt") do |line|
<arup_r>
end
<arup_r>
end
<arup_r>
file.puts line
shtirlic has quit [Client Quit]
Georg3 has joined #ruby
<baweaver>
still bad, why are you using Ruby for this?
toastynerd has joined #ruby
shtirlic has joined #ruby
<baweaver>
if you're copying a file, use cp
<jhass>
that's still FileUtils.copy "test.txt", "out.txt"
<arup_r>
baweaver: Me ?
<toretore>
arup_r: you should explain what it is you're doing and what the purpose of it is
<baweaver>
learn bash
<baweaver>
yes
<centrx>
Copying a file is as easy as: cp input output
<baweaver>
indeed
jxf has quit [Quit: Leaving]
<baweaver>
you're making it way too complicated.
<toretore>
seen without context, your code is ridiculous
<toretore>
i have a feeling you're just fooling around trying to learn, but you should make this clear
<arup_r>
toretore: Because ,, I am earning by doing this.. I am doing some check.. and then of it meets, then I put the line inside the out.txt...
AskSteve has quit [Ping timeout: 245 seconds]
bluOxigen has quit []
<jhass>
that check can probably be done with grep
tcstar has quit [Remote host closed the connection]
mijicd has quit [Remote host closed the connection]
<jhass>
but you didn't show that, we can only judge what you show
LiohAu has quit [Quit: LiohAu]
yalue has quit [Quit: Leaving]
<arup_r>
I am checking the line if it matches any particular sub strings or not
<jhass>
?
<baweaver>
grep -v 'check_regex' file >? new_file
<arup_r>
if it is matched,, then inserting the line onside the out.txt
<baweaver>
grep -v 'check_regex' file > new_file
<baweaver>
done
<toretore>
and you should ask better questions than "why doesn't this code work?" "how do i do <specific thing>?" is better
sputnik1_ has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
AskSteve has joined #ruby
<arup_r>
toretore: makes sense ;-)
<baweaver>
grep -v searches for the regex and returns all lines not matching
funktor has joined #ruby
AskSteve has left #ruby [#ruby]
<baweaver>
'>' outputs it to the file
<baweaver>
seriously, learn bash
moted has quit [Quit: moted]
<baweaver>
that's the type of thing it's used for
tcstar has joined #ruby
Georg3 has quit [Ping timeout: 255 seconds]
<jhass>
-P gives you full perl regexp power
tcstar has quit [Client Quit]
<toretore>
arup_r: what is it you're trying to learn?
<arup_r>
baweaver: Did you follow jhass told not to use shell..
jottr_ has joined #ruby
tcstar has joined #ruby
<baweaver>
in Ruby
<jhass>
if that is your whole task, do use shell
<baweaver>
he's saying don't shell out in Ruby
tcstar has quit [Read error: Connection reset by peer]
<baweaver>
for something like that
<jhass>
do not shell out in ruby for stuff like writing a file, copying it etc.
choke has joined #ruby
<baweaver>
but for what you're describing, you don't even need Ruby
x1337807x has joined #ruby
<baweaver>
bash / shell scripting is far faster than writing that ruby script
<arup_r>
My whole project is Ruby based..
<arup_r>
so I have to stck with ruby
jheg has joined #ruby
<toretore>
arup_r: explain more, explain better
<baweaver>
you haven't explained what you're even doing
<baweaver>
you make it seem like you want to copy and do basic filters on files. That's bash territory.
<toretore>
arup_r: you won't get good advice when you don't provide good information
andrewjanssen has quit [Ping timeout: 256 seconds]
funktor has quit [Ping timeout: 240 seconds]
decoponio has quit [Quit: Leaving...]
cek has joined #ruby
<arup_r>
toretore: I have got some CSV files... where I am searching in each line, if any particular email id is matched or not.. If it matched, then redirecting those lines to the out.txt
havenwood has quit [Remote host closed the connection]
ffranz has quit [Quit: Leaving]
danijoo has quit [Read error: Connection reset by peer]
<arup_r>
That csv file is a log file has been processed during transactions
<cek>
Is it possible to override object's comparison for conditional? if obj; end;
<jhass>
cek: no
ascarter has joined #ruby
ffranz has joined #ruby
danijoo has joined #ruby
<jhass>
cek: you can override stuff like == etc. but you can't override the truthy/falsey state of an object
<cek>
ok
<wallerdev>
hey rubyists
<wallerdev>
happy friday
mr-foobar has quit [Quit: Leaving...]
cek has left #ruby [#ruby]
<arup_r>
toretore: Am I able to clear my work, I am doing here ?
<arup_r>
to you guys
alem0lars has quit [Quit: alem0lars]
geekbri has quit []
<ramfjord>
arup_r: you should check out the CSV library for parsing csv's
shtirlic has quit [Ping timeout: 240 seconds]
klaut has joined #ruby
jkline has quit [Quit: jkline]
Gonzih has quit [Ping timeout: 255 seconds]
<ramfjord>
CSV.foreach("path/to/file.csv") do |row|
ebragaparah has quit [Remote host closed the connection]
twhittley has quit [Remote host closed the connection]
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SCommette has quit [Quit: SCommette]
mechanicalduck_ has joined #ruby
<mechanicalduck_>
hi
<mechanicalduck_>
So I can iterate over a ruby hash.
<toretore>
arup_r: divide your problem into smaller problems
<mechanicalduck_>
However, I simply want to prefix all keys in that hash with a string.
<mechanicalduck_>
And only the top level keys, nothing recursive.
<mechanicalduck_>
Is there already a nice ruby function for this?
shevy has joined #ruby
brianstorti has quit [Remote host closed the connection]
<jhass>
mechanicalduck_: no, but it's as simple as hash.map {|k, v| [prefix+k, v] }.to_h
<j_mcnally>
you can clone my fork and use the heroku branch
rubytor has joined #ruby
zoosjuice has joined #ruby
<toretore>
this is the basic and repeatable method used for every programming problem
chrishough has quit [Quit: chrishough]
<arup_r>
I have an input file.. from where I will redirect some lines to output file.. only if those lines matched my predefined regexs
funktor has joined #ruby
jrhe has quit [Quit: Connection closed for inactivity]
ylluminarious has joined #ruby
pu22l3r has quit [Read error: Connection reset by peer]
pu22l3r has joined #ruby
tvw has quit []
<toretore>
1. how do i read the lines from a file 2. how do i compare a string using a regex? 3. how do i write a line to a file?
<nahtnam>
j_mcnally: Awesome!!! I already have a clone, and im trying to create a pull request using your branch. Does this look about right? http://puu.sh/ahatZ/138a7d978c.png
<Beoran_>
arup_r, out = file.open(output_name, 'w') ; File.readlines(input_name) { |line | out << line if line =~/my_regexp/ } ; out.close
<nahtnam>
j_mcnally: Im not sure if its supposed to be like that or the other way around!
<j_mcnally>
nahtnam: sounds good
<j_mcnally>
it will tell u if u mess it up
<Beoran_>
arup_r, find the errors and it will work ;)
<j_mcnally>
you should be base, i should be head
<jhass>
Beoran_: block form of open is generally recommended
SCommette has joined #ruby
towbes has quit [Ping timeout: 260 seconds]
<Wolland>
sadly it's just one line in terminal with sed
<toretore>
and that is not relevant
<Beoran_>
Wolland, it's also 1 line in ruby really
chipotle has quit [Quit: cya]
<Beoran_>
this is not #bash here
<arup_r>
toretore: My eyes are still on you.. Go ahead! I want to see how this code can be solved in smaller parts..
<nahtnam>
j_mcnally: Thank you so much! I really appreciate this since you saved me like 2 days of figuring everything out
<toretore>
arup_r: i'm trying to make you think for yourself
<toretore>
i'm not going to just tell you how to do it
<j_mcnally>
nahtnam: no problem
jdj_dk has quit [Remote host closed the connection]
<toretore>
i'm trying to teach you how to solve problems like a programmer
anaeem1 has quit [Remote host closed the connection]
<Beoran_>
jhass, File.open(output_name, 'w') { | out | File.readlines(input_name) { |line | out << line if line =~/my_regexp/ } }
<arup_r>
toretore: Yes.. I get that
<Beoran_>
arup_r, he means, divide the problem into steps
<toretore>
the only reason i bother is because you seem like you genuinely want to learn, and you're not some cheap rent-a-coder trying to paste together something that barely works
Darkchaos has joined #ruby
<toretore>
arup_r: i told you the questions you should ask above, but you have still not asked them
troyready has quit [Remote host closed the connection]
<toretore>
it is many times more beneficial for you to learn how to solve problems in general than to learn how to solve this specific problem
moted has joined #ruby
<nahtnam>
j_mcnally: Its tips.sql useless since heroku requires pg?
<arup_r>
them means whom ? Sorry I am not getting... Please don't mind... Really wanted to learn
<j_mcnally>
nahtnam: i dont know, i dont think so, but i recommend using migration.rb to bootstrap things
<arup_r>
Your three questions is actually the correct way to describe my problem
<nahtnam>
j_mcnally: Yeah, thats what I mean. I was asking if its ok to remove tips.sql
<j_mcnally>
nahtnam: seems to be the simplest
<j_mcnally>
nahtnam: probably
<nahtnam>
kk
<nahtnam>
Thanks
<Beoran_>
arup_r, your problem has 3 steps as toretore said
<Beoran_>
so step 1 is read lines of a file
<arup_r>
read from file... match line and write to file the matched lines
<Beoran_>
how would you do that in Ruby?
<arup_r>
Okay.
<j_mcnally>
nahtnam: admittedly i don't know enough about railsbot to know for sure but i would guess so
jkline has joined #ruby
<Beoran_>
(you are allowed to check the ruby manual )
fabrice31 has joined #ruby
<centrx>
Are we still trying to figure out how to copy a file
<toretore>
no
<arup_r>
Beoran_ I would read using File::foreach or File::readlines
<Beoran_>
arup_r, what do you need to do first before you can write to a file ?
<toretore>
mechanicalduck_: learn to crawl before you try to walk
<mechanicalduck_>
so the [] thing just belongs to a function name
<mechanicalduck_>
toretore: right
<toretore>
what you're being taught here is walking
davispuh has joined #ruby
<mechanicalduck_>
:D
<Beoran_>
mechanicalduck_, well [] is just an operator method really
<arup_r>
Ohkay.. I have to open the target file in `wb` mode.
<toretore>
arup_r: make a gist with your solution
<Beoran_>
arup_r, yes, that 's right
<arup_r>
I already gave it..
<toretore>
no, you did not.
<Beoran_>
so now you have almost all elements of your solution. You can write it now.
<centrx>
mechanicalduck_, You can make methods with special characters, e.g. [] and <<, but only certain ones. That's all it is though, an otherwise ordinary method.
<toretore>
you gave us some pseudocode that did not work.
jerius has quit []
<mechanicalduck_>
"You are a worm, wanting to fly? CRAWL!"
<j_mcnally>
mechanicalduck_: maybe im a catapillar.... someday i'll fly
<mechanicalduck_>
yes
<arup_r>
mechanicalduck_: HaHaHaHa ... thanks for making me laugh on your "You are worm..."
awkwords has joined #ruby
<mechanicalduck_>
Worms like apple
* mechanicalduck_
trolls
KnownSyntax_ has quit [Ping timeout: 240 seconds]
towbes has joined #ruby
Hanmac1 has joined #ruby
<Beoran_>
arup_r, yes, well, maybe regexp should be a parameter as well, but tha tmethod looks more or less OK to me
<mechanicalduck_>
The worm thing is quoted from somewhere, don't know from where :D
failshel_ has joined #ruby
<arup_r>
Beoran_... It is under class called FilterByEmail..
<Beoran_>
arup_r, and?
<arup_r>
I hard coded those pattern inside the method..
<Beoran_>
oh, well, if it's for filtering on e-mails only it's OK I guess
Hanmac has quit [Ping timeout: 250 seconds]
evilrat has joined #ruby
SCommette has quit [Quit: SCommette]
lw has quit [Quit: s]
<Beoran_>
you could make the regexp a contant then for changibg it more easily later on if you have to but for now what you have seems ok
evilrat has quit [Client Quit]
<arup_r>
Yes.. the log files will be given as input and pattern will be fired on each line and then matched lines will be put to another file.. that's it
<Beoran_>
except maybe you should use file << line
<arup_r>
Beoran_ great idea of constant
<Beoran_>
to avoid duplicating the newlines at the end of each line
terrell_t has joined #ruby
<arup_r>
I am slapping .. on my face.....
<Beoran_>
arup_r, anything hardcoded is preferrably a constant
failshell has quit [Ping timeout: 250 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrishough has joined #ruby
amargherio has quit [Read error: Connection reset by peer]
<Beoran_>
arup_r, programming is making mistakes and accepting that all the time
chrishough has quit [Client Quit]
<arup_r>
I locked it in my baggage forever your tips
<Beoran_>
arup_r, wou're welcome. Now I'll be going , hope you keep enjoying programming
<jhass>
Beoran_: puts doesn't add a trailing newline if there already is one
failshel_ has quit [Ping timeout: 260 seconds]
<Beoran_>
jhass, its doesn't? I stand corrected then!
<arup_r>
But I am fearing when I think... why am I so late in Programming.. when I will learn and when I will be a good dev like you guys... :-(
<Beoran_>
... never knew that after all these years :p
<Beoran_>
arup_r, 10 years
<shevy>
arup_r go and write code
<Beoran_>
it always take s10 years to become great at anything
<shevy>
code
<shevy>
code
<shevy>
go on arup_r
<shevy>
Beoran_ how is your sex life
<Beoran_>
shevy, is irght
<shevy>
did you really need 10 years
<Beoran_>
shevy, what a question?
pu22l3r has quit [Remote host closed the connection]
<shevy>
you said it takes 10 years to become great at anything
<Beoran_>
ah, on that point' I never claimed greatness
<baweaver>
10000 hours is the number
terrellt has quit [Ping timeout: 255 seconds]
tesaf has quit [Quit: Lost terminal]
benlieb has joined #ruby
<shevy>
I am faster!
dingus_khan has joined #ruby
<Beoran_>
baweaver, yeah like that
<baweaver>
I just make things, I don't care about silly metrics.
bmurt has quit []
<Wolland>
being a good problem solver > being a good programmer
<Beoran_>
true, but it's indicatibve, there's no short-cut to mastery
<Beoran_>
Wolland, they go hand in hand for a programmer
<Beoran_>
enough!
Beoran_ has left #ruby ["Leaving"]
SCommette has joined #ruby
Georg3 has joined #ruby
<shevy>
real men do not program
<shevy>
they create
nanoyak has joined #ruby
brandonshowers has joined #ruby
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sambao21 has quit [Quit: Computer has gone to sleep.]
zoosjuice has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dingus_khan has quit [Ping timeout: 264 seconds]
deric_skibotn has quit [Ping timeout: 264 seconds]
shtirlic has joined #ruby
rubytor has quit [Read error: Connection timed out]
deric_skibotn has joined #ruby
Georg3 has quit [Ping timeout: 240 seconds]
Dane has joined #ruby
rubytor has joined #ruby
JoshGlzBrk has joined #ruby
nanoyak has quit [Read error: Connection reset by peer]
amacou has joined #ruby
sepp2k has joined #ruby
nanoyak has joined #ruby
sambao21 has joined #ruby
JohnFord has joined #ruby
gaussblurinc1 has joined #ruby
nanoyak has quit [Client Quit]
<arup_r>
Can anyone take me with you in your project to work ? I want to involve in weekends ... little time for week days.. I don't need $$... I want to gather some experience and learn things well under a professional dev.. Any body out there take a Risk ?
pu22l3r has joined #ruby
Sugar_GirL_ has joined #ruby
msull92 has joined #ruby
mikesplain has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
<mechanicalduck_>
shevy: lol
<shevy>
arup_r go and create stuff man. write gems.
amacou has quit [Ping timeout: 240 seconds]
anaeem1 has joined #ruby
chipotle has joined #ruby
zigomir has quit [Remote host closed the connection]
jgt has joined #ruby
gaussblurinc1 has quit [Client Quit]
frellnet has quit [Remote host closed the connection]
toastynerd has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
codeurge has quit [Quit: Quit.]
renderful has quit [Remote host closed the connection]
beef-wellington has quit [Ping timeout: 250 seconds]
kachi8 has joined #ruby
apeiros has joined #ruby
<shevy>
hmm how to round down always?
nateberkopec has joined #ruby
<centrx>
#floor
alexju has joined #ruby
<shevy>
cool
frellnet has quit [Ping timeout: 245 seconds]
<centrx>
arup_r, I would take a look at some open source projects you are interested in and look at their source code and their issue tracker, see if you can't make a patch for a bug
anaeem1 has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
nanoyak has joined #ruby
GriffinHeart has joined #ruby
zoosjuice has joined #ruby
<arup_r>
ramfjord: don't do `rm -rf *` ... Lollz
dawkirst has quit [Ping timeout: 240 seconds]
<arup_r>
Then I will loose all Giant devs out there
baweaver has joined #ruby
ascarter has joined #ruby
<shevy>
arup_r, nah, it runs in a sandbox
omosoj has quit [Ping timeout: 255 seconds]
GriffinHeart has quit [Ping timeout: 240 seconds]
AlSquire has quit [Quit: This computer has gone to sleep]
<arup_r>
Thank God
jkline has quit [Quit: jkline]
ffranz has quit [Quit: Leaving]
hmsimha has quit [Ping timeout: 240 seconds]
baweaver has quit [Read error: Connection reset by peer]
alexju has quit [Remote host closed the connection]
baweaver has joined #ruby
claymore has quit [Quit: Leaving]
Sugar_GirL_ has quit []
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Darkchaos has quit [Ping timeout: 255 seconds]
edmellum has quit [Quit: Connection closed for inactivity]
einarj has quit [Remote host closed the connection]
tjr9898 has joined #ruby
diptanuc has quit [Ping timeout: 250 seconds]
pixelsnbits has joined #ruby
Fabiano has joined #ruby
Trynemjoel has joined #ruby
kachi8 has quit [Ping timeout: 260 seconds]
<mattalexx>
How can I get I use "gets" when I'm running code using the ruby executable's STDIN? Here's a test: echo "input = \$stdin.gets; puts 'You entered: ' + input" | ruby
sputnik1_ has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zigomir has joined #ruby
Fabiano has quit [Quit: Saindo]
zigomir has quit [Remote host closed the connection]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<arup_r>
your question is Fuzzy
pixelsnbits has left #ruby [#ruby]
<toretore>
mattalexx: your echo output is stdin
<mattalexx>
toretore: I don't understand what means
<alexbobp>
in activerecord migrations, how can I set the default value for a timestamp to NOW()?
<alexbobp>
everything I tried just evaluates it at migration time and sets a hardcoded date as the default value
diptanuc has joined #ruby
agjacome has quit [Quit: leaving]
kaspergrubbe has joined #ruby
namxam has quit [Ping timeout: 240 seconds]
funktor has quit [Remote host closed the connection]
ctp has joined #ruby
nanoyak has joined #ruby
omosoj has quit [Ping timeout: 240 seconds]
tokik has joined #ruby
andrewjanssen has joined #ruby
Georg3 has quit [Ping timeout: 264 seconds]
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
namxam_ has quit [Remote host closed the connection]
ctp has quit [Client Quit]
iamjarvo has joined #ruby
jheg has quit [Quit: jheg]
<alexbobp>
anyone awake?
farleyknight has quit [Ping timeout: 245 seconds]
nanoyak has quit [Ping timeout: 250 seconds]
dfalkner has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
try #rubyonrails
nahtnam has quit [Quit: Page closed]
<alexbobp>
ah ok, thanks.
<alexbobp>
I tried to guess that channelname but missed the obvious
<alexbobp>
o/
alexbobp has left #ruby [#ruby]
senayar has quit [Ping timeout: 250 seconds]
NinoScript_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tjr9898 has quit [Remote host closed the connection]
NinoScript has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
dfalkner has joined #ruby
saarinen has quit [Quit: saarinen]
nateberkopec has quit [Quit: Leaving...]
cleopatra has joined #ruby
ctp has joined #ruby
spider-mario has quit [Remote host closed the connection]
dangerou_ has quit [Ping timeout: 250 seconds]
snath has quit [Ping timeout: 250 seconds]
SCommette has joined #ruby
diptanuc has quit [Ping timeout: 240 seconds]
diptanuc has joined #ruby
j_mcnally has quit [Quit: さよなら]
sputnik1_ has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
tjr9898 has joined #ruby
WormDrink has quit [Ping timeout: 250 seconds]
clov3r has quit []
farleyknight has joined #ruby
Mon_Ouie has quit [Ping timeout: 255 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
etqqkoiflwhb has quit [Quit: Computer has gone to sleep.]
diptanuc has quit [Ping timeout: 240 seconds]
GriffinHeart has joined #ruby
Neener54 has quit [Ping timeout: 264 seconds]
diegoviola has quit [Remote host closed the connection]
baweaver has joined #ruby
snath has joined #ruby
cuqa has joined #ruby
<cuqa>
hello, I have a problem with ruby and dashing
<cuqa>
I have made a widget which queries two machines with snmp, however one machine is very slow at responding and this messes everything up
<cuqa>
it seems like the loops are running in parallel annd are not waiting until it has actually finished
GriffinHeart has quit [Ping timeout: 240 seconds]
WormDrink has joined #ruby
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Ping timeout: 255 seconds]
dfalkner has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<cuqa>
ok got the problem :[
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jkline has joined #ruby
jgt has quit []
sambao21 has quit [Quit: Computer has gone to sleep.]
choke has quit [Quit: Leaving]
ctp has joined #ruby
olivier_bK has joined #ruby
dawkirst has joined #ruby
dfalkner has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
cDuff has quit [Read error: Connection reset by peer]
tjr9898 has quit []
brandonshowers has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
namxam has joined #ruby
<febuiles>
Is there anything like Airbrake or Exception Notifier for bare Ruby apps?
dawkirst has quit [Ping timeout: 240 seconds]
namxam has quit [Read error: Connection reset by peer]
namxam has joined #ruby
SCommette has quit [Quit: SCommette]
beneggett has joined #ruby
<toretore>
you just want to be emailed when an exception occurs?
Aryasam has quit [Ping timeout: 240 seconds]
EvanR_ has joined #ruby
<febuiles>
toretore: ideally I'd like to use have a backend like Errbit for this, or at the very least something different to begin; App.new; rescue; send_exception; end
<toretore>
define different
<febuiles>
I don't want to do the error catching myself at the top lvl
<febuiles>
(although I don't know if I can avoid that)
<febuiles>
the app uses EM and Fibers/Threads depending on the imp. Some parts also spawn a new process. I'm not sure of the implications of catching everything at the spawner level
hadees has joined #ruby
<toretore>
well, you're not going to find anything that will handle all those things automatically
klaut has quit [Remote host closed the connection]
<toretore>
you're going to have to handle each case manually
<febuiles>
toretore: I see, thank you
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zoosjuice has joined #ruby
OffTheRails has joined #ruby
rubytor has quit [Quit: No Ping reply in 180 seconds.]
rubytor has joined #ruby
lolmaus has quit [Remote host closed the connection]
<toretore>
you could probably funnel everything into one handler
jay has quit []
bruno- has joined #ruby
phoo1234567 has quit [Quit: Leaving]
matchaw has quit [Ping timeout: 256 seconds]
icarus_ has quit [Remote host closed the connection]
gaussblurinc1 has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
dfalkner has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x1337807x has joined #ruby
chipotle has quit [Quit: cya]
pietr0 has quit [Quit: pietr0]
gaussblurinc1 has quit [Client Quit]
kaspergrubbe has quit [Remote host closed the connection]
britneywright has joined #ruby
lethjakman has joined #ruby
dingus_khan has joined #ruby
gaussblurinc1 has joined #ruby
dik_dak has joined #ruby
gaussblurinc1 has quit [Client Quit]
jkline has quit [Quit: jkline]
zoosjuice has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dfalkner has joined #ruby
memph1s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
namxam has joined #ruby
jottr_ has quit [Ping timeout: 255 seconds]
brandonshowers has joined #ruby
Lewix has quit [Remote host closed the connection]
Lewix has joined #ruby
mr_snowf1ake has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]