hellangel7 has quit [Read error: Connection reset by peer]
solo_ has joined #ruby
magic is now known as Guest20981
Guest20981 is now known as magic
<rubie>
centrix: what are classic algorithm problems/.
<gorelative>
question: i have a string ... str = '2.4.0' i need to grab the first two "versions" and drop the last
<rubie>
like project euler?
magic has quit [Changing host]
magic has joined #ruby
fsapo has quit [Remote host closed the connection]
<gorelative>
str.split('.') and then recombine them back in so ... 2.4.0 becomes 2.4
jyuan has quit [Read error: Connection reset by peer]
<rubie>
centrx: thanks for that rosetta page!
<Wolland>
split('.')[0..1].join('.')
geggam has joined #ruby
<gorelative>
holy balls thats slick
Zesty has quit [Quit: Leaving...]
<centrx>
rubie, yes project euler has a lot of those, it seems to have more mathematical ones as opposed to computer science ones but nevertheless interesting and relevant, and computer science really is mathematics.
nettoweb has quit [Client Quit]
Xuerian has quit [Read error: Connection reset by peer]
<centrx>
rubie, Data structures like a hash table, Search algorithms like Binary search, Sort algorithms like Quicksort
<solo_>
Looking to create a cli app in ruby..haven't done any ruby and a quick google search lead me to thor, commander, or slop..does anyone have any recommendations on which to use?
postmodern has quit [Quit: Leaving]
<centrx>
rubie, You'll notice Ruby has a native Hash data table, which is implemented using a hash table. Hash tables are used everywhere in computers
<centrx>
rubie, *Hash data type
<centrx>
rubie, And the Ruby native Array#sort uses QuickSort, because it is a fast all-purpose algorithm
<rubie>
cool i'll look into those
<centrx>
binary trees
alexherbo2 has quit [Ping timeout: 250 seconds]
klmlfl has joined #ruby
cndiv has joined #ruby
kireevco has quit [Quit: Leaving.]
dkam has joined #ruby
cirn0 has joined #ruby
Sharker has quit [Ping timeout: 264 seconds]
Sharker has joined #ruby
jasonzzz_ has joined #ruby
jasonzzz_ has left #ruby [#ruby]
mary5030 has joined #ruby
lampd1 has joined #ruby
mattstratton has quit [Read error: Connection reset by peer]
mattstratton has joined #ruby
tkuchiki has joined #ruby
klmlfl has quit [Ping timeout: 272 seconds]
mattstratton has quit [Max SendQ exceeded]
ursooperduper has joined #ruby
mattstratton has joined #ruby
brandonshowers has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
cirn0 has quit [Ping timeout: 258 seconds]
c107 has joined #ruby
deject3d has joined #ruby
jonr22 has joined #ruby
mary5030 has quit [Ping timeout: 258 seconds]
TorpedoSkyline has joined #ruby
bruno- has joined #ruby
kireevco has joined #ruby
jhass is now known as jhass|off
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
lkba has joined #ruby
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kenneth has joined #ruby
modernbob has joined #ruby
manacit has joined #ruby
alexherbo2 has joined #ruby
daynaskully has quit [Quit: quit]
jhass|off is now known as jhass
digifiv5e has joined #ruby
digifiv5e has quit [Changing host]
digifiv5e has joined #ruby
manacit has quit [Changing host]
manacit has joined #ruby
bruno- has quit [Ping timeout: 258 seconds]
<benzrf>
solo_: i like thor
<solo_>
benzrf: Just installed it.
digifiv5e is now known as daynaskully
jhass is now known as jhass|off
<solo_>
benzrf: I think it will get the job done for now. Now I just need to figure out how to set this project up hah :x
geggam has quit [Ping timeout: 246 seconds]
thams has joined #ruby
IcyDragon has joined #ruby
moritzschaefer has joined #ruby
hmsimha_ has joined #ruby
IceDragon has quit [Ping timeout: 272 seconds]
moritzs has quit [Ping timeout: 250 seconds]
axsuul has joined #ruby
omosoj_ has joined #ruby
thams has quit [Quit: thams]
bricker`work has quit [Ping timeout: 260 seconds]
j_mcnally has joined #ruby
kireevco has quit [Quit: Leaving.]
wjimenez5271 has quit [Remote host closed the connection]
wjimenez5271 has joined #ruby
AtumT has quit [Quit: AtumT]
nettoweb has joined #ruby
charliesome has joined #ruby
nettoweb has quit [Max SendQ exceeded]
niklasb has quit [Ping timeout: 245 seconds]
Sawbones has quit [Remote host closed the connection]
nettoweb has joined #ruby
IcyDragon has quit [Ping timeout: 245 seconds]
skolman_ has joined #ruby
IcyDragon has joined #ruby
Wolland_ has joined #ruby
wjimenez5271 has quit [Read error: Connection reset by peer]
wjimenez5271 has joined #ruby
Channel6 has joined #ruby
Juanchito has quit [Quit: Connection closed for inactivity]
Wolland_ has quit [Remote host closed the connection]
narcan has joined #ruby
Wolland has quit [Ping timeout: 240 seconds]
<omosoj_>
what's the difference between a model generator and a migration generator? the model generator creates a corresponding model file as well?
boombadaroomba has joined #ruby
<sevenseacat>
one creates a model, one creates a migration.
jbueza has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<stormbytes>
question about structuring an app: lets say I need 2 similar objects --- like a "magazine" and a "book". They share some variables/methods and not others. Whats the best way to structure that in code?
tolo123 has quit [Read error: No route to host]
<stormbytes>
different classes? mixins? super/child?
jalcine has quit [Quit: Quit]
krisquigley has quit [Remote host closed the connection]
postmodern has joined #ruby
felixjet has joined #ruby
<sevenseacat>
well different classes for sure
krisquigley has joined #ruby
<shevy>
class Penis
<stormbytes>
so like.. superclass "Publication" with child classes "book" and "magazine" ?
awc737 has joined #ruby
<shevy>
well
finitoo has joined #ruby
gsd has joined #ruby
tolo123 has joined #ruby
<shevy>
most of the time you can simplify it - for instance, you can gather all specific constants in a module
tolo123 has quit [Client Quit]
<sevenseacat>
composition over inheritance is the oft-touted rule of thumb
GriffinHeart has joined #ruby
InhalingPixels has quit []
<stormbytes>
could you elaborate on that or point me to a resource?
<shevy>
the traditional subclass approach should go to have the same logic in the parent class, and the subclass would then be a specialized variant of that
<shevy>
for instance, the traditional parent would be:
<shevy>
class Weapon
<shevy>
and then the subclass is
<shevy>
class Sword < Weapon
<shevy>
I don't think a book is a magazine nor is a magazine really a book though
<stormbytes>
shevy yes i understand that, but i'm not sure if it works in this scnerio
<stormbytes>
but they are both publications
<shevy>
then you'd need a third class
lyanchih has joined #ruby
<shevy>
class Publication
<stormbytes>
as a superclass
<shevy>
yeah
deject3d has quit [Quit: Computer has gone to sleep.]
<stormbytes>
yeah i was considering that.. thought maybe there was some better way i dunno
<shevy>
sure
<shevy>
just use modules
<sevenseacat>
it could really be done either way.
<sevenseacat>
most people would lead to the module in ruby though, i think.
<sevenseacat>
*lean
<shevy>
stormbytes I have a project called EasyCompile
<stormbytes>
i was considering modules too
<stormbytes>
though I didn't quite get how i'd set thing sup
<shevy>
stormbytes in this I have one base class which will compile an archive into the /usr prefix
krisquigley has quit [Ping timeout: 245 seconds]
<sevenseacat>
class Book; include Publication; end
<shevy>
stormbytes I then also have a specialized class that is a subclass of this base class - it will use a different prefix (app-dir prefix)
<shevy>
it also has to do some post-compile hooks, which are unique to that latter class only
tectonic has quit []
<stormbytes>
sevenseacat the problem with that is Publication couldn't have state
speakingcode has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
<sevenseacat>
why would it?>
<stormbytes>
well a publication has a 'name', 'author', 'date published'. etc
<stormbytes>
regardless of book or magazine
<stormbytes>
it wouldn't make sense to repeat these in each subclass
<sevenseacat>
thats okay, that state would be on both of the book and magazine
<stormbytes>
but if publication is a module, its (to my knowledge) poor form to add variables to it
<sevenseacat>
it can come from the module, but it would be stored in the classes it is included in
<sevenseacat>
huh?
<shevy>
stormbytes now you already described your preference so why don't you continue? class Publication; end; class Book < Publication; end
emmesswhy has quit [Quit: This computer has gone to sleep]
<sevenseacat>
indeed, you seem to be leaning that way, so just go with it
<shevy>
set your accessor methods in the parent class, call them in your subclass
<stormbytes>
shevy : i'm considering different ways of doing it and have some pros/cons in mind, but haven't made any final decision yet
<shevy>
yeah because your mind is weak
<stormbytes>
lol
<shevy>
you are not in the flow of coding
<sevenseacat>
the decision isnt a big deal. try one way, if it doesnt work, change it.
<shevy>
the difference between modules and classes in ruby is rather fuzzy
<stormbytes>
yeah good point sevenseacat
<shevy>
a module is basically like a crippled class - you don't get to have .new
<stormbytes>
modules are for namespacing and essentially "macros"
<stormbytes>
exactly
<shevy>
you can use a class for namespacing as well :)
<stormbytes>
you can
<shevy>
people do that so they can do .new
<shevy>
I did this for: class Exams
<shevy>
class Exams; class AskQuestion
<shevy>
hmm, singular... it is actually *class Exam
<shevy>
Exam.new
<shevy>
it's my trainer for exams so I don't get to fail them \o/
<stormbytes>
ok settled
<stormbytes>
i'll set it up as a base/sub class
<stormbytes>
and mess around with it later if it doesn't seem quite right
nettoweb_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Sawbones has joined #ruby
<stormbytes>
;) thx
kobain has joined #ruby
emmesswhy has joined #ruby
GriffinHeart has joined #ruby
rezzack has quit [Ping timeout: 272 seconds]
fred-inRio has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
echooo has joined #ruby
echooo1 has quit [Ping timeout: 245 seconds]
crdpink2 has joined #ruby
oo_ has joined #ruby
txdv has quit [Ping timeout: 246 seconds]
chrishough has quit [Read error: Connection reset by peer]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
geggam has quit [Remote host closed the connection]
crdpink has quit [Ping timeout: 272 seconds]
txdv has joined #ruby
geggam has joined #ruby
stormbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
bricker`work has joined #ruby
yacks has quit [Ping timeout: 240 seconds]
Spami has quit [Quit: This computer has gone to sleep]
mocfive has quit [Remote host closed the connection]
<tectonic>
Even something like `uname -a 2>/dev/null` is vulnerable.
mocfive has joined #ruby
Zesty has joined #ruby
MrBoolean has quit [Quit: Leaving...]
angusiguess has joined #ruby
mocfive has quit [Ping timeout: 272 seconds]
<eam>
and that's why you never invoke a shell
roombadaboomba has joined #ruby
fgo has joined #ruby
roombadaboomba has quit [Client Quit]
<tectonic>
But plenty of gems do. That's in the Stripe gem.
andrewjanssen has joined #ruby
<eam>
oh yeah, this is a huge problem
techsethi has quit [Quit: techsethi]
<eam>
and a great excuse for "I told you so"
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
angusiguess has quit [Ping timeout: 272 seconds]
willgo has quit [Remote host closed the connection]
klmlfl has joined #ruby
<pontiki>
experience is the best teacher
lewix has quit [Remote host closed the connection]
lewix has joined #ruby
lewix has quit [Changing host]
lewix has joined #ruby
oleo__ has quit [Quit: Verlassend]
fgo has quit [Ping timeout: 260 seconds]
lsmola has quit [Ping timeout: 272 seconds]
echevemaster_ has quit [Remote host closed the connection]
oso96_2000 is now known as oso|away
lewix_ has joined #ruby
lewix has quit [Read error: Connection reset by peer]
Takle has joined #ruby
j75 has quit []
tectonic has quit []
pushnell has joined #ruby
lukeholder has joined #ruby
dukz has quit [Remote host closed the connection]
MaciejCzyzewski has joined #ruby
klmlfl has quit [Remote host closed the connection]
almostworking has joined #ruby
almostworking has quit [Remote host closed the connection]
sh1ken has joined #ruby
lewix_ has quit [Remote host closed the connection]
lewix has joined #ruby
c107 has quit [Remote host closed the connection]
kireevco has joined #ruby
sepp2k has quit [Quit: Leaving.]
ghostmoth has joined #ruby
kireevco has quit [Max SendQ exceeded]
thomasxie has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
mr-foobar has quit [Quit: Leaving...]
kireevco has joined #ruby
almostworking has joined #ruby
cirn0 has joined #ruby
lsmola has joined #ruby
echooo1 has quit [Quit: echooo1]
lmickh has quit [Remote host closed the connection]
Spami has joined #ruby
lewix has quit [Ping timeout: 272 seconds]
buub has quit [Ping timeout: 272 seconds]
GriffinHeart has quit [Remote host closed the connection]
emmesswhy has quit [Quit: This computer has gone to sleep]
lukeholder has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Channel6 has quit [Quit: Leaving]
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cirn0 has quit [Ping timeout: 244 seconds]
almostworking has left #ruby ["Leaving"]
klmlfl has joined #ruby
GriffinHeart has joined #ruby
chrishough has quit [Read error: Connection reset by peer]
duncan_bayne has joined #ruby
<agent_white>
So. I have a 2d array for a grid I access via grid[y][x]. Someone said I would have to overload the "[]" operator to switch the coordinates so I can access it in normal coordinate form (grid[x][y]). Is that what I need to do?
* agent_white
doesn't know how to explain in technical terms
<duncan_bayne>
Hi, I'm trying to call a set accessor from C with 'rb_funcall(output, rb_intern("state"), 1, T_TRUE);'. It's failing silently :( Am I doing something obviously wrong here?
<duncan_bayne>
That's intended to be equivalent to 'output.state = true' in Ruby
p0sixpscl has joined #ruby
<duncan_bayne>
Ahah
<duncan_bayne>
Qtrue
<duncan_bayne>
Qfalse
tectonic has joined #ruby
<duncan_bayne>
Correct code is: 'rb_funcall(output, rb_intern("state="), 1, Qtrue);'
duncan_bayne has left #ruby [#ruby]
p0sixpscl has quit [Client Quit]
chrishough has joined #ruby
charliesome has quit [Quit: zzz]
sepp2k has joined #ruby
sevvie has quit [Quit: leaving]
GriffinHeart has quit [Remote host closed the connection]
arup_r has joined #ruby
lewix has joined #ruby
GriffinHeart has joined #ruby
charliesome has joined #ruby
Zesty- has joined #ruby
Zesty- has quit [Client Quit]
modernbob has joined #ruby
mastr_bennett[x] has joined #ruby
fredInRio has quit [Ping timeout: 260 seconds]
klmlfl has quit [Remote host closed the connection]
Zesty has quit [Ping timeout: 250 seconds]
techsethi has joined #ruby
thrasymachus has quit [Quit: leaving]
freerobby has quit [Quit: Leaving.]
devboard has joined #ruby
statis has joined #ruby
mityaz_ has quit [Quit: See ya!]
gorelative has quit [Ping timeout: 250 seconds]
lukeholder has joined #ruby
bMalum has quit [Read error: Connection reset by peer]
kyb3r_ has joined #ruby
bMalum has joined #ruby
devboard has quit []
fabrice31 has joined #ruby
krisquigley has joined #ruby
bruno- has joined #ruby
klmlfl has joined #ruby
fabrice31 has quit [Ping timeout: 272 seconds]
baltazore has joined #ruby
Mohd_ has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
bizarrosandwich has quit [Read error: Connection reset by peer]
davasaurous has quit [Remote host closed the connection]
axsuul has quit [Ping timeout: 240 seconds]
goshdarnyou has quit [Quit: Connection closed for inactivity]
User458764 has quit [Ping timeout: 246 seconds]
grenierm has quit [Quit: grenierm]
lewix has quit [Remote host closed the connection]
ta has joined #ruby
davasaurous has joined #ruby
lewix has joined #ruby
<mastr_bennett[x]>
so is it possible to get terminal input from a script, in reponse to to CLI prompt and then redirect that back to stdout, to use in that CLI program via ruby. that value
<mastr_bennett[x]>
I don't see how it would be possible, but I just asking in case there's anything better I can do than storing that value in the script.
ghostmoth has quit [Quit: ghostmoth]
spastorino has quit [Quit: Connection closed for inactivity]
hiyosi_ has quit [Ping timeout: 272 seconds]
User458764 has joined #ruby
aganov has joined #ruby
lewix has quit [Ping timeout: 272 seconds]
Morkel has joined #ruby
hmsimha_ has joined #ruby
HelperW_ has joined #ruby
lxsameer has joined #ruby
kaspergrubbe_ has joined #ruby
thomasxie has quit [Ping timeout: 260 seconds]
Scotteh has joined #ruby
hiall has quit [Quit: hiall]
Vile` has quit [Ping timeout: 246 seconds]
jackyalcine is now known as jalcin
jalcin is now known as jalcine
melik has quit [Quit: Computer has gone to sleep.]
emocakes has joined #ruby
Takle has quit [Remote host closed the connection]
RichardLitt has quit [Quit: RichardLitt]
rdark has joined #ruby
fabrice31 has joined #ruby
gauke has joined #ruby
arup_r has quit [Remote host closed the connection]
kaspergrubbe_ has quit [Remote host closed the connection]
techsethi has quit [Quit: techsethi]
ht__th has joined #ruby
osvico has quit [Ping timeout: 260 seconds]
<pontiki>
i have no idea what you're trying to do
arup_r has joined #ruby
LudicrousMango has quit [Remote host closed the connection]
<agent_white>
mastr_bennett[x]: Yes, you can pipe stdin to a ruby script.
LudicrousMango has joined #ruby
adac has joined #ruby
<pontiki>
i don't think that was the question
Vile` has joined #ruby
<mastr_bennett[x]>
pontiki: i have a username stored in the script and I'm using system() to drop to the command line and run a program.
angusiguess has joined #ruby
<mastr_bennett[x]>
that program needs a password.
maestrojed has joined #ruby
emocakes has quit []
<agent_white>
mastr_bennett[x]: You mean like `echo "hello there" | capitalize.rb` => "HELLO THERE" ?
<agent_white>
Heh...
<pontiki>
does the called program request the password, or do you need to supply it when to use system()?
<mastr_bennett[x]>
agent_white: no, like system('passwd')
<txdv>
capitalize.rb, best script ever
<mastr_bennett[x]>
pontiki: it requests the passwd.
<Hanmac>
mastr_bennett[x]: hm you might look at open3 and popen
fgo has joined #ruby
<agent_white>
txdv: Inorite? :D
<pontiki>
probably not, Hanmac, if the called program needs to do IO with the user directly
<mastr_bennett[x]>
well I actually am using those is the script instead of system. specifically popen...
<mastr_bennett[x]>
IO.popen
timonv_ has joined #ruby
LudicrousMango has quit [Ping timeout: 272 seconds]
<mastr_bennett[x]>
but I'm popen to other options :-)
sh1ken has quit [Quit: leaving]
<pontiki>
is this actually the passwd program you're calling?
angusiguess has quit [Ping timeout: 272 seconds]
<mastr_bennett[x]>
pontiki: no. it's git-svn
graydot has quit [Quit: graydot]
robbyoconnor has quit [Ping timeout: 260 seconds]
hiall has joined #ruby
wallerdev has quit [Quit: wallerdev]
techsethi has joined #ruby
<pontiki>
does that have to ask for the password each time it's run? (i don't use it, obviously)
<pontiki>
or can it use, say .netrc ?
klmlfl has joined #ruby
alex-i_ is now known as alex-i
<pontiki>
it just seems crude. i don't have a ready answer to your original question, sadly.
<agent_white>
So... is there a way for me to override Array's element reference operators for a 2d array? I would like to access this 2d array `Array.new(3) { Array.new(3) }` and set it's elements via `array[x][y]` instead the current reverse-cooordinates way of `array[y][x]`.
<agent_white>
Notsure if I said that right... but yeah! :D
kaspergrubbe_ has quit [Read error: Connection reset by peer]
max06 has joined #ruby
kaspergrubbe_ has joined #ruby
mindlessdemon has joined #ruby
kaspergrubbe_ has quit [Read error: Connection reset by peer]
qpok has quit [Ping timeout: 260 seconds]
kaspergrubbe_ has joined #ruby
tectonic has quit []
mindlessdemon has left #ruby [#ruby]
<lxsameer>
hey guys, Is there any solution to pack/unpack a binary data using bits ? ( unpack/pack method smallest template value is C which is 8bit)
tessi_zz is now known as tessi
davasaurous has quit [Remote host closed the connection]
cirn0 has joined #ruby
yeticry has quit [Remote host closed the connection]
<aech>
lxsameer: You can just use the bitwise operators?
davasaurous has joined #ruby
fgo has quit [Remote host closed the connection]
kaspergrubbe_ has quit [Remote host closed the connection]
<lxsameer>
aech: What do you mean, I need to generate a 38bytes long data which I have some 1bit flags in it too
Takle has joined #ruby
ta has quit [Remote host closed the connection]
noop has joined #ruby
kaspergrubbe_ has joined #ruby
<aech>
lxsameer: you could also use the bindata gem
<lxsameer>
aech: thanks let me take a look
cirn0 has quit [Ping timeout: 245 seconds]
graydot has joined #ruby
<mastr_bennett[x]>
pontiki: i didn't know about .netrc. This is meant to be cross-platform though and as dumb as possible so I don't think that'll work
Sawbones has quit [Ping timeout: 244 seconds]
fgo has joined #ruby
Scotteh_ has quit [Quit: Later, folks]
BTRE has quit [Ping timeout: 245 seconds]
ktpri has joined #ruby
kaspergrubbe_ has quit [Ping timeout: 260 seconds]
tylersmith has quit [Remote host closed the connection]
<flughafen>
when is it ok to use global variables?
<mastr_bennett[x]>
i honestly didn't expect there to be a way to do this. i was just curious. popen seems to be able to do some fancy things once you start looking at the docs.
tylersmith has joined #ruby
Sawbones has joined #ruby
krisquigley has joined #ruby
ta has joined #ruby
graydot has quit [Quit: graydot]
mercwithamouth has joined #ruby
<ktpri>
ruby uses pointers?
AlSquirrel has joined #ruby
AlSquire has quit [Ping timeout: 240 seconds]
davasaurous has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 258 seconds]
hiyosi_ has joined #ruby
timonv_ has quit [Remote host closed the connection]
lukeholder has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
anaeem1_ has joined #ruby
alex88 has joined #ruby
timonv_ has joined #ruby
krisquigley has quit [Ping timeout: 240 seconds]
<flughafen>
i think all programming languages use pointers, but wether or not it's exposed to you, is something different
timonv^ has joined #ruby
lukeholder has joined #ruby
tessi is now known as tessi_zz
SOLDIERz has joined #ruby
<SOLDIERz>
Hello everyone
W0rmDr1nk has joined #ruby
<SOLDIERz>
I've just got a question about ruby and a way to handle multiple ruby versions.
hiyosi_ has quit [Ping timeout: 260 seconds]
<SOLDIERz>
Is there somebody which already have achieved to handle multiple versions of ruby on an redhad-derviate?
kaspergrubbe_ has joined #ruby
timonv_ has quit [Ping timeout: 250 seconds]
<sevenseacat>
on a... what?
<SOLDIERz>
and I mean no solutions with rvm, rbenv or anything else
yeticry has joined #ruby
<SOLDIERz>
I mean thorugh rpms
<SOLDIERz>
through
toretore has joined #ruby
timonv^ has quit [Remote host closed the connection]
bruno- has joined #ruby
contradictioned_ is now known as contradictioned
kaspergrubbe_ has quit [Read error: No route to host]
kaspergr_ has joined #ruby
<sevenseacat>
'is there anyone who has come up with a way to do this, not including the people who have already come up with ways to do this'
ktpri has quit [Quit: Page closed]
Juanchito has joined #ruby
<SOLDIERz>
sry I mean Red Hat version
<SOLDIERz>
@sevenseacat ?
<SOLDIERz>
sevenseacat ?
<sevenseacat>
whats wrong with the existing solutions?
<SOLDIERz>
which existing solutions do you mean
<SOLDIERz>
?
<sevenseacat>
rvm, rbenv, etc.
<SOLDIERz>
well this is pretty simple. I don't want tools like make and gcc on a production server
yeticry has quit [Ping timeout: 245 seconds]
<sevenseacat>
have fun then
graydot has joined #ruby
<sevenseacat>
theres a reason these tools exist
graydot has quit [Client Quit]
kaspergr_ has quit [Read error: Connection reset by peer]
<SOLDIERz>
and the reason is?
kaspergrubbe_ has joined #ruby
corehook has quit [Remote host closed the connection]
Stalkr_ has joined #ruby
<sevenseacat>
because theyre the simplest and best way to tackle such a problem
boombada_ has joined #ruby
<pontiki>
you can certainly roll your own rpms
Takle has quit [Remote host closed the connection]
corehook has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
<SOLDIERz>
pontiki then probably tell me the simplest way to do that
<sevenseacat>
if you have multiple RPMs that try to install the same programs, you still need some way to handle switching between them
<pontiki>
i've never done it
fgo has quit [Remote host closed the connection]
<Stalkr_>
Is it possible to have sh in a Rakefile not echo the output or should I just write to a tmp file? Need to silent sh %{which brew}, would that just be sh ${which brew > /tmp/brew} or is Rake then not able to use the block?
pen has quit [Read error: Connection reset by peer]
<flughafen>
is there an equivlant of if __name__ == "__main__" in pyton?
<flughafen>
err
pen has joined #ruby
<flughafen>
un ruby
jxs_ has joined #ruby
<sevenseacat>
what does that do?
<SOLDIERz>
because I'm running in a lot of issues. Because there are then running in version issues.
<sevenseacat>
indeed.
corehook has quit [Read error: No route to host]
<sevenseacat>
thats why we use these tools.
corehook has joined #ruby
<SOLDIERz>
So I need to create special rpms for every version of ruby
yfeldblum has joined #ruby
<flughafen>
sevenseacat: it allows a file to be used as a lib if it's imported, or it'll run as an app if you run the file directly
<flughafen>
so everything under if ...."__main__" runs if you call python thatfile.py
Ghis_ has joined #ruby
<SOLDIERz>
and call them with the specific package name
boombada_ has quit [Ping timeout: 250 seconds]
GriffinHeart has quit [Remote host closed the connection]
<SOLDIERz>
so like name: ruby213 to deploy ruby-2.1.3 to dont run in any version issues with yum and rom
<SOLDIERz>
rpm
maestrojed has quit [Quit: Computer has gone to sleep.]
charliesome has quit [Quit: zzz]
<sevenseacat>
have fun with that
<SOLDIERz>
sevenseacat have fun with that is your most common answer for everything I'm talking about ha?
<sevenseacat>
well what youre talking about is i think a bit crazy
mkaesz has joined #ruby
<SOLDIERz>
I'm mean seriously rvm and rbenv could not be a solution for a productionsystem
ki0 has joined #ruby
dukz has quit [Remote host closed the connection]
<sevenseacat>
why?
qba73 has joined #ruby
BTRE has joined #ruby
<pontiki>
having build tools on a system is a vector
<SOLDIERz>
Well I got there than every tools deployed to build software from the source
<sevenseacat>
having a system is a vector
<SOLDIERz>
i don't want to having build tools installed on productionsystems
<pontiki>
no, the system is the target
<SOLDIERz>
it's a security issue
oponder has joined #ruby
GriffinHeart has joined #ruby
parduse has quit []
* sevenseacat
shrugs
dukz has joined #ruby
apeiros has joined #ruby
<pontiki>
but i don't think you're going to get any further answers here, SOLDIERz
<postmodern>
SOLDIERz, if you don't want rvm/rbenv in production, just install the ruby packages or roll your own
oponder has quit [Client Quit]
a has joined #ruby
<SOLDIERz>
pontiki I think also... and I find it terrifying ...
<pontiki>
shivver yer timbers
a is now known as Guest2850
<SOLDIERz>
Nobody is thinking about this out there in the wild
<sevenseacat>
most people don't want multiple versions of ruby on production servers.
angusiguess has joined #ruby
<pontiki>
well, then, you have a huge paycheck in front of you. have at it
qba73 has quit [Remote host closed the connection]
choke has quit [Ping timeout: 260 seconds]
<SOLDIERz>
postmodern yeah well I know fpm... but there it's the same problem here... versioning... and also there are other issues with fpm that are creepy... I need a system where I first need to install the build tools... So i can not run the build in an chroot envrionement
<SOLDIERz>
and that are thinks I really don't want to...
roolo has joined #ruby
patrick99e99 has quit [Ping timeout: 260 seconds]
klmlfl has quit [Ping timeout: 260 seconds]
qba73 has joined #ruby
<postmodern>
SOLDIERz, use schroot
mikecmpbll has joined #ruby
<postmodern>
SOLDIERz, also for versionsing, have your packages install into /opt/rubies, then your apps can do #!/opt/rubies/..../bin/ruby
LiohAu_ has joined #ruby
arup_r has quit [Remote host closed the connection]
<postmodern>
SOLDIERz, or you could create a build server that spits out docker images
corehook_ has joined #ruby
emmesswhy has joined #ruby
ndrei has joined #ruby
anarang has quit [Ping timeout: 250 seconds]
yeticry has joined #ruby
<SOLDIERz>
well schroot and fpm is probably one way not the best but one way
anarang has joined #ruby
<SOLDIERz>
but I'm thinking to really force them probably to one version. Because I see there really a lot of issues upcoming
Pumukel has joined #ruby
AFKGeek has joined #ruby
<postmodern>
SOLDIERz, have them dev off system ruby
<SOLDIERz>
postmodern yeah well you are probably right. From the Administrationside (my side) I really don't want to run multiple Versions on productionsystem..
ki0 has quit []
kaspergrubbe_ has quit [Remote host closed the connection]
<SOLDIERz>
probably I need a meeting with them and force them to one version. Because it already scares me that multiple version think.
<Bish>
postmodern, i think i got it from the link u sent me, but what exactly does the << operator do now.. does it extend the class by the methods the instance has?
kaspergrubbe_ has joined #ruby
<SOLDIERz>
I want clean systems easy to deploy easy to control not more
yeticry has quit [Remote host closed the connection]
fgo has joined #ruby
<SOLDIERz>
I'm losing there the control when I'm doing this fancy stuff with multiple versions
AFKGeek has quit [Client Quit]
<SOLDIERz>
and can not gurantee a stable system
sk87 has joined #ruby
AFKGeek has joined #ruby
<postmodern>
Bish, it's special syntax, << is normally the append operator
kaspergrubbe_ has quit [Read error: No route to host]
Spami has quit [Quit: This computer has gone to sleep]
<Bish>
i don't know what to try.. if i do def method end, Module will always respond to the method and i cannot create an instance of the module right?
Alina-malina has quit [Ping timeout: 240 seconds]
<postmodern>
Bish, you can query singleton methods via Mod.singleton_methods
Xeago has quit [Remote host closed the connection]
LudicrousMango has joined #ruby
kaspergrubbe_ has quit [Remote host closed the connection]
kaspergrubbe_ has joined #ruby
charliesome has joined #ruby
frenda has joined #ruby
<frenda>
Hi
Alina-malina has joined #ruby
<frenda>
I have a question about software development methods; (a ruby web application, can I ask here?)
krisquigley has joined #ruby
<Bish>
how would you guys communicate with a thread? when having like a worker thread?
corehook_ has quit [Remote host closed the connection]
corehook has joined #ruby
<frenda>
(Note: Let call the software 'OpenTilt'; We assume it does not have social features) --> we're going to add these features to it --> that means a service which allows people to have their profile with provided interactivity between users, ability to follow up others, Likes, etc.
<frenda>
Method 2: Keeping the core untouched and working on an external Software for integration between different installation per user! (img: http://i.stack.imgur.com/lBTCI.png)
<frenda>
The Question: Which method is recommended? (Developing with lower cost and Maintaining easier, Better security, etc)
Xeago has joined #ruby
hiyosi_ has joined #ruby
<frenda>
Methods 2 and 3 need separated resource for each user: Ram, CPU and DB
joonty has joined #ruby
<frenda>
But these 2 methods use the open source app which is developing by others; we should just develop our plugin/integrator!
kaspergrubbe_ has quit [Ping timeout: 260 seconds]
Aaaal has joined #ruby
osvico has joined #ruby
work_op has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 250 seconds]
yeticry has joined #ruby
corehook has quit [Ping timeout: 260 seconds]
elstif has joined #ruby
guiguidoc has quit [Ping timeout: 240 seconds]
Takle has joined #ruby
corehook has joined #ruby
kristofferR has joined #ruby
hiyosi_ has quit [Ping timeout: 272 seconds]
hellangel7 has joined #ruby
kaspergrubbe_ has joined #ruby
Xeago has quit [Remote host closed the connection]
angusiguess has joined #ruby
blackmesa has joined #ruby
fgo has joined #ruby
tkuchiki has joined #ruby
hellangel7 has quit [Read error: Connection reset by peer]
Takle has quit [Ping timeout: 245 seconds]
yeticry has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
Takle has joined #ruby
sevenseacat has quit [Remote host closed the connection]
nettoweb has joined #ruby
nettoweb has quit [Max SendQ exceeded]
nettoweb has joined #ruby
klmlfl has joined #ruby
fgo has quit [Ping timeout: 250 seconds]
mikepack has quit [Remote host closed the connection]
angusiguess has quit [Ping timeout: 272 seconds]
nettoweb has quit [Client Quit]
jxs_ has joined #ruby
wpp has joined #ruby
jxs_ has quit [Remote host closed the connection]
St_Marx has quit [Remote host closed the connection]
hellangel7 has joined #ruby
St_Marx has joined #ruby
kaspergrubbe_ has quit [Remote host closed the connection]
kaspergrubbe_ has joined #ruby
hellangel7 has quit [Max SendQ exceeded]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
guiguidoc has joined #ruby
klmlfl has quit [Ping timeout: 258 seconds]
<bhaak>
if I wanted to pass an IO object (representing a log file) to a method, but also wanting to only have that file being created if something's has been written to the IO object before it has been closed, is there a simple existing class to use for that behavior?
lkba has quit [Ping timeout: 272 seconds]
sk87 has joined #ruby
kaspergrubbe_ has quit [Ping timeout: 250 seconds]
dANO has quit [Read error: Connection reset by peer]
AlexRussia has joined #ruby
<DaniG2k>
whats the best way of refactoring that into another method?
ta has quit [Ping timeout: 272 seconds]
<DaniG2k>
shold I just pu the if else in another method with a yield in the middle?
Mia has joined #ruby
<workmad3>
DaniG2k: so... the condition is the same, the else is the same, it's just the true-case that changes?
a_ has joined #ruby
corehook has quit [Ping timeout: 260 seconds]
<workmad3>
DaniG2k: and, also critically, they're *meant* to be the same, semantically... it's not just a quirk of implementation that they ended up the same at the moment?
<DaniG2k>
well
<DaniG2k>
workmad3: 3 of my methods are using this, for example: response = https_request; if response.kind_of? String; xml_doc = Nokogiri::XML(response)
<DaniG2k>
with an identical else that just puts a different message in the event !response.kind_of? String
<DaniG2k>
but the meat of the methods are actually quite different otherwise
<DaniG2k>
I don't want to have to keep writing this whole response.kind_of? String
<DaniG2k>
I mean: response = https_request; if response.kind_of? String; xml_doc = Nokogiri::XML(response)
<workmad3>
DaniG2k: why not pull the XML construction out into an 'xml_https_request' method?
<workmad3>
DaniG2k: and raise an exception you can handle in the case of it not being a String
tokik has quit [Ping timeout: 272 seconds]
corehook has joined #ruby
nettoweb has joined #ruby
<DaniG2k>
workmad3: thats what I'm saying. If I put this boilerplate code in another method, whats the right way to make the rest of the method different?
<AlexRussia>
DaniG2k: yield means 'here be block of user code'
dANO_ has quit [Ping timeout: 272 seconds]
techsethi has quit [Quit: techsethi]
<workmad3>
DaniG2k: reload
kaspergrubbe_ has joined #ruby
<workmad3>
DaniG2k: that's a method that can be called either way ;)
<workmad3>
DaniG2k: but essentially, as AlexRussia and mikecmpbll say, yield is pretty simple... all it does is go 'execute the block parameter passed to this method now, please'
<DaniG2k>
ok let me have a look
<DaniG2k>
workmad3: thanks :)
<DaniG2k>
yes thats kind of what im looking for
<DaniG2k>
I want to learn this
dANO_ has joined #ruby
<DaniG2k>
so
<DaniG2k>
yield xml_doc
<DaniG2k>
its returning the Nokogiri element
<workmad3>
DaniG2k: think of it like a method call
<DaniG2k>
oooh i see
<DaniG2k>
right
<DaniG2k>
thats why i was conused
<DaniG2k>
confused
<workmad3>
:)
<DaniG2k>
xml_doc = xml_https_request
<DaniG2k>
and
<DaniG2k>
xml_https_request do |xml_doc|
<DaniG2k>
i was wondering, what if I dont want to pass anything to it
<DaniG2k>
you can tell it what to yield
<workmad3>
yeah... the first one doesn't pass a block, so the method doesn't yield
<workmad3>
that's what 'block_given?' checks for
<DaniG2k>
ok
<workmad3>
if you yield and no block was provided, you get an exception
<workmad3>
DaniG2k: digging into the code for gems that make use of blocks helps too
<DaniG2k>
yes
mengu has joined #ruby
mengu has joined #ruby
sprihodko has joined #ruby
<mikecmpbll>
or reading any of the billion websites that explains about blocks/procs/lambdas :p
Takle has quit [Remote host closed the connection]
<DaniG2k>
i tried reading them in the past
hiyosi_ has joined #ruby
<DaniG2k>
got super confused
<DaniG2k>
I think I get lambdas
<DaniG2k>
I'm still learning about blocks
<DaniG2k>
and procs are a bit confusing
<mikecmpbll>
you probably don't. they're all intertwined.
dangerousdave has joined #ruby
<workmad3>
procs and lambdas are the same thing, just some minor differences in behaviour
<DaniG2k>
ok
<mikecmpbll>
ya, ones a closure or summit.
mmochan_ has joined #ruby
<workmad3>
hell, if you look at a lambda, you see that 'lambda{}' creates a Proc object with 'lambdaness'
<workmad3>
mikecmpbll: nah, they're both closures
ndrei has quit [Quit: Lost terminal]
<mikecmpbll>
ok then, one will execute in the context it's defined?
ndrei has joined #ruby
<workmad3>
the difference is that lambdas act slightly more like a 'normal' method... they throw an error if you don't provide all the arguments, and 'return' in a lambda just returns from the lambda, not the context you defined it in
<workmad3>
mikecmpbll: again, they both execute in the context they're defined in ;)
m4rCsi_ has quit [Ping timeout: 260 seconds]
<workmad3>
(unless overridden with an instance_eval(&blk) hack)
<mikecmpbll>
how does the return behaviour differ then
<mikecmpbll>
(not in which way, but how)
<DaniG2k>
did you guys hear about the 20 year vulneravility in bash? lolz
<workmad3>
mikecmpbll: before running the code, have a think about what you expect to be the behaviour in each case
yfeldblum has quit [Quit: Leaving...]
flughafen has quit [Quit: WeeChat 0.4.1]
mengu has quit [Ping timeout: 240 seconds]
sk87 has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mikecmpbll>
i understand the behaviour reasonably well, call_with_lambda will print all the lines (bar "in proc" obviously) and call_with_proc will return from execute_callable
<mikecmpbll>
just trying to understand what it is that makes them differ in that way.
mindlessdemon has joined #ruby
<workmad3>
mikecmpbll: it's that one is a lambda and one is a proc ;)
angusiguess has joined #ruby
mindlessdemon has quit [Max SendQ exceeded]
<mikecmpbll>
ya, but the behaviour of `return` has to have something to do with the context in which the block is being executed.
<mikecmpbll>
that would have been my thought anyway.
dangerousdave has joined #ruby
<workmad3>
mikecmpbll: however, the return in the proc in 'call_with_proc' doesn't return from 'execute_callable'
corehook has quit []
<workmad3>
mikecmpbll: it returns from 'call_with_proc'
t_p has joined #ruby
<workmad3>
mikecmpbll: it's essentially just aborted a bunch of the stack there ;)
mindlessdemon has joined #ruby
mindlessdemon has quit [Max SendQ exceeded]
a_ has quit [Ping timeout: 245 seconds]
elstif has joined #ruby
<workmad3>
mikecmpbll: hence why you can have weirdnesses happening with a 'return' in a block or a proc... it typically happens when the proc has been saved for later use... and then when the proc executes, it tries to return from a context that has already finished executing
mindlessdemon has joined #ruby
mindlessdemon has quit [Max SendQ exceeded]
kaspergrubbe_ has quit [Read error: Connection reset by peer]
mindlessdemon has joined #ruby
emmesswhy has quit [Quit: Leaving]
kate_r has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<mikecmpbll>
maybe i didn't explain what i meant about context properly
<DaniG2k>
workmad3: in your example
kaspergrubbe_ has joined #ruby
<DaniG2k>
you have
<mikecmpbll>
lambda's have their own context
mindlessdemon has quit [Max SendQ exceeded]
<mikecmpbll>
proc's do not?
skaflem has joined #ruby
<mikecmpbll>
a = proc { b = "foobar" }; a.call; b => "foobar"
<workmad3>
mikecmpbll: no, they both have their own context nowadays, I believe
<mikecmpbll>
so the proc is executed in the context it is defined
<DaniG2k>
if block_give?; yield xml_block; end
<DaniG2k>
is there a way to pass a variable to this method as well?
mindlessdemon has joined #ruby
<mikecmpbll>
lamdas do not, if i define a variable in a lambda, it's not available outside the lambda
mindlessdemon has quit [Max SendQ exceeded]
rkalfane has joined #ruby
<workmad3>
mikecmpbll: b isn't available outside that proc ;)
<mikecmpbll>
yes it is
<workmad3>
mikecmpbll: no it's not... not since about 1.9 :P
<workmad3>
mikecmpbll: maybe even 1.8
patrick99e99 has joined #ruby
fgo has quit [Ping timeout: 258 seconds]
<mikecmpbll>
argh, maybe i already had b defined outside
klmlfl has joined #ruby
<workmad3>
mikecmpbll: ;)
angusiguess has quit [Ping timeout: 260 seconds]
ghr has quit []
qba73 has quit [Remote host closed the connection]
<mikecmpbll>
my irb fu is so bad lately.
<workmad3>
mikecmpbll: they both (now) define their own local scope (which is what I think you were meaning)
<workmad3>
mikecmpbll: they both capture the outside context (this is the behaivour of a closure)
<mikecmpbll>
yep, i'm completely wrong.
<workmad3>
mikecmpbll: it used to be you weren't though ;)
<workmad3>
mikecmpbll: that behaviour changed in either 1.8->1.9 or 1.6->1.8... can't remember which
qba73 has joined #ruby
<mikecmpbll>
it still shows the difference in behaviour, lambda won't update the variable but define it's own
<workmad3>
mikecmpbll: wrong again :P
a has joined #ruby
ghr has joined #ruby
rkalfane has quit [Client Quit]
<workmad3>
mikecmpbll: seriously, it's only 'return' that behaves differently
a is now known as Guest58297
<mikecmpbll>
a = lambda { b = "foobars" }; puts b => "foobar"
dANO has quit [Read error: Connection reset by peer]
dANO has joined #ruby
dANO_ has quit [Read error: Connection reset by peer]
fabrice31 has quit [Remote host closed the connection]
<workmad3>
mikecmpbll: btw, the reason for the difference is that a lambda is intended as an anonymous method, while a proc should behave as expected in something like this 'def my_find(i, ary); ary.each_with_idx{|item, idx| return idx if item == i}; return -1; end'
Guest58297 has quit [Quit: leaving]
skammer3 has quit [Ping timeout: 260 seconds]
Takle has quit [Remote host closed the connection]
<mikecmpbll>
ic
postmodern has quit [Quit: Leaving]
<workmad3>
mikecmpbll: hence a lambda acts more like a method, while a proc acts more like it's just part of the method you created it in
<mikecmpbll>
yeah that makes sense.
Takle has joined #ruby
<workmad3>
(which is probably where your confusion about the various scopes, etc. came from, I'm guessing? ;) )
<mikecmpbll>
god knows where it came from.
<mikecmpbll>
i think that's best left a mystery
fabrice31 has joined #ruby
<workmad3>
mostly, it's best, IMO, to just avoid returns in anything that looks proc-like or block-like in ruby :)
bricker`LA has joined #ruby
blackmesa has quit [Quit: WeeChat 1.0]
Davedo has quit [Read error: Connection reset by peer]
<workmad3>
the difference in argument-list behaviour can be mitigated nowadays too, as you can provide splat-args and defaults for block-params :)
<DaniG2k>
workmad3: the code works brilliantly
<DaniG2k>
thanks
<DaniG2k>
:)
<DaniG2k>
now i get it
angusiguess has joined #ruby
Davedo has joined #ruby
Advocation has joined #ruby
echooo has quit [Quit: echooo]
echooo has joined #ruby
<workmad3>
DaniG2k: that style of detecting if a block was passed or not can be more useful with scoping some resource you want to clean up btw... such as with File.open... with a block, it passes the file object to the block and closes it afterwards, while without a block, it returns the file object and closing it is your responsibility
qba73 has quit []
<workmad3>
DaniG2k: with 'block_given?' you can write other methods that act like that... such as transactions or locks :)
<workmad3>
some of them, you may want to never provide a mechanism that leaves closing up to the caller (both of the above are candidates for that :) )
fabrice31 has quit [Ping timeout: 245 seconds]
banister has quit [Read error: Connection reset by peer]
banister_ has joined #ruby
<DaniG2k>
workmad3: what was that &block thing you wrote before
bricker`LA has quit [Ping timeout: 246 seconds]
<workmad3>
DaniG2k: that makes the block parameter explicit
<workmad3>
DaniG2k: so you can pass it around, store it, etc.
<workmad3>
DaniG2k: or rather, there are two meanings
<workmad3>
DaniG2k: in a parameter list for a method definition, it makes the block parameter explicit
<DaniG2k>
so mymethod(&block)
<workmad3>
DaniG2k: when calling a method, it passes the argument as the block parameter
<DaniG2k>
is the same asde mymethod;
<DaniG2k>
as def mymethod; yield; end
<mikecmpbll>
if you call it in the first one
<workmad3>
^^
<workmad3>
def mymethod(&blk); blk.call; end == def mymethod; yield; end
<mikecmpbll>
otherwise you're just accepting a block and not doing owt with it.
mengu has joined #ruby
<workmad3>
and 'a = proc{puts "hi"}; mymethod(&a)' == 'mymethod {puts "hi"}'
bruno- has joined #ruby
<DaniG2k>
oh ok
<DaniG2k>
i see
<DaniG2k>
so a proc is a function that can be stored in a variable
qba73 has joined #ruby
dANO_ has joined #ruby
<workmad3>
proc{} creates a Proc object, which you can pass around like any other object
karupa is now known as zz_karupa
<mikecmpbll>
can do Proc.new too.
<workmad3>
yeah... and lambda{}, which also creates a Proc object
<workmad3>
and ->
Takle has quit [Remote host closed the connection]
<workmad3>
and if you look at 'def mymethod(&blk); blk.class; end', you'll also see that blk is a Proc
dANO has quit [Ping timeout: 245 seconds]
<workmad3>
if you dig into the implementation details for MRI, you'll see that the block parameter is only turned into a Proc when it's explicit
bruno- has quit [Ping timeout: 272 seconds]
<DaniG2k>
ok
<DaniG2k>
I'll have to read more intot his
<DaniG2k>
thanks :)
t_p has quit [Quit: Computer has gone to sleep.]
<workmad3>
there's also some weirdness in there around what happens with 'some_method(&a_proc)' :)
roolo_ has quit [Remote host closed the connection]
<workmad3>
at the level of visible ruby though, if you compare the object_id of 'a_proc' outside that method, and an explicit block parameter's object_id inside that method, they'll be the same... so I personally think of procs and blocks as semantically the same thing
shanlar- has joined #ruby
roolo has joined #ruby
<workmad3>
others don't, and think of them as separate entities, with '&' being a 'to_proc' operator
timgauthier has quit [Remote host closed the connection]
timgauthier has joined #ruby
timonv_ has quit [Remote host closed the connection]
shanlar has quit [Ping timeout: 260 seconds]
timonv_ has joined #ruby
roolo has quit [Ping timeout: 260 seconds]
bruno- has joined #ruby
himsin has joined #ruby
Advocation has quit [Quit: Advocation]
bruno- is now known as Guest95323
jgt has joined #ruby
<jgt>
howdy
fsapo has joined #ruby
timonv_ has quit [Ping timeout: 272 seconds]
relix has quit [Ping timeout: 245 seconds]
relix has joined #ruby
dANO_ has quit [Read error: Connection reset by peer]
dANO has joined #ruby
techsethi has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
jgt has quit [Read error: Connection reset by peer]
echooo has quit [Quit: echooo]
echooo has joined #ruby
echooo has quit [Client Quit]
tqkrfa has joined #ruby
fsapo has quit [Ping timeout: 272 seconds]
skolman has joined #ruby
ringarin has joined #ruby
vinleod has joined #ruby
roolo has joined #ruby
fsapo has joined #ruby
m4rCsi has quit [Ping timeout: 240 seconds]
hiyosi_ has joined #ruby
jottr has joined #ruby
jottr has quit [Client Quit]
Pumukel has joined #ruby
charliesome has quit [Quit: zzz]
mkaesz has joined #ruby
Advocation has joined #ruby
dANO has quit [Read error: Connection reset by peer]
dANO has joined #ruby
charliesome has joined #ruby
hiyosi_ has quit [Ping timeout: 272 seconds]
timonv_ has joined #ruby
lyanchih has quit [Quit: lyanchih]
fgo has joined #ruby
choke has joined #ruby
davasaurous has joined #ruby
osvico has quit [Ping timeout: 272 seconds]
<apeiros>
workmad3: there is a GC/Memory implication in the difference between blocks and procs
<apeiros>
a block is not an object, a proc is
timgauthier is now known as timgauthier_isaw
finitoo was banned on #ruby by apeiros [*!*@90.174.5.120]
finitoo was kicked from #ruby by apeiros [no spam.]
AlexRussia has quit [Ping timeout: 264 seconds]
AlexRussia has joined #ruby
<apeiros>
this is an implementation detail, though - any ruby implementation might choose to represent all blocks as objects.
krz has quit [Quit: WeeChat 1.0]
arup_r has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 260 seconds]
<wasamasa>
apeiros: thanks
klmlfl has joined #ruby
m4rCsi has joined #ruby
phutchins has joined #ruby
Ludicrou_ has quit [Read error: Connection reset by peer]
yfeldblum has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
klmlfl has quit [Ping timeout: 272 seconds]
lolmaus has quit [Quit: Konversation terminated!]
timonv_ has quit [Remote host closed the connection]
LudicrousMango has joined #ruby
jottr has joined #ruby
fsapo has quit [Ping timeout: 246 seconds]
yeticry has joined #ruby
dANO_ has joined #ruby
dANO has quit [Read error: Connection reset by peer]
fgo has joined #ruby
mr-foobar has joined #ruby
ta has joined #ruby
nonmadden has joined #ruby
ta has quit [Client Quit]
ta has joined #ruby
osvico has joined #ruby
timgauthier_isaw is now known as timgauthier
tqkrfa has quit [Ping timeout: 260 seconds]
jhass|off is now known as jhass
andikr has quit [Remote host closed the connection]
ndrei has quit [Quit: Lost terminal]
yeticry has quit [Ping timeout: 240 seconds]
zybi1 has joined #ruby
ndrei has joined #ruby
m4rCsi has quit [Ping timeout: 272 seconds]
mkaesz has quit [Remote host closed the connection]
quazimodo has joined #ruby
vpnncn has joined #ruby
<quazimodo>
hullo :D
ItSAN____ has quit [Quit: Leaving...]
yacks has quit [Ping timeout: 260 seconds]
Nahra has quit [Ping timeout: 260 seconds]
wchun has quit [Quit: Leaving]
angusiguess has quit [Ping timeout: 260 seconds]
<apeiros>
wasamasa: hm? what for? finitoo?
<wasamasa>
apeiros: yes, he bothered me in #lisp lately
<wasamasa>
apeiros: it's still the same guy with the bot it seems
<shevy>
haha
rocknrollmarc has joined #ruby
<shevy>
aren't you the guy who was missing that troll dude
<shevy>
who asked you to unban him
<wasamasa>
yes, I miss web2fly
<shevy>
finitoo just wants some of your love wasamasa
<wasamasa>
shevy: that's someone entirely else
cirn0 has joined #ruby
<wasamasa>
shevy: someone who does /query spam which promises you some free webcams but only links you to a goldfish webcam
dANO has joined #ruby
dANO_ has quit [Read error: Connection reset by peer]
<Pro|>
can't convert Fixnum into Array org/jruby/RubyArray.java:3067:in `+'
<Pro|>
why does this happen when i'm adding number to array
<wasamasa>
you can't do that
kdeepak has joined #ruby
TorpedoSkyline has joined #ruby
<wasamasa>
>> 1 + [2]
diegoviola has quit [Quit: WeeChat 1.0]
<eval-in_>
wasamasa => Array can't be coerced into Fixnum (TypeError) ... (https://eval.in/198476)
kdeepak has left #ruby [#ruby]
sk87 has joined #ruby
AFKGeek has quit [Quit: Leaving]
<gregf_>
>> Proc.new { |x| start, isprime = 2, true; while ( start < x ); begin; isprime=false; break; end if x %start == 0; start+=1;end; isprime }.call(5)
bigkevmcd has quit [Quit: This computer has gone to sleep]
angusiguess has joined #ruby
cocotton has joined #ruby
abdulsattar has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
britneywright has joined #ruby
mastr_bennett[x] has joined #ruby
ndrei has quit [Remote host closed the connection]
ndrei has joined #ruby
angusiguess has quit [Ping timeout: 272 seconds]
mastr_bennett[x] has quit [Client Quit]
dANO has quit [Ping timeout: 250 seconds]
yfeldblum has joined #ruby
nonmadden has quit [Remote host closed the connection]
dANO has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
nonmadden has joined #ruby
spyderman4g63 has joined #ruby
deject3d has quit [Remote host closed the connection]
govg has quit [Quit: leaving]
yeticry has joined #ruby
larissa has joined #ruby
benzrf|offline is now known as benzrf
AlexRussia has quit [Remote host closed the connection]
sk87 has joined #ruby
kate_r_ has quit [Read error: Connection reset by peer]
abuzze has quit [Remote host closed the connection]
AlexRussia has joined #ruby
kate_r has joined #ruby
yfeldblum has quit [Ping timeout: 272 seconds]
abuzze has joined #ruby
mrbubbles has quit [Quit: mrbubbles]
nonmadden has quit [Ping timeout: 260 seconds]
yeticry has quit [Ping timeout: 245 seconds]
hmsimha_ has quit [Ping timeout: 272 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chihhsin has quit [Quit: leaving]
chihhsin has joined #ruby
Xeago has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
kate_r has quit [Ping timeout: 245 seconds]
mattstratton has joined #ruby
Aaaal has quit [Quit: Aaaal]
tkuchiki has quit [Remote host closed the connection]
hellangel7 has quit [Remote host closed the connection]
yeticry has joined #ruby
Sawbones has quit [Remote host closed the connection]
<gaussblurinc1>
how to create logger with 'formatter = Logger::Formatter. object'? My loggers are created only with instance value 'formatter => Logger::SimpleFormatter object'
codeurge has quit [Quit: Sleep.]
Aaaal has joined #ruby
ndrei has quit [Ping timeout: 258 seconds]
yeticry has quit [Remote host closed the connection]
davasaurous has quit [Remote host closed the connection]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shevy>
that shows you that OSX sucks compared to linux
tkuchiki has joined #ruby
<txdv>
compared to linux everything sucks
silkfox has joined #ruby
<shevy>
however had other people could compile OSX just fine so perhaps this is specific to 2.1.3 and perhaps your hardware. do earlier ruby versions compile on that machine?
<abdulsattar>
starlord: what do you mean array VALUE?
dukz has quit [Remote host closed the connection]
<starlord>
VALUE a;
<Hanmac>
starlord: use RARRAY_LEN(a)
jeremy04 has joined #ruby
<starlord>
Is that the standard way? I thought R* functions were off-limits because they use low-level details?
ducklobster has joined #ruby
ItSANgo has joined #ruby
cocotton has quit [Remote host closed the connection]
<Hanmac>
starlord: hm no for your usecase they are perfect because they also lookout for embedded and shared arrays
<starlord>
Great.
<starlord>
Most of my unknowns are now solved!
yeticry has joined #ruby
<starlord>
Now to figure out how to get a VALUE for an implicitly passed block.
<starlord>
rb_block_given_p() works, so does rb_need_block(), but they don't give it to me.
<starlord>
Ahh, rb_block_lambda()
freerobby has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MaciejCzyzewski has joined #ruby
ndrei has quit [Ping timeout: 272 seconds]
dangerousdave has joined #ruby
<Hanmac>
hm ok i prefer block_proc, but that is nearly the same
<starlord>
What's the diff?
mark_locklear has joined #ruby
eivindml is now known as eivindml2
eivindml2 is now known as eivindml
dkam has quit [Quit: dkam]
eivindml is now known as eivindml2
cocotton has joined #ruby
<starlord>
Anyway, the actual hard part is how to deal with storing this block for later, off the stack.
ixti has joined #ruby
<starlord>
I'm not gonna mess around with rb_gc_register_address, I'm just gonna store it in a sekrit global Ruby array.
enebo has joined #ruby
slester has joined #ruby
sailias has joined #ruby
jerius has quit []
ta has quit [Remote host closed the connection]
pdoherty has joined #ruby
<Hanmac>
starlord: for my projects if you want to remove the block or what ever from the global variable i does use a hash because an array did not work (removing element from array does result in allocation ... and that is not allowed while GC'ing) so the hash does store it like { object_id => object } so i can remove the object later without hurting
<starlord>
blech
benzrf|offline is now known as benzrf
yeticry has quit [Ping timeout: 260 seconds]
Rollabunna has joined #ruby
<starlord>
I don't want to manage IDs.
subopt has quit [Remote host closed the connection]
hiyosi_ has joined #ruby
skolman has quit [Remote host closed the connection]
skolman_ has joined #ruby
<Hanmac>
i needed to do something like that because i needed to protect the objects from the GC without saving them forever ...
blackgoat has joined #ruby
subopt has joined #ruby
<starlord>
I don't see the problem with just shoving it in an array and removing it later.
Aaaal has quit [Quit: Aaaal]
<starlord>
Is GC really going to be happening while I try to remove it?
<starlord>
Anyway, rb_gc_register_address() would be simpler, but it requires a static address, which is not easy to obtain for N values.
baltazore has quit [Remote host closed the connection]
chihhsin_cloud has joined #ruby
<starlord>
I could store them in a CFMutableArrayRef I guess, but that would be so hard as to not be worthwhile.
<starlord>
Ruby's GC is so dumb.
bricker`LA has joined #ruby
<starlord>
If it weren't for Ruby being way better, I'd just be writing this thing in Lua, which has a so much nicer C API.
jheg_ has joined #ruby
davasaurous has joined #ruby
<starlord>
But alas, popularity counts for something.
skrite has joined #ruby
<skrite>
hey all
skolman_ has quit [Ping timeout: 260 seconds]
<skrite>
is it possible to start my ruby install over by just removing my ~/.rvm folder and starting over?
msmith_ has joined #ruby
<workmad3>
skrite: if you're using rvm, should be ok... but there's also 'rvm implode' I believe
hamakn has joined #ruby
oo_ has quit [Remote host closed the connection]
<workmad3>
skrite: which just destroys the ruby installs without destroying the entire rvm directory
<starlord>
skrite: just use chruby
abuzze has quit [Remote host closed the connection]
Takle has joined #ruby
<skrite>
chruby?
<starlord>
i used rvm for years
<starlord>
then i switched to rbenv and used that for years
lmickh has joined #ruby
<starlord>
a month ago i switched to chruby, and its way better than both of those
<skrite>
starlord: ok, will check it out, thanks !
<starlord>
no hacks, no shims, just easy.
vt102 has joined #ruby
<starlord>
but, it has no gemsets
Channel6 has quit [Quit: Leaving]
ruber has quit [Quit: BitchX: the ONLY bug-free client]
<starlord>
so get used to typing "bundle exec" all the time
<starlord>
which you should be doing anyway, so...
bricker`LA has quit [Ping timeout: 245 seconds]
ndrei has joined #ruby
iamjarvo has joined #ruby
davasaurous has quit [Ping timeout: 240 seconds]
danman has quit [Quit: danman]
Avahey has joined #ruby
topolinux has joined #ruby
<starlord>
oh man i wish for a stack-based api
GriffinHeart has quit [Remote host closed the connection]
<workmad3>
starlord: I go for the shell-function approach to avoid 'bundle exec' (handily provided by oh-my-zsh) ;)
<starlord>
IT FRICKEN WORKS YESSSSSS
<starlord>
<3<3<3
momomomomo has joined #ruby
<starlord>
workmad3: what
<workmad3>
starlord: basically, common ruby tools are replaced with a shell function that checks for a Gemfile in the directory hierarchy... if it finds one, it uses 'bundle exec', otherwise it uses the original command
<starlord>
Hmm, I am surprised that my struct thing stays on stack...
<starlord>
ah
<starlord>
workmad3: sounds too hackish
<starlord>
for me
<starlord>
So, I have two levels of things, and it's making this awful.
klmlfl has joined #ruby
ndrei has quit [Ping timeout: 272 seconds]
dkam has joined #ruby
<starlord>
At the ObjC level, I have a Hotkey object which owns a Block/Function object which it can call as-needed.
<starlord>
I have to wrap my ObjC Hotkey object in a Ruby Hotkey object.
<starlord>
But I also have to wrap my ObjC Block with a Ruby Block.
klmlfl has quit [Read error: No route to host]
noop has quit [Ping timeout: 258 seconds]
<starlord>
... all without changing the internals of the ObjC stuff.
klmlfl has joined #ruby
<starlord>
So, either I need to come up with a really clever solution, or deal with tons of duplicated logic on the Ruby side.
Spleeze has quit [Ping timeout: 245 seconds]
slester has quit [Quit: slester]
starkhalo has joined #ruby
last_staff has quit [Remote host closed the connection]
patrick99e99 has joined #ruby
dkam has quit [Client Quit]
<starlord>
Because right now I have to write special code for *every time* I have to wrap an ObjC object that contains {1..N} ObjC blocks
<starlord>
That just won't do.
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
abuzze has joined #ruby
blackmesa has joined #ruby
kil0byte has joined #ruby
emocakes__ has joined #ruby
relix has joined #ruby
emocakes has quit [Ping timeout: 272 seconds]
jottr has joined #ruby
<Hanmac>
yeah ... writing wrapping functions is crazy ... because of that i use macros and templates to reduce the work for me ...
last_staff has joined #ruby
timgauthier_isaw is now known as timgauthier
klmlfl has quit [Ping timeout: 244 seconds]
Spleeze has joined #ruby
<starlord>
Good idea.
icebourg has joined #ruby
zeroNones has joined #ruby
chthon has joined #ruby
bricker`LA has joined #ruby
dangerousdave has joined #ruby
Envek has joined #ruby
patrick99e99 has quit [Ping timeout: 260 seconds]
aspires has joined #ruby
slester has joined #ruby
Aaaal has joined #ruby
sichardrtallman has joined #ruby
speakingcode has joined #ruby
mikesplain has joined #ruby
Sawbones has joined #ruby
emocakes__ has quit [Ping timeout: 260 seconds]
Kricir has joined #ruby
Envek|2 has joined #ruby
silkfox has quit [Quit: WeeChat 0.4.3]
shackleford has joined #ruby
Sawbones_ has joined #ruby
hiall_ has joined #ruby
shackleford has quit [Remote host closed the connection]
hiall has quit [Ping timeout: 250 seconds]
hiall_ is now known as hiall
Envek has quit [Ping timeout: 240 seconds]
shackleford has joined #ruby
yeticry has joined #ruby
kristofferR has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
sk87 has joined #ruby
skrite has quit [Quit: WeeChat 0.4.2]
emocakes has joined #ruby
<starlord>
I'm surprised my VALUE v (where v = Data_Wrap_Struct(...)) stayed on the stack correctly in my ObjC block that captured it.
dukz has joined #ruby
<starlord>
I was sure that wasn't going to work and that I was going to have to store some special numeric ID or something.
edwardly is now known as D
D is now known as edwardly
<starlord>
Actually I probably still should, considering how hacky this is.
zeroNones has quit [Ping timeout: 272 seconds]
Sawbones has quit [Ping timeout: 272 seconds]
aspires has quit []
paulfm has quit []
aspires has joined #ruby
roolo_ has joined #ruby
<starlord>
Can you splat before a final arg in a call?
roolo has quit [Read error: Connection reset by peer]
<starlord>
So I can do: mash = ["cmd", "ctrl", "shift"]; Hotkey.new *mash, "d" do ... end
<starlord>
Right?
sichardrtallman has left #ruby [#ruby]
pu22l3r has joined #ruby
mbinder has quit [Read error: No route to host]
mbinder has joined #ruby
<jhass>
syntactically? sure
Rollabunna has quit [Read error: No route to host]
i8igmac has quit [Remote host closed the connection]
treehug88 has joined #ruby
<starlord>
Is it bad practice?
yfeldblum has quit [Ping timeout: 240 seconds]
<starlord>
I just think [...] is a bit verbose in Hotkey.new ["cmd", "shift"], "d" do ... end
<jhass>
wouldn't say so
<jhass>
though rare
<jhass>
to have another arg after the splat
MrBoolean has quit [Ping timeout: 244 seconds]
epochwolf has joined #ruby
<starlord>
oh
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Hanmac>
starlord .. depending what Hotkey wants as parameters Hotkey.new ["cmd", "shift"], "d" and Hotkey.new *["cmd", "shift"], "d" are not the same for the Hotkey class
jakolehm has quit [Remote host closed the connection]
<starlord>
Hotkey doesn't care right now what it gets.
<starlord>
Hotkey is asking Rubyists what they want to give it, and Hotkey will form what it wants based on that.
<starlord>
:)
angusigu1ss has joined #ruby
aspires has quit []
<jhass>
I think I'd like to be able to give "cmd+shift+d" as well as %w(cmd shift d) as well as "cmd", "shift", "d" :Ü
<jhass>
*:P
<starlord>
ha
<starlord>
this isnt rails
<starlord>
lets just pick one and stick with it
<starlord>
:P
Rollabunna has joined #ruby
TeresaP has joined #ruby
<Hanmac>
hm i think that one would make sense too Hotkey.new "d", ["cmd", "shift"]
soulcake has quit [Quit: Quack.]
<starlord>
it used to be that way, but it seemed backwards
<starlord>
cuz you usually say the mods before the key (ctrl-alt-delete)
<starlord>
so typing delete, ctrl, alt seems backwards
<starlord>
or what if they type "cmd-shift-d" instead?
<Hanmac>
hm ok ps i would prefer :cmd and :shift to make it showing that it not the real translated meaning ... like one might have "ctrl" but i have "strg" on the keyboard ... so symbols might have more sense
<jhass>
.split(/[+-]/)
<starlord>
see, it gets too confusing for users
<starlord>
they forget which thing they're allowed to use
<starlord>
or maybe they think this is /all/ they can use, and they dont know about the array options
buub has joined #ruby
yeticry has joined #ruby
<starlord>
too many options is bad for users who dont want to think.
<workmad3>
jhass: 'k.split('+') unless k == '+' '? ;)
<starlord>
and my users never want to think.
<starlord>
oh yeah, :cmd is fine too
<starlord>
i wrote this in lua before, which only has (immutable) strings (like python)
<jhass>
workmad3: what about ctrl++
<starlord>
but yeah, syms work better here
<workmad3>
jhass: ah, good point
ppinto has joined #ruby
<starlord>
ok we're all agreed you cant use this friggen syntax if you have punct keys, deal?
seanosaur has joined #ruby
<starlord>
in that case you have to use [:cmd, :opt], "d"
<starlord>
i would use constants instead, but thats not any clearer really, and its longer
<banister>
Hanmac what do u think of this quote? "The Germans have an inhuman way of cutting up their verbs. Now a verb has a hard time enough of it in this world when it's all together. It's downright inhuman to split it up. But that's just what those Germans do. They take part of a verb and put it down here, like a stake, and they take the other part of it and put it away over yonder like another stake, and between these two limits they just
<banister>
shovel in German."
<starlord>
[Hotkey::Cmd, Hotkey::Ctrl]
<starlord>
lol
emocakes has quit []
seanosaur has quit []
angusigu1ss has quit [Ping timeout: 240 seconds]
Takle has quit [Read error: Connection reset by peer]
<jhass>
and super! don't take me my super with your pesky cmd keys
<bhaak>
banister: ha. you are right. but doesn't sound quite like him. I prefer the one with jumping into the atlantic and coming up on the other side with the verb.
RandyT has quit [Ping timeout: 244 seconds]
milkohol has joined #ruby
<starlord>
oh yeah
<starlord>
super too
<starlord>
and 'option'
<starlord>
etc
Sawbones_ has quit []
<starlord>
okay this is what im going with: Hotkey.new :cmd, :alt, "d" do ... end
<starlord>
brb using (transpose ...) a lot
IceDragon has joined #ruby
momomomomo has quit [Ping timeout: 244 seconds]
fgo has quit []
geggam has joined #ruby
yeticry has quit [Ping timeout: 260 seconds]
skolman_ has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kil0byte has quit [Remote host closed the connection]
momomomomo has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Advocation has joined #ruby
<Hanmac>
starlord: hm what about Alt-Gr ? ;P
mijicd has joined #ruby
<starlord>
wat
<Hanmac>
the Right Alt Key does have diffent meaning than the left Alt key
mijicd has quit [Remote host closed the connection]
freerobby has joined #ruby
<starlord>
not here.
<Hanmac>
on my keyboard layout its called "Alt-Gr"
<starlord>
sorry, not my limitation, osx's
abuzze has quit [Remote host closed the connection]
kil0byte has joined #ruby
ohcibi has quit [Quit: No Ping reply in 180 seconds.]
ohcibi has joined #ruby
joast has quit [Quit: Leaving.]
lmickh has quit [Remote host closed the connection]
hellangel7 has joined #ruby
hellangel7 has quit [Max SendQ exceeded]
mijicd has joined #ruby
abuzze has joined #ruby
jottr has joined #ruby
Pumukel has quit [Ping timeout: 272 seconds]
fsapo has quit [Ping timeout: 244 seconds]
Bish has quit [Ping timeout: 260 seconds]
gsd has joined #ruby
ursooperduper has joined #ruby
mkaesz has joined #ruby
Bish has joined #ruby
Trynemjoel has quit [Ping timeout: 245 seconds]
cajone has joined #ruby
<starlord>
any of you suckers use osx?
Trynemjoel has joined #ruby
<DefV>
wow
abuzze has quit [Ping timeout: 260 seconds]
<DefV>
you really know how to ask a q
<starlord>
<3
abdulsattar has quit [Ping timeout: 272 seconds]
<DefV>
but this sucker does
<starlord>
did you buy Dash.app or Sublime Text or anything?
dangerousdave has joined #ruby
<starlord>
did you by the latest iPhone too?
<DefV>
no
<cajone>
guys is there an elegant way of turning a string array into a hash, say I have a = %w(car transport bus transport fridge appliance) and i'm looking for car => transport etc ?
jottr has quit [Ping timeout: 245 seconds]
<jhass>
cajone: recent ruby #to_h, not so recent ruby Hash[]
aspires has joined #ruby
<starlord>
>> %{a b c d}.split(' ').to_h
<eval-in_>
starlord => wrong element type String at 0 (expected array) (TypeError) ... (https://eval.in/198541)
<eval-in_>
starlord => /tmp/execpad-afb7c2bf2c0e/source-afb7c2bf2c0e:2: warning: wrong element type String at 0 (expected array) ... (https://eval.in/198543)
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
starlord: no, eval-in is for demo purposes only, not for figuring stuff out, that's what your local irb/pry is for
<jhass>
these 900 people here are not interested in your experiments
centrx has joined #ruby
kil0byte has quit [Remote host closed the connection]
az has quit [Quit: WeeChat 0.4.2]
<starlord>
890 of them just forgot that they have irssi running on a slicehost box somewhere and will never come back
oponder has quit [Remote host closed the connection]
gsd has joined #ruby
<starlord>
the other 10 can help me figure out what im doing wrong.. like you did ;)
oponder has joined #ruby
oponder has quit [Remote host closed the connection]
az has joined #ruby
cym has quit [Ping timeout: 272 seconds]
Spami has joined #ruby
<jhass>
okay, warned you
<jhass>
op will be around soon enough
mary5030 has joined #ruby
momomomomo has joined #ruby
mityaz has quit [Quit: Leaving]
<tobiasvl>
what a nice response starlord
snath has joined #ruby
<starlord>
<3
apeiros_ is now known as apeiros
<starlord>
yall so nice
klmlfl has joined #ruby
St_Marx has quit [Remote host closed the connection]
<starlord>
jhass: why so serious?
bal has quit [Quit: bal]
<starlord>
lifes too short bruh
<jhass>
why so ignorant?
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arturhoo has joined #ruby
<starlord>
am i really?
<starlord>
my response is legit
<momomomomo>
you both cool it, ruby is serious business
St_Marx has joined #ruby
<starlord>
While I could have just used irb on my local machine to figure out the solution, nobody in here would have been able to benefit from my trials/errors.
<momomomomo>
lol were you using >> a lot?
<momomomomo>
don’t do that :P
<momomomomo>
use it for examples
<momomomomo>
>> p ‘like this’
<starlord>
By using eval-in_ to test it, someone brought up several of my mistakes.
<starlord>
Passers-by may have learned from those teaching opportunities.
<jhass>
starlord: not to offend you, but those trials are very basic, those 10 persons you claim to listen learned nothing from them
endash has joined #ruby
abuzze has joined #ruby
<momomomomo>
both of you, shh
<momomomomo>
starlord: respect the channel, and don’t spam
mijicd has quit [Quit: leaving]
<jhass>
starlord: we would have pointed them out in your final suggestion too
<momomomomo>
^
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<starlord>
jhass: Look I'm just waxing philosophical because you accused me of being ignorant, and I ain't got no time for lack of respect.
starlord has quit [Quit: Leaving...]
kil0byte has joined #ruby
<jhass>
kthx, bai
klmlfl has quit [Ping timeout: 250 seconds]
<cajone>
so .. Hash[*w{a b c d}] is definitive? :{, jhass you mentioned .to_h
<jhass>
cajone: it's the most portable one
<momomomomo>
>> puts “hello"
<jhass>
.to_h is fairly new
<momomomomo>
what happened to you eval
abdulsattar has joined #ruby
<centrx>
>> you used to be cool
<eval-in_>
centrx => undefined local variable or method `cool' for main:Object (NameError) ... (https://eval.in/198554)
<centrx>
figures
<jhass>
it has its hiccups recently
kate_r has joined #ruby
<momomomomo>
looool
<momomomomo>
>> poop
<eval-in_>
momomomomo => undefined local variable or method `poop' for main:Object (NameError) ... (https://eval.in/198555)
<jhass>
>> "☃"
<jhass>
^ no more utf-8
<momomomomo>
~_~
IceDragon has quit [Ping timeout: 272 seconds]
joast has joined #ruby
aledovsky has quit [Read error: Connection reset by peer]
<Hanmac>
charliesome: didnt fixed the utf8 problem yet ...
joast has quit [Client Quit]
aledovsky_ has joined #ruby
aledovsky_ is now known as aledovsky
Takle has quit [Remote host closed the connection]
IceDragon has joined #ruby
LekeFly_ has joined #ruby
hiall_ has joined #ruby
hiall has quit [Ping timeout: 250 seconds]
hiall_ is now known as hiall
cocotton has quit [Remote host closed the connection]
LekeFly has quit [Ping timeout: 245 seconds]
TeresaP has joined #ruby
cocotton has joined #ruby
starlord has joined #ruby
LekeFly_ has quit [Client Quit]
gregf has quit [Quit: WeeChat 1.0]
yfeldblum has joined #ruby
axsuul has joined #ruby
larissa has quit [Quit: Leaving]
rkalfane has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yeticry has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
rkalfane has quit [Client Quit]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
gauke has quit [Quit: gauke]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
spacemud has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Ping timeout: 246 seconds]
kaspergrubbe_ has quit [Ping timeout: 245 seconds]
<mikecmpbll>
from reading a little about SAX XML parsing it seems as though it's not appropriate for all XML structures
axsuul has quit [Read error: Connection reset by peer]
<mikecmpbll>
would this be the case?
IceDragon has quit [Ping timeout: 260 seconds]
jottr has joined #ruby
<mikecmpbll>
because of it's sequential nature, if i had <User><ID>1</ID><LinkedUserID>2</LinkedUserID></User><User><ID>2</ID><LinkedUserID>1</LinkedUserID></User>
<mikecmpbll>
that might be bad XML design, but never the less if i was parsing users in to objects i wouldn't be able to parse the association between from user 1 to user 2?
mattstratton has quit [Ping timeout: 272 seconds]
mattstratton has joined #ruby
rkalfane has joined #ruby
IceDragon has joined #ruby
snorkra_ has quit [Ping timeout: 245 seconds]
ixti has quit [Ping timeout: 260 seconds]
Jarboe has joined #ruby
Fire-Dragon-DoL has joined #ruby
spacemud has joined #ruby
last_staff has quit [Read error: No route to host]
starlord has quit [Quit: Leaving...]
wpp has quit [Quit: ZZZzzz…]
axsuul has joined #ruby
hiall has quit [Ping timeout: 272 seconds]
axsuul has quit [Max SendQ exceeded]
zeroNones has joined #ruby
axsuul has joined #ruby
cornfeedhobo has joined #ruby
mbinder has quit [Quit: Leaving...]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
Alina-malina has quit [Ping timeout: 260 seconds]
kireevco has joined #ruby
mordocai has joined #ruby
<cornfeedhobo>
howdy. i have a string with a literal \n (because it is bash output grabbed with ``), and i want to split() on that, but when i do split('\n'), it just turns the string into an array, thinking that i want to split on newlines. is there *any* way to be literal?
kobain has joined #ruby
kobain_ has joined #ruby
kobain_ has quit [Client Quit]
<canton7>
cornfeedhobo, escape the \ with another \
<mikecmpbll>
\\n
<mikecmpbll>
indeed.
cirn0 has joined #ruby
angusigu1ss has joined #ruby
<cornfeedhobo>
fml
<cornfeedhobo>
i thought i tried that
<cornfeedhobo>
ya, no luck
apeiros has quit [Remote host closed the connection]
nouranology has quit [Quit: ChatZilla 0.9.90.1 [Firefox 32.0.3/20140924083558]]
<canton7>
what isn't?
<Hanmac>
cornfeedhobo: hm you can also look at output.lines and see what does return
<cornfeedhobo>
canton7: because our outputs dont match up :p
Jarboe has joined #ruby
<canton7>
cornfeedhobo, you're using \\n, I'm using \n
<mikecmpbll>
cornfeedhobo: yes the do
<mikecmpbll>
they*
<mikecmpbll>
look at output.inspect.
xenomorph is now known as {xenomorph}
aganov has quit [Quit: Leaving]
HelperW_ has quit [Ping timeout: 245 seconds]
<mikecmpbll>
ack
<mikecmpbll>
ignore me
starlord has joined #ruby
<cornfeedhobo>
mikecmpbll: yeah, but then why does the exact same commands not produce the same output :(
arup_r has joined #ruby
<cornfeedhobo>
ah
<cornfeedhobo>
k
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
{xenomorph} is now known as xenomorph
gsd has joined #ruby
<starlord>
the way i solved this before was just writing a single implementation and tightly coupling the scripting language wrapper to the underlying code, so that it wasnt really a wrapper anymore, it was the actual code.
<cornfeedhobo>
Hanmac: updated
HelperW__ has quit [Ping timeout: 260 seconds]
<starlord>
maybe i should do that again with ruby.
<mikecmpbll>
cornfeedhobo: your `output`, contains new lines
<starlord>
but theres something to be said for writing code once and never having to change it again.
<mikecmpbll>
not "\\n"
<Hanmac>
cornfeedhobo: ok lines.to_a ?
<mikecmpbll>
so your original question is wrong, what are you trying to do?
carraroj has quit [Ping timeout: 240 seconds]
joast has joined #ruby
<mikecmpbll>
cornfeedhobo: the reason your split on new line wasn't working, was because you were using single quotes
<mikecmpbll>
so what you really want, is output.split("\n")
<starlord>
how would you do it?
yakko has quit [Read error: Connection reset by peer]
<cornfeedhobo>
okay, updated with what i think is everything everyone has suggested
<canton7>
mikecmpbll, that's not what he wants
<mikecmpbll>
canton7: what does he want?
<canton7>
he doesn't want to split on a literla newline (I think?)
<mikecmpbll>
he does
<canton7>
he wants to split on a literal '\n'
<mikecmpbll>
he doens't have a literal \n in his string
* mikecmpbll
bashes head
<mikecmpbll>
:p
rkalfane has joined #ruby
<cornfeedhobo>
this turned a bit into learning about ruby, but my goal is to eventually create a hash (map?) of username => homedir
yakko has joined #ruby
<cornfeedhobo>
that way i can iterate it easily later in puppet
ndrei has quit [Ping timeout: 260 seconds]
emmesswhy has joined #ruby
charliesome has quit [Quit: zzz]
ndrei has joined #ruby
<canton7>
mikecmpbll, line 8 makes it look like he does?
<mikecmpbll>
that's because it's an inspect
<cornfeedhobo>
i was just using awk to print space deliminated user/dir pairs, and then thought i could split on ' ' and '\n'
<canton7>
mikecmpbll, yes. inspect shows a newline as \n and a literal \n as \\n
<mikecmpbll>
no it doesn't
hamakn has quit [Remote host closed the connection]
<mikecmpbll>
pardon me, it does
<mikecmpbll>
but its IRB so it's double inspected
<mikecmpbll>
if you write `output` he'll get the inspected version printed.
<cornfeedhobo>
^^
<canton7>
aha, that's what I hadn't appreciated
<canton7>
yes, true
kireevco has quit [Ping timeout: 260 seconds]
MrBoolean has joined #ruby
<Hanmac>
cornfeedhobo: oh a hash, that means everything more interesting and also more easy:
timonv_ has quit [Remote host closed the connection]
terlar has quit [Ping timeout: 244 seconds]
<cornfeedhobo>
yeah, works like a charm
mordocai has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
timonv_ has joined #ruby
<cornfeedhobo>
thanks, everyone, i really appreciate the help this morning!
yakko has joined #ruby
iinzg has quit [Ping timeout: 260 seconds]
codeurge has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
lkba has quit [Ping timeout: 240 seconds]
patrick99e99 has quit [Ping timeout: 250 seconds]
ndrei has quit [Ping timeout: 250 seconds]
ndrei has joined #ruby
kireevco has joined #ruby
AFKGeek has quit [Quit: Leaving]
skammer has quit [Ping timeout: 260 seconds]
stunder has quit [Quit: Screw you guys I'm going home]
jcdesimp has joined #ruby
timonv_ has quit [Ping timeout: 246 seconds]
jottr has quit [Ping timeout: 244 seconds]
buub has quit [Read error: Connection reset by peer]
foooobear__ has joined #ruby
buub has joined #ruby
klmlfl has joined #ruby
foooobear_ has quit [Ping timeout: 245 seconds]
Alina-malina has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
sdwrage_ has quit [Quit: This computer has gone to sleep]
sdwrage has quit [Quit: This computer has gone to sleep]
seanosaur has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 240 seconds]
seanosaur has joined #ruby
sdwrage has joined #ruby
yakko has quit [Read error: Connection reset by peer]
sdwrage_ has joined #ruby
kate_r has joined #ruby
yakko has joined #ruby
alex88 has quit [Quit: Leaving...]
apeiros has joined #ruby
cocotton has quit [Remote host closed the connection]
dangerousdave has joined #ruby
ndrei has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ghostmoth has joined #ruby
klmlfl has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby
seanosaur has quit [Remote host closed the connection]
klmlfl has joined #ruby
klmlfl has quit [Remote host closed the connection]
dorei has joined #ruby
Igneous has joined #ruby
klmlfl has joined #ruby
Takle has quit [Remote host closed the connection]
hamakn has joined #ruby
ursooperduper has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<timgauthier>
shevy you here?
Avahey has quit [Quit: Connection closed for inactivity]
kireevco has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 258 seconds]
joonty has quit [Quit: Leaving]
tylersmith has joined #ruby
chihhsin_cloud has quit [Quit: Connection closed for inactivity]
<starlord>
what is it with yall and regexps
cocotton has joined #ruby
<Igneous>
if I wanted to dynamically retrieve a value from a hash of hashes, what would be an efficient way of doing that? I'm taking a string from the user for accessing the value in the hash like "app.nodegroup", and am expecting it to get the value of hash['app']['nodegroup']
MaciejCzyzewski has joined #ruby
JohnBat26 has joined #ruby
klmlfl has quit [Remote host closed the connection]
spyderman4g63 has quit [Remote host closed the connection]
<Igneous>
I'm sure I could build something with eval, but I have a feeling that's not the 'right' way
<starlord>
yxhuvud: because if i write ruby code, then anyone can read it by inspecting my app's binary
<starlord>
yxhuvud: ruby code is just ascii text, thus anyone can see it
<e^ipi>
RFC 3986
<yxhuvud>
well, they could read your public interface exposed in your .h file, yes.
rippa has joined #ruby
<jhass>
e^ipi: the process is standard and what's allowed unescaped is standard, not what to escape or not
<starlord>
i so vastly prefer lua's c api to ruby's :'(
<starlord>
but lua is so horribly unpopular and batteries-not-included as to be useless
sdwrage_ has joined #ruby
sdwrage has joined #ruby
fsapo has joined #ruby
niklasb has joined #ruby
Sharker has quit [Ping timeout: 264 seconds]
axsuul has quit [Read error: No route to host]
chthon has quit [Ping timeout: 272 seconds]
axsuul has joined #ruby
Sharker has joined #ruby
<Hanmac>
starlord if its because of that some part of your C code can be seen with investigate the compiled lib too
skammer has joined #ruby
<starlord>
Hanmac: meh, thats way harder
<starlord>
Hanmac: i dont care about that. i just dont want to write it all in plaintext ruby.
p0sixpscl has quit [Quit: bye]
aspires has quit []
dc__ has joined #ruby
<Hanmac>
starlord: and will you ship it as gem? because then you might need to precompile it (normally gems have C code that is installed while runtime)
<starlord>
no
<Hanmac>
noo ... i mean its compiled as install time
jcdesimp has joined #ruby
<starlord>
im shipping an .app
roolo_ has quit [Remote host closed the connection]
MaciejCzyzewski has joined #ruby
<starlord>
it has no external dependencies, it is a self contained osx app
<starlord>
it links against Ruby.framework
<Hanmac>
ahh ok
maestrojed has joined #ruby
<starlord>
right
roolo has joined #ruby
<Hanmac>
its long time ago since i worked with OSX ...
gmas has quit [Ping timeout: 260 seconds]
IceDragon_ has joined #ruby
IceDragon has quit [Ping timeout: 272 seconds]
a13x212 has joined #ruby
icarus has joined #ruby
arup_r has quit [Quit: Leaving.]
<starlord>
oh nice, it works: Core::Hotkey.new(:cmd, :shift, "d") { p :hi }.enable
IceDragon_ is now known as IceDragon
dukz has joined #ruby
hiall has quit [Ping timeout: 260 seconds]
arup_r has joined #ruby
mocfive has quit [Remote host closed the connection]
pen has joined #ruby
moritzschaefer has quit [Ping timeout: 244 seconds]
mocfive has joined #ruby
<Hanmac>
starlord: sugestion: make that enable as optional keyparameter or similar like Core::Hotkey.new(:cmd, :shift, "d", :enable => true) { p :hi } .... hm i need to investigate whats the best way to write that in C-API
gmas has joined #ruby
roolo has quit [Ping timeout: 260 seconds]
<starlord>
well thats longhand
xcv has joined #ruby
thumpba has quit [Remote host closed the connection]
<starlord>
shorthand is Core::Hotkey.bind(:cmd, :shift, "d") { p :hi }
blackmesa has joined #ruby
<wasamasa>
starlord: I suggest using licenses and lawyers to protect against the threats plain-text sources give your commercial software
<starlord>
its short for .new + #enable
<starlord>
wasamasa: meh
mikepack has joined #ruby
<starlord>
wasamasa: theres no compelling reason to write any of this in ruby
<wasamasa>
starlord: works pretty well for all major players
<starlord>
plus FFI gem is not guaranteed to work with objc blocks
<starlord>
or objc classes, etc
ki0 has quit [Ping timeout: 272 seconds]
yakko has quit [Read error: Connection reset by peer]
<starlord>
wasamasa: plus im not a major player and cant afford lawyers
Advocation has joined #ruby
<wasamasa>
so you afford the next-best thing
Takle has joined #ruby
<wasamasa>
wasting time
* centrx
heats up the popcorn
<starlord>
lol
yfeldblum has joined #ruby
yakko has joined #ruby
<starlord>
Data_Make_Struct is weird
<starlord>
i mean, i get why it works the way it does... just, weird.
yakko has quit [Read error: Connection reset by peer]
<starlord>
hmm, i wonder how i should allow for a key-released lambda... you cant pass two blocks to a single method call, so ill have to take an optional last lambda arg or something
cocotton has quit [Remote host closed the connection]
<jhass>
or a DSL: Hotkey.bind(...) do |key| key.on_press { } key.on_release { } end
pen has joined #ruby
mocfive has joined #ruby
kate_r has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
pandaant has joined #ruby
cocotton has quit [Remote host closed the connection]
<starlord>
i dunno, thats borderline overcomplicated
<starlord>
i think my users would be like "wtf no"
soulcake has quit [Ping timeout: 260 seconds]
<starlord>
its rare that they want a hotkey-up event, they usually just want hotkey-down
nanoyak has joined #ruby
<starlord>
so ill make it be another method, like "hotkey.onkeyup do ... end"
boombadaroomba has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
<starlord>
er, on_release is nicer
<starlord>
i wonder what rb_proc_exec does
tonybird has joined #ruby
nanoyak has quit [Read error: Connection reset by peer]
benzrf is now known as benzrf|offline
kapowaz_ is now known as kapowaz
tonybird has quit [Max SendQ exceeded]
klmlfl has quit [Ping timeout: 272 seconds]
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nanoyak has joined #ruby
himsin has joined #ruby
IceDragon has quit [Ping timeout: 272 seconds]
dANO_ has quit []
IceDragon has joined #ruby
toretore has quit [Ping timeout: 244 seconds]
cocotton has joined #ruby
seanosaur has joined #ruby
troyready has joined #ruby
jeremy04 has joined #ruby
wallerdev has joined #ruby
<starlord>
oh wow, i bet it's literally just a way of doing exec() in a ruby proc
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soulcake has joined #ruby
pen has quit [Read error: Connection reset by peer]
poguez_ has quit [Quit: Connection closed for inactivity]
ndrei has quit [Ping timeout: 258 seconds]
pen has joined #ruby
spyderman4g63 has joined #ruby
soulcake has quit [Client Quit]
skammer has quit [Read error: Connection reset by peer]
SCHAAP137 has joined #ruby
ndrei has joined #ruby
dc__ has quit [Remote host closed the connection]
skammer has joined #ruby
soulcake has joined #ruby
<starlord>
How do you call a proc and/or lambda safely and be able to know whether it had an exception without giving it a back-up VALUE to call in case of exception?
dohsan has joined #ruby
benzrf|offline is now known as benzrf
baltazore has joined #ruby
klmlfl has joined #ruby
klmlfl has quit [Remote host closed the connection]
elstif has quit [Quit: Leaving.]
sepp2k has quit [Quit: Konversation terminated!]
choke has quit [Read error: Connection reset by peer]
hooper has joined #ruby
wldcordeiro_ has joined #ruby
lkba has joined #ruby
Ankhers has quit [Remote host closed the connection]
o2q has quit [Ping timeout: 240 seconds]
yakko has quit [Read error: Connection reset by peer]
bigkevmcd has quit [Quit: This computer has gone to sleep]
niklasb has quit [Ping timeout: 246 seconds]
niklasb_ has joined #ruby
Ankhers has joined #ruby
ndrei has quit [Ping timeout: 258 seconds]
pen has quit [Quit: Leaving]
yakko has joined #ruby
pen has joined #ruby
pen has quit [Read error: Connection reset by peer]
fennec has quit [Ping timeout: 244 seconds]
<soahccc>
starlord: what do you mean? you can just wrap the block call in a begin..end
<soahccc>
and rescue of course :)
ptrrr has quit [Quit: ptrrr]
<starlord>
I'm using the C API.
lowandslow has joined #ruby
<starlord>
I'm given a block to a method, and I save it for later, and I want to call it, and know if it had an exception (without crashing the whole app).
Tricon has quit [Quit: Leaving...]
<soahccc>
no idea about the C API but where do you want to know if it had an exception? Where you saved it or where you called it?
workmad3 has quit [Ping timeout: 250 seconds]
emocakes has joined #ruby
Takle has quit [Remote host closed the connection]
starlord has quit [Quit: Leaving...]
ki0 has joined #ruby
fennec has joined #ruby
fennec has quit [Changing host]
fennec has joined #ruby
eivindml2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
m8 has joined #ruby
anarang has joined #ruby
BTRE has quit [Quit: Leaving]
swartwulf has quit [Remote host closed the connection]
krisquigley has joined #ruby
starlord has joined #ruby
pen has joined #ruby
zorak8 has joined #ruby
BTRE has joined #ruby
wjimenez5271 has joined #ruby
klmlfl has joined #ruby
pen has quit [Read error: Connection reset by peer]
<starlord>
I'm given a block which I store as a VALUE and want to call later in C, but making sure to handle failure correctly.
abdulsattar has quit [Ping timeout: 260 seconds]
MaciejCzyzewski has joined #ruby
yxhuvud has quit [Remote host closed the connection]
magic is now known as Guest26178
Guest26178 has quit [Killed (morgan.freenode.net (Nickname regained by services))]
klmlfl has quit [Remote host closed the connection]
<starlord>
I can do rb_funcall(blk, rb_intern("call"), 0); but then if it has an exception, the whole program crashes.
emocakes has quit [Ping timeout: 260 seconds]
mferrier has joined #ruby
klmlfl has joined #ruby
<starlord>
Same with rb_proc_call(blk, Qnil);
wldcordeiro_ has quit [Ping timeout: 272 seconds]
yakko has quit [Read error: Connection reset by peer]
ursooperduper has joined #ruby
angusigu1ss has joined #ruby
thumpba has joined #ruby
yakko has joined #ruby
cirn0 has joined #ruby
ki0 has quit [Remote host closed the connection]
gmas has quit [Ping timeout: 260 seconds]
swartwulf has joined #ruby
krisquigley has quit [Ping timeout: 272 seconds]
bMalum has joined #ruby
<starlord>
er, rb_ary_new() as the last arg
Tricon has joined #ruby
cocotton_ has joined #ruby
teddyp1cker has joined #ruby
JohnBat26 has quit [Ping timeout: 260 seconds]
xcv has quit [Remote host closed the connection]
<starlord>
I can't use rb_rescue since it's not a C function.
xcv has joined #ruby
HelperW__ has quit [Quit: Computer has gone to sleep.]
AlSquirrel has quit [Quit: This computer has gone to sleep]
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HelperW__ has joined #ruby
angusigu1ss has quit [Ping timeout: 260 seconds]
cirn0 has quit [Ping timeout: 240 seconds]
oponder has joined #ruby
thumpba_ has joined #ruby
thumpba has quit [Read error: Connection reset by peer]
rocknrollmarc has quit [Quit: My damn controlling terminal disappeared!]
timonv_ has joined #ruby
Advocation has quit [Quit: Advocation]
kireevco has joined #ruby
<starlord>
What? No.
<starlord>
I'm using Ruby's C API.
skammer has quit [Ping timeout: 245 seconds]
michaeldeol has joined #ruby
ptrrr has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jle` has quit [Ping timeout: 272 seconds]
Trynemjoel has quit [Quit: Trynemjoel]
beneggett has joined #ruby
omosoj has quit [Ping timeout: 260 seconds]
yfeldblum has joined #ruby
xenomorph is now known as {xenomorph}
<apeiros>
starlord: he means because you claimed rb_rescue was not a C function
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<starlord>
Oh.
<starlord>
I mean I have a VALUE that I obtained via rb_block_lambda() or rb_block_proc();
omosoj has joined #ruby
<starlord>
And I want to call that VALUE itself.
cndiv has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
britneywright has joined #ruby
benzrf is now known as benzrf|offline
altamic has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
altamic has quit [Changing host]
altamic has joined #ruby
davasaurous has joined #ruby
Stalkr_ has quit [Quit: Leaving...]
<starlord>
yay 4300 github stars even
Trynemjoel has joined #ruby
<starlord>
my ocd is now happy
klmlfl_ has joined #ruby
pdoherty has quit [Quit: pdoherty]
<mferrier>
you truly are the lord of stars
davasaurous has quit [Ping timeout: 260 seconds]
ta has joined #ruby
freerobby has quit [Quit: Leaving.]
Hobogrammer has joined #ruby
freerobby has joined #ruby
benzrf|offline is now known as benzrf
topolinux has quit [Quit: Sto andando via]
Aaaal has quit [Quit: Aaaal]
boombadaroomba has quit [Remote host closed the connection]
klmlfl_ has quit [Ping timeout: 258 seconds]
atmosx has joined #ruby
mikecmpbll has joined #ruby
<starlord>
ha
<starlord>
well played sir
lewix has joined #ruby
lewix has quit [Changing host]
lewix has joined #ruby
xcv_ has joined #ruby
Xeago has joined #ruby
jeremy04 has quit [Ping timeout: 250 seconds]
mikeg has joined #ruby
ndrei has joined #ruby
paulfm has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
pdoherty has joined #ruby
paulfm has quit [Remote host closed the connection]
paulfm has joined #ruby
xcv has quit [Ping timeout: 245 seconds]
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
zerowaitstate has joined #ruby
toretore has joined #ruby
lewix has quit [Read error: Connection reset by peer]
dx7 has joined #ruby
thumpba_ has quit []
thumpba has joined #ruby
reset has joined #ruby
xcv_ has quit [Remote host closed the connection]
blackmesa has joined #ruby
agjacome has quit [Quit: leaving]
pskosinski has joined #ruby
<patrick99e99>
Hi everyone... Does anyone here know what the best way to set the current time zone for testing purposes in irb (or rails console) ?
SilkFox_ has quit [Ping timeout: 272 seconds]
yetanotherdave has joined #ruby
pushnell has quit [Quit: pushnell]
jbueza has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
Time.now.zone I guess?
<patrick99e99>
I thought I could just do ENV['TZ'] = ... but, for some bogus reason, if I set it to ENV['TZ'] = 'EST", then I see the correct offset-- but if I do 'PDT', 'PST', 'CST', 'CDT' it all results in UTC and the timezone gets lost
<patrick99e99>
Time.now.zone gives me my current time zone..
<jhass>
or read a get there :P
<patrick99e99>
I want to set it to something else so that I can see the correct offsets in the time.0
<patrick99e99>
"or read a get there" ? what does that mean?
axl_ has joined #ruby
Trynemjoel has quit [Quit: Trynemjoel]
Cheezebox has joined #ruby
<jhass>
it means I should stop typing. s/or/oh,/
MaciejCzyzewski has joined #ruby
mofai has joined #ruby
doodlehaus has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
jeremy04 has joined #ruby
<jhass>
anyway, man timezone has a description of valid values for TZ
yakko has quit [Read error: Connection reset by peer]
gsd has joined #ruby
yakko has joined #ruby
<starlord>
so uh yeah
<starlord>
ill figure this out on my own
starlord has quit [Quit: Leaving...]
tessi_zz has quit [Ping timeout: 272 seconds]
<patrick99e99>
timezones are so annoying.. so you can apparently do Time.zone = 0 -> 13... but none of those values are UTC, PST, they are things like "Casablanca", "Amsterdam", etc
timgauthier_isaw has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 272 seconds]
<Fractional>
Question regarding SRP. Lets say I have a class called 'Map'. I need to randomly build/generate this map. Should I divide this task into a MapBuilder class which gets called from the PersonalIdentifier constructor?
dumdedum has quit [Quit: foo]
<Hanmac>
yes
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elaptics is now known as elaptics`away
kaspertidemann has joined #ruby
<Fractional>
So for instance:
<Fractional>
class Map; def initialize; @map = MapBuilder.build; end; end?
axsuul has quit [Read error: No route to host]
<Hanmac>
hm yes and no ... imo Map should be indipent from MapBuilder because you might want to have a map that is not generated ...
<apeiros>
IMO both are valid choices. if map building is complex, I'd probably opt for the builder.
musicmatze has joined #ruby
<apeiros>
but also IMO you shouldn't put the builder into initialize
<Hanmac>
imo MapBuilder.build {|b| ... } #=> new Map instance
<Fractional>
So am I thinking right or am I on the wrong track?
carraroj has quit [Quit: Konversation terminated!]
dc__ has joined #ruby
<Fractional>
Oh, that makes perfect sense. Thank you Apeiros! :)
HelperW___ has quit [Ping timeout: 260 seconds]
agjacome has joined #ruby
dotrb has joined #ruby
<dotrb>
hey ruby hackers
<apeiros>
hey random person
<dotrb>
I'm new to programming and learning ruby as my first language
robustus has quit [Ping timeout: 250 seconds]
<dotrb>
as much as I'm enjoying it, I can't yet decide on which text editor to go with
<dotrb>
for ruby/general programming
<dotrb>
html/css etc.
<dotrb>
what do you guys use??
<waxjar>
vim, emacs and sublime text are the popular ones
<apeiros>
dotrb: ^
<Hanmac>
dotrb: do you want an IDE or a simple editor?
<apeiros>
waxjar beat me to it
* apeiros
prefers sublime
zoo-zed has joined #ruby
<canton7>
sublime text here
* waxjar
too
dukz has quit [Remote host closed the connection]
<Fractional>
sublime text here
<dotrb>
Hanmac: what's the difference??
carraroj has joined #ruby
end_guy has quit [Remote host closed the connection]
<apeiros>
dotrb: one is huge and offers lots of functionality but has usually a rather big learning curve, the other is focused, doesn't have that much functionality and can be used easily
tjr9898_ has joined #ruby
<Hanmac>
dotrb: a simple editor like gedit does not have project features like a IDE ... and IDE like eclipse does have that ones like version control, TestSuits, build tasks ... etc
<dotrb>
in which category does vim/emacs/sublime fall?
lolmaus has joined #ruby
FracV has quit [Remote host closed the connection]
spyderman4g63 has quit [Remote host closed the connection]
<waxjar>
they are text editors
<dotrb>
all of them?
<waxjar>
but they all offer plugins
kenneth has joined #ruby
<waxjar>
yes
<dotrb>
okay
<boombadaroomba>
i use aptana studio 3
<boombadaroomba>
because i am a noob
spyderman4g63 has joined #ruby
klmlfl_ has joined #ruby
EminenceHC has quit [Remote host closed the connection]
gmas has quit [Ping timeout: 245 seconds]
tjr9898 has quit [Ping timeout: 272 seconds]
* wmoxam
uses Atom
robustus has joined #ruby
cndiv has joined #ruby
<canton7>
is aptana still going? I used that years ago for php dev
govg has quit [Quit: leaving]
<dotrb>
all right, looks like the popular opinion is inclining towards sublime text
<dotrb>
i'll check it
<dotrb>
thanks everyone
mferrier has quit []
dotrb has left #ruby [#ruby]
kate_r has joined #ruby
mferrier has joined #ruby
end_guy has joined #ruby
seamon has joined #ruby
duncannz has joined #ruby
seamon has quit [Client Quit]
<Fractional>
apeiros, if I don't need the constructor to take any arguments for Builder.new (Map.build(*args) --> Map::Builder.new(*args).to_map). Would it be 'better' to write: Map::generate(*args)?
havenwood has joined #ruby
JBreit has joined #ruby
<Fractional>
Or is it prefered going through an object?
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
kireevco has joined #ruby
<apeiros>
Fractional: I don't follow
cocotton has joined #ruby
klmlfl_ has quit [Ping timeout: 250 seconds]
claymore has quit [Quit: Leaving]
spyderman4g63 has quit [Ping timeout: 260 seconds]
<Fractional>
apeiros, nevermind. Sorry :P
JBreit has left #ruby [#ruby]
cocotton has quit [Remote host closed the connection]
Trynemjoel has joined #ruby
pen has joined #ruby
vhyg has joined #ruby
jakolehm has quit [Remote host closed the connection]
diegoviola has quit [Read error: Connection reset by peer]
vhyg has quit [Client Quit]
finitoo has quit [K-Lined]
MaciejCzyzewski has joined #ruby
wjimenez_ has joined #ruby
LiohAu has quit [Quit: LiohAu]
Xeago has joined #ruby
<Fractional>
apeiros, Map::Builder.new.build(width, height, water_percent). Does this look alright?
<apeiros>
Fractional: no. move the arguments to Builder.new
kamilc__ has quit [Quit: Leaving...]
<apeiros>
if you have the arguments in build, why have a class at all?
<Fractional>
apeiros, ok. Thank you for helping :)
pen has quit [Read error: Connection reset by peer]
<Junior_>
hello! I need your help guys! I want to make a API for a backend for mij angular JS application. The application is a simple webshop. How would you do it?
pen has joined #ruby
jeremy04 has quit [Remote host closed the connection]
iamjarvo has joined #ruby
<apeiros>
Fractional: in that code, Builder is an ephemeral class. it'll vanish after building a single map. that's its purpose. having the arguments in new allows you to not pass those values around and instead use ivars.
foooobear__ has quit [Ping timeout: 245 seconds]
pen has quit [Read error: Connection reset by peer]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 240 seconds]
chrishough has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michaeldeol has joined #ruby
krisquigley has joined #ruby
<apeiros>
I'm curious how many passwords I'm now actually remembering. I think it's >30 12 digit passwords.
<apeiros>
(so wow, I have a memory of a whooping ~400 bytes :D)
<havenwood>
junior_: What do you mean by API for a backend? Don't AngularJS folk typically use MongoDB or something about mongeese?
<Fractional>
apeiros, would the Map class be Map::Map?
<apeiros>
Fractional: I'd just have it as Map
iamjarvo has quit [Client Quit]
boombadaroomba has quit [Remote host closed the connection]
kayloos has joined #ruby
<apeiros>
shevy: ^ example of class as a namespace ;-)
Xiti` has quit [Quit: Leaving]
<jhass>
apeiros: did you account mapping to where they (might) be used? :P
HelperW___ has joined #ruby
<Fractional>
apeiros: Is it possible to have a map class and a namespace (module) called map? I am getting some error here saying it doesn't identify Map as a module.
Xiti has joined #ruby
<apeiros>
brb
<jhass>
Fractional: a Class is a Module
<jhass>
thus can be used as a namespace
<Junior_>
havenwood: yes, but i want to use a 'normal' MySQL database and a ruby (on rails?) backend API. So the Angular app can get data with $http from de API
<Fractional>
jhass, solved it by doing 'class Map; Class Builder; end; end'
aspires has joined #ruby
yxhuvud has joined #ruby
jhc76 has joined #ruby
<havenwood>
junior_: Typically for APIs we use Rack. There are a number of Rack adapters, Rails included. Sinatra is another that's a popular option for APIs. There's also Grape, which does a bit more handholding.
boombadaroomba has joined #ruby
<havenwood>
junior_: A very minimalist option that's pretty nice is Hobbit. Or lotus-router looks kinda more like a pure Rack option but with routing.
vpnncn has quit [Remote host closed the connection]
dohsan has quit [Remote host closed the connection]
<Morkel>
I have a problem with the asset pipline. I have a external js lib in the vendor/assets/stylsheets dir. It requires 3 images with the path /images/img.png. I dont know how i must put this files
jeremy04 has quit [Remote host closed the connection]
<mary5030>
i had a question real quick if anyone available to answer: how can i convert this hash to an array of [blocks]? {"accountNumber1" => [block1, block2, ...], ...}
<centrx>
mary5030, hash['accountNumber1']
baltazore has quit [Remote host closed the connection]
<centrx>
mary5030, hash.values.flatten ?
<mary5030>
ah
iamjarvo has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ankhers has quit [Ping timeout: 264 seconds]
<Fractional>
centrx, even works in my IRB now but when running with rspec the .split does not split the string.
baltazore has joined #ruby
mocfive has quit [Remote host closed the connection]
mocfive has joined #ruby
IceDragon has quit [Ping timeout: 240 seconds]
gauke has quit [Quit: gauke]
IceDragon has joined #ruby
SilkFox_ has joined #ruby
* apeiros
back
<apeiros>
jhass: errr, what? :)
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
thagomizer has quit [Quit: Leaving.]
klmlfl_ has joined #ruby
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
cocotton has joined #ruby
yfeldblum has joined #ruby
<jhass>
remembering passwords without where they belong is rather useless ;)
<apeiros>
jhass: aah, that was with regards to passwords
<apeiros>
jhass: my pw memory is contextual. I start to remember them when I need them :)
wallerdev has quit [Remote host closed the connection]
<apeiros>
some is even partially muscle memory
<jhass>
so there's associative data ;)
<jhass>
it's more than just the pw's
<apeiros>
somehow somewhere, yupp :D
<banister>
jhass is german your native language?
yekta has joined #ruby
<apeiros>
and in the worst case, I have my keychain
<jhass>
banister: yep
<banister>
jhass nice, same for apeiros
<apeiros>
nope
<banister>
apeiros really?
<apeiros>
my mother tongue is swiss german, a quite distinct dialect ;-)
<shevy>
tobiasvl no not to you, just in general
<shevy>
don't say you don't trust amazon
<shevy>
they bring you BOOKS all the time
milkohol has joined #ruby
tjr9898 has joined #ruby
ptrrr has quit [Quit: ptrrr]
<shevy>
I solved the problem of passwords by having just one password
Xeago_ has quit [Remote host closed the connection]
ptrrr has joined #ruby
Xeago has joined #ruby
wallerdev has joined #ruby
KC9YDN has joined #ruby
<momomomomo>
simple to do your own encryption to generate arbitrary length pw
<momomomomo>
take a sentence like that, choose some random algorithm, and bam
<momomomomo>
ie: take the every other letter, and for every prime n digit, insert a special char of your choosing
<momomomomo>
sm*l ^
Tricon has quit [Quit: Leaving...]
bMalum has quit [Ping timeout: 246 seconds]
<apeiros>
for new stuff I prefer to just use the sentences
<momomomomo>
obviously failed ont he prime there
<apeiros>
that way I don't need to visit the pw manager in like 90% of all cases
bMalum has joined #ruby
<momomomomo>
aye
yacks has quit [Remote host closed the connection]
<apeiros>
my biggest issue is forgetting obsolete pws :-(
<apeiros>
it's even worse with pin codes
<momomomomo>
lol apeiros that’s everyone’s issue
<momomomomo>
I haven’t used the ATM in 2 months, since they sent me 4 letters with different pass codes, and I don’t know which one is the correct one
<momomomomo>
plus, stops me from spending cash
<apeiros>
like, when your whole body is ready to f'ing type that pin and on the 5th digit you notice it's the last one… 1 year after it got deprecated :-S
<momomomomo>
~_~
<shevy>
I'd wish there was a ruby with automagic variables defined
<apeiros>
momomomomo: just try them?
<shevy>
without having to = them
<momomomomo>
apeiros: 3 and you’re locked
<apeiros>
I mean you have 3 tries free :D
ghostmoth has quit [Quit: ghostmoth]
osvico has joined #ruby
<momomomomo>
I could just walk to the bank
<momomomomo>
meh
<shevy>
apeiros you use whole sentences as password?
<apeiros>
oh you received 4 different codes?
<momomomomo>
aye
<atmosx>
apeiros: what's your arduino project about?
<apeiros>
well, what are the chances… :D
MCDev has joined #ruby
<momomomomo>
4 choose 3
<momomomomo>
or wait
<momomomomo>
eh don’t feel like doing the probability
* momomomomo
wonders why more women don’t chat here
almostworking has left #ruby ["Leaving"]
axsuul has joined #ruby
stunder has joined #ruby
HelperW_____ has quit [Ping timeout: 260 seconds]
skammer has quit [Read error: Connection reset by peer]
chrishough has joined #ruby
<wasamasa>
they have better things to do I bet
skammer has joined #ruby
tkuchiki has joined #ruby
<havenwood>
`ruby-install jruby 1.7.16` time!
choke has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
Trynemjoel2 has joined #ruby
timonv_ has quit [Remote host closed the connection]
Trynemjoel has quit [Ping timeout: 250 seconds]
<havenwood>
or i guess is should say `ruby-install jruby` with head or `ruby-install jruby 1.7.16 --md5 92cb058d1a896257b5ac1c26dc433506` with any version ;)
speakingcode has quit [Ping timeout: 260 seconds]
lmickh has quit [Remote host closed the connection]
cirn0 has joined #ruby
* havenwood
eagerly wonders when jruby-9000 will land
Trynemjoel2 is now known as Trynemjoel
ramfjord has quit [Ping timeout: 246 seconds]
tkuchiki has quit [Ping timeout: 258 seconds]
jds has quit [Quit: Connection closed for inactivity]
chrishough has quit [Read error: Connection reset by peer]
chrishough has joined #ruby
ramfjord has joined #ruby
benzrf|offline is now known as benzrf
ppinto has quit [Quit: ppinto]
cirn0 has quit [Ping timeout: 245 seconds]
ghostmoth has joined #ruby
Stalkr_ has quit [Quit: Leaving...]
mocfive has quit [Remote host closed the connection]
awc737 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pdoherty has quit [Quit: pdoherty]
mocfive has joined #ruby
yekta has quit [Quit: yekta]
niklasb_ has joined #ruby
Rollabunna has joined #ruby
emmesswhy has quit [Quit: This computer has gone to sleep]
danijoo has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
omosoj has joined #ruby
danijoo has joined #ruby
timonv_ has joined #ruby
n_blownapart has joined #ruby
thumpba has joined #ruby
cndiv_afk has joined #ruby
krisquigley has quit [Ping timeout: 246 seconds]
cndiv_afk has quit [Client Quit]
cndiv has joined #ruby
tesaf has quit [Quit: Lost terminal]
nickjj has joined #ruby
TeresaP has joined #ruby
Fractional has quit [Read error: Connection reset by peer]
davasaurous has joined #ruby
yalue has quit [Quit: Leaving]
shock_one has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
aspires has joined #ruby
klmlfl_ has joined #ruby
kate_r has joined #ruby
<shock_one>
Hi. Is there a special context or something for define_method ? When I call the defined function (line 3), it works correctly, but when I call what this function executes (5), it behaves differently. https://gist.github.com/shockone/6dad216cede4e02313c4
<momomomomo>
shock_one: you must eval
revoohc has quit [Quit: revoohc]
nanoyak has joined #ruby
<shock_one>
Is it a joke?
carraroj has quit [Quit: Konversation terminated!]
Xeago has quit [Remote host closed the connection]
<banister>
Mia because it's silly to ask a ruby or node programmer when those are the two you're evaluating
<banister>
obvs a ruby programmer will recommend ruby and vice versa
<boombadaroomba>
banister: go get an unbiased opinion bruh
Beoran has joined #ruby
kate_r has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
aspires has joined #ruby
<Mia>
banister, well even that is a reply to me, I'm also asking the same in node channel
<Mia>
biased opinions are good too
HelperW_____ has quit [Ping timeout: 260 seconds]
m_3_ has quit [Remote host closed the connection]
klmlfl_ has joined #ruby
<boombadaroomba>
i dunno, node and ruby are not exclusive though
ki0 has quit [Ping timeout: 258 seconds]
DarthGandalf has quit [Ping timeout: 260 seconds]
c107 has joined #ruby
seanosaur has quit [Remote host closed the connection]
kaspertidemann has quit []
Inhaling_ has joined #ruby
awc737 has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
hiyosi_ has quit [Ping timeout: 250 seconds]
<shevy>
cool
<shevy>
now we have miah and Mia
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DarthGandalf has joined #ruby
dc__ has quit [Remote host closed the connection]
chrishou_ has joined #ruby
jerius has quit []
<Mia>
shevy :)
<shevy>
Mia I guess if you can get away with javascript only and don't want to learn anything else than you could well stick to the javascript-node universe
klmlfl has quit [Ping timeout: 272 seconds]
<soahccc>
Is raquo (») in the ascii table?
<jhass>
soahccc: man ascii
<Mia>
shevy, is it really that bad O_O
klmlfl_ has quit [Ping timeout: 260 seconds]
chrishough has quit [Ping timeout: 244 seconds]
<Mia>
"get away" part specially :)
shock_one_ has quit [Quit: Computer has gone to sleep.]
<shevy>
well you wrote build web apps
sinkensabe has quit [Remote host closed the connection]
<shevy>
so you have a very limited use case
pushnell has quit [Ping timeout: 272 seconds]
Juanchito has quit [Quit: Connection closed for inactivity]
InhalingPixels has quit [Ping timeout: 272 seconds]
<shevy>
even when you use rails you may often end up having to write or use javascript code
<fennec>
Mia -- I wouldn't start by learning Node. It's... hmm.
aspires has quit []
narcan has joined #ruby
<Mia>
fennec, hmm
<fennec>
it's a very neat idea with a variety of pitfalls and its style is not necessarily intuitive for beginners.
doodlehaus has quit [Remote host closed the connection]
<Mia>
fennec, I see
<centrx>
aka callback hell
<jhass>
am I the only one who finds it silly to compare a programming language to a framework?
<wasamasa>
yes
Tricon has quit [Quit: Leaving...]
<jhass>
ok, just wanted to check back
<soahccc>
jhass: that is interesting... I have a string here "mo»ep".encoding == "ASCII-8BIT"
<shevy>
javascript sucks
<fennec>
it's a little silly but it has reasons.
Aaaal has joined #ruby
gmas has quit [Quit: WeeChat 0.4.3]
<Mia>
jhass, excuse my lack of information. I'm a designer, I might be asking things that's not comparable
CaptainJet has joined #ruby
<Mia>
Just using my googlefied mind right now
<Mia>
if it makes sense
<jhass>
soahccc: ascii-8bit == binary
<jhass>
soahccc: not ascii
sailias has quit [Ping timeout: 245 seconds]
pushnell has joined #ruby
<fennec>
there's a capable language buried under the warts of JavaScript :)
<shevy>
yeah
<shevy>
ruby
<jhass>
Mia: no worries, I was more wondering why I'm the first to point out ;)
<fennec>
no that's some place different
<shevy>
in moments like this, I always remember the wat-video about javascript
kayloos has quit []
<shevy>
Mia what about jquery by the way
<wasamasa>
about javascript and ruby you mean
<soahccc>
jhass: should I then be able to encode this symbol to ascii-8bit?
<shevy>
ruby does not have many wat's
<wasamasa>
hahaha
<wasamasa>
it does
<shevy>
wat
<shevy>
like wat
<jhass>
soahccc: ascii-8bit says "this is an array of bytes"
<wasamasa>
it's right there, in the first demonstration of the wat-talk
kristoff_ has joined #ruby
<Mia>
fennec, then let me ask you ---- I want to build a "dice" twitter bot that mentions back with the result -- So that -as an example- if someone mentions the bot and says D20, they will be mentioned back with ra random int from 20 ---------- how hard it is for a complete beginner to build someing like that in both options (ruby vs node)
<wasamasa>
missing_method
milkohol has joined #ruby
<jhass>
soahccc: it's not really an encoding
<shevy>
man, missing_method is like eval
last_staff has quit [Read error: No route to host]
<wasamasa>
I find it pretty mind-boggling people actually use it
<Mia>
shevy, what about it?
<soahccc>
jhass: well I can do "asd".encode("ascii-8bit")
<soahccc>
but not with raquo
<wasamasa>
I find it even more mind-boggling people use instance_eval
<shevy>
Mia I used it about 3 days ago! just for drag and drop effects
kristoff_ has quit [Read error: Connection reset by peer]
kristoff_ has joined #ruby
<fennec>
Mia- assuming you have a framework for each, i'd favor Ruby, slightly. probably fewer pitfalls.
<shevy>
I felt really proud of myself - rather than writing javascript code, I simply did let ruby generate the javascript code in question. that makes me much happier than touch the taint that is javascript directly
<Mia>
shevy, I can learn fornt end stuff right now I'm not too worried abotu it as css3 helps me more than enough for most of the stuff
<soahccc>
jhass: apparently this isn't the problem even as it works on *nix but on windows it's broken but the "encoding" is the same
<jhass>
soahccc: yes, because it's implemented as ascii-compatible encoding
postmodern has joined #ruby
CaptainJet has quit [Client Quit]
<fennec>
speaking of node and irc bots, I was just doing some work on an irc bot framework for node in my spare time
<Mia>
fennec, that's nice
<fennec>
like, a proper bot framework with all the extras, not just the "here is an irc client class that you can use for things"
<jhass>
soahccc: let's skip to your real issue: why do you get a (presumably) utf-8 string as ascii-8bit. How do you read it?
<Mia>
I would love to dive into that really
timonv_ has quit [Remote host closed the connection]
kristofferR has quit [Ping timeout: 260 seconds]
timonv_ has joined #ruby
<soahccc>
jhass: I read it from pastebin.com but the problem is I think when I pass a string from there to a process I'm controlling. On OS X it works and on Windows it works as well. It shows the correct character but it has a weird thing infront of ti
<jhass>
soahccc: how exactly
russt_ has quit [Quit: russt_]
carif has joined #ruby
<fennec>
the nice thing about node is that everything that's anything is all async. that helps you shuffle bits around for one connection without making latency happen in another. but simple low-traffic irc bots don't actually need that, and understanding your program logic enough to orchestrate callbacks in a way that doesn't melt your brain is a challenge even if you're experienced with programming elsewhere. :)
timonv^ has joined #ruby
Guest95323 has quit [Ping timeout: 245 seconds]
carif has quit [Remote host closed the connection]
kil0byte has quit [Remote host closed the connection]
<soahccc>
but the problem occurs when invoke the command I guess
ItSANgo has quit [Quit: Leaving...]
dx7 has quit [Ping timeout: 244 seconds]
<bahar>
hello.... how do i select records that have a certain characteristic... for example i have many users.... i want to select only those from washington state ?
Takle has quit [Remote host closed the connection]
beneggett has joined #ruby
kirun has quit [Quit: Client exiting]
beneggett has quit [Client Quit]
maniacal_ has joined #ruby
<soahccc>
jhass: I'm debugging the problem this way but I get it even when directly using code and sending something to the process
cornfeedhobo has left #ruby ["when i leave, come together like butt cheeks"]
<jhass>
soahccc: the Content-Type is set to utf8, so maybe net/http on windows fails to parse that correctly or so. I'd try .force_encoding('UTF-8')
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
havenwood has quit [Remote host closed the connection]
j_mcnally has joined #ruby
<jhass>
soahccc: on a side node rescuing Exception is considered bad practice, you should rescue the exceptions you expect to happen
hiyosi_ has joined #ruby
<jhass>
and at most rescue StandardError (which is the default if you specify no class)
mikeg has quit [Ping timeout: 272 seconds]
zeroNones has joined #ruby
<jhass>
rescuing Exception will prevent a SystemExit if stuck in that method for example
Tricon has joined #ruby
Takle has joined #ruby
<soahccc>
jhass: it's failsafe to not let a "chat command" break the main loop in this case and tell it to the user...
<soahccc>
the whole thing is evil as in eval :D
<jhass>
None of that code will raise anything above StandardError, really
<soahccc>
jhass: but yeah for the http block you're right
bMalum has quit [Quit: bMalum]
<jhass>
not different in the later case
zeroNones has quit [Client Quit]
zeroNones has joined #ruby
ixti has joined #ruby
MaciejCzyzewski has joined #ruby
Kricir has joined #ruby
<soahccc>
jhass: I tried to directly send data to the process with force_encoding utf-8 and windows-1252 still this weird A is appearing. But if the encoding is wrong the raquo wouldn't be there right? I think this is a windows issue or the way I opened the process maybe. With File.read I needed the (b)inary flag for everything.
hiyosi_ has quit [Ping timeout: 260 seconds]
Aaaal has quit [Read error: Connection reset by peer]
awc737_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Aaaal has joined #ruby
Takle has quit [Remote host closed the connection]
adac has quit [Ping timeout: 260 seconds]
<jhass>
you mean you have additional bytes on windows? I doubt that but compare .bytes
Pumukel has joined #ruby
maniacal_ has quit [Read error: Connection reset by peer]
klmlfl has joined #ruby
<jhass>
if you really have I'd blame gzip or something and play with different Accept-Encoding headers
awc737 has joined #ruby
<soahccc>
I know a similar thing from OS X where there is UTF-8 with wide character format or some sort of shit.
<jhass>
maybe your IPC is messing up, so take to properly pass encoding there too
<jhass>
*take care
<soahccc>
jhass: it's not remote anymore, I directly do @process_stdin.write so no headers or anything conflicitng
<jhass>
IO's may do encoding conversions which can mess stuff out of either end is opened with the wrong encoding or gets passed a string with the wrong encoding declaration
CorySimmons has joined #ruby
northfurr has joined #ruby
teddyp1cker has joined #ruby
havenwood has joined #ruby
jay_ has joined #ruby
klmlfl has quit [Ping timeout: 244 seconds]
<soahccc>
jhass: apparently this is what is getting logged (you remember the ingame notation from the screen right?) »
jay_ is now known as rubyonrailed
<jhass>
that can mean anything depending on the encoding
<soahccc>
I couldn't find a way to define any sort of encoding for popen so I have no idea how to fix that
<jhass>
look at the .bytes
<soahccc>
okay
<jhass>
I guess they get Encoding.default_external unless you turn on binmode
axsuul has joined #ruby
marr has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 260 seconds]
stunder has quit [Quit: Screw you guys I'm going home]
<jhass>
I'd try to define that string inline as close to the output method as possible and check if it's transmitted directly
<jhass>
if it is check its encoding and .bytes
thams has quit [Quit: thams]
<jhass>
then from either side, the output method and the http call, check encoding and .bytes and see where it changes/goes wrong
bMalum has joined #ruby
<jhass>
I do not work with ruby on windows, so that's about the advice I can give you here
banister has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
teddyp1cker has quit [Ping timeout: 272 seconds]
osvico has quit [Ping timeout: 272 seconds]
timonv_ has joined #ruby
banister has joined #ruby
IceDragon has quit [Ping timeout: 260 seconds]
<soahccc>
jhass: at the point where I send the data the bytes are exactly the same so there is an issue while writing to the process' stdin. I tried to make this script windows compatible (and for the most part is now) but I can tell you: It was a big pain
bruno- is now known as Guest49778
IceDragon has joined #ruby
phutchins has joined #ruby
cndiv has joined #ruby
nanoyak has quit [Read error: Connection reset by peer]
axsuul has quit [Ping timeout: 250 seconds]
nanoyak has joined #ruby
devyn has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Takle has joined #ruby
<jhass>
soahccc: did you try to .encode(Encoding.default_external) ?
jobewan has quit [Quit: Leaving]
shackleford has quit [Remote host closed the connection]
devyn has joined #ruby
HelperW_____ has joined #ruby
wjimenez_ has joined #ruby
wjimenez_ has quit [Read error: Connection reset by peer]
maestrojed has quit [Quit: Computer has gone to sleep.]
freerobby has quit [Quit: Leaving.]
<soahccc>
well it's utf-8 so yeah I tried this with force_encoding before
MaciejCzyzewski has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest49778 has quit [Ping timeout: 260 seconds]
wjimenez_ has joined #ruby
ki0 has joined #ruby
treehug88 has quit []
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
well, we know the data is in utf-8
Veidit_ has joined #ruby
<jhass>
so .force_encoding('utf-8').encode(encoding_the_other_end_expects)
<jhass>
.force_encoding simply changes the tag, .encode converts
Veidit has quit [Ping timeout: 260 seconds]
axsuul has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krisp1 has joined #ruby
<soahccc>
maybe I should write a script which is at the other end to see what's actually coming in
wjimenez5271 has quit [Ping timeout: 272 seconds]
MaciejCzyzewski has joined #ruby
maestrojed has joined #ruby
timonv_ has quit [Ping timeout: 272 seconds]
cpruitt has quit [Quit: cpruitt]
<soahccc>
if just pry wouldn't suck so bad in the windows CMD :D
ursooperduper has joined #ruby
aZtec_ has joined #ruby
HelperW_____ has quit [Ping timeout: 240 seconds]
<aZtec_>
hi all..i can't get to install Nokogiri on OSX 10.9.5
m8 has quit [Quit: Sto andando via]
HelperW_____ has joined #ruby
<soahccc>
aZtec_: what's the error? I have it running on 10.9.4
nfk has quit [Quit: yawn]
skammer has joined #ruby
<aZtec_>
soahccc it's the libiconv libraries that are giving me headache
<aZtec_>
i managed to install nokogiri (installer passed without errors), but rake throws an exception
<soahccc>
what does it say
awc737 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<fennec>
that was 4 lines, should have been a gist ;)
<aZtec_>
hm i'll give that a try next
ghostmoth has joined #ruby
andrewlio has quit [Remote host closed the connection]
krisquigley has joined #ruby
larissa has joined #ruby
<shevy>
hey those were 3 lines and then 2 lines
angusiguess has joined #ruby
<shevy>
aZtec_ if you are in the ext/ subdirectory and manually run extconf.rb, you will get the specific error message
pdoherty has quit [Quit: pdoherty]
<shevy>
it's what I do even on linux, because as you can see above, rake stinks (I did not even need hoe at all, so why does it bother me with it)
<benzrf>
shevy..
chrishough has quit [Read error: Connection reset by peer]
<benzrf>
.
<benzrf>
I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/LInux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
<benzrf>
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.
<benzrf>
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself;
<benzrf>
it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.
sinkensabe has quit [Remote host closed the connection]
<shevy>
wow
gregf has quit [Quit: WeeChat 1.0]
<shevy>
fennec how many lines were that?
<shevy>
benzrf I run quite a lot of non GNU stuff too
<fennec>
shevy- benzrf doen't nead a gist, he just needs to /nick rms
* fennec
teases
<hendricius>
shevy: yep
rubyonrailed has joined #ruby
lolmaus has joined #ruby
shackleford has joined #ruby
shock_one_ has joined #ruby
<boombadaroomba>
asked in rubyonrails. anyone recommend any good reading for javascript with embedded ruby?
<aZtec_>
wow i got it to work
willgo has joined #ruby
<aZtec_>
uninstalled all port and brew traces of libxml2, libxslt and finally libiconv and then reinstalled
<aZtec_>
it seems to work now
momomomomo has joined #ruby
agjacome has quit [Quit: leaving]
jonr22 has joined #ruby
lolmaus has quit [Client Quit]
osvico has quit []
snath has quit [Ping timeout: 246 seconds]
icarus has quit [Remote host closed the connection]
<shevy>
\o/
<shevy>
aZtec_ IS THE MAN!
<shevy>
it worked when you were ANGRY
<zrl>
What's an easy way to get a block of code to run at a set interval? I'd like to the syntax to be something like 1.minutes { puts "Hello, world!" }
shackleford has quit [Remote host closed the connection]
lolmaus has joined #ruby
<shevy>
<aZtec_> i don't know why there is dependency hell
<shevy>
<aZtec_> well ofc i do but it rids my of my last nerve
<shevy>
<aZtec_> soahccc i'm literally at the stage where I feel like I have tried every single possible combination of installing this sh** (please excuse)
<shevy>
angriness works
<aZtec_>
holy molly i thought i'd never see this day in my life
<shevy>
zrl one way would be via Thread.new
<shevy>
aZtec_ AND you are still on OSX
<omosoj>
is there a time method to return the day (Thursday), like Time.now.day or something
<fennec>
zrl- well the outside-of-Ruby way is called cron
<zrl>
right
<havenwood>
boombadaroomba: embedded Ruby in Javascript?
<havenwood>
boombadaroomba: like mruby?
<aZtec_>
zrl, standard way to do recurring tasks in unix environments is with cron
<fennec>
zrl- other questions include whether you have guarantees the work will take less time than the time scheduled, and whether you want to block the process or not
<aZtec_>
but in the case of 1 minute intervals that wouldn't be a good option, depending on how you execute the task
kaspertidemann has quit []
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alexherbo2 has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
arturhoo has quit [Quit: arturhoo]
danijoo has quit [Read error: Connection reset by peer]
yfeldblum has quit [Read error: Connection reset by peer]
zeroNones has joined #ruby
danijoo has joined #ruby
yfeldblum has joined #ruby
Kricir has quit [Remote host closed the connection]
wallerdev has joined #ruby
ki0 has quit [Remote host closed the connection]
klmlfl has quit [Read error: No route to host]
Kricir has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ixti has quit [Quit: WeeChat 1.0]
klmlfl has joined #ruby
nanoyak has quit [Read error: Connection reset by peer]
<havenwood>
having fun playing with langs on exercism.io, but wondering if it wouldn't be nice for Ruby to add support for Elixir's alternate method calling sugar so `count_unequal_pairs(pairs_of_chars(sort_by_size([a, b])))` could alternatively be written as `[a b] |> sort_by_size |> pairs_of_chars |> count_unequal_pairs`
gr33n7007h has joined #ruby
nanoyak has joined #ruby
c107 has quit [Remote host closed the connection]
aspires has quit []
ndrei has quit [Ping timeout: 260 seconds]
krisp1 has left #ruby [#ruby]
troyready has quit [Quit: Leaving]
<havenwood>
allows that nice method-chainy feel without monkeypatching the world
<wallerdev>
how does that handle multiple params at different parts
<havenwood>
wallerdev: i think you could mix and match maybe, like: sort_by_size(a, b) |> pairs_of_chars |> count_unequal_pairs
Kricir has quit [Ping timeout: 260 seconds]
krisquigley has quit [Remote host closed the connection]
<wallerdev>
eh
timonv_ has joined #ruby
<havenwood>
wallerdev: or maybe splat?
krisquigley has joined #ruby
<wallerdev>
i dont think its neeeded too much, i dont find myself doing that that much anyways
n_blownapart has joined #ruby
<wallerdev>
makes more sense for a language with lots of static functions
<havenwood>
i think it makes sense for Ruby, in that you can get readability in cases where we now resort to variable assignment
klmlfl has quit []
boombadaroomba has quit [Remote host closed the connection]
tectonic has joined #ruby
<havenwood>
i like the flexibility to say it in the order you want, without freedom patching or refinements
benzrf is now known as benzrf|offline
<havenwood>
it's a sugar i think i'd use, dunno
HelperW_____ has joined #ruby
wldcordeiro_ has joined #ruby
troyready has joined #ruby
Aaaal has quit [Read error: Connection reset by peer]
nanoyak has quit [Read error: Connection reset by peer]
snath has joined #ruby
krisquigley has quit [Ping timeout: 260 seconds]
nanoyak has joined #ruby
timonv_ has quit [Ping timeout: 260 seconds]
hmsimha_ has joined #ruby
yfeldblum has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
HelperW_____ has quit [Ping timeout: 260 seconds]
yfeldblum has joined #ruby
HelperW_____ has joined #ruby
axsuul has quit [Read error: Connection reset by peer]
<shevy>
hmm is there a simple way to re-alias one hash key to another one? right now I use .delete for this
<centrx>
ght, A, B, C are not proper variable names, not sure if that's related
<centrx>
ght, should be lowercase
<ght>
but that syntax is supported, ok.
<centrx>
yes
<ght>
Thank you.
<syva>
ght: you can use if RUBY_VERSION < ‘x.x’
<centrx>
ght, although that's the default operator precedence as I recall
coderdad has quit [Remote host closed the connection]
<centrx>
maybe not
<syva>
sorry wrong person
<Paradox>
lol
<syva>
i meant paradox
<Paradox>
i know that was addressed at me syva
seanosaur has quit [Ping timeout: 272 seconds]
<Paradox>
i've settled on that
<Paradox>
but was wondering if there was an in-ruby equivalent to something like modernize for browsers
hiyosi_ has joined #ruby
<Paradox>
detect the "feature", regardless of "version"
wallerdev has quit [Quit: wallerdev]
<centrx>
Paradox, Since many features are methods on objects, you can use respond_to?
<syva>
paradox: browser feature detection is about testing for available standard libs
<syva>
not syntactical
<syva>
features
Wolland has quit [Ping timeout: 272 seconds]
<centrx>
Paradox, e.g. my_array.respond_to?(:to_h)
thams has joined #ruby
<syva>
keyword args specificially is very low level thing to be detecting for
<Paradox>
yeah, i know of that one centrx, not sure how i'd handle keyword hashes though, since they're a little lower level, or no?
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx>
right
<Paradox>
well i want to fall back to a hash argument in the event that they arent there
wallerdev has joined #ruby
<centrx>
it's kind of already the same thing for passing in
<centrx>
then use def method(options) for the params, or (options = {})
<Paradox>
same syntax, but if you run a program written in 2x in 1.9, ruby screams and yells
<centrx>
oh right kwarg syntax for hashes, not methodss
msmith_ has quit [Remote host closed the connection]
IceDragon_ has quit [Ping timeout: 272 seconds]
<Paradox>
syva modernize doesn't always detect standard libs. Sometimes it does hacky shit, like the manner through which it detects input[type=color]
<syva>
but if you have a lot of methods like this then its going to be a lot of conditionals for the ruby version, and using meta progamming to achieve it would be suboptimal
<syva>
so this smells like overengineering
<syva>
imo just go with hash args
<Paradox>
yeah, i guess i can just do a if not 2x and wait for 3x to come out
<Paradox>
or that
<Paradox>
thanks
TorpedoSkyline has joined #ruby
IceDragon_ has joined #ruby
<havenwood>
Paradox: February 23rd is coming up pretty soon. Buh bye 1.9!