mistym has quit [Remote host closed the connection]
|jemc| has joined #ruby-lang
mistym has joined #ruby-lang
mister_integer has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<imperator>
evenin'
AncientAmateur has quit [Remote host closed the connection]
akerl has left #ruby-lang ["valete"]
dm78 has joined #ruby-lang
pixelhandler has quit [Quit: pixelhandler]
Cakey has quit [Ping timeout: 240 seconds]
AncientAmateur has joined #ruby-lang
lewix has joined #ruby-lang
Cakey has joined #ruby-lang
sepp2k1 has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
diegoviola has joined #ruby-lang
x0f has quit [Ping timeout: 272 seconds]
x0f has joined #ruby-lang
yfeldblum has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
MikaAK1 has joined #ruby-lang
kek has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
nathanstitt has quit [Quit: I growing sleepy]
AncientAmateur has quit [Remote host closed the connection]
nathanstitt has joined #ruby-lang
mister_integer has quit [Remote host closed the connection]
adaleigh has joined #ruby-lang
MikaAK1 has quit [Ping timeout: 245 seconds]
spajus has joined #ruby-lang
thmzlt has quit []
Cakey has quit [Ping timeout: 255 seconds]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
gix has quit [Ping timeout: 255 seconds]
yfeldblum has quit [Remote host closed the connection]
mistym has joined #ruby-lang
gix has joined #ruby-lang
dsaint-pierre has quit [Remote host closed the connection]
cnivolle has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
mistym_ has joined #ruby-lang
dgaffney has quit [Ping timeout: 240 seconds]
kek has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
dgaffney has joined #ruby-lang
tkuchiki has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
adaleigh has quit [Read error: Connection reset by peer]
alexju has joined #ruby-lang
adaleigh has joined #ruby-lang
AncientAmateur has joined #ruby-lang
karamazov has joined #ruby-lang
MikaAK has joined #ruby-lang
AncientAmateur has quit [Ping timeout: 264 seconds]
AncientA_ has joined #ruby-lang
lewix has quit [Remote host closed the connection]
lewix has joined #ruby-lang
lewix has quit [Changing host]
lewix has joined #ruby-lang
<adaleigh>
Hello Ruby friends, I have a question. I have a function that returns 1 or 0. I have instances in if statements when I am doing !function and it is always returning false. How could this be happening?
<adaleigh>
Besides the always returning 1 of course. :P I have that it is returning 0 in instances.
diegovio1 has joined #ruby-lang
diegovio1 is now known as diegovio1a
lewix has quit [Ping timeout: 240 seconds]
AncientA_ has quit [Remote host closed the connection]
dgaffney has quit [Remote host closed the connection]
<whitequark>
adaleigh: both 1 and 0 are "true" in Ruby
<whitequark>
in fact, everything except false and nil is considered truthful
<apeiros>
notice how the first one is [[, i.e. an array in an array
<apeiros>
also, don't put spaces in front of argument parenthesis. add(…), not add (…)
<apeiros>
they're not identical.
dm78 has joined #ruby-lang
<apeiros>
and another note: line 14 will fail (`calculation [:add] = true`) a) because of the space and b) because if calculation is not a Hash, you can't use []= on it.
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tbuehlmann has quit [Remote host closed the connection]
mister_integer has joined #ruby-lang
araujo has quit [Quit: Leaving]
araujo has joined #ruby-lang
shinnya has joined #ruby-lang
mister_integer has quit [Ping timeout: 244 seconds]
GBrawl has joined #ruby-lang
yfeldblu_ has quit [Ping timeout: 272 seconds]
ari-_-e has quit [Ping timeout: 264 seconds]
bantic has joined #ruby-lang
jarto has quit [Ping timeout: 245 seconds]
alexju has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
bantic has quit [Quit: bantic]
dm78 has joined #ruby-lang
pskosinski has joined #ruby-lang
kfpratt has joined #ruby-lang
ari-_-e has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
dm78 has quit [Ping timeout: 272 seconds]
MichD is now known as michd
toastynerd has joined #ruby-lang
toastynerd has quit [Ping timeout: 244 seconds]
cnivolle has quit [Remote host closed the connection]
johnny_rugger has joined #ruby-lang
relix has joined #ruby-lang
rahul_j has joined #ruby-lang
relix has quit [Read error: Connection timed out]
relix has joined #ruby-lang
t4nk136 has joined #ruby-lang
<t4nk136>
Hi I need help using VCR gem
<t4nk136>
I have 2 services A and B. When I enable VCR it'll record interactions with service A but any interactions between service A and service B VCR cannot see? Why is that?
mister_integer has joined #ruby-lang
<t4nk136>
I'm sure I've had this working before in another project
<t4nk136>
All calls are made using RestClient
<t4nk136>
and I'm telling VCR to fake with WebMock
mister_integer has quit [Read error: Connection reset by peer]
mister_integer has joined #ruby-lang
JoL1hAHN has quit [Quit: WeeChat 0.4.3]
mister_integer has quit [Ping timeout: 272 seconds]
JoL1hAHN has joined #ruby-lang
cnivolle has joined #ruby-lang
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cnivolle has quit [Client Quit]
benlovell has joined #ruby-lang
sarkyniin has quit [Ping timeout: 255 seconds]
yubrew has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
yubrew has quit [Ping timeout: 255 seconds]
t4nk136 has quit [Ping timeout: 246 seconds]
cnivolle has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 255 seconds]
benlovell has joined #ruby-lang
dm78 has joined #ruby-lang
dm78 has quit [Ping timeout: 245 seconds]
toastynerd has joined #ruby-lang
dsaint-pierre has joined #ruby-lang
toastynerd has quit [Ping timeout: 240 seconds]
relix has quit [Ping timeout: 245 seconds]
lcdhoffman has joined #ruby-lang
kalehv has joined #ruby-lang
relix has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
jhass|off is now known as jhass
jg_ has joined #ruby-lang
mister_integer has joined #ruby-lang
allomov has quit [Remote host closed the connection]
mister_integer has quit [Ping timeout: 264 seconds]
benlovell has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
stamina has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
dsaint-pierre has quit [Remote host closed the connection]
karamazov has joined #ruby-lang
nofxx has joined #ruby-lang
yfeldblum has joined #ruby-lang
lewix has joined #ruby-lang
allomov has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
vick_ has joined #ruby-lang
saarinen has joined #ruby-lang
allomov has quit [Remote host closed the connection]
dm78 has joined #ruby-lang
pskosinski_ has joined #ruby-lang
pskosinski has quit [Disconnected by services]
dm78 has quit [Ping timeout: 264 seconds]
pskosinski_ is now known as pskosinski
heftig has quit [Quit: Quitting]
toastynerd has joined #ruby-lang
spajus has quit [Quit: Leaving]
<vick_>
I just had an interesting discussion about Perl (http://www.perlmonks.org/?node_id=1090606, conserning Perl's Latin-1 encoding shenanigans) and decided that this language is hopeless and i shold abandon Perl... like many others have. So I need to learn some other language for my scripting purposes. Basically, is Ruby anything like Python in regards to Unicode, typing etc? Does it allow to mix binary and unicode strings?
allomov has joined #ruby-lang
toastynerd has quit [Ping timeout: 255 seconds]
<whitequark>
it does
<vick_>
And what encoding does it use implicitly?
<jhass>
what your system has set, the fallback is UTF-8 since 2.0, ASCII before that
<centrx>
Ruby is happy
<vick_>
It uses locale? That's not ideal.... thanks.
ari-_-e has quit [Ping timeout: 240 seconds]
nathanstitt has joined #ruby-lang
bin7me has quit [Remote host closed the connection]
djinni` has quit [Ping timeout: 240 seconds]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
zastern has quit [Ping timeout: 240 seconds]
Gate has quit [Ping timeout: 264 seconds]
benlovell has joined #ruby-lang
justinmcp has joined #ruby-lang
rahul_j has joined #ruby-lang
saarinen has quit [Read error: Connection reset by peer]
saarinen has joined #ruby-lang
benlovell has quit [Ping timeout: 240 seconds]
yubrew has joined #ruby-lang
mister_integer has joined #ruby-lang
vick_ has quit [Ping timeout: 246 seconds]
allomov has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
yubrew has quit [Ping timeout: 245 seconds]
mister_integer has quit [Ping timeout: 264 seconds]
ari-_-e has joined #ruby-lang
zastern has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
saarinen has quit [Quit: saarinen]
djinni` has joined #ruby-lang
Gate has joined #ruby-lang
Gate has joined #ruby-lang
mhabibi has joined #ruby-lang
<mhabibi>
I install 2.1.2 version of ruby with rbenv. but when I try "ruby -v" in terminal, I get this : "ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux]"
yfeldblum has joined #ruby-lang
<whitequark>
jhass: it does not use locale
<whitequark>
1.9 is ASCII, 2.0 and later use UTF-8
<whitequark>
e.g. $ LANG=ru_RU.KOI8-R ruby -e 'p __ENCODING__'
<whitequark>
#<Encoding:US-ASCII>
allomov has joined #ruby-lang
<whitequark>
actually nevermind, it does O_o. without LANG that'd be UTF-8
<whitequark>
TIL
<mhabibi>
I used rbenv local and fixed it
mhabibi has left #ruby-lang [#ruby-lang]
<whitequark>
oh, it's only for -e.
Guest73738 has quit [Read error: Connection reset by peer]
Guest73738 has joined #ruby-lang
<jhass>
that seems unlikely
<jhass>
I'm pretty sure it does for reading files
cored has quit [Ping timeout: 244 seconds]
<whitequark>
I just checked.
toastynerd has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
<jhass>
doing along for internal strings would make sense but maybe they pick up the file encoding
<whitequark>
so basically, at 2.0 with -e you get either UTF-8 or US-ASCII, in irb you get your locale, and in files you get UTF-8.
rahul_j has quit [Quit: rahul_j]
<jhass>
yep, internal strings pick up file encoding
<whitequark>
sure, that's the point of file encoding
<jhass>
so you don't automatically get UTF-8 there
<whitequark>
in files you do
<whitequark>
in -e and irb you don't
<jhass>
are you even listening to yourself? or am I just deeply misunderstanding you?
<jhass>
in -e you get the system locale because that's what ARGV is in, in irb you get that because that's what stdin is in
<whitequark>
let me rephrase. in 2.0 and newer, files are UTF-8, or whatever is specified by magic encoding comment. in pre-2.0, it's US-ASCII or whatever's in the magic encoding. locale doesn't affect encoding of sources require'd or passed as files to the `ruby' command, but it does affect encoding of strings in -e or irb
<jhass>
I guess what we're fighting over is that fallback means automatically to you, for me it doesn't
<jhass>
well, fallback/default
jg_ has quit [Ping timeout: 240 seconds]
lewix has quit [Remote host closed the connection]
stulzer has joined #ruby-lang
AKASkip has joined #ruby-lang
dm78 has joined #ruby-lang
GaelanAintAround is now known as Gaelan
dm78 has quit [Ping timeout: 255 seconds]
x0f has quit [Ping timeout: 255 seconds]
x0f has joined #ruby-lang
snoopybbt has joined #ruby-lang
mister_integer has joined #ruby-lang
saarinen has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
saarinen has quit [Client Quit]
shinnya has quit [Ping timeout: 264 seconds]
matled has joined #ruby-lang
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 240 seconds]
kek has joined #ruby-lang
allomov has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
jarto has joined #ruby-lang
<epitron>
loll, "it uses locale, ruby is not for me"
<epitron>
what a maroon
allomov has joined #ruby-lang
<whitequark>
epitron: that's not nice.
<epitron>
i know, but he left :)
<epitron>
now forever a python user
<epitron>
someone should've asked what problem he was trying to solve
allomov has quit [Ping timeout: 272 seconds]
toastynerd has joined #ruby-lang
<jhass>
I think his problem was Perl
spastorino has joined #ruby-lang
erichmenge has quit [Ping timeout: 252 seconds]
nirix has quit [Ping timeout: 240 seconds]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
<jhass>
ah well, it expects you to call Kernel#rand not Random::rand, so just strip the Random.
<roelof>
jhass : that is the only thing I m not allowed to use sample. I have to write my own sample
justinmcp has joined #ruby-lang
<roelof>
but it succeed now
<roelof>
jhass: thanks
<jhass>
now you can make that one line by writing n.times.map { array[rand(array.size)]
<jhass>
}
charliesome has joined #ruby-lang
<jhass>
might want to dig a bit into the edge cases though
<jhass>
ah, nvm
<jhass>
rand already does the -1
allomov has joined #ruby-lang
yfeldblum has joined #ruby-lang
<roelof>
jhass : I miss you on which part I have to change ?
<jhass>
the whole method is just n.times.map { arrray[rand(array.size)] }
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jarto has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<jhass>
or Array.new(n) { array[rand(array.size)] }
yfeldblum has quit [Ping timeout: 240 seconds]
x0f has quit [Ping timeout: 240 seconds]
<roelof>
jhass thanks
x0f has joined #ruby-lang
Parrot has joined #ruby-lang
<Parrot>
Hi there. anyone with sinatra experience on, who can help me out with a few questions?
<jhass>
try to find solutions, not the people that have them
<jhass>
(just ask your question, if somebody has the answer he'll respond)
<Parrot>
that sounded so zen
dc5ala has joined #ruby-lang
<Parrot>
basically I'm trying to figure out how to have multiple different forms on a page. so, a few different list to which you can add words. do you use a seperate post request for each?
allomov has quit [Remote host closed the connection]
<jhass>
if they're not related, sure
<jhass>
different <form> tags in any case
<jhass>
might hit the same route, but I'd only would do that if that route wouldn't need to differentiate between the requests
<jhass>
if you need different code to handle them, give them their own route
<jhass>
now see, that didn't even involve any sinatra knowledge
<Parrot>
a valid point. Thanks for your help! I'm sure I'll have more questions soon
roelof has quit [Quit: Page closed]
simoz111118 has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
simoz111119 has joined #ruby-lang
ritek has joined #ruby-lang
simoz111118 has quit [Ping timeout: 245 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
dm78 has joined #ruby-lang
lsegal has joined #ruby-lang
chrisseaton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dm78 has quit [Ping timeout: 240 seconds]
karamazov has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
mistym has joined #ruby-lang
yubrew has quit [Ping timeout: 244 seconds]
elia has joined #ruby-lang
Fushi has quit [Quit: Connection closed for inactivity]
elia has quit [Client Quit]
mister_integer has quit [Remote host closed the connection]
mister_integer has joined #ruby-lang
yfeldblum has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
mister_integer has quit [Ping timeout: 255 seconds]
AncientAmateur has joined #ruby-lang
yfeldblum has quit [Ping timeout: 244 seconds]
sepp2k has quit [Read error: Connection reset by peer]
ritek has quit [Changing host]
ritek has joined #ruby-lang
ritek has joined #ruby-lang
ritek has left #ruby-lang [#ruby-lang]
AncientAmateur has quit [Remote host closed the connection]
nescio has joined #ruby-lang
nescio has left #ruby-lang [#ruby-lang]
nescio has joined #ruby-lang
benlovell has joined #ruby-lang
chrisseaton has joined #ruby-lang
sarkyniin has joined #ruby-lang
mister_integer has joined #ruby-lang
mister_integer has quit [Client Quit]
simoz111119 has quit [Ping timeout: 264 seconds]
Parrot has quit [Quit: Page closed]
sarkyniin has quit [Quit: Quitte]
symm- has quit [Ping timeout: 244 seconds]
toastynerd has joined #ruby-lang
stamina has quit [Ping timeout: 240 seconds]
elliotec has joined #ruby-lang
elliotec has quit [Client Quit]
x0f has quit [Ping timeout: 244 seconds]
benlovell has quit [Read error: Connection reset by peer]
<sonvu>
class CreateProducts < ActiveRecord::Migration def change create_table :products do |t| t.string :name t.text :description t.timestamps end end end
<sonvu>
in this code what |t| is?
<jhass>
rails questions go to #rubyonrails, luckily this isn't a Rails question
<jhass>
|t| is a block parameter
<sonvu>
hi jhass
<sonvu>
we met again
<sonvu>
thanks for answer my question but #rubyonrails i see nobody in there
<sonvu>
if |t| is a block parameter so what "t" is?
<sonvu>
a object of somthing?
<jhass>
a variable
<jhass>
and all variables are references to objects in ruby
<sonvu>
ok i got it
<sonvu>
but i am a little curious what class "t" of?
benlovell has quit [Ping timeout: 240 seconds]
<jhass>
find out: p t.class
yubrew has joined #ruby-lang
djbkd has joined #ruby-lang
<sonvu>
and I just started learn Ruby and the "self" method make me confuse
<jhass>
self is not a method
<sonvu>
they said that "Ruby has no class methods, but it has singleton methods attached to a particular object."
<AncientAmateur>
I believe in the case of the create_table method the block parameter references the object representing the table being created
<jhass>
self is a keyword that refers to the object you're currently in
lolmaus has quit [Ping timeout: 240 seconds]
<jhass>
class Foo; def foo; self; end; end here self refers to an instance of Foo
sarkyniin has quit [Read error: No route to host]
sarkyniin has joined #ruby-lang
<sonvu>
when we use self?
havenwood has joined #ruby-lang
<jhass>
for example if you want to return the current object, so you can chain method calls: foo.method_of_foo.another_method_of_foo
<jhass>
another case is when accessing attribute setters within a class: self.foo = bar, simply doing foo = bar would create a local variable
dm78 has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
<jhass>
a third case is to define singleton methods inside a class definition: class Foo; def self.a_singleton_method; end; end
<jhass>
the self in the last example refers to the Class instance you're currently defining
<sonvu>
" A method given only to a single object is called a singleton method." is it right?
<jhass>
yes, though it omits why it's called a singleton method
dm78 has quit [Ping timeout: 244 seconds]
<sonvu>
thanks, It help me understand alot
<sonvu>
There are many different beetwen Java and Ruby
saarinen has quit [Quit: saarinen]
havenwood has quit [Remote host closed the connection]