fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
sailias has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
ephemerian has quit [Quit: Leaving.]
sneakyness_wk has quit [Quit: JUST ADD BEEF]
baroquebobcat has quit [Quit: baroquebobcat]
tds has joined #ruby
triptec has quit [Read error: Operation timed out]
Takehiro has quit [Ping timeout: 252 seconds]
karakedi has joined #ruby
mercwith1mouth has quit [Ping timeout: 244 seconds]
<dekz>
answer to my question is yes and it's accesible through RACKUP inside the configuration file RACKUP[:port] for eample.
mrdodo has quit [Remote host closed the connection]
<t0rc>
I am having trouble installing bundler on Mountain Lion. I started with the CLI then switched to using the RVM GUI and it says it installs yet I cannot access the commands, gem says it isn't installed.
<burgestrand>
karstensrage: the repository you have there is how an example application using devise could look like, but most likely not something to continue building from
digitalcakestudi has quit [Ping timeout: 246 seconds]
<karstensrage>
not something? or something to continue building from?
<burgestrand>
karstensrage: not something to continue building from, but rather something to look at to see of how you could use devise
<burgestrand>
karstensrage: kind of like a blueprint
<karstensrage>
ok i see
<burgestrand>
karstensrage: for example, it is using a slightly older version of rails than you should use when starting a new application, especially if you are new to rails in general, since the current guide material for rails is for newer versions
<karstensrage>
rails is like the framework, right?
<burgestrand>
it’s not *really* old, but slightly out of date :)
g33k has joined #ruby
<karstensrage>
it says i have ruby 1.8.7 and WEBrick 1.3.1
<karstensrage>
oh
<burgestrand>
karstensrage: yes, rails kind of enforces a structure on how you should write your code, and where you should put your code, in order to help you build web applications faster and in a good way
<karstensrage>
and Rails 3.0.10
guns has quit [Ping timeout: 244 seconds]
<burgestrand>
karstensrage: yes :) that is because of the file named Gemfile in that repository, it tells your application which gems (libraries) and versions you should use when running the application
zz_fbernier has joined #ruby
<karstensrage>
oh i see yes
<karstensrage>
and 3.0.10 is old?
<burgestrand>
karstensrage: together with the Gemfile.lock file, it is the single authorative documentation of what versions that application can use
<burgestrand>
karstensrage: yes, not very old, but we have version 3.2 now, which is the most recent one
zz_fbernier is now known as fbernier
<karstensrage>
gotcha
<burgestrand>
karstensrage: new releases often come with new features, and many guides may use some of these new features, which means that if you follow a new guide with an old version, you might get confused
guns has joined #ruby
arkiver has joined #ruby
guns is now known as Guest32664
Guest32664 has quit [Client Quit]
<burgestrand>
karstensrage: are you new to both ruby and rails?
Guedes has quit [Ping timeout: 246 seconds]
<karstensrage>
yes
<burgestrand>
welcome :)
fbernier is now known as zz_fbernier
<karstensrage>
my goal is write a devise plugin for my service
<karstensrage>
thank you
<burgestrand>
karstensrage: you know other languages before ruby?
<karstensrage>
yup
<karstensrage>
mostly java, php, some python and i cut my teeth on symbolics lisp and C programming
<burgestrand>
sounds like a good arsenal, ruby has many similarities to python, more so than the other languages you know from earlier, but has a very different culture and structure in it’s applications
answer_42 has joined #ruby
<karstensrage>
would you recommend a good intro from my background to introduce me to the culture and structure aspects?
<karstensrage>
i found the lacking in python
<karstensrage>
just big api docs
lolsuper_ has quit [Read error: Connection reset by peer]
<karstensrage>
and focus on sugar as if the intro to lisp was by showing you 'loop'
<burgestrand>
culture is probably best received from idling in this channel and possibly even #ruby-lang, it comes with time and is hard to read to
_veer has joined #ruby
_veer has quit [Changing host]
_veer has joined #ruby
<bnagy>
yeah ganesh help us all if this chan is the exemplar for 'culture' ;)
<burgestrand>
I have a note I regularly give to new people of ruby, trying to find the link
<burgestrand>
our culture is vast :p
AlbireoX has quit [Read error: Connection reset by peer]
AlbireoX has joined #ruby
<bnagy>
... I had to try SO hard to avoid a mom joke there
<burgestrand>
the list of blogs is kind of outdated, I should move that to the bottom
jastix has joined #ruby
mc0e has quit [Ping timeout: 246 seconds]
justinmcp has quit [Remote host closed the connection]
<burgestrand>
karstensrage: apart from that document, it’s all about how you learn best, some people read books, some people watch videos, some people follow online tutorials, and some people just wing it
matrixise has quit [Ping timeout: 272 seconds]
fantazo has quit [Remote host closed the connection]
ryanf has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
Kneferilis has joined #ruby
williamherry has joined #ruby
arturaz has joined #ruby
mahmoudi_ has quit [Quit: Computer has gone to sleep.]
RubyPanther has quit [Ping timeout: 240 seconds]
thaz has joined #ruby
robbyoconnor has joined #ruby
luckyruby has joined #ruby
ryanf has quit [Ping timeout: 244 seconds]
abrausch has joined #ruby
r0bby has joined #ruby
tagrudev has joined #ruby
ph^ has joined #ruby
mascool has joined #ruby
r0bby has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Read error: Connection reset by peer]
r0bby has joined #ruby
maesbn has joined #ruby
daniel_hinojosa has quit [Ping timeout: 276 seconds]
gtuckerkellogg has joined #ruby
bhavesh_a_p has joined #ruby
bradhe has joined #ruby
und3f has joined #ruby
mercwith1mouth has quit [Ping timeout: 240 seconds]
burgestrand has quit [Quit: Leaving.]
<bhavesh_a_p>
hello
bradhe has quit [Ping timeout: 276 seconds]
bradhe has joined #ruby
bhavesh_a_p has quit [Quit: Leaving]
yxhuvud has quit [Ping timeout: 255 seconds]
jprovazn_away is now known as jprovazn
kyb3r has joined #ruby
heisenmink has joined #ruby
Z_Mass has quit [Quit: Leaving]
linuxsable has quit [Ping timeout: 248 seconds]
sonkei has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Remote host closed the connection]
s1n4 has joined #ruby
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
ryanf has joined #ruby
Y_Ichiro has quit [Read error: Connection reset by peer]
cantonic has joined #ruby
yshh has quit [Quit: Leaving...]
bradhe has quit [Ping timeout: 248 seconds]
kjellski has joined #ruby
heisenmink has quit [Remote host closed the connection]
hipertracker has quit [Quit: hipertracker]
linuxsable has joined #ruby
ph^ has quit [Remote host closed the connection]
Mister5 has joined #ruby
nilg has joined #ruby
igotnolegs has quit [Ping timeout: 268 seconds]
luckyruby has quit [Remote host closed the connection]
zeromodulus has quit [Ping timeout: 268 seconds]
LouisGB has joined #ruby
savage- has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
Mister5 has quit [Quit: Leaving]
williamherry has quit [Quit: WeeChat 0.3.7]
noyb has quit [Ping timeout: 255 seconds]
aarwine has quit [Remote host closed the connection]
Mister5 has joined #ruby
triptec has joined #ruby
christor has joined #ruby
christor is now known as alphoro
<alphoro>
Hi, is there a simple way to convert char to hex? ex: "abc" to \x61\x62\x63 ?
qwerxy has joined #ruby
justinmcp has joined #ruby
lolmaus has joined #ruby
JJMalina has joined #ruby
<bnagy>
well if you enter "\x61" you'll just get 'a'
<fowl>
>> "a" == "\x61"
<al2o3cr>
(TrueClass) true
<bnagy>
you can convert to hex a few ways, depending on what you want the output to look like
<alphoro>
fowl: yess I want to convert char to hex so it is the same
<fowl>
alphoro: it _is_ the same
dhruvasagar has joined #ruby
<fowl>
>> "\x61\x62\x63" === "abc"
<al2o3cr>
(TrueClass) true
<alphoro>
I have a string like "azereazrfezat" and I want to get a chain like "\x61\x......"
<bnagy>
"foo" is 3 bytes "\x66\x6f\x6f" is 3 bytes
Takehiro has joined #ruby
<bnagy>
"\\x66\\x6f\\x6f" is 12 bytes
stepnem has joined #ruby
<fowl>
alphoro: are you thick?
<alphoro>
fowl: no , just try to understand how to get my result :)
<alphoro>
I need to use Zlib::Inflate.inflate(compressed) ( where compressed is \x... and I cannot put directly the string)
<fowl>
alphoro: then why arent you reading what the people who are trying to help you are saying
matrixise has joined #ruby
<bnagy>
alphoro: ok, you need to explain exactly what you want, because if you want a string representation of the hex values, that will not be the same
Mister5 has quit [Quit: Leaving]
Takehiro has quit [Ping timeout: 240 seconds]
<bnagy>
as far as ruby is concerned 'A' and 0x41 and 65 are all exactly the same thing
<bnagy>
it's just a byte
luckyruby has joined #ruby
Mister5 has joined #ruby
<bnagy>
if you want to display a backslash, an x and a 4 and a 1, that's gonna be 4 bytes
ph^ has joined #ruby
Mister5 has quit [Max SendQ exceeded]
zz_fbernier has quit [Read error: Connection reset by peer]
Mister5 has joined #ruby
<alphoro>
bnagy: I know that , I need to use Zlib to uncompress data. Currently my data are in the format "aaa" and I need to convert aaa in \x61\x61\x61. Zlib::Inflate.inflate(aaa) does not work, I need to set Zlib::Inflate.inflate(\x61\x61\x61)
<fowl>
what i do when working with bytes, (just to display them!) something like str.bytes.map {|b| b.to_s(16)}.join' '
<bnagy>
alphoro: you're mistaken
<bnagy>
I odn't know what you're problem is, but that's not it
<bnagy>
*your
<bnagy>
frickin finger memory
aganov has joined #ruby
<fowl>
the problem is that is not a valid header
<fowl>
>> require'zlib'; Zlib.deflate('abc')
<al2o3cr>
(String) "x\x9CKLJ\x06\x00\x02M\x01'"
<bnagy>
well we assume he's not actually trying to inflate 'aaa' :P
<fowl>
see how it comes out with with characters like x, K, L, J
khakimov has quit [Quit: Computer has gone to sleep.]
heisenmink has joined #ruby
<alphoro>
fowl: you right the header are not valid
<fowl>
alphoro: i can't help you because you arent reading. how do you expect to get anything from a text-based chat if you wont read?
<suborbital>
sooo
<bnagy>
to be honest, I don't really trust Zlib, had it break on some valid stuff before
<bnagy>
you should test shelling out to gunzip
<alphoro>
fowl: I m reading , just not understanding your point of view may be due to my lack of knowledge on ruby
<alphoro>
the exercice is to decrypt a chain coded in base64 and encrypted with zlib. Here the chain : eJyr9A8uyIjKrPCKSgvIBgAjFQT0
Mister5 has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
specialGuest has joined #ruby
<bnagy>
zlib is not encryption
<alphoro>
sorry compressed
frogprince_mac has joined #ruby
igotnolegs has joined #ruby
Morkel has joined #ruby
Mister5 has joined #ruby
<bnagy>
what's it supposed to end up as?
<bnagy>
cause it looks like ascii junk to me
<Mon_Ouie>
I get yOSphZixJZfPk if I try Base64.decode + Zlib.inflate
jgrevich has quit [Quit: jgrevich]
<bnagy>
Mon_Ouie: I was trying not to do people's homework for them :/
<Mon_Ouie>
Oh, sorry :p
<alphoro>
bnagy: of course , don t worry I have a timing to send the answer and it change everytime
_bart has quit [Quit: _bart]
<alphoro>
bnagy: this is why I need to script it because I have 2 sec to send the answer
<banisterfiend>
Mon_Ouie: 'alut
<bnagy>
well if that ascii junk is correct, then job done
<Mon_Ouie>
'alut
saschagehlich has joined #ruby
<alphoro>
Oh I got it :)
<alphoro>
ok my apologies, I thought in the inflate we need only hex value but it s working with char as well.
thone_ has joined #ruby
<bnagy>
siiigh
<alphoro>
:p
<bnagy>
alphoro: there IS NO DIFFERENCE
<Mon_Ouie>
hex values don't exist, they're just a different way of representing integers (or characters in this case)
<alphoro>
yes ok I will know it
<fowl>
bnagy: lets go to an irc channel and ask for help but not read what people say
wobr has joined #ruby
<fowl>
bnagy: u and me, it can be our first date ;)
eldariof has joined #ruby
<alphoro>
I agree with that but a module can be done in a way to wait string like "\x" to force the hexa no?
<bnagy>
alphoro: NO
<bnagy>
because ther IS NO DIFFERENCE
thone has quit [Ping timeout: 240 seconds]
<bnagy>
internally they are exactly the same
keymone has joined #ruby
rakl has quit [Quit: sleeping]
rakunHo has joined #ruby
Mister5 has quit [Quit: Leaving]
pskosinski has joined #ruby
<Mon_Ouie>
"a" == "\x61" #=> true
pefavre has quit [Remote host closed the connection]
luckyruby has quit [Remote host closed the connection]
AxonetBE has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
linuxsable has quit [Quit: linuxsable]
<AxonetBE>
I have a mysql process that stays sleeping and it is linked to a Rack process .How can I see what this rack process is doing?
chimay has joined #ruby
chimay has quit [Changing host]
chimay has joined #ruby
qwerxy has quit [Quit: offski]
jimeh4 has joined #ruby
jimeh4 has quit [Read error: Connection reset by peer]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
savage- has joined #ruby
croz has quit [Read error: Connection reset by peer]
croz has joined #ruby
jimeh4 has joined #ruby
ryanf has quit [Ping timeout: 246 seconds]
jsmonkey has joined #ruby
<jsmonkey>
hi, If I have a variabel called x and lets say I want to set it to y but only if y is not nil if not I want to run a reduce function on an array. Of course I can check this with a simple if condition but if I remember correctly (was some time ago I used ruby) there should be like x = y || do.. something something that returns the reduce. anyone catch what I am after?
goodieboy has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
c0rn_ has quit []
banisterfiend has quit [Remote host closed the connection]
<Hanmac1>
jsmonkey what do you want to reduce within your array? an sum or an product?
Hanmac1 is now known as Hanmac
<jsmonkey>
Hanmac: that is some default business data stuffy thingy-ingy. can I just do like x = y || my_bla.reduce({}).... ?
vectorshelve has joined #ruby
<bnagy>
you can, but it looks horrible
Criztian has joined #ruby
<jsmonkey>
bnagy: how then? can I do like this? x = y || do (new line and there have my reduce stuff and then end the block?
abrausch has quit [Ping timeout: 246 seconds]
<bnagy>
just use an if statement
<jsmonkey>
is that really that much nicear?
<bnagy>
unless your reduce is ultra short, but I still don't like it cause what does y have to do with some_other_thing.reduce...
abrausch has joined #ruby
<jsmonkey>
bnagy: it is kinda short but for learning purposes. what other way can I solve it with ruby?
<jsmonkey>
preferebly in some block way
PapaSierra has joined #ruby
PapaSierra has left #ruby [#ruby]
<bnagy>
I don't know what you're trying to do - it's hard to refactor simplified examples with fake variable names
<jsmonkey>
bnagy: I hear you
Criztian has quit [Ping timeout: 245 seconds]
djdb has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
nilg has quit [Remote host closed the connection]
Criztian has joined #ruby
haxrbyte has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
Rochefort has joined #ruby
<Mon_Ouie>
Also, when you do reduce({}), it's likely you will be mutating the hash instead of changing the accumulator
<Mon_Ouie>
So you might as well use #each_with_object
workmad3 has joined #ruby
adambeynon has joined #ruby
M- has quit [Quit: This computer has gone to sleep]
<jsmonkey>
Mon_Ouie: what do you mean? if I pass in an empty hash to reduce that is exactly what I want to mutate, not the accumlated values
<jsmonkey>
what am I missing?
xorigin has joined #ruby
elaptics`away is now known as elaptics
Criztian has quit [Ping timeout: 240 seconds]
nilg has joined #ruby
artOfWar has quit [Remote host closed the connection]
<Mon_Ouie>
reduce is not when you want to mutate a specific object, it's when you want to return a new accumulator after each iteration
<Mon_Ouie>
e.g. inject { |acc, e| acc + e }
beneggett has joined #ruby
<Mon_Ouie>
It looks awkward when you use it for mutating: inject({}) { |h, e| h[e] = stuff; h }
savage- has quit [Remote host closed the connection]
<jsmonkey>
Mon_Ouie: hm okey you are probaly correct but I have used reduce many times to mutate a sent in start value like an empty hash or something else
<jsmonkey>
but I get your point
hipertracker has joined #ruby
Kabaka has quit [Quit: Rebooting for kernel upgrade]
Vert has joined #ruby
Jrz has joined #ruby
bradhe has joined #ruby
kjellski has quit [Remote host closed the connection]
<bnagy>
in 1.8 you had no option, since each_with_object you can (and should) stop abusing poor inject :)
Kabaka has joined #ruby
Kabaka has quit [Excess Flood]
Kabaka has joined #ruby
justsee has quit [Quit: Leaving...]
kjellski has joined #ruby
baphled has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
cezar has joined #ruby
ephemerian has joined #ruby
cezar has quit [Client Quit]
frogprince_mac has quit [Quit: Leaving...]
BiHi has joined #ruby
manouche has quit [Remote host closed the connection]
jayne has quit [Quit: shutting down]
jayne has joined #ruby
alphoro has quit [Quit: leaving]
dhruvasagar has quit [Ping timeout: 240 seconds]
diegoviola has quit [Ping timeout: 246 seconds]
goodieboy has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
Ev3r10sT has joined #ruby
<Ev3r10sT>
hey there
qwerxy has joined #ruby
<Ev3r10sT>
I'm trying to translate a ruby script to another langage. It's ok until now... Can someone tell me what that does :
<Ev3r10sT>
Digest::MD5.hexdigest(data[9 .. 28])
<Ev3r10sT>
?
maletor has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
techsurvivor has quit [Quit: WeeChat 0.3.8]
<lupine_85>
Ev3r10sT, calculates an md5sum of a subset of the contents of the data string
mklappstuhl has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
sdwrage has quit [Quit: geekli.st/programmer]
<Ev3r10sT>
oh ok! thanks lupine_85
Banistergalaxy has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<morsik>
i'm trying to update gitlab to latest version and it needs capybara-webkit. well... the problem is that i can't install it for unknown reason: http://pastebin.com/Srpf9wzx
<helpa>
Hi morsik. We in #rubyonrails would really appreciate it if you did not use pastebin during your time with us.
<helpa>
Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
tonini has quit [Remote host closed the connection]
Criztian has quit [Read error: Connection reset by peer]
<morsik>
i read in capbara-webkit docs that i need Qt, but it even don't try to run configure or anything like that...
Criztian_ has joined #ruby
robotmay has joined #ruby
<bnagy>
helpa: you're not in #rubyonrails
lampe2 has joined #ruby
<morsik>
bnagy: it's bot... ;D
<bnagy>
well get it the frack out then
hoelzro|away is now known as hoelzro
AxonetBE has left #ruby [#ruby]
saschagehlich has quit [Ping timeout: 268 seconds]
<hoelzro>
hi guys; does anyone know of a good library for manipulating SSH keys? (namely, checking if a password is the right one for a key)
<bnagy>
morsik: read the log it tells you to read (or pastie it)
<morsik>
bnagy: this is log! i pasted it. gen_make.out contains only "/home/git/ruby/bin/ruby extconf.rb"
<morsik>
and nothing else
<bnagy>
try just gem install capybara-webkit
<bnagy>
do you have dev tools installed?
<bnagy>
that accounts for about 90% of those failures
<morsik>
dev tools for ruby?
<bnagy>
no for your os
wallerdev has quit [Quit: wallerdev]
<morsik>
i have ruby 1.9.1 compiled by myself
specialGuest has quit [Ping timeout: 244 seconds]
kyb3r has quit []
<morsik>
bnagy: well... i think yes. i have installed native nokogiri
<bnagy>
well I'd just work on getting capybara-webkit installed by itself
<bnagy>
it will definitely need qt libs
<morsik>
i installed qt-devel (centos 6.3)
<bnagy>
HAHAHAH CENTOS
<morsik>
but it doesn't try to run some configure or anything like that...
Kabaka has quit [Quit: Tinkering with my kernel. Be back soon (hopefully).]
SeySayux has joined #ruby
specialGuest has joined #ruby
jwbuurlage has left #ruby [#ruby]
krz has quit [Quit: krz]
torarne1 has joined #ruby
Kabaka has joined #ruby
Kabaka has quit [Excess Flood]
Banistergalaxy has quit [Ping timeout: 246 seconds]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
Kabaka has joined #ruby
dhruvasagar has joined #ruby
wez has joined #ruby
iori has quit [Remote host closed the connection]
torarne1 has quit [Quit: Leaving.]
mneorr has quit [Quit: Leaving.]
cascalheira has joined #ruby
slainer68 has joined #ruby
<slainer68>
hi
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
morsik has left #ruby [#ruby]
x0F_ is now known as x0F
Xeago has joined #ruby
<slainer68>
i've got 2 arrays : a & b. how can i test if array b is equal or is at least a subarray of array a (== test if array b is equal to array a or contains at least all the elements of array a). thanks.
<Xeago>
slainer68: look at methods provided in Array and enumerable
<slainer68>
Xeago: yes i've just looked at the rdoc.
burgestrand has joined #ruby
<Xeago>
if nothing's there, b.all { |element| a.contains element } however that performs horrible
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
sepp2k has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
awarner has quit [Remote host closed the connection]
<GeekOnCoffee>
JonnieCache: why the hate?
gfontenot has joined #ruby
Guest47318 has joined #ruby
pu22l3r has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<JonnieCache>
it does crazy stuff and is too complicated
* Guest47318
Hello Everybody
johnlcox has joined #ruby
<banisterfiend>
JonnieCache: you're moving away from ruby?
<banisterfiend>
or rails at least? :)
m4rtijn has quit [Quit: Verlassend]
<JonnieCache>
nope
bradhe has joined #ruby
<JonnieCache>
the new place uses sequel and redis
<JonnieCache>
and mostly sinatra, although some rails
<banisterfiend>
k00
BrokenCog has quit [Quit: leaving]
BrokenCog has joined #ruby
CarlB_the_great has joined #ruby
Guest47318 is now known as The_Game
<JonnieCache>
activerecord makes me feel like some sort of noobish phpmonkey having used it for so long - im looking forward to working more directly with the database
frogprince_mac has quit [Quit: Leaving...]
philcrissman has quit [Remote host closed the connection]
bradhe has quit [Ping timeout: 240 seconds]
philcrissman has joined #ruby
clj_newb has joined #ruby
fbernier has quit [Ping timeout: 245 seconds]
CarlB_the_great has quit [Ping timeout: 246 seconds]
Virunga has quit [Remote host closed the connection]
The_Game has quit []
Danielpk has joined #ruby
CarlB_the_great has joined #ruby
nari has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
kvirani has quit [Remote host closed the connection]
sailias has joined #ruby
verto|off is now known as verto
Banistergalaxy has quit [Ping timeout: 272 seconds]
ph^_ has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
jonathanwallace has quit [Ping timeout: 276 seconds]
sagax has quit [Quit: Ухожу я от вас]
datsik33 has joined #ruby
internet_user has joined #ruby
thaz has quit [Quit: thaz]
cakehero has joined #ruby
takamichi has quit [Ping timeout: 244 seconds]
pu22l3r has quit [Remote host closed the connection]
jrajav has quit [Quit: The best darkness is strange and surprising]
<trooney>
Noob question: With DataMapper/Sinatra, how can I make my Model.get() return a namespaced Json object? like, { Model: { foo: bar } } instead of just { foo: bar } ?
mercwith1mouth has quit [Ping timeout: 268 seconds]
rhodee has joined #ruby
<rhodee>
under what conditions should self be a method argument?
bbttxu has joined #ruby
fyolnish has joined #ruby
ph^ has joined #ruby
<banisterfiend>
rhodee: never, ruby has an implicit self
h4mz1d has joined #ruby
rcloak has quit [Quit: rcloak]
awarner has joined #ruby
chrismcg is now known as zz_chrismcg
Criztian has joined #ruby
jimeh has joined #ruby
bradhe has joined #ruby
mmitchel_ has joined #ruby
CodeFriar has joined #ruby
<rhodee>
banisterfiend: which I gathered from the David Black's book however in other texts I've seen this approach and was confused -- def publish blog.add_entry(self) end
verto is now known as verto|off
<banisterfiend>
rhodee: nothing unusual about that, self is an object, and can be passed around to other objects that act on it, just as any other object
fearoffish has joined #ruby
<banisterfiend>
rhodee: there's no way to know whether to pass self other than 'does it make sense to pass self here?' :)
jjbohn is now known as jjbohn|afk
statarb3 has joined #ruby
<rhodee>
banisterfiend: why not just say def publish blog.add_entry(post) end?
<banisterfiend>
wait
rjsamson has joined #ruby
yasushi has joined #ruby
mmitchell has quit [Ping timeout: 245 seconds]
Paradox has joined #ruby
<banisterfiend>
rhodee: what is 'post' there? it's not possible to know what you're talking about without more context. But clearly 'self' there is a kind of post
<banisterfiend>
so passing it in to add_entry() makes sense
qwerxy has quit [Quit: offski]
<banisterfiend>
rhodee: are you new to programming in general out of interest?
wmoxam has joined #ruby
bradhe has quit [Ping timeout: 276 seconds]
<rking>
Hey guys — does anyone know what the bad algorithms are called where they're like a highway painter who painted his first mile in 1 day, his second in 2 days, his third in 4 days, etc., and when asked why he told his boss, "Simple. I had to keep walking further and further back to the paint can."
kalleth has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
IrishGringo has quit [Quit: ChatZilla 0.9.88.2 [Firefox 15.0/20120824154833]]
<rhodee>
Xeago: I understand that bit, where I am getting confused is self is typically a receiver of messages but I've seen it used as an argument (see pastie). Just wanting to know why not simply map blog.add_entry(post) vs. the blog.add_entry(self)
CodeFriar has joined #ruby
<Xeago>
because post is not a variable in your context
<Mon_Ouie>
Or a method
<banisterfiend>
rhodee: self is just an object, as an object it ca be passed around
dmiller has joined #ruby
maxmmurphy has joined #ruby
<Xeago>
'post' does not exist within your scope in publish
takamichi has quit [Ping timeout: 264 seconds]
<rking>
Xeago: Something seems off. It's probably my Big O understanding, but it seems like it's closer to exponential.
<rhodee>
so because add_entry is a method from Blog the method add_entry is effectively grabbing a post obj from the correct domain (e.g. Post)
takamichi has joined #ruby
<banisterfiend>
Xeago: you dont know that actually, it could be a method
<Mon_Ouie>
According to his pastie it isn't
dhruvasagar has quit [Ping timeout: 246 seconds]
heda has joined #ruby
spanner has quit [Ping timeout: 246 seconds]
Paradox has quit [Quit: derpderp]
<banisterfiend>
ah you're right
<rking>
He can paint a 50m line in no time, refilling his brush 10 times but only walking a negligible extra distance. But the same 50m put 1km down the road is going to take him a very, very long time, because he has to walk 10k extra.
g_rotbart has quit [Read error: Connection reset by peer]
<rhodee>
so banister fiend: I know it seems simple self is just an object and in all other contexts its very clear
Paradox has joined #ruby
<heda>
hi all, is there a way to stop a struct from being enumerable? i.e its members being considered independent parts of the set? like if i have an array of structs I want to iterate over the discrete structs not each ones independent members?
apok has joined #ruby
<Xeago>
rking: what are you getting to?
g_rotbart has joined #ruby
<rhodee>
but in the case of say method existing in the same domain but using self as an arg what benefit would there be to pointing to self as an arg
<rking>
Xeago: Overall or with my question in reply to your O(2n)?
<rhodee>
..say *a...
arturaz has quit [Read error: Operation timed out]
fbernier_ has quit [Read error: Connection reset by peer]
<banisterfiend>
rhodee: you're as confused as an octopus in a garage
<JonnieCache>
rhodee: sometimes you just want to pass the current object to another method. youre right in thinking that it can sometimes be an indicator of strange code or bad design
mc0e1 has joined #ruby
<banisterfiend>
:P
<JonnieCache>
but its a perfectly legit thing to do
<rhodee>
well that settles it.
<rhodee>
danke to all.
<Xeago>
if the method you're calling exists in the scope of self, there is no point in passing self
<rhodee>
that is what I always understood
<rking>
Xeago: I would assume that the "n" is the distance of road covered, and I thought things like "number of trips back to the bucket per mile" were washed out in Big O notation as constants that don't affect the fundamental shape of the graph.
<rhodee>
I was looking at this code for the first time in OO on Rails and was confused
snearch has quit [Quit: Verlassend]
<rking>
Xeago: But overall I was only trying to remember the name, "Schlemiel the Painter's algorithm", so I'm already happy.
<JonnieCache>
rhodee: theres MUCH weirder shit than that in rails. if you want to do rails youre gonna have to get used to it :)
mc0e has quit [Ping timeout: 264 seconds]
<rhodee>
JonnieCache: :(
<JonnieCache>
dont worry about it, its a learning experience
<rhodee>
Seriously thanks for all the responses.
mengu has quit [Quit: Konversation terminated!]
<banisterfiend>
rhodee: there's nothing actually weird in passing 'self', dont think that the code is weird (it's not) :)
<JonnieCache>
no it isnt. maybe ive given the wrong impression
elux has joined #ruby
<JonnieCache>
i just meant that it can SOMETIMES be an INDICATOR of weirdness, it isnt weird in itself
<rking>
Whatever you do, do *not* base your definition of weird on that of banisterfiend.
<banisterfiend>
yeah, i have a feeling he's dealt with his confusion by just htinking 'oh that's weird code, i dont have to worry about it'
<rhodee>
Its not intimidating or anything I really enjoy ruby and i was doing some exploring, figured I ask
<Xeago>
rhodee do you understand why we pass self, and not post?
arkiver has quit [Quit: Leaving]
robustus has joined #ruby
<rhodee>
banisterfiend: lots of assuming going on
larissa has joined #ruby
KevinSjoberg has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<rhodee>
Xeago: yes in this case I do
<Xeago>
is there a case where you wouldn't?
<rhodee>
it actually fits well with the David Black book
Nisstyre_ has quit [Remote host closed the connection]
<Xeago>
wait, what why?
<Xeago>
why would you eval it?
<adamos>
How do i put the mysql result into an array? When I am trying to create an array with the result from a mysql select statement i get this: can't convert Mysql::Result into Array (TypeError)
<rking>
Xeago: It's a pretty odd line, IMO. But it puts that var in the caller's scope.
<GeekOnCoffee>
adamos: why are you trying to put it in an array
<rking>
I don't get why you'd do something so roundabout for such an inconveniently long name.
<rking>
A normal person would pass a var to "yield"
Takehiro has joined #ruby
<Xeago>
why not eval only the right part?
<adamos>
i am writing something that pulls the sha1 sums from mysql and compares it with the local server. I want to compare two arrays basically
<rking>
Xeago: Because then the caller's local vars are left unchanged.
<JonnieCache>
rking: aaaargh. that link.
<rking>
Hehe, I know!
berserkr has joined #ruby
<adamos>
the central server puts the sah1 sums into mysql and i want to compare against it
ckrailo has joined #ruby
<rking>
JonnieCache: What's funny about it is that this was part of an interview process. Like, "Here's my Github ID."
<JonnieCache>
were you looking to contract "svitla systems" or something
jasonkuhrt has quit [Quit: Leaving...]
<rking>
JonnieCache: I also ♡ the part at the top that completely arbitrarily starts talking about :corporate_data.
<Xeago>
but if dialog_builder is not accessible outside of eval
<Xeago>
then what is the point of evaling?
mercwith1mouth has joined #ruby
<banisterfiend>
Xeago: it's defined in the caller scope
wahly has left #ruby [#ruby]
<JonnieCache>
rking: its the most mundane shit ever as well: a helper for doing modal dialogs
ph^ has quit [Remote host closed the connection]
<Xeago>
banisterfiend: still have no clue what it does
<JonnieCache>
how could someone who knows about ObjectSpace end up with that as a solution to html building?
<banisterfiend>
he's essentially changing the value of a variable in the caller, it's like a cute version of binding_of_caller
<rking>
JonnieCache: Yeah. I sent out a listing for a Rails position and this was one of the people that contacted me.
rakuN has joined #ruby
<rking>
JonnieCache: LOL! I know!!
<rking>
JonnieCache: Thank you for making me feel sane. Banister's "k00" reaction to this code made me doubt myself severely.
<banisterfiend>
like i said, i wasn't evaluating it in terms of code structure or design
<rking>
banisterfiend: Hehe
<Xeago>
so eval can replace a variable regardless of scope?
clj_newb has quit [Ping timeout: 240 seconds]
<banisterfiend>
i was looking at the issue he was solving, injecting a local object into a scope, and i thought his technique was pretty original
<GeekOnCoffee>
adamos: you could do something like results = []; resultset.each{|r| results << r}
<JonnieCache>
also wtf is "extend self" doing there
ananthakumaran has joined #ruby
maesbn has quit [Remote host closed the connection]
<banisterfiend>
teh altnerative to that is to use globals or thread locals
baroquebobcat has quit [Quit: baroquebobcat]
spopescu has joined #ruby
sailias has quit [Read error: Connection reset by peer]
sailias1 has joined #ruby
<JonnieCache>
seriously though someone please explain `extend self` to me
<banisterfiend>
JonnieCache: extend self is like module_function
<Xeago>
puts methods from module on Object?
<rking>
JonnieCache: It's an alternative to singleton's. I had to look it up as well. 1min.
<banisterfiend>
JonnieCache: it amkes the methods avaiable as instance methods and class methods
h4mz1d has quit [Ping timeout: 246 seconds]
<JonnieCache>
lol amazing
MasterIdler has joined #ruby
<JonnieCache>
thats actually quite neat to be fair, although it does make a mess
bbttxu has quit [Quit: bbttxu]
<banisterfiend>
it's a fairly common pattern
<banisterfiend>
i've seen it in a lot of code bases
<JonnieCache>
yeah so basically in conclusion there is literally no reason to do `extend self` when you can just wrap it in class << self; end or define every method on self. correct?
baroquebobcat has joined #ruby
<JonnieCache>
and therefore avoid creating two versions of every method
<JonnieCache>
yeah and it annoys me every time i see it
<JonnieCache>
i guess its useful for scripting
<banisterfiend>
JonnieCache: Pry helpers work in a similar way
<JonnieCache>
a stylistic thing i suppose
ph^ has joined #ruby
chimay has quit [Quit: WeeChat 0.3.9-rc1]
<banisterfiend>
inside command context you can just go helper1()
samflores has joined #ruby
<banisterfiend>
outside command context you have to go Pry::Helpers.helper1()
<banisterfiend>
or whatever
samflores has left #ruby [#ruby]
jjbohn has quit [Quit: Leaving...]
<JonnieCache>
ah right that makes sense
larissa has quit [Quit: Leaving]
alvaro_o has joined #ruby
jonathanwallace has quit [Ping timeout: 252 seconds]
jsmonkey has quit [Quit: Lost terminal]
<JonnieCache>
but the main thing is that my understanding of that other stuff was correct. i was feeling my confidence as a ruby programmer draining away for a minute there!
<banisterfiend>
hehe
<JonnieCache>
>> puts "bot still there?"
<al2o3cr>
(NilClass) nil, Console: bot still there?
<JonnieCache>
maybe it didnt like `end end` without a ;
<Xeago>
or in what essence is it different than kill
<Muz>
It fires up a browser, takes you to a search engine and enters your query.
<Xeago>
a niftier form of kill?
blazes816 has joined #ruby
bradhe has joined #ruby
DrShoggoth has joined #ruby
<Hanmac>
Xeago it kills the parent process
mneorr has quit [Quit: Leaving.]
yasushi has joined #ruby
otters has quit [Read error: Connection reset by peer]
* Muz
shakes his head.
otters has joined #ruby
ph^ has quit [Read error: No route to host]
ph^ has joined #ruby
Emmanuel_Chanel has joined #ruby
bradhe has quit [Ping timeout: 276 seconds]
<shevy>
Xeago, via "pkill gdm" you can kill running gdm for example
Eplemosen has joined #ruby
horofox has quit [Quit: horofox]
Synthead has joined #ruby
jonathanwallace has joined #ruby
hoelzro|away is now known as hoelzro
h4mz1d has joined #ruby
SirRamonGabriel has quit [Remote host closed the connection]
nim_ has joined #ruby
eldariof has quit [Read error: Operation timed out]
haxrbyte has joined #ruby
Takehiro has quit [Remote host closed the connection]
h4mz1d has quit [Ping timeout: 276 seconds]
ctp has joined #ruby
Takehiro has joined #ruby
manouche has joined #ruby
lampe2 has quit [Ping timeout: 246 seconds]
maxmmurphy has joined #ruby
Takehiro has quit [Remote host closed the connection]
sailias1 has joined #ruby
robotmay has quit [Remote host closed the connection]
Takehiro has joined #ruby
sailias1 has left #ruby [#ruby]
sailias has quit [Ping timeout: 268 seconds]
krawchyk has joined #ruby
saschagehlich has joined #ruby
dmiller has quit [Remote host closed the connection]
beneggett has joined #ruby
haxrbyte_ has joined #ruby
ephemerian has quit [Quit: Leaving.]
vitor-br has quit [Ping timeout: 276 seconds]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
<Xeago>
anyone with knowledge about duff's device?
timonv has quit [Ping timeout: 246 seconds]
kjellski has quit [Ping timeout: 260 seconds]
Know1edge has joined #ruby
haxrbyte has quit [Ping timeout: 255 seconds]
jonathanwallace has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
luxurymode has joined #ruby
pu22l3r has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
spanner has joined #ruby
qwerxy has quit [Quit: offski]
sonkei has quit [Quit: Computer has gone to sleep.]
machty has joined #ruby
torarne1 has joined #ruby
timonv has joined #ruby
maletor has joined #ruby
SphericalCow has quit [Remote host closed the connection]
SphericalCow has joined #ruby
hoelzro is now known as hoelzro|away
jshsu has joined #ruby
jso has joined #ruby
jshsu has left #ruby [#ruby]
jonathanwallace has quit [Ping timeout: 276 seconds]
pricees has joined #ruby
qwerxy has joined #ruby
spanner has quit [Ping timeout: 246 seconds]
mmitchel_ has quit [Remote host closed the connection]
johnjohnson has quit [Ping timeout: 252 seconds]
nim__ has joined #ruby
resure has joined #ruby
<Sou|cutter>
is `` just an alias for system() ?
<rking>
Sou|cutter: Nope.
johnjohnson has joined #ruby
<rking>
It's Kernel#`, and it acts rather dif'runtly. (It captures the output as an expression, and handles errors dif'runtly.)
<rking>
And it always does evil shell interpolation, which if you don't know about ShellWords escaping you should probably not use except in the dirtiest of situations.
wallerdev has joined #ruby
<rking>
(system will also, if you give it a single string arg. Compare system "echo foo > /dev/null" vs system %w(echo foo > /dev/null) )
<Xeago>
I rather like duff's device..
bradhe has joined #ruby
nim_ has quit [Ping timeout: 252 seconds]
wuzzzzaah has quit [Quit: wuzzzzaah]
<Sou|cutter>
rking: thanks
verto|off is now known as verto
GMFlash has joined #ruby
pdtpatrick has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
lolmaus has quit []
mrsolo has joined #ruby
josh^ has quit [Ping timeout: 244 seconds]
lolapaloza has joined #ruby
spanner has joined #ruby
s1n4 has joined #ruby
jgrevich has joined #ruby
<lolapaloza>
hello #ruby, whats mean the symbol ||= ??
<Xeago>
if the left side evals to false, assign right
<lolapaloza>
thanks Xeago!.
<rking>
Xeago: A key bit, "However, the standard C library provides the function memcpy for this purpose; it will not perform worse than this code, and may contain architecture specific optimizations that will make it significantly faster."
<Xeago>
>> var = nil; var ||="set"
<al2o3cr>
(String) "set"
sailias has joined #ruby
savage- has joined #ruby
adeponte has joined #ruby
<JonnieCache>
>> var = 1; var ||="set"; puts var
<al2o3cr>
(NilClass) nil, Console: 1
<rking>
lolapaloza: I wish there was a "syntax Google" that wouldn't mush out what punctuation you enter in.
chrishunt has joined #ruby
artOfWar has joined #ruby
smellynoser has quit [Quit: This computer has gone to sleep]
<Xeago>
memory copy is not available when writing to hardware
<JonnieCache>
rking: expand the thing on the left and click "verbatim"
flayer has quit [Read error: Connection reset by peer]
flayer has joined #ruby
<rking>
JonnieCache: What thing on the left?
yshh has quit [Remote host closed the connection]
<JonnieCache>
"show search tools"
<rking>
Oh, gotcha.
<rking>
Yeah, DDG wins on this one.
areil has quit [Ping timeout: 240 seconds]
<JonnieCache>
tbh it doesnt really keep the punctuation but it stops a lot of the google guesswork
<JonnieCache>
ddg is best for searching for code i agree
davidcelis has joined #ruby
<rking>
JonnieCache: Every year I have to put more and more things in quotes or prefix with +'s in Google.
flayer has quit [Read error: Connection reset by peer]
<JonnieCache>
thats what verbatim was created to address
flayer has joined #ruby
johnjohnson has quit [Ping timeout: 260 seconds]
burgestrand has joined #ruby
<Xeago>
ddg is cool ;O
flayer has quit [Read error: Connection reset by peer]
<rcassidy>
does verbatim handle punctuation well?
flayer has joined #ruby
<JonnieCache>
no it still ignores a lot of it
artOfWar_ has joined #ruby
Bosma has quit [Ping timeout: 268 seconds]
<JonnieCache>
i think google dont index the punctuation for performance reasons
ph^ has quit [Remote host closed the connection]
zemanel has quit [Quit: Remote hottie closed the connection]
johnjohnson has joined #ruby
Eplemosen has quit [Quit: NOPE]
<rking>
I can't blame them for dropping it, it's the easy thing to do.
<JonnieCache>
especially with the instant search thing
<rking>
But it'd be nice if there was a search engine that was like, "We split on \s. Nothing else."
yasushi has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
apok has quit [Ping timeout: 264 seconds]
mercwith1mouth has quit [Ping timeout: 268 seconds]
horofox has joined #ruby
<rking>
There used to be a Google Source search thing that was close, but they killed it because they have some dragon that requires them to kill X number of projects per year or else he rampages. Apparently.
khakimov has joined #ruby
velikasha1 has joined #ruby
<juha_>
how do i get current date -1 day or +1 day?
carloslopes has quit [Quit: Leaving.]
artOfWar has quit [Ping timeout: 252 seconds]
rhodee has quit [Quit: rhodee]
davidcelis has quit [Quit: K-Lined.]
stopbit has quit [Read error: Connection reset by peer]
<rking>
juha_: Date manipulation is always gross.
<Xeago>
juha_ with active support: 1.day.ago
<rking>
But yeah, I was definitely going to recommend ActiveSupport's date stuff.
<JonnieCache>
that is the best thing about activesupport hands down
stopbit has joined #ruby
jonathanwallace has joined #ruby
* Xeago
feels like toast
<JonnieCache>
if you only need to do it once id look up the api rather than import activesupport though
<Xeago>
as with every library import^^
<JonnieCache>
except crypto
<Xeago>
why?
<JonnieCache>
NEVER WRITE YOUR OWN CRYPTO OR AUTHENTICATION CODE
<Xeago>
copy?
<JonnieCache>
you are not a cryptographer. you will get it wrong.
<Xeago>
I actually studied cryptonalysis
<Xeago>
if I spell that correctly
<blazes816>
hahaha, burn
davidcelis has joined #ruby
<Xeago>
however, I don't aught myself capable of making an algo
Vert has quit [Read error: Connection reset by peer]
davidcelis has quit [Read error: Connection reset by peer]
<JonnieCache>
we've all studied it. doesnt mean we should be doing it in the wild
davidcelis has joined #ruby
<Xeago>
I know lots and tons of software engineers that have not studied it xD
<Xeago>
it's a worthy course to take
<Xeago>
second course, I'd recommend is optimizing it
Danielpk has joined #ruby
<JonnieCache>
oh i agree, study it, but dont impose your homegrown crypto on other people. its morally wrong.
geggam has joined #ruby
spanner has quit [Ping timeout: 245 seconds]
<Danielpk>
i trying to install rconv but i get this error: ERROR: Failed to build gem native extension.
<Danielpk>
any1 know how i can fix it?
ringotwo has joined #ruby
<JonnieCache>
thats like giving people rides in your car with homemade safety features. even if youre a good mechanic, youre not qualified to design airbags etc
<JonnieCache>
(obv not a perfect analogy, you know what i mean)
rcloak has joined #ruby
NiteRain has joined #ruby
mohits has quit [Quit: Leaving]
iamjarvo has quit [Ping timeout: 244 seconds]
<Xeago>
anyone has some good reads for me
<Xeago>
got a long ride home
<Xeago>
and need material to get me through
carrythezero has quit [Quit: Lost terminal]
Xeago_ has joined #ruby
frogprince_mac has joined #ruby
<Synthead>
is there a .find that returns all matches (instead of the first one)?
xorigin has quit [Quit: leaving]
Xeago_ has quit [Remote host closed the connection]
<cjz>
good morning, I was playing around last night with RestClient and I was curious about conventions… when you install the gem, its 'gem install rest-client' with a dash, but when you use the "library?" you do require 'rest_client' with an underscore, is that following some kind of ruby/rails/gem convention?
jgrevich_ has joined #ruby
baphled has quit [Remote host closed the connection]
alvaro_o has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
chussenot has joined #ruby
matti has joined #ruby
elaptics is now known as elaptics`away
spanner has joined #ruby
jgrevich has quit [Ping timeout: 244 seconds]
jgrevich_ is now known as jgrevich
havenn has joined #ruby
ph^ has joined #ruby
havenn has quit [Remote host closed the connection]
c0rn_ has joined #ruby
Pleiadian has joined #ruby
<davidcelis>
cjz: Gems can have hyphens or underscores, it doesn't really matter. that's up to the author
<davidcelis>
cjz: But class names and module names are underscored for require statements. i.e. to require the module RestClient, you do `require 'rest_client'`
macmartine has quit [Quit: Computer has gone to sleep.]
<workmad3>
davidcelis: you can require a hypenated file too
<davidcelis>
wat
<davidcelis>
oh you're right it's just the file name
<davidcelis>
ugh
<davidcelis>
disregard me
voodoofish430 has joined #ruby
<workmad3>
cjz: most gems try to keep gemname and the lib to require in-sync
<workmad3>
cjz: some older gems haven't done so
velikasha1 has left #ruby [#ruby]
<workmad3>
cjz: some go through silly lengths to provide for all forms (active-support was one I believe, where iirc it used to support 'require "activesupport"' 'require "active-support" ' and 'require "active_support" '
jimeh has quit [Quit: bye]
Takehiro has quit [Remote host closed the connection]
<workmad3>
cjz: a fairly common convention (especially in rails, which bases autoloading on it) is the ClassName to class_name conversion though
c0rn_ has quit [Client Quit]
carloslopes has joined #ruby
mneorr has joined #ruby
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
kidoz has joined #ruby
<cjz>
ok interesting
wallerdev has joined #ruby
sagax has joined #ruby
BSaboia__ has joined #ruby
adamkittelson has joined #ruby
havenn has joined #ruby
bradhe has joined #ruby
nim__ has quit [Ping timeout: 255 seconds]
c0rn_ has joined #ruby
Moggle has quit [Ping timeout: 240 seconds]
havenn has quit [Remote host closed the connection]
BSaboia has quit [Ping timeout: 246 seconds]
seanyo has joined #ruby
havenn has joined #ruby
pu22l3r has joined #ruby
bradhe has quit [Ping timeout: 276 seconds]
chussenot has quit [Ping timeout: 246 seconds]
BiHi has quit [Quit: Computer has gone to sleep]
nwest has joined #ruby
datapolitical has joined #ruby
<datapolitical>
anyone alive in here?
<workmad3>
braaaaains
stephenjudkins has joined #ruby
jromine has joined #ruby
Rochefort has quit [Remote host closed the connection]
r0bby has quit [Ping timeout: 240 seconds]
<datapolitical>
i'm running into a path error when trying to execute a gem
<datapolitical>
on Mac OS X
<workmad3>
braaaaaaaains
kn330 has joined #ruby
mmitchell has quit [Remote host closed the connection]
eldariof has quit [Ping timeout: 240 seconds]
<reactormonk>
heeeeaaaaaaaaaadddds
nilg` has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
mmitchell has joined #ruby
nim__ has joined #ruby
kn330 has quit [Ping timeout: 246 seconds]
spanner has quit [Ping timeout: 245 seconds]
evilsushi has joined #ruby
evilsushi has joined #ruby
evilsushi has quit [Changing host]
nilg has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 248 seconds]
ada2358 has joined #ruby
<burgestrand>
datapolitical: you need to be a lot more specific than that
timonv has joined #ruby
shadoi has joined #ruby
Moggle has joined #ruby
workmad3 has quit [Read error: Operation timed out]
datapolitical has quit [Quit: This computer has gone to sleep]
Goles has joined #ruby
Axsuul has joined #ruby
Spooner_ has quit [Ping timeout: 246 seconds]
seanyo has quit [Ping timeout: 246 seconds]
hukl has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
rakunHo has joined #ruby
joofsh has joined #ruby
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
diegoviola has quit [Ping timeout: 252 seconds]
evilsushi has quit [Quit: leaving]
havenn has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
evilsushi has joined #ruby
evilsushi has quit [Changing host]
evilsushi has joined #ruby
<joofsh>
Hi, noobie question. I'm trying to use String.insert and to_s at the same time.
ph^ has quit [Read error: Connection reset by peer]
Moggle has quit [Ping timeout: 264 seconds]
<shevy>
you modify the string object via .insert
ph^ has joined #ruby
<shevy>
if you have a variable, and want to build it up slowly, for some reason, step by step
<shevy>
you could do:
<shevy>
x = "foo"
<shevy>
x.insert 5,'lo'
<shevy>
x.insert -5,'ack '
<shevy>
x << 'yippie ey yoh'
<shevy>
new_var = "hi#{x}"
reset has joined #ruby
reset has quit [Read error: Connection reset by peer]
araujo has quit [Ping timeout: 272 seconds]
<joofsh>
I see, Okay thank you shevy
nilg` has quit [Ping timeout: 276 seconds]
love_color_text has joined #ruby
<shevy>
you can use [] too rather than insert btw
<shevy>
x = 'foo'
<shevy>
x[0,0] = 'this will be appended '
<joofsh>
oh wow, good to know
mercwithamouth has joined #ruby
<shevy>
x # => "this will be appended foo"
reset has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
bigdc1 has joined #ruby
<joofsh>
thank you! :)
<burgestrand>
>> x = 'foo'; x[0,0] = 'hi! '; x
<al2o3cr>
(String) "hi! foo"
<love_color_text>
Hi, I'm trying to use Dir.mkdir "my_folder", 0777 to create a world writeable directory -- but i get ALMOST there: drwxrwx--x... not sure what to do
<shevy>
I like it more for some reason. works on Array too. though .insert works on Array as well, I guess it may come down to personal preferences
fermion has quit [Quit: P]
<shevy>
love_color_text tried fileutils?
<love_color_text>
nope
<burgestrand>
love_color_text: what is the value of File::umask?
<burgestrand>
>> File::umask
<al2o3cr>
(Fixnum) 18
<love_color_text>
6
reset has quit [Client Quit]
<shevy>
hmm
<burgestrand>
love_color_text: that’s why then, it will apply to your permissions and change them
iamjarvo has joined #ruby
<love_color_text>
hm, strange. is there a simple way to create chmod 777 directoriess?
johnjohnson has quit []
<love_color_text>
other than doing `chmod 777 #{dir}` after :P
<burgestrand>
love_color_text: set the umask before, and set it back after ^^
beneggett has quit [Quit: Computer has gone to sleep.]
<love_color_text>
I didn't know it was settable. pass 18 into File::umask, do the mkdir, then make it 6 again?
<burgestrand>
Something like that. Did not try it.
krz has joined #ruby
nim__ has quit [Ping timeout: 240 seconds]
<love_color_text>
burgestrand: a noble attempt, but it didnt work
<love_color_text>
burgestrand: sorry, it DID work
* burgestrand
shrugs
<love_color_text>
thank you!
<love_color_text>
i passed it 777 instead of 0777, which is why i spoke to soon
<love_color_text>
thank you
spanner has joined #ruby
* burgestrand
bows
maletor has quit [Quit: Computer has gone to sleep.]
<burgestrand>
love_color_text: would probably make something like this if you plan on creating files and such, too: http://pastie.org/4669478
<love_color_text>
i will need to study up about umask, i didn't realize there is this constant just set like this -- thanks for leading me to the knowledge
billyoc has quit [Remote host closed the connection]
<burgestrand>
love_color_text: you can just type umask in your terminal, it exists there too
araujo has joined #ruby
sterex_ has joined #ruby
sterex has quit [Read error: Connection reset by peer]
sterex_ is now known as sterex
GMFlash has quit [Quit: Computer has gone to sleep.]
psycho_one has joined #ruby
mikepack has quit [Remote host closed the connection]
<love_color_text>
burgestrand: yeah that is nicer, since i can pass files or folders or anything in the umask(0) context via a block. good stuff thank you
* love_color_text
just learned more :P
jrist is now known as jrist-afk
spanner has quit [Ping timeout: 246 seconds]
w400z has joined #ruby
headius has joined #ruby
mikepack has joined #ruby
maletor has joined #ruby
Takehiro has joined #ruby
joofsh has quit [Ping timeout: 245 seconds]
Paradox has joined #ruby
wpaulson has joined #ruby
havenn has joined #ruby
v0n has joined #ruby
<trooney>
What's the file you can drop to describe what gems your app needs to function?
<davidcelis>
the... Gemfile...?
<trooney>
davidcelis: ah, cool. that's easy. sorry, been using ruby for like.. 8 hours :P
<rking>
Or s/refer to/be referenced by/. Or maybe it's some kind of advanced mutual reference.
<Hugo-Boss>
hi am very new here
wpaulson_ has quit [Client Quit]
spinagon has joined #ruby
hipertracker has joined #ruby
<rking>
Hugo-Boss: Just ask.
mercwithamouth has quit [Ping timeout: 240 seconds]
<Hugo-Boss>
plz tell me how can i start learning ruby easily
<trooney>
rking: yes. is there something more... low level than this? -- asking in case if there is something i should familiarize myself with before using bundler.
<rking>
Hugo-Boss: Sure. Tell us your background so we can start you at the right level.
wpaulson has quit [Ping timeout: 240 seconds]
<Hugo-Boss>
i know php but i am interested in ruby but dunno why i want to switch to ruby :)
<rking>
trooney: Well, there's "gem" itself. Whatever you install with it will be available to "require".
<trooney>
rking: yep. similar to RPMs or PEAR or what not. just wondering if bundler is to apt as gem is to rpm or if bundler is to aptitude and i'm missing something :)
bradhe has joined #ruby
<Hugo-Boss>
rking: one more thing is ruby is easy than php ?
xyon has quit [Quit: WeeChat 0.3.8]
<blazes816>
Hugo-Boss: yes
<Hanmac>
Hugo-Boss: we feel sorry for you that you know php :(
<blazes816>
better answer
<trooney>
Hugo-Boss: Me too. There's like... a ton of good stuff on learning ruby. Grab "The Ruby Programming Language" it's pretty good.
wpaulson has joined #ruby
xyon has joined #ruby
<Hugo-Boss>
i see
<blazes816>
Hugo-Boss: you'll soon never need to google something like "str_replace" because you don't remember the order of arguments
<rking>
trooney: I wouldn't give it an exact equivalence to anything else I've seen exactly. The thing about Bundler is that it's strict. If you don't have a gem in the Gemfile, it will not exist as far as programs run under "bundle exec" are concerned.
fsdfds has quit [Ping timeout: 272 seconds]
<rking>
This strictness is good, meaning you don't have to wonder if you're accidentally depending on something.
<skyjumper>
i'm using 1.9.3p194 and am getting a different result for the 4th line
<skyjumper>
('test' and nil) == nil
havenn has joined #ruby
<skyjumper>
but in the example it's supposed to be 'test'
<skyjumper>
is the example wrong?
manizzle has joined #ruby
<Hanmac>
skyjumber: no you didnt understand it... try to print out both after each line
bricker88 has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
<skyjumper>
ah, duh. the assignment has precedence
<bricker88>
What is the difference between yield &block, or yield some_method, and block.call?
manizzle has quit [Remote host closed the connection]
<Hanmac>
>> a = 'test'; b = nil; both = a && b; p "first both #{both.inspect}"; both = a and b; p "second both #{both.inspect}";nil
<al2o3cr>
(NilClass) nil, Console: "first both nil", "second both \"test\""
manizzle has joined #ruby
<davidcelis>
bricker88: i believe that the first and third are just syntactically different
<invisime>
is there a way to tell rdoc not to document a method that matches a particular pattern? I'm making a gem with a c extension and I don't want it to document all of the extension methods.
banisterfiend has quit [Remote host closed the connection]
<Hanmac>
bricker88 (yield object) does not create a proc object when using an block
banisterfiend has joined #ruby
<bricker88>
Hanmac: I see, that makes sense. Thanks
<bricker88>
thanks davidcelis
<Hanmac>
invisime: what kind of extension? do you write it yourself or do you use some kind of swig?
Guest29448 is now known as fred
stephenjudkins has quit [Quit: stephenjudkins]
fred has quit [Changing host]
fred has joined #ruby
<invisime>
Hanmac: rolling it myself. all of the extension methods are public class methods on a particular singleton class and all of their names match /\Ac_/
c0rn_ has joined #ruby
<Hanmac>
... hm why do you do that? i mean why do they need to be public? you could use some kind of "syntax" sugar
timonv has quit [Remote host closed the connection]
nim_ has joined #ruby
c0rn_ has quit [Client Quit]
<invisime>
Hanmac: they're public because they have to be. as far as I can tell, there's no way to make a private singleton method from within c.
bradhe has joined #ruby
banisterfiend has quit [Ping timeout: 244 seconds]
bbttxu has joined #ruby
ckrailo has quit [Quit: Leaving...]
ckrailo has joined #ruby
<Hanmac>
invisime i mean why need the method accessable from ruby? why not make it hidden inside your stuff?
eignerchris has joined #ruby
<invisime>
Hanmac: because a bunch of the functionality of the rest of the gem uses it. they're basically internal class stuff for a communication API. the private methods are things like "open_communication, close_communication, send_raw" and then the ruby methods are the actual API that I want to expose.
mmitchell has quit [Remote host closed the connection]
<Hanmac>
hm i still dont see a reason for that ... i think it works without ...
mikepack has quit [Remote host closed the connection]
<invisime>
Hanmac: yes, that's correct. I also want to hide the analog of your format, compression, etc.
axl__ has joined #ruby
<invisime>
really, I don't care that they're exposed, I just don't want them in my documentation.
sonkei has joined #ruby
deryl has quit [Quit: deryl]
<Hanmac>
i would do: rb_define_singleton_method( ... ); //:nodoc:
<Hanmac>
that protects rdoc from parsing the method imo ...
<Hanmac>
but i dont like accessable but undocumented methods ... its shitty like swig generated methods or ruby-gnome2
axl_ has quit [Ping timeout: 268 seconds]
axl__ is now known as axl_
<invisime>
they're not *really* accessible. since the API is designed to be called via IPC and the transfer format uses a :send but filters out things that aren't on the whitelist.
<invisime>
Hanmac: adding //:nodo: to the end of the line with the definte_method isn't working. :-/
mneorr has left #ruby [#ruby]
axl_ has quit [Remote host closed the connection]
axl_ has joined #ruby
gdawg has joined #ruby
krawchyk has quit [Remote host closed the connection]
gdawg has quit [Client Quit]
cj3kim has quit [Quit: This computer has gone to sleep]
mikepack has joined #ruby
Bosma has quit [Quit: leaving]
atmosx has joined #ruby
spanner has joined #ruby
mmitchell has joined #ruby
w400z has quit []
joofsh has joined #ruby
<trooney>
Should I be using rSpec with Sinatra or is there something better?
<invisime>
trooney: <3 rspec with sinatra.
<blazes816>
trooney: better is subjective. e.g. I hate rspec and love minitest
Juul has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<atmosx>
Any RoR dev interested in working in Germany? There's a company looking for RoR devs in GE apparently, if anyone is interested msg me
<GeekOnCoffee>
atmosx: I'd try #rubyonrails
<invisime>
Hanmac: apparently, rdoc can't find // comments, only /* */ comments. and it only looks just above the definitions of the c methods. adding /* :nodoc: */ above each of them.
nanderoo has left #ruby [#ruby]
fermion has joined #ruby
<atmosx>
I'm not working for them, just sent me an email because they saw a ruby+sqlite twitter dumper I wrote on github, and a fail2ban script
<atmosx>
so I don't care really.
<GeekOnCoffee>
ahh
Maniacal has joined #ruby
insulator has joined #ruby
<Hanmac>
invisime you are right ... i normaly use the backwards way ... i need to make methods visible when there are no one :P
<burgestrand>
invisime: just call private on the singleton class like you would in ruby with rb_funcall. Or, if you want to, call private in ruby code after loading your extension.
<burgestrand>
Won’t help with rdoc but it makes them private at least.
fantazo has quit [Remote host closed the connection]
cableray has joined #ruby
jrist-afk is now known as jrist
jchauncey has quit [Quit: jchauncey]
rjsamson has joined #ruby
mmitchel_ has joined #ruby
jlogsdon has joined #ruby
<invisime>
burgestrand: I don't actually want them private, I just want them not documented. since I'm filtering the commands I'll pass to #send via a whitelist, they're already inaccessible. I just definitely don't want them cluttering up my documentation. thanks though! :-)
wmoxam has quit [Ping timeout: 244 seconds]
Goles has quit [Ping timeout: 244 seconds]
rjsamson has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 260 seconds]
bradhe has quit [Remote host closed the connection]
andrewpthorp has joined #ruby
headius has joined #ruby
<Hanmac>
i use rb_define_attr inside a #if 0 block :P
elux has joined #ruby
iocor has joined #ruby
verto is now known as verto|off
<iocor>
are there any types for which object.is_a? NilClass wil evaluate to false?
luxurymode has joined #ruby
<Hanmac>
>> true.is_a? NilClass
<al2o3cr>
(FalseClass) false
<burgestrand>
iocor: all for which object does not have NilClass as superclass
<davidcelis>
>> Object.new.is_a? NilClass
<al2o3cr>
(FalseClass) false
<Hanmac>
iocor ... use .nil? for the nil checking ... its a bit faster
hipertracker has quit [Quit: hipertracker]
snearch has joined #ruby
gen0cide_ has joined #ruby
c0rn_ has joined #ruby
horofox has joined #ruby
<trooney>
blazes816: why do you prefer minitest over rspec? just style?
<blazes816>
trooney: yeah. minitest is like a small comfy tool store, and rspec is like megalo-mart presents disney world
Rochefort has joined #ruby
horofox_ has joined #ruby
<davidcelis>
rspec is bloat
<davidcelis>
you won't use most of it; if you like the semantics of specification testing, MiniTest::Spec is nice
br4ndon has joined #ruby
horofox has quit [Ping timeout: 246 seconds]
<Muz>
You can of course install parts of rspec and include just those.
c0rn_ has quit [Quit: Computer has gone to sleep.]
<Muz>
gem install rspec-expectations; require 'rspec/expectations' # I commonly use just that from rspec in various cucumber suites.
maletor has joined #ruby
<davidcelis>
ew cucumber :(
<Muz>
Meh, $work foams at the mouth over it.
GMFlash has quit [Quit: Computer has gone to sleep.]
c0rn_ has joined #ruby
jjbohn has joined #ruby
<lectrick>
OK so I have written a bunch of potentially useful code at this point and it's time to push some gems out to the community. I have never gemmed out my code so this is exciting. I am planning on watching http://asciicasts.com/episodes/245-new-gem-with-bundler to get this up on github (I knew of Jeweler but I didn't realize bundler also had a way to generate gemspecs). Anyone know any caveats to thi
<lectrick>
s process?
geggam has quit [Read error: Connection reset by peer]
<davidcelis>
don't fuck up
answer_42 has quit [Quit: WeeChat 0.3.8]
<davidcelis>
don't .gitignore the .gemspec file because that's super lame and i hate everyone who does that
arkiver has joined #ruby
bradhe has joined #ruby
<burgestrand>
lectrick: it’s not too bad. Install gemcutter if you ever need to yank a version from rubygems. Also quick-read this in case you are unsure about something: http://guides.rubygems.org/
<burgestrand>
I use the same process for my gems. I’d however advise you against adding bundler as a development dependency, and making sure the Rakefile can be run without bundler installed :)
jjbohn has quit [Client Quit]
Hugo-Boss has left #ruby [#ruby]
havenn has quit [Remote host closed the connection]
machty has quit [Read error: Connection reset by peer]
machty_ is now known as machty
sambio_ has joined #ruby
sambio_ has quit [Client Quit]
<burgestrand>
Same with anything that is not essential for development. Your contributors don’t need rake tasks for releasing your gem.
havenn has joined #ruby
al-ol has joined #ruby
<trooney>
blazes816: davidcelis: cool. thanks for the advice
<lectrick>
burgestrand: ok that's another thing- should I set up a different gemset with RVM for each gem separately to manage all its dependencies completely separately, or is a Gemfile an OK addition? (Or are you saying a Gemfile is a Bundler dependency?)
geekbri has quit [Remote host closed the connection]
<lectrick>
The problem is I'm currently working on projects on multiple Rails versions and Bundler makes it easy for me to do that with only one gemset
<shevy>
ahhhhhh the neverending joy of bundler...
<lectrick>
Is it wrong that I don't use Rake to run tests and I write tests that are runnable (ideally) by passing the path to the test directly to the Ruby executable? :)
<asshopo>
stupid question that's driving me insane.. I need a simple function or a 1 liner to give me the offset between 2 timezones, taking DST into account.. everything Im trying for 'America/Central' is returning -6 instead of -5.
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
<invisime>
asshopo: central *is* UTC -6 right now.
<blazes816>
asshopo: CST != CDT
<blazes816>
also, that
<invisime>
err, standard.
<invisime>
right now it's -5.
<asshopo>
exactly my point.. its 5 hours behind right now, not 6
br4ndon has quit [Read error: Connection reset by peer]
stephenjudkins_ has joined #ruby
br4ndon has joined #ruby
Guest5516 has quit [Ping timeout: 252 seconds]
samflores has joined #ruby
<asshopo>
heh, thats what I figured
lolapaloza has quit [Quit: Lost terminal]
<asshopo>
something so simple, someones have to had this issue before
samflores has left #ruby [#ruby]
cj3kim has quit [Quit: This computer has gone to sleep]
<blazes816>
asshopo: are you trying to use tzinfo? that's all i've ever used for ruby time stuff
<asshopo>
TZInfo doesnt seem to give you an offset in general (I might have missed something)
<asshopo>
Ive also tried ActiveSupport::TimeZone, which almost does what I need
<asshopo>
except it doesnt include DST
zeromodulus has joined #ruby
<asshopo>
blazes816: not that you'd know (based on you saying you've only used TZInfo), but I currently have: ActiveSupport::TimeZone.seconds_to_utc_offset(ActiveSupport::TimeZone.new("America/Chicago").utc_offset)
<asshopo>
that returns -6, not -5
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
mmitchel_ has quit [Remote host closed the connection]
Targen has joined #ruby
Guedes is now known as Guedes_out
r0bby has joined #ruby
m_3 has quit [Quit: leaving]
elico has joined #ruby
ringotwo has joined #ruby
mmitchell has joined #ruby
<blazes816>
asshopo: sorry, can't figure it out. try #rubyonrails, they probably know a lot more about AS than anyone here
<asshopo>
blazes816: I figured it out.. puts DateTime.now().in_time_zone('Central Time (US & Canada)').strftime("%z")
<asshopo>
thats using rubys build in DateTime, thats close enough to what I need
<asshopo>
thanks for trying tho
<blazes816>
ah, nice
horofox_ is now known as horofox
ttilley has quit [Quit: ttilley]
stephenjudkins_ has quit [Quit: stephenjudkins_]
jenrzzz has joined #ruby
erichmenge has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
yxhuvud has quit [Ping timeout: 240 seconds]
Chryson has joined #ruby
stephenjudkins has joined #ruby
brett has joined #ruby
jbw has quit [Ping timeout: 246 seconds]
m_3 has joined #ruby
r0bby has quit [Ping timeout: 246 seconds]
bbttxu has quit [Read error: Connection reset by peer]
bbttxu_ has joined #ruby
kvirani has quit [Remote host closed the connection]
iamjarvo has quit [Ping timeout: 246 seconds]
sailias has quit [Quit: Leaving.]
hipertracker has joined #ruby
dmiller has quit [Remote host closed the connection]
mark_locklear has quit [Remote host closed the connection]
recycle has quit [Remote host closed the connection]
m_3 has quit [Quit: leaving]
atmosx has joined #ruby
bwlang has joined #ruby
SCommette has quit [Quit: SCommette]
pu22l3r has quit [Ping timeout: 272 seconds]
banseljaj is now known as imami|afk
rcassidy has quit [Quit: leaving]
SCommette has joined #ruby
m_3 has joined #ruby
statarb3 has joined #ruby
atmosx has quit [Client Quit]
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
timonv has quit [Remote host closed the connection]
Targen has quit [Ping timeout: 252 seconds]
frogprince has quit [Quit: Leaving...]
Asher has joined #ruby
Targen has joined #ruby
iamjarvo has joined #ruby
br4ndon has quit [Read error: Connection reset by peer]
br4ndon has joined #ruby
alec has joined #ruby
recycle has joined #ruby
verto|off is now known as verto
workmad3 has joined #ruby
sambio has joined #ruby
auntieNeo has joined #ruby
joofsh has joined #ruby
sonkei has joined #ruby
Maniacal has quit [Ping timeout: 264 seconds]
deadSnowman has joined #ruby
elaptics`away is now known as elaptics
clj_newb has quit [Ping timeout: 248 seconds]
alec is now known as alec-c4
minijupe has quit [Quit: minijupe]
vlad_starkov has quit [Remote host closed the connection]
geggam has joined #ruby
recycle has quit [Ping timeout: 248 seconds]
Criztian has joined #ruby
Spooner has joined #ruby
elux has quit [Quit: Leaving...]
<trooney>
Using Sinatra+DataMapper+MiniTest -- How can I mock the Model.find() objects within my routes? I don't quite see how to pass either a mock object in the test
cj3kim has quit [Quit: This computer has gone to sleep]
adamkitt_ has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
adamkittelson has quit [Read error: Connection reset by peer]
internet_user has quit [Remote host closed the connection]
alec-c4 has left #ruby [#ruby]
Danielpk_ has joined #ruby
chrishunt has quit [Quit: Leaving...]
Danielpk has quit [Ping timeout: 246 seconds]
Danielpk_ is now known as Danielpk
verto is now known as verto|off
ephemerian has joined #ruby
sailias has quit [Quit: Leaving.]
luxurymode has quit [Quit: Computer has gone to sleep.]
jenrzzz has quit [Ping timeout: 255 seconds]
Maniacal has joined #ruby
wmoxam has joined #ruby
maletor has joined #ruby
hukl has quit [Quit: Leaving...]
bradhe has quit [Remote host closed the connection]
doomMonkey has quit [Quit: Leaving]
Morkel has quit [Quit: Morkel]
eroc has quit [Quit: eroc]
doomMonkey has joined #ruby
deryl has joined #ruby
Maniacal has quit [Ping timeout: 276 seconds]
havenn has quit [Remote host closed the connection]
deryl has quit [Client Quit]
Jay_Levitt has quit [Ping timeout: 265 seconds]
bbttxu has quit [Quit: bbttxu]
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
jenrzzz has joined #ruby
insulator has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
<joofsh>
var = File.new("filename","w") works no problem, and creates a new file in the current directory. But how can I create a file in a subdirectory. I keep getting errors with var =File.new("/subdir1/subdir2/filename","w")
fantazo has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
<blazes816>
joofsh: you need to create the directories first
<shevy>
joofsh what is the error
<canton7>
obvious question: did you mean to put that leading slash on?
GoGoGarrett has quit [Remote host closed the connection]
<joofsh>
blaze816: already did create the directories
<shevy>
what is the error
<joofsh>
canton7: not necessarily? I was trying all the variants I could think of
<blazes816>
canton7, good call my man
<blazes816>
joofsh: the leading slash tells it to start at the root of your file system
<canton7>
leading slash means relative to the root of the filesystem
<kenneth>
i get a SyntaxError: (eval):4: multiple assignment in conditional
<shevy>
canton7 aaah joofsh just confused me :P
<joofsh>
haha, not trying to be confusing ! :(
v0n has quit [Ping timeout: 246 seconds]
<canton7>
joofsh, where, exactly, do you want to write the file?
machty has quit [Ping timeout: 245 seconds]
<shevy>
kenneth an eval??
<blazes816>
joofsh: but looking above you probably just want output = File.new(filename,"w")
piotr__ has joined #ruby
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
<joofsh>
blaze816: It will work that way, but then it creates 20 files in my main directory, its really messy
<blazes816>
?
<Hanmac>
joofsh read about File.open , File.new is maybe not soo good
<canton7>
joofsh, the filename variable is "output/thanks_<stuff>/html"
<shevy>
kenneth well perhaps ruby doesnt like that construct you try to use :D
machty has joined #ruby
alanp_ has joined #ruby
<canton7>
joofsh, thus, the files will go in output/
statarb3 has quit [Quit: Leaving]
<joofsh>
hanmac: okay i'll look into FIle.open
<Hanmac>
joofsh and change "letter = File.open("form_letter.html", "r").read" to "letter = File.read("form_letter.html", "r")" ...
<Hanmac>
using open without an block and without close is a very bad idea
bradhe has joined #ruby
invisime has quit [Quit: Leaving.]
<joofsh>
hanmac, doesn't the "r" already make it readable only? file.read with "r' seems redundant?
fbernier has quit [Ping timeout: 246 seconds]
<Hanmac>
you are right
jenrzzz has quit [Ping timeout: 244 seconds]
alanp has quit [Ping timeout: 252 seconds]
DrShoggoth has quit [Quit: Leaving]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<joofsh>
but yea. you're right i should be using File.read
snearch has quit [Quit: Verlassend]
theRoUS has quit [Ping timeout: 260 seconds]
carrythezero has quit [Ping timeout: 255 seconds]
<joofsh>
canton7: I want to write it to the subdirectory "output" with the filename "thanks_<variable>"
fbernier has joined #ruby
<joofsh>
No such file or directory - output/thanks_Nguyen_Allison.html (Errno::ENOENT)
dagnachewa has joined #ruby
<joofsh>
but I already do have a directory output. Just not the file yet, hence I wanted to create it
<canton7>
joofsh, then changing line 106 to 'File.new(filename, "w")' should work fine
<canton7>
make sure the 'output' folder exists first
<fowl>
"w+"
<canton7>
File.mkdir('output')
carrythezero has joined #ruby
<Hanmac>
like that File.write(filename,output)
recycle has joined #ruby
<joofsh>
oh, hmm
e is now known as root
<fowl>
ah w+ is r/w i thoguht it was read/create but w does that
<canton7>
yeah
<Hanmac>
canton7 not tell him that he should use File.new(filename, "w"), in 99,99% there are better ways
hukl has joined #ruby
<joofsh>
hmm
<canton7>
joofsh, next point: use File.new(filename, "w"){ |f| f.write(custom_letter) } also
<canton7>
oops. File.open not File.new
<joofsh>
File.mkdir('output') gives me an error. says mkdir method does not exist for File?
<joofsh>
canton7, good call, that's much cleaner. Hadn't gotten there yet
<canton7>
so File.open(filename, "w"){ |f| f.write(custom_letter }
<canton7>
that takes care of closing the file
hukl has quit [Client Quit]
<canton7>
and I'm an idiot. it's Dir.mkdir
minijupe has joined #ruby
<Hanmac>
canton7 yes you are :P
* canton7
bows his head. been too long since I did file manipulation in ruby
<canton7>
in general, using File.new is bad, and using File.open without a block is bad
<joofsh>
lol, sorry this is so irregular to do file manipulation in ruby
minijupe has quit [Client Quit]
<Hanmac>
"File.write(filename,custom_letter)" is the same as "File.open(filename, "w"){ |f| f.write(custom_letter) }"
<canton7>
nah it's perfectly fine and natural
<fowl>
joofsh: actually it isnt, its like every other language, open a file, read/write to it, close it
<canton7>
Hanmac, aha good call thanks. joofsh ^^
<joofsh>
will File.write() also create the file like open will?
<Hanmac>
but unlike other languages ruby can close the files for you automaticly if you use the right methods /arguments
<Hanmac>
joofsh yeah
<Hanmac>
fowl: no w+ is not like r/w ... w+ means that its running in "add"-mode
<fowl>
Hanmac: no it doesnt :)
sonkei has quit [Quit: Computer has gone to sleep.]
<canton7>
w is overwrite iirc. a is append
<joofsh>
Okay cool, File.write(filename, custom_letter) works really smoothly. But I still can only get it to write to the main directory. if I set Dir.mkdir('output') it gives me `mkdir': File exists - output (Errno::EEXIST)
<blazes816>
Hanmac: you're thinking of 'a'
<fowl>
Hanmac: w and w+ will always truncate the file
<canton7>
joofsh, replace line 105 with filename = File.join('output', "thanks_#{line[:last_name]}_#{line[:first_name]}.html")
dmiller has quit [Remote host closed the connection]
igotnolegs has joined #ruby
justinmcp has joined #ruby
dagnachewa has quit [Quit: Leaving]
cj3kim has quit [Quit: This computer has gone to sleep]
ellsworth has joined #ruby
<Hanmac>
joofsh use FileUtils.mkdir_p for dir creation ... its safe
bwlang has left #ruby [#ruby]
<joofsh>
canton7, that's essentially the same as writing it manually, no? Either way still errors
<joofsh>
hanmac, okay i'll try that
philcrissman_ has joined #ruby
<canton7>
hrm, it makes sure the directory separator is the same, though it shouldn't matter much.
<canton7>
I though the problem was with it not writing files in the output/ directory?
Marwan_ has joined #ruby
joshman_ has quit [Ping timeout: 264 seconds]
philcrissman_ has quit [Remote host closed the connection]
Guedes has joined #ruby
<joofsh>
correct. it's something about the Dir.mkdir or something not worrking. Hanmac: i'll try FileUtils
<canton7>
well the Dir.mkdir is failing because the output/ folder already exists
<fowl>
Marwan_: the error is a missing libcurl you need to install curl for windows
<Marwan_>
fowl: ok how i do that
Takehiro has joined #ruby
<fowl>
Marwan_: google
<canton7>
fowl, yeah, shocker. that loop goes round 20 times, and each time tries to create the directory. so it succeeds the first time, and fails the second
<Marwan_>
fowl: ok thanks man
stopbit has quit [Quit: Leaving]
<canton7>
put either Dir.mkdir('output') unless Dir.directory?('output') OR FileUtils.mkdir_p('output') above the loop
hersoy has quit [Ping timeout: 240 seconds]
<canton7>
so, on line 100 or so
yasushi has joined #ruby
<joofsh>
oh god lol
<joofsh>
so obvious
<blazes816>
or do both!
ellsworth has quit [Remote host closed the connection]
recycle has quit [Read error: Connection reset by peer]
robustus has quit [Ping timeout: 244 seconds]
mneorr has quit [Quit: Leaving.]
<joofsh>
canton7: works perfectly now. Duh, can't have the mkdir inside a loop lol. Thank you so much
<canton7>
cool!
<canton7>
and it's outputting to the right directory?
Takehiro has quit [Ping timeout: 240 seconds]
<joofsh>
yep, it puts all the files in /output
<canton7>
sweet
vlad_starkov has joined #ruby
bier has quit [Ping timeout: 252 seconds]
yasushi has quit [Ping timeout: 276 seconds]
hersoy has joined #ruby
<keyvan>
attention contractors, i am looking to bring on 2-3 ruby developers with BDD experience (or if you want me to teach you) to help with this rails app. if interested please PM me
stepnem has quit [Ping timeout: 252 seconds]
the_jeebster1 has quit [Quit: Leaving.]
vlad_starkov has quit [Ping timeout: 240 seconds]
GMFlash has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
levieraf has quit [Quit: Saliendo]
<rking>
keyvan: Pretty generous.
<keyvan>
rking: i didnt say how much i can afford to pay, what do you mean?
<Hanmac>
keyvan you should try it in #rubyonrails
<keyvan>
yep i did thanks Hanmac
<keyvan>
accidently did it in #ruby actually, didn't mean to
<rking>
keyvan: Actually, I care more about the open-mindedness that would understand that a decent developer could learn something new on the job over plain old open-walletedness.
* Hanmac
dont even know that BDD means
<fowl>
i could use the money but i never used rails :<
<keyvan>
Hanmac: BDD refers to acceptance tests written in cucumber, basically a high level way of testing user experience via "Scenarios" that describe your "Features"
<davidcelis>
Hanmac: actually we hate recruiters going in there
<davidcelis>
please don't send them to #rubyonrails. thanks
<keyvan>
i'm not a recruiter, im a ruby developer.
<davidcelis>
what i mean is
<keyvan>
big difference i think lol
mneorr has joined #ruby
<davidcelis>
people don'tw ant to be recruited there
<fowl>
davidcelis: you should know by now we send things that we hate to #rubyonrails
<davidcelis>
it's a help channel, not for job acquisition
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
mneorr has left #ruby [#ruby]
recycle has joined #ruby
<keyvan>
if it makes you feel any better, nobody PM'd me :P
<Hanmac>
we need some kind of #ruby-job channel :P
<keyvan>
worked pretty well a couple years back
recycle has quit [Read error: Connection reset by peer]
<trooney>
oh damn insuffurable people wanting to hire me all the time!
<trooney>
Can't a man walk down the street without being offered a job?
<keyvan>
sorry :(
MasterIdler has quit [Ping timeout: 264 seconds]
baphled has quit [Ping timeout: 246 seconds]
Targen has quit [Ping timeout: 244 seconds]
* Hanmac
is searching for a job, but he dont want to use rails
pdtpatrick has joined #ruby
naz has joined #ruby
<fowl>
^
bier has joined #ruby
Marwan_ has quit [Quit: Page closed]
<trooney>
Oops. Sorry. *takes foot out of mouth*
shadoi has quit [Quit: Leaving.]
<keyvan>
fowl: what about RubyMotion :)
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
<fowl>
keyvan: this might be shocking but not everybody uses or likes macs
SCommette has quit [Quit: SCommette]
<keyvan>
not shocking, my Dad is insistent on using Windows all the time... every time i go visit he asks me for a recommendation for a new comp.. i've stopped bothering to say "get a mac"
<blazes816>
shift-option-cmd-lol
Tachyon has joined #ruby
<keyvan>
he loves to start conversations with me about Windows 8 and whatever else MS is doing...
<trooney>
$ usually throws people off. plus their 15+ years of experience.
johnlcox has quit [Ping timeout: 276 seconds]
<trooney>
windows 8 is actually pretty slick, imo
<blazes816>
and should be shot
<blazes816>
aw, you said 'slick'
<blazes816>
now i just sound crazy
<trooney>
s/l//g
bigdc1 has quit []
<Hanmac>
windows8 does notify microsoft about all Programs you download from the internet (per default)
samflores has joined #ruby
samflores has quit [Client Quit]
GMFlash has joined #ruby
<trooney>
does that really matter? everything you do on every device is tracked in some way.
Rochefort has quit [Remote host closed the connection]
eric has joined #ruby
shadoi has joined #ruby
mmitchell has joined #ruby
eric is now known as Guest71629
recycle has joined #ruby
mneorr has joined #ruby
Guest71629 is now known as fumduq
flagg0204 has quit [Quit: leaving]
<Hanmac>
trooney imo it shouldnt be allowed
sneakyness_wk has quit [Quit: YOU MUST BACON HARDER]
mneorr has quit [Client Quit]
deryl has joined #ruby
futini has joined #ruby
<Tachyon>
I need to make new Hash that has the operators [] and []= redefined. How do i do that ?
mmitchell has quit [Ping timeout: 276 seconds]
CarlB_the_great has joined #ruby
datsik33 has quit [Quit: This computer has gone to sleep]
mrsolo has quit [Quit: Leaving]
<fowl>
>> h = {}; def h.[]=(key, value) puts "haha #{key} is not being set to #{value} bcuz im leet" end; h[5] =43; h
bradhe has quit [Read error: Connection reset by peer]
<al2o3cr>
(Hash) {}, Console: haha 5 is not being set to 43 bcuz im leet
stkowski has quit [Quit: stkowski]
bradhe has joined #ruby
qwerxy has joined #ruby
kvirani has joined #ruby
<Tachyon>
fowl: thx!
kalleth has joined #ruby
specialGuest has quit [Ping timeout: 246 seconds]
juarlex has quit [Ping timeout: 246 seconds]
<deryl>
Got news today. Because my adoption was done in Canada, not the US, the USA won't accept the adoption. As a result, all my github repos have been moved from github.com/deryldoucette to under github.com/davidderyldowney [This info is for those following any of my repos]
jlogsdon has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
mmitchell has joined #ruby
CarlB_the_great has quit [Remote host closed the connection]
punkrawkR has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<trooney>
deryl: You moved GitHubrepos because of adoption records? Crazy.
dhruvasagar has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 268 seconds]
CarlB_th_ has joined #ruby
<deryl>
trooney: No it was done due to the repos were under my legal name (well legal for canada) since i'm back in the states and so some orgs can't say I'm attempting to hide behind a moniker I changed it to what the US considers my legal name.
<deryl>
long story
<davidcelis>
wtf is wrong with your name
CarlB_th_ has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 276 seconds]
<trooney>
davidcelis: i bet jack bauer had him on his list
<blazes816>
doucette isn't US friendly perhaps
torarne1 has quit [Ping timeout: 252 seconds]
<davidcelis>
that shit hasn't mattered since ellis island
evilsushi has quit [Quit: Lost terminal]
Y_Ichiro has joined #ruby
Y_Ichiro has quit [Changing host]
Y_Ichiro has joined #ruby
kaushik_ has joined #ruby
<trooney>
Hmm. My Sinatra app isn't matching routes when running under MiniTest, but works fine in brwoser...
piotr__ has quit [Ping timeout: 246 seconds]
torarne1 has joined #ruby
Nisstyre_ has joined #ruby
cjz has quit [Quit: Leaving.]
ttilley has joined #ruby
fbernier has quit [Ping timeout: 245 seconds]
lkba has joined #ruby
Targen has joined #ruby
emmanuelux has quit [Remote host closed the connection]
fbernier has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
Bosma has joined #ruby
bsilvereagle has joined #ruby
<bsilvereagle>
I'm sitting in an intro ruby talk right now, and don't want to interupt the presenter. If I know python, does ruby have an distinct advantages?
ezra has quit [Ping timeout: 276 seconds]
brett has left #ruby [#ruby]
recycle has quit [Read error: Connection reset by peer]
<canton7>
ruby has blocks
<canton7>
and a different approach to stick stuff in the global namespace
<canton7>
and no explicit 'self' :P
emmanuelux has joined #ruby
<bsilvereagle>
no explicit self is a feature?!
<bsilvereagle>
and I guess he hasn't gotten to blocks yet
beneggett has joined #ruby
<canton7>
it's a matter of opinion
<canton7>
most of the ruby/python "advantages"/"disadvantages" are though tbf
<canton7>
some people like the global namespace littered with functions; some don't
<bsilvereagle>
alright fair enough. One of his major points is RoR but Python has Django
Takehiro has joined #ruby
<canton7>
some like prefer list comprehension to #map
<canton7>
some prefer python's "one obvious way", while others prefer the expresiveness that ruby has, allowing you to make your intentions more clear in your code
horofox has quit [Quit: horofox]
jenrzzz has joined #ruby
<canton7>
but python doesn't have blocks, so that's a definitely unarguable feature for ruby :P
<blazes816>
some like having the object a method is called on an explicit argument, others know how OOP works
<bsilvereagle>
haha valid
cj3kim has quit [Quit: This computer has gone to sleep]
luckyruby has joined #ruby
deryl has quit [Ping timeout: 240 seconds]
<canton7>
the thing that annoyed me was when python complained that there's a problem with the 4th argument to a function. but ti's not the 4th, it's the 3rd/5th (can't remember) due to that damn 'self'
saschagehlich has quit [Quit: saschagehlich]
<blazes816>
yeah, not cool
headius has quit [Quit: headius]
elaptics is now known as elaptics`away
emmanuelux has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 240 seconds]
havenn has quit [Remote host closed the connection]
<bsilvereagle>
For an internship, I had to use the Blender Python API and self got me quite a bit. On that note, does a lot of stuff have Ruby API?
<canton7>
more and more stuff
cj3kim has joined #ruby
rjsamson has quit [Remote host closed the connection]
<helpa>
Hi Tachyon. We in #rubyonrails would really appreciate it if you did not use pastebin during your time with us.
<helpa>
Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
uris has quit [Quit: leaving]
codyrobbins has left #ruby [#ruby]
<Tachyon>
... I would use another pastebin, i even wanted. But since you recommend it in the topic ...
<drags>
why does the bot yell at people for using the pastebin specified in the channel topic?
emmanuelux has joined #ruby
<drags>
why does the bot yell at people for using the pastebin specified in the channel topic?
<drags>
why does the bot yell at people for using the pastebin specified in the channel topic?
<canton7>
and why is it talking about #rubyonrails
<canton7>
methinks it's listening in the wrong channel ;)
<Tachyon>
anyway... why doesn't the code work, what is the problem with the mutex ?
<Tachyon>
hm!
<Tachyon>
i'm retarder probably mmnt
<Tachyon>
retarded ...
tommyvyo has quit [Quit: Computer has gone to sleep.]
Synthead has joined #ruby
<trooney>
Anyone? Help a little noob? :P
<Tachyon>
hm no, missing thread class wasn't the problem
recycle has joined #ruby
stretchlimo has quit [Quit: ChatZilla 0.9.88.2 [Firefox 15.0/20120824154833]]
yoklov has joined #ruby
<fowl>
whos bot is that
<drags>
trooney: what's the output you're getting or not getting?
<drags>
fowl: someone trying to be helpful, clearly
<drags>
*headdesk*
<fowl>
drags: get that rails trash out of here
<drags>
not me
<fowl>
drags: our rubies are crystal clear and refract light like nothing you've seen before
<trooney>
drags: says route not matched. works fine browsing site in rack, but under test just asks me to add the route
<drags>
I'm headdesking over people joining their random unaffiliated bots
<drags>
trooney: is your rack_env set correctly? (do you have a configure :test block in your app)
<drags>
trooney: disclaimer, I'm not actually very good at this stuff, just been working on testing a sinatra app recently :)
blazes816 has quit [Quit: blazes816]
<trooney>
drags: better than me. started 5 hours ago :P i have env[rack_env] in test but not app...
blazes816 has joined #ruby
fmcgeough has joined #ruby
daniel_hinojosa1 has quit [Quit: Leaving.]
Vert has quit [Read error: Connection reset by peer]
recycle has quit [Read error: Connection reset by peer]
davidcelis has quit [Quit: K-Lined.]
codyrobbins has joined #ruby
<drags>
fowl: fyi, someone with the nick 'Radar' was irc'ing from the same linode host as the helpa bot
vladislav has joined #ruby
<codyrobbins>
Is there an easy way to create a sort of proxy object that acts like IO and has a #read method, but which I can pass a block to the way Enumerator works and have the block feed data?
ephemerian has quit [Quit: Leaving.]
joofsh has quit [Ping timeout: 245 seconds]
<codyrobbins>
I have a library that expects an IO object to stream data to a server, but I'm building the data on the fly and don't want it to touch the actual filesystem because there's a lot of it.
gfontenot has quit []
bsilvereagle has left #ruby ["WeeChat 0.3.2"]
<mc0e1>
pastebin has ads? I'd never noticed.
qwerxy has quit [Quit: offski]
<drags>
not everyone runs adblock :)
datsik33 has joined #ruby
vladislav has quit [Client Quit]
<mc0e1>
but amongst programmers? surely there's not many?
<drags>
some of my coworkers have philosophical stances against adblocking
<drags>
front end programmers also need to see ads for their work (why they can't just add exceptions for their own sites.. *le shrug*)
<mc0e1>
you can turn it off selectively for sites you work on