<freezey_>
volty: yeah it works but when you execute it with ruby you get different results
<freezey_>
which is kinda odd
<xibalba>
havenwood, mind helping me out w/a trivial newb Q. Looking over Array.Each() and wondering if there is any sense in ever using that method w/out a code block
<freezey_>
i was wondering why that would be happening
<nobitanobi>
PPH, try this: myhash.each_pair do |k,v| new_hash.merge!({k.downcase => v}) end
<freezey_>
so when you execute it from cli on the actual linux machine it removes either the word node or nas.. when you execute it in ruby it keeps the word node or nas in the result
<xibalba>
volty, what can i do with the returned enumerator?
<xibalba>
is this returned enumerator, #<Enumerator:0x00000001ce63b8>
<xibalba>
, basically the memory address of the array i just called each() on ?
<joshu>
havenwood do you know of any existing ruby scripts, projects that can be used to a) save new tweets that show up on your home timeline and b) that i can use to view tweets i've missed the past two weeks on my home timeline?
<volty>
xibalba: whatever you want, iterate, to_a, map
mikepack has quit [Ping timeout: 245 seconds]
jhulten has quit [Remote host closed the connection]
<volty>
no no, the number is the address of the returned object (the enumerator itself)
<volty>
ops, not address but ID
lmadrigal has joined #ruby
srji has quit [Ping timeout: 264 seconds]
<havenwood>
joshu: tried the twitter gem?
<joshu>
someone else suggested it and i was trying just nu with a simple script but i was hoping there might be something ready made so i don't have to build it
<freezey_>
volty: yeah i used full paths and still yields different results the sed doesnt actually get executed is what it looks like
parduse is now known as Guest41833
<joshu>
but i get that error which I don't understand as the gem is installed and i've copied that code from the github readme
Guedes0 has quit [Ping timeout: 240 seconds]
threesome has joined #ruby
<havenwood>
joshu: i've never really worked with this gem, looks like elsewhere in the docs REST is oft removed, just: Twitter.configure do |config|
nateberkopec has joined #ruby
<freezey_>
volty: yeah i dunno man its odd that ruby sends different results
<freezey_>
trying to figure out why
<havenwood>
joshu: ahh, the syntax you mention is 'new in version 5'
mklappstuhl has joined #ruby
tharindu has joined #ruby
<havenwood>
joshu: So the disconnect is that the Github docs are 5.0.0.rc1.
vlad_starkov has joined #ruby
<havenwood>
joshu: But if you gem install, without --pre, you'll get 4.8.1.
<havenwood>
joshu: Docs that ship with gem are correct for 4.8.1.
<joshu>
i tried both ways i.e. without REST but that still didn't work. never mind I wasn't keen on building something as I just wanted to save tweets as soon as possible and possibly retrieve ones i've missed. it's not the end of the world.
<joshu>
the version i have installed is 4.8.1.
samuel02 has quit [Ping timeout: 245 seconds]
<havenwood>
joshu: Well, just only use 4 docs then, don't at all use the Github ones, they aren't compatible.
__zxq9__ has quit [Quit: Konversation terminated!]
<havenwood>
joshu: Or do use the Github docs and: gem install twitter --pre
jbw has quit [Read error: Operation timed out]
<joshu>
havenwood ah didn't see that I'll try with the old syntax
<freezey_>
volty: yeah its not executing the sed which is what i just found
jbw has joined #ruby
zaargy has quit [Ping timeout: 246 seconds]
zaargy has joined #ruby
<joshu>
thanks havenwood ;)
<havenwood>
joshu: np, happy hacking!
Guest41833 has quit [Remote host closed the connection]
lfox has joined #ruby
phinfonet has joined #ruby
tharindu has quit [Ping timeout: 240 seconds]
parduse has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
parduse is now known as Guest28221
VTLob has quit [Quit: VTLob]
lfox has quit [Client Quit]
mlpinit has quit [Remote host closed the connection]
Guest91973 has quit [Remote host closed the connection]
<havenwood>
not much golf to be had in that one
<sam113101>
exactly
snuffeluffegus has quit [Remote host closed the connection]
<volty>
i'm a bit frightened of the new world, i see more and more robots around :)
baroquebobcat has joined #ruby
jlast has joined #ruby
mlpinit_ has quit [Quit: Leaving...]
jlast_ has quit [Read error: Connection reset by peer]
Guest37962 has joined #ruby
Guest37962 is now known as parduse
parduse is now known as Guest57992
Guest57992 has quit [Read error: Connection reset by peer]
mklappstuhl has quit [Remote host closed the connection]
<volty>
ok: the guy is learning, so I see (so: imho) no sense in giving pedantic exact answers counting the steps
predator117 has quit [Ping timeout: 246 seconds]
scarolan has quit [Ping timeout: 244 seconds]
<volty>
I'm sure that baumax is happy with all these answer, with all of them
predator117 has joined #ruby
larissa has quit [Quit: Leaving]
baroquebobcat has quit [Ping timeout: 272 seconds]
frx has joined #ruby
parduse has joined #ruby
tomzx_mac has quit [Quit: return 0;]
<frx>
what GUI library do you guys usually use? Gtk/Qt? or is there any high level?
parduse is now known as Guest6164
<volty>
Which server (the most simple) should I use for serving just (only) rss feeds?
benlieb has joined #ruby
<volty>
i'm with Qt
mlpinit has joined #ruby
Guest6164 has quit [Read error: Connection reset by peer]
RaCx has joined #ruby
Monie has joined #ruby
robustus has quit [Ping timeout: 245 seconds]
havenwood has quit [Remote host closed the connection]
srji has joined #ruby
Guest37962 has joined #ruby
Guest37962 is now known as parduse
parduse is now known as Guest67691
Monie has quit [Client Quit]
<volty>
I'm the only left with unanswered questions :(
froy has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robustus has joined #ruby
ravster has left #ruby [#ruby]
<sam113101>
lighttpd
vx9r has quit [Quit: leaving]
nisstyre has quit [Quit: Leaving]
wesside has joined #ruby
tomzx_mac has joined #ruby
kofno has joined #ruby
tomzx_mac has left #ruby [#ruby]
<sam113101>
I try to use gtk apps, because I find qt apps ugly (although they could *technically* look the same), but if I had to code a graphical app I'd probably like qt better as a programmer
ephemerian has quit [Quit: Leaving.]
iliketurtles has quit [Quit: zzzzz…..]
<volty>
thx sam113101
* coldmethod
completely agrees with sam113101, at looks so ugly on Linux
existensil has joined #ruby
Guest67691 has quit [Remote host closed the connection]
<volty>
Qt with ruby is amazing. // As for the ugliness I think that the KDE makes them look ugly - I find qt applications to be much nicer than gtk's
RaCx has quit [Quit: Computer has gone to sleep.]
ukd1_ has joined #ruby
sailias has joined #ruby
btanaka has quit [Read error: Connection reset by peer]
benlieb has quit [Quit: benlieb]
jrhorn424 is now known as zz_jrhorn424
parduse has joined #ruby
kofno has quit [Ping timeout: 272 seconds]
parduse is now known as Guest79778
srji has quit [Ping timeout: 264 seconds]
asteros has quit [Ping timeout: 244 seconds]
mikepack has joined #ruby
Aryasam has quit [Ping timeout: 240 seconds]
timonv has joined #ruby
ukd1 has quit [Ping timeout: 272 seconds]
sevenseacat has joined #ruby
srji has joined #ruby
mixel has quit [Quit: mixel]
sambao21 has joined #ruby
Aryasam has joined #ruby
Guest79778 has quit [Read error: Connection reset by peer]
mikepack has quit [Ping timeout: 245 seconds]
timonv has quit [Ping timeout: 264 seconds]
parduse has joined #ruby
parduse is now known as Guest44896
tkuchiki has joined #ruby
sambao21 has quit [Ping timeout: 244 seconds]
jlast has quit [Remote host closed the connection]
rdalin has joined #ruby
banjara has quit [Quit: Leaving.]
mrj has joined #ruby
banjara has joined #ruby
jonathanwallace has joined #ruby
Guest44896 has quit [Ping timeout: 240 seconds]
freezey_ has quit [Remote host closed the connection]
jlast has joined #ruby
<superscott[8]>
Following the ruby docs, and i keep getting 'implicit conversion of object into string' when running --$ digest = OpenSSL::Digest::SHA1.new
jlast has quit [Remote host closed the connection]
lukec has quit [Quit: lukec]
taternuts has joined #ruby
parduse has joined #ruby
Kricir has joined #ruby
jlast has joined #ruby
parduse is now known as Guest26618
<superscott[8]>
nevermind, i think i'm getting it because i'm running in rails console
volty has quit [Quit: Konversation terminated!]
TheMoonMaster has quit [Remote host closed the connection]
flaccid_ has joined #ruby
jhulten has joined #ruby
banjara has quit [Quit: Leaving.]
Aryasam has quit [Ping timeout: 245 seconds]
jb41 has quit [Ping timeout: 260 seconds]
banjara has joined #ruby
misutowolf has joined #ruby
Guest26618 has quit [Remote host closed the connection]
kitak has quit [Remote host closed the connection]
<flaccid_>
i do create() and default_task :create and still get Attempted to create command "create" without usage or description. Call desc if you want this method to be available as command or declare it inside a no_commands{} block.
kitak has joined #ruby
zeade has quit [Quit: Leaving.]
gustavo__ has quit [Quit: This computer has gone to sleep]
randomnick_ has quit [Quit: Leaving]
maletor has quit [Quit: Computer has gone to sleep.]
asteros has joined #ruby
<sn0wb1rd>
flaccid_: give it a description and you should be good.It is required I guess
dmiller has joined #ruby
Lewix has quit [Remote host closed the connection]
Guest21022 has quit [Remote host closed the connection]
Guest37962 has joined #ruby
Guest37962 is now known as parduse
parduse is now known as Guest28872
yfeldblu_ has joined #ruby
DarthGandalf has quit [Ping timeout: 264 seconds]
Jeticus has joined #ruby
CaptainJet has quit [Disconnected by services]
Jeticus has quit [Client Quit]
bronson_ has joined #ruby
CaptainJet has joined #ruby
srji has quit [Ping timeout: 264 seconds]
CreativeEmbassy has joined #ruby
Mars__ has quit [Remote host closed the connection]
<flaccid_>
sn0wb1rd: thanks mate. it seems with :desc i give it "" for param 1 in this case
kcombs has joined #ruby
Mars__ has joined #ruby
thelorax123 has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 240 seconds]
thelorax123 has joined #ruby
Kricir has joined #ruby
yfeldblu_ has quit [Ping timeout: 240 seconds]
Guest28872 has quit [Remote host closed the connection]
misutowolf has quit [Ping timeout: 248 seconds]
RichardBaker has quit [Quit: RichardBaker]
tsykoduk is now known as zz_tsykoduk
Mars__ has quit [Ping timeout: 246 seconds]
iliketurtles has joined #ruby
duggiefresh has joined #ruby
banjara has quit [Quit: Leaving.]
Spami has joined #ruby
kofno has joined #ruby
DropsOfSerenity has joined #ruby
failshell has joined #ruby
huttan has quit [Ping timeout: 240 seconds]
Guedes0 has joined #ruby
sambao21 has joined #ruby
<flaccid_>
hmm i need to work out how to define an option in format --foo-bar
parduse has joined #ruby
parduse is now known as Guest18632
<flaccid_>
oh right, thats built in it seems with boolean
gstamp has quit [Ping timeout: 256 seconds]
tvw has quit []
Kricir has quit [Remote host closed the connection]
gstamp has joined #ruby
bronson_ has quit [Quit: bronson_]
diegoviola has joined #ruby
tylersmith has quit [Remote host closed the connection]
sambao21 has quit [Ping timeout: 272 seconds]
tharindu has joined #ruby
Targen_ has quit [Ping timeout: 246 seconds]
failshell has quit []
Guest18632 has quit [Remote host closed the connection]
parduse has joined #ruby
heidi has quit [Quit: Leaving.]
jaimef has quit [Excess Flood]
parduse is now known as Guest72993
Davey has quit [Quit: Computer has gone to sleep.]
Guest72993 has quit [Read error: Connection reset by peer]
Hobogrammer has quit [Ping timeout: 240 seconds]
Hobogrammer has joined #ruby
Guest37962 has joined #ruby
Guest37962 is now known as parduse
parduse is now known as Guest59750
TheMoonMaster has joined #ruby
baroquebobcat has joined #ruby
bronson_ has joined #ruby
wesside has quit [Quit: Computer has gone to sleep.]
DonRichie has quit [Ping timeout: 246 seconds]
DonRichie has joined #ruby
x1337807x has joined #ruby
gstamp_ has joined #ruby
x1337807x has quit [Client Quit]
srji has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
<flaccid_>
sn0wb1rd: hmm problem doing this method is that foo help cannot be mapped to foo help default
Guest59750 has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 240 seconds]
bricker has joined #ruby
Davey has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
<flaccid_>
if i use default_task :create, the user has to know to get help, foo help create
tylersmith has quit [Remote host closed the connection]
Aryasam has quit [Ping timeout: 246 seconds]
Guest74408 has joined #ruby
RORgasm has joined #ruby
Guest74408 is now known as diegoviola
TheHodge has quit [Quit: Connection closed for inactivity]
iliketurtles has joined #ruby
hiyosi has joined #ruby
robbyoconnor has joined #ruby
phansch has joined #ruby
sayan has quit [Ping timeout: 240 seconds]
RORgasm has quit [Ping timeout: 248 seconds]
danshultz has joined #ruby
mercwithamouth has joined #ruby
RORgasm has joined #ruby
hiyosi has quit [Ping timeout: 244 seconds]
Fezzler has joined #ruby
sergicles has quit [Quit: sergicles]
danshultz has quit [Ping timeout: 272 seconds]
ananthakumaran has quit [Quit: Leaving.]
EvanR_ has joined #ruby
sevenseacat has quit [Ping timeout: 240 seconds]
Liothen has quit [Quit: System of a down……]
Fezzler has quit [Client Quit]
Deele has joined #ruby
lukec has quit [Quit: lukec]
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
Deele has quit [Ping timeout: 260 seconds]
Advocation has joined #ruby
zarul has joined #ruby
jjbohn has joined #ruby
Monie has joined #ruby
<nobitanobi>
Why am I able to do load "myfile.rb" even though when doing $: I don't see "." in the load path?
samuel02 has joined #ruby
noop has joined #ruby
Spami has joined #ruby
<shevy>
well
Advocation has quit [Ping timeout: 245 seconds]
ewnd9 has joined #ruby
<shevy>
nobitanobi, one reason could be that it sits directly in your SITE_DIR directory
<shevy>
like when you have a project foobar, and you do require 'foobar', it will load the file foobar.rb in SITE_DIR, which then loads other files under foobar/ directory usually
<shevy>
if in doubt you can always search all files called that way on your linux system :D
jjbohn has quit [Ping timeout: 245 seconds]
Lewix has quit [Remote host closed the connection]
<nobitanobi>
shevy, I am surprised because with require 'myfile' it hangs. But not when doing load 'myfile.rb'
Shidash1 has joined #ruby
<nobitanobi>
shevy, what is the SITE_DIR?
<shevy>
nobitanobi your main path where all installed ruby files reside
Kricir has quit [Remote host closed the connection]
<shevy>
for instance
Shidash has quit [Read error: Connection reset by peer]
<shevy>
on my system it is currently at /Programs/Ruby/Current/lib/ruby/site_ruby/1.9.1/
<shevy>
on your system it possibly is at /usr/lib/ruby/site_ruby/1.9.1/
zz_michael_mbp is now known as michael_mbp
dhruvasagar has joined #ruby
<shevy>
nobitanobi yeah sounds odd, if I were you I would first search for all myfile.rb files there
samuel02 has quit [Ping timeout: 272 seconds]
<nobitanobi>
just that one :)
<shevy>
I give you an example
<shevy>
in 1.9.1/ I have a directory called vte/ and a file called vte.rb
<shevy>
now I change to the root dir at /
<shevy>
I start irb
<shevy>
I do this:
<shevy>
require 'vte.rb'
<shevy>
and it works, even though there is no file called /vte.rb
OdNairy has joined #ruby
<shevy>
it loads the SITE_DIR vte.rb one
<shevy>
that's one reason why modifying the LOAD_PATH isn't needed!
yfeldblu_ has quit [Remote host closed the connection]
<nobitanobi>
shevy, I understand that
<nobitanobi>
but I think what I am asking here is a little bit different
<shevy>
is it?
<nobitanobi>
if I create a project in a folder say /Projects
<nobitanobi>
and I have
<shevy>
ok so outside your SITE_DIR
<nobitanobi>
yes
<nobitanobi>
completely out
<nobitanobi>
:P
<shevy>
yeah that is indeed different
<nobitanobi>
and I don't see "." in my load path
<shevy>
then require 'foo' won't work unless you have modified the list of loaded paths
thesheff17 has quit [Quit: Leaving]
<nobitanobi>
right
<nobitanobi>
require 'foo' doesn't work
<nobitanobi>
but
<nobitanobi>
load 'foo.rb' does
jlast has quit [Remote host closed the connection]
sevenseacat has joined #ruby
<shevy>
but only if you are in the same directory?
Clooth has quit [Quit: Leaving...]
<shevy>
what if you go to another dir and specify the absolute path to it
<nobitanobi>
correct
<nobitanobi>
ah let me doo that...
<shevy>
I usually write tiny ruby scripts and call them directly via aliases on the commandline
kevinykchan has quit [Quit: Computer has gone to sleep.]
huttan has quit [Ping timeout: 245 seconds]
tylersmith has quit [Ping timeout: 246 seconds]
Clooth has quit [Quit: Leaving...]
kloeri has quit [Remote host closed the connection]
tonni has quit [Ping timeout: 252 seconds]
kloeri has joined #ruby
dmiller has quit [Quit: Leaving...]
yfeldblum has joined #ruby
zipper has joined #ruby
jjbohn has joined #ruby
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
nfk has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
mercwithamouth has joined #ruby
tagrudev has joined #ruby
`MArceLL` has quit [Ping timeout: 246 seconds]
DanBoy has joined #ruby
jjbohn has quit [Ping timeout: 245 seconds]
timonv has quit [Ping timeout: 272 seconds]
DanBoy has quit [Remote host closed the connection]
DanBoy has joined #ruby
ehc has quit [Quit: ehc]
Es0teric has quit [Quit: Computer has gone to sleep.]
mikepack has joined #ruby
apeiros has joined #ruby
camilasan has joined #ruby
yacks has quit [Quit: Leaving]
vlad_starkov has joined #ruby
muzammilr has joined #ruby
gstamp has quit [Read error: No route to host]
mlpinit has joined #ruby
<nobitanobi>
ok, night guys
<muzammilr>
i dont have much knowledge on ruby. i am trying to write a custom logstash filter. input is a json stream but i am not able to parse this json. events comes in the form of {:event=>#<LogStash::Event:0x29cd761a @data={"message"=>"{\"exceptionChain\":null,\"header\":{\"EventHeader\":{\"container\":\"java-tomcat\",\"environment\":\"PROD\",\"eventType\":\"log_event\",\"eventVersion\":4,\"guid\":\"guid-1234\",\"instance\":\"1\",\"nano\":4177214706043820
<nobitanobi>
shevy, take care!
<muzammilr>
0,\"server\":\"server1234\",\"service\":\"test\",\"time\":1384320822046,\"version\":\"0.0.1\"}}}}} , how can i extract the data of of this ?
DanKnox is now known as DanKnox_away
mikepack has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
<nobitanobi>
muzammilr, you want to parse @data ?
jhaals has joined #ruby
<muzammilr>
yes
<nobitanobi>
JSON.parse(@data)
dangerousdave has joined #ruby
digital-ghost has quit [Remote host closed the connection]
gstamp has joined #ruby
virtual|a has joined #ruby
peterdecroos has quit [Remote host closed the connection]
peterdecroos has joined #ruby
<muzammilr>
nobitanobi: i am getting nil
<muzammilr>
input is like this event = '{:event=>#<LogStash::Event:0x29cd761a @data={"message"=>"{\"exceptionChain\":null,\"header\":{\"EventHeader\":{\"container\":\"java-tomcat\",\"environment\":\"PROD\",\"eventType\":\"log_event\",\"eventVersion\":4,\"guid\":\"guid-1234\",\"instance\":\"1\",\"nano\":41772147060438200,\"server\":\"server1234\",\"service\":\"test\",\"time\":1384320822046,\"version\":\"0.0.1\"}}}}}'
virtualize has quit [Ping timeout: 252 seconds]
<muzammilr>
i am want to do something like JSON.parse(event.???)
<nobitanobi>
event.data?
asteros has joined #ruby
<muzammilr>
it says data is undefined
<nobitanobi>
where do you get this from ? {:event=>#<LogStash::Even.....
<nobitanobi>
?
<nobitanobi>
try doing this event.to_hash
coderhs has joined #ruby
SirFunk has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aspires has quit [Quit: sudo making a sandwich]
SirFunk has joined #ruby
camilasan has quit [Remote host closed the connection]
banjara has quit [Quit: Leaving.]
andrewstewart has quit [Quit: Connection closed for inactivity]
camilasan has joined #ruby
yfeldblum has quit [Remote host closed the connection]
tjad has joined #ruby
yfeldblum has joined #ruby
yfeldblum has quit [Read error: Connection reset by peer]
rellin has quit [Read error: Connection reset by peer]
niop has joined #ruby
camilasan has quit [Ping timeout: 240 seconds]
`MArceLL` has joined #ruby
nobitanobi has quit [Quit: Leaving]
jxw1024 has left #ruby [#ruby]
<niop>
hi, doing the Hartl rails tute, and it says to install ruby use flag --with-openssl-dir=$HOME/.rvm/opt/openssl. but there's no subfolder of .rvm by the name of opt. nor is there a subfolder use as another possible openssl directory suggested. where is openssl? it was installed using brew install openssl.
Rix has joined #ruby
<niop>
*another subfolder usr
mengu has joined #ruby
SirFunk has quit [Remote host closed the connection]
mengu has quit [Changing host]
mengu has joined #ruby
JohnBat26 has joined #ruby
tharindu has quit [Quit: Leaving...]
EvanR_ has quit [Ping timeout: 248 seconds]
<s3itz>
niop: check with #rvm
<niop>
ok ta
Mon_Ouie has quit [Ping timeout: 246 seconds]
Mars___ has joined #ruby
<s3itz>
I'd help, but I cannot recall why you were overriding openssl
<PPH>
Anyone using syntastic with vim?
yannucci has quit [Remote host closed the connection]
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
aganov has joined #ruby
panko has joined #ruby
<niop>
s3itz: just following the tute, and the command it asks you to run is... $ brew install libtool libxslt libksba openssl
weszlem has joined #ruby
<niop>
i think it's being installed to /etc/bin, but not sure. there's a full openssl install there, but it may be part of the ruby that's inbuilt to mac, rather than rvm.
hiyosi has joined #ruby
phansch has quit [Remote host closed the connection]
<s3itz>
it's just a suggestion
<niop>
oops, /etc/openssl
<s3itz>
you installed openssl via brew, you just need to build a version of ruby you want
<niop>
so why use a flag specifying the openssl directory?
<niop>
that implies that brew installs openssl somewhere under .rvm?
<s3itz>
I think RVM can build openssl locally to it
<niop>
so, secret location?
samuel02 has joined #ruby
<niop>
if that's the case, and the tutorial writer would know this stuff, why would he bother stipulating that the directory be specified.
<niop>
i've used /etc/openssl, and it seems to pick up stuff in there for openssl compile, but an error results at some point.
<niop>
that's during ruby install
<niop>
hence why i'm going back trying to determine which openssl directory should be specified.
hiyosi has quit [Ping timeout: 245 seconds]
david2 has joined #ruby
david2 has quit [Client Quit]
robbyoconnor has joined #ruby
zoee has joined #ruby
<s3itz>
What system are you using?
Mars___ has quit [Remote host closed the connection]
<niop>
mac
<s3itz>
ML or MAV?
LarsSmit has joined #ruby
<niop>
mav, i think, the latest.
Mars___ has joined #ruby
<niop>
it's not my mac
<s3itz>
ok
<s3itz>
remove openssl from brew
<s3itz>
build ruby from rvm using rvm's documentations
david2 has joined #ruby
<s3itz>
rvm implode to start over; maybe research using rbenv
david2 has quit [Client Quit]
<niop>
that might be an approach, i don't quite know what these install tools are doing, but the tute is probably the best known, or one of them. what they're saying should work. using brew.
noname001__ has quit [Ping timeout: 244 seconds]
<niop>
maybe command in the tute needs modification for some reason, just of finding out what it should be.
<s3itz>
Well, the author tries to hint that he only promotes RVM because it is what he knows :)
<niop>
i'd be happy to chop and change the current install, but it's someone else's. so more looking to get info, rather than make substantial changes to the install.
rellin has joined #ruby
<niop>
sure but i'd be surprised if his approach is one that wouldn't work.
<niop>
it's just a matter of.. knowing where ssl is
Mars___ has quit [Ping timeout: 240 seconds]
mattattaque has quit [Ping timeout: 246 seconds]
<niop>
and then if it doesn't work, well, maybe can give his suggestion the toss. but it wouldn't seem unreasonable to try to locate openssl, or at least get some comment as to what to do about the openssl dir that the author has suggested needs to be specified.
tharindu has joined #ruby
peterdecroos has quit [Remote host closed the connection]
Advocation has joined #ruby
jjbohn has joined #ruby
<niop>
it's remarkable how much time can be wasted on these things
<bnagy>
things change.
peterdecroos has joined #ruby
<niop>
my friend, just specified the .rvm/opt directory, and though the directory doesn't exist, was happy to proceed because that's what the tute said, there were no error msgs, and it was quick.
<bnagy>
fwiw rvm is, imho, a steaming pile
srajan has joined #ruby
srajan has quit [Max SendQ exceeded]
<bnagy>
and installing openssl into opt in your rvm is .. suboptimal
srajan has joined #ruby
srajan has quit [Max SendQ exceeded]
<niop>
who's opinion should one follow, the guru behind one of the best know tutus for rails around, or... anonymous.
skaflem has joined #ruby
threesome has quit [Ping timeout: 245 seconds]
funburn has joined #ruby
<niop>
there may be something to the opinion you have of rvm.. but that shouldn't be reason for rvm not to work. installing ssl probably isn't one of the most one off type things that might happen in the process of ruby rails install.
<niop>
as in people generally don't do it, and that's why it's broken perhaps.
<sevenseacat>
it may be the best known tutorial, but that doesnt make it good
samuel02 has quit []
<sevenseacat>
people still insist on reading agile web dev with rails too, even after we tell them its a horrible book
Advocation has quit [Ping timeout: 272 seconds]
<s3itz>
I do not understand why you are upset by our suggestions
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xcess_denied has quit [Quit: Leaving...]
<s3itz>
We are suggesting rbenv because it is better
<s3itz>
Not because we hate you and RVM
peterdecroos has quit [Ping timeout: 252 seconds]
jjbohn has quit [Ping timeout: 272 seconds]
end_guy has quit [Ping timeout: 240 seconds]
xcess_denied has joined #ruby
<s3itz>
You're going to have to have the same experience irregardless; I simply said ditch the openssl directives and build like normal
kobain has quit [Ping timeout: 240 seconds]
<niop>
knowing where an install is... isn't exactly rocket science. so i guess there was presumption that location might not be too difficult to find. using methods, with rvm, that obviously many have employed.
sandeepk has quit [Quit: Leaving...]
<niop>
but if there's a dead end with rvm. sure, will give the other tool a try. just wary of interfering with the install on this machine. prefer to abide the instructions in the tute, assuming that would be the path of least resistance
danguita has joined #ruby
<s3itz>
create your own environment
<s3itz>
are you doing rvm in your user directory as well?
cool has quit [Quit: Connection closed for inactivity]
<sevenseacat>
you think thats the path of least resistance? i cant wait until you get to the bootstrap and spork section of the tutorial
<s3itz>
lol
DouweM has quit [Ping timeout: 245 seconds]
sayan has quit [Read error: Connection reset by peer]
<niop>
about ditching the directory specification.. my concern with that is.. if the author knows what he's doing, he's probably put the directory in there for a reason, not just to make it look cool. if i omit something.. it may cause problems down the track. often more painful to solve than the cause had it been dealt with at the outset.
weszlem has quit []
<niop>
yeah, that's a point, possible to do different environments as you say
<niop>
well, if i'm using the other tool you mentioned, and the author is using a set of commands that don't relate to it, in itself that could be resistance.
jprovazn has joined #ruby
Monie has joined #ruby
<niop>
with some searching around for cmdx, doable, but tutee are often best digested without too much customisation.
<s3itz>
naturally ignore the coach to install gcc if you don't need to
jrhe has joined #ruby
david2 has joined #ruby
vpretzel has quit [Remote host closed the connection]
Clooth has joined #ruby
<niop>
that's virtually what i've done, it just doesn't specify the openssl dir
<s3itz>
and it has installed just fine?
sandeepk has joined #ruby
h_kon has joined #ruby
<niop>
an idea i might try is uninstalling openssl with brew... and then installing again. i think, maybe, when it's installing, it gives the install directory.
<niop>
well.. it does.. yes. as in no error msgs. but the directory specified for openssl, /.rvm/opt, doesn't exist. so it's no wonder there's no error msg. unless it resorts to some default.
mikepack has joined #ruby
ezkl has joined #ruby
sayan has joined #ruby
SirFunk has joined #ruby
<niop>
just got a msg on #rvm.. and they said there's no need for that openssl flag any more. has been so for the last 6 months.
<s3itz>
hehehe
<bnagy>
15:35 < bnagy> things change.
andikr has joined #ruby
sandeepk has left #ruby [#ruby]
<s3itz>
RVM install is simply, get rvm, knit it in, start a new session, maybe run rvm packages autolib and start installing
<s3itz>
rehash if you need and go
<niop>
well, that solves the problem really. good to know. don't want the ship to have technical problems later on.
fgo has joined #ruby
<s3itz>
but rbenv is still worth looking into down the road
vlad_starkov has joined #ruby
<niop>
ok, sure.. sounds promising. thanks for the advice.
<s3itz>
autolibs*
david2 has quit [Quit: WeeChat 0.4.0]
<bnagy>
chruby is probably a better bet these days
<s3itz>
things change :D
<bnagy>
seems to have the momentum
predator217 has joined #ruby
jrhe has quit [Quit: jrhe]
coderhs has quit [Quit: Leaving]
<s3itz>
seems nice and simple
david2 has joined #ruby
mikepack has quit [Ping timeout: 272 seconds]
noname001__ has joined #ruby
predator117 has quit [Ping timeout: 248 seconds]
dagobah has joined #ruby
zigomir has joined #ruby
corehook has joined #ruby
vlad_starkov has quit [Ping timeout: 272 seconds]
mlpinit has joined #ruby
basil_kurian_ has left #ruby [#ruby]
relix has joined #ruby
camilasan has joined #ruby
kcombs has joined #ruby
Al_ has joined #ruby
corehook has quit [Client Quit]
lukec has joined #ruby
thelorax123 has quit [Remote host closed the connection]
jhaals has joined #ruby
banjara has joined #ruby
niop has quit [Quit: niop]
panko has quit [Remote host closed the connection]
claymore has joined #ruby
david2 has quit [Quit: WeeChat 0.4.0]
thelorax123 has joined #ruby
david2 has joined #ruby
jhaals has quit [Read error: Operation timed out]
gianlucadv has joined #ruby
banghouse has quit [Remote host closed the connection]
lukec has quit [Ping timeout: 248 seconds]
mlpinit has quit [Ping timeout: 252 seconds]
xerxas has joined #ruby
kcombs has quit [Ping timeout: 246 seconds]
bianchini has joined #ruby
workmad3 has joined #ruby
david2 has quit [Client Quit]
david2 has joined #ruby
fightback has joined #ruby
weszlem has joined #ruby
jhaals has joined #ruby
einarj has joined #ruby
huttan has joined #ruby
weszlem has quit [Client Quit]
banjara has quit [Ping timeout: 244 seconds]
peterdecroos has joined #ruby
bianchini has quit [Remote host closed the connection]
weszlem has joined #ruby
threesome has joined #ruby
sandeepk has joined #ruby
Xeago has joined #ruby
huttan has quit [Ping timeout: 248 seconds]
dusseault has joined #ruby
asteros has quit [Quit: asteros]
peterdecroos has quit [Ping timeout: 246 seconds]
hiyosi has joined #ruby
drumusician has joined #ruby
david2 has quit [Quit: WeeChat 0.4.0]
mercwithamouth has quit [Quit: leaving]
alup has joined #ruby
hiyosi has quit [Ping timeout: 248 seconds]
mrfoto has joined #ruby
blaxter_ has joined #ruby
phansch has joined #ruby
batman has quit [Quit: leaving]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Read error: Connection reset by peer]
mikepack has quit [Ping timeout: 244 seconds]
Xeago has quit [Remote host closed the connection]
niop has quit [Ping timeout: 246 seconds]
rellin has quit [Read error: Connection reset by peer]
srji has joined #ruby
newbiehacker_ has joined #ruby
rellin has joined #ruby
DanBoy has quit [Remote host closed the connection]
lxsameer has joined #ruby
DanBoy has joined #ruby
<lxsameer>
hi guys, i'm looking for a template generator system which work like a template engine in development and an static page generator in production
mlpinit has joined #ruby
timonv has quit [Remote host closed the connection]
Mars___ has joined #ruby
icecandy has quit [Quit: Going offline, see ya! (www.adiirc.com)]
Xeago has joined #ruby
kaspergrubbe has joined #ruby
banjara has joined #ruby
icecandy has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 264 seconds]
kaspergrubbe has joined #ruby
mlpinit has quit [Ping timeout: 245 seconds]
<jrobeson>
lxsameer, jekyll?
choobie has joined #ruby
hogeo_ has quit [Remote host closed the connection]
hogeo has joined #ruby
ghr has joined #ruby
andikr has quit [Read error: Operation timed out]
hogeo has quit [Ping timeout: 245 seconds]
banjara has quit [Ping timeout: 248 seconds]
andikr has joined #ruby
Mars___ has quit [Remote host closed the connection]
Mars___ has joined #ruby
kcombs has joined #ruby
user258467 has joined #ruby
hogeo has joined #ruby
icedp has quit [Ping timeout: 240 seconds]
shaunbaker has joined #ruby
shaunbak_ has joined #ruby
Mars___ has quit [Ping timeout: 245 seconds]
mattattaque has joined #ruby
icedp has joined #ruby
lacko has joined #ruby
AlSquire has joined #ruby
icecandy has quit [Quit: Going offline, see ya! (www.adiirc.com)]
TMM has joined #ruby
timonv has joined #ruby
Blaze_Boy has joined #ruby
krandi has joined #ruby
sbos99 has joined #ruby
andikr has quit [Ping timeout: 264 seconds]
shaunbaker has quit [Ping timeout: 272 seconds]
kcombs has quit [Ping timeout: 245 seconds]
h_kon has quit [Remote host closed the connection]
h_kon has joined #ruby
yjmsf20 has joined #ruby
krandi has quit [Ping timeout: 245 seconds]
andikr has joined #ruby
BlazeeBoy has joined #ruby
BlazeeBoy has quit [Client Quit]
v0n has joined #ruby
aagdbl has quit [Read error: Connection reset by peer]
aagdbl has joined #ruby
einarj has quit [Remote host closed the connection]
wildroman2 has joined #ruby
einarj has joined #ruby
lacko has quit [Quit: Lost terminal]
funburn has joined #ruby
adambeynon has joined #ruby
ephemerian has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
sayan has joined #ruby
einarj has quit [Ping timeout: 272 seconds]
Advocation has joined #ruby
jjbohn has joined #ruby
Squarepy has joined #ruby
rdark has joined #ruby
hamakn_ has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
Rollabunna has joined #ruby
Advocation has quit [Ping timeout: 246 seconds]
jjbohn has quit [Ping timeout: 246 seconds]
GreatSUN has joined #ruby
<GreatSUN>
Hi all
<GreatSUN>
I have some small problem...
TigerWolf has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<GreatSUN>
I want to create some function to convert unix mode 0700 or equal to windows setup
<GreatSUN>
but whenever I look what is in the parameter I get sth. else
<GreatSUN>
for 0700 for example it is 448
kalleth_ is now known as kalleth
<GreatSUN>
does someone of you know how I can get the 0700 back?
<GreatSUN>
means how to convert decimal back to octal
sevenseacat has quit [Quit: Leaving.]
<apeiros>
.to_s(8)
<apeiros>
or "0%O" % num (iirc)
<apeiros>
>> [0700.to_s(8), "0%03O" % num]
<eval-in>
apeiros => undefined local variable or method `num' for main:Object (NameError) ... (https://eval.in/66914)
<DouweM>
that's... strange. at least in Rubinius, Float::NAN is defined as `NAN = 0.0/0.0` exactly
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d45h has quit []
achru has joined #ruby
<gyre007>
gents anyone here using Octopress ?
jrhe has joined #ruby
camilasan has quit [Remote host closed the connection]
jjbohn|afk is now known as jjbohn
shaunbaker has quit [Remote host closed the connection]
<Hanmac>
DouweM: that is a difference between quiet and loud NaN's ... i maked a ticket about that to make it more clear http://bugs.ruby-lang.org/issues/8994
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
camilasan has joined #ruby
zoee has quit [Quit: This computer has gone to sleep]
shaunbaker has joined #ruby
jrhe has quit [Client Quit]
Liquid-- has joined #ruby
<DouweM>
I didn't even know about quiet and loud NaNs
habanany has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
habanany has quit [Max SendQ exceeded]
rickmasta has joined #ruby
camilasan has joined #ruby
<DouweM>
but if it's just a constant assignment in Rubinius, does Rubinius do loud/quiet NaN wrong?
Ox6abe has quit [Ping timeout: 246 seconds]
fgo has quit [Ping timeout: 252 seconds]
jrhe has joined #ruby
habanany has joined #ruby
maletor has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
mikepack has joined #ruby
<Hanmac>
hm i dont know ... ruby itself does not very differ between them ... (so you cant check with methods if a NaN is quiet or not) ... neigher you can create NaNs for your functions which are your wanted type ... also the -@ method on NaN may be implemented wrong (it changes the NaN type, not the sign)
maletor has quit [Client Quit]
habanany has quit [Max SendQ exceeded]
<Hanmac>
thats why i maked this ticket
RaCx_ has joined #ruby
<DouweM>
yeah, I read the ticket
<cout>
nan is never equal to nan
maletor has joined #ruby
maletor has quit [Client Quit]
zarubin has joined #ruby
shaunbaker has quit [Ping timeout: 240 seconds]
RaCx has quit [Ping timeout: 240 seconds]
RaCx_ is now known as RaCx
<cout>
and there are a gazillion bit representations of nan
Liquid-- has quit [Client Quit]
habanany has joined #ruby
mengu has quit []
<Hanmac>
cout yeah, but as you see there are still different types of NaN
NotreDev has quit [Quit: NotreDev]
<cout>
Hanmac: I don't see why that's a "but"
Monie has joined #ruby
maletor has joined #ruby
simplyaubs has joined #ruby
jrhe has quit [Client Quit]
JonahR has quit [Quit: jonahR]
blackmesa has joined #ruby
Mars__ has joined #ruby
srji has joined #ruby
mikepack has quit [Ping timeout: 245 seconds]
Spami has joined #ruby
<Hanmac>
for sample in my ticket there is also an quiet_nan + loud_nan, loud_nan + quiet_nan ... both ignore the 2nd object and return self, but it should take care that if you combine a quiet_nan and a loud_nan, indepent from the order, loud_nan should returned (because loud should has more priority than quiet)
shaunbaker has joined #ruby
heidi has joined #ruby
pel_daniel has joined #ruby
tharindu has joined #ruby
weszlem has joined #ruby
Kricir has quit []
AleksEst has quit [Ping timeout: 268 seconds]
Mars__ has quit [Ping timeout: 240 seconds]
PPH has quit [Quit: leaving]
AleksEst has joined #ruby
tesuji has quit [Ping timeout: 246 seconds]
kpshek has joined #ruby
threesome has quit [Ping timeout: 264 seconds]
MrThePlague has joined #ruby
MrThePlague has quit [Changing host]
MrThePlague has joined #ruby
iamjarvo has joined #ruby
sergicles has quit [Quit: sergicles]
Liothen has joined #ruby
shaunbak_ has joined #ruby
mojjojo has quit [Quit: mojjojo]
crus has quit [Read error: Connection reset by peer]
ahawkins has quit [Quit: leaving]
shaunbaker has quit [Ping timeout: 245 seconds]
platzhirsch has quit [Quit: Leaving.]
weszlem has quit []
Variantdataaa has joined #ruby
Squarepy has quit [Quit: Leaving]
pskosinski has joined #ruby
_Andres has quit [Read error: Connection reset by peer]
graydot has joined #ruby
Fire-Dragon-DoL has joined #ruby
sergicles has joined #ruby
burlyscudd has quit [Quit: Leaving.]
jibi has quit [Read error: Operation timed out]
aspires has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
rickmasta has quit [Read error: Connection reset by peer]
Megtastique has joined #ruby
rickmasta has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
fgo has joined #ruby
failshell has joined #ruby
jibi has joined #ruby
saarinen has joined #ruby
rudisimo has joined #ruby
kaspergr_ has joined #ruby
kaspergr_ has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
freezey has joined #ruby
yfeldblum has joined #ruby
bluehavana has quit [Read error: Connection reset by peer]
bluehavana has joined #ruby
sandeepk_ has joined #ruby
sandeepk has quit [Read error: Connection reset by peer]
jlast has quit [Read error: Connection reset by peer]
<zipper_>
This was the infinite recursive function that I wanted to run: pastebin.com/REJDzF8i
jlast has joined #ruby
<DouweM>
what's with the multiple nicks?
axl_ has quit [Quit: axl_]
mephux has quit [Quit: w0ots...]
<zipper_>
I wonder how far it can go if all the variables are destroyed before the function calls itself
hiroyuki_ has quit [Remote host closed the connection]
<zipper_>
DouweM: One is me on mobile
<DouweM>
and also, setting array to nil should kill the reference, calling GC.start manually will perform the sweep
wallerdev has joined #ruby
<DouweM>
otherwise, just wait for the GC to kick in automatically
relix has joined #ruby
<zipper_>
DouweM: I wrote it on my way from school then I ran out if charge
hiroyuki_ has joined #ruby
saarinen has quit [Quit: saarinen]
hiroyuki has quit [Read error: Connection reset by peer]
kevinykchan has quit [Ping timeout: 252 seconds]
<zipper_>
DouweM: so after it's nil for ling enough it get's garbage collected?
<zipper_>
*long
<DouweM>
zipper_: it breaks autocomplete in my client, because tabbing from `zip` will alternate between both niks
Guest28163 has joined #ruby
<DouweM>
pretty much
<zipper_>
DouweM: let me exit the phone
freezey has quit [Remote host closed the connection]
zipper_____ has quit [Client Quit]
kevinykchan has joined #ruby
freezey has joined #ruby
<zipper_>
DouweM: hey what do you think of that code btw? Is there a better way to write it?
classix has quit [Ping timeout: 248 seconds]
heidi has joined #ruby
<DouweM>
zipper_: to judge on that, I'll need the actual code. not a weird YAML example
tharindu has quit [Quit: Leaving...]
kaspergrubbe has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
blaxter has quit [Quit: foo]
nhmood has quit [Remote host closed the connection]
cody-- has quit [Quit: derp]
joshu has quit [Remote host closed the connection]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
havenwood has joined #ruby
kenneth has quit [Quit: kenneth]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
MrThePlague has quit [Remote host closed the connection]
axl_ has joined #ruby
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
rellin has joined #ruby
tkuchiki has quit [Remote host closed the connection]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
MrThePlague has joined #ruby
jlebrech has quit [Quit: Konversation terminated!]
myappleguy has quit [Ping timeout: 244 seconds]
tkuchiki has joined #ruby
dkamioka has joined #ruby
evanvarvell has quit [Ping timeout: 252 seconds]
sputnik13 has quit [Read error: Operation timed out]
werdnativ has joined #ruby
freezey has quit [Ping timeout: 240 seconds]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
<zipper_>
DouweM: that is the whole thing. Since yaml is a recursive acronym it was the point.
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
kaspergrubbe has quit [Ping timeout: 246 seconds]
<DouweM>
is that the actual method you're trying to write?
ehc has quit [Quit: ehc]
burlyscudd has joined #ruby
tkuchiki has quit [Ping timeout: 244 seconds]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
danshult_ has quit [Remote host closed the connection]
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
srji has joined #ruby
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
danshultz has joined #ruby
nhmood has joined #ruby
nhmood has quit [Max SendQ exceeded]
MrZYX is now known as MrZYX|off
Advocation has joined #ruby
nhmood has joined #ruby
timonv_ has joined #ruby
typicalbender has joined #ruby
jjbohn has quit [Quit: Leaving...]
joshu has joined #ruby
joshu has quit [Client Quit]
MrZYX|off is now known as MrZYX
Czupa has quit [Remote host closed the connection]
cescalante is now known as ce_afk
<zipper_>
DouweM: yes it is
burlyscudd has quit [Ping timeout: 272 seconds]
brtdv has joined #ruby
shredding has quit [Quit: shredding]
jjbohn has joined #ruby
<DouweM>
well, in that case: I really don't see the point and you need some spaves around those operators, but otherwise this is the way recursion works
timonv has quit [Ping timeout: 264 seconds]
aspires has quit [Quit: sudo making a sandwich]
myappleguy has joined #ruby
buscon has quit [Ping timeout: 240 seconds]
<zipper_>
DouweM: spaves? Never heard of those.
<DouweM>
*spaces ;)
Advocation has quit [Ping timeout: 245 seconds]
danshultz has quit [Ping timeout: 245 seconds]
aspires has joined #ruby
<zipper_>
DouweM: spaces between what? You're talking readability now, no?
<zipper_>
You made me google spaves bro :D
jjbohn has quit [Client Quit]
relix has quit [Read error: Connection reset by peer]
DanKnox_away is now known as DanKnox
jjbohn has joined #ruby
<DouweM>
yeah, spaces around << and +
classix has joined #ruby
newbiehacker has joined #ruby
<zipper_>
SLOW INTERNET IS FROM HELL!!!
<zipper_>
I'll be back
Chris-_ has joined #ruby
Soliah has quit [Ping timeout: 244 seconds]
mmitchell has quit [Remote host closed the connection]
mmitchell has joined #ruby
Rollabunna has quit [Remote host closed the connection]
lukec has quit [Quit: lukec]
burlyscudd has joined #ruby
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblu_ has joined #ruby
zipper has joined #ruby
jamblack has quit [Quit: jamblack]
aspiers has quit [Ping timeout: 264 seconds]
daxroc has joined #ruby
phansch has joined #ruby
apeiros has quit [Remote host closed the connection]
barratt has quit [Ping timeout: 245 seconds]
zxq9 has joined #ruby
newbiehacker has quit [Ping timeout: 240 seconds]
pel_daniel has quit [Ping timeout: 246 seconds]
whunt has joined #ruby
apeiros has joined #ruby
jibi has quit [Ping timeout: 246 seconds]
zipper_ has quit [Ping timeout: 264 seconds]
m8 has joined #ruby
cody-- has joined #ruby
fysaen has joined #ruby
camilasan has joined #ruby
danguita has quit [Ping timeout: 244 seconds]
jhulten has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
fgo has quit [Ping timeout: 241 seconds]
shaunbak_ has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 272 seconds]
stkowski has joined #ruby
shaunbaker has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
relix has joined #ruby
mlpinit has quit [Remote host closed the connection]
apeiros has quit [Ping timeout: 246 seconds]
jamblack has joined #ruby
mary5030 has quit [Remote host closed the connection]
kenneth has joined #ruby
superscott[8] has joined #ruby
mary5030 has joined #ruby
ner0x has joined #ruby
shaunbaker has quit [Ping timeout: 245 seconds]
pskosinski has quit [Quit: Til rivido Idisti!]
zipper has quit [Quit: leaving]
sambao21 has joined #ruby
aagdbl has quit [Quit: Leaving.]
heidi has quit [Quit: Leaving.]
kpshek has quit []
pixelgremlins has quit [Ping timeout: 272 seconds]
timonv_ has quit [Remote host closed the connection]
freezey has quit [Remote host closed the connection]
heidi has joined #ruby
burlyscudd has quit [Quit: Leaving.]
freezey has joined #ruby
ExCa|iBuR has joined #ruby
brianpWins has joined #ruby
ExCa|iBuR has quit [Client Quit]
jxcl has joined #ruby
iliketurtles has joined #ruby
ggordan has quit [Remote host closed the connection]
sepp2k has joined #ruby
edwardly has joined #ruby
vlad_starkov has joined #ruby
jbpros has joined #ruby
maycon_ has quit [Ping timeout: 260 seconds]
mlpinit has quit [Remote host closed the connection]
RaCx has joined #ruby
maycon_ has joined #ruby
jerius has quit [Ping timeout: 245 seconds]
weirdpercent has joined #ruby
freezey has quit [Ping timeout: 246 seconds]
angusigu1ss has joined #ruby
sayan has joined #ruby
<weirdpercent>
I have an array of URIs with http and https, I'm trying to replace each occurence of https with http but no matter how I loop it it doesn't seem to work. I've tried links.each, links.map...any ideas?
<DouweM>
post your code
mklappstuhl has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
<weirdpercent>
thanks guys, that answered my question
<DouweM>
but still, I'm curious, why?
<weirdpercent>
I didn't want any https urls
<DouweM>
why?
<weirdpercent>
I'm screen scraping forum links
freezey has joined #ruby
<weirdpercent>
and some of them come out http, some come out https. I'm kind of OCD like that
camilasan has quit [Remote host closed the connection]
jxcl has quit [Quit: Leaving]
<shevy>
is google still considered to not do evil?
camilasan has joined #ruby
<DouweM>
weirdpercent: all right
hiyosi has quit [Ping timeout: 264 seconds]
jjbohn has joined #ruby
MadDog31 has quit [Quit: Leaving]
<DouweM>
shevy: I think their toc now states they can do *some* evil
<MrZYX>
shevy: don't think so
<DouweM>
but they promise they try to keep it to a minimum
fgo has quit [Ping timeout: 272 seconds]
cody-- has quit [Quit: derp]
danguita has quit [Ping timeout: 244 seconds]
dkamioka has quit [Ping timeout: 252 seconds]
daxroc has joined #ruby
jibi has joined #ruby
mephux_ is now known as mephux
<weirdpercent>
the way I look at it, if the fed is gonna use my own data against me, then it's a fascist dictatorship nightmare anyway, there's nothing I can do about it
<mikeg>
havenwood: yeah, I'm guessing that that sugguestion will work as well
ckinni has joined #ruby
jhulten has quit [Remote host closed the connection]
<mikeg>
I learned quickly that %w is the same as single quotes
<mikeg>
so that code I posted is the failed code
<shevy>
Hanmac yeah
timonv has joined #ruby
<mikeg>
so I went with %W but that looked kinda lame
<havenwood>
mikeg: if var1 is already a string it doesn't make sense to interpolate it or use %w
danshultz has joined #ruby
<shevy>
Hanmac google keeps on annoying me on youtube, since a week I no longer login to youtube but gmail automatically wants to log me in. I will have to find replacements for all google services :(
<havenwood>
mikeg: do as MrZYX suggests
<mikeg>
yeah. trying that now. thanks
mary5030 has quit [Remote host closed the connection]
Guest51393 has quit []
benwoody has quit [Quit: benwoody]
mary5030 has joined #ruby
gstamp has quit [Ping timeout: 256 seconds]
alvaro_o has joined #ruby
sambao21 has joined #ruby
kirun has joined #ruby
bricker has joined #ruby
<mikeg>
yep. that worked. thanks again MrZYX and havenwood
bricker`work has joined #ruby
zmattpetty has quit [Ping timeout: 272 seconds]
olivier_bK has joined #ruby
BigBlueBacon has quit []
jbpros has joined #ruby
gstamp has joined #ruby
CaptainJet has quit []
danshultz has quit [Ping timeout: 252 seconds]
scarolan has quit [Ping timeout: 245 seconds]
hiyosi has quit [Ping timeout: 264 seconds]
iliketurtles has joined #ruby
typicalbender has quit [Quit: Leaving.]
benwoody has joined #ruby
Ox6abe has joined #ruby
artm has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h has quit [Max SendQ exceeded]
ce_afk is now known as cescalante
gr33n7007h has joined #ruby
mojjojo has quit [Quit: mojjojo]
Morrolan has joined #ruby
jamblack has quit [Quit: jamblack]
sputnik13 has joined #ruby
sputnik13 has quit [Max SendQ exceeded]
Kamuela has joined #ruby
sputnik13 has joined #ruby
scarolan has joined #ruby
freezey has quit [Remote host closed the connection]
duggiefresh has joined #ruby
freezey has joined #ruby
colonolGron has joined #ruby
kpshek has joined #ruby
wallerdev has quit [Quit: wallerdev]
capicue has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
fysaen_ has joined #ruby
pel_daniel has joined #ruby
iamjarvo_ has quit []
iamjarvo_ has joined #ruby
typicalbender has joined #ruby
Mars__ has joined #ruby
scarolan has quit [Ping timeout: 245 seconds]
codeFiend has joined #ruby
momomomomo has joined #ruby
freezey has quit [Ping timeout: 245 seconds]
brianpWins has quit [Quit: brianpWins]
scarolan has joined #ruby
bricker`work has quit [Ping timeout: 244 seconds]
bricker`work has joined #ruby
fysaen has quit [Ping timeout: 264 seconds]
burlyscudd has quit [Quit: Leaving.]
graydot has quit [Quit: graydot]
mikepack has quit [Remote host closed the connection]
iniusman has joined #ruby
duggiefresh has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
jhulten has joined #ruby
cascalheira has quit [Quit: Leaving...]
jonathanwallace has quit [Quit: WeeChat 0.4.1]
jhulten has quit [Excess Flood]
cody-- has joined #ruby
jhulten has joined #ruby
jonathanwallace has joined #ruby
Aryasam has joined #ruby
Solnse has quit [Quit: Leaving.]
joshu has joined #ruby
CaptainJet has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
ghr has joined #ruby
Aryasam has quit [Ping timeout: 248 seconds]
Solnse has joined #ruby
Aryasam has joined #ruby
Targen has quit [Remote host closed the connection]
jhaals has joined #ruby
jhulten has quit [Ping timeout: 240 seconds]
fgo has joined #ruby
wallerdev has joined #ruby
danguita has joined #ruby
kpshek has quit []
skaflem has quit [Quit: Leaving]
jjbohn has quit [Quit: Leaving...]
jbpros has quit [Quit: jbpros]
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
kpshek has joined #ruby
jbpros has joined #ruby
fgo has quit [Ping timeout: 272 seconds]
<nhmood>
I foolishly ended up using Config as the name for one of my classes and now when I reference just Config (include MyModule, Config.new) in an RSpec test I see Use RbConfig instead of obsolete and deprecated Config
alekst has quit [Quit: Computer has gone to sleep.]
<nhmood>
Is there any way I can avoid this error from popping up and not have to explicitly define what module I'm using Config from? (MyModule::Config doesn't cause these problems)
pu22l3r has quit [Remote host closed the connection]
danguita has quit [Ping timeout: 252 seconds]
jhulten has joined #ruby
Monie has joined #ruby
Monie has quit [Client Quit]
Aryasam has joined #ruby
jbpros has quit [Client Quit]
Ox6abe has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 248 seconds]
Ox6abe has joined #ruby
<MrZYX>
the clean solution is to use MyModule::Config
ExCa|iBuR has joined #ruby
<MrZYX>
the not so clean is remove_const :Config before you include
jbpros has joined #ruby
jbpros has quit [Client Quit]
<nhmood>
Would the "correct" way to approach this (if starting from scratch lets say) to not name my Config class Config?
cgore has joined #ruby
<MrZYX>
I'd say the correct way is to use the full qualifier and not do include MyModule
<MrZYX>
but we're getting int #rubyonrails topics here ;)
<Trudko>
yeah
postmodern has joined #ruby
<Trudko>
but I doesnt like that one , the one above is easier
<Trudko>
at least shorther imo
RaCx has joined #ruby
<MrZYX>
and a pain in the ass if you ever going to support more than one locale ;)
Briareos1 has joined #ruby
nisstyre has quit [Quit: Leaving]
blaxter_ has joined #ruby
achru has quit [Remote host closed the connection]
achru has joined #ruby
<Trudko>
MrZYX, for sure :)
hiyosi has quit [Ping timeout: 240 seconds]
sailias has quit [Ping timeout: 245 seconds]
momomomomo has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
cburyta has quit [Remote host closed the connection]
aspires has quit [Quit: sudo making a sandwich]
ArchBeOS has joined #ruby
binaryplease has joined #ruby
<ArchBeOS>
I have two loops, one inside the other. If a condition is hit within the inner loop I want to break it, but continue the outer loop. break just kills both loops. is there another way of doing this?
<MrZYX>
what kind of loops? using blocks or true loops?
<Hanmac>
then you may do the loops wrong
<ArchBeOS>
true loops. let me get a code example for you
achru has quit [Ping timeout: 272 seconds]
* Hanmac
's true loops are more true than your true loops ,P
Jabberish has quit [Remote host closed the connection]
thelorax123 has quit [Remote host closed the connection]
<MrZYX>
so using a block
err_ok has joined #ruby
mojjojo has joined #ruby
<MrZYX>
works for me though
vince_prignano has quit []
<MrZYX>
do you have a executable example?
thelorax123 has joined #ruby
superscott[8] has quit [Ping timeout: 264 seconds]
RaCx has quit [Ping timeout: 240 seconds]
vince_prignano has joined #ruby
mengu has joined #ruby
vince_prignano has quit [Client Quit]
sailias has joined #ruby
<ArchBeOS>
im cleaning it up
tvw has quit [Ping timeout: 272 seconds]
breakingthings has quit [Ping timeout: 246 seconds]
vince_prignano has joined #ruby
vince_prignano has quit [Client Quit]
watermel0n has joined #ruby
RaCx has joined #ruby
<ArchBeOS>
it's tough because there is a lot of company-sensitive crap in here.
_Andres has joined #ruby
watermel0n has quit [Client Quit]
<MrZYX>
maybe try to recreate a minimal example demonstrating your problem
<MrZYX>
that often already helps to discover the error in the real code
timonv has joined #ruby
watermel0n has joined #ruby
<ArchBeOS>
im trying MrZYX . let me try surrounding the break in puts just to see whats going on. it really sucks being the only rubyist in my company sometimes...
<apeiros>
ArchBeOS: break definitively doesn't break out of two blocks
jbpros has joined #ruby
breakingthings has joined #ruby
dangerousdave has joined #ruby
<apeiros>
ArchBeOS: what break does is: return directly from the yielding method (the yielding method does not get control back) and lets the method return the value passed to break
<apeiros>
(nil by default)
<ArchBeOS>
so it acts like a return?
mikepack has joined #ruby
<apeiros>
no
<apeiros>
return returns from a method
<ArchBeOS>
ok, sorry. my brain is farting
<apeiros>
well, if you mean "break is to a block what return is to a method", then somewhat, yes
sailias has quit [Ping timeout: 252 seconds]
<apeiros>
but it's not really comparable due to that "method which yields" thing
filipe_ has joined #ruby
<apeiros>
with `def foo; yield; puts "reached"; "quuz"; end`, the code `x = foo { break "bar" }` will not print "reached", and x is "bar"
vlad_starkov has joined #ruby
<apeiros>
the code `x = foo { next "bar" }` will print "reached" and x will be "quuz"
simplyaubs has quit [Quit: simplyaubs]
<ArchBeOS>
ok, the data is finally getting munged...(parsing 20 meg excel files suck)
randomnick_ has joined #ruby
jrhe has joined #ruby
jamblack has joined #ruby
brandonblack has joined #ruby
<ArchBeOS>
same damn issue. i really should have picked another profession like rodeo clown or ventriloquist. im just gonna refactor the damn thing instead.
barratt has quit [Quit: Leaving...]
mikepack has quit [Ping timeout: 272 seconds]
sailias has joined #ruby
jjbohn has joined #ruby
ckinni_ has joined #ruby
myappleguy has quit [Ping timeout: 272 seconds]
ckinni has quit [Read error: Connection reset by peer]
heidi has quit [Quit: Leaving.]
benlieb has joined #ruby
<MrZYX>
yeah, try to filter down the data beforehand instead of breaking out
danshultz has joined #ruby
mikepack has joined #ruby
noop has quit [Ping timeout: 246 seconds]
colonolGron has joined #ruby
Guest78439 has quit [Remote host closed the connection]
<ArchBeOS>
MrZYX: found a better way of doing it. break was just gonna force me to do a next on the outer loop anyway, so i extracted that inner loop to a seperate method, returning nil if it encounters the condition then the outter loop will call that method and if nil will next.
cek has joined #ruby
Monie has joined #ruby
<cek>
my rdebug is not stopping on breakpoint I issue via b file:line
<ArchBeOS>
stupid? yes. cumbersome? yup. do i wish i can do it a better way? hell yeah. but i have no time to figure out why break is breaking through to the outter loop
pothibo has joined #ruby
<cek>
it breaks if I explicitly put a "debugger" method there
<MrZYX>
I think I'd still try to filter it out
sambao21 has joined #ruby
blaxter_ has quit [Quit: foo]
barratt has joined #ruby
<MrZYX>
cek: most people tend to use pry, pry-byebug, pry-rescue etc. as debugger these days
<ArchBeOS>
MrZYX: this script has to be ready to run in about 1.5 hours. i live in an enterprise .NET shop where they are strict on deadlines.
<ArchBeOS>
a work around is a work around is a work around
wfht has joined #ruby
newbiehacker has joined #ruby
<MrZYX>
ArchBeOS: just sayin' :P
<ArchBeOS>
lol
<MrZYX>
and I'm sorry for you ;P
<ArchBeOS>
i will look into it after this script runs. then i will kick my own ass for making it so cumbersome later
pixelgremlins has joined #ruby
barratt has quit [Client Quit]
Hobogrammer has quit [Read error: Connection reset by peer]
capicue has quit [Quit: Leaving...]
jamblack has quit [Quit: jamblack]
hukl has quit [Read error: Permission denied]
hukl has joined #ruby
<cek>
i dont' like somethign that requires incode patching. I want to debug like with gcc
<cek>
so that i don't have to modify code
<cek>
gdb i mean
elux has joined #ruby
benlieb has quit [Quit: benlieb]
jprovazn has quit [Quit: Odcházím]
<cek>
pry was cumbersome last time i checked
kpshek has joined #ruby
Jetchisel has joined #ruby
<MrZYX>
hm I think with pry-byebug you could start a pry load your code set breakpoints with the break command and make that code run
dnyy has quit []
vlad_starkov has quit [Remote host closed the connection]
baordog has joined #ruby
RORgasm has quit [Remote host closed the connection]
<MrZYX>
given you can load your code in a way that doesn't run it yet
ckinni_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
samuel02 has quit []
anderson has quit [Quit: Leaving]
pothibo has quit [Quit: pothibo]
<cek>
rdebug script just stops on first line
funburn has joined #ruby
vlad_starkov has joined #ruby
drag00n has quit [Ping timeout: 240 seconds]
<lolmaus>
Please suggest a shorter / more elegant way to say this: `item_is_current = defined? current_item ? item.id == current_item : false`
<iajrz>
what am I supposed to match? I could \w+ it, as I said earlier, but I'm not quite certain that's the intent
<havenwood>
iajrz: So an error has a class (like `NoMethodError`) and an optional `#message` like `undefined local variable or method `united_lemming_front' for main:Object`
Xeago has joined #ruby
<iajrz>
yeah, I understood that... and I've been running the test, so I can get to see the messages
einarj has joined #ruby
atmosx has joined #ruby
<iajrz>
but ... well, I'm just insecure about the regex they ask for.
<havenwood>
iajrz: ahh, put part of the text
<havenwood>
iajrz: a word, a partial sentence, they're not asking you to learn regex
Liothen has quit [Ping timeout: 264 seconds]
<iajrz>
you think it's there just so we can see the error messages?
<DouweM>
should I do the koans even if I think I know Ruby well?
Czupa has quit [Ping timeout: 245 seconds]
<havenwood>
iajrz: for example: true if 'this message'[/mess/] #=> true
drim has joined #ruby
<iajrz>
DouweM: they are _very_ enjoyable. if I knew ruby, i'd do them just for the kicks anyway.
<iajrz>
havenwood: I could /\w+/ it, I did it with others... just thought there might be some deeper truth to the excercise
io_syl has joined #ruby
<havenwood>
DouweM: Sure, maybe use an artificial constraint. Only monkeypatch to solve. Or only use lambda expressions. Hrm.
<DouweM>
iajrz: all right, I'll put it on my todo list :)
<DouweM>
havenwood: hah, that would be fun
DrShoggoth has quit [Read error: Connection reset by peer]
hukl_ has joined #ruby
mengu has quit [Remote host closed the connection]
benlieb has joined #ruby
Monie has joined #ruby
mengu has joined #ruby
<benlieb>
when I do `gem list -l` is there a way to also show WHERE the gem is being found?
Al_ has joined #ruby
<havenwood>
benlieb: gem list -dl
<benlieb>
havenwood: awesome thanks!
<iajrz>
how long did it take you from first touching ruby to first finished (enough) (serious) project?
hukl has quit [Ping timeout: 252 seconds]
<benlieb>
havenwood: been wanting that for years
<havenwood>
benlieb: I'd usually assume same GEM_ROOT and just check: gem env gemdir
<bricker>
Okay, I know that these two are essentially the same. The first defines the method on the Article Class, the second defines the method on the Article Class's Singleton class, right? So my question is - what difference does that really make, in a practical sense? https://gist.github.com/bricker/7456781
Solnse has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 245 seconds]
iamjarvo_ has joined #ruby
<benlieb>
havenwood: me too, but I just inherited a project (OLD) with frozen gems in it. Turns out the gems that are frozen aren't being used (it seems), based on the flag you just showed me.
Grantlyk has joined #ruby
<havenwood>
benlieb: aha
<apeiros>
bradsmith: the first defines it on the Article's singleton class too
<apeiros>
gah
<apeiros>
bricker: : the first defines it on the Article's singleton class too
<havenwood>
bricker: they are very very the same
<apeiros>
bricker: practical difference - the first one is easier to grep
Grantlyk has quit [Client Quit]
<havenwood>
bricker: `class Article; def Article.plural` would be the same too
<bricker>
apeiros: ah - so these are just alternate syntaxes for the literal, exact same thing
<benlieb>
havenwood: and I might be the cause ;) ahhh
Thanatermesis has quit [Quit: ɯlɐɔ uı ʞɹoʍ oʇ ƃuıoƃ]
<apeiros>
bricker: yes
<benlieb>
I've never used frozen gems. Not really sure how that works.
<bricker>
apeiros: phew! thanks.
<bricker>
havenwood: thank you too
RaCx has quit [Quit: Computer has gone to sleep.]
<apeiros>
`class << obj; def foo; end end` is identical to `def obj.foo; …; end`
<havenwood>
bricker: or `class << Article` is same too, but nicer to use `self` so you can change the Class name without breaking stuff
nanoyak has quit [Ping timeout: 245 seconds]
<apeiros>
it's not limited to classes either
<bricker>
Is there a preference in the ruby community? I think I remember seeing that Rails prefers class << self syntax
<havenwood>
bricker: If you have accessors or multiple methods, i'd use `class << self`. One or two, i think self.method is nice.
<apeiros>
bricker: as said, self.foo is easier to grep
<apeiros>
which is why I prefer it
<bricker>
ah
<apeiros>
I only use class << self for things where self.foo can't be used (as havenwood said - e.g. for attr_* stuff)
jhulten_ has joined #ruby
nanoyak has joined #ruby
<bricker>
Okay last question on this subject: In this case, are there any methods defined on the Article class itself? Or are there *only* methods in its singleton class?
<havenwood>
bricker: There are class instance methods on the class, but not instance methods.
<havenwood>
the naming makes it a little hard to talk about this stuff >.>
<bricker>
havenwood: oh, I thought `def self.foo()` went into the singleton.
<apeiros>
havenwood: does it help if I tell you that the only kind of method that exists are instance methods? :)
<bricker>
apeiros: I understand that fully
barratt has quit [Quit: Leaving...]
<apeiros>
bricker: there are no methods defined in the Article class in your gist
<apeiros>
bricker: all methods are defined in the singleton class of Article
<apeiros>
where `all` is `twice the same "plural" method`
<apeiros>
does that answer your question?
<havenwood>
apeiros: now if you could just tell me that `class variables` and `global variables` were a bad dream and the only kind that exists are `instance variables` :P
michael_mbp is now known as zz_michael_mbp
Fire-Dragon-DoL has quit [Quit: Leaving.]
<apeiros>
havenwood: just pretend it was
* havenwood
pretends will all his might...
<apeiros>
until some badly written code lifts my delusion, I can live very well with that :)
<bricker>
apeiros: Okay, so when is a method *actually* defined on a class? How do you even do that? I can see that `Array.methods - Array.singleton_class.methods` returns two results: `:[]` and `:try_convert`
jkamenik has quit [Quit: Leaving.]
<bricker>
Is that something you can even do with Ruby itself, or would it have to be done with an extension?
<apeiros>
bricker: Array.methods lists all methods which are defined in Array.singleton_class, Array.class and Array.class' ancestors and included modules
gener1c has quit [Disconnected by services]
<apeiros>
bricker: as said, there's only instance methods.
<bricker>
apeiros: That clears it up for me. I was thinking about it backwards.
<bricker>
apeiros: so... an I hesitate to say this, but here goes... would you say a singleton class is a sort of "prototype" in the javascript sense of the word?
gajon has joined #ruby
<bricker>
and*
<apeiros>
no
<bricker>
shit
vlad_starkov has quit [Ping timeout: 246 seconds]
<iajrz>
hey, in the koans I only saw a "for item in array" kind of for... are there no other forms of 'for' in ruby?
<apeiros>
it's a virtual class between object and object's class
<DouweM>
`for item in array` is usually bad practice. use #each on your enumerable
Ox6abe has joined #ruby
<MrZYX>
iajrz: don't really care and always use the block forms for all your iterating needs
<DouweM>
bad practice as in non-conventional
<iajrz>
ok
<iajrz>
:)
<iajrz>
the blocks confuse me, still
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<iajrz>
thanks for the pointers :)
<bricker>
apeiros: oh wait, nevermind then, I did not have it backwards before
<DouweM>
iajrz: just think of them as lambdas, that's what they basically are after all
myappleguy has joined #ruby
<myappleguy>
hello
<iajrz>
so I'd do array.each { |a| result+=a} or something similar
agjacome has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
gr33n7007h has quit [Ping timeout: 272 seconds]
<havenwood>
iajrz: You're trying to get the sum of the elements of the array?
krawchyk has quit []
<iajrz>
that'd be the idea :)
<DouweM>
iajrz: that's how #each works, yeah, but for sums there are better options
<drim>
why when using imap.fetch(data, ['RFC822', 'UID']) Im getting could not parse command, but it's working when Im only specifing RFC8222 for example
hiyosi has joined #ruby
jbpros has quit [Quit: jbpros]
<bricker>
apeiros: in foo.bar, why is method `bar` looked up in the Article class at all, if it's already looking in the singleton class?
<apeiros>
that's what you do with class methods - you define a method for a single instance of Class
<apeiros>
(your class methods are not shared with other classes)
<bricker>
apeiros: okay okay okay
<bricker>
stop
<bricker>
hold on
nazty has quit [Read error: No route to host]
<bricker>
apeiros: "you define a method for a single instance of Class". I completely get that. So then why does the lookup chain look in both Article.singleton_class, *and* Article ?
crus has joined #ruby
kobain has quit [Remote host closed the connection]
<apeiros>
bricker: now you're confusing things
jhulten has joined #ruby
<apeiros>
calling a method in an instance of Article will NOT lookup in Article.singleton_class
kobain has joined #ruby
<bricker>
I know
<bricker>
I am not talking about an Instance of Article
jonathanwallace has quit [Ping timeout: 246 seconds]
cburyta has quit [Remote host closed the connection]
<apeiros>
calling a method on Article itself will NOT lookup in Article
cescalante is now known as ce_afk
Hanmac1 has joined #ruby
<apeiros>
as with all objects, it will look up in Article.singleton_class, then Article.class
<apeiros>
(there's only one class where obj.class == obj - and that's Class)
Guest21880 is now known as bassclef
scarolan has joined #ruby
<benzrf>
does anybody know where eval-in came from and if I can get a copy??
<bricker>
apeiros: Ah, I misread your example earlier, that had me confused
<apeiros>
benzrf: ask charliesome
<benzrf>
thx
<benzrf>
for that matter, does eval.in have an api
<apeiros>
benzrf: no idea
<benzrf>
huh
<havenwood>
benzrf: ya charliesome, but he keeps the source private for various and sundry reasons
<benzrf>
lame
<shevy>
I wanna talk to charliethreesome
mojjojo has quit [Quit: mojjojo]
<iajrz>
else _demands_ a newline?
gajon has joined #ruby
<apeiros>
benzrf: wtf?
Hanmac has quit [Ping timeout: 272 seconds]
<benzrf>
do you know if therere any APIs I can call to evaluate code in multiple languages?
<havenwood>
shevy: charlielonesome
mojjojo has joined #ruby
typicalbender has quit [Quit: Leaving.]
<shevy>
lol
<shevy>
well the bot rocks, no doubt about it
fysaen has quit [Read error: Connection reset by peer]
bronson_ has quit [Quit: bronson_]
<apeiros>
benzrf: lame that you don't know yourself… srsly…
cek has quit [Ping timeout: 246 seconds]
<benzrf>
>:I
<ismaelrb>
charliesome
angusiguess has quit [Ping timeout: 245 seconds]
<shevy>
benzrf I remember the days when we had no bot here
<havenwood>
beetlejuice
<shevy>
benzrf these were days of horror and bloodshed
<DouweM>
helpa over in #RubyOnRails is a fun bot too
<apeiros>
yeah, nowadays it's "think of the bots!" all the time when we want to shed blood :(
<shevy>
that's an odd name for a bot
<bricker>
apeiros: So what is the purpose of a class, say Article? If the methods are defined in its singleton class, and the lookup chain skips it... and calling `Article.some_method` actually looks into its singleton class... Is it just there to sort-of house the singleton class?
<apeiros>
bricker: for all the things you claim to know you're confusing quite a few :)
<DouweM>
okay wtf I only just realized charliesome is 19 years old
Es0teric has joined #ruby
<apeiros>
the purpose of class Article is to hold instance methods
<havenwood>
uhh, okay - so a couple days ago they announced a Beetlejuice 2 is coming out...
<shevy>
DouweM young geniuses everywhere out there
<DouweM>
I'm 19 as well. I'm jealous
<shevy>
DouweM don't worry
<shevy>
DouweM you both will get older
<DouweM>
hah
<apeiros>
bricker: `If the methods are defined in its singleton class` - again, methods defined in the singleton class of Article are NOT relevant for instances of Article.
rudisimo has quit [Quit: Leaving.]
asobrasil has left #ruby [#ruby]
<apeiros>
classes exist to be able to make instances of those classes.
thelorax123 has quit [Remote host closed the connection]
<bricker>
apeiros: I think I just have this mental image of the relationship of a Class to its singleton class that has been in my head for like 6 years... can't teach an old dog new tricks, etc.
<bricker>
apeiros: I understand now though, thank you
interactionjaxsn has quit [Remote host closed the connection]
amacgregor_ has quit [Ping timeout: 246 seconds]
<apeiros>
bricker: I'll try to put it differently once more, though
interactionjaxsn has joined #ruby
thelorax123 has joined #ruby
<apeiros>
bricker: as I said, there's only instance methods. in order to call an instance method, you need an instance.
kayloos has quit [Remote host closed the connection]
<bricker>
I know that
<apeiros>
now if you have Article and define instance method `foo`, it's trivial. you do Article.new to get an Article instance. you then do that_article.foo
<bricker>
yes
<apeiros>
but if you want to do Article.some_method, and there's only instance methods - where should that some_method be defined?
<apeiros>
obviously it can't be in Article, since Article is not an instance of Article.
scarolan has quit [Ping timeout: 245 seconds]
<bricker>
That is a helpful way to put it
<Kamuela>
hey, i was 19 five years ago, i think i can play this game
<apeiros>
so we need a class which Article is an instance of
Monie has joined #ruby
cburyta has joined #ruby
<apeiros>
Article's class is Class
<DouweM>
Kamuela: :)
<apeiros>
we could put the method there (really)
<apeiros>
but then *all* classes would have that some_method
AlSquire has quit [Quit: This computer has gone to sleep]
mmcdaris has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
and that's where singleton_class comes into play. it's a class which belongs only to a single object. Article.singleton_class is the class which belongs only and only to Article.
Monie has quit [Client Quit]
<apeiros>
so we put an instance method `some_method` there. Article being an instance of Article.singleton_class can now have `Article.some_method` called on it. and we don't disturb any other class.
<bricker>
apeiros: That is helpful. Does something like `String.new.singleton_class` ever get used?
fomatin has joined #ruby
<apeiros>
and because this concept is universal, it works for non-class objects too.
scarolan has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<apeiros>
bricker: yes. everytime you use extend f.ex.
thelorax123 has quit [Remote host closed the connection]
<apeiros>
`obj.extend Mod` is almost the same as using include in obj.singleton_class
interactionjaxsn has quit [Ping timeout: 240 seconds]
<apeiros>
I also use it in testing
<apeiros>
other than that I haven't used it much I think. I'd have to go through the source.
<Kamuela>
DouweM, quit school, just k0de, never look back ;)
<apeiros>
it somewhat goes against reuse patterns to create methods on the singleton class.
AlSquire has joined #ruby
benzrf has left #ruby [#ruby]
stringoO has quit [Quit: stringoO]
thelorax123 has joined #ruby
asteros has joined #ruby
cburyta has quit [Ping timeout: 240 seconds]
ffranz has quit [Quit: Leaving]
gverri_ has joined #ruby
failshell has quit []
<DouweM>
Kamuela: it's tempting, but I like what I learn at uni too much, and I'm getting enough coding in through my job anyway. not complaining at all, just holy fuck charliesome is awesome
<bricker>
apeiros: okay lat question
<apeiros>
bricker: don't make promises you can't hold :-p
<DouweM>
Kamuela: I'm just hella impressed because I've known about charliesome for a while, I just figured he was a 20-something guy like the rest of the Ruby world. To see much he's accomplished w/ Ruby, GitHub etc while he's the same age as I am is always humbling. But yeah; didn't mean to fish, but I can see how it could come off that way
<DouweM>
benzrf: wrote a couple of cool gems, works on Ruby, works at GitHub. but mostly I've known about him as a name for so long, and I only now realize he's so young.
<benzrf>
ah
<benzrf>
i only wish i'd written anything other people use
<benzrf>
:D
kcombs has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
<benzrf>
o:
<benzrf>
how perlish
<bricker>
it is perl!
<benzrf>
im aware, that's why i said it
<benzrf>
;p
vlad_sta_ has quit [Ping timeout: 252 seconds]
ewnd9 has joined #ruby
<shevy>
how ugly
<shevy>
now someone has to chime it
<shevy>
"it is perl!"
<benzrf>
har
threesome has quit [Ping timeout: 245 seconds]
larissa has joined #ruby
newbiehacker has quit [Ping timeout: 240 seconds]
amacgregor has joined #ruby
hiall has joined #ruby
<bricker>
apeiros: actually I'm going to sit on this for a while, let the visual image form in my head, see if it sticks, and come back if I need more clarification. Thank you :)
hukl_ has quit [Quit: Leaving...]
mattattaque has joined #ruby
<apeiros>
yw
colonolGron has quit [Quit: leaving]
fomatin has quit [Quit: Computer has gone to sleep.]
hiall has quit [Read error: Connection reset by peer]
gr33n7007h has joined #ruby
darkskiez has joined #ruby
darkskiez has joined #ruby
darkskiez has quit [Changing host]
kaspergrubbe has quit [Remote host closed the connection]
hiall has joined #ruby
ngoldman has joined #ruby
jhulten has quit [Remote host closed the connection]
myappleguy has left #ruby ["WeeChat 0.4.2"]
nhhagen_ has joined #ruby
mmcdaris has quit [Ping timeout: 264 seconds]
agjacome has quit [Quit: leaving]
pbae has joined #ruby
<shevy>
he falls asleep
IcyDragon is now known as IceDragon
nhhagen has quit [Disconnected by services]
nhhagen_ is now known as nhhagen
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
AlSquire has quit [Quit: This computer has gone to sleep]
<Kamuela>
i only know a steve balmer and i think he's getting fired
<shevy>
benzrf do you also learn go?
apeiros has joined #ruby
<nobitanobi>
who uses vim here?
<benzrf>
i have not
<benzrf>
it looks boring
<benzrf>
nobitanobi: me
<nobitanobi>
me too
<nobitanobi>
(Y)
<platzhirsch>
How would you name a module containing methods that involve HTTP? I am looking for a word like Enumerable or Runnable...
<DouweM>
platzhirsch: what kinds of methods?
<shevy>
nobitanobi I stopped using it about 8 years ago
Bira has joined #ruby
<nobitanobi>
shevy, yeah? why?
<platzhirsch>
DouweM: I just want to encapsulate some utility methods
gverri_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<DouweM>
platzhirsch: like?
<benzrf>
shevy: did you start 8 years + 1 day ago
<platzhirsch>
one converts a Curb response object into a string message
soba has joined #ruby
gajon has quit []
<shevy>
nobitanobi a multitude of reasons. a big one is that I hate the way you extend it with this specific let bla be bla function style. another was that there is always more and more to learn. another was that the brain associates actions with certain keystroke combinations - which I dont want to allow any editor to do
nhhagen has quit []
<shevy>
benzrf nah, somewhen in 2002 when I moved to linux
<shevy>
ruby in ... 2004 I think
nhhagen has joined #ruby
<nobitanobi>
shevy, another was that there is always more and more to learn -> this is good no?
<shevy>
nobitanobi is it? :)
RaCx has quit [Quit: Computer has gone to sleep.]
<platzhirsch>
DouweM: another one returns a boolean, whether the response was successful or not, based on the HTTP code
<nobitanobi>
shevy, well, you can always say.. I don't wanna learn more
<nobitanobi>
:P
<nobitanobi>
at least you have the chance to learn more
Apane has quit [Ping timeout: 246 seconds]
<shevy>
nobitanobi if you would become more productive perhaps, but I noticed a flat curve if at all, and a much higher curve to forget things I knew
<Kamuela>
I need to work backwards already with Rails, i need to just clone working apps or something
<DouweM>
platzhirsch: Not sure this needs an Xable name. if it's just utility methods, do you really need them encluded into other classes? why not just call them on the util module?
<nobitanobi>
shevy, I agree with that.
sambao21 has joined #ruby
<nobitanobi>
shevy, what do you use now, Sublime?
<shevy>
nobitanobi I'd rather fill my brain with more ruby knowledge. but the main gripe I have is with how you add to vim, those functions are so awful, it looks like 1970 era
<platzhirsch>
DouweM: you mean just call it module SomethingUtil?
<DouweM>
platzhirsch: yeah
<platzhirsch>
yes, you are right. Just thought it would be fancy, but I agree, it's not the right place
<nobitanobi>
hehe, that's true. config looks old
Xeago has joined #ruby
sambao21 has quit [Client Quit]
<shevy>
nobitanobi nah, really notepad-editor styles. bluefish 1.0.7 usually, other gtk-based ones sometimes. sublime is cool but I dont have a real need to switch. most actions I want to do I do with ruby scripts anyway, so I dont have a big need for superawesome editors
<Kamuela>
i think everything is pointing me to just do it and ask questions as i screw up
<Kamuela>
guides are really rough, i'm just learning that everyone has his own style
MrZYX is now known as MrZYX|off
nanoyak has joined #ruby
<shevy>
Kamuela true
<shevy>
Kamuela it means you must find your own style
<Kamuela>
i'm gonna have to respect that ruby is all about how you personally solve stuff
<shevy>
yeah
dkamioka_ has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 272 seconds]
<shevy>
it's one part of there-is-more-than-one-way
scarolan has quit [Ping timeout: 245 seconds]
<benzrf>
Kamuela: this is why i like python
<benzrf>
:{
<benzrf>
shevy: yes
<shevy>
:D
<benzrf>
shevy: i read most of it
<Kamuela>
i just figured since rails said convention over configuration, there'd be more... convention. lol
<shevy>
benzrf we should create a language that combines the best features of languages
<benzrf>
but i stopped about halfway through downtown
<benzrf>
shevy: but we disagree what those are!
<benzrf>
:D
danshultz has quit [Ping timeout: 244 seconds]
<shevy>
Kamuela, rails kinda does things in a very specific way, including on their ruby code
jerius has quit [Ping timeout: 246 seconds]
<shevy>
they use things that I dont see often used outside rails
<shevy>
like
adambeynon has joined #ruby
<shevy>
has_many :cheese
<atmosx>
shevvyyyyyy
<shevy>
atmosxxxxxx
Voodoofish430 has quit [Ping timeout: 248 seconds]
<atmosx>
shevy: one_to_many :asses
<shevy>
lol
<Kamuela>
yeah but when it comes down to it
<atmosx>
are you 'railing'?
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Kamuela>
everyone still approaches crap so differently in rails
<Kamuela>
it kinda drives me nuts
<shevy>
Kamuela the idea is that when you use specific rails-centric code parts, you can be more productive
Voodoofish430 has joined #ruby
<atmosx>
Kamuela: tell me about it.
<shevy>
atmosx still not :(
maletor has quit [Quit: Computer has gone to sleep.]
<benzrf>
i refuse to learn rails
<Kamuela>
like what the hell! i'm still confused about fat models skinny controllers
<benzrf>
im far too much of a hipster
<benzrf>
:D
<Kamuela>
because the model is EMPTY by default
<Kamuela>
WHAT THE F
<benzrf>
Kamuela: what's confusing about this
<benzrf>
Kamuela: models should be highly custom
einarj has quit [Remote host closed the connection]
<shevy>
I have not even reached that part
Monie has quit [Ping timeout: 245 seconds]
<atmosx>
Kamuela: I'm building an app on Sinatra and everytime I look for a sample code online (SO or otherwise) I crash a guy who use a completely different approach os structure. Sometimes I get the idea that either me or the other guy don't know what is doing.
<DouweM>
Kamuela: well duh... you need to add your own domain/business logic
<DouweM>
Kamuela: rails can't really make that up for you and pre-fill the model
<atmosx>
benzrf: what do dyou do for a living?
<benzrf>
atmosx: im 16
_Andres has quit [Quit: jazz]
<benzrf>
that need is filled for me atm
<benzrf>
:D
<shevy>
atmosx gas stations weekend robbery ;)
<Kamuela>
DouweM, so help me then, how does the view implicitly decide what happens in the model? because that's what i'm seeing
<atmosx>
benzrf: Lean rails and JS, it will serve you. Althourh you're young you can do anything
<benzrf>
shevy: that too
<platzhirsch>
benzrf: hahaha, that comic strip is superb
<shevy>
yes
<DouweM>
Kamuela: wait what?
<atmosx>
shevy: lol
<benzrf>
atmosx: i know js & try not to
<shevy>
benzrf, you have an excuse there
<benzrf>
atmosx: livescript is pretty coo
<shevy>
benzrf you can say you had to learn rails and JS because you were young and needed the money :>
<benzrf>
atmosx: it's like coffeescript with extra haskell and more sugar
<benzrf>
shevy: hmm
<benzrf>
a good excuse indeed
<benzrf>
i'd rather learn django
<benzrf>
:D
<shevy>
it is like haskell? with monads?
tobiasvl has quit [Ping timeout: 245 seconds]
<atmosx>
haskell? unknown languages
<Kamuela>
DouweM, a model will be empty, but still have storage capability for both username and email, for example, after you just ran a scaffold. and it'll happen through the form but the model is... empty. i don't get that
<atmosx>
lol
<benzrf>
shevy: no it's still a 1:1 JS mapping
<benzrf>
mostly
<shevy>
atmosx see, benzrf can not decide what language to use
<Kamuela>
DouweM, i'm looking for something to be "caught" in the model
<benzrf>
shevy: but it has crazy ass sugar
kpshek has quit []
<benzrf>
atmosx: do you not know of haskell?
<atmosx>
shevy: I see, he's got too much time to loose
myappleguy has joined #ruby
tvl has joined #ruby
<shevy>
atmosx knows a lot, not only about programming but also about biology
nateberkopec has quit [Quit: Leaving...]
<atmosx>
benzrf: not really, I don't know neither haskell or lisp
tvl is now known as tobiasvl
<DouweM>
Kamuela: well, the model is hooked up to the database table by the same name (pluralized), which is where its knowledge about fields comes from. all of its other functionality comes from AR::Base, which it extends
<benzrf>
oh man haskell is super neat
<shevy>
lispell
<DouweM>
benzrf: true dat. I love haskell
benlieb has joined #ruby
<atmosx>
shevy: When I'm done with this project of mine and the rails book, I'll go with Go!
* benzrf
fistbumps DouweM
<shevy>
right... benzrf taught me that haskell accepts only one argument in a function
<atmosx>
shevy: it's easy.
<Kamuela>
DouweM, so how is it that it knows how to deal with a form without any code?
breakingthings has quit []
<shevy>
atmosx really? I am trying to convince myself to go with ... java :(
<benzrf>
shevy: haskell curry
<benzrf>
so cool he got two things named after him
<shevy>
indian curry!
<atmosx>
shevy: java? why java?
<atmosx>
shevy: are you taking any online course?
fomatin has joined #ruby
<benzrf>
shevy: good lord java
<DouweM>
Kamuela: in your view, you use form_for @some_instance_of_that_model. form_for has a bunch of methods like form.text_field :field_name that correspond to the field_name field on @that_model_I_just_mentioned
<shevy>
atmosx I kinda need a language in addition to ruby
<atmosx>
all these use jv
lkba has quit [Ping timeout: 240 seconds]
<benzrf>
shevy: i hear c# is much better
<DouweM>
Kamuela: form_for does all of the heavy lifting of rendering the form
<atmosx>
shevy: JavaScript
<benzrf>
shevy: use mono
<benzrf>
atmosx: u wat
<shevy>
atmosx not really, I still lack time... but I need to use an additional language
<benzrf>
weak typing D:
<atmosx>
shevy: or Clojure
<shevy>
I hate javascript
<DouweM>
Kamuela: the form's values is then sent to the create action on your controller via params, which it sets on the model instance
<benzrf>
i should learn scala
<benzrf>
ajd clojure
thesheff17 has quit [Quit: Leaving]
lkba has joined #ruby
<DouweM>
Kamuela: the model instance then does database-y stuff with it
watermel0n has quit []
<atmosx>
benzrf: what exactly to you mean by learn?
<Kamuela>
DouweM, so controllers are the ones deciding the form elements?
<atmosx>
because we're throwing laguages here random, you happen to know all of them... I'ms scared.
<DouweM>
Kamuela: the code in your view determines what fields to show, check your new.html.erb
<DouweM>
Kamuela: the controller grabs all posted info from params and passes it to the model
benwoody has quit [Quit: benwoody]
<atmosx>
DouweM: do you happen to know how can I create a multilanguage website using sinatra?
hiall has quit [Quit: hiall]
mercwithamouth has quit [Ping timeout: 272 seconds]
<DouweM>
atmosx: I do not. Have no experience with Sinatra
<atmosx>
DouweM: How would you do that in rails?
<Kamuela>
DouweM, the fact you just said "code in your view" confuses the hell out of me, MVC down the drain?
<benzrf>
atmosx: what is unclear about the word?
<benzrf>
O:
<atmosx>
I'm usinv MVC actually, manually heh
<shevy>
atmosx it's the youth, they wanna learn. once they get older, they settle for beer instead
<benzrf>
by learn i mean learn
ewnd9 has quit [Ping timeout: 272 seconds]
<benzrf>
i know OF clojure, and I know scala up to hello world
<DouweM>
Kamuela: your view is your views/controller_name/new.html.erb file. of course there's HTML in there, and some Ruby for loops and stuff and for rendering the form, which is a very view-y thing
<DouweM>
Kamuela: Rails has its own interpretation of MVC, but I don't think this is a good example of where it misses it
<benzrf>
anyway righ now im reading land of lisp, so once i finish that maybe ill look into clojure
<benzrf>
does it have macros? it cant be much of a lisp without macros ..?
<DouweM>
atmosx: multilingual site on Rails depends on whether you want localized models or views or messages or whatever
<atmosx>
benzrf: the level of knowledge actually. Knowing could mean "I can understand a code-snippet when I see it" or I can write an entire app by heart and I understand how to use all the perks that come with the lang properly.
<Kamuela>
DouweM, give me a second, i'll try to see if i can make a new project and g scaffold Users username:string email:string
<DouweM>
atmosx: in all cases: check out the i18n gem
ce_afk is now known as cescalante
baordog has quit [Remote host closed the connection]
<Kamuela>
DouweM, or is it User
<atmosx>
shevy: beer!!!!
<shevy>
:D
<DouweM>
Kamuela: bad example, because you have certain expectations about usernames and passwords and authentcation etc. try a Post with title:string and body:string, for example
_maes_ has joined #ruby
<atmosx>
DouweM: jus messages (meaning the views/ directory)
<DouweM>
Kamuela: and yeah, the model is singular
<atmosx>
the rest don't need any ocalization
<DouweM>
atmosx: in which case, use i18n
<benzrf>
atmosx: well when i learn a lang i like to learn it enough that i really undestand it
<atmosx>
DouweM: k, I'll check it out
<benzrf>
otherwise it bugs me that i dont know how everything works
<Kamuela>
ok DouweM i'll do that one sec
<DouweM>
atmosx: it allows you to specify messages in yaml files and then reference them from the views. you can set I18n.locale which it will use to pick the right localization file
<benzrf>
not memorizing the spec, necessarily, nor the stdlib
<benzrf>
but like the basic semantics &c
<DouweM>
atmosx: http_accept_language is a gem which will help you get that locale info from the request header
_zxq9_ has joined #ruby
<atmosx>
DouweM: awesome. I'll just use flags or a drop down menu
<atmosx>
to set localization
<DouweM>
atmosx: good too, as long as you set I18n.locale :)
ngoldman has quit [Remote host closed the connection]
<atmosx>
DouweM: I can do that in rails out of the box using params
duggiefresh has quit [Remote host closed the connection]
<atmosx>
okay
Ox6abe has quit [Remote host closed the connection]
<atmosx>
err no rails sorry sinatra.
<atmosx>
hm, cool.
<DouweM>
atmosx: right, if you want like a dropdown or links. but http_accept_language is neat if you want to anticipate the user's language
aarkerio has joined #ruby
duggiefresh has joined #ruby
<Kamuela>
DouweM, rails g scaffold Post title:string body:string, so we're on the same page
<atmosx>
I also need to start my other project...
ngoldman has joined #ruby
sambao21 has joined #ruby
<atmosx>
and my thesis
<DouweM>
Kamuela: yeah
<atmosx>
fuck
<atmosx>
too much code, too litle time all of them web-apps
<benzrf>
web apps r lame
<benzrf>
random screwing around ftl
<benzrf>
*ftw
* atmosx
and my FreeBSD friends do not consier ruby or anything web-related a computer programming language
<Kamuela>
atmosx, haha. all i have to do is make a coming soon mailing list page, and i spend all day hiding from the guy and learning railzz :)
<benzrf>
atmosx: in what way is ruby webrelated
<DouweM>
atmosx: :|
<benzrf>
it is commonly used for that sure
<atmosx>
DouweM: poor me :-(
<DouweM>
Kamuela: your Rails stuff may be better suited for #RubyOnRails btw
zxq9 has quit [Read error: Operation timed out]
<DouweM>
Kamuela: because I gotta go in a minute, class in the morning and it's 12:15 am
mikepack has quit [Remote host closed the connection]
<aarkerio>
hi! in this line : def topic_admin?; role_is_topic?(:topic_admin); end
<aarkerio>
why is a ";" after "?"
<Kamuela>
DouweM, if you personally don't have time right now to help me, that's cool
<atmosx>
aarkerio: def shit; puts "shit happens"; end
<Kamuela>
DouweM, ok, well models is empty, let me check the views
<RubyPanther>
benzrf: lol awesome
_maes_ has quit [Ping timeout: 246 seconds]
<aarkerio>
mmmm, great! thanks guys!
<atmosx>
aarkerio: you're welcome
<DouweM>
atmosx: forgive me my stalking, but I like greek names and you have an awesome sounding one
<Kamuela>
DouweM, i'm seeing in the _form.html.erb f.label :title, f.txt_field :title, and for_for @post, so @post is the current instance of the post model?
RichardBaker has quit [Quit: RichardBaker]
<atmosx>
DouweM: no worries, I'd be using an alias and Tor if I didn't want you to find my ID ;-)
zz_scottstamp is now known as scottstamp
<benzrf>
RubyPanther: from Land of Lisp
duggiefresh has quit [Ping timeout: 248 seconds]
<DouweM>
Kamuela: yup, it's set in your controller's #new method
<atmosx>
DouweM: thanks btw, for the compliment! (Which brings to the point where I feel that is a good time to mention that I have a gf!)
<DouweM>
Kamuela: controllers and views share instance vars
<benzrf>
[it goes on to say that FP is pretty cool but they think side fx should be allowed if you want]
<DouweM>
atmosx: lol
<atmosx>
hahah
yfeldblu_ has joined #ruby
lolmaus has quit []
ckinni has joined #ruby
<Kamuela>
DouweM, does only a controller have access to the Models?
<DouweM>
atmosx: something about how you can know if a programmer has a girlfriend, yada yada, because they'll tell you
<atmosx>
DouweM: my iPhone got stolen recently and I'm waiting for the police to help, but I'm not hopeful anymore...
<benzrf>
DouweM: mmm pressing space on your site misaligns ItSANgo
yfeldblum has quit [Ping timeout: 240 seconds]
<benzrf>
*it
<DouweM>
atmosx: ah... the sdk's gotten a lot better recently btw
<benzrf>
DouweM: maybe you can somehow actually restrict scrolling instead of capturing up/down
<DouweM>
benzrf: how do you suggest I handle space?
<Kamuela>
DouweM, is this magic in post_params?!?!
<benzrf>
dunno
daxroc has joined #ruby
kitak has joined #ruby
havenwood has quit [Remote host closed the connection]
<DouweM>
benzrf: and nah, I'd hate restricting scrolling
<DouweM>
benzrf: I do capture option+up/down as wlel
<benzrf>
DouweM: no i meant like
<benzrf>
wait hmm
<DouweM>
Kamuela: that's getting the params from the form
<benzrf>
is there an onScroll event or something?
iamjarvo_ has quit [Ping timeout: 245 seconds]
<benzrf>
If so, you could capture that instead of up/down
<iajrz>
DouweM: you could make space jump you to the next title?
<benzrf>
and modulo
<iajrz>
thats what I was expecting when I pressed it
<DouweM>
benzrf: there is, what'd you want to do?
<Kamuela>
DouweM, but basically this is what passes it to your model, because your model is straight DB about things?
myappleguy has quit [Ping timeout: 245 seconds]
<DouweM>
iajrz: I could. you can send me a pull request :P
olivier_bK has quit [Quit: Quitte]
olivier_bK has joined #ruby
<DouweM>
Kamuela: post_params just gets a Hash with all form values, inside #create it's passed to the model, inside Model#save it's saved to the DB
<DouweM>
iajrz: I never use space to navigate, so I didn't think of that. will look into it tho
mikepack has joined #ruby
<benzrf>
DouweM: module man!
<benzrf>
*modulo
<Kamuela>
DouweM, so once it gets into your model, is Model#save where the business logic is applied?
<DouweM>
benzrf: ?
<Kamuela>
DouweM, and then helper methods from within the model?
Clooth has quit [Quit: Leaving...]
<DouweM>
Kamuela: business logic is all of your own methods, validation etc. your own methods you'll need to call, validation is applied on #save, yeah
sambao21 has quit [Quit: Computer has gone to sleep.]
<Kamuela>
DouweM, wow, i think i'm getting it somewhat
asteros has quit [Ping timeout: 240 seconds]
fgo has joined #ruby
RTG` has quit []
<benzrf>
DouweM: i know, capture scrolling, then shift the position of the text so that it always lines up
<Kamuela>
DouweM, but how is a scaffold able to automatically save to the DB? is it because Save is a method that we overload?
<benzrf>
:D
asteros has joined #ruby
daxroc1 has joined #ruby
<DouweM>
benzrf: ew :P
zz_michael_mbp is now known as michael_mbp
RTG` has joined #ruby
<benzrf>
DouweM: aw
<DouweM>
Kamuela: "the scaffold" just sets up a bunch of controllers and views. the view shows form fields, when you hit [Save] it's posted to #create, create gets the params via post_params, it's passed to the model, which is then #save'd
<benzrf>
you could trap the event and modify it so that scrolling moves in discrete amounts
<DouweM>
benzrf: feel very free to post a pull request
<DouweM>
benzrf: I'd hate it if a website were to hijack my scrolling
<benzrf>
hmm
Astralum has quit [Ping timeout: 245 seconds]
benlieb has quit [Quit: benlieb]
RichardBaker has joined #ruby
<benzrf>
i guess having a pull request accepted even just once would look good on my resume
<benzrf>
:B
_zxq9_ has quit [Quit: Konversation terminated!]
<Kamuela>
DouweM, post_params is a params object that is passed to the Post model constructor?
<DouweM>
benzrf: haha
daxroc has quit [Ping timeout: 272 seconds]
<DouweM>
Kamuela: a params object is just a Hash with [form field name]=>[form field value]
<DouweM>
Kamuela: but yeah, that hash is passed to the Post constructor
<Kamuela>
DouweM, what is the post constructor's method called? is it new like you jsut said?
<DouweM>
Kamuela: in ruby, Class.new is the constructor, yeah
simplyaubs has joined #ruby
<Kamuela>
DouweM, so if i went into my model and said
<DouweM>
Kamuela: it calls #initialize where initial setup is performed
<Kamuela>
DouweM, so would i overload initialize or new?
<DouweM>
Kamuela: you wouldn't either, but if you were so inclined, you'd override #initialize
michael_mbp is now known as zz_michael_mbp
<DouweM>
Kamuela: you shouldn't touch .new unless you know what you're doing
<Kamuela>
DouweM, it's better practice to manipulate instance variables outside of the constructor?
<DouweM>
with activerecord, you really don't ever need to override #initialize though
Banistergalaxy has quit [Ping timeout: 248 seconds]
<DouweM>
Kamuela: what kinds of ivars would you want to use on the model?
mlpinit has quit [Remote host closed the connection]
<DouweM>
benzrf: LiveScript looks nice btw. Like like like the functional influences
mlpinit has joined #ruby
<benzrf>
yeah
<benzrf>
the recommended stdlib is actually called prelude.ls
<Kamuela>
DouweM, when we have @post.title and @post.body, these are all given access_attr because of the activerecord default constructor?
<benzrf>
=]
<iajrz>
DouweM: I forked and changed the code
<iajrz>
how do I submit the pull request?
<iajrz>
noticed you'd done the same thing for alt+down
<iajrz>
never thought of pressing alt+key on browser
<DouweM>
iajrz: if you go to the compare view for your branch, there should be a Add Pull Request button
DonRichie has quit [Quit: Verlassend]
<DouweM>
Kamuela: access_attr ?
jblack has quit [Quit: Lost terminal]
tonni has joined #ruby
<DouweM>
iajrz: make changes in the .coffee version, compile to .js, submit both
<Kamuela>
DouweM, i could be using the wrong terminology, but basically the accessor methods are generated by default because of what was passed to the constructor
<DouweM>
iajrz: don't touch .js manuyally ;)
<iajrz>
ahhh, coffeee :'(
<iajrz>
lol, I know not coffee, did it in js
newbiehacker has quit [Ping timeout: 245 seconds]
tharindu has joined #ruby
<iajrz>
well, learning day I guess.
<iajrz>
brb
<DouweM>
Kamuela: the Post model knows it has fields title and post because it has access to the DB tables. it will then create getters and setters for those fields, yeah
scarolan has joined #ruby
<DouweM>
iajrz: your changes should be pretty straightforward based on the existing code
<Kamuela>
DouweM, so Post model reads the database, and Rails internally deals with what it knows, and everything else is an override? which is why nothing can be done until a db:migrate?
mercwithamouth has joined #ruby
<DouweM>
Kamuela: pretty much
<DouweM>
atmosx: cool
<Kamuela>
DouweM, if I didn't use a scaffold, would I have had to code a migration?
<atmosx>
DouweM: yea you could get names like one77.bit
mlpinit has quit [Ping timeout: 245 seconds]
<DouweM>
Kamuela: yup
ngoldman has quit [Remote host closed the connection]
<Kamuela>
DouweM, i'm GETTING it!
elux has quit [Quit: Bye!]
<atmosx>
or maybe evenprime.bit
jhulten has joined #ruby
<atmosx>
hehe
sambao21 has joined #ruby
christopherdupon has joined #ruby
<DouweM>
Kamuela: :D
<Kamuela>
DouweM, so what is the absolute most RESTful way to deal with your root?
<Kamuela>
DouweM, i guess that's a good question, haha, but what if you want to show just like an intro page or something. should you have a pages controller for your non-appy stuff?
xk_id has quit [Quit:
ner0x has quit [Quit: Leaving]
<DouweM>
iajrz: not that I wasn't going to accept that piece of code anyway, too much duplication with the up/down thing. you could extract it into a goToNextSection() method or something
<DouweM>
Kamuela: that's the convention yeah, so a PagesController with #home, #contact, #about etc
^Chris^ has quit [Ping timeout: 245 seconds]
<iajrz>
aye, I could, but I tend to get overexcited
<iajrz>
now looking at how to compile coffeescript
<DouweM>
iajrz: I expect an awesome pull request in the morning
<Kamuela>
DouweM, and then once you get down to your social/dynamic stuff, that's when you scaffold for that other stuff and try to keep it RESTful?
<DouweM>
and now, I'm gonna catch some sleep
<DouweM>
Kamuela: I never scaffold, I just write the controllers, views an models myself
<DouweM>
Kamuela: but yeah, what I'd write myself would pretty much match what scaffolding sets up for you
carif has joined #ruby
<Kamuela>
DouweM, you've helped me immeasurably :D
<DouweM>
Kamuela: also, are you learning Rails through a book or by yourself? because most of what you've asked should've been explained to you
<DouweM>
Kamuela: I can recommend railstutorial.org
<Kamuela>
DouweM, i'm reading many books and watching a lot of things, i'll admit that maybe i've just missed these things that i'm asking, but i really think they leave them out for some reason
<DouweM>
Kamuela: np. if you have any more questions, there's always #ruby and #RubyOnRails. and if you don't trust them, I'm online most of the time as well
<DouweM>
Kamuela: yeah, I don't really like the shotgun approach. just go with one good book, as I said, going through railstutorial.org from start to finish should be sufficient
<DouweM>
Kamuela: that's what I used
<Kamuela>
i've never seen the connection from post_params explained and the migration code being explained as the way your database gets set up
<Kamuela>
and the fact that your model reads from the db
<DouweM>
iajrz: so I'm gonna get some sleep, if you message me I'll see it in the morning :) looking forward to your pr
mikeg has quit [Remote host closed the connection]