<Alayde>
I've gotten a few more leads though, in regards to the soap4r gem; looks like you can disable ssl verification during a call so I'll try that tomorrow
tmtwd has quit [Ping timeout: 260 seconds]
omegamike has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Oka has quit [Remote host closed the connection]
<pontiki>
hi, all
<havenwood>
pontiki: hey
<pontiki>
what does `extend self` do in a module?
<pontiki>
is that a funny way of saying `module_function` at the top of a module?
<havenwood>
pontiki: nope, it's different from module_function despite the similarities
Mendenhall has joined #ruby
<havenwood>
pontiki: The module function instance methods are copies and are private.
<pontiki>
could you splain it to me, ricky?
<Ox0dea>
"Havey, you got some 'splainin' to do."
sarkyniin has quit [Remote host closed the connection]
icarus has quit [Remote host closed the connection]
dr3w has joined #ruby
<shevy>
lots of things make irb nicer to use, like IRB.conf[:EVAL_HISTORY], but I don't need any of that
Oka has joined #ruby
Yzguy has quit [Quit: Zzz...]
dr3w has quit [Client Quit]
<shevy>
youtube is kinda funny, it's like a big lecture room with lots of different lectures available
dr3w has joined #ruby
fullofcaffeine has joined #ruby
<shevy>
incompatible character encodings: UTF-8 and ISO-8859-1 (Encoding::CompatibilityError)
<shevy>
cool
<shevy>
never saw this error before
phutchins has quit [Ping timeout: 250 seconds]
djbkd has quit [Remote host closed the connection]
tkuchiki has joined #ruby
diegoviola has joined #ruby
yfeldblum has joined #ruby
mdavid613 has quit [Quit: Leaving.]
ereslibre has quit [Quit: No Ping reply in 180 seconds.]
ereslibre has joined #ruby
devoldmx has joined #ruby
radgeRayden has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
saddad has joined #ruby
devoldmx has quit [Ping timeout: 260 seconds]
Vile` has quit [Ping timeout: 272 seconds]
j4cknewt has joined #ruby
niiamon has quit [Read error: Connection timed out]
Vile` has joined #ruby
niiamon has joined #ruby
halcyone3 has joined #ruby
bradleyprice has quit [Remote host closed the connection]
niiamon has quit [Read error: Connection reset by peer]
niiamon has joined #ruby
Inside has joined #ruby
Inside has joined #ruby
bricker has joined #ruby
Trynemjoel has quit [Ping timeout: 250 seconds]
dr3w has quit [Ping timeout: 255 seconds]
halcyone3 has quit [Ping timeout: 252 seconds]
Oka has quit []
Trynemjoel has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
MatthewsFace has joined #ruby
dmmoody has joined #ruby
RegulationD has joined #ruby
allcentury has joined #ruby
omegamike has joined #ruby
ereslibre has quit [Ping timeout: 260 seconds]
umgrosscol has joined #ruby
<shevy>
now I wondered why an alias won't work
<shevy>
until I realized I forgot to use the word "alias" ...
atom3_ has joined #ruby
atom3 has quit [Ping timeout: 256 seconds]
omegamike has quit [Ping timeout: 246 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arescorpio has joined #ruby
yqt has quit [Ping timeout: 252 seconds]
zacstewart has joined #ruby
RegulationD has quit [Ping timeout: 250 seconds]
ponga has quit []
niiamon has quit [Read error: Connection timed out]
dorei has quit []
niiamon has joined #ruby
poguez_ has joined #ruby
leesharma has quit [Ping timeout: 252 seconds]
Channel6 has quit [Quit: Leaving]
s00pcan has quit [Ping timeout: 252 seconds]
gthank has joined #ruby
s00pcan has joined #ruby
iateadonut has joined #ruby
centrx has quit [Quit: 'Get out, you and all the people who follow you!' Then he went out from Pharaoh in hot anger.]
Chau has joined #ruby
dseitz has joined #ruby
dmmoody has quit [Remote host closed the connection]
leesharma has joined #ruby
darkf has joined #ruby
leesharma has quit [Client Quit]
_blizzy_ has joined #ruby
hazelux has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
niiamon has quit [Read error: Connection timed out]
hazelux has joined #ruby
maq has quit [Quit: maq]
Randroid has joined #ruby
niiamon has joined #ruby
ascarter has joined #ruby
dmmoody has joined #ruby
brendan- has joined #ruby
Randroid has left #ruby [#ruby]
astrobun_ has joined #ruby
niiamon_ has joined #ruby
niiamon has quit [Ping timeout: 246 seconds]
niiamon_ has quit [Ping timeout: 240 seconds]
d2dchat has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
niiamon has joined #ruby
Chau has quit [Ping timeout: 246 seconds]
chouhoulis has quit [Remote host closed the connection]
Mendenhall has joined #ruby
CorySimmons has joined #ruby
tubuliferous_ has joined #ruby
jonee has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
braincrash has quit [Quit: bye bye]
Randroid has joined #ruby
Randroid has left #ruby [#ruby]
hazelux has quit [Ping timeout: 244 seconds]
tubuliferous_ has quit [Ping timeout: 244 seconds]
braincrash has joined #ruby
allcentury has quit [Ping timeout: 250 seconds]
Aswebb_ has joined #ruby
Chau has joined #ruby
CorySimmons has quit [Quit: Bye!]
dopie has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
Fire-Dragon-DoL has quit []
halcyone3 has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
ramfjord has quit [Ping timeout: 246 seconds]
fedexo has joined #ruby
r_baron has joined #ruby
Aswebb_ has quit [Ping timeout: 250 seconds]
milesforrest has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
bricker has quit [Ping timeout: 272 seconds]
Chau has quit [Ping timeout: 244 seconds]
d0lph1n98 has joined #ruby
Pupeno has joined #ruby
Pupeno_ has quit [Ping timeout: 244 seconds]
d0lph1n98 has quit [Remote host closed the connection]
maq has joined #ruby
dmmoody has quit []
shadoi has quit [Quit: Leaving.]
djbkd has joined #ruby
ponga has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
seitensei has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
RegulationD has joined #ruby
seitensei has joined #ruby
fedexo has quit [Quit: No Ping reply in 180 seconds.]
diego1 has joined #ruby
[k- has joined #ruby
gix has quit [Ping timeout: 240 seconds]
baweaver has joined #ruby
diegoviola has quit [Ping timeout: 246 seconds]
devoldmx has joined #ruby
RegulationD has quit [Ping timeout: 256 seconds]
gix has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
astrobu__ has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
serivich has joined #ruby
<bazbing80>
what's the most efficent way to update just one file line? Read line 3, update 1 character on that line, save and close the file. Seems wasteful to load the whole thing into memory
maq has quit [Quit: maq]
astrobun_ has quit [Ping timeout: 265 seconds]
<Ox0dea>
bazbing80: Most filesystems only support efficient append. :/
Chau has joined #ruby
oo_ has quit [Remote host closed the connection]
theobrowne has quit [Ping timeout: 264 seconds]
<bazbing80>
Ox0dea so reading the whole file, editing in memory and then writing everything back into the file is the only way?
<bazbing80>
no worries if so that's what its doing already :L
<Ox0dea>
bazbing80: As you can see, even venerable `sed` has to write every single line even though it's only being asked to replace a single character on a single line.
<bazbing80>
hah even sed
<Ox0dea>
bazbing80: I use it as an example only becaue if there were some better way to do it, `sed` almost certainly would.
sdrew has joined #ruby
<bazbing80>
yeah I get, thanks. Another question, you know when Rails updates your filesystem, and you get feedback. create file create file2 create file3 modify file4 ect? is it a gem that provides that feedback and or syntax?
<bazbing80>
not just rails standalone gems show the same output
<bazbing80>
seems standarized
ramfjord has joined #ruby
Rollabunna has quit [Read error: Connection reset by peer]
<Ox0dea>
bazbing80: That'd be Thor.
Rollabunna has joined #ruby
<Ox0dea>
Which isn't "standardized", per se, but it's easy to argue its being the best offering for making "command" CLIs.
fedexo has joined #ruby
halcyone3 has quit [Ping timeout: 252 seconds]
j4cknewt has quit [Remote host closed the connection]
<bazbing80>
Ox0dea cool, can you link me to some docs? I'm not sure what search terms to use regarding giving filesystem feedback via Thor
Chau has quit [Ping timeout: 246 seconds]
<Ox0dea>
bazbing80: You seem to be under the impression that these apps are monitoring the filesystem and responding to events. They're just logging what they're about to do.
Rollabunna has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
<bazbing80>
Ox0dea: I was indeed under that impression...well do you know methods I need to utilize within my code to log?
michael_mbp has quit [Excess Flood]
fedexo has quit [Quit: No Ping reply in 180 seconds.]
<pontiki>
remember, too, that the file system knows nothing itself about lines
mistermocha has joined #ruby
michael_mbp has joined #ruby
<bazbing80>
pontiki: you mean if I want to give feedback on what line has been edited? that's no worry
mistermocha has quit [Remote host closed the connection]
<pontiki>
idk, i was looking at your original query about updating just one line
d2dchat has quit [Remote host closed the connection]
Rollabunna has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
fedexo has joined #ruby
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
omegamike has joined #ruby
safeforge has joined #ruby
theobrowne has joined #ruby
Musashi007 has joined #ruby
yfeldblum has joined #ruby
diego1 has quit [Changing host]
diego1 has joined #ruby
diego1 is now known as diegoviola
omegamike has quit [Ping timeout: 250 seconds]
yosafbridge has quit [K-Lined]
yfeldblum has quit [Ping timeout: 264 seconds]
dopie has quit [Quit: This computer has gone to sleep]
cvtsx1 has joined #ruby
devbug_ has joined #ruby
Mendenhall has quit [Ping timeout: 240 seconds]
blue_deref has quit [Quit: bbn]
yosafbridge has joined #ruby
astrobu__ has quit [Remote host closed the connection]
cvtsx has quit [Ping timeout: 244 seconds]
Mon_Ouie has quit [Read error: Connection reset by peer]
qiukun has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
Mon_Ouie has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
astrobun_ has joined #ruby
Rutix has quit []
Motoservo has joined #ruby
Synthead has joined #ruby
Synthead has quit [Max SendQ exceeded]
Synthead has joined #ruby
Musashi007 has quit [Ping timeout: 250 seconds]
Synthead has quit [Client Quit]
Rutix has joined #ruby
Rutix has joined #ruby
serivich has quit [Ping timeout: 260 seconds]
Rutix has quit [Client Quit]
fedexo has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
r_baron has quit [Quit: Leaving]
jbw__ has quit [Ping timeout: 246 seconds]
railswebdev has joined #ruby
jbw__ has joined #ruby
fedexo has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Ping timeout: 245 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tmtwd has joined #ruby
fedexo has quit [Client Quit]
symm- has quit [Ping timeout: 240 seconds]
_blizzy_ has quit [Ping timeout: 265 seconds]
tubuliferous_ has joined #ruby
Inside has quit [Ping timeout: 244 seconds]
frem has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
schaerli has joined #ruby
schaerli has quit [Client Quit]
A124 has quit [Ping timeout: 260 seconds]
tubuliferous_ has quit [Ping timeout: 250 seconds]
A124 has joined #ruby
fedexo has joined #ruby
pawnbox has joined #ruby
Kalov has quit []
Aswebb_ has joined #ruby
Musashi007 has joined #ruby
mistermocha has joined #ruby
ragingcake_ has quit [Quit: ragingcake_]
riotjones has joined #ruby
Fraeon has quit [Ping timeout: 264 seconds]
Rollabunna has quit [Read error: Connection reset by peer]
Aswebb_ has quit [Ping timeout: 256 seconds]
bradleyprice has joined #ruby
niemcu has joined #ruby
jenrzzz has joined #ruby
tmtwd has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 246 seconds]
tanath has left #ruby ["Leaving"]
oo_ has quit [Remote host closed the connection]
avahey has quit [Quit: Connection closed for inactivity]
Rollabun_ has joined #ruby
tmtwd has joined #ruby
chrissonar has joined #ruby
yfeldblum has joined #ruby
mistermocha has quit [Ping timeout: 246 seconds]
kidoz has quit [Quit: Ухожу я от вас]
reverse_light has joined #ruby
arescorpio has quit [Read error: Connection reset by peer]
rehat has quit []
graydot has joined #ruby
[k- has quit [Ping timeout: 256 seconds]
psy_ has quit [Ping timeout: 245 seconds]
bronson_ has quit [Remote host closed the connection]
oo_ has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
fullofcaffeine has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
Rollabunna has joined #ruby
dualbus has quit [Quit: WeeChat 1.2]
Rollabun_ has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
casadei_ has quit [Remote host closed the connection]
Musashi007_ has joined #ruby
casadei_ has joined #ruby
dualbus has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Musashi007 has quit [Ping timeout: 246 seconds]
Musashi007_ is now known as Musashi007
Rollabunna has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
casadei_ has quit [Ping timeout: 264 seconds]
RobertBirnie has joined #ruby
devoldmx has joined #ruby
vondruch has joined #ruby
niemcu has quit [Ping timeout: 256 seconds]
oo_ has quit [Remote host closed the connection]
graydot has quit [Quit: graydot]
oo_ has joined #ruby
Rollabunna has joined #ruby
j4cknewt has joined #ruby
riotjones has joined #ruby
devoldmx_ has joined #ruby
ZeBaws has joined #ruby
devoldmx has quit [Ping timeout: 264 seconds]
<ZeBaws>
Hey guys! Is ruby a good language for complete programmers?
oo_ has quit [Remote host closed the connection]
<Ox0dea>
No.
nickjj has quit [Ping timeout: 244 seconds]
<ZeBaws>
What is the best language for teaching programming?
<Ox0dea>
Scheme.
oo_ has joined #ruby
Violentr has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
Rollabunna has quit [Ping timeout: 246 seconds]
ZeBaws has left #ruby [#ruby]
<al2o3-cr>
Ox0dea: how long you been doing ruby?
devoldmx_ has quit [Ping timeout: 260 seconds]
abcd1234 has quit [Read error: Connection reset by peer]
RobertBirnie has quit [Ping timeout: 240 seconds]
Musashi007 has quit [Quit: Musashi007]
leat has quit [Ping timeout: 252 seconds]
<wasamasa>
not long enough!
devoldmx has joined #ruby
<al2o3-cr>
really?
leat has joined #ruby
RobertBirnie has joined #ruby
abcd1234 has joined #ruby
<Ox0dea>
al2o3-cr: About eight years, I guess.
lsmola has joined #ruby
abcd1234 has quit [Read error: Connection reset by peer]
* Ox0dea
is still raw about having used Python as long as he did.
<sevenseacat>
does it give you a better appreciation for the awesomeness of ruby?
fullofcaffeine has joined #ruby
<sevenseacat>
i know my seven or so years of php does
<Ox0dea>
sevenseacat: So many things give me that appreciation.
abcd1234 has joined #ruby
TvL2386 has joined #ruby
<Ox0dea>
There are just so many little pleasures.
<al2o3-cr>
i'd give my big toe for ruby
s2013 has joined #ruby
<al2o3-cr>
when do you become a pro?
Guest36270 has joined #ruby
Rollabunna has joined #ruby
leat has quit [Quit: leat]
ferhaty has joined #ruby
<al2o3-cr>
ruby is just my hobby
Guest36270 is now known as Jandre
oo_ has quit [Remote host closed the connection]
Lucky__ has joined #ruby
Jandre has quit [Changing host]
Jandre has joined #ruby
<Ox0dea>
al2o3-cr: On a vaguely related note, I'm surprised there don't seem to be any software projects called Hallux.
<Ox0dea>
Do you only write Ruby?
oo_ has joined #ruby
<al2o3-cr>
yep, and a little lua
ap4y has quit [Remote host closed the connection]
<al2o3-cr>
tried python didn't like it
<atmosx>
al2o3-cr: I guess when you're getting paid.
<al2o3-cr>
also tried php + js too
Rollabun_ has joined #ruby
Rollabunna has quit [Read error: Connection reset by peer]
devbug has joined #ruby
<al2o3-cr>
atmosx: probably
* sevenseacat
sends js to the devil
<al2o3-cr>
so, i just stuck to ruby as it was different
Renich has joined #ruby
chinmay_dd has joined #ruby
Renich has quit [Client Quit]
devbug_ has quit [Ping timeout: 246 seconds]
Renich has joined #ruby
fantazo has joined #ruby
AlexRussia has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
psy_ has joined #ruby
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
Feyn has joined #ruby
n1x has joined #ruby
Xiti has joined #ruby
Rollabun_ has quit [Read error: Connection reset by peer]
graydot has joined #ruby
brianpWins_ has joined #ruby
<al2o3-cr>
I think i started delving into ruby when the metasploit changed from perl
mesamoo has quit [Quit: Konversation terminated!]
<al2o3-cr>
*framework
Rollabun_ has joined #ruby
skade has joined #ruby
brianpWins has quit [Ping timeout: 250 seconds]
brianpWins_ is now known as brianpWins
<sevenseacat>
I was tired of all the php web frameworks being 'inspired by rails' so I said screw it, time to learn rails
Rollabun_ has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
<al2o3-cr>
and i bet that's the best decision you've made (though haven't use rails at all)
fantazo has quit [Quit: Verlassend]
ramfjord has quit [Ping timeout: 244 seconds]
<al2o3-cr>
diggled with sinatra once or twice (nice little dsl)
<sevenseacat>
al2o3-cr: absolutely.
<sevenseacat>
that was 2011.
<sevenseacat>
still here o/
<al2o3-cr>
nice to hear :)
cornerma1 has joined #ruby
fedexo has quit [Ping timeout: 244 seconds]
graydot has quit [Quit: graydot]
ddv has quit [Changing host]
ddv has joined #ruby
<al2o3-cr>
sevenseacat: did you write class in php?
<al2o3-cr>
*classes
<sevenseacat>
yep. i was quite used to MVC web frameworks in php
<Aeyrix>
I shifted to Ruby from Python after the Python 2/3 split became too unbearable.
cornerman has quit [Ping timeout: 246 seconds]
cornerma1 is now known as cornerman
Rollabunna has quit [Read error: Connection reset by peer]
<al2o3-cr>
self is wierd in php
<al2o3-cr>
i just don't like the whitespace rule with python, plus one or two other things
<al2o3-cr>
what ever can be done with python, can be done with ruby anyway
<al2o3-cr>
i like pythons list comps though
nhhagen has joined #ruby
<al2o3-cr>
anyway, i'll stop rabbiting on now
pawnbox has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
djbkd has quit [Remote host closed the connection]
janno has joined #ruby
djbkd has joined #ruby
Davey has quit [Ping timeout: 244 seconds]
_djbkd has joined #ruby
bronson has joined #ruby
Pisuke has joined #ruby
yardenbar has joined #ruby
Askilada has joined #ruby
TomyLobo has joined #ruby
Askilada has quit [Client Quit]
MyMind has quit [Ping timeout: 265 seconds]
djbkd has quit [Ping timeout: 264 seconds]
vondruch has quit [Ping timeout: 244 seconds]
minmax has joined #ruby
roolo has joined #ruby
diegoviola has quit [Quit: WeeChat 1.2]
msnyon has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 240 seconds]
codecop has joined #ruby
DoubleMalt has joined #ruby
tmtwd has quit [Remote host closed the connection]
graydot has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
chinmay_dd has quit [Ping timeout: 246 seconds]
fullofcaffeine has quit [Remote host closed the connection]
n1x has quit [Ping timeout: 256 seconds]
michael_mbp has quit [Excess Flood]
pawnbox has quit [Ping timeout: 256 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
niemcu has joined #ruby
graydot has quit [Quit: graydot]
stardiviner has joined #ruby
Macaveli has joined #ruby
michael_mbp has joined #ruby
niiamon has quit [Ping timeout: 252 seconds]
fella6s has quit [Ping timeout: 255 seconds]
fella5s has joined #ruby
tubuliferous_ has joined #ruby
weemsledeux has joined #ruby
TomyLobo has quit [Ping timeout: 240 seconds]
amclain has quit [Quit: Leaving]
Aswebb_ has joined #ruby
radgeRayden has quit [Ping timeout: 250 seconds]
tubuliferous_ has quit [Ping timeout: 246 seconds]
TvL2386 has quit [Ping timeout: 252 seconds]
keeguon has joined #ruby
nikamura has joined #ruby
andikr has joined #ruby
saddad has quit [Ping timeout: 244 seconds]
Philipp__ has joined #ruby
_djbkd has quit [Remote host closed the connection]
aganov has joined #ruby
djbkd has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
n1x has joined #ruby
freerobby has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
AlphaAtom has joined #ruby
Macaveli has joined #ruby
corpsicle has joined #ruby
<corpsicle>
hello
pawnbox has joined #ruby
<corpsicle>
so, im iterating over a list of variables, checking their content. but when i find an empty variable i want to puts a errormessage containing the name of the variable. how do i achieve this?
zacstewart has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
<Ropeney>
corpsicle: p "
brianpWins has joined #ruby
<Ropeney>
p "" if variable.nil?
<Ropeney>
or p "" if variable == ""
<corpsicle>
ok, im a noob at ruby, what does p do ? is it short for puts?
<Mon_Ouie>
p o is short for puts o.inspect
<corpsicle>
and p "" prints the name of the variable?
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TvL2386 has joined #ruby
<Ropeney>
corpsicle: how are you iterating through the variables...? show code?
<corpsicle>
for x in [variable1, variable2...]
<corpsicle>
and then an if statement checking the content and printing message if empty
<Ox0dea>
Yikes.
<corpsicle>
not ruby enough ? =)
<Ox0dea>
Do you know about Arrays?
<corpsicle>
to some extent yes
<Ox0dea>
If you have a group of related variables, you almost certainly want to use a collection type like Array or Hash.
oo_ has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse>
Not being allocated does not making something a non object
<yorickpeterse>
Hell, you can have objects without allocations
<yorickpeterse>
e.g. nil is never allocated either, it's nothing but a tagged pointer
j4cknewt has quit [Remote host closed the connection]
<yorickpeterse>
yet it's still an object
<tobiasvl>
Ox0dea: wow.
<[k->
but it isn't the same
<apeiros>
yorickpeterse: I'm not arguing that point. but there is no object with a block.
<Ox0dea>
tobiasvl: I actually kinda like it. :x
<DefV>
Ox0dea: dutch, why?
<tobiasvl>
Ox0dea: I gotta fork that so I remember it
<DefV>
Ox0dea: Is my English that bad?
devbug has joined #ruby
<adaedra>
DefV: speak english, we don't understand you
<adaedra>
:p
<Ox0dea>
DefV: No, it's really not, and I apologize if I inadvertently gave any offense.
oleksandriuzikov has joined #ruby
<DefV>
You didn't, just curious :-)
<[k->
silly?.rb isnt a valid name!
<Ox0dea>
It's just that mistakenly dropping the "such" from "such as" is pretty common, and I thought it might have to do with not being a native speaker.
devoldmx has quit [Ping timeout: 265 seconds]
<DefV>
aha, it probably is. Now I'm very self-concious
<Ox0dea>
[k-: Are you on DOS?
<[k->
i would drop the such
<[k->
fewer words anyway
devbug_ has quit [Ping timeout: 250 seconds]
<tobiasvl>
well he said "smth as"
<adaedra>
let's drop all the words then
<adaedra>
<tobiasvl>
so it's not even fewer words :P
yh has quit [Ping timeout: 260 seconds]
<[k->
Ox0dea yes, in the past i used windows
<Ox0dea>
[k-: ? is a valid character in filenames in any remotely modern environment.
<apeiros>
Ox0dea: that silly?.rb is funny
soc42 has joined #ruby
<[k->
i see you as a pony!
<Ox0dea>
Which?
<adaedra>
Ox0dea: so Windows is not modern?
<tobiasvl>
silly\?.rb
oo__ has quit [Remote host closed the connection]
<[k->
why would ? even be allowed
<Ox0dea>
Why not?
quimrstorres has joined #ruby
<[k->
isnt it in glob patterns or something
<adaedra>
it is, but it shouldn't be an issue
<[k->
we don't have * on names for example
<Ox0dea>
But we can!
<adaedra>
it is possible on a Linux
<Ox0dea>
I think / is the only invalid filename character on Linux.
sevenseacat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
depend on the fs, ext4 forbids \0 too apparently.
<ruboto>
mikecmpbll # => undefined method `first' for "test":String (NoMethodError) ...check link for more (https://eval.in/413017)
<mikecmpbll>
oh really.
<mikecmpbll>
wtf
fella5s has quit [Ping timeout: 265 seconds]
<[k->
what
<[k->
String isn't an array
<Ox0dea>
mikecmpbll: Was String a guess, then?
<mikecmpbll>
Ox0dea: no.
<mikecmpbll>
woops, good ol' rails core_ext
<mikecmpbll>
either way, it's a string, and all the bytes are \x00 :(
Ropeney has joined #ruby
<yorickpeterse>
mikecmpbll: set the proper encoding
<yorickpeterse>
or make sure the input is valid in the first place
<mikecmpbll>
yorickpeterse: i'll try play around with the encoding, just using mechanize defaults at the moment which always worked for me before. what do you mean by making sure the input is valid?
Ropeney has quit [Client Quit]
<Ox0dea>
Mechanize is sort of like Dreamweaver for Web interaction. :P
Pumukel has quit [Ping timeout: 244 seconds]
<yorickpeterse>
As in the input not containing crap
<mikecmpbll>
yorickpeterse: what input?
<yorickpeterse>
whatever you're getting via Mechanize
<corpsicle>
but the only "more elegant" solution is to rewrite the other sript to be a class i guess
<adaedra>
the proper thing would be to merge both scripts I guess
pawnbox has quit [Remote host closed the connection]
Caelum has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
<Caelum>
Anyone know a good quick reference for ruby syntax? I can read ruby fairly easily and hack on code a bit, and I know perl and python so it's not too hard, but I haven't read a book yet (I promise I will at some point....)
tubuliferous_ has joined #ruby
r_baron has joined #ruby
tmtwd has quit [Ping timeout: 265 seconds]
pawnbox has joined #ruby
<shevy>
corpsicle you can probably use `` just fine, remember it will yield to you back its result, which you can capture in a variable, which you can capture. it's nice for lazy code when you don't want to rewrite something (or if someone else wrote the script and you don't feel like investing time to clean up what someone else wrote)
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
apfeluser has quit [Quit: Leaving]
tvw has joined #ruby
OrbitalKitten has joined #ruby
<corpsicle>
shevy: its more the fact that the script is used in more places, if i change it i have to make sure it works everywhere else aswell =P
<tuor>
hi, i have a Nokogiri::XML object and want to get a string again, but with out all unneed whitespace between xml elements. How can I do it? code: https://gist.github.com/anonymous/18b9182d73421cf9cc2b (reason: want to read from a xml-file)
<adaedra>
Caelum: thank zenspider
zacstewart has joined #ruby
allcentury has quit [Ping timeout: 245 seconds]
tkuchiki has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 252 seconds]
<corpsicle>
gah, converting python scripts to ruby ... every other error i get is because of an ":" too much or an "end" too little =)
mcgain has joined #ruby
sarkyniin has joined #ruby
serivich has quit [Ping timeout: 246 seconds]
<[k->
Nokogiri can read XML
rikkipitt has quit [Quit: Leaving...]
shoutsid has joined #ruby
<yorickpeterse>
tuor: you'll have to get all the text nodes and strip them of whitespace
shoutsid has quit [Client Quit]
govg has quit [Quit: leaving]
<tuor>
[k-, is there a method in Nokogiri to get a sting object with out aditional withspaces?
dorei has joined #ruby
<tuor>
[k-, I mean I can read from a file into a Nokogiri object but the problem is to get a string from this object (with out aditional withespace).
benlovell has joined #ruby
shoutsid has joined #ruby
d2dchat has joined #ruby
lele|w has quit [Remote host closed the connection]
jgpawletko has quit [Quit: jgpawletko]
surs has joined #ruby
surs has quit [Changing host]
surs has joined #ruby
ljt has joined #ruby
scripore has joined #ruby
jbw__ has quit [Ping timeout: 240 seconds]
<tuor>
yorickpeterse, I hoped that nokogiri can do it.,.
sepp2k has joined #ruby
millerti has joined #ruby
jenrzzz has joined #ruby
lannonbr has joined #ruby
jbw__ has joined #ruby
Cust0sLim3n has quit [Ping timeout: 246 seconds]
vali has left #ruby ["Leaving"]
freedollar has joined #ruby
freedollar has left #ruby [#ruby]
Liam` has quit [Ping timeout: 246 seconds]
<corpsicle>
hmm, is there a thing in ruby like pythons shlex ?
nateberkopec has joined #ruby
<corpsicle>
aha
<corpsicle>
shellwords
<yorickpeterse>
tuor: there's no way to have Nokogiri do it automatically IIRC
jonee has quit [Ping timeout: 256 seconds]
shoutsid has quit []
<tuor>
yorickpeterse, ah ok. thx.
shoutsid has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
shoutsid has quit [Client Quit]
jbw__ has quit [Ping timeout: 245 seconds]
thiagovsk has joined #ruby
joonty has quit [Quit: Leaving]
shoutsid has joined #ruby
<[k->
+b n*i*g*g*e*r*!*@*
shoutsid has quit [Client Quit]
Liam` has joined #ruby
jbw__ has joined #ruby
khebbie has quit [Remote host closed the connection]
shoutsid has joined #ruby
rideh has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tuor>
[k-, what?
rideh has quit [Client Quit]
shoutsid has quit [Read error: Connection reset by peer]
Aria has quit [Ping timeout: 255 seconds]
conor_ has joined #ruby
shoutsid has joined #ruby
<[k->
these days, people keep having 'nigger' in their nicks
shoutsid has quit [Client Quit]
sgambino has joined #ruby
aredridel has joined #ruby
Cust0sLim3n has joined #ruby
quimrstorres has quit [Remote host closed the connection]
devoldmx has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
<shevy>
only one guy
<shevy>
he is very persistent
omegamike has joined #ruby
[k-_ has joined #ruby
serivich has joined #ruby
jimms has joined #ruby
sevenseacat has joined #ruby
<tuor>
ah ok.
codecop has joined #ruby
<[k->
adaedra: commas are actually used in urls @.@
Dzejmskrokan has joined #ruby
prestorium has quit [Quit: Konversation terminated!]
<[k-_>
that wouldn't be an issue, right?
<[k-_>
for &ri i mean
nini1294 has quit [Ping timeout: 265 seconds]
<tuor>
So I don't realy have an idea how to remove whitespaces and linebreaks from my xml file with out removing whitespaces in the strings (<a>string with space</a>). So how can i do it?
victortyau has joined #ruby
Liam` has quit [Ping timeout: 244 seconds]
centrx has joined #ruby
<[k-_>
regexp cant do it
<[k-_>
unless you want _HELL_
carlosoliveira has joined #ruby
Liam` has joined #ruby
dblessing has joined #ruby
bruno- has joined #ruby
<tuor>
[k-_, ah ok. I'll try.
<[k-_>
NO, DONT TRY WITH REGEXP
chouhoulis has joined #ruby
skade has joined #ruby
hoov has joined #ruby
<shevy>
he'll try [k-_
<tuor>
ah don't^^ sry didn't read well.
<[k-_>
NO DONT TRY!
<tuor>
I'll not.
shoutsid has joined #ruby
_ht has quit [Read error: Connection reset by peer]
<tuor>
So how?
Liam` has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 244 seconds]
<adaedra>
[k-_: well, are there commas in some of Ruby's methods?
<[k-_>
that would be illegal
dstarh has joined #ruby
<shevy>
you could via define_method or?
<adaedra>
shevy: you can, but is it done in stdlib?
tmtwd has joined #ruby
chouhoulis has quit [Remote host closed the connection]
Macaveli has quit [Read error: Connection reset by peer]
juanpaucar has joined #ruby
jonee has joined #ruby
Muhannad has joined #ruby
<shevy>
wielding, as weapon, a baguette
jeremy04 has joined #ruby
<shevy>
games are way too much work though
shoutsid has joined #ruby
DroidBurgundy has joined #ruby
troulouliou_div2 has joined #ruby
nhhagen has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 240 seconds]
lxsameer has quit [Quit: Leaving]
rakm has joined #ruby
TvL2386 has quit [Quit: Ex-Chat]
Liam` has joined #ruby
hinbody has joined #ruby
hinbody has quit [Read error: Connection reset by peer]
jimms has quit []
scripore has quit [Quit: This computer has gone to sleep]
fgo has quit [Ping timeout: 240 seconds]
paulcsmith___ has joined #ruby
A124 has quit [Ping timeout: 260 seconds]
havenwood has joined #ruby
<corpsicle>
does SCRIPT_DIR mean anything special in ruby ?
joonty has joined #ruby
jerius has joined #ruby
DroidBurgundy has quit []
A124 has joined #ruby
<[k-_>
>> SCRIPT_DIR
<ruboto>
[k-_ # => uninitialized constant SCRIPT_DIR (NameError) ...check link for more (https://eval.in/413173)
<[k-_>
nope
hinbody has joined #ruby
<corpsicle>
ok
<corpsicle>
thanks
Ropeney has joined #ruby
dimasg has quit [Ping timeout: 246 seconds]
arup_r has quit []
fgo has joined #ruby
bluOxigen has joined #ruby
blueOxigen has quit [Ping timeout: 246 seconds]
bigbadbear has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
duggiefresh has joined #ruby
d2dchat has quit [Remote host closed the connection]
scripore has joined #ruby
jenrzzz has joined #ruby
failshell has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tubuliferous_ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
pawnbox has joined #ruby
lalalaaa has joined #ruby
failshell has quit [Remote host closed the connection]
djbkd has joined #ruby
<lalalaaa>
Hi! How come gsub("^/", "").gsub("/", "_") doesn't change "/test/lala" to "test_lala"? I'm getting "_test_lala"..
yqt has joined #ruby
r_baron has quit [Changing host]
r_baron has joined #ruby
r_baron has quit [Changing host]
r_baron has joined #ruby
<[k-_>
that is because the first / is changed to _
<[k-_>
the one before "test"
A124 has quit [Ping timeout: 260 seconds]
<centrx>
lalalaaa, maybe because "^/" is not a regex?
<apeiros>
s/?/./
rbennacer has joined #ruby
<apeiros>
"^/" looks for literally a caret followed by slash
<lalalaaa>
aaah
<lalalaaa>
i see i see
A124 has joined #ruby
<apeiros>
%r{^/} or /^\// if you want "/" at beginning of line
casadei_ has joined #ruby
<[k-_>
/^\//
<corpsicle>
deosnt it look for a slash at the beginning of the string?
<centrx>
carrot and stick
banister has joined #ruby
<apeiros>
lalalaaa: also note that you probably should get into the habit of using \A, not ^
fgo has quit [Ping timeout: 264 seconds]
allcentury has joined #ruby
<apeiros>
^ is start of *line*, \A is start of string.
<adaedra>
better \A than ^, no?
<adaedra>
oh
<adaedra>
nvm
danzilio has joined #ruby
tubuliferous_ has quit [Ping timeout: 265 seconds]
sshuff|gone is now known as sshuff
danzilio has quit [Max SendQ exceeded]
denver has joined #ruby
j_mcnally has joined #ruby
djbkd has quit [Ping timeout: 246 seconds]
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lalalaaa>
indeed much better
danzilio has joined #ruby
freezevee has quit [Remote host closed the connection]
<lalalaaa>
*testing*
sevenseacat has quit [Quit: .]
umgrosscol has joined #ruby
MIGGERS has joined #ruby
<MIGGERS>
Hi
<lalalaaa>
awesome! many thanks apeiros, rest of y'all
danzilio has quit [Max SendQ exceeded]
<adaedra>
la la laaa ♫
tmtwd has joined #ruby
<lalalaaa>
adaedra: wow such a beautiful voice :P
<adaedra>
:)
<[k-_>
gah, he's back
danzilio has joined #ruby
RegulationD has joined #ruby
<adaedra>
Prepare for trouble
benlovell has quit [Ping timeout: 265 seconds]
<tuor>
I have a solution: the xml2 programm can do it. So I have a string and want run xml2 (from my ruby script) and give my string as input. How can I run an other programm in a ruby script?
halcyone3 has joined #ruby
<adaedra>
There's plenty of solutions
<adaedra>
You know there are ruby xml libraries, though?
<[k-_>
tuor, what is the problem you want to solve
<tuor>
[k-_, still the same. remove all unneed space and linebreak.
govg has joined #ruby
<[k-_>
why do you want to do that?
RegulationD has quit [Ping timeout: 255 seconds]
ryanpc has joined #ruby
<tuor>
[k-_, I'll explain the hole thing: I export a monitoring template and write it to a file. In the file it has to be readable (and easy to see diffs). Then I need to import it again, but the api don't accept my string if there are linebreaks...
<tuor>
(I don't know but I think the spaces are not ok to.)
<MIGGERS>
I HATE THE MIGGERS
<yorickpeterse>
MIGGERS: you can go now, nobody cares
<havenwood>
!mute MIGGERS
jbw__ has quit [Ping timeout: 246 seconds]
AnoHito_ has joined #ruby
<[k-_>
tuor: not allowing spaces is ridiculous
Dzejmskr_ has joined #ruby
<apeiros>
oh, our ever fascinated 3y old is back
<apeiros>
thanks havenwood
<tuor>
I just tryed to import the file (after pretty printing with REXML) and it didn't work.
relix has joined #ruby
benlovell has joined #ruby
prefixed has joined #ruby
<[k-_>
can you give us an excerpt of your file
cndiv has joined #ruby
<tuor>
Importing the file without pretty printing it first works.
<tuor>
sec
<yorickpeterse>
tuor: in Oga you could do something like this: `some_element.xpath('descendant::text()').map { |node| node.inner_text.strip }.inject(:+)`
jenrzzz has quit [Ping timeout: 240 seconds]
<Nilium>
This is reminding me of someone asking how to get Go's XML library to use self-closing tags in arbitrary cases because a particular XML parser on the receiving end of some data didn't understand certain tags unless they were self-closing..
<yorickpeterse>
That gives you all the text of a node (recursively) with leading/trailing whitespace removed
Dzejmskrokan has quit [Ping timeout: 256 seconds]
<tuor>
yorickpeterse, oh nice. Ok. I'll try.
MIGGERS has quit [Ping timeout: 246 seconds]
<yorickpeterse>
alternatively you can do `text = ''; some_element.each_node { |node| text << node.inner_text if node.is_a?(Oga::XML::Text) }`
AnoHito has quit [Ping timeout: 265 seconds]
<cndiv>
Hi all, brand new person here, and the documentation on this confuses me. Can someone teach me what the code is to create a .txt file (if it doesn't already exist) and add text to it? I'm making a simple app that makes a .txt with today's date, and takes entries.
<yorickpeterse>
which is probably a tad faster
<cndiv>
There's IO and Print and Open, and I'm confused on which or mulitple do I need.
chills42 has quit [Remote host closed the connection]
<[k-_>
you have spaces in <template>Template OS Linux</template>
<[k-_>
if you strip spaces, its gonna go WRONG!
<tuor>
[k-_, yes. Only spaces between the elements not in the elements strings.
hahuang61 has joined #ruby
<[k-_>
i dont think space would be an issue though
<[k-_>
i dont see any chunks of text
<cndiv>
Another question, are you all saying that the create and append are different bits of code? IE, I'll have to write something to handle that, as well?
<cndiv>
I'm like a week in here, obviously.
<adaedra>
We all began one day
scripore has quit [Quit: This computer has gone to sleep]
<cndiv>
:-)
chrissonar has quit [Remote host closed the connection]
<adaedra>
ruby's open is based on C fopen
<cndiv>
And soon enough I'll be great and help others.
astrobun_ has quit [Remote host closed the connection]
alotofnoodles has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
<adaedra>
you have the flag argument which determine what you will do with the file (read, write) and what to do if it exists or not (append, create, fail...)
<[k-_>
<tuor> Importing the file without pretty printing it first works.
<[k-_>
why dont you just give that then :o
ljt has quit [Read error: Connection reset by peer]
<tuor>
[k-_, yes.
<[k-_>
give it to the api!
blue_deref has joined #ruby
<tuor>
And all done. I just tryed pretty printing with Nokogiri and then I can import when I pretty print with REXML it can't.
ljt has joined #ruby
<tuor>
OK thx all for help! Man this was a waste of time^^
<allcentury>
I have a question, I have two different singleton classes that inherit from a base class. Should I also make that base class a singleton? I'm simply trying to share behavior/methods at this point.
govg has quit [Quit: leaving]
<canton7>
allcentury, do you want there to be a single instance of the base class throughout your entire application (in addition to the two single instances of its two children)?
<hj2007>
adaedra: that was it, thanks!
<adaedra>
yw
lalalaaa has quit [Quit: leaving]
<allcentury>
canton7: Right, that's the question I should be asking. I think the answer is no, it doesn't matter if that base class is instianted more than once. In my instance though, it could only get instantiated twice or in other words, it can only get instantiated the same amount of classes that it is the parent of - right?
<canton7>
allcentury, is anyone supposed to instantiate the base class directly?
<allcentury>
no
<canton7>
therefore noone can be supposed to access the base class directly, therefore having it singleton makes no sense
<canton7>
easy!
<allcentury>
lovely, thank you for the rubber-ducking canton7
lordkryss has joined #ruby
<canton7>
(a simpler question would have been 'will anyone ever type BaseClass.instance?')
rbennacer has quit [Read error: Connection reset by peer]
jgpawletko has joined #ruby
jgpawletko has quit [Client Quit]
Hounddog has quit [Read error: Connection reset by peer]
<cndiv>
apeiros: Another question from earlier. Your code is right, I think, but it doesn't *create* the file first, I don't think? I'm looking to create a file, and if it already exists, add to it.
mengu has joined #ruby
mengu has joined #ruby
fgo has joined #ruby
<adaedra>
cndiv: look at open flags :)
dr3w has quit [Quit: WeeChat 1.2]
aganov has quit [Remote host closed the connection]
dr3w has joined #ruby
momomomomo has joined #ruby
chipotles has quit [Ping timeout: 245 seconds]
<adaedra>
I think you want the "a" flag
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanpaucar has quit [Remote host closed the connection]
yh has joined #ruby
riotjones has quit [Remote host closed the connection]
<cndiv>
adaedra: flags are what goes in ( ) after the method, right?
nini1294 has quit [Ping timeout: 255 seconds]
<cndiv>
adaedra: and it has that, the error just says that file doesn't exist yet
s2013 has joined #ruby
nish1294 has joined #ruby
<adaedra>
cndiv: how do you open your file for writing?
rippa has joined #ruby
strixd has quit [Client Quit]
<cndiv>
adaedra: File.open("/thepahto/code/#{todays_date}", "a") do |fh| fh.puts "#{entry}" end
greenarrow has joined #ruby
quimrstorres has joined #ruby
<cndiv>
those two varables assign a date and what I enter in. Happy to show this in a pastebin
<adaedra>
And the error you get is?
<cndiv>
stamper.rb:24:in `initialize': No such file or directory
<cndiv>
stamper is the name of the thing I'm writing.
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
renanoronfle has quit [Ping timeout: 252 seconds]
<adaedra>
does the /thepatho/code/ directory exists?
tkuchiki has quit [Remote host closed the connection]
<cndiv>
yep, for sure, that's where the .rb file is
<adaedra>
be careful that this is an absolute path (so from /), not relative
<cndiv>
used pwd to make sure I'm doing it 100% right
ruby-lang343 has joined #ruby
chipotles has joined #ruby
<cndiv>
adaedra: I'm on a mac and it goes /Users/cndiv/MEGA/code/stamper
<cndiv>
does it need to start with volumes, etc?
dopamean_ has joined #ruby
<adaedra>
no
wpp has quit []
<adaedra>
what does `pwd` outputs?
ljt has quit [Read error: Connection reset by peer]
paulcsmith___ has quit [Quit: Be back later ...]
<cndiv>
sorry it outputs "/Users/cndiv/MEGA/code/stamper"
<adaedra>
so it's not /thepatho/code/
<cndiv>
adaedra: Sorry, I was protecting something for no reason. it's the one I just put
Philipp__ has quit [Read error: Connection reset by peer]
kies^ has quit [Ping timeout: 260 seconds]
<shevy>
ruby for happiness \o/
Coldblackice has quit [Ping timeout: 255 seconds]
allcentury has joined #ruby
Scroff has joined #ruby
msnyon has quit [Read error: Connection reset by peer]
dgutierrez1287 has joined #ruby
quimrstorres has quit [Remote host closed the connection]
denver has quit [Remote host closed the connection]
<bradland>
any recommendations for an amazon s3 gem that provides a filesystem like interface?
jenrzzz has joined #ruby
cball has joined #ruby
rbennacer has joined #ruby
h4ckurate has joined #ruby
quimrstorres has joined #ruby
jbw has quit [Ping timeout: 265 seconds]
lannonbr has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jbw has joined #ruby
benjwadams has joined #ruby
chipotles has quit [Ping timeout: 240 seconds]
mcgain has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
psy_ has joined #ruby
dgutierrez1287 has quit [Ping timeout: 272 seconds]
rehat_ has joined #ruby
<benjwadams>
what happens when two files are opened at nearly the same time with File.write "w+" mode?
psy_ has quit [Max SendQ exceeded]
<adaedra>
Depends
<apeiros>
benjwadams: I assume you left out "with the same path"?
psy_ has joined #ruby
jonee has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
<benjwadams>
yes
alotofnoodles has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
khebbie has quit [Remote host closed the connection]
<adaedra>
On Linux, you get two valid handles you can write in. Can be a mess with concurrent writes.
<benjwadams>
I didn't write the code, but I'm getting malformed XML that has one start element and two end elements and I suspect it's because two processes are attempting to write to the same file
<apeiros>
they'll both have the same file open then. and they'll interfere with each other. the cursor position will remain, but the content can get mixed.
<adaedra>
I think Windows would forbid you the second open.
<benjwadams>
yeah, that's what I thought
Iskarlar has joined #ruby
safeforge has quit [Remote host closed the connection]
<bradland>
benjwadams: that is often called interleaved writes
<adaedra>
A solution would be to lock the file, I think.
<bradland>
it's a common problem with logging too
safeforge has joined #ruby
<benjwadams>
so basically the ending content of the xml is staggered near the end and repeats, causing malformed xml
<bradland>
if you need atomic writes, you probably need to put something in front of the file writer that handles the atomic units to be written
<adaedra>
The best solution would be to not have shared write access, though.
momomomomo_ has joined #ruby
<benjwadams>
is there any way to do that via locks, etc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 255 seconds]
Lucky__ has joined #ruby
h4ckurate has quit [Quit: h4ckurate]
benlovell has quit [Read error: No route to host]
benlovell has joined #ruby
relix has joined #ruby
Scrofff has quit [Ping timeout: 256 seconds]
yqt has quit [Ping timeout: 245 seconds]
relix has quit [Client Quit]
afs has joined #ruby
riotjones has joined #ruby
duoi has quit [Ping timeout: 246 seconds]
momomomomo has quit [Quit: momomomomo]
symm- has joined #ruby
Scrofff has joined #ruby
danzilio has quit [Quit: My computer has fallen asleep!]
BTRE has quit [Read error: Connection reset by peer]
etqqkoiflwhb has quit [Quit: (null)]
govg has joined #ruby
nhhagen has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
yh has quit [Ping timeout: 265 seconds]
tubuliferous_ has joined #ruby
Scroff has quit [Ping timeout: 250 seconds]
yh has joined #ruby
niiamon has joined #ruby
scripore has joined #ruby
duoi has joined #ruby
gambl0re has quit [Remote host closed the connection]
BTRE has joined #ruby
gambl0re has joined #ruby
failshell has joined #ruby
lapideviridi has joined #ruby
_blizzy_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 246 seconds]
Dzejmskr_ has quit [Remote host closed the connection]
anisha has quit [Quit: Leaving]
gxm has quit []
rbennacer has joined #ruby
Dzejmskrokan has joined #ruby
ascarter has joined #ruby
lapide_viridi has quit [Ping timeout: 260 seconds]
nhhagen has quit [Remote host closed the connection]
jbw has quit [Ping timeout: 250 seconds]
changelog has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
gambl0re has quit [Remote host closed the connection]
pawnbox_ has joined #ruby
gambl0re has joined #ruby
msnyon has joined #ruby
imperator has joined #ruby
Dzejmskrokan has quit [Ping timeout: 272 seconds]
pawnbox has quit [Ping timeout: 250 seconds]
Scrofff is now known as scroff
_blizzy_ has joined #ruby
senayar has quit []
bruno- has joined #ruby
paulcsmith___ has quit [Quit: Be back later ...]
jbw has joined #ruby
shoutsid has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 244 seconds]
msnyon has quit [Read error: Connection reset by peer]
paulcsmith___ has joined #ruby
michaeldeol has joined #ruby
shoutsid has joined #ruby
shoutsid has quit [Remote host closed the connection]
shoutsid has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
khebbie has joined #ruby
momomomomo has joined #ruby
ferhaty has joined #ruby
shoutsid06 has joined #ruby
khebbie has quit [Remote host closed the connection]
ferhaty has quit [Client Quit]
tcrypt has quit []
jlebrech_ has joined #ruby
niiamon has quit [Read error: Connection timed out]
dfockler has joined #ruby
<jlebrech_>
anyone use Threads? I've been using sidekiq but realised all i needed was stuff to be async
<adaedra>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
jonee has joined #ruby
<suchness>
jlebrech_: That's king of a scary comment.
<suchness>
kind of*
shoutsid has quit [Ping timeout: 256 seconds]
niiamon has joined #ruby
<jlebrech_>
adaedra: sorry
<dfockler>
jlebrech_: I use a lib, because it's tough to tell what will be thread safe
<jlebrech_>
dfockler: makes sense
<suchness>
jlebrech_: To answer your question though, yes people here have used threads.
moted has joined #ruby
baweaver has joined #ruby
govg has quit [Ping timeout: 250 seconds]
<dfockler>
jlebrech_: if you aren't sharing any resources between threads and what you're doing is really simple, then you could probably get away with it
<jlebrech_>
kinda want something in a queue but not in a queue, just it to be async in the simplest way.
govg has joined #ruby
<changelog>
jlebrech_: so you want to do it in the web process?
<jlebrech_>
yeah it's just run this method and forget
d2dchat has quit [Remote host closed the connection]
greenarrow has quit [Quit: 500]
quimrstorres has quit [Remote host closed the connection]
<changelog>
that’s probably a bad idea because if you deploy that progress gets lost and isn’t “requeued"
tkuchiki has quit [Remote host closed the connection]
<jlebrech_>
changelog: yeah, it's just run this method that sends a request to an api
<imperator>
have any rexml conversion wrappers already been written?
mleung has joined #ruby
<changelog>
if you already have sidekiq setup it’s probably best to leave it :-)
<benjwadams>
if I'm using File.open { |f| f.flock(File::LOCK_EX); #some other commands... } and then something goes wrong/exception occurs, is the lock released as well?
<changelog>
just be mindful about the state thing. better to call delay on a class method where you pass teh arguments in than it is to force it to serialize the whole state into redis.
quimrstorres has quit [Remote host closed the connection]
<imperator>
benjwadams, good question; i think you could test it by trying to get another lock on it
polpak has joined #ruby
mdavid613 has joined #ruby
<imperator>
use flock(File::LOCK_NB|File::LOCK_EX) and see what it returns after an exception
<imperator>
if false, then it still has the lock
<benjwadams>
imperator, so i could test by intentionally raising an exception or something and then trying to open
<imperator>
yep
rbennacer has quit [Remote host closed the connection]
hanmac has quit [Ping timeout: 244 seconds]
ramfjord has joined #ruby
<imperator>
i would think it would be released, since the block is only held within the block
<imperator>
but if you swallow an exception within the block...not sure
<imperator>
my guess (because I'm lazy) is that it would retain the lock
baroquebobcat has quit [Quit: baroquebobcat]
saddad has joined #ruby
<imperator>
since the *lock is only held within the block
towski_ has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 250 seconds]
<adaedra>
you should keep the locks only for the time of write
govg has quit [Ping timeout: 246 seconds]
A124 has quit [Ping timeout: 260 seconds]
bricker has joined #ruby
A124 has joined #ruby
<benjwadams>
don't the locks get cleaned up after leaving the block?
<benjwadams>
i'm gonna find out i guess
<imperator>
yep, should
RobertBirnie has joined #ruby
iTrace has joined #ruby
spider-mario has joined #ruby
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cvtsx has quit [Read error: Connection reset by peer]
krz has quit [Ping timeout: 244 seconds]
[Butch] has joined #ruby
<iTrace>
Anybody know of an open source Ruby on Rails CMS project? I want something that could rival WordPress. Anybody know of such a project?
<[k->
wordpress has bugs, automatically striked off!
<suchness>
iTrace: I wish I could publish the one I have been writing over the last 5 years.
<shevy>
iTrace #rubyonrails should be able to help more. I think there are individual projects but probably none have a full rival CMS like to drupal wordpress or joomla
<[k->
does Jekyll count? i dont know
willywos has joined #ruby
<[k->
i dont even know what jekyll or cms do!
<suchness>
iTrace: But you know how companies like their tech!
pietr0 has joined #ruby
<dfockler>
iTrace: refinery, locomotive
danzilio has joined #ruby
casadei_ has quit [Remote host closed the connection]
<suchness>
dfockler: I have heard good things about locomotive
pdoherty has joined #ruby
<shevy>
[k- things such as site-login, blogging and ... I don't know what else. I am reading this right now https://canned-death.us/drupal/node/8 which apparently is using drupal
<shevy>
if only ruby would enter the www world
<adaedra>
kof kof
<centrx>
.l.
benlovell has joined #ruby
<iTrace>
Thanks all. I was thinking about building something from scratch with Active Admin, but I thought I'd check if there was a good base project I could pull from.
<dfockler>
iTrace: spina is a in-the-works cms that looks nice
chouhoulis has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 264 seconds]
<iTrace>
Never heard of spina
skade has quit [Quit: Computer has gone to sleep.]
hanmac has joined #ruby
jonee has joined #ruby
momomomomo has quit [Ping timeout: 244 seconds]
<iTrace>
dfockler: Spina does looks nice. Thanks!
<shevy>
spinacce!
freerobby has joined #ruby
momomomomo has joined #ruby
jhack has joined #ruby
<benjwadams>
imperator: looks like the lock is released when the block exits or an exception happens
<imperator>
benjwadams, good to know :)
mary5030_ has joined #ruby
<darix>
iTrace: just to throw something into the mix: jekyll or nanoc are for many sites really enough
mikecmpbll has quit [Ping timeout: 246 seconds]
troulouliou_div2 has joined #ruby
<darix>
iTrace: and you have less burden on the hosting part
nettoweb has joined #ruby
<darix>
iTrace: https://pixls.us/ - fully static except for comments comming from discourse
mary5030 has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
mary5030_ has quit [Read error: Connection reset by peer]
<iTrace>
darix: nanoc looks interesting.
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
serivich has quit [Ping timeout: 250 seconds]
<darix>
they are both similar
Dzejmskrokan has joined #ruby
paulcsmith___ has quit [Quit: Be back later ...]
devoldmx_ has joined #ruby
baweaver has quit [Remote host closed the connection]
casadei_ has joined #ruby
mary5030 has quit [Remote host closed the connection]
paulcsmith___ has joined #ruby
mary5030 has joined #ruby
A124 has quit [Ping timeout: 260 seconds]
stan has quit [Ping timeout: 244 seconds]
j4cknewt has joined #ruby
failshell has quit [Remote host closed the connection]
leafybasil has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 252 seconds]
A124 has joined #ruby
govg has joined #ruby
towski_ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
chthon has quit [Ping timeout: 244 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jhack has quit [Remote host closed the connection]
mary5030_ has joined #ruby
Rollabunna has joined #ruby
youch has joined #ruby
iamjarvo has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
c0m0 has quit [Ping timeout: 264 seconds]
f4cl3y__ has quit [Ping timeout: 260 seconds]
pengin has joined #ruby
dopamean_ has quit [Quit: Leaving...]
mhib has quit [Ping timeout: 255 seconds]
tkuchiki has joined #ruby
nhhagen has joined #ruby
mary5030 has quit [Ping timeout: 260 seconds]
jerius has quit [Quit: /quit]
dgutierrez1287 has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
mikecmpbll has joined #ruby
A124 has quit [Ping timeout: 260 seconds]
A124 has joined #ruby
dopie has joined #ruby
justicefries has joined #ruby
Trynemjoel has quit [Ping timeout: 245 seconds]
Trynemjoel has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
tkuchiki has quit [Remote host closed the connection]
platzhirsch has quit [Ping timeout: 246 seconds]
safeforge has quit [Remote host closed the connection]
<ddfreyne>
\o/ nanoc
<ddfreyne>
(I do not have a highlight for nanoc)
keeguon has quit [Ping timeout: 246 seconds]
saltsa has quit [Ping timeout: 244 seconds]
<raz>
nanoc is terrible
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amclain has joined #ruby
<raz>
middleman is slightly less terrible
<raz>
the landscape of static site generators is pretty sad
<ddfreyne>
What makes it terrible?
safeforge has joined #ruby
<raz>
it's a confused design and a convoluted architecture
platzhirsch has joined #ruby
<raz>
once you go beyond a few dozen pages you run into performance issues
freerobby has quit [Quit: Leaving.]
<raz>
like, ruby is slow as a pig to begin with, but nanoc can easily chew *minutes* to generate a bunch of html...
f4cl3y__ has joined #ruby
saltsa has joined #ruby
<ddfreyne>
Yeah, I can understand that. nanoc 4 addresses some of those concerns (it gets rid of the confusing identifiers).
nish1294 has quit [Ping timeout: 265 seconds]
pengin has quit []
<ddfreyne>
As for speed… I’ve managed to generate thousands of pages in a minute. It depends on the filters you use, most of the time.
* raz
currently reaches for harp when making static sites
<raz>
yea the problem is that its rather easy to hit a combination that grinds nanoc to effectively a stop
jsrn has quit [Ping timeout: 244 seconds]
<raz>
and then it's very hard to workaround the brain damaged design
tomphp_ has joined #ruby
* raz
been there, got the t-shirt
shlomo has joined #ruby
jhack has joined #ruby
<raz>
and the annoying part is that it only happens after you're already pretty invested into it
<raz>
it's a trap! ;)
Musashi007 has joined #ruby
codecop has quit [Remote host closed the connection]
<ddfreyne>
raz: disclaimer: I am the author of nanoc. I'm always interested in feedback though :)
<raz>
ddfreyne: ouch, sorry lol
jobewan has joined #ruby
<raz>
well we actually had an exchange about that years ago when nanoc came crashing down on me ;)
<raz>
on github
mhib has joined #ruby
<raz>
i don't remember the exact details.. but to cut you some slack: middleman collapsed in similar ways not very long after ;)
xelim has quit [Remote host closed the connection]
<ddfreyne>
A goal I have for nanoc 4 is for it to be not memory-based, so it doesn't have to deal with garbage collection issues. It's the main bottleneck.
troyready has quit [Read error: Connection reset by peer]
<[k->
oh shit buuuuuuuuuuuuuurn
<[k->
sorry bro
<raz>
yea, iirc that was part of the issue, it would balloon to OOM at some point
A124 has quit [Ping timeout: 260 seconds]
Overand has joined #ruby
<ddfreyne>
It's surprisingly difficult to build a static site generator that has the flexibility of nanoc while also being fast.
jsrn has joined #ruby
<raz>
well i dunno really.. imho it tries to do too much
<ddfreyne>
(The nanoc 3.x design didn't give me much space to fix things either. But then again, that architecture lasted for 6 years.)
A124 has joined #ruby
<ddfreyne>
raz: What would you remove?
millerti has joined #ruby
<raz>
its terribly hard to find a site gen that simply compiles from source to destination, minifies the assets on the destination, and leaves it at that
<raz>
ddfreyne: well, all the world-building efforts
<atmosx>
raz: in what way is middleman terrible?
<raz>
atmosx: oh god this is turning into a roundhouse rant... lol
<atmosx>
raz: ah k, worry not.
<raz>
atmosx: getting it to work (and keeping it working) is the first problem, when less etc, gets involved
jackjackdripper has joined #ruby
dfockler has quit [Remote host closed the connection]
<atmosx>
okay, it's the same kind of problem that have all static website generators currently in existence I guess.
juanpaucar has joined #ruby
platzhirsch has quit [Ping timeout: 265 seconds]
<raz>
and it also has this problematic ambition to maintain an internal image of all interdependencies and what not
<atmosx>
raz: I don't thin it was made for huge websites
<raz>
ddfreyne: the rules file, it shouldn't exist :)
<atmosx>
but for small corporate websites, front-ends etc, works well IMHO.
f4cl3y__ has quit [Ping timeout: 240 seconds]
<ddfreyne>
raz: Keeping track of dependencies is useful for speeding up compiles (avoid recompiling when possible). It's hard to get right, but I find it really useful.
<raz>
atmosx: yeh.. i'm a bit of a hardcore user.. it's just annoying when simple things that *should* work suffocate from their own bloat ;)
maq has joined #ruby
paulcsmith___ has quit [Quit: Be back later ...]
<atmosx>
raz: well, there's sinatra.
<ddfreyne>
raz: What would you rather have than a rules file?
<raz>
ddfreyne: the filesystem has timestamps for that
<raz>
ddfreyne: no rules file, most static site gens do without such
<atmosx>
You can always write your own website, there are other projects that are less hardcore than sinatra..
shoutsid has joined #ruby
jsrn has quit [Ping timeout: 252 seconds]
<ddfreyne>
raz: Where would you specify how certain pages or assets are processed?
djbkd has joined #ruby
<raz>
ddfreyne: why would that need to be specified?
<raz>
the filename extension goes a pretty long way
paulcsmith___ has joined #ruby
devoldmx_ has quit [Ping timeout: 256 seconds]
<ddfreyne>
raz: How would you specify which markdown processor to use? Whether or not to minify? Colorize syntax? Run a typography-improving script? ...
nhhagen has quit [Remote host closed the connection]
<ddfreyne>
raz: Mind you, nanoc is designed to be flexible and not make assumptions about what you want to do with the input files. I try to keep it as opinion-free as possible
<raz>
ddfreyne: why would i want to run different md processors per file? why would i not want to minify? colorizing syntax and typography improving sounds like javascript to me
d2dchat has joined #ruby
hj2007 has quit [Quit: This computer has gone to sleep]
jerius has joined #ruby
hj2007 has joined #ruby
<raz>
ddfreyne: good software is opinionated :P
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<raz>
imho that one is pretty close to getting it right
<raz>
sadly it's javascript :x
<[k->
the ruby of the cms world
<ddfreyne>
raz: I like it when software gives you possibilities, and you fill in the blanks. Having to resort to JS for colorizing syntax and improving typography can be a good thing, but I don't want to be limited to that.
TomyLobo has joined #ruby
skade has joined #ruby
niiamon has quit [Remote host closed the connection]
<raz>
ddfreyne: well, i'd argue on the other side 99% of your users would prefer not to learn an awkward config DSL only to render an index.html
djbkd has quit [Remote host closed the connection]
dopamean_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
<raz>
i recall it had a lot of gotchas and counter-intuitive semantics even for supposedly trivial cases
Muhannad has quit [Ping timeout: 240 seconds]
<raz>
getting stuff like that right is very hard, so it's best avoided until it's absolutely inevitable, imho
A124 has quit [Ping timeout: 260 seconds]
jsrn has joined #ruby
A124 has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
rbennacer has quit [Ping timeout: 245 seconds]
<atmosx>
raz have you tried creatinga website the way you want with something like Scorched or Sinatra?
<raz>
atmosx: yes, i'm an old fart, i've used pretty much everything you've ever heard of ;)
<raz>
all the way from java struts and perl mojo
iamjarvo has joined #ruby
dfockler has joined #ruby
<atmosx>
raz: what about rubyonrails?
<atmosx>
lol
<ddfreyne>
raz: For simple sites, I generally don't even recommend using nanoc myself--it's designed to be flexible, and it is overkill for simple sites.
<raz>
heh yes, that's what i use most for sites that need logic
skade has quit [Client Quit]
marsjaninzmarsa is now known as Guest42321
ascarter has joined #ruby
<raz>
ddfreyne: yea well, its a philosophical argument... i just really don't see nanoc's niche when harp can be used ;)
failshell has joined #ruby
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ddfreyne>
Even though it’s written in JavaScript? ;)
changelog has quit [Quit: changelog]
<raz>
but it's not like there's a law that there can be only one framework for x
djbkd has joined #ruby
<raz>
ddfreyne: well, javascript is the pest.. but it has going for it that a render pass takes 0.1s, whereas with nanoc the same render pass would be somewhere around 15s
darkf has quit [Quit: Leaving]
<towski_>
I am getting a segmentation fault with 2.0.0
<ddfreyne>
raz: If nanoc is that slow, I'd look at the filters you used (that's where the vast majority of the slowness lies)
<towski_>
Segmentation fault: 11
<havenwood>
towski_: Use the latest patch release of 2.0, or better yet 2.1 or 2.2.
<raz>
havenwood: looks like sinatra, at a glance? :)
<havenwood>
towski_: 2.0 is in maintenance mode.
ramfjord has quit [Ping timeout: 246 seconds]
<towski_>
how do I get a core dump tho?
bruno- has joined #ruby
<raz>
ddfreyne: no matter how much you tweak it, ruby just doesn't go as fast as javascript, not even remotely the same ballpark ;)
<towski_>
another big complaint about ruby is that it has classes
<towski_>
classes are so gay
iTrace has quit [Quit: (null)]
* raz
likes classes
<[k->
haskell!
Jackneill has joined #ruby
bronson has joined #ruby
<havenwood>
towski_: that's a terrible way to express disapproval of classes :(
<raz>
maybe it wasn't even disapproval?
<raz>
;)
<havenwood>
raz: ;)
<raz>
who knows what side of the fence towski_ lives
benlovell has quit [Ping timeout: 265 seconds]
<wmoxam>
...
<ddfreyne>
towski_: Please don’t use “gay” as an insult.
graydot has joined #ruby
rbennacer has joined #ruby
<havenwood>
raz: It's easy to port a Sinatra app to Roda. The plugin system is powerful and I love how Roda keeps things clean.
skade has joined #ruby
<raz>
havenwood: i've lost interest in reinventing my own rails after spending too much time with padrino ;)
<havenwood>
raz: Its core is just a routing tree. You can go through each plugin and cherry pick them to build what you need.
<raz>
sinatra is good enough for tiny api shims and such that don't need big performance or features
<havenwood>
raz: It's a very different beast than Padrino.
<raz>
anything beyond that you'd better reach for something either more performant, or more fully featured
graydot has quit [Client Quit]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
<havenwood>
raz: I use Roda for APIs indeed but the author, Jeremy Evans, uses it for large webapps.
<raz>
havenwood: if you're at the point of cherry picking, and want to do it in ruby, just use rails and save yourself the hassle to port it later :)
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rakm_ has joined #ruby
<raz>
keeping rails patched up is enough work of its down.. doing it on a homebrew conglomerate of gems is unsustainable
skade has quit [Client Quit]
prettiestPony11 has joined #ruby
<havenwood>
raz: I'd rather have a carefully crafted Roda app backed by Sequel than trying to make Rails work for whatever purpose it wasn't really created for (unless you're making a Basecamp clone).
tubuliferous_ has joined #ruby
atomical has joined #ruby
<raz>
havenwood: i think everyone goes through that phase. ;)
casadei_ has quit [Remote host closed the connection]
mary5030 has joined #ruby
nish1294 has joined #ruby
<havenwood>
raz: So you're in the monolith stage?
rakm has quit [Ping timeout: 245 seconds]
skade has joined #ruby
<havenwood>
raz: Couple everything?
graydot has joined #ruby
<raz>
no, quite the opposite
vickleton has joined #ruby
<havenwood>
raz: With Rails? The opposite?
<havenwood>
raz: Do tell...
lele has joined #ruby
<raz>
well, as terrible as it is, rails is the best frontend framework you can use atm
<raz>
its relatively mature (been hard enough), easy to hire for
<towski_>
sorry for dropping the g bomb. apparently if you do a let(:variable){ variable } in rspec it seg faults
<raz>
arguably django and a few others are also up there
<havenwood>
towski_: 2.0 is in maintenance mode but the early releases were prone to segfault.
tubuliferous_ has quit [Ping timeout: 260 seconds]
mary5030_ has quit [Ping timeout: 246 seconds]
AlphaAtom has joined #ruby
<havenwood>
towski_: 2.0 doesn't receive bug fixes anymore and will be EoLed in Feb.
<havenwood>
towski_: If you can, switch to 2.1 or 2.2 at once.
<havenwood>
towski_: At the very least, switch to the latest patch release of 2.0.
freerobby has joined #ruby
Guest24 has quit [Ping timeout: 256 seconds]
<havenwood>
raz: Lotus and Roda are lovely and are great for real work. Good to have high quality options.
NeverDie has joined #ruby
shadoi has joined #ruby
<raz>
havenwood: yea we're just from different angles, would you launch a company on lotus or ronda? ;)
<havenwood>
raz: Yes. Roda*
pietr0_ has joined #ruby
<raz>
heh... oh well
<towski_>
last time we upgraded from ruby 2.0 there was a memory issue
NeverDie has quit [Client Quit]
<towski_>
although I assume that's probably fixed
<towski_>
there is just higher priority stuff to do
<havenwood>
towski_: 2.2.2 is a very good option.
<havenwood>
towski_: Get off 2.0 before you're forced. It's time is coming to an end.
<towski_>
thanks
<towski_>
that's dramatic
skade has quit [Quit: Computer has gone to sleep.]
<havenwood>
towski_: 2.1.6 or 2.2.2
<havenwood>
tick tock
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pietr0 has quit [Ping timeout: 250 seconds]
pietr0_ is now known as pietr0
<scpike>
havenwood: I'd love to see an open source "complicated web app" written in one of these microframeworks / as services. Learned a lot about rails from reading the redmine source
changelog has joined #ruby
scroff has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
scpike: Aye. Jeremy has mentioned he'd like to make a good large example available.
mary5030 has quit [Read error: Connection reset by peer]
<scpike>
havenwood: cool I'll check it out
tcopeland has quit [Quit: Leaving.]
AlphaAtom has joined #ruby
tvw has quit []
user1138 has quit [Remote host closed the connection]
Lucky__ has joined #ruby
Muhannad has joined #ruby
suchness has quit [Ping timeout: 256 seconds]
user1138 has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Musashi007_ has joined #ruby
mary5030_ has quit [Remote host closed the connection]
<jhack>
is there a frontend dev channel?
mary5030 has joined #ruby
graydot has quit [Quit: graydot]
jlebrech_ has quit [Remote host closed the connection]
Musashi007 has quit [Ping timeout: 244 seconds]
Musashi007_ is now known as Musashi007
kaleido has joined #ruby
bodgix has left #ruby [#ruby]
tomphp_ has quit [Ping timeout: 240 seconds]
mdavid613 has quit [Quit: Leaving.]
<havenwood>
jhack: There's ##javascript and #css, ah or there is actually a ##frontend.
graydot has joined #ruby
troulouliou_div2 has quit [Ping timeout: 240 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gambl0re>
can i pm you?
speakingcode has joined #ruby
<havenwood>
gambl0re: If you need an OP, otherwise ask in the channel. ;)
mdavid613 has joined #ruby
<gambl0re>
whats op
Synthead has joined #ruby
<havenwood>
gambl0re: A staff operator for the channel.
ramfjord has joined #ruby
hahuang65 has joined #ruby
<gambl0re>
remember you helped me setting up ruby/rails and all the other stuff
<gambl0re>
it was long time ago
<havenwood>
gambl0re: If you ask here other folk can maybe give better answers than me, learn from the answers, etc.
<havenwood>
gambl0re: Glad to help!
ne1l has joined #ruby
<gambl0re>
ok
j_mcnally has joined #ruby
ne1l is now known as Guest41819
conor_ has quit [Remote host closed the connection]
Guest41819 has quit [Client Quit]
Guest41819 has joined #ruby
Guest41819 has quit [Read error: Connection reset by peer]
<havenwood>
gambl0re: Ruby actually has UnboundMethods but typically a Method is bound to an Object.
jbw has quit [Ping timeout: 246 seconds]
jbw has joined #ruby
jsrn has quit [Ping timeout: 246 seconds]
umop3plsdn has joined #ruby
j_mcnally has quit [Ping timeout: 240 seconds]
conor_ has joined #ruby
umop3plsdn is now known as Guest61290
mary5030 has quit [Remote host closed the connection]
<havenwood>
scpike: "Unfortunately, all of my large Roda apps are proprietary... But in general they use multi_route for splitting up the routing tree by the initial segment."
<havenwood>
(The multi_route plugin.)
msnyon has joined #ruby
fantazo has joined #ruby
halcyone3 has quit [Ping timeout: 240 seconds]
<havenwood>
^ from the #roda channel
Rollabunna has quit [Ping timeout: 244 seconds]
scroff has joined #ruby
Dzejmskr_ has joined #ruby
relix has joined #ruby
j4cknewt has joined #ruby
Dzejmskrokan has quit [Ping timeout: 245 seconds]
baroquebobcat has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
nettoweb has joined #ruby
<gambl0re>
a method is a function in javascript, a hash is a object in javascript
reset has joined #ruby
<gambl0re>
symbol im not sure what it is in javascript...
bthesorceror has joined #ruby
<havenwood>
gambl0re: They're all objects in Ruby. :)
<BraddPitt>
roda is like Spray routing from what I can tell
<gambl0re>
why is it called a method and not a function
<gambl0re>
is there any difference between the two for those that know javascript
gard has joined #ruby
nish1294 has quit [Read error: Connection reset by peer]
<BraddPitt>
no, gambl0re
<BraddPitt>
Except for how javascript treats functions (first class objects) that can be passed around
<BraddPitt>
think Procs in ruby
kirun has joined #ruby
niiamon has joined #ruby
Cust0sLim3n has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Ping timeout: 252 seconds]
<gambl0re>
symbols are mainly used for creating hash names?
<bradland>
gambl0re: the difference in terminology has to do with the origins and philosophies of javascript versus ruby
<bradland>
if you run String.ancestors in your local irb, you may get a different list
<bradland>
havenwood: that is slick
yardenbar has quit [Remote host closed the connection]
Dzejmskr_ has quit [Remote host closed the connection]
lwu has joined #ruby
DroidBurgundy has quit [Ping timeout: 240 seconds]
<havenwood>
bradland: Shows well how the class of a module is class and its superclass is module whose superclass is object, which includes kernel whose class is module.
maq has quit [Quit: maq]
dopie has joined #ruby
A124 has quit [Ping timeout: 260 seconds]
joneshf-laptop has quit [Ping timeout: 265 seconds]
A124 has joined #ruby
yardenbar has joined #ruby
cornerma1 has joined #ruby
baweaver has joined #ruby
tvw has quit [Remote host closed the connection]
<dfockler>
O_o
towski_ has quit [Read error: Connection reset by peer]
AlphaAtom has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
towski_ has joined #ruby
graydot has quit [Quit: graydot]
ponga has quit [Quit: Connection closed for inactivity]
rbennace_ has joined #ruby
toretore has joined #ruby
user1138 has quit [Remote host closed the connection]
quimrstorres has joined #ruby
cornerman has quit [Ping timeout: 246 seconds]
AlexRussia has quit [Read error: Connection reset by peer]
cornerma1 is now known as cornerman
scripore has joined #ruby
nhhagen has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby
rbennacer has quit [Ping timeout: 250 seconds]
nhhagen has quit [Remote host closed the connection]
nhhagen has joined #ruby
finisherr has joined #ruby
ragingcake_ has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
hoov has quit [Quit: Leaving]
safeforge has quit [Remote host closed the connection]
user1138 has joined #ruby
user1138 has quit [Remote host closed the connection]
lian_ has joined #ruby
lian_ has quit [Client Quit]
lian_ has joined #ruby
lian_ is now known as lianj
lianj has quit [Changing host]
lianj has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonee has quit [Ping timeout: 272 seconds]
Lingo has joined #ruby
davedev2_ has joined #ruby
dr3w has quit [Read error: Connection reset by peer]
Dzejmskrokan has joined #ruby
dr3w has joined #ruby
davedev24 has quit [Ping timeout: 240 seconds]
Lingo has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
Lingo has joined #ruby
khebbie has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
baroquebobcat has joined #ruby
scripore has joined #ruby
symm- has joined #ruby
khebbie has quit [Ping timeout: 252 seconds]
arup_r has joined #ruby
Oka has joined #ruby
nhhagen has quit [Remote host closed the connection]
JoshL has quit [Read error: No route to host]
JoshL has joined #ruby
khebbie has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
shoutsid has quit [Read error: Connection reset by peer]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s2013 has quit [Ping timeout: 245 seconds]
shoutsid has joined #ruby
safeforge has joined #ruby
DLSteve has joined #ruby
scripore has quit [Ping timeout: 246 seconds]
devoldmx_ has joined #ruby
jonee has joined #ruby
mordocai has joined #ruby
yardenbar has quit [Ping timeout: 252 seconds]
Muhannad has quit [Ping timeout: 244 seconds]
AlphaAtom has joined #ruby
mhib has quit [Ping timeout: 256 seconds]
atomical has joined #ruby
<TomyLobo>
rails allows specifying methods as Class#method. I've also seen the manuals and people here reference methods in similar ways. is there some way to get a method reference from that?
PaulCapestany has quit [Ping timeout: 255 seconds]
<bradland>
TomyLobo: not sure what you mean by a "method reference"?
<TomyLobo>
i tried method('String#ancestors'), but it wont work
<bradland>
as in, documentation?
<bradland>
oh
A124 has quit [Ping timeout: 260 seconds]
abcd1234 has quit [Ping timeout: 246 seconds]
Blaguvest has joined #ruby
<bradland>
so, Object#method is just a means of communicating documentation
<bradland>
it's not actual code
AlphaAtom has quit [Client Quit]
<bradland>
the hash means it's a class method
<bradland>
derp
<bradland>
instance method
<apeiros>
String.instance_method(:ancestors)
<bradland>
a double colon means class method
AlphaAtom has joined #ruby
<apeiros>
and yes, it's just the common way to denote an instance method
<imperator>
yorickpeterse, worse, it would be a REXML compat layer, but ok :)
A124 has joined #ruby
<Sou|cutter>
bradland: I usually use . for class method
<bradland>
there are many ways to communicate method type, but the official ruby docs use ::method
<Sou|cutter>
:: I use for namespacing
ItSAN____ has quit [Quit: Leaving...]
<Sou|cutter>
fair enough
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
abcd1234 has joined #ruby
mase-chatter has joined #ruby
iamjarvo has joined #ruby
<hanmac>
File.size is ambiguous in ri and does show you both, File#size and File::size are more specific
Lingo has quit [Quit: (null)]
niiamon has joined #ruby
nahtnam has joined #ruby
<bradland>
@s3.list_objects(bucket: S3_BUCKET, delimiter: S3_DELIMITER, prefix: "#{@instance}/#{@instance}_backup/").each do |response| response.content.keys.map(&:key).pop
<bradland>
end
<bradland>
sry
diegoviola has joined #ruby
jhack has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
<BraddPitt>
yeah, I use :: for namespacing, # for instance and . for class
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
<Sou|cutter>
while potentially ambiguous, I guess it's worth knowing that some of us use it that way
A124 has quit [Ping timeout: 260 seconds]
Trynemjoel has quit [Ping timeout: 250 seconds]
niiamon has quit [Ping timeout: 255 seconds]
<imperator>
little did we know that Brad Pitt was a Ruby programmer on the side
A124 has joined #ruby
Musashi007 has quit [Ping timeout: 240 seconds]
Trynemjoel has joined #ruby
<TomyLobo>
my bullshit detector is ringing
tubuliferous_ has quit [Ping timeout: 250 seconds]
chills42 has quit [Remote host closed the connection]
dfockler has joined #ruby
baweaver has quit [Remote host closed the connection]
failshell has quit [Remote host closed the connection]
<jhass>
?code allcentury
<ruboto>
allcentury, We can't help you without your code, please post it to https://gist.github.com
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
j4cknewt_ has joined #ruby
krz has joined #ruby
atomical has quit [Ping timeout: 255 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mdavid613 has joined #ruby
conor_ has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
skade has joined #ruby
j4cknewt has quit [Ping timeout: 244 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
allcentury has quit [Ping timeout: 260 seconds]
AlphaAtom has joined #ruby
<apeiros>
jhass: seems like they didn't like the idea of showing code…
TheHodge has joined #ruby
rideh has quit [Quit: zap]
<jhass>
heh, I simply came too late
nhhagen has quit [Remote host closed the connection]
benlovell has joined #ruby
brendan- has quit [Remote host closed the connection]
<apeiros>
yeah, 3min delayed response. teh horror.
kidoz has quit [Read error: Connection reset by peer]
iateadonut has quit [Quit: Leaving.]
n008f4g_ has joined #ruby
kidoz has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
danzilio has quit [Quit: My computer has fallen asleep!]
ItSANgo has joined #ruby
Neon has joined #ruby
gambl0re has quit [Ping timeout: 255 seconds]
kidoz_ has joined #ruby
zacstewa_ has joined #ruby
_reset has joined #ruby
changelog_ has joined #ruby
d2dchat_ has joined #ruby
yh__ has joined #ruby
rbennace_ has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
mordocai` has joined #ruby
gard has joined #ruby
reset has quit [Ping timeout: 245 seconds]
gambl0re has joined #ruby
<Neon>
I'm trying to set something up with rb-inotify. The example (http://www.rubydoc.info/github/nex3/rb-inotify/INotify/Notifier) makes this pretty straightforward, but I have a problem. I watch for two different events and if any of them triggers once I want the whole notifier to stop watching. I tried calling event.watcher.notifier.close in the watcher's block and it gives me a EBADF (bad file descriptor) in IO#readpartial,
<Neon>
called from some rb-inotify method.
cookiez has quit [Ping timeout: 245 seconds]
ItSANgo has quit [Client Quit]
cookiez has joined #ruby
rbennacer has quit [Ping timeout: 245 seconds]
brianpWins has quit [Ping timeout: 245 seconds]
<adaedra>
I would need a way to create fake web requests (rack-style) for tests
Muhannad has quit [Read error: Connection reset by peer]
skade has quit [Quit: Computer has gone to sleep.]
<centrx>
nlsun, I thought it was done through scripts in /etc/bash_completion.d for example, but maybe there is some kind of interface the shell can use to interrogate it out of the ruby script
Trynemjoel has joined #ruby
<adaedra>
Or just it formats it well enough for shells to parse it
<adaedra>
given zsh's shell completion, it's possible
<shadeslayer>
what would be a good way to get the elements that are in neither of these arrays : ["C", "A", "B", "C"] , ["C", "A", "B"], FWIW sequence matters
jsrn has joined #ruby
<nlsun>
doesn't work with my zsh and mine's pretty powered up
<shadeslayer>
so the answer should be C
<centrx>
shadeslayer, "elements that are in neither of the arrays" what?
<Sou|cutter>
rails is based on ruby, so if you are learning ruby it will apply to rails. If you only you rails and have a poor understanding of ruby you will have trouble doing anything outside of copy-paste coding
<baweaver>
I can see about getting him out to coffee some time later anyways. We're working on getting SF Ruby back up a bitl.
victortyau has quit [Quit: Leaving]
FernandoBasso has joined #ruby
decoponyo has joined #ruby
DLSteve has joined #ruby
<baweaver>
irctc090: You said you can't use parse in that reply
<shadoi>
irctc090: from the error you get back it looks like you're simply not finding an object for your request. probably phoneNumber is not a primary key.
dblessing has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
willywos has quit [Ping timeout: 246 seconds]
<irctc090>
but i do have it as a column already.
ishahnaz has joined #ruby
<baweaver>
doesn't matter
<baweaver>
what's your server expecting?
<shadoi>
But you probably can't retrieve records with only that piece of data.
skade has quit [Ping timeout: 246 seconds]
scroff has quit [Remote host closed the connection]
<shadoi>
Look that the API docs for the service.
<baweaver>
because if it is Rails
scroff has joined #ruby
<baweaver>
it's probably object id or something of that kin
scroff has quit [Remote host closed the connection]
<baweaver>
banister
texasmade has joined #ruby
<drbrain>
!mute WEHATEMIGGERS
<baweaver>
danke
WEHATEMIGGERS has left #ruby [#ruby]
<irctc090>
i replied that i dont want to use that gem. someone on here told me a couple days ago that the gem is based on the rest api so just use the rest api?
<Radar>
Thanks baweaver :)
decoponio has quit [Ping timeout: 272 seconds]
A124 has quit [Ping timeout: 260 seconds]
<shadoi>
irctc090: you're not hearing what we're saying. The querying you're sending that service doesn't have enough information, it has nothing to do with what library or API you're using.
armyriad has joined #ruby
<baweaver>
Your client is sending "I want the user with the key phoneNumber"
<irctc090>
what more information do i need to pass?
<shadoi>
read the docs for the API
<banister>
baweaver how's sony
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver>
the server is likely saying "The heck mate? I need an ID, not that"
A124 has joined #ruby
<baweaver>
banister: decent enough
<baweaver>
I think cirwin went and told people about my project name
<banister>
which one
<baweaver>
his boss mentioned something on twitter about sony having a team named badass
<irctc090>
so i need to pass the users objectid in the url?
Rickmasta has joined #ruby
<baweaver>
bingo
<irctc090>
how can i do that?
<baweaver>
or better yet, look at the API docs for what it wants to pass
WEHATEMIGGERS has joined #ruby
WEHATEMIGGERS has left #ruby [#ruby]
* baweaver
puts away ops flag
axl__ has quit [Ping timeout: 245 seconds]
<banister>
baweaver what is badass
<zenspider>
what happens with a midge crossbreeds with a chigger? I'd prolly hate those too
<baweaver>
BaDASS -> Build and Deployment Automation Support System.
scroff has joined #ruby
scroff has quit [Remote host closed the connection]
<banister>
zenspider are you experimenting with any other languages these days? rust? go? etc
<pontiki>
:)
<zenspider>
racket and its brethren
scroff has joined #ruby
<zenspider>
oh! I also released a graphics simulation library... cleverly called... graphics
<banister>
zenspider cool, john carmack is tweeting a lot about racket these days
<zenspider>
yup yup
<zenspider>
ok... off to go get beat up. laters
kies^ has quit [Ping timeout: 244 seconds]
<gambl0re>
i dont understand how ruby is able to calculate "a" * 100
skade has joined #ruby
<irctc090>
yeah i saw the docs, i probably need the objectid in the url. how can i achieve that?
<gambl0re>
that doesnt make sense
<zenspider>
what doesn't make sense?
<baweaver>
It does
zacstewa_ has quit [Remote host closed the connection]
<zenspider>
you're calling "*" on "a" with 100 as the arg
<zenspider>
it's just code
<baweaver>
* is defined on string to something different than integer
dopamean_ has joined #ruby
<baweaver>
it's actually: 'a'.*(100)
sarkyniin has quit [Ping timeout: 244 seconds]
vickleton has quit [Ping timeout: 260 seconds]
<gambl0re>
huh???
<zenspider>
that doesn't really clarify much, because it's also 1.+(1)
<baweaver>
irctc090: probably though data
hahuang61 has quit [Ping timeout: 256 seconds]
<zenspider>
ok. really... need to get beat up
<gambl0re>
you are multiplying a string and a integer
<baweaver>
The method * can be different for different classes
jbw has quit [Ping timeout: 256 seconds]
<gambl0re>
different how?
<pontiki>
gambl0re: you are sending the message :* to "a" with the argument 100
<irctc090>
could you show an example? because i probably cant put @response["objectId"] in the https url
khebbie has quit [Remote host closed the connection]
<eam>
why does fork return nil in the child
<pontiki>
"a" * 100 --> "a".send(:*, 100)
<gambl0re>
>> "a" * 100
<ruboto>
gambl0re # => "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ...check link for more (https://eval.in/413344)
s00pcan has quit [Read error: Connection reset by peer]
carlosoliveira has quit [Quit: Connection closed for inactivity]
diegoviola has joined #ruby
t_ has quit [Remote host closed the connection]
<workmad3>
eam: I think so you can do 'if fork' to detect if you're in the child or not
<baweaver>
probably because 0 isn't false in ruby
<eam>
I'm getting dangerously close to complaining about zero being true
s00pcan has joined #ruby
<baweaver>
and that's some bizarre carryover where it admonishes unix conventions for it
<baweaver>
eam: honestly I don't know where I stand on that one
<eam>
I won't complain about it, but I'm so close
jbw has joined #ruby
<baweaver>
In some cases I want 0 / '' / empty to be false, but I see reasons for both
<adaedra>
0 as true is very practical sometimes.
Guest50 has joined #ruby
<adaedra>
Like you can do infinite loops with `while 0`.
<adaedra>
:p
<workmad3>
eam: yeah... it still catches me out at times too (especially when doing modulo) but I think 0 as falsey opens the door for a whole host of less reasonable falsey values... at which point you end up with JS or PHP </straw-man>
<eam>
workmad3: it's true
<eam>
and zero-as-true values like "0e0"
riotjone_ has joined #ruby
doertedev has quit [Quit: Lost terminal]
shazaum_ has joined #ruby
arooni-mobile has quit [Ping timeout: 244 seconds]
A124 has quit [Ping timeout: 260 seconds]
<workmad3>
I guess it would also remove a lot of the use of `||=` for lazy assignment... too many special cases for that and it becomes pretty worthless
ponga has joined #ruby
A124 has joined #ruby
riotjones has quit [Ping timeout: 246 seconds]
jwaldrip has joined #ruby
roolo has quit [Remote host closed the connection]
zacstewart has joined #ruby
niiamon has joined #ruby
<shadeslayer>
centrx: indeed, thanks
v0n has quit [Ping timeout: 246 seconds]
decaff has quit [Quit: Leaving...]
<zenspider>
eam: zero is a valid pid on some systems
jhack has joined #ruby
hahuang61 has joined #ruby
shazaum_ has quit [Quit: Leaving]
ragingcake_ has joined #ruby
v0n has joined #ruby
niiamon has quit [Ping timeout: 264 seconds]
sarkyniin has joined #ruby
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gambl0re has quit [Ping timeout: 246 seconds]
bigbadbear has quit [Ping timeout: 256 seconds]
sdrew has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<irctc090>
even when i pass the objectid with the url, it says {"code"=>107, "error"=>"invalid JSON"}
<irctc090>
but when i do it with curl, in terminal, it works perfect
DLSteve has quit [Quit: Leaving]
<eam>
zenspider: you gotta qualify that though - while some systems use pid=0 for special processes, it can never be returned by fork()
<eam>
(on posix)
<eam>
so yeah kinda, but no not really :)
eggoez has quit [Ping timeout: 256 seconds]
Ox0dea has joined #ruby
safeforge has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
zenspider: Does "some systems" mean most?
dopie has quit [Quit: This computer has gone to sleep]
eggoez has joined #ruby
soviet_jesus has joined #ruby
jackjackdripper1 has joined #ruby
<soviet_jesus>
I'm trying to write less crap code and so I started using reek. While it's uncovered a whole mess of problems, one that I've chosen to look at first is it telling me the following code exhibits feature envy.
Pumukel has quit [Quit: ChatZilla 0.9.91.1 [Firefox 39.0/20150630154324]]
phutchins has joined #ruby
<dfockler>
soviet_jesus: might be because you are calling entry all over the place
<Ox0dea>
s/calling/referring to/
A124 has quit [Quit: Luke's IRC Client v0.94 build 682]
mcgain has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jhack has quit [Ping timeout: 240 seconds]
<workmad3>
^^ if you're not using entry, you're using drops... nothing in the method requires the use of anything in the object it's a method of (it's envious of the features of other objects)
<soviet_jesus>
oooohhhhhh
s00pcan has quit [Read error: Connection reset by peer]
Alayde has quit [Ping timeout: 260 seconds]
<workmad3>
soviet_jesus: feature envy is usually taken as a sign that either you've got code that should be in a different class, or that you've got code that could be extracted into a new class
avahey has joined #ruby
jonee has quit [Ping timeout: 264 seconds]
s00pcan has joined #ruby
<soviet_jesus>
hmm, another method triggered the utility function smell too. It would appear I've built a class that doesn't really do anything other than get the user input and pass it back to other classes
hj2007 has quit [Quit: This computer has gone to sleep]
youch has quit [Quit: Konversation terminated!]
<dfockler>
soviet_jesus: might think about making it a module
axl_ has joined #ruby
apt-get_ has joined #ruby
allcentury has quit [Ping timeout: 265 seconds]
<soviet_jesus>
like take the methods that don't depend on their containing objects and make them functions in a module?
<dfockler>
if they're related
DoubleMalt has quit [Ping timeout: 250 seconds]
danzilio has quit [Quit: My computer has fallen asleep!]
<baweaver>
Did you catch what I said above about single quotes?
<baweaver>
because you haven't fixed your code yet if so
csmb has left #ruby ["Leaving..."]
<soviet_jesus>
ok so I've got another question: What I'm doing here seems just downright silly, is there a better data structure or way of working with arrays that will accomplish this in a less wretched way? The closest I got was to take something like a 20 line method and break it into several methods, but the number of instance variables exploded
<soviet_jesus>
So I'm given a file from one source or another, and I want to get rid of the columns I don't need, use the name to build a couple new fields, and then it also needs to be split up by when the records get mailed
<baweaver>
CSV it is, you win pontiki
<shevy>
pontiki knows the old things
<soviet_jesus>
pontiki: yeah exactly
jerius has joined #ruby
<pontiki>
it wasn't until i looked at his header examples
<soviet_jesus>
I wrote the program before using no classes and just a bunch of functions, but it was a gargantuan mess and hard to look at
<soviet_jesus>
I'm currently only using CSV to iterate over the source file, write to the dest file, and grab the headers...i think...I've spent a lot of time looking at the CSV class and I'm not quite sure what other functionality I'm looking for
irctc025 has quit [Ping timeout: 246 seconds]
<pontiki>
if you have the headers, why are you reparsing them with those regexps?
<baweaver>
though the csv library probably has a nicer way to do that.
<soviet_jesus>
1 moment....
<baweaver>
Ox0dea: it did
<Ox0dea>
baweaver: You lost 1, 4, and 7?
arooni-mobile has joined #ruby
<baweaver>
yeah
<baweaver>
reject
<baweaver>
on key a
<pontiki>
you take the parsed csv file structure and boom you have an array of hashes you can do anything with
<pontiki>
stick 'em in a database, sql around with 'em
<Ox0dea>
> Have you ever had a dream that you, um, you had, your, you, you could, you’ll do, you, you wants, you, you could do so, you , you’ll do, you could, you, you want, you want them, to do you so much, you could do anything?
countryHick has quit [Quit: Connection closed for inactivity]
<baweaver>
running thousands of sync processes to try and break something, so waiting for that to finish.
<baweaver>
fair
graydot has joined #ruby
jerius has quit [Quit: /quit]
Lucky__ has joined #ruby
<banister>
Ox0dea did you figure out yoru ancestor chain thing yet?
<banister>
or at least have a look at remix? :P
<soviet_jesus>
pontiki: you've given me much to think about, thank you
<finisherr>
Hello folks. I’m trying to instantiate a Net::HTTP object in my class but it’s giving me this error: ./jenkins-config:16:in `initialize': uninitialized constant MCJenkins::CredentialsHandler::NET (NameError
<Ox0dea>
banister: remix does appear to cover any use cases I might bump into. :)
<banister>
with the slight exception it probably no longer works... (hvaen't checked it tho..)\
<Ox0dea>
finisherr: You probably want "Net", not "NET".
<finisherr>
haha, facepalm
<finisherr>
ok
<finisherr>
Thanks
baweaver has quit [Remote host closed the connection]
<soviet_jesus>
oh wait, to get the array of hashes do I need to slurp the whole file, or can I still go line by line....also at what point does slurping a CSV become problematic?
vt102 has quit [Remote host closed the connection]
graydot has quit [Client Quit]
Edward__ has joined #ruby
Lucky__ has quit [Ping timeout: 250 seconds]
cyberarm has joined #ruby
<Ox0dea>
soviet_jesus: The only real benefit to converting it all at once is succinct code.
tekacs has quit [Ping timeout: 256 seconds]
nateberkopec has quit [Read error: Connection reset by peer]
nateberkopec has joined #ruby
tvw has quit [Remote host closed the connection]
DarthGandalf has quit [Read error: Connection reset by peer]
DarthGandalf has joined #ruby
NeverDie has joined #ruby
tobyx_ has quit [Remote host closed the connection]
ElderFain has quit [Ping timeout: 256 seconds]
bascht has quit [Ping timeout: 256 seconds]
Olipro has quit [Ping timeout: 256 seconds]
tobyx has joined #ruby
einarj has quit [Remote host closed the connection]
youch has joined #ruby
unsymbol has quit [Ping timeout: 272 seconds]
<Ox0dea>
banister: Did you end up watching charliesome's talk?
ribbons has quit [Ping timeout: 256 seconds]
bascht has joined #ruby
<banister>
bits and pieces but it doesnt seem you can do very interesting things with frozen core
jobewan has quit [Quit: Leaving]
_ht has quit [Quit: Konversation terminated!]
Olipro has joined #ruby
omegamike has joined #ruby
s00pcan has quit [Read error: Connection reset by peer]
ElderFain has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoviola has quit [Ping timeout: 245 seconds]
<Ox0dea>
>> Symbol.all_symbols.grep(/core#/)
<ruboto>
Ox0dea # => [:"core#set_method_alias", :"core#set_variable_alias", :"core#undef_method", :"core#define_method", ...check link for more (https://eval.in/413369)
unsymbol has joined #ruby
<Ox0dea>
I think some of those are worthy of the term.
<Ox0dea>
Sans the superlative, I suppose.
baweaver has joined #ruby
mwlang has joined #ruby
<mwlang>
How do I query the Ruby object space for all class objects declared under a module?
<soviet_jesus>
one last question, other than smashing my face into the docs till I can't read, what's a good way to learn to program better? It seems like practicing is just causing me to produce the same crap code
<baweaver>
For Ruby, read others source and get real friendly with Enumerable, Array, Hash, and String
<Coraline>
soviet_jesus: I recommend exercism.io
<BraddPitt>
soviet_jesus write code, ask for a review, and like baweaver read others (good) source
juanpaucar has quit [Remote host closed the connection]
<baweaver>
equally important is learning to test code
<mwlang>
outputs nothing...
blackmesa has quit [Ping timeout: 240 seconds]
Inside has joined #ruby
Inside has quit [Changing host]
Inside has joined #ruby
<mwlang>
soviet_jesus: online tutorials and screencasts yourself into oblivion.
<baweaver>
for little weekly tips, look into avdi's Ruby Tapas
Rollabunna has quit [Remote host closed the connection]
<baweaver>
Good quick overview of various features
<baweaver>
though I think it might be 2-3 a week
<mwlang>
watch a screencast, then research what makes the approach they teach work then try to recreate it all blind (without help)
<baweaver>
I lose track of everything I read
<baweaver>
or watch
lannonbr has joined #ruby
<baweaver>
Practical Object Oriented Design in Ruby and Eloquent Ruby are both great books.
sgambino has joined #ruby
<Ox0dea>
mwlang: Foobar.constants.select { |c| Class === Foobar.const_get(c) }
serivich has joined #ruby
Tempesta has quit [Read error: Connection timed out]
<baweaver>
is_a? Class ?
<soviet_jesus>
Alright, so i'm on a somewhat right track. I just hate it when I write ugly code. I'll have to check those books out
<baweaver>
safaribooksonline is your friend too
<baweaver>
$29/month for unlimited access to anything O'Rielly has touched
<baweaver>
including a lot of things from pragmatic programmers, no starch, and manning
<mwlang>
Ox0dea: bam! just like that. thanks.
mikecmpbll has quit [Quit: i've nodded off.]
whiteline has joined #ruby
<soviet_jesus>
oh, cool...I tend to like those books
<baweaver>
Avoid Packet Publishing like the plague
<baweaver>
Apress isn't much better
Tempesta has joined #ruby
<baweaver>
I tend to find the best are Addison Wesly (sp?) and No Starch, shortly followed by PragProg and O'Reilly
blue_deref has quit [Quit: bbn]
djbkd_ has joined #ruby
<baweaver>
Manning is hit or miss, depends on the book
finisherr has quit [Quit: finisherr]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<soviet_jesus>
baweaver: sweet, at least I know what I'm doing this weekend now lol
<baweaver>
that and asking us here
vF3hNGxc47h5 has quit [Ping timeout: 255 seconds]
<baweaver>
really depends on what you want to do with the language though as to where you want to look past that
rehat_ has quit [Remote host closed the connection]
shpoont has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
soviet_jesus I think we all write ugly code
grotewold has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
erts has quit [Ping timeout: 260 seconds]
<shevy>
what may help is to find structure in code, comments that are sensible and helpful, usage examples, ensuring that there are no bugs or at the least no crippling ones
jerius has quit [Quit: /quit]
DoubleMalt has quit [Ping timeout: 255 seconds]
cyberarm has quit [Read error: Connection reset by peer]
<baweaver>
I build beautiful code shevy, dam magnificent code
<shevy>
to adopt styles that lead to less bugs and better, more readable and/or terser code
<shevy>
lol
<yh__>
How might I list all of the gems that are directly depended on in my Bundler project?
<shevy>
yeah ok but
<shevy>
a dam is simple
<shevy>
try to fly to the moon with it
djbkd_ has quit [Ping timeout: 260 seconds]
<baweaver>
yh__ gemfile.lock
<yh__>
bundle list # shows indirect dependencies too, which is not what I want
<shevy>
beavers are "ecosystem engineers". I love that word
<yh__>
baweaver: not all projects are locked
<yh__>
I wish to cover all
existensil has quit [Quit: WeeChat 0.4.2]
scottschecter has joined #ruby
<baweaver>
gemspec or gemfile
<baweaver>
I would include nondirect if I were you
<baweaver>
pretending they don't exist causes many woes.
<yh__>
Huh? You don't even know my usecase
<mwlang>
argh. Ox0dea your technique does work, but sadly Rails just in time autoload kills my idea dead in it’s tracks — not seeing descending classes until they’re accessed at least once.
<Ox0dea>
That sucks.
<baweaver>
yh__: I wonder why
existensil has joined #ruby
<yh__>
baweaver: and whether it used gemspec or gemfile would depend upon if the gemfile specified gemspec within it
<baweaver>
My psychic powers must be on the fritz again
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yh__>
psychic powers not necessary, just looking for a solution to the very specific problem posed :+1:
<Ox0dea>
mwlang: I'm sure $thing isn't double-dead, but it's bound to be hacky.
<baweaver>
not really, but have fun with that.
<yh__>
baweaver: to be perfectly honest, I wish bundler just provided a flag to bundle list that enabled this, alas, my
<yh__>
oh, nvm.
<mwlang>
yeah. it’s not all that important…a handful of objects, I set a self.fingerprint with a unique hash “fingerprint” that allows a Factory object to intelligently decide which Object to instantiate based on keys in a given hash.
soviet_jesus has quit [Quit: Page closed]
<mwlang>
what I figured I’d do was wire up a spec that checks all fingerprints defined to ensure that each is definitely unique.
<baweaver>
now why bundler doesn't just install a manpage
<baweaver>
pesky
decoponyo has quit [Quit: Leaving...]
DoubleMalt has joined #ruby
saddad has joined #ruby
<Ox0dea>
mwlang: It seems you want to write a pseudo-integration test where a unit one would suffice.
<baweaver>
really though, grep through gemfile or gemspec for it. show and list show everything
scottschecter has quit [Quit: Leaving]
<banister>
mwlang you could load them alll in an initializer if u really wanted to
jbw has quit [Ping timeout: 260 seconds]
<banister>
i think
<mwlang>
Ox0dea: yeah, pretty much…its more a “protect the next programmer from totally shooting himself in the foot” test. :-D
<mwlang>
banister: there’s a way to dip into the autoload stuff to see what’s been registered, but not loaded, but I don’t really want to get into any of that.
<baweaver>
Unix has no such scruples. It's job, should you choose to use it as such, is to deliver Bullet from Gun to Foot as efficiently as possible.
<mwlang>
it would be smarter to just go to a fail fast and loud in production should two objects have the exact same fingerprints.
<mwlang>
everything pre-loads in production so it would make more sense to put it there if anywhere than resort to hackery.
MatthewsFace has quit [Remote host closed the connection]
fullofcaffeine has quit [Remote host closed the connection]
<mwlang>
I don’t mind getting hacky on a limited basis in specs when the intent can be made clear in a few lines of code and self-contained in the specs.
mistermocha has joined #ruby
<Ox0dea>
mwlang: Still, it'd be more sensible to test your algorithm for generating fingerprints, no?