<flaccid>
hey guys i'm trying to understand what https://github.com/redcar/redcar#installing-from-source actually does. it does a rake init which puts a bundle in ./vendor. when i go to run ruby bin/redcar it returns LoadError: no such file to load -- plugin_manager - i assume this is because the bundle gems are not in path or something?
mansi has quit [Remote host closed the connection]
spalenza has joined #ruby
<r0bgl33s0n>
anyone have experience with polymoprhic belongs_to & simple_form/fields_for?
mrsolo has quit [Quit: This computer has gone to sleep]
mansi has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
<r0bgl33s0n>
i am passing the polymorphic record to fields_for but it uses the records class name instead of the polymorphic associations name.
snovak has joined #ruby
jdolitsky1 has quit [Quit: Leaving.]
yxhuvud has joined #ruby
lukec has quit [Quit: lukec]
julweber has quit [Remote host closed the connection]
randomautomator has quit [Ping timeout: 264 seconds]
kofno has joined #ruby
jibi has joined #ruby
snovak has joined #ruby
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
gyre007 has quit [Ping timeout: 264 seconds]
julweber has joined #ruby
dmerrick has quit [Remote host closed the connection]
nwertman_ has quit [Ping timeout: 248 seconds]
peregrine81 has quit []
Davey has joined #ruby
buibex has quit [Ping timeout: 260 seconds]
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
bthesorceror has quit [Quit: bthesorceror]
nwertman_ has joined #ruby
Monie has joined #ruby
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
snovak has quit [Ping timeout: 264 seconds]
sevenseacat has joined #ruby
julweber has quit [Ping timeout: 248 seconds]
hasrb has quit [Remote host closed the connection]
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
Monie has quit [Ping timeout: 264 seconds]
nwertman_ has quit [Ping timeout: 276 seconds]
hadees has quit [Quit: hadees]
randomautomator has joined #ruby
<xybre>
skinkitten: you don't need to specify attributes ahead of time
dkamioka has joined #ruby
Targen has quit [Read error: Connection reset by peer]
pvizcay has joined #ruby
Targen has joined #ruby
ryandeussing has quit [Remote host closed the connection]
ryandeussing has joined #ruby
<volty>
xybre: what do you mean by 'ahead of time'?
benwoody has joined #ruby
apfelbox has quit [Ping timeout: 260 seconds]
Nisstyre has quit [Ping timeout: 260 seconds]
<xybre>
volty: before ou use them
soba has joined #ruby
ixti has quit [Read error: Connection reset by peer]
momomomomo has quit [Quit: momomomomo]
ixti has joined #ruby
huoxito has joined #ruby
saarinen has quit [Quit: saarinen]
kofno has quit [Quit: leaving]
lukec has joined #ruby
<volty>
xybre: you must mean before you write them (inside methods), or, by other words, you must mean that you can invoke attr after you wrote all the methods
dankest has quit [Quit: Peace]
ehaliewicz has joined #ruby
<xybre>
You don't need to specify attr* at all.
Domon has joined #ruby
<volty>
ah! leave it man! he was asking a simple question, he (and we) was not asking how to rewrite or mimic the implications of attr
<xybre>
It sounded to me that it was being over complicated
RobW_ has joined #ruby
shvelo has quit [Read error: Operation timed out]
havenwood has quit [Remote host closed the connection]
<volty>
semantically creating instance variables and creating attributes (properties) is not the same // it's about (explicit) properties declaration, getters, setters and maybe optional initializers etc etc
Croms has quit [Quit: Croms]
adkron has joined #ruby
<volty>
ops i meant optional initial values
javierbuilder has joined #ruby
spalenza has quit [Remote host closed the connection]
randomautomator has quit [Read error: Connection reset by peer]
randomautomator has joined #ruby
<bnagy>
uh
<bnagy>
well there's no such thing as 'attributes' or 'properties' so semantically they are kind of the same
endash has quit [Quit: endash]
<volty>
there is
javierbuilder has quit [Max SendQ exceeded]
saarinen has joined #ruby
<bnagy>
no.
<bnagy>
people use those terms, but they're just shorthand
<bnagy>
mostly web people afaict
<volty>
shorthand for what?
<bnagy>
methods
Voodoofish430 has quit [Quit: Leaving.]
<volty>
don't pose a pedant to me
blueredturtle has joined #ruby
<sevenseacat>
why so argumentative volty
<volty>
those are properties of objects
jibi has quit [Quit: .]
<volty>
why so curious ?
<volty>
sevenseacat:
<bnagy>
it's not pedantic. Some people have the impression that there is a 'property' which is somehow distinct from a method
<sevenseacat>
if people smarter than you are all telling you the same thing, they're likely right.
<bnagy>
those people are mistaken
havenwood has joined #ruby
<volty>
sevenseacat: smarty boy, argue
<sevenseacat>
i'm no smarty boy.
randomautomator has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby
<volty>
ya ya, they are used as properties / attributes, who needs the classic properties just uses the attr class method
aryaching has joined #ruby
<volty>
all the rest of talking is you posing as teachers of the series "I"ll tell you what goes behind the scenes"
osvico has joined #ruby
<bnagy>
ok, which creates instance variables and methods for you
<bnagy>
< volty> semantically creating instance variables and creating attributes (properties) is not the same
<volty>
You can of course tell that there are methods behind, but you cannot tell that those are not attributes
<bnagy>
... which is where I came in
alekst has quit [Quit: Leaving...]
dodosan has joined #ruby
nbouscal has joined #ruby
<volty>
semantically refers to the spoken language (meaning also : enough pedantry)
<bnagy>
well most people use 'semantically' to mean a specific thing when talking about programming
<bnagy>
but ok. Carry on.
<skinkitten>
uh. I want to create a BasicSalesTax class which has a tax rate of 10%. thats why I asked for the attributes. I wanted to make the tax rate an attribute. And have other sub classes that I can have different taxes
__userna1 has joined #ruby
<sevenseacat>
i like chocolate.
<volty>
when I say properties I mean properties, behave as properties - it is that simple,
<sevenseacat>
who else likes chocolate!?
blueredturtle has quit [Quit: blueredturtle]
<xybre>
Also you can't set default attribute values using attr.
peregrine81 has joined #ruby
<volty>
you can tell me that behind properties of c++ objects there are instructions for the processors etc etc :)
<bnagy>
skinkitten: just use attr_reader
<sevenseacat>
we're not in c++ so nice try
Astral_ has quit [Ping timeout: 276 seconds]
<volty>
i didn't say that you can set initial values with attr
chriskk has joined #ruby
<volty>
sevenseacat: but somebody similar to you can do the same, in a c++ chan
__username__ has quit [Ping timeout: 276 seconds]
Spami has quit [Quit: This computer has gone to sleep]
* sevenseacat
goes back to eating chocolate
<xybre>
skinkitten: You probably just want to set a constant if your tax value is never going to change programmatically
<bnagy>
nooo
<skinkitten>
i'm going to have subclasses that will have different taxes xybre class TaxFree < BasicSalesTax
<bnagy>
using a constant will make inheritance awful
<volty>
smarties, you could have told skinkitten, long before, that there isn't such a thing called 'attributes' in ruby
<volty>
were you sleeping ? :)
<skinkitten>
or have a BaseItem class and have a class BasicTax < BaseItem
<bnagy>
... this is sounding like a strange architecture
sirupsen has quit [Quit: sirupsen]
bthesorceror has joined #ruby
jbrecht__ has quit [Remote host closed the connection]
bthesorceror has quit [Client Quit]
<xybre>
skinkitten: then a class_instance_variable is what you want, or perhaps you want to pass in the tax rate when you instantiate the object
jbrechtel has joined #ruby
okinomo__ has quit [Quit: Lost terminal]
okinomo_1 has quit [Quit: Lost terminal]
okinomo has quit [Quit: Lost terminal]
okinomo_ has quit [Quit: Lost terminal]
okinomo_2 has quit [Remote host closed the connection]
<bnagy>
nooo
<volty>
ya, now we are going back, right to the teaching of how to make the water warm ...
<volty>
too few info to hear the strangeness of his architecture
jrobeson has quit [Ping timeout: 264 seconds]
<bnagy>
skinkitten: the tax behaviour of an item belongs to the item class, right?
bthesorceror has joined #ruby
cads has quit [Ping timeout: 248 seconds]
<bnagy>
every item of a given class has a tax characteristic
<skinkitten>
but they're items that have special taxes
<bnagy>
this is not a good use of inheritance
<bnagy>
cause an item isn't a kind of tax
<volty>
special calculations - he, probably, means
<bnagy>
so, option one - just have a @tax_rate instance var in every item class, which you could pass during initialize
<havenwood>
include a module instead of inheriting from a class
<volty>
skinkitten: listen to an old fox, don't mess with modules until (and unless) you get clear ideas working on your (just) class hierarchy
<bnagy>
holy crap what is this, bad advice day?
<sevenseacat>
only when volty's around
saarinen has quit [Quit: saarinen]
<bnagy>
volty: honestly, I don't know where you came from, but everything I have heard you say so far has been either wrong or pointlessly argumentative
<bnagy>
so why don't you pipe down, ok?
Rym_ has joined #ruby
jrobeson has joined #ruby
<Buuyo>
he's been a centerpiece in every conversation I've chanced to peek in and see for the last week :p
snovak has joined #ruby
Rym has quit [Ping timeout: 248 seconds]
Rym_ is now known as Rym
rcosta has quit [Remote host closed the connection]
<volty>
smart guys, my impression is that you take into account much more your teacher's compulsions than the needs of needy people - failing so to understand their problems (all of them - not less the ability determined by many factors)
saarinen has joined #ruby
<Buuyo>
volty: don't make light of the profession of ivory tower building. it's why we get to charge so much for software. :)
pitzips has quit [Quit: Leaving]
peregrine81 has quit []
zeade has joined #ruby
randomdrake has quit [Quit: randomdrake]
xiphffff4 is now known as xiphias
<volty>
you, with your posing compulsions, are just making mess in his brain & ideas
<volty>
if you are really interested in helping him, you should ask him more about what he has to handle
<xybre>
skinkitten: I don't know 100% how you have to do sales taxes, so cut it to fit
gstamp has quit [Quit: Computer has gone to sleep.]
<havenwood>
i came in late... but 'semantic' is a commonly used term of art that isn't fancy or pedantic, attrs are often referred to as attributes and the instance variables and methods behind them are essential to understanding how to use them, and a mixin seems more appropriate than inheritance from the bit i've heard
<bnagy>
xybre: that's kind of OK< but if you have a tax free item you'll have to have a negative 'special tax'
<bnagy>
which is a bit ugly
<xybre>
bnagy: true, but I don't have a use case, so I can't code for it ;)
<bnagy>
just use an ivar, and attr_reader - it's just as unchangeable as a constant
<bnagy>
ie not at all
<havenwood>
meaning totally changable >.>
<volty>
you get an attribute, you set an attribute - end of the story !
snovak has quit [Ping timeout: 264 seconds]
rupee has quit [Quit: Leaving]
<volty>
if you need something more than an attribute you can study on ... :)
<skinkitten>
thats giving me 1 of 0 arguments error xybre
<xybre>
skinkitten: what Ruby version?
mansi has joined #ruby
<xybre>
It runs here on Ruby 2
nbouscal has quit [Quit: Computer has commenced electric sheep tracking protocol.]
<volty>
i have plenty of qtruby and cannot risk (or loose time) FOR NOW
<sevenseacat>
can someone just like mute him?
<volty>
havenwood: i'm not trolling
<volty>
just telling what i think, what i have, why i have
Legion has joined #ruby
cads has joined #ruby
<volty>
you got a pythoner ... :)
havenwood has quit [Remote host closed the connection]
goodcodeguy has quit [Quit: Lost terminal]
havenwood has joined #ruby
<shim>
n00b q: writing a script. input a word, scans x.txt for the line with tha word on it, then puts the word. got input and .read but can't get it to print the line back
<volty>
skinkitten: why don't you ask in a python chan - since you are so comfortable with python, and, now, writing in python, translating in real time ?
<xybre>
shim: puts?
<volty>
nuts
<volty>
:)
<shim>
puts what? from stackoverflow i was told File.readline
havenwood has quit [Read error: Connection reset by peer]
<skinkitten>
because i need to program it in ruby
<xybre>
shim: to print a string in ruby you use puts
<skinkitten>
and plus i should be doign this as a TDD exercise
<shim>
derp. this scans a txt file for the line with that word, then returns the line
<volty>
skinkitten: then write in ruby
<skinkitten>
my first test to test the basic sales class
DanKnox_away is now known as DanKnox
<skinkitten>
learning ruby
<skinkitten>
well i'm learning at an accelerated pace because of the code you guys have posted
<volty>
skinkitten: go on, learn by mistake, create 20 redundant classes and reduce later - BY YOURSELF - the best way - imho
<skinkitten>
xybre: how would I do this in rspec. testing the tax percentage
Rym_ has joined #ruby
dkamioka has quit [Read error: Connection reset by peer]
Rym has quit [Ping timeout: 264 seconds]
Rym_ is now known as Rym
<xybre>
shim: hm, might be erroring out
dkamioka has joined #ruby
sparq_ has joined #ruby
sparq_ has quit [Read error: Connection reset by peer]
RobW_ has quit [Quit: RobW_]
<xybre>
skinkitten: something like .. describe Item do; it 'gives the correct total'; expect(Item.new('dsfkn', 10, 0.10).total).to eq(10.10); end
ehc has quit [Quit: ehc]
<xybre>
shim: Yeah I'm getting the same "module" error as you
nari_ has joined #ruby
randomdrake has joined #ruby
<volty>
shim: first of all you have 'lword' instead of lword (without quotes)
pvizcay has quit [Quit: leaving]
jp- has quit [Quit: OK, I believe you… but my tommy gun don't]
Monie has joined #ruby
nbouscal has joined #ruby
aryaching has quit [Ping timeout: 248 seconds]
kobain_ has joined #ruby
kobain_ has quit [Remote host closed the connection]
kobain has quit [Read error: Connection reset by peer]
<xybre>
shim: oh I see, its the File.include? line
bthesorceror has quit [Quit: bthesorceror]
<volty>
of course, speedy
radic__ has joined #ruby
<xybre>
shim: File is the class, you want to search your file's instance
awc737 has quit [Ping timeout: 260 seconds]
nbouscal has quit [Client Quit]
benwoody has quit [Quit: benwoody]
narcan has joined #ruby
<volty>
that source is too messy
sst66 has quit [Ping timeout: 256 seconds]
RobW_ has joined #ruby
radic_ has quit [Ping timeout: 260 seconds]
<volty>
he is the right guy to whom you may teach - since you can be told (or guess) the expected behavior, since there's all that mess
awc737 has joined #ruby
awc737 has quit [Excess Flood]
mary5030 has joined #ruby
javaHelloWorld has joined #ruby
awc737 has joined #ruby
aryaching has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
mrsolo has joined #ruby
nmabry has joined #ruby
io_syl has quit []
sst66 has joined #ruby
<javaHelloWorld>
i lovr rubys they are nice and red and i love the way light bounces off them
randomdrake has quit [Quit: randomdrake]
carlyle has joined #ruby
stonevil has quit [Remote host closed the connection]
__userna1 has quit [Ping timeout: 245 seconds]
mansi has quit [Remote host closed the connection]
mansi has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
<volty>
you left shim?
<skinkitten>
xybre: why did you put all caps for BASE_SALES_TAX
<sevenseacat>
convention
<skinkitten>
is that the idiom?
<skinkitten>
so variables are in all caps
<skinkitten>
?
<sevenseacat>
no, constants are
dcope has joined #ruby
mansi has quit [Ping timeout: 264 seconds]
<dcope>
hey all, any idea why this code works fine when run by itself but when it's run inside of a node iteration with nokogiri the header is the wrong value? http://pastie.org/private/z2j9cqwddngadyslcapha
krz has joined #ruby
<skinkitten>
how do I run this script and then call the class in that script to use in the interpreter
ewnd9_ has quit [Ping timeout: 276 seconds]
sayan has joined #ruby
flaccid has left #ruby ["Konversation terminated!"]
Rym has quit [Ping timeout: 264 seconds]
Rym has joined #ruby
mcat1 has joined #ruby
fourq_ has quit [Ping timeout: 256 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Levin_22 has joined #ruby
<mcat1>
test
<xybre>
skinkitten: captials are constants
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
<skinkitten>
and the @sku?
<skinkitten>
thats like the self.in python ahhhh I see
brain_shim has joined #ruby
iamjarvo has joined #ruby
<skinkitten>
ok I'm familiar with the ruby program. now how does an rspec look like for something like this?
dhruvasagar has quit [Ping timeout: 248 seconds]
jlast has quit [Remote host closed the connection]
<b00stfr3ak>
hello, I am having an issue with vim. For some reason inside the editor everything looks good but when I post it to github or cat the file all the formatting is messed up. Has any one else run into this issue?
eka has quit [Quit: Computer has gone to sleep.]
snath has quit [Ping timeout: 248 seconds]
mcat1 has quit [Remote host closed the connection]
eka has joined #ruby
volty has quit [Quit: Konversation terminated!]
snovak has joined #ruby
saarinen has quit [Quit: saarinen]
skinkitten has quit [Quit: Page closed]
JumpMast3r has quit [Quit: JumpMast3r]
headius has joined #ruby
lukec has quit [Quit: lukec]
snovak has quit [Ping timeout: 276 seconds]
ssvo has joined #ruby
mansi has joined #ruby
narcan has joined #ruby
Bira has quit []
krzkrz has joined #ruby
krzkrz has quit [Client Quit]
krzkrz has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
randomdrake has joined #ruby
c0rn has joined #ruby
badpie has joined #ruby
c0rn has quit [Client Quit]
snath has joined #ruby
<badpie>
Any Clonezilla users floating around here?
aryaching has quit [Ping timeout: 264 seconds]
Nisstyre-laptop has joined #ruby
dodosan has quit [Remote host closed the connection]
aryaching has joined #ruby
shim has quit [Quit: Leaving]
musl has quit [Quit: WeeChat 0.4.1]
saarinen has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
io_syl has joined #ruby
katselphrime has joined #ruby
Soda has joined #ruby
aryaching_ has joined #ruby
stormbytes has joined #ruby
aryaching has quit [Ping timeout: 245 seconds]
pkrnj has joined #ruby
splittingred has quit [Quit: splittingred]
katselphrime has quit [Ping timeout: 248 seconds]
stonevil has joined #ruby
bluOxigen has joined #ruby
blueOxigen has joined #ruby
saarinen has quit [Quit: saarinen]
dkamioka has quit [Remote host closed the connection]
randomdrake has quit [Quit: randomdrake]
akells has quit [Remote host closed the connection]
badpie has left #ruby ["Leaving"]
randomdrake has joined #ruby
Spami has joined #ruby
adkron has quit [Ping timeout: 248 seconds]
stonevil has quit [Ping timeout: 264 seconds]
bluOxigen has quit [Ping timeout: 276 seconds]
zeade has quit [Quit: Leaving.]
iliketur_ has joined #ruby
gildo has quit [Ping timeout: 264 seconds]
krzkrz has quit [Quit: krzkrz]
sirupsen has joined #ruby
ndngvr has joined #ruby
Davey has quit [Ping timeout: 264 seconds]
randomdrake has quit [Quit: randomdrake]
vlad_starkov has joined #ruby
mary5030 has quit [Remote host closed the connection]
iliketur_ has quit [Quit: zzzzz…..]
dodosan has joined #ruby
Nisstyre-laptop has quit [Read error: Operation timed out]
vlad_starkov has quit [Ping timeout: 264 seconds]
mwmnj has quit [Ping timeout: 276 seconds]
javaHelloWorld has quit [Ping timeout: 256 seconds]
saarinen has joined #ruby
mansi has quit [Remote host closed the connection]
mansi has joined #ruby
dodosan has quit [Remote host closed the connection]
saarinen has quit [Client Quit]
Asher2 has joined #ruby
ssvo_ has joined #ruby
Domon has quit [Remote host closed the connection]
Domon has joined #ruby
ereslibre_laptop has joined #ruby
ereslibre_laptop has joined #ruby
jokke1 has joined #ruby
dayepa has quit [Ping timeout: 264 seconds]
Asher has quit [Ping timeout: 264 seconds]
derf- has quit [Ping timeout: 264 seconds]
bmn has quit [Ping timeout: 264 seconds]
Norrin has quit [Ping timeout: 264 seconds]
ereslibre has quit [Read error: Connection reset by peer]
jokke has quit [Ping timeout: 264 seconds]
DonVitoCorleone has quit [Ping timeout: 264 seconds]
blo has quit [Ping timeout: 264 seconds]
zero7 has quit [Ping timeout: 264 seconds]
ismlages has quit [Ping timeout: 264 seconds]
aalmenar has quit [Ping timeout: 264 seconds]
banzounet has quit [Ping timeout: 264 seconds]
epic_ has quit [Ping timeout: 264 seconds]
Blue_Ice has quit [Ping timeout: 264 seconds]
bnagy has quit [Ping timeout: 264 seconds]
supki has quit [Ping timeout: 264 seconds]
epic has joined #ruby
Blue_Ice has joined #ruby
Blue_Ice has quit [Changing host]
Blue_Ice has joined #ruby
mansi has quit [Ping timeout: 245 seconds]
bnagy has joined #ruby
spap has joined #ruby
DonVitoCorleone has joined #ruby
ssvo has quit [Ping timeout: 248 seconds]
dayepa has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
bmn has joined #ruby
Dreamer3 has joined #ruby
aalmenar has joined #ruby
aalmenar has quit [Changing host]
aalmenar has joined #ruby
nwertman_ has joined #ruby
blo has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
arturaz has quit [Remote host closed the connection]
visof has joined #ruby
greenysan has quit [Ping timeout: 260 seconds]
atmosx has joined #ruby
stonevil has quit [Remote host closed the connection]
Xeago has joined #ruby
r0bgl33s0n has joined #ruby
rdark has quit [Ping timeout: 264 seconds]
rdark has joined #ruby
gyre007 has joined #ruby
ndrei has quit [Ping timeout: 245 seconds]
timonv has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
nmabry has quit [Quit: nmabry]
dhruvasagar has joined #ruby
ananthakumaran has joined #ruby
amacgregor has joined #ruby
amacgregor_ has quit [Ping timeout: 264 seconds]
ssvo has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
nfk has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
dhruvasagar has joined #ruby
ssvo has quit [Ping timeout: 245 seconds]
thepreacher has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
buibex has joined #ruby
ananthakumaran has joined #ruby
buibex_ has quit [Ping timeout: 260 seconds]
thepreacher has quit [Client Quit]
sevenseacat has quit [Quit: Leaving.]
xbob has quit [Ping timeout: 250 seconds]
snovak has joined #ruby
dhruvasagar has joined #ruby
nomenkun has joined #ruby
bricker`LA has joined #ruby
Xeago has quit [Remote host closed the connection]
zarubin has joined #ruby
ismael_ has joined #ruby
Heero has quit [Ping timeout: 260 seconds]
graydot has joined #ruby
graydot has quit [Client Quit]
ananthakumaran has quit [Read error: Connection reset by peer]
marcgg has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
marcgg_ has quit [Read error: Connection reset by peer]
wildroman has joined #ruby
[0x1a]_ has joined #ruby
snovak has quit [Ping timeout: 276 seconds]
ananthakumaran has joined #ruby
dhruvasagar has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
marcgg_ has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
wildroman has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
wildroman has joined #ruby
RenderRob has joined #ruby
<RenderRob>
is it easy to alternate between versions in rvm?
<xybre>
renderrob: yep
<xybre>
renderrob: rvm use 1.9.3; rvm use 2.0.0
marcgg has quit [Ping timeout: 256 seconds]
himsin has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
senayar_ has joined #ruby
senayar_ has quit [Remote host closed the connection]
senayar has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
senayar has joined #ruby
ananthakumaran has joined #ruby
niceguyjames has joined #ruby
mklappstuhl has joined #ruby
RubyPanther has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
buibex has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
platzhirsch has joined #ruby
<platzhirsch>
Revisiting your 5 month old Ruby code is kind of shocking, what was I thinking when I wrote this *facepalm*
buibex has joined #ruby
<RenderRob>
xybre, nice!
<buzzybron>
any aptana users here?
rubyguy has quit [Ping timeout: 240 seconds]
ananthakumaran has quit [Read error: Connection reset by peer]
guilleiguaran_ has quit [Ping timeout: 248 seconds]
Guest85414__ has quit [Ping timeout: 256 seconds]
lectrick has quit [Ping timeout: 268 seconds]
randym_ has quit [Ping timeout: 268 seconds]
pusewicz_ has quit [Ping timeout: 264 seconds]
karlfreeman has quit [Ping timeout: 245 seconds]
ziyadb has quit [Ping timeout: 240 seconds]
zero7 has quit [Ping timeout: 248 seconds]
mattyohe has quit [Ping timeout: 248 seconds]
Scorchin has quit [Ping timeout: 245 seconds]
rndstr has quit [Ping timeout: 256 seconds]
stonevil has joined #ruby
dhruvasagar has joined #ruby
heidar has quit [Ping timeout: 276 seconds]
mklappstuhl has quit [Remote host closed the connection]
denysonique has quit [Ping timeout: 264 seconds]
kapowaz has quit [Ping timeout: 276 seconds]
ananthakumaran has joined #ruby
buibex has quit [Remote host closed the connection]
keyvan_ has quit [Ping timeout: 256 seconds]
xerxas has quit [Ping timeout: 246 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
bluehavana has quit [Ping timeout: 268 seconds]
davidboy has quit [Ping timeout: 268 seconds]
HavokOC has quit [Ping timeout: 256 seconds]
dnyy has quit [Ping timeout: 264 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Read error: Connection reset by peer]
emergion has joined #ruby
amacgregor has quit [Ping timeout: 248 seconds]
ananthakumaran has joined #ruby
emergion has quit [Client Quit]
dhruvasagar has joined #ruby
jokke1 has quit [Quit: WeeChat 0.4.1]
jokke has joined #ruby
ndrei has joined #ruby
intuxicated has quit [Ping timeout: 245 seconds]
ananthakumaran has quit [Read error: Connection reset by peer]
ndrei has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
senayar_ has joined #ruby
ananthakumaran has joined #ruby
dhruvasagar has joined #ruby
niceguyjames has quit [Quit: Computer has gone to sleep.]
MrZYX|off is now known as MrZYX
ndrei has joined #ruby
senayar_ has quit [Remote host closed the connection]
tommyvyo has quit [Remote host closed the connection]
pipecloud has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
senayar has quit [Ping timeout: 278 seconds]
dennus has quit []
vlad_starkov has quit [Remote host closed the connection]
niceguyjames has joined #ruby
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
pagios has joined #ruby
<pagios>
hello i am trying to communicate from my laptop with my ledkeypad connected to the arduino using this code: http://pastebin.com/L4VKWMT1 nothing happens when i press on the keypad
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
<xybre>
pagios: well, is that the right port?
dhruvasagar has joined #ruby
<pagios>
yes xybre it blinks when i connect to it
ananthakumaran has joined #ruby
wildroman has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 256 seconds]
<xybre>
pagios: So the port and the keypad is working, but you don't think your script is sending?
<pagios>
yes
<pagios>
my script needs to read the keypad strokes
<pagios>
it is not
wildroman has joined #ruby
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
ananthakumaran has quit [Read error: Connection reset by peer]
ndrei has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
<xybre>
pagios: can you confirm that your code is getting to the `gets` line?
intuxicated has joined #ruby
ananthakumaran has joined #ruby
mklappstuhl has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ndrei has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
dhruvasagar has joined #ruby
ewnd9 has joined #ruby
colonolGron has joined #ruby
<xybre>
Also, why are you nesting the while loops?
<pagios>
xybre: it is not getting to the gets
<pagios>
while true do
<pagios>
print "hi" while (i = sp.gets.chomp) do # see note 2 print "hi2"
<pagios>
it prints only hi on the console, not hi2
<xybre>
pagios: the gets method is a blocking action, so if it never receives input, it will sit there forever
<pagios>
so mainly i am not geting the keypad
kayloos has quit [Read error: Connection reset by peer]
kayloos_ has joined #ruby
<xybre>
Thats right, it doesn't appear you are getting anything to read from the SerialPort object
zarubin has quit [Remote host closed the connection]
<pagios>
if i inplug the usb when the script is running it seems to output: hihi2�"�#������e��0�����"�
varfoo has joined #ruby
varfoo has quit [Client Quit]
ndrei has joined #ruby
<xybre>
pagios: Weird, it must be sending a close signal, or maybe just noise?
kapowaz has joined #ruby
Guest85414__ has joined #ruby
denysonique has joined #ruby
zarubin has joined #ruby
<platzhirsch>
the chat is broken
Scorchin has joined #ruby
heidar has joined #ruby
<pagios>
platzhirsch: what do you mean
<pagios>
is this correct? baud_rate = 9600data_bits = 8stop_bits = 1parity = SerialPort::NONE ?
<platzhirsch>
oh nevermind, just saw some nice unicode characters
<xybre>
pagios: that's something you'll have to confirm with the documentation for the device
apfelbox has quit [Read error: Connection reset by peer]
pusewicz_ has joined #ruby
stonevil has quit [Remote host closed the connection]
apfelbox has joined #ruby
srji has joined #ruby
dnyy has joined #ruby
ssvo has joined #ruby
kayloos_ has quit [Remote host closed the connection]
hakunin has quit [Ping timeout: 248 seconds]
procrastinat0r has joined #ruby
browndawg has quit [Ping timeout: 248 seconds]
procrastinat0r has quit [Remote host closed the connection]
sayan has joined #ruby
buibex has joined #ruby
alepore has quit [Quit: This computer has gone to sleep]
Lindrian has joined #ruby
<Lindrian>
Hello
<Lindrian>
Is there a way of limiting backtracking in ruby regex?
ssvo has quit [Ping timeout: 260 seconds]
d2dchat_ has quit [Remote host closed the connection]
Targen has quit [Ping timeout: 245 seconds]
Targen_ has joined #ruby
bluehavana has joined #ruby
nari_ has quit [Ping timeout: 245 seconds]
guilleiguaran_ has joined #ruby
javierbuilder has joined #ruby
javierbuilder has quit [Max SendQ exceeded]
buzzybron has quit [Quit: Leaving.]
mklappstuhl has quit [Remote host closed the connection]
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
niceguyjames has quit [Quit: Computer has gone to sleep.]
<workmad3>
renderrob: it might bore you a bit at times though ;)
<Lindrian>
ty
<shevy>
how do you want to use cgi with a .rb file, how do you get the commandline arguments Lindrian
<RenderRob>
darn
ananthakumaran has joined #ruby
<Lindrian>
shevy: what commandline arguments?
<workmad3>
renderrob: but it'll show you a fair bit of ruby syntax, get you familiar with a fair bit of core ruby and make sure you're aware of some of the interesting edge-case 'gotchas' in the syntax
<RenderRob>
I see
<workmad3>
renderrob: without giving you quite so much hand-holding as a beginners tutorial would
<tagrudev>
ydd is a good place to start and end
<RenderRob>
Is Sinatra still used much or is that out of favor now because of Rails?
<workmad3>
sinatra is still popular for lightweight stuff
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
<shevy>
Lindrian I dont know how you get the params to cgi, that was your code, not mine. I use .cgi page, not .rb file, I have no idea why you use a .rb file and not a .cgi file, that was your idea not mine
<Lindrian>
shevy: i simply want to send some data from my website to a ruby file for it to be executed in ruby behind the scenes, then have ruby output a json string.
<Lindrian>
thats it
<Lindrian>
i dont want ruby to output any html or similar
<Lindrian>
i just want to utilize the ruby language
<shevy>
ok then how do you fetch this data from your website
<workmad3>
Lindrian: yeah, that's sinatra
<Lindrian>
shevy: in python or php i just send some post data, let the language do its thing, then output a json file which my JS code then picks up
<Lindrian>
its a simple ajax call
emergion has quit [Quit: Computer has gone to sleep.]
<Lindrian>
workmad3: could you help me set sinatra up with some basic working code?
nhhagen has joined #ruby
ldnunes has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Read error: Connection reset by peer]
<shevy>
sinatra is so easy man
dhruvasagar has joined #ruby
<shevy>
require 'sinatra'
<shevy>
get '/' do
<shevy>
'Hello world!'
<shevy>
end
<shevy>
arguments to it are available through params
<Lindrian>
how do i install it on windows?
<matti>
shevy: Pastebin!
<sevenseacat>
the sinatra docs are pretty good too
ananthakumaran has joined #ruby
<sevenseacat>
lol, windows
<Lindrian>
i know.
<shevy>
Lindrian use gem
<shevy>
gem install sinatra
<shevy>
and even when you use windows, if irb works, you can do this all in irb
<shevy>
system 'gem install sinatra'
<Lindrian>
so what do i type in the command prompt?
<shevy>
I guess @app.route is the same as using "get" in sinatra
<shevy>
ok but
<shevy>
this still does not explain how they know that my_function() must be called
<Lindrian>
it has @app.route decorator
<shevy>
does flask assume that all functions defined in a file must be used?
<Lindrian>
no.
<Hanmac>
shevy what do you think about "frozen string"f ;P
kayloos has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
<shevy>
hanmac what is the f doing
<Lindrian>
shevy: i want something similar to that python code, but in ruby
<Lindrian>
simple and easy
senayar has quit [Remote host closed the connection]
<shevy>
Lindrian I still do not know how you mysteriously can call my_function() in that code and say that this works
yalue has joined #ruby
<Lindrian>
the decorator says it all
senayar has joined #ruby
<shevy>
magic
<Lindrian>
yes.
<shevy>
whatever the name, it will be called
<shevy>
what if you add 100 functions
ssvo has joined #ruby
<Hanmac>
shevy an f after a string marks a string as frozen ( an b maybe would mark a string as binary) but this is nightly stuff ;P
<shevy>
how does it figure out which one to call?
starfox21 has joined #ruby
<Lindrian>
shevy: it calls the one with the decorator on it.....
<shevy>
aha
<shevy>
now I understand
mikecmpbll has quit [Quit: Computer has gone to sleep.]
<shevy>
that reminds me of how "private" in ruby works
ananthakumaran has quit [Read error: Connection reset by peer]
jlebrech has joined #ruby
mwmnj has joined #ruby
<Lindrian>
now you see what i really want to do shevy, can i do something similar in ruby?
osvico has quit [Ping timeout: 264 seconds]
ananthakumaran has joined #ruby
jdenen has joined #ruby
<shevy>
Lindrian possible sure but probably not with just a few lines of code, ruby does not have such pre-defined decorators as python has for instance
<Lindrian>
okay
<shevy>
it would be nice to do so without rack
ssvo has quit [Ping timeout: 256 seconds]
<shevy>
I have an idea
kvirani has joined #ruby
yacks has quit [Quit: Leaving]
<Lindrian>
the first thing you said, about cgi.new().params
<Lindrian>
seems to be the cloest thing to do what i want
<shevy>
it's hard to compare because I have no idea how flask works and barely any idea outside cgi either ;)
ismaelrb has joined #ruby
zarubin has quit [Remote host closed the connection]
<shevy>
I hate cgi but it was also enough for me to get query params through an URL and I never wanted more complicated stuff... save for redirections or sane URLs perhaps
bluOxigen has joined #ruby
orionstein_away is now known as orionstein
<Lindrian>
thats what i want to do too, query params
<Lindrian>
query params through post and get
blueOxigen has quit [Ping timeout: 248 seconds]
Bira has joined #ruby
brbcoding has joined #ruby
ewnd9 has quit [Ping timeout: 264 seconds]
browndawg has joined #ruby
rcosta has joined #ruby
stonevil has quit [Remote host closed the connection]
rcosta has quit [Remote host closed the connection]
krzkrz has quit [Quit: krzkrz]
lord1234 has joined #ruby
nari_ has joined #ruby
claymore_ has joined #ruby
dEPy has joined #ruby
<dEPy>
Hi all
<dEPy>
I've installed rbenv on my mac and ruby 2.0.0-rc2
zarubin has joined #ruby
sst66 has quit [Ping timeout: 256 seconds]
<dEPy>
if I do ruby -v it shows right version, but when i go "gem install bundler" it installs it under 1.8.7 ruby
<dEPy>
and "rbenv which gem" shows 2.x version also
<dEPy>
any ideas? (it's on MacOS)
kaldrenon has joined #ruby
sst66 has joined #ruby
<Hanmac>
dERy that means that your PATH is wrong and does not have the rbenv stuff inside
<Hanmac>
maybe
claymore has quit [Ping timeout: 276 seconds]
nbouscal has joined #ruby
jealous-pated77 has quit [Quit: jealous-pated77]
jp- has joined #ruby
<Hanmac>
dEPy so "gen env" shows you 1.8.7 ?
<Hanmac>
"gem env"
wildroman has quit [Remote host closed the connection]
tenner36 has joined #ruby
<dEPy>
no, shows 2.0.0-rc2
<dEPy>
oh wait, it says bundle is now installed on 2.x
sailias has joined #ruby
devoldmx3 has joined #ruby
<dEPy>
but, when I run bundle it complains about ":" and wrong syntax which seems like it's using older version?
twoism_ has joined #ruby
adkron_ has joined #ruby
<Hanmac>
hm yeah the ":" on an when is wrong syntax … in which file does it happen?
devoldmx has quit [Ping timeout: 276 seconds]
<dEPy>
in Gemfile
pranny1 has quit [Quit: Leaving.]
<dEPy>
on this line: gem 'devise', github: 'plataformatec/devise', branch: 'master' # Authentication
lord1234 has left #ruby [#ruby]
<Hanmac>
hm yeah then maybe the gemfile is broken
ananthakumaran has quit [Read error: Connection reset by peer]
<dEPy>
It's not likely cause it works fine on my linux machine
claymore_ has quit [Ping timeout: 264 seconds]
twoism has quit [Ping timeout: 264 seconds]
<Hanmac>
hm no this is vaild in ruby … i think you should pick an newer version, not the rc
twoism_ has quit [Ping timeout: 245 seconds]
iamjarvo has joined #ruby
ananthakumaran has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
visof has quit [Ping timeout: 264 seconds]
<dEPy>
but rc-2 is the newest I think :)
locriani has quit [Remote host closed the connection]
Spami has joined #ruby
claymore_ has joined #ruby
<sevenseacat>
see channel topic
<sevenseacat>
no it is not
browndawg has left #ruby [#ruby]
himsin has quit [Quit: himsin]
Hanmac has left #ruby [#ruby]
Hanmac has joined #ruby
krawchyk has joined #ruby
<dEPy>
hm, ok
<dEPy>
i'll try that
tkuchiki has joined #ruby
ndrei has quit [Ping timeout: 261 seconds]
ndrei has joined #ruby
niceguyjames has joined #ruby
Bira has quit [Remote host closed the connection]
girija has quit [Ping timeout: 245 seconds]
ferdev has joined #ruby
colonolGron has quit [Quit: Lost terminal]
burlyscudd has joined #ruby
starfox21 has quit [Quit: starfox21]
snovak has joined #ruby
Monie has joined #ruby
sambao21 has joined #ruby
Bira has joined #ruby
jerius has joined #ruby
wildroman has joined #ruby
jerius has quit [Max SendQ exceeded]
ananthakumaran has quit [Read error: Connection reset by peer]
jerius has joined #ruby
devoldmx has joined #ruby
jerius has quit [Client Quit]
devoldmx3 has quit [Read error: Connection reset by peer]
mwmnj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ananthakumaran has joined #ruby
pumper has joined #ruby
<dEPy>
hm, ok problem is not what I thought it was
ferdev has quit [Ping timeout: 276 seconds]
<dEPy>
seems like bundle calls old version of gem or something already installed on macos
senayar_ has joined #ruby
Tania has joined #ruby
nbouscal has quit [Quit: Computer has commenced electric sheep tracking protocol.]
<dEPy>
Have no idea how to remove it, gem list doesn't show it
<crunch-choco>
bibip, <<EOF breaks on quote, is there a way to avoid that problem?
Zai00 has quit [Ping timeout: 276 seconds]
Zai00_ is now known as Zai00
senayar has joined #ruby
michaellynch has joined #ruby
Squarepy has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
JumpMast3r has joined #ruby
ananthakumaran has joined #ruby
vramana has joined #ruby
kayloos has quit [Remote host closed the connection]
jerius has joined #ruby
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
<crunch-choco>
for instance I want this <<EOF #{variable} EOF, where variable = "Home"
mmitchell has joined #ruby
robscomputer_ has quit [Ping timeout: 272 seconds]
fgo has quit [Read error: Connection reset by peer]
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dhruvasagar has joined #ruby
fgo has joined #ruby
michaellynch has quit [Ping timeout: 245 seconds]
mmitchell has quit [Remote host closed the connection]
<vramana>
Hi, I don't have any knowledge of ruby. But I am trying to install this https://github.com/feedbin/feedbin on Ubuntu 12.04. So far I have installed Ruby 2.0.0-p247 using rvm. then "bundler" gem and postgres-9.2.4 I cloned the feedbin git repo entered the directory.
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
<vramana>
When I try to run bundle. The terminal is showing an error like this ERROR: RVM Ruby not used, run `rvm use ruby` first.
iamjarvo has quit [Ping timeout: 240 seconds]
mmitchell has joined #ruby
<vramana>
Can somebody please help
<vramana>
??
<_br_>
crunch-choco: Doesn't break on quote for me.
JDHankle has joined #ruby
predator217 has quit [Remote host closed the connection]
mpereira has joined #ruby
persand has quit [Quit: persand]
dEPy has quit [Remote host closed the connection]
<crunch-choco>
_br_: oh oops, i guess my script is bugged elsewhere
Maoko has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kpshek has joined #ruby
ffranz has joined #ruby
<wuest>
vramana: sounds like you need to make sure rvm is being used. Try rvm use --default 2.0.0
<workmad3>
with things like Hash and Array, because they're built into core syntax what you end up with is a bad idea rather than a 'well, it's kinda pointless' idea
tilmans has quit [Remote host closed the connection]
dml_ has quit [Client Quit]
gusnasis has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
dml_ has joined #ruby
poga has quit [Remote host closed the connection]
abhim has quit [Ping timeout: 245 seconds]
Nisstyre-laptop has quit [Remote host closed the connection]
angusiguess has quit [Ping timeout: 245 seconds]
niceguyjames has quit [Quit: Computer has gone to sleep.]
tilmans has joined #ruby
huoxito has joined #ruby
<shevy>
hmm we have File.extname
tesuji_ has quit [Ping timeout: 264 seconds]
poga has joined #ruby
<shevy>
is there the reverse.. or rather, how to get all but the extname ?
starfox21 has quit [Ping timeout: 245 seconds]
robscomputer has quit [Ping timeout: 268 seconds]
gyre008 has quit [Remote host closed the connection]
<Hanmac>
File.basename ?
gyre007 has joined #ruby
mrsolo has joined #ruby
dhruvasagar has joined #ruby
quoin has quit [Remote host closed the connection]
starfox21 has joined #ruby
lukec has quit [Quit: lukec]
<shevy>
that does not seem to do anything
<catphish>
i gave up and wrote my own 2-line http client for what was supposed to be an incredibly simple task :)
<shevy>
File.basename "foo.pdf" # => "foo.pdf"
<shevy>
File.extname 'foo.pdf' # => ".pdf"
<Hanmac>
shevy: File.basename(s,File.extname(s))
<shevy>
nice
<shevy>
that's better than my current solution via .gsub
pothibo has joined #ruby
aryaching has joined #ruby
<Hanmac>
hm basename also cuts the dir … :/
robscomputer has joined #ruby
dross_ has joined #ruby
Skylab has joined #ruby
vlad_sta_ has joined #ruby
<Hanmac>
shevy so do you need the dir too? if yes use File.join( File.dirname(s),File.basename(s,File.extname(s))) … or something like rhat (maybe you can use Pathname?)
vlad_starkov has quit [Read error: Connection reset by peer]
<shevy>
I dont need the dir
_serial_ has joined #ruby
<shevy>
but with File.join it becomes really ugly and verbose
<shevy>
like java
angusigu1ss has joined #ruby
stonevil_ has quit [Remote host closed the connection]
tobago has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
tonni has quit [Remote host closed the connection]
<shevy>
hanmac well
visof has quit [Ping timeout: 240 seconds]
<shevy>
they got lots of money to do all those things
kobain has joined #ruby
Macaveli has quit [Quit: Computer has gone to sleep.]
angusigu1ss has quit [Read error: Connection reset by peer]
burlyscudd has quit [Quit: Leaving.]
Tomasso has joined #ruby
jerius has quit [Ping timeout: 256 seconds]
fmcgeough has joined #ruby
ahegyi has joined #ruby
julweber has joined #ruby
Macaveli has joined #ruby
alex__c2022 has joined #ruby
<Tomasso>
i have a class named Context, but it gets confused with other class. I declared a module around it, and in my code referenced it as mapping::Context but I get "class/module name must be CONSTANT (SyntaxError)"
ahawkins has quit [Quit: leaving]
mary5030 has quit [Remote host closed the connection]
jerius has joined #ruby
filipe has quit [Ping timeout: 264 seconds]
tk__ has quit [Quit: ばいばい]
taion809 is now known as zzz_taion
_serial_ has quit [Quit: Ex-Chat]
Macaveli has quit [Client Quit]
yshh has joined #ruby
<hoelzro>
Tomasso: your module's name probably needs to be Mapping
optimusprimem has joined #ruby
optimusprimem has joined #ruby
rgbdev has quit [Quit: rgbdev]
alup has quit [Read error: No route to host]
iamjarvo has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<Todd>
that's as light weight as you're going to get in ruby :)
<Lindrian>
okay, how do I use it?
tonni has joined #ruby
<Todd>
I really don't want to be that guy.
RORgasm has joined #ruby
<Todd>
but I'd probably start by reading the docs
filipe has quit [Ping timeout: 240 seconds]
alex__c2022 has quit [Quit: alex__c2022]
RORgasm has quit [Remote host closed the connection]
RORgasm has joined #ruby
krz has joined #ruby
alex__c2022 has joined #ruby
zachrab has quit [Remote host closed the connection]
vlad_sta_ has quit [Remote host closed the connection]
<Lindrian>
also, why can't I just use CGI?
buzzybron has joined #ruby
cads has joined #ruby
peregrine81 has joined #ruby
<Todd>
You said lightweight :)
swordsmanz has joined #ruby
dodosan has joined #ruby
<Lindrian>
isnt cgi lightweight?
rodacato has quit [Remote host closed the connection]
Quashie has joined #ruby
azcodex has quit [Read error: Connection reset by peer]
<hoelzro>
imo, once you've used Rack once, it's *way* easier to work with than CGI
<Hanmac>
one day i will make a gem that is bigger than all other gems combined … and then i will name it "lightweight" ;P
benwoody has joined #ruby
adambeynon has joined #ruby
<Todd>
Ruby itself isn't really lightweight but I digress. CGI provides horrible performance compared to rack or sinatra (sinatra sits on top of rack).
atmosx has joined #ruby
tjbiddle has joined #ruby
<Lindrian>
is rails much slower?
<Todd>
Sigh.
<Todd>
For every CGI request you have to load the ruby interpreter all over again.
<Todd>
rack/sinatra/rails provide a way around that
<hoelzro>
and all your modules!
Coolhand has joined #ruby
<Todd>
I think what you mean is easy to configure and use.
<Todd>
Lightweight isn't striking me as what you REALLY want.
alekst has quit [Quit: Leaving...]
<Lindrian>
i want rubys equivalence of pythons flask
<Lindrian>
simple, easy and lightweight
<yxhuvud>
then sinatra is what you want.
<banister>
Lindrian also, from what i've read, flash was inspired by sinatra, so it's more like you were using the equivalent of ruby's sinatra in python :)
<banister>
flask
<hoelzro>
mind explosion!
<Lindrian>
ha
<atmosx>
with the power of greyskull
cads has quit [Ping timeout: 264 seconds]
<Todd>
lol.. you guys
<rdark>
banister: ++
niceguyjames has joined #ruby
havenwood has joined #ruby
persand has quit [Quit: persand]
pentameter has joined #ruby
Rym has quit [Ping timeout: 246 seconds]
<Lindrian>
excuse me for a few minutes, gotta take care of my wash. ill pester you in a few again!
peret has joined #ruby
Zonakusu has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
filipe has joined #ruby
ananthakumaran has joined #ruby
nhhagen has joined #ruby
VTLob has joined #ruby
troessner has quit [Quit: Leaving]
girija has quit [Ping timeout: 256 seconds]
guardian_ has quit [Ping timeout: 264 seconds]
boblu has quit [Ping timeout: 246 seconds]
hogeo has quit [Remote host closed the connection]
carlyle has joined #ruby
okinomo_ has quit [Quit: Lost terminal]
okinomo has quit [Quit: Lost terminal]
havenwood has quit [Remote host closed the connection]
randomdrake has joined #ruby
havenwood has joined #ruby
kpshek has joined #ruby
end_guy_ is now known as end_guy
rgbdev has joined #ruby
rodacato has joined #ruby
rodacato has quit [Remote host closed the connection]
JumpMast3r has quit [Quit: JumpMast3r]
yshh has quit [Ping timeout: 256 seconds]
banister has quit [Quit: Computer has gone to sleep.]
kayloos has joined #ruby
__userna1 has joined #ruby
andikr has quit [Remote host closed the connection]
jsatk has joined #ruby
Soda has joined #ruby
niceguyjames has quit [Quit: Computer has gone to sleep.]
zachrab has quit [Remote host closed the connection]
wildroman has quit [Remote host closed the connection]
Targen_ has quit [Read error: Operation timed out]
Criztian has quit [Remote host closed the connection]
gusnasis has quit [Read error: Connection reset by peer]
gusnasis has joined #ruby
iamjarvo_ has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
carlyle has quit [Remote host closed the connection]
blandflakes has quit [Quit: Page closed]
burlyscudd has joined #ruby
greenrose1 has joined #ruby
greenrose has quit [Ping timeout: 245 seconds]
mary5030 has joined #ruby
deception has quit [Quit: Goodbye]
deception has joined #ruby
lukec has joined #ruby
shredding has quit [Quit: shredding]
Xeago has quit [Remote host closed the connection]
benwoody has quit [Quit: benwoody]
Guest77577 is now known as rhys_
rhys_ has quit [Changing host]
rhys_ has joined #ruby
iamjarvo_ has quit [Remote host closed the connection]
Animawish has joined #ruby
iamjarvo has joined #ruby
grits has joined #ruby
m8 has joined #ruby
benwoody has joined #ruby
ArchBeOS has quit [Quit: Leaving]
mary5030 has quit [Remote host closed the connection]
digital-ghost has joined #ruby
ArchBeOS has joined #ruby
ArchBeOS has quit [Changing host]
ArchBeOS has joined #ruby
mary5030 has joined #ruby
niceguyjames has joined #ruby
benwoody has quit [Client Quit]
iamjarvo has quit [Ping timeout: 245 seconds]
burlyscudd has quit [Ping timeout: 264 seconds]
rodacato has joined #ruby
<Lindrian>
fuck this is such a chore
<Lindrian>
still cant get sinatra to run
niceguyjames has quit [Client Quit]
rodacato has quit [Remote host closed the connection]
robscomputer_ has quit [Ping timeout: 264 seconds]
Macaveli has joined #ruby
<shevy>
to run
<shevy>
what do you mean
<shevy>
basic sinatra apps work just fine
<Lindrian>
why do i need this weird ass folder structure?
<shevy>
dunno
snovak_ has joined #ruby
<Lindrian>
why is it so hard just to execute some arbitrary ruby code without having to go through all this hassle
mlpinit_ has joined #ruby
<Lindrian>
jesus christ im getting so annoyed right now
DrCode has quit [Ping timeout: 240 seconds]
<havenwood>
Lindrian: You can just have your Sinatra app live in a single file until it is time to extract it out. The conventions are optional but convenient.
HavokOC has quit [Changing host]
HavokOC has joined #ruby
HavokOC has quit [Changing host]
HavokOC has joined #ruby
<Lindrian>
what does that even mean
cads has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
<shevy>
hehe
devoldmx has quit [Read error: Connection reset by peer]
<Lindrian>
gaaah fucking ruby
snovak has quit [Ping timeout: 248 seconds]
mlpinit has quit [Ping timeout: 240 seconds]
senayar has quit [Ping timeout: 264 seconds]
robscomputer has joined #ruby
dagobah has quit [Remote host closed the connection]
<Lindrian>
i installed ruby, installed sinatra, installed passenger
<Lindrian>
but i still cant run my app
robscomputer has quit [Read error: Connection reset by peer]
unixninja92 has quit [Ping timeout: 264 seconds]
d2dchat_ has quit [Remote host closed the connection]
robscomputer has joined #ruby
<havenwood>
Lindrian: Sinatra requires you to understand what you're doing, but is really powerful when you do. Maybe look at some existing Sinatra apps or even use a generator to create your Sinatra app layout if you aren't comfy with the conventional places things go?
timonv has quit [Remote host closed the connection]
<Lindrian>
I'm just trying to print hello world, nothing else.
mikepack has joined #ruby
wallerdev has quit [Quit: wallerdev]
<havenwood>
Lindrian: Create a single file, called 'app.rb', and like on the home page put: require 'sinatra'; get '/hi' do; "Hello World!"; end
tvw has quit [Read error: Connection reset by peer]
<havenwood>
Lindrian: Then to run your app: ruby app.rb
mityaz has joined #ruby
<havenwood>
Lindrian: There is a Sinatra specific channel too called #sinatra.
<shevy>
hanmac hmm I used to use apachefriends php xampp stack or what the name was
<shevy>
ack 4 years
nhhagen has joined #ruby
<shevy>
do you always randomly try to follow 4 years old guides by unknown people
<Lindrian>
yes.,.
<shevy>
that guide looks indeed awful
<shevy>
look at the crap that is in config.ru
<Lindrian>
looks like the rest of them then
vince_prignano has quit [Ping timeout: 276 seconds]
<havenwood>
Lindrian: Using Passenger with its Apache module is gunna be loads more confusing than just running your app with Webrick, Thin, Unicorn, Puma, or whatever.
<shevy>
I always tell people to not use russian ruby files
<Lindrian>
havenwood: i dont even know what any of those things are
filipe has quit [Remote host closed the connection]
snath has joined #ruby
<Lindrian>
i dont want to host a web server, i just want to be able to send data to a ruby file and have it output json
<shevy>
Lindrian no, there are great guides, but you need to find the right people to write them, not just random entries on the www
<Lindrian>
how on earth can that be so hard.
<shevy>
you never said that before
<shevy>
you said you must fetch data from a website
<Lindrian>
I SAID IT A THOUSAND TIMES
<shevy>
no
d2dchat_ has joined #ruby
mlpinit has quit [Ping timeout: 256 seconds]
<Lindrian>
I said I will POST data THROUGH JAVASCRIPT to RUBY. I then want RUBY to simply output JSON.
<Lindrian>
I will make an AJAX CALL.
<havenwood>
Lindrian: They are Rack webservers. So Sinatra (like Rails) is a DSL/framework build on Rack. On the other side of Rack is a webserver. The default, zero-configuration one is called Webrick. Imho, use that till you have reason to switch (unless you just wanna start with Unicorn or Thin or something sane.)
<Lindrian>
Plain and simple.
gtrak has joined #ruby
<shevy>
"<Lindrian> The only thing I'll need to receive is POST/GET data, and then the rest can probably be done directly in ruby."
<shevy>
"<Lindrian> i want to run a very simple web application, all its going to do is output json."
<Lindrian>
Once more time for you shevy. JAVASCRIPT sends AJAX (through POST) to my_ruby_file.rb. My ruby file then reads the posted JSON, does some stuff with it, outputs a new JSON string.
<Lindrian>
THE END.
<shevy>
I dont think your requirement is simple in the slightest, if it would have been to "send data to a ruby file", you could just use ARGV
<Lindrian>
I also said I don't want to create a new web server.
<Lindrian>
I want apache to serve the script.
nhhagen has quit [Ping timeout: 264 seconds]
jxport has joined #ruby
rodacato has joined #ruby
rodacato has quit [Remote host closed the connection]
<Lindrian>
I dont want to build my site in ruby, I just want to run a script in ruby.
<shevy>
you dont want "just" anywhere
mlpinit has joined #ruby
<Lindrian>
You now know exactly what I want, I hope.
pito has joined #ruby
sr78ger has joined #ruby
<workmad3>
Lindrian: 'a file' can't be posted to
<workmad3>
Lindrian: it needs some form of interface in order to understand a HTTP POST request
<Lindrian>
Right, I can buy that.
adkron_ has quit [Ping timeout: 260 seconds]
<workmad3>
Lindrian: CGI is clunky, old and difficult to work with
<workmad3>
Lindrian: sinatra is pretty easy to work with
quoin has quit [Ping timeout: 268 seconds]
<Lindrian>
i still havent gotten it to work
<Lindrian>
could you please walk me through it?
carlyle has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<workmad3>
Lindrian: however, it does need to be run on a rack adapter (rack is a web server interface for ruby), which requires something like a separate app server (*not* a web server) or a module like phusion passenger
<workmad3>
Lindrian: all the stuff people have linked to here work fine for me :/
<shevy>
use cgi
* apeiros
smacks shevy
Animawish has quit [Quit: Animawish]
<shevy>
apeiros will walk you through Lindrian
<apeiros>
seriously…
cody-- has quit [Quit: Computer has gone to sleep.]
<havenwood>
Lindrian: Follow a tutorial created in 2012 or later. I can't tell if you really need AJAX or if that is just what you're calling POST/PUT requests.
splittingred_ has joined #ruby
<Lindrian>
i followed this
<RubyPanther>
if it is true but just not in the first way you thought of it, you're really not understanding enough to claim it is wrong
Rollabunna has joined #ruby
bio has joined #ruby
bio is now known as Guest11924
<apeiros>
RubyPanther: maybe you check what exactly CGI means. hint: it obviously does not mean what you think it does.
randomautomator has joined #ruby
<Lindrian>
havenwood: dont worry about ajax, i just need to get this running first. the guide i followed isnt helping me
splittingred has quit [Ping timeout: 268 seconds]
splittingred_ is now known as splittingred
<Todd>
if we're actually talking about CGI requests I'm siding with apeiros.. if we're talking about the use of the CGI class or related classes I'd have to check the code
<Lindrian>
require File.expand_path '../app.rb', __FILE__ <---- where should i put my app here?
<RubyPanther>
why are you so sure that I am mistaken, and not yourself?
<Lindrian>
in the folder above the config.ru file?
<RubyPanther>
is CGI a type of "request?"
yacks has quit [Quit: Leaving]
<apeiros>
RubyPanther: CGI is an *interface*
<apeiros>
it's part of the very abbreviation
<Todd>
RubyPanther, CGI is a common gateway interface
<apeiros>
it defines how a script and a webserver communicate
burlyscudd has quit [Read error: Operation timed out]
<zzak>
whats wrong with the recipe?
<apeiros>
and rack does NOT communicate via the CGI protocol with webserver (generally - it can, but it's not advisable)
<jxport>
What *is* the CGI protocol?
radic__ has quit [Read error: Connection reset by peer]
<workmad3>
jxport: old and convoluted :)
<zzak>
Lindrian: put that in yoru config.ru
<Lindrian>
not gonna get any help now am i.
<apeiros>
RubyPanther: I'm so sure because I know the specs and I'm not just talking out of my ass like you.
<Lindrian>
zzak: sure, but where does it link to?
shaunbak_ has quit [Remote host closed the connection]
<jxport>
CGI seems like one of those terms that isn't worth knowing the definition for
<Lindrian>
zzak: should my app.rb file be in the folder above?
<apeiros>
RubyPanther: but please, feel free to provide evidence why all rack is CGI.
<zzak>
you can also just do "require './app.rb'" in modern versions of ruby
<jxport>
Then again, I'm on the side of the fence that doesn't know it
<zzak>
Lindrian: no in the same folder
<workmad3>
zzak: 'require_relative "app.rb" ' in modern rubies
<Lindrian>
zzak: okay. do i put this entire folder structure inside my htdocs folder or outside of it?
<apeiros>
jxport: correct. it's rather useless nowadays. the reason I know it is because I wrote my first CGI >15y ago when it was more or less the only way
<zzak>
Lindrian: you can setup a virtual host and put it anywhere you want
<workmad3>
zzak: 'require "./app.rb" ' has always worked... and has always been problematic, because '.' is dependent on the CWD of the process, not on the file you're currently in ;)
<zzak>
Lindrian: did you see the bit about Virtual Host?
<apeiros>
the one advantage CGI has is that it is *very* simple
<apeiros>
all you need is stdin, stdout and env
<Todd>
CGI basically takes a request, figures out what interpreter is needed to handle the request, forks the handler, then returns whatever the handler returns(overly simplistic). fastcgi is an attempt to fix this by allowing a process to be long running as apposed to forking for every request.
Rollabunna has quit [Ping timeout: 264 seconds]
<zzak>
noise noise noise
<workmad3>
apeiros: rack is pretty simple in ruby terms :)
<apeiros>
workmad3: rack is very complex
<apeiros>
workmad3: it is simple *to use*
<RubyPanther>
generally you can check your ENV vars, and if there is webby gunk in there, then CGI is actually still being used most likely. Even though you're not using a thing in the webserver that is labeled "cgi" and everything is labeled as something else
<Lindrian>
zzak: ill add a new virtualhost, hold on.
<Todd>
RubyPanther, that makes no sense
mlpinit has quit [Remote host closed the connection]
<zzak>
Lindrian: im on the edge of my seat
<Lindrian>
zzak: what?
<zzak>
on hold
spider-mario has quit [Remote host closed the connection]
mlpinit has joined #ruby
<workmad3>
apeiros: fair enough... I tend to think of 'rack' in terms of the interface it needs within a ruby object, rather than the stuff it does to interface to HTTP requests
<RubyPanther>
okay, okay, if it made _no_sense_ then I apologize, it must have been phrased in way that is inaccessible. Surely doesn't make it nonsense, however. Or untrue.
<zzak>
if i go afk, its only because ive completely given up on irc, but you can just pm me or whatever
jlast has quit [Remote host closed the connection]
<Lindrian>
if I already have a
<Lindrian>
<VirtualHost *:80>, should I still create a new one?
mlpinit has quit [Read error: Connection reset by peer]
<Lindrian>
or append to the previous one?
<zzak>
Lindrian: what does the recipe say?
<Lindrian>
Does not specify.
Macaveli has quit [Quit: Computer has gone to sleep.]
<Lindrian>
Just says "setup"
mlpinit has joined #ruby
snovak_ has quit [Remote host closed the connection]
<Lindrian>
But this virtualhost would conflict with my previous one
<workmad3>
apeiros: but you're right... the stuff it does to interface to the request environment is pretty complex :)
timonv has joined #ruby
<apeiros>
workmad3: LOC alone tells you as much ;-)
<Lindrian>
they cant both listen to the same port and have different documentroots
<zzak>
Lindrian: right
snovak has joined #ruby
<workmad3>
apeiros: yeah, 'rack the implementation' vs 'rack the interface'
<zzak>
Lindrian: you could try a different port just to test that it works
<workmad3>
apeiros: you were, I believe, talking implementation, while I was talking interface ;)
ghr has quit [Quit: Computer has gone to sleep.]
<Lindrian>
alright
<apeiros>
but it's not really fair to compare CGI impl. with rack impl
<apeiros>
since rack covers multiple avenues while CGI will always only be a single one
<Lindrian>
ideally i would like it all under the same virtualhost, and not running different servers on different ports
<apeiros>
workmad3: yes. I think we don't differ in opinion.
<workmad3>
apeiros: not on this situation anyway :)
<zzak>
apeiros: are you going to arrrcamp next month?
<Todd>
Lindrian, what you want is name based virtualhosts
<apeiros>
zzak: no confs for me this year :(
<Todd>
Lindrian, in which case <*:80> is correct as long as you want it to listen on all interfaces
<RubyPanther>
Lindrian: you can't just use a half-ass recipe on apache config, you need either a full recipe, or years of practice at apache wrestling
<zzak>
half-assed or not, whats wrong with it can be fixed, right?
mityaz has quit [Quit: See ya!]
<Lindrian>
zzak: I added the virtualhost for port 8080, not working.
__userna1 has quit [Quit: none 0.4.1]
<RubyPanther>
I dunno, I see stuff about a wrong vhost, probably lots of stuff is wrong
wallerdev has joined #ruby
camilasan has quit [Remote host closed the connection]
<zzak>
Lindrian: whats your vhost look like?
<RubyPanther>
I don't see the file, is there is gist?
<Lindrian>
just like in the recepie
<Lindrian>
recipe
<RubyPanther>
fail
<RubyPanther>
maybe it is... maybe it isn't
<zzak>
Lindrian: did you change the "/path/to/whatever" to point to your app?
<Lindrian>
i made it point to /public like in the example
camilasan has joined #ruby
<zzak>
does your app have a public dir?
<Todd>
Lindrian, pastebin or bust
sayan has joined #ruby
carlyle has quit [Remote host closed the connection]
<apeiros>
Lindrian: I'd put the project on github as a public repository. easier for the others to help.
<workmad3>
Todd: please, please, not pastebin :( gist or pastie
* apeiros
won't help - still at work
<Lindrian>
zzak: i just followed the guide, i dont even have an app yet.
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
<zzak>
Lindrian: you dont have an app? :(
<Todd>
workmad3, meh.. I don't care either way
<Todd>
workmad3, just paste it somewhere
<RubyPanther>
the example shouldn't be interesting to anybody but you, the file you're actually using is all somebody should want to see to help you . It is bad enough to have to read one broken config file, you want us to also read a sucky, unclear recipe?
<workmad3>
Todd: :)
camilasan has quit [Remote host closed the connection]
<Todd>
Lindrian, write the sinatra application and test it using the build in web server! that's what it's for!
<Lindrian>
I created an app.rb file
<Todd>
Lindrian, when the application is written THEN you deploy it to your apache environment
<Todd>
s/build/built/
end_guy has quit [Remote host closed the connection]
radic has joined #ruby
<zzak>
yeah, i would worry about deployment last
<Lindrian>
its just the hello world example.
<RubyPanther>
so use a hello world that uses webrick
Animawish has joined #ruby
Animawish has quit [Client Quit]
<workmad3>
Lindrian: hmm... didn't you say you were workning on windows?
<Lindrian>
im on debian now
<workmad3>
ah, ok :)
<zzak>
the recipe should still work tho, however suck, unclear, and half-assed it is
<Lindrian>
i have to go take care of my wash, give me a few minutes.
<zzak>
i helped write it, and as one of the maintainers, should help fix it if theres something wrong
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
lucazi has quit [Quit: Leaving.]
ananthakumaran has quit [Quit: Leaving.]
mlpinit has quit [Remote host closed the connection]
locriani has joined #ruby
jlebrech has quit [Quit: Konversation terminated!]
nomenkun has quit [Ping timeout: 276 seconds]
rodacato has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
dkamioka has quit [Remote host closed the connection]
adkron_ has joined #ruby
cads has quit [Ping timeout: 246 seconds]
apfelbox_ has joined #ruby
iamjarvo has joined #ruby
pabloh has quit [Remote host closed the connection]
zeade has joined #ruby
krz has quit [Quit: krz]
maasdesigner has joined #ruby
tjbiddle has joined #ruby
NealJ has quit [Ping timeout: 248 seconds]
Macaveli has joined #ruby
dachi has joined #ruby
MarcWeber has quit [Ping timeout: 264 seconds]
<dachi>
Hello everybody. Please help. Inside a gem, when creating a file, ie File.open("file.txt.... How to indicate a correct path relative to gem's root
Targen has joined #ruby
jhn has joined #ruby
apfelbox has quit [Ping timeout: 260 seconds]
<apeiros>
dachi: you can't rely on gem's structure to remain the same when installed
splittingred has quit [Quit: splittingred]
<apeiros>
dachi: I usually use Gem.datadir(gemname)
<dachi>
apeiros: thanks and how do I write to files then, which directory path should I indicate?
lukec has quit [Quit: lukec]
<apeiros>
you should *absolutely not* write files into your gem dir
<apeiros>
you may not even have write access
blackmesa has quit [Ping timeout: 240 seconds]
cads has joined #ruby
kaldrenon has quit [Remote host closed the connection]
<dachi>
File.open(Gem.datadir('my_gem') + '/file.cvs'). .. . like this?
kaldrenon has joined #ruby
<dachi>
Oh okay. So I need to have a csv file or similar to store info downloaded from web
<dachi>
Should I rely on ~ Home directory then?
rodacato has joined #ruby
<apeiros>
for example, yes. or allow the user to specify a location.
jokke has quit [Ping timeout: 245 seconds]
<dachi>
great. thank you!
greenysan has joined #ruby
buzzybron has quit [Quit: Leaving.]
mlpinit has joined #ruby
goleldar has joined #ruby
rodacato has quit [Remote host closed the connection]
azcodex has joined #ruby
timonv has quit [Remote host closed the connection]
yshh has joined #ruby
aganov has quit [Remote host closed the connection]
julweber has quit [Remote host closed the connection]
mklappstuhl has quit [Remote host closed the connection]
Macaveli has quit [Remote host closed the connection]
dkamioka has joined #ruby
rupee has joined #ruby
iamjarvo has quit [Remote host closed the connection]
ckampfe has joined #ruby
nwertman_ has joined #ruby
altamic has joined #ruby
MarcWeber has joined #ruby
kpshek has quit []
altamic has left #ruby [#ruby]
jokke has joined #ruby
nwertman has quit [Remote host closed the connection]
SHyx0rmZ has joined #ruby
Zai00 has quit [Quit: Zai00]
lukec has joined #ruby
Rym has joined #ruby
randomdrake has quit [Quit: randomdrake]
jlast has joined #ruby
randomdrake has joined #ruby
<Lindrian>
zzak: i followed it and im not able to get it to work
ixti has joined #ruby
<Lindrian>
i have no bloody clue what im doing wrong
x1337807x has joined #ruby
locriani has quit [Remote host closed the connection]
Ripp__ has joined #ruby
crunch-choco has quit [Quit: leaving]
tylersmith has joined #ruby
tabolario has joined #ruby
sepp2k has joined #ruby
kjellski has joined #ruby
atmosx has quit [Quit: WeeChat 0.4.1-rc2]
sayan has quit [Quit: Leaving]
iliketur_ has joined #ruby
iamjarvo has joined #ruby
svend has joined #ruby
KevinSjoberg has joined #ruby
platzhirsch has joined #ruby
<platzhirsch>
roar
c0rn has joined #ruby
dankest has quit [Quit: Peace]
Al__ has quit [Quit: Al__]
Loaft has joined #ruby
jlast has quit [Ping timeout: 240 seconds]
shunt has joined #ruby
<Lindrian>
ive grown to hate ruby over a period of less than 3 hours.
<platzhirsch>
Lindrian: btw. why have you started to learn Ruby? :)
azcodex has quit [Quit: azcodex]
<Lindrian>
learn ruby they said
tvw has joined #ruby
<Lindrian>
its a great language they said
<Lindrian>
its so easy they said
enebo has quit [Ping timeout: 246 seconds]
<platzhirsch>
What's your background?
jerius has quit [Ping timeout: 246 seconds]
<Lindrian>
java, python, javascript, php, .NET
<Lindrian>
among other things
nwertman has joined #ruby
carraroj has joined #ruby
<platzhirsch>
and what annoys the most at the moment about Ruby?
<Lindrian>
i havent even managed to deploy my app
<Lindrian>
>.<
<havenwood>
Lindrian: You seem to be stuck on configuring an Apache module. Apache confs are a bad way to learn Ruby. :P
<banisterfiend>
Lindrian deploy to heroku
<havenwood>
Lindrian: Serve your app on the default port, forget port 80 at least until you have something to serve up. Then you can move forward and learn rather than being stuck on fact that you aren't familiar enough with Apache to get the server setup right away.
svend has quit [Remote host closed the connection]
<Lindrian>
banisterfiend: i would rather have it on my own server
quoin has joined #ruby
<Lindrian>
havenwood: theres no point for me to learn ruby if i cant get it to work with apache right now
<Lindrian>
it would be a waste of time
<havenwood>
Lindrian: Get something running in dev that is actually doing something, then worry about deployment. Easier to deploy when something works.
<Lindrian>
i have working hello world
YaNakilon has quit [Ping timeout: 248 seconds]
<zzak>
Lindrian: can you open a ticket?
<havenwood>
Lindrian: Okay, so serve it up on a port other than 80?
<Lindrian>
i have tried havenwood
<havenwood>
Lindrian: Ports are open?
<Lindrian>
yes.
<zzak>
Lindrian: that recipe was written around 3 years ago
<platzhirsch>
I am downloading compressed files, like gzip and zip and want to uncompress them on the disk. Is there another approach than system("gunzip #{file}")?
jhn has quit [Ping timeout: 268 seconds]
<platzhirsch>
before I did the uncompressing in Ruby with zlib and zipruby
<Hanmac>
hm there are gems that use libarchive … (but mine isnt commited for a long time)
<Lindrian>
ill attack this another day
DanKnox_away is now known as DanKnox
<Lindrian>
is there a quick and easy way to remove all the ruby related files I had to add?
quoin has quit [Ping timeout: 240 seconds]
<havenwood>
Lindrian: Uninstall all gems?
<platzhirsch>
hanmac: just found you repo
<Hanmac>
platzhirsch: you can make issues if you have problems with it ...
<havenwood>
Lindrian: (Gems are the packages like Sinatra and Passenger. Is that what you want to remove?)
<platzhirsch>
hanmac: yeah, I will definietly make you some issues
<Lindrian>
havenwood: yes
<platzhirsch>
heh, well I am just wondering now, what's the advantage over just jamming out the system commands
<Lindrian>
havenwood: i want to return to where i was before i installed all of this stuff
YaNakilon has joined #ruby
d2dchat_ has quit [Ping timeout: 264 seconds]
<platzhirsch>
well, it's a programmatic approach where i don't have to deal with the file ending
<platzhirsch>
file type*
ixti has quit [Read error: Connection reset by peer]
stkowski has joined #ruby
mwmnj has joined #ruby
<havenwood>
Lindrian: You can `rm -rf $GEM_HOME` to nuke all the gems. In the upcoming RubyGems 2.1.0.rc.1 you can: gem uninstall --all
<havenwood>
Enough people asked here how to uninstall all gems that I submitted a patch. :P
jerius has joined #ruby
rdark has quit [Quit: leaving]
<havenwood>
2.1 ftw!
<havenwood>
Can use now with: gem update --system --pre
jdolitsky1 has joined #ruby
ixti has joined #ruby
<Todd>
rvm gemset empty <-
<Todd>
I know rvm is the devil.
<platzhirsch>
no, RVM to the rescue
<havenwood>
chruby!
asobrasil has joined #ruby
katselphrime has quit [Remote host closed the connection]
nickbend_ has joined #ruby
<havenwood>
No idea if anyone uses it but RVM actually has a Mini-RVM mode where it installs Ruby but uses chruby to select versions: https://rvm.io/workflow/chruby
nickbend_ is now known as nickbender_
<platzhirsch>
The pricing at Heroku is hilarious
jlast has joined #ruby
obs has quit [Quit: Konversation terminated!]
<havenwood>
platzhirsch: lolroku
atmosx_ has quit [Quit: Lost in trance]
<platzhirsch>
havenwood: bless you
relix has joined #ruby
hukl has joined #ruby
azcodex has joined #ruby
felixjet has joined #ruby
Es0teric has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
twoism has joined #ruby
kpshek has joined #ruby
MrPoT4tO has joined #ruby
azcodex has quit [Read error: Connection reset by peer]
maasdesigner has quit [Ping timeout: 246 seconds]
baordog_ has joined #ruby
<shevy>
do you guys use coloured output when you write .rb file for commandline stuff?
azcodex has joined #ruby
<Lindrian>
when i used CGI i was able to simply send data to my ruby app without any hussle
zigomir has quit [Read error: Connection reset by peer]
<Lindrian>
all i did was install ruby and worked from there.
<Lindrian>
(added .rb to apache cgi)
ssvo_ is now known as ssvo
apfelbox_ has quit [Remote host closed the connection]
chairabanta has joined #ruby
alekst has joined #ruby
<Lindrian>
why cant sinatra be as easy
zigomir has joined #ruby
hukl has quit [Remote host closed the connection]
RobW_ has quit [Quit: RobW_]
apfelbox has joined #ruby
hukl has joined #ruby
baordog_ is now known as solidoodlesuppor
<havenwood>
Lindrian: Just a different problem domain. Embedding a script in a webpage versus a web app with its own webserver.
zeade has quit [Quit: Leaving.]
<Lindrian>
I want the former
<Lindrian>
I dont want a web app and a webserver
<platzhirsch>
shevy: do you mean coloring the console output?
blaxter has quit [Quit: foo]
<shevy>
Lindrian did I not tell you to use cgi!!!
<Lindrian>
but its the only thing that works
<shevy>
the frameworks are more complicated because they integrate rack
<Lindrian>
i tried using your fancy frameworks
<shevy>
my?
<shevy>
I dont use any frameworks, I use only .cgi since about 7 years
<havenwood>
Lindrian: For static website generation Jekyll is really nice: http://jekyllrb.com/
<platzhirsch>
CGI? Hipster platzhirsch does not approve
zarubin has quit [Ping timeout: 245 seconds]
<shevy>
platzhirsch yeah... let's say normal ruby code is "black on white" on your console, or something like that
<shevy>
platzhirsch do you use only black+white, or also colours? and if colours, what do you use for that in your ruby files?
RobW_ has joined #ruby
mrwizard has quit [Quit: leaving]
<platzhirsch>
shevy: I have provided a customization for my Rails logger, which prints WARN, INFO, ERROR in different colors
shunt has quit [Quit: leaving]
endash has joined #ruby
<shevy>
the problem is when you dont use cgi, you must use a myriad of things that take time to learn... like rails
<shevy>
platzhirsch ok but how do you do that, can you give a minimal example?
mklappstuhl has joined #ruby
<shevy>
like you want to show info, then error
<shevy>
info "You suck."
<Lindrian>
havenwood: but this still gets served by its own server
<shevy>
error "Because you suck, we must remove all your files now."
<havenwood>
shevy: I like to use colors in command line apps. Usually just red and green, sometimes blue.
ferdev has quit [Quit: ferdev]
zarubin has joined #ruby
mansi has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
<havenwood>
Lindrian: Yeah, it is the Ruby way (if you're setting up a server from scratch, it is cake).
<shevy>
havenwood ok... three colours (and black/white I guess, so five perhaps). How do you do that for the colour output though? do you use a specific library or hardcoded values for the colours?
mrwizard has joined #ruby
vlad_starkov has joined #ruby
nhhagen has joined #ruby
<shevy>
Lindrian hates servers
<havenwood>
Lindrian: If you just want access to a Ruby gem or Ruby scripting in an existing PHP or whatev website then CGI may be the path of least resistance.
<havenwood>
shevy: Depends how many colors I need and if bold is also needed.
<shevy>
ok let's make it simple, only 3 colours, no boldness
<havenwood>
and does red always mean abort?
<shevy>
hehehe
<havenwood>
or warn?
<shevy>
hmmmmm
<havenwood>
what colors?
<shevy>
I use it only for warn... actually, I use red for both warn and abort
saarinen has joined #ruby
<shevy>
but I want to see what people use for colour-output in general
<Todd>
oh my God.. I've ate lunch, took a walk and smokes and we're still harping on CGI.
jbpros has joined #ruby
<Todd>
/ragequit :[
Tuxist has joined #ruby
<shevy>
Todd but you heard Lindrian complain... anything else is more complicated to use than python's flask
ndrei has joined #ruby
splittingred has joined #ruby
greenysan has quit [Ping timeout: 268 seconds]
<Todd>
shevy, he's been requiring hand holding since this morning
<shevy>
he was using windows for a long while
kidoz has joined #ruby
<platzhirsch>
shevy: puts "\033[31mColor!\033\n"
<platzhirsch>
prints Color! in red
<shevy>
ok
<shevy>
that is the hardcoded approach
<shevy>
but do you really use that in a .rb file?
mklappstuhl has quit [Remote host closed the connection]
carraroj has quit [Ping timeout: 260 seconds]
<platzhirsch>
shevy: It sounds strange when you say, use that in a rb file?
<shevy>
yeah, a script
dankest has joined #ruby
<platzhirsch>
ok, well no
<shevy>
hmmmmm
<platzhirsch>
Isn't there a nice gem which wraps that behavior?
end_guy has joined #ruby
<shevy>
that is the thing... it seems people use ruby differently than I do :\
jibi has quit [Quit: .]
<platzhirsch>
shevy: so you want to craft a rainbow tool?
<shevy>
there are many colour related gems, sure. but I think most are rather annoying... I'd like to find someone who uses colour-related output since a very long time and can "swear by one library / way to rule them all"
polaco_zZz is now known as polaco
<shevy>
platzhirsch one that would be better than the others sure... but right now it seems barely anyone else is doing coloured output in ruby :\
<shevy>
or perhaps you have all been converted into web-people
<platzhirsch>
shevy: the gem bundler uses colors :P
noopq has joined #ruby
<shevy>
hmm true... I shall find out how it does that
nickbender_ has quit [Remote host closed the connection]
<platzhirsch>
I think colors should be used sparely in a console tool
brain_shim has quit [Ping timeout: 245 seconds]
<platzhirsch>
sparsely*
<shevy>
:(
<Lindrian>
havenwood: then i guess im going to stick with CGI
<shevy>
Lindrian \o/
<Lindrian>
havenwood: if i bother with ruby at all
<shevy>
that's how I used php for a long time!
<shevy>
then I wanted to write an IRC bot in php
<shevy>
and failed
<shevy>
then I tried in ruby
<shevy>
and got it working after some days
<platzhirsch>
and then you painted the bot colorful?
zeade has joined #ruby
alvaro_o has joined #ruby
<shevy>
platzhirsch haha almost
<shevy>
there are IRC colours right? test
<shevy>
I got them to work too
<Mattias>
PHP, Ruby? What are we talking about?
<shevy>
but then I did not change it since 2 years
<Mattias>
running a ruby and php server?
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
<shevy>
Mattias coloured output from a ruby script
<platzhirsch>
Mattias: crazy things are happening here, someone brought drugs
<Mattias>
and how did php get into this?
<xybre>
Mattias: this dude is mad at ruby for not being php
<shevy>
Lindrian is talking mostly about sinatra, ruby and php
<Mattias>
-.-
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
vlad_starkov has quit [Ping timeout: 240 seconds]
ananthakumaran has joined #ruby
<Morrolan>
Mattias: He doesn't like that you need an application server for Ruby web apps.
<shevy>
Mattias I mentioned php because Lindrian said he will stick to CGI, which is what I did when I used php... I only wrote stupid little .php files that displayed useless things to me
<Morrolan>
E.g. "why is there no mod_ruby for apache"
<Mattias>
just use nginx, then proxy to php-fpm / ruby server
<shevy>
and E.g. "why is it all so complicated"
<Mattias>
nginx is the shiz
browndawg has left #ruby [#ruby]
vlad_starkov has joined #ruby
jaimef has quit [Excess Flood]
<wuest>
Mattias: truth.
c0rn has joined #ruby
persand has joined #ruby
mikeg has joined #ruby
jaimef has joined #ruby
azcodex has quit [Quit: azcodex]
maasdesigner has joined #ruby
<Lindrian>
big man shevy
azcodex has joined #ruby
<apeiros>
Lindrian: if you want "mod_php" style stuff, take a look at rack-server-pages
<Mattias>
Back to reading about edible mushrooms~
graft has joined #ruby
graft has joined #ruby
persand has quit [Client Quit]
crus has quit [Ping timeout: 240 seconds]
<Morrolan>
Mattias: As in, "I just learned that there's edible mushrooms", or as in "I want to gather some myself without getting food poisoning"?
jprovazn has joined #ruby
<Mattias>
Morrolan: Learning more of them so I can pick more when in the woods :)
zachrab has joined #ruby
cascalheira has joined #ruby
<Morrolan>
Ah. :)
splittingred has quit [Quit: splittingred]
peta_ has joined #ruby
robscomputer has quit [Read error: Connection reset by peer]
<Lindrian>
or "i want to know which get me high"
razi has quit [Quit: Leaving.]
<Mattias>
This book has 100~ edible mushrooms (Swedish book, Swedish mushrooms)
robscomputer has joined #ruby
<shevy>
wtf
<shevy>
swedish mushrooms
razi has joined #ruby
locriani has joined #ruby
<Mattias>
Yeah, it lists all the common ones located in sweden :)
robscomputer has quit [Read error: Connection reset by peer]
apeiros has quit [Remote host closed the connection]
<Lindrian>
shevy: all I am going to do with ruby is accept post/get and output json. i feel its unnecessary to run an entire server just for that.
<toothe>
so, its the equivalent of "return privateVariable;" in C++
<Morrolan>
Yea. The last value in a function gets, implicitly, returned.
<toothe>
kewl, thanks :-)
<MrZYX>
method ;P
<Morrolan>
Screw terminiology. :P
<Morrolan>
s/nio/no/
<rkowalick>
instance variables are one of the main ways an object can store state
<Mattias>
Morrolan: So, do you pick mushrooms?
mcat1 has joined #ruby
<Morrolan>
Mattias: Nah, I was just curious. :)
<Morrolan>
MrZYX: But yea, I have a hard time remembering what's what. (Maybe it's because I don't try too hard ;D)
<MrZYX>
methods have an receiver, functions don't
rodacato has joined #ruby
rkowalick has quit [Quit: Page closed]
<MrZYX>
ruby has no functions ;)
<Lindrian>
should i not have passenger.conf or similar under /etc/apache2/mods-available?
alpha123 has joined #ruby
<banisterfiend>
Lindrian did you name yourself after a character in a narnia book?
YaNakilon has quit [Ping timeout: 240 seconds]
<Lindrian>
i dont think so
<Lindrian>
why?
cads has quit [Ping timeout: 260 seconds]
ferdev has joined #ruby
julweber has joined #ruby
c0rn has joined #ruby
Speed has joined #ruby
awarner_ has joined #ruby
iamjarvo has quit [Remote host closed the connection]
azcodex has quit [Remote host closed the connection]
<wuest>
Mattias: one of the things I miss most from my trip to the general area (Finland, given, but geographically similar) is fresh mushrooms.
iamjarvo has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
awarner has quit [Ping timeout: 245 seconds]
<platzhirsch>
hanmac: I am looking through libarchive-ruby, I cannot rename the archive extraction through this, can I? This has to be done afterwards?
kjellski has joined #ruby
YaNakilon has joined #ruby
iamjarvo has joined #ruby
ixti has quit [Read error: Connection reset by peer]
angusiguess has joined #ruby
ixti has joined #ruby
<Hanmac>
platzhirsch, hm i dont think it works, but you can use 2 Archive objects and move the files from one to the other
julweber has quit [Ping timeout: 264 seconds]
ndrei has quit [Ping timeout: 260 seconds]
kobain has quit [Ping timeout: 252 seconds]
Targen has quit [Quit: No Ping reply in 180 seconds.]
ananthakumaran has quit [Quit: Leaving.]
Targen has joined #ruby
headius has joined #ruby
azcodex has joined #ruby
<platzhirsch>
hanmac: mh, I meant that I want to rename the file inside an archive after extraction (or before)
mcat1 has left #ruby [#ruby]
yacks has joined #ruby
mlpinit has quit [Read error: No route to host]
<Hanmac>
hm i hink i need to test something (normaly the name may not be changeable … )
quoin has joined #ruby
mikeg has quit [Remote host closed the connection]
mlpinit has joined #ruby
iamjarvo has quit [Ping timeout: 260 seconds]
sethetter has left #ruby [#ruby]
ndrei has joined #ruby
<platzhirsch>
in any case, .extract returns an array of extracted files so I could use the result to perform the renaming
Tomasso has quit [Read error: Connection reset by peer]
Ripp__ has joined #ruby
xk_id has quit [Quit:
RobW_ has quit [Read error: Connection reset by peer]
Tomasso has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
quoin has quit [Ping timeout: 264 seconds]
V8Energy has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<V8Energy>
is there a method to specify which character to trim in the end of the string? like "test.".trim('.') ?
havenwood has quit [Remote host closed the connection]
lele has quit [Ping timeout: 264 seconds]
<MrZYX>
if it's just one: .chomp
<Hanmac>
platzhirsh you can also extracts specific files
<V8Energy>
thanks
RobW_ has joined #ruby
havenwood has joined #ruby
azcodex has quit [Remote host closed the connection]
iamjarvo has joined #ruby
<platzhirsch>
hanmac: yeah, found that on your README doc :)
rupee has quit [Quit: Leaving]
lele has joined #ruby
burlyscudd has joined #ruby
alekst has joined #ruby
carraroj has joined #ruby
havenwood has quit [Ping timeout: 260 seconds]
Bira has quit [Remote host closed the connection]
azcodex has joined #ruby
fenicks has joined #ruby
unixninja92 has quit [Read error: Connection reset by peer]
unixninja92 has joined #ruby
marcdel has joined #ruby
<Hanmac>
platzhirsch, there is also an way to extract files inside into IO objects …
Targen has quit [Read error: Connection reset by peer]
<platzhirsch>
hanmac: yeah, feeling meta-vibes here
mikeg has joined #ruby
Targen has joined #ruby
apeiros has joined #ruby
burlyscudd has quit [Ping timeout: 268 seconds]
<platzhirsch>
that's really cool if you want to work memory efficient
<platzhirsch>
and with my 1 GB RAM this gets my attention
apfelbox has quit [Remote host closed the connection]
rcosta has joined #ruby
yacks has quit [Read error: Operation timed out]
apfelbox has joined #ruby
momomomomo has joined #ruby
ckampfe has quit [Ping timeout: 264 seconds]
<Hanmac>
platzhirsch: info: my ones currently does not use temp files for the archives … that means all data for making and reading archives are stored inside the ram … just in case you want to extract an archive that is bigger than your ram ...
Kabaka has quit [Remote host closed the connection]
carraroj_ has joined #ruby
carraroj has quit [Ping timeout: 264 seconds]
<platzhirsch>
Nooooooo
carraroj_ is now known as carraroj
<platzhirsch>
gem uninstall libarchive-rubyu
carraroj has quit [Client Quit]
carraroj has joined #ruby
apfelbox has quit [Ping timeout: 240 seconds]
nwertman_ has quit [Quit: leaving]
Kabaka has joined #ruby
nwertman_ has joined #ruby
<Hanmac>
platzhirsch: i currently dont know how to solv it the nice way
Nilium has quit [Ping timeout: 276 seconds]
greenysan has joined #ruby
<platzhirsch>
I can imagine
vlad_sta_ has joined #ruby
atmosx has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
jonathanwallace has joined #ruby
hanoi has joined #ruby
nickbend_ has joined #ruby
<banisterfiend>
platzhirsch u have only 1 gig ram?
<zzak>
Lindrian: i think there is a #passenger channel for help
<platzhirsch>
banisterfiend: on my linode VPS ;)
<banisterfiend>
ah
<apeiros>
wow, still at that problem?
<apeiros>
somehow that's impressive
vlad_starkov has quit [Ping timeout: 240 seconds]
<platzhirsch>
I think 25 USD is already expensive enough for fooling around
<platzhirsch>
apeiros: do you mean me?
s0ny123 has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
<apeiros>
no, Lindrian
greenysan has quit [Ping timeout: 264 seconds]
<platzhirsch>
phew
<zzak>
apeiros: i am very latent
Speed has quit [Ping timeout: 240 seconds]
AlSquire has joined #ruby
rcosta has quit [Remote host closed the connection]
yebyen has left #ruby [#ruby]
<shevy>
you are a damn lagger
polaco is now known as polaco_zZz
<shevy>
do we use a "spec/" dir or a "specs/" dir? hmm
<shevy>
or a "specification/" dir... or perhaps just a "test/" dir instead
havenwood has joined #ruby
rodacato has quit [Remote host closed the connection]
blackmesa has joined #ruby
ner0x has joined #ruby
obs has joined #ruby
RobW_ has quit [Quit: RobW_]
iamjarvo_ has joined #ruby
<atmosx>
shevy: did you receive an email from Conjune LLC?
burlyscudd has joined #ruby
<shevy>
huh?
<shevy>
dont think so
timonv has quit [Read error: Operation timed out]
unixninja92 has quit [Ping timeout: 268 seconds]
<shevy>
perhaps in spam folder but I never look into that one :\
apfelbox has joined #ruby
ndrei_ has joined #ruby
zachrab has quit [Remote host closed the connection]
iamjarvo has quit [Ping timeout: 240 seconds]
<Lindrian>
apeiros: oh okay then
nickbend_ is now known as nickbender_
<apeiros>
hm?
<Lindrian>
you said no
jbpros has joined #ruby
<Lindrian>
assumed you were answering my question
<apeiros>
Lindrian: I was answering platzhirsch's question
jbpros has quit [Client Quit]
Coolhand has quit [Remote host closed the connection]
<apeiros>
he asked whether I was referring to him/his question, and I replied "No, [I am referring to] Lindrian['s question]"
jbpros has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
<platzhirsch>
unzip doesn't have an option to remove the zip file after decompression, sucky zip
<Lindrian>
apeiros: yes im still at that problem
robscomputer_ has joined #ruby
robscomputer has quit [Read error: Connection reset by peer]
zachrab has quit [Remote host closed the connection]
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nfk has quit [Quit: yawn]
<apeiros>
I generally use rack based stuff for the whole application, so let me gather a bit of info first
momomomomo has joined #ruby
<apeiros>
you did use CGI before rack?
<apeiros>
or rather, before trying to go via sinatra?
<Lindrian>
correct
<Lindrian>
see this guy, this guy speaks my language. we totally seem to understand eachother.
marcdel has joined #ruby
<Fractional>
I speak English :D
ixti has quit [Read error: Connection reset by peer]
rcosta has joined #ruby
<apeiros>
what was the reason to move away from CGI? (I generally think not using CGI is a good idea, though)
ixti has joined #ruby
<ericwood>
¿qué?
<Lindrian>
apeiros: people in here said it would summon the devil and he would consume my soul
hamakn has quit [Ping timeout: 245 seconds]
<apeiros>
that's pretty much correct. but for your case it might actually be suited (and I owe shevy an apology)
g3orge has quit [Quit: leaving]
<apeiros>
it's akin to saying "goto is bad, don't use it" - it applies to 99.9%. But there is cases where it is "the right choice"™
<Lindrian>
i see
Bira has quit [Ping timeout: 240 seconds]
nickbender_ has quit [Remote host closed the connection]
<shevy>
I think what he actually mostly just needs is a minimal library that gives him post/get data, like CGI.new.params does
<apeiros>
I am currently scanning passengers documents, as I've only ever used it for fully ruby based apps, and I think passenger is generally geared towards that. but I might be wrong, so I check.
Coolhand has quit [Remote host closed the connection]
awarner_ has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
<Todd>
will is_a? return true for base classes of the actual class that you're working with?
tonni has joined #ruby
<apeiros>
Todd: yes
<platzhirsch>
What's a nice Ruby core exception for "What the hell is this kind of value? I don't know what to do"
<Todd>
No. I write code. I just don't own any of it.
<apeiros>
platzhirsch: get a coin. it works like a charm.
polaco_zZz is now known as polaco
diegoviola has quit [Quit: WeeChat 0.4.1]
<Todd>
Agile and all. We get in trouble for calling things "mine" or "my".
<Todd>
Go team!
<apeiros>
hrmpf, I thought passenger had an option to limit it to a directory…
<Todd>
</sarcasm>
<platzhirsch>
Yeah, putting an MIT license on it and then going like I don't own it
unixninja92_ has joined #ruby
<platzhirsch>
public domain or chicken
<Todd>
On top of legal issues and crazy network security guys.
huoxito has quit [Quit: Leaving]
Coolhand has joined #ruby
<apeiros>
Lindrian: would solving it via CGI and (if possible) moving it to non-cgi later be a workable way for you?
Rym_ has joined #ruby
unixninja92 has quit [Ping timeout: 256 seconds]
unixninja92_ is now known as unixninja92
<Todd>
I put some stuff on github once that I was using to assist with a project. Had no privacy issues or company secrets or anything in it. Was signed off on by my manager . They still raised a stink about it afterwards.
<apeiros>
Todd: ouch…
<apeiros>
my employer wouldn't do good if they did that with me :-D
<platzhirsch>
Todd: yeah what's wrong with you, probably was a huge financial damage
<Lindrian>
apeiros: im pretty sure CGI would work
<Lindrian>
its nothing fancy at all
<Todd>
And I'm a huge fan of open source. I didn't go to college. If not for open source I wouldn't know how to code. ie. I'd be unemployed or digging a ditch.
<apeiros>
Lindrian: I'd say go ahead, use CGI for the time being. get the gratification of seeing it work.
<Todd>
So it's kind of painful for me to deal with nonsense like that.
<platzhirsch>
Funny thing in Germany, we had an issue with open souring the Open(!) Government Data Platform, because due to laws, it's generally not allowed to open source something (give for FREE away), that was financed with TAXES
<apeiros>
Todd: also IMO it's better to get it to work. get a lot of problems out of the way. then deal with the then isolated problem of migrating from a single CGI resource to a single-route rack-app
<shevy>
I mostly just use %w()
<apeiros>
%x is actually a bastard. looks like a literal. is really a method.
noopq has quit [Ping timeout: 256 seconds]
Rym has quit [Ping timeout: 268 seconds]
<MrZYX>
well, `` too
<apeiros>
yupp
akemrir has quit [Quit: WeeChat 0.4.1]
sirupsen has joined #ruby
rcosta has quit [Remote host closed the connection]
Kruppe has joined #ruby
deception has joined #ruby
<Todd>
apeiros, the code itself has nothing to do with CGI vs. Rack.
kjellski has quit [Ping timeout: 256 seconds]
futilegames has quit [Quit: futilegames]
<Todd>
apeiros, he can write up a quick class to deal with the JSON and munge it however he so please locally
Rym has joined #ruby
<apeiros>
partially
<apeiros>
he's new to ruby
kobain has joined #ruby
<Todd>
apeiros, I suppose at this point I have no opinion. :)
<apeiros>
and if he has troubles for what, 5h to get rack to work/integrate, then that's 4h more than it would have taken to just write the CGI
<apeiros>
and it's much easier to migrate from a working system
shtirlic has quit [Read error: Operation timed out]
<Todd>
apeiros, I did get a little flustered by his begging for hand holding which caused me to be a bit crass.
<apeiros>
Todd: in such cases, divide and conquer
hamakn has joined #ruby
<Todd>
apeiros, for that I apologize... Maybe I'm getting old crotchety, but I come from the land of RTFM.
<apeiros>
try to slice the problem into separate smaller problems
<platzhirsch>
ah maybe I should use system, it looks more natural
mansi has quit [Remote host closed the connection]
<apeiros>
Todd: na, it's difficult sometimes
zz_dbRenaud has quit [Ping timeout: 240 seconds]
<Todd>
s/d c/d and c/
<apeiros>
I don't want to know how often I brushed somebody off undesiredly…
Tobarja has quit [Ping timeout: 245 seconds]
<apeiros>
err
mark_locklear has quit [Ping timeout: 276 seconds]
<apeiros>
undeservedly
mansi has joined #ruby
jalcine has quit [Ping timeout: 245 seconds]
mumblerit has quit [Ping timeout: 245 seconds]
<apeiros>
(undeserved for/to/by the brushed-off party, that is - wtf, english fail…)
machuga has quit [Ping timeout: 264 seconds]
iamjarvo_ has quit [Remote host closed the connection]
<apeiros>
platzhirsch: system and `` differ quite a bit
ckampfe has joined #ruby
<apeiros>
platzhirsch: system returns true/false based on exit status, `` returns $stdout output
<Todd>
you should definitely read about the differences between system and exec
<platzhirsch>
apeiros: well `` only makes sense if you want the return value
<apeiros>
and iirc both will just print stderr output on $stderr
mumblerit has joined #ruby
iamjarvo has joined #ruby
the_mentat has quit [Ping timeout: 248 seconds]
Kovensky has quit [Ping timeout: 248 seconds]
DanKnox has quit [Ping timeout: 248 seconds]
Guest41314 has quit [Ping timeout: 248 seconds]
xybre has quit [Ping timeout: 245 seconds]
paul__k has quit [Ping timeout: 264 seconds]
yonahw_ has quit [Ping timeout: 264 seconds]
sindork has quit [Ping timeout: 240 seconds]
gf3 has quit [Ping timeout: 240 seconds]
wormwood has quit [Ping timeout: 264 seconds]
onewheelskyward has quit [Ping timeout: 264 seconds]
mumblerit is now known as Guest12247
failshel_ has joined #ruby
mfilipe has quit [Ping timeout: 260 seconds]
scrogson has quit [Ping timeout: 276 seconds]
rgrinberg has quit [Ping timeout: 276 seconds]
<Todd>
well, something just went down
marcdel has joined #ruby
yonahw has joined #ruby
Tobarja has joined #ruby
DanKnox has joined #ruby
rgrinberg has joined #ruby
wormwood has joined #ruby
xybre has joined #ruby
xybre has quit [Changing host]
xybre has joined #ruby
onewheelskyward has joined #ruby
zz_dbRenaud has joined #ruby
machuga_ has joined #ruby
machuga_ has quit [Changing host]
machuga_ has joined #ruby
c0rn has joined #ruby
the_mentat has joined #ruby
mfilipe has joined #ruby
machuga_ is now known as machuga
gf3 has joined #ruby
mansi has quit [Ping timeout: 240 seconds]
mumblet has joined #ruby
paul_k has joined #ruby
sindork has joined #ruby
Kovensky has joined #ruby
shtirlic has joined #ruby
Gnubie has joined #ruby
<platzhirsch>
Won't make a big difference, although I might want to pass on the stdout/stderr spaming
Gnubie is now known as Guest38604
visof has joined #ruby
scrogson has joined #ruby
failshell has quit [Ping timeout: 264 seconds]
Guest12247 has quit [Ping timeout: 260 seconds]
cads has joined #ruby
Al__ has joined #ruby
jalcine has joined #ruby
robustus has quit [Ping timeout: 245 seconds]
huoxito has joined #ruby
nwertman_ has quit [Quit: leaving]
Coolhand has quit [Read error: Connection reset by peer]
greenysan has joined #ruby
hamakn has quit [Ping timeout: 245 seconds]
Astralum has joined #ruby
<platzhirsch>
tomorrow I finish the Well-Grounded Rubyist, I think David Black did a great job on that book
zarubin has quit [Ping timeout: 264 seconds]
Alina-malina has quit [Quit: Leaving]
sirupsen has quit [Quit: sirupsen]
robustus has joined #ruby
<atmosx>
I must start reading ruby books (apparently)
<apeiros>
platzhirsch: he sometimes visits. realDAB
huoxito has quit [Client Quit]
huanmnl has joined #ruby
<apeiros>
I must start writing ruby books (apparently)
<platzhirsch>
realDAB?
<apeiros>
that's his nick
<platzhirsch>
atmosx: it depends, for me it was good to go over some fundamentals which I learned on the fly, it filled a lot of gaps and it was a nice read for someone who is a) not new to Ruby b) not new to programming
chriskk has quit [Ping timeout: 264 seconds]
<V8Energy>
i tried science_magic to resize images, but it still requires me to install 2 things as opposed to rmagick which only requires me to install the rmagick lol. i need a standalone gem that can resize images D:
chriskk has joined #ruby
<atmosx>
platzhirsch: I need practice with Ruby and I'd love to get some experience working on "real projects" with deadlines, on a team etc.
greenysan has quit [Ping timeout: 240 seconds]
<platzhirsch>
atmosx: add cucumber and it's a gig
chairabanta has quit [Quit: Leaving...]
<atmosx>
cucumber?
s0ny123 has quit [Quit: leaving]
<atmosx>
what's that?
Guest12247 has joined #ruby
<platzhirsch>
framework for developing an application in a behavior driven manner
mrsolo has quit [Quit: This computer has gone to sleep]
Guest12247 has quit [Read error: Connection reset by peer]
mrwizard_ has joined #ruby
hadees has joined #ruby
<atmosx>
what do you mean by behavior driven manner?
Guest12247 has joined #ruby
saarinen has quit [Quit: saarinen]
girija has quit [Ping timeout: 260 seconds]
<platzhirsch>
atmosx: do you know use cases, from software engineering?
<atmosx>
platzhirsch: no. (or maybe I do but don't see what you mean, which happens more often than not actually)
<Lindrian>
apeiros: now that im running CGI, could you help me parse my JSON data?
iamjarvo_ has quit [Remote host closed the connection]
iamjarvo has quit [Read error: Connection reset by peer]
<V8Energy>
i need a standalone gem that can resize image files and doesn't require the user to install any additional software. suggestions?
mumblet is now known as mumblerit
burlyscudd has joined #ruby
<apeiros>
with content-type: application/json ?
iamjarvo has joined #ruby
<Lindrian>
correct
<Lindrian>
i can send as application/form-data too
<Lindrian>
or anything really.
Guest12247 has quit [Ping timeout: 260 seconds]
mumblerit is now known as Guest34380
cody-- has quit [Quit: Computer has gone to sleep.]
kurt21 has joined #ruby
saarinen has quit [Client Quit]
Guest12247 has joined #ruby
<apeiros>
no, should send application/json
<kurt21>
For ruby on rails on Ubuntu, should I install via normal apt-get or should I use rvm?
<apeiros>
let me check, been a decade since I wrote CGI
mansi has quit [Read error: Connection reset by peer]
mansi has joined #ruby
<kurt21>
Most unix utilities are best installed via apt-get. I know for Java/Scala work, it's better to install manually. The Java in the official repos is some weird variant
<atmosx>
kurt21: ruby's on every linux distribution are mstly viewed as *part of the system*. Other binaries (i.e. vim) depend on them. That's why they are veeeery slow on updates, they lag behind. It's better to have a totally separated dev environment and leave the system's ruby alone.
<kurt21>
even core ruby? uninstall the apt-get version and install through rvm?
MrPoT4tO has quit [Read error: Connection reset by peer]
<Morrolan>
God no, leave the system ruby in place.
<kurt21>
ah, gotcha
<Morrolan>
As he mentioned, several applications depend on it.
<kurt21>
makes perfect sense
<atmosx>
kurt21: leave it.
MrPoT4tO has joined #ruby
<kurt21>
thanks guys :)
<Morrolan>
:)
<apeiros>
Lindrian: hm, don't see a way to just get the whole request body. you could try `json = $stdin.read?
<apeiros>
whoops
<apeiros>
you could try `json = $stdin.read`
Al__ has joined #ruby
<Lindrian>
and then parse that?
ndrei_ has quit [Read error: Operation timed out]
<Lindrian>
A JSON text must at least contain two octets! (JSON::ParserError)
tvw has quit []
tvw has joined #ruby
brbcoding has quit [Ping timeout: 245 seconds]
momomomomo has joined #ruby
allsystemsarego has quit [Quit: Leaving]
<Morrolan>
Do a `puts json` after having read from stdin, so we have some clue what it is.
<Morrolan>
`p json` is even better.
<Lindrian>
Bad header: ""
ndrei has joined #ruby
Al__ has quit [Quit: Al__]
<Lindrian>
changed p to puts and now it doesnt error anymore
<Lindrian>
but it prints nothing
<Morrolan>
Oh, welp.
<Morrolan>
Yea, forgot that everything which you print to stdout gets relied to the client. *sigh*
RichardBaker has joined #ruby
<apeiros>
^^
<apeiros>
$stderr.puts json.inspect
<apeiros>
stderr should be printed to the terminal
Fuzai_ is now known as Fuzai
burlyscudd has quit [Quit: Leaving.]
<apeiros>
`p obj` does essentially the same as `puts obj.inspect`, and with $stderr.puts we explicitly print on stderr
<Lindrian>
$stderr.puts json.inspect
<Lindrian>
err
<Lindrian>
Premature end of script
<Morrolan>
Now you probably have an open quote, bracket, or similar.
momomomomo has quit [Client Quit]
<Lindrian>
i dont think so
Xeago has quit [Read error: Connection reset by peer]
<havenwood>
ehc: Ruby's Enumerable#find is the inherited method available on Array. The tool Pry is really useful easily checking where methods come from: http://pryrepl.org/
starfox21 has quit [Quit: starfox21]
<Lindrian>
it works!
visof has quit [Changing host]
visof has joined #ruby
burlyscudd has joined #ruby
iamjarvo has quit [Remote host closed the connection]
brianpWins has joined #ruby
zeade has quit [Quit: Leaving.]
iamjarvo has joined #ruby
burlyscudd has quit [Client Quit]
mary5030 has quit [Ping timeout: 240 seconds]
peregrine81 has quit []
bluOxigen has quit [Ping timeout: 256 seconds]
zeade has joined #ruby
gyre007 has joined #ruby
quoin has joined #ruby
saarinen has joined #ruby
<apeiros>
Lindrian: still getting my setup working… moment
pyx has joined #ruby
<Morrolan>
What kind of machine are you on, that you don't control the environment? :)
pyx has quit [Client Quit]
<Lindrian>
apeiros: you're an angel
<Lindrian>
Morrolan: im just on my windows box right now, i dont have linux to boot into
<Lindrian>
will fix that soon though
<Lindrian>
ill probably throw ubuntu on it
peregrine81 has joined #ruby
saarinen has quit [Client Quit]
<Morrolan>
Oh, I actually was wondering about apeiros' environment, since he said that he couldn't get CGI set up in reasonable amount of time.
<apeiros>
Morrolan: well, I have no apache installed and getting a rack app running is quick
iamjarvo has quit [Ping timeout: 240 seconds]
<apeiros>
the thing now is that I need something which does the JSON request :)
ckampfe has quit [Ping timeout: 245 seconds]
peregrine81 has quit [Read error: Connection reset by peer]
<Morrolan>
Ruby?
peregrine81 has joined #ruby
<Morrolan>
Anyway, I see. Lack of apache might make it difficult indeed. :)
marr has quit [Ping timeout: 264 seconds]
Companion is now known as companion
<apeiros>
Morrolan: na, html document with jquery
<Morrolan>
Hah, that works too, I guess.
<apeiros>
Morrolan: not difficult, but I don't want to spend time installing and configuring apache ;-)
<apeiros>
could do the request via ruby, sure
<apeiros>
but since Lindrian uses an ajax request, I'll do too
thillux has quit [Quit: Leaving]
dkamioka has quit [Remote host closed the connection]
rcosta has quit [Remote host closed the connection]
quoin has quit [Ping timeout: 264 seconds]
thillux has joined #ruby
v0id_ has quit [Quit: leaving]
cody-- has joined #ruby
thillux has quit [Read error: Connection reset by peer]
dkamioka has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
BizarreCake has quit [Read error: Operation timed out]
<Lindrian>
apeiros: how do i check if the key "regex" exists in data?
<apeiros>
line 5 & 6 open files to send stderr and stdout of the ruby script
<apeiros>
Hash#has_key?
<apeiros>
data.has_key?("regex")
<apeiros>
`Hash#has_key?` reads as `instance method "has_key?" of class Hash`
platzhirsch has left #ruby [#ruby]
<Lindrian>
thanks
<Lindrian>
you deserve a price my friend
Hanmac has quit [Quit: Leaving.]
rupee has joined #ruby
<apeiros>
help is top down. just pass it on to the next who needs help ;-)
<Lindrian>
apeiros: if you're curious to know what im doing, its to provide a ruby flavor for my regex testing website. I figured I would do everyone a solid and provide a solid online regex tester for ruby
<Lindrian>
I already have full support for JS/PHP/Python
<apeiros>
you're welcome. after all, you proved to have quite an impressive endurance :)
<Lindrian>
heh
vince_prignano has quit [Remote host closed the connection]
<fryguy>
isn't that what rubular is for
<apeiros>
nice
InFlames has joined #ruby
vince_prignano has joined #ruby
<Lindrian>
fryguy: i guess. rubular was what inspired me to create my own site
<Lindrian>
regex101.com
<Lindrian>
is my website
<apeiros>
Lindrian: btw., this is a viable rack-app. means only the last line would have to be replaced to have it run by whatever adapter you want.
vince_prignano has quit [Remote host closed the connection]
<Lindrian>
amazing
<breakingthings>
My kingdom for a flash-less Regexr clone
<Lindrian>
fryguy: rubular is quite limited in my opinion
vince_prignano has joined #ruby
vince_pr_ has quit [Remote host closed the connection]
<Lindrian>
breakingthings: what is?
<Lindrian>
rubular?
jocellyn has joined #ruby
<breakingthings>
Lindrian: As in, I would give my kingdom for a flashless Regexr clone.
<apeiros>
Lindrian: an important thing: ^ and $ are not start/end of string in ruby. they're start/end of line.
Kabaka has quit [Remote host closed the connection]
vince_prignano has quit [Remote host closed the connection]
<apeiros>
\A and \z are start/end of string in ruby
greenysan has joined #ruby
<Lindrian>
thanks
<Lindrian>
i was skimming through the docs
vince_prignano has joined #ruby
slyv has joined #ruby
<Lindrian>
my code is very adaptable, a few rules would take care of that. only real "problem" is the very very weird char class syntax in ruby
slyv has quit [Max SendQ exceeded]
<breakingthings>
Lindrian: I wish it had inline, realtime highlighting of matches like Regexr though :)
Kabaka has joined #ruby
Bira has quit [Remote host closed the connection]
robscomputer_ has quit [Remote host closed the connection]
<Lindrian>
breakingthings: i discussed that with a few people, turns out its more cons than pros with a solution like that.
Xeago has quit [Remote host closed the connection]
dkamioka has quit [Remote host closed the connection]
* breakingthings
shrugs
<breakingthings>
I found it useful on more than one occasion when I was building a regex from scratch.
robscomputer has joined #ruby
<apeiros>
Lindrian: take a look at debuggex.com too
<breakingthings>
But I won't say your tool isn't useful :)
<Lindrian>
my website will actually validate your regex, and find errors and explain them to you. if it did this on every keystroke, you'd see errors even though you still werent done.
<breakingthings>
Well, not the errors.
ckampfe has joined #ruby
<breakingthings>
Just highlighting matches.
<Lindrian>
breakingthings: secondly, people tend to look at their regex when they write it, then the result.
vince_prignano has quit [Remote host closed the connection]
mary5030_ has quit [Remote host closed the connection]
<Lindrian>
breakingthings: it will simply not highlight anything then
vince_prignano has joined #ruby
Bira has joined #ruby
<Lindrian>
apeiros: i've seen it. great stuff, horrible interface though.
<breakingthings>
Lindrian: It would highlight the test string. See how regexr does it.
bronson_ has joined #ruby
<breakingthings>
I can figure out whether the token I just put worked immediately
<breakingthings>
and you can remove the need for a highlighting box on the right
<Lindrian>
if my regex is invalid, regexr just does not highlight anything
vince_prignano has quit [Client Quit]
<Lindrian>
how do I know if my regex is invalid or the page is broken?
vince_prignano has joined #ruby
phantasm66 has quit [Quit: *sleeeep….]
<kurt21>
which is better: rvm or rbenv?
<breakingthings>
I didn't say regexr was the best thing in the world. Obviously show errors. I just want to see things highlight in realtime.
<breakingthings>
Errors can still be there.
<breakingthings>
They don't have to be realtime either.
rodacato has joined #ruby
jonathanwallace has joined #ruby
greenysan has quit [Ping timeout: 260 seconds]
<Lindrian>
breakingthings: i see what you're saying. i cant do that with my current solution as im running ajax requests.
<Lindrian>
regexr runs flash on your browser
jonkri has quit [Quit: jonkri]
<breakingthings>
I realize that.
Spami has joined #ruby
<breakingthings>
Though you can run realtime calculations clientside.
<Lindrian>
how so? i could only do that with javascript
<Lindrian>
the rest would still require ajax
<breakingthings>
well, yes. with javascript.
<postmodern>
kurt21, chruby :)
sailias has joined #ruby
<breakingthings>
I see your point at that point with other langs.
<kurt21>
oh no, another one!
InFlames has quit [Quit: Leaving]
robscomputer has quit [Ping timeout: 240 seconds]
InFlames has joined #ruby
iamjarvo has joined #ruby
<Lindrian>
im planning on creating a full fledged regex debugger aswell
sirupsen has quit [Quit: sirupsen]
<Lindrian>
which would run in perl
<Lindrian>
but would be quite applicable in most languages i think
jbrechte_ has quit [Remote host closed the connection]
<alpha123>
postmodern: is chruby the currently recommended one? I too am very confused about the multitude of rvm-like things.
<postmodern>
alpha123, rvm is still the recommended one for new users
<Morrolan>
RVM does more than chruby.
<alpha123>
postmodern: ok. doesn't it do ugly things to my shell though?
jbrechtel has joined #ruby
Ripp__ has quit [Quit: Ripp__]
Ripp__ has joined #ruby
<postmodern>
alpha123, sort of. they have improved some things
<havenwood>
+1 chruby
vince_prignano has quit []
<jrobeson>
alpha123, there is no favorite atm
<jrobeson>
other than rvm :(
zachrab has joined #ruby
<jrobeson>
i've been using rbenv since it doesn't mess with my shell
<jrobeson>
but that was from before chruby existed
<fryguy>
i like using rbenv for development, and chruby for production
<fryguy>
probably going to end up just using chruby for everything
mansi has quit [Remote host closed the connection]
<jrobeson>
ruby apps are like osx apps.. :(
<jrobeson>
everyhting is packaged
mansi has joined #ruby
jbrechtel has quit [Ping timeout: 260 seconds]
mcat1 has joined #ruby
rafacv has joined #ruby
platzhirsch has joined #ruby
mcat1 has left #ruby [#ruby]
<platzhirsch>
There's one problem with unzipping archives via system & co. I don't get the filename of the file that was inside, so I really go down that road and compare the directory list before and after?
mansi has quit [Read error: Connection reset by peer]
<platzhirsch>
meh
mansi has joined #ruby
Banistergalaxy has quit [Ping timeout: 256 seconds]
zachrab has quit [Ping timeout: 245 seconds]
<jrobeson>
why are you unzipping with system ?
mansi has quit [Remote host closed the connection]
<jrobeson>
i haven't done any archive unpacking in ruby.. but i figured there were libraries
<platzhirsch>
jrobeson: That was my previous solution, I don't want to load them into memory
michaellynch has quit [Ping timeout: 268 seconds]
sepp2k has quit [Read error: Connection reset by peer]
seich- has quit [Ping timeout: 240 seconds]
burlyscudd has joined #ruby
<platzhirsch>
there is zlib (for gzip) and rubyzip (for zip)
s0ber_ has joined #ruby
ixti has quit [Read error: No route to host]
mansi has joined #ruby
<platzhirsch>
although.. maybe it's not a problem. If both use IO object and stream it, then the memory shouldn't be affect much, should it?
mansi has quit [Remote host closed the connection]
robscomputer has joined #ruby
alpha123 is now known as alpha123-afk
mansi has joined #ruby
sepp2k has joined #ruby
Tuxist has quit [Read error: Connection reset by peer]
s0ber has quit [Ping timeout: 256 seconds]
c0rn has quit [Ping timeout: 268 seconds]
s0ber_ is now known as s0ber
reset has joined #ruby
ckampfe has quit [Ping timeout: 260 seconds]
aryaching has quit [Ping timeout: 264 seconds]
kaldrenon has quit [Read error: Connection reset by peer]
c0rn has joined #ruby
havenwood has quit [Remote host closed the connection]
kaldrenon has joined #ruby
zachrab has joined #ruby
havenwood has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
Eiam has joined #ruby
danman has joined #ruby
mansi has quit [Ping timeout: 260 seconds]
mansi has joined #ruby
s0ny123 has joined #ruby
seich- has joined #ruby
kaldrenon has quit [Ping timeout: 264 seconds]
rodacato has quit [Remote host closed the connection]
kpshek has quit [Ping timeout: 264 seconds]
mengu has joined #ruby
rezzack has joined #ruby
Quashie has joined #ruby
colonolGron has joined #ruby
mrsolo has quit [Read error: Connection reset by peer]
kpshek has joined #ruby
mrsolo has joined #ruby
nhhagen has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
nhhagen has joined #ruby
momomomomo has joined #ruby
jp- has quit [Quit: OK, I believe you… but my tommy gun don't]
mansi has quit [Read error: Connection reset by peer]
Skylab has quit [Quit: Skylab]
mansi has joined #ruby
Nilium has joined #ruby
fcahoon has joined #ruby
nhhagen has quit [Ping timeout: 264 seconds]
capsuley has joined #ruby
JDHankle has quit [Remote host closed the connection]
iamjarvo_ has joined #ruby
ckampfe has joined #ruby
ner0x has quit [Quit: Leaving]
mansi has quit [Read error: Connection reset by peer]
hornairs has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
<platzhirsch>
IO.copy_stream is really nice for that
quoin has joined #ruby
mansi has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
zachrab has quit [Remote host closed the connection]
iamjarvo has quit [Ping timeout: 246 seconds]
iamjarvo_ has quit [Ping timeout: 240 seconds]
Speed has joined #ruby
alex__c2022 has quit [Quit: alex__c2022]
marr has joined #ruby
JohnBat26 has quit [Ping timeout: 256 seconds]
quoin has quit [Ping timeout: 245 seconds]
dfdx2 has joined #ruby
thillux has joined #ruby
s0ny123 has quit [Quit: leaving]
<pontiki>
can you stick the decomp in there?
s0ny123 has joined #ruby
jdenen has quit [Read error: Connection reset by peer]
danman has quit [Quit: danman]
atyz has quit [Quit: Leaving...]
tonni_ has joined #ruby
nhhagen has joined #ruby
twoism_ has joined #ruby
twoism has quit [Read error: Connection reset by peer]
s0ny123 has quit [Client Quit]
ehc has quit [Quit: ehc]
JDHankle has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
RenderRob has joined #ruby
Bira has quit [Remote host closed the connection]
<RenderRob>
just downloaded the ruby koans. Why do the first several tests pass by default?
<RenderRob>
AboutAsserts#test_assert_truth has expanded your awareness.
<RenderRob>
AboutAsserts#test_assert_with_message has expanded your awareness.
<RenderRob>
AboutAsserts#test_a_better_way_of_asserting_equality has expanded your awareness.
<RenderRob>
AboutAsserts#test_fill_in_values has expanded your awareness.
<RenderRob>
AboutAsserts#test_assert_equality has expanded your awareness.
<RenderRob>
AboutNil#test_nil_is_an_object has damaged your karma.
nickbend_ has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
momomomomo has quit [Quit: momomomomo]
nickbend_ is now known as nickbender_
julweber has joined #ruby
claymore_ has quit [Quit: Leaving]
<Eiam>
hmm they didn't pass for me when i did them a few years ago! =0
Spami has joined #ruby
<RenderRob>
Eiam, what is invoking these methods? All I see are methods in classes, but I don't see what's calling them or in what order they are being called.
gusnasis has quit [Read error: Connection reset by peer]
classix has joined #ruby
gusnasis has joined #ruby
<havenwood>
RenderRob: You can convert back and forth with #to_s and #to_sym (or #intern, since Symbol is an interned string).
dhruvasagar has quit [Ping timeout: 264 seconds]
<shevy>
hmm
<shevy>
#intern is as #to_sym ?
<Eiam>
yeah
<Eiam>
thats kind of weird
guardian_ has joined #ruby
<havenwood>
aliases
<Eiam>
but whatever, i guess its collect vs map
<shevy>
all those who use collect must die!
<RenderRob>
havenwood, what would be an analogous object from another language?
<Eiam>
shevy: I just went through and find/replaced a part time code base contributors usage of "collect"
<workmad3>
RenderRob: to a symbol?
<Eiam>
for some reason it mentally throw me off =(
<RenderRob>
right
<workmad3>
RenderRob: maybe the Symbol object from Smalltalk ;)
<RenderRob>
hmm, haven't used smalltalk
<Eiam>
a global pointer to the same instance
<Eiam>
?
<RenderRob>
I've used python, php, c++
c0rn has quit [Quit: Computer has gone to sleep.]
<havenwood>
RenderRob: Ruby's come from the Lisp terminology. Other languages call them Atoms instead of Symbols. Like an atom in Elixir.
<shevy>
Eiam hehe yeah, it distracts me as well... but I must admit, ruby code written by other people often confuses me a lot
<workmad3>
RenderRob: there isn't an exactly analogous construct in those languages, afaik...
<Eiam>
shevy: yes, ruby lends itself very well to being confusing if written by what I call "assholes"
gusnasis has quit [Ping timeout: 240 seconds]
<Eiam>
shevy: or worse, "clever assholes"
<RenderRob>
lol
<workmad3>
RenderRob: C++ has enums, which are somewhat like them
volty has joined #ruby
<Eiam>
workmad3: enums are like symbols?!
<apeiros>
symbols are a bit like a number with a name
<workmad3>
RenderRob: in the way they're used at least
<Eiam>
a global number..
<Eiam>
with a name..
<apeiros>
all numbers are global :)
<platzhirsch>
With 'rubyzip' I can create a IO-like object with is = Zip::InputStream.open("my.zip"), but somehow with File.new('decompressed, 'w') { |f| IO.copy_stream(is, f) } the content is not written into that file. Any thoughts what could be missing?
<workmad3>
Eiam: symbols are frequently used in a similar manner to C++ enums
Targen has quit [Ping timeout: 245 seconds]
<workmad3>
and tbh, 'number with a name' describes a C++ enum perfectly ;)
<Eiam>
workmad3: yeah, I've thought about it more since my initial reaction 30 seconds ago
<Eiam>
and I'm agreeing now =)
<pontiki>
platzhirsch: does using File.open there make any difference?
<Eiam>
apeiros: point =p
<Eiam>
apeiros: I still think its important to mention symbols are global
<shevy>
who
breakingthings has quit []
<apeiros>
workmad3: don't enums provide additional restrictions, though? as in, you can only use the values listed in an enum?
<shevy>
oops... I meant whoa
<Eiam>
vs x =2 not being global
<apeiros>
(IMO an advantage for many use cases)
kvirani has quit [Remote host closed the connection]
<workmad3>
apeiros: yeah, somewhat analogous, not a perfect mapping ;)
<shevy>
but nubmers are beautiful globals
<shevy>
*numbers
<platzhirsch>
pontiki: indeed, I get a undefined method length method for nil class, seems there is a problem with the implementation
kvirani has joined #ruby
verto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
RenderRob: symbols are used to identify everything with a name in ruby
<pontiki>
hmm...
<apeiros>
local variables, @ivars, constants, method names
Targen has joined #ruby
<apeiros>
whenever you define something with a name, a symbol with that value comes into existence
<RenderRob>
"with a name"
<platzhirsch>
pontiki: I think they provide their own copy_stream method, I have seen something like this
hukl has quit [Quit: Leaving...]
<RenderRob>
0_o
<pontiki>
ah...
peta_ has quit [Quit: peta_]
d2dchat_ has joined #ruby
<workmad3>
apeiros: aren't a lot of those lazily constructed though?
<workmad3>
apeiros: which I know is an implementation detail :)
solidoodlesuppor has quit [Remote host closed the connection]
<apeiros>
workmad3: I think not. but I never checked that. I assume you mean in MRI/KRI?
<apeiros>
RenderRob: `def foobar; end`
jbrechtel has joined #ruby
<apeiros>
you created a method, it has a name: "foobar"
<apeiros>
you identify it by that
<apeiros>
@flubber = 123 # you defined an instance variable, it has a name "@flubber", you identify it by that
<apeiros>
and that's where Symbols shine: identifying things.
<RenderRob>
hmm
<workmad3>
apeiros: ah, they do seem to be immediately created, you're right
<workmad3>
apeiros: and yeah, I was meaning in MRI 1.9/2.0
<volty>
if you need a two (or more) word enum-like you use, e.g., :"first name"
jbrechtel has quit [Ping timeout: 264 seconds]
<RenderRob>
all symbols are global?
corpuscle has quit [Quit: WeeChat 0.4.1]
<Eiam>
or :first_name
<apeiros>
volty: that one is also nice for interpolated symbols
<volty>
yap
<apeiros>
RenderRob: global and never garbage collected
<Eiam>
RenderRob: yes
alekst has quit [Quit: Computer has gone to sleep.]
<workmad3>
RenderRob: the first time you use a :symbol, it gets created
<apeiros>
which is why you should not use it for arbitrary user input
momomomomo has joined #ruby
<apeiros>
or rather: which is why you should not use it for user-input
<workmad3>
RenderRob: thereafter, everytime you use the same :symbol literal, the same Symbol object is provided
<volty>
apeiros: i do agree, symbols are good as syntactic sugar and should not be created "on-fly" - unless one has a very cute and precise ideas ...
snovak has quit [Remote host closed the connection]
alpha123-afk is now known as alpha123
<RenderRob>
That might be the first time I've ever heard of an idea being had which is characterized as "cute" :)
haukur has quit [Quit: Lost terminal]
<Eiam>
i like symbols I think they are kind of neat =p
eshlox has left #ruby ["."]
axeman- has quit [Remote host closed the connection]
<shevy>
I hate them
<workmad3>
shevy: you hate everything :P
<Eiam>
=p
<shevy>
every moment I have to ask myself "will I use a symbol or will I use a string"
<workmad3>
shevy: it's just a case of whether you hate it more or less than something else ;)
<Eiam>
shevy: lol..
<shevy>
workmad3 nah, ruby has a good foundation
<volty>
«apeiros: global and never garbage collected» - remember this! whenever you have problems with objects going out of scope (for whatever reason - usually created by external libs) put them in global var or a global array that you clean after by hand
<shevy>
workmad3 it just has warts on the outside
<Eiam>
shevy: whats that matteR?
<apeiros>
shevy: just use strings.
graft has quit [Ping timeout: 268 seconds]
nickbender_ has quit [Remote host closed the connection]
<Eiam>
or just use symbols ;p =)
<Eiam>
save those precious object_ids!
<RenderRob>
so all variables and objects in ruby automatically generate a symbol?
<shevy>
Eiam well consider user_input = gets.chomp, from this point on you have a string right? so internally, if you work with it, you always want to work on a string everywhere
<apeiros>
RenderRob: all variables yes, all objects no
<apeiros>
variables have names. objects do not
jaynewstrom has quit [Remote host closed the connection]
<shevy>
Eiam so when you have a hash with keys only, you must convert user input queries to symbols right?
<apeiros>
kurt21: #rubyonrails
<apeiros>
kurt21: probably newest patchlevel of 1.9.3
hasrb has quit [Remote host closed the connection]
<volty>
RenderRob: think about it this way: a symbol is created for whatever could be referenced
<kurt21>
apeiros: thanks!
<Eiam>
shevy: If I'm dealing with data like that sure, but my data models don't generally flow that way
<shevy>
do you never have or store user input :P
<Eiam>
shevy: DB <-> Internal Object -> JSON.
<shevy>
ok I see, anything less than a database is not where you work :P
<shevy>
what happened to good old perl days!
<Eiam>
IO will have symbols. to_json moves it to strings. frontend talks in strings, and those don't get converted into internal objects so no need to deal with symbols
<Eiam>
shevy: I'm not sure what you mean by "less than a DB"
<workmad3>
shevy: sure, convert a user command to a symbol... but only once you've validated that it is a command you know about ;)
<Eiam>
i just described a general input output flow where I use symbols but don't have to worry about input conversion to symbols was all
elaptics is now known as elaptics`away
MrPoT4tO has quit [Read error: Connection reset by peer]
E23 has joined #ruby
adkron_ has quit [Ping timeout: 264 seconds]
MrPoT4tO has joined #ruby
<platzhirsch>
pontiki: still complaining, that one of the two streams would not be opened for reading. I just hope I can achieve the stream extracting through another interface method
rcosta has joined #ruby
rhys_ has quit [Quit: Leaving]
<workmad3>
shevy: also, there's many popular 'hash with indifferent access' implementations that will let you access the same value with both "key" and :key (and I hope at least most of them convert :key to "key" rather than "key" to :key :D)
cody-- has quit [Quit: Computer has gone to sleep.]
vlad_sta_ has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 260 seconds]
<shevy>
workmad3 hah funny that you mention that... I went the exactly opposite way for a class Configuration I wrote... only symbols may be stored in my hash (that was my earlier question when I wanted class Configuration < Hash)
robscomputer has quit [Remote host closed the connection]
<apeiros>
n8
apeiros has quit [Remote host closed the connection]
<shevy>
but get this, before I did this I could have had ...
<shevy>
some_hash[:debug]
robscomputer has joined #ruby
<shevy>
some_hash['debug']
<shevy>
in the same hash!
apeiros has joined #ruby
E23 has left #ruby [#ruby]
<workmad3>
shevy: well yeah... they're different objects, they hash to different things... they're different :P
mlpinit has quit [Remote host closed the connection]
Zai00 has joined #ruby
momomomomo has quit [Quit: momomomomo]
<volty>
I don't like hashes for config - since i cannot decide the order of the keys // the order is important if you are creating, f.e., a gui dialog programatically
<volty>
and, said that, btw, can you suggest me something nice for that purpose ?
<volty>
(key, value pairs where i can change the order of keys)
starfox21 has joined #ruby
Naoe-Kanno has joined #ruby
<workmad3>
volty: xml? </troll> ;)
SHyx0rmZ has quit [Ping timeout: 245 seconds]
<volty>
i don't mind xml // i was thinking of a nice extension for Hash - nice but also excepted by users if not as standard
nbouscal has quit [Quit: Computer has commenced electric sheep tracking protocol.]
<Eiam>
volty: hashes are ordered as of 1.9..
robscomputer has quit [Ping timeout: 268 seconds]
c0rn has joined #ruby
<Eiam>
workmad3: hey I use xml for configuration sometimes =)
<Eiam>
beats yaml IMO
<Eiam>
I'd probably just use json if I did it over =) or a database!
<workmad3>
Eiam: drats... I should have gone for INI files :P
<volty>
as for the troll: I don't like the little compulsive teachers - that's all // talk about whatever but not teach a novice, that hasn't read a single line of ruby-doc, what is an instance variable
lnormous has joined #ruby
<Eiam>
huh?
<volty>
Eiam: what if I want to reorder? Or define the order of known-in-advance keys without having to assign in that order?
cody-- has joined #ruby
zastern_ has joined #ruby
<volty>
ini files aren't a bad idea :)
<Eiam>
volty: well, hash order is defined by order of insertion
<shevy>
at least XML does not force you into just one encoding
jonathanwallace has joined #ruby
<workmad3>
shevy: which is a shame :P
<Eiam>
volty: if you want to re-order, sort the hash? =)
NinjaBot_ has quit [Remote host closed the connection]
<workmad3>
Eiam: which is easier to reason through - 'a block is just syntax for passing a proc to a method' or 'a block is special. The VM will only turn it into an object when I actually need it as an object, up until then it's not an object *as long as I don't look at it*' ;)
<shevy>
Eiam what was that
<workmad3>
banisterfiend: but once you ask for a method programmatically, you get a Method object ;)
<volty>
shevy: ah, sorry, was distractted, fixnum are an exception
lewis has joined #ruby
<Eiam>
shevy: me wondering if << had an object_id ? =)
<workmad3>
>> method(:<<).object_id
<eval-in>
workmad3 => undefined method `<<' for class `Object' (NameError) ... (https://eval.in/46718)
<shevy>
oh man... I never had this idea in my life
<workmad3>
banisterfiend: can I apply extensionality to them please? they do the same thing, therefore they are the same thing ;)
<shevy>
especially for an Integer
<workmad3>
Eiam: it's pretty rare to need a method object
<Eiam>
workmad3: come again?
<workmad3>
Eiam: in part because they're a bit of a PITA to get a hold of :)
<lewis>
hey guys
lewis is now known as Lewix
<Eiam>
its rare to do <<, + and so on?
<Lewix>
why would someone do this string.split[0..(wordcount-1)].
<Lewix>
what's the point
nbouscal has quit [Client Quit]
nathan28 has joined #ruby
<workmad3>
Eiam: no, calling a method doesn't require the interpreter to create a method object ;)
<Eiam>
Lewix: they are splitting a string based on a range from the start to the i presume wordcount-1? =)
<workmad3>
Eiam: the method object is only created when you ask for it
<banisterfiend>
workmad3 it's a shame they're not in some ways, a method object might be a cool place to store state for a method without polluting the object itself
<banisterfiend>
i think that trick is used in python
<platzhirsch>
What I like in Ruby more than in Python, that it seems to promote a lot more dynamic programming paradigms. No rules, no conventions, just pure dam break
<Lewix>
workmad3: ok I see what you mean, Im in the very situation... and that's why i got confused -)
<platzhirsch>
Eiam: no, to break every dependency there is and drown in the lake of bleeding edge
modernbob has quit [Quit: Leaving]
<platzhirsch>
I highly endorse that
<workmad3>
Lewix: yeah, compactness and low character count isn't everything ;)
Levin_22 has joined #ruby
saarinen has quit [Quit: saarinen]
<pcfreak30>
Whats the difference between a module function and a class method. What should be use in what case?
<RenderRob>
so then 1 + 1 is like 1.add(1) ?
mansi has quit [Ping timeout: 240 seconds]
<workmad3>
RenderRob: 1.+(1)
<volty>
workmad3: first_words = string.split(/^s+/ #optional)[0..wordcount - 1]; // separating it in tow pieces adds nothing to readability of the code
<alpha123>
RenderRob: 1.+(1)... yes, the number class defines a def +(n) method
<RenderRob>
are there any assignment operators in ruby?
<workmad3>
volty: hehe, you just wrote a syntax error ;)
musl has joined #ruby
<Eiam>
RenderRob: blah = 2 ?
<alpha123>
RenderRob: well there are assignment methods :)
<Eiam>
RenderRob: x = 5 if "yo" == "yo"
<RenderRob>
right. Wouldn't that just be blah.=(2)
<workmad3>
RenderRob: no
<Eiam>
RenderRob: fire up pry and type it in =)
<workmad3>
RenderRob: = isn't an operator
<platzhirsch>
Actually I wanted to mix my parse_recursively method into the JSON module, does somehow have an alternative idea where to put this?
KobraKao has joined #ruby
saarinen has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
mansi has joined #ruby
<RenderRob>
= is not an operator?
<Eiam>
RenderRob: fixnum does not implement an "add" method
<RenderRob>
I wasn't being literal since I have never used ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<Eiam>
workmad3: not the same thing ;p
beneggett has joined #ruby
<volty>
workmad3: not a good idea - the explicit separator
<volty>
workmad3: beacuse he nees till wordcount - 1
jbrechte_ has joined #ruby
<volty>
needs
<RenderRob>
I don't understand this eval.in
<banisterfiend>
Eiam recent rubies are really conservative in their exposed C functions, so you really can't do as much cool stuff as you used to be able to :(
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<workmad3>
volty: right, which is what 0...wordcount gives
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam>
volty: this is .. vs ...
Rym has joined #ruby
<Eiam>
one is inclusive one is not
<volty>
but he needs wordcount -2 since he states wordcount - 1 as right boundary :)
<volty>
vs
musl has quit [Client Quit]
<workmad3>
volty: yes, when using an inclusive range
<workmad3>
volty: so he's saying '0 upto and including wordcount - 1)
musl has joined #ruby
<platzhirsch>
banisterfiend: but why implement the gem through C if it can also implemented with Ruby?
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
<workmad3>
volty: which is the same as '0 upto but not including wordcount) (which is 0...wordcount)
<volty>
workmad3: that one you might forget after six month (i never use them)
phantasm66 has quit [Remote host closed the connection]
musl has quit [Client Quit]
JDHankle has joined #ruby
<banisterfiend>
platzhirsch because it can't be cleanly implemented in ruby
<banisterfiend>
platzhirsch i wouldn't know how to implement include_complete in pure ruby
<workmad3>
volty: or to avoid that confusion... words[0, wordcount]
<volty>
(are there 3 dots // i didn't see them)
musl has joined #ruby
<volty>
nicer
<volty>
much nicer
<platzhirsch>
banisterfiend: I thought using the ClassMethods module was the way to do that
x1337807x has joined #ruby
<banisterfiend>
platzhirsch the whole point of include_complete was to avoid that ;)
JDHankle has quit [Read error: Connection reset by peer]
jbrechtel has quit [Ping timeout: 245 seconds]
JDHankle has joined #ruby
Astral_ has joined #ruby
Bira has joined #ruby
<platzhirsch>
banisterfiend: well, if you don't see it and that part is extracted into the gem, it's still an improvement
jibi has joined #ruby
Astral__ has joined #ruby
<banisterfiend>
platzhirsch not sure what u mean but ok :)
obs has quit [Quit: Konversation terminated!]
hamakn has joined #ruby
Ziarkaen has quit [Read error: Connection reset by peer]
<RenderRob>
a = 1
<RenderRob>
a += 1
<RenderRob>
a.+=(1) # error
<Aloysius1_>
Hey, all: I'm constructing an object from an incoming params hash, and then planning to store it to Mongo. To construct the object, I use "instance_variable_set" looping over the incoming hash. I have validators on a few fields, and the others I'm indifferent to (at least for now). I think to get it into Mongo, I need to turn it back to a hash. Is that so?
ewnd9 has quit [Ping timeout: 240 seconds]
<Aloysius1_>
And if so, should I just do the complement of the instance_variable_set loop?
simplyaubs has joined #ruby
<platzhirsch>
The gem would simply eliminate the redundancy of going through the ClassMethods approach every time a module for module mixin should be created. The functionality is encapsulated and the user does not have to deal with that every time, nor does he/she see the code
Astralum has quit [Ping timeout: 260 seconds]
<volty>
RenderRob: there's a dot after a ? kidding us
Astral_ has quit [Ping timeout: 245 seconds]
simplyaubs has left #ruby [#ruby]
zarubin has joined #ruby
<RenderRob>
just noticing that +() is a method but += is not
gstamp has joined #ruby
<banisterfiend>
platzhirsch still don't really get what u mean, what would the gem do exactly? if it only works on modules that already have a ClassMethods defined, then that module would likely provide the included() hook anyway. And if it's working on modules that do not have a ClassMethods defined, then I'm not sure how it could work at all
<RenderRob>
@ volty
<alpha123>
RenderRob: that's because x += 1 is equivalent to x = x.+(1)
Cyrus_ has joined #ruby
<platzhirsch>
banisterfiend: ah okay, I haven't put thought into the actual implementation. I assumed some eval magic works always
<banisterfiend>
:P
malcolmva has joined #ruby
cody-- has joined #ruby
hamakn has quit [Ping timeout: 260 seconds]
snovak has joined #ruby
maasdesigner has quit [Quit: whowantstolivefo]
<platzhirsch>
so there are boundaries in Ruby
strgbrew has quit [Ping timeout: 276 seconds]
<volty>
RenderRob: i see, tried it with send too
fourq__ has joined #ruby
<volty>
ops
s0ber_ has joined #ruby
<visof>
hello
poga_ has joined #ruby
<volty>
i remember it now: + can be regular method because it creates a new Fixnum instance
<platzhirsch>
banisterfiend: do you think adding a parse_recursively method to the JSON module is a legitimate scenario for singleton classes
<volty>
+= cannot be a methods because you cannot change the value of the fixnum inside a method
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
VTLob has quit [Quit: VTLob]
jlast has quit [Remote host closed the connection]
<visof>
i have arr = ["hello", "world", "take", "this"] , i want to get a format string like this from this array : "1:hello,2:world,3:take,4:this" ?
<visof>
how can i do this?
<pcfreak30>
Whats the difference between a module function and a class method. When should you use each?
jbrechte_ has quit [Remote host closed the connection]
poga has quit [Ping timeout: 240 seconds]
<volty>
RenderRob: that's why you cannot create singletons on Fixnum objects
locriani has quit [Remote host closed the connection]
<banisterfiend>
pcfreak30 module functions can only be defined on modules
jbrechtel has joined #ruby
<xybre>
pcfreak30:
<banisterfiend>
pcfreak30 and a module function is both a (private) instance method as well as a public class method
s0ber has quit [Ping timeout: 268 seconds]
s0ber_ is now known as s0ber
<xybre>
module_function is a method that sets up a state for the rest of the module block definition that does what banisterfiend said
<banisterfiend>
pcfreak30 a class method is just a method that is invokable on a Module instance
* xybre
hit enter by accident
robscomputer has quit [Remote host closed the connection]
<pcfreak30>
I know a class comes from a module. And I understand modules are both basically static classes and used for organizations. I just dont get the purpose of class methods.
<platzhirsch>
embarassing
jeebster has joined #ruby
<pcfreak30>
I come from C/JAVA/PHP so some o the block and module ideals are confusing
<xybre>
pcfreak30: class methods are often called "service methods" or "Static functions"
mansi has quit [Remote host closed the connection]
<jeebster>
not really a ruby question, but…how battery taxing are server daemons in osx? I do a fair bit of accessing local database servers and I'd like to know if having many of these daemon processes constantly running would severely impact the battery life of the new macbook air
<volty>
visof: s = ""; arr.each_with_index { |w, i| s << "#{i+1}:#{w}" }
<banisterfiend>
pcfreak30 well in ruby classes/modules are objects too
mansi has joined #ruby
ferdev has quit [Quit: ferdev]
<banisterfiend>
pcfreak30 a class method is just a method where the receiver is a class/module
<pcfreak30>
xybre: If so then whats the purpose of module functions besides using as mixin's
locriani has joined #ruby
<volty>
pcfreak30: namespace
<pcfreak30>
And do you have to define a module at each level like A::B or can you just define A::B alone
jsatk has quit [Remote host closed the connection]
marr has quit []
<banisterfiend>
pcfreak30 no a module function is typically for a method that behaves like a pure function
<xybre>
pcfreak30: Really, theres not a huge reason to use them. They're usually used for grouping together functions. Like the Math standard lib, you don't instantiate anything, its just a collection of functions.
<pcfreak30>
like module A module B end end
stkowski has quit [Quit: stkowski]
<xybre>
pcfreak30: It's not a great practice, so module_function isn't used much.
<banisterfiend>
pcfreak30 that is, it carries no state, and is invoked like a function
<pcfreak30>
xybre: So its a way of doing procedural in OOP?
snovak has quit [Ping timeout: 268 seconds]
jsatk has joined #ruby
jbrechtel has quit [Ping timeout: 246 seconds]
<RenderRob>
so symbols are really just entries in a global index?
rcosta has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
<pcfreak30>
xybre: I get that, but still not following when a class method should be used vs a module method
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
colonolGron has quit [Quit: Lost terminal]
<volty>
RenderRob: yap, useful for mapping, for efficency
<xybre>
pcfreak30: Its not really procedural, but its just a way to namespace functions. It's useful though, because you can still mix in the module, and all the functions will be mixed in as private methods. I've used it for that a few times, but its a rare occurance.
<visof>
volty, what about ',' ?
<xybre>
pcfreak30: a class method and a module method aren't really different in any meaningful way except that modules can be mixed into classes and classes can be inhereited from.
jlast has joined #ruby
<banisterfiend>
xybre i think he meant module function, no?
mansi has quit [Ping timeout: 256 seconds]
<pcfreak30>
xybre: I am just trying to ensure I do the proper way before I make a bad habbit.
<banisterfiend>
pcfreak30 you can ignore module_function
<pcfreak30>
I havent even started coding, but trying to et all ruy's unique abilities understoof
<banisterfiend>
pcfreak30 module_function is really not very important, and it relies on a deep magic
<xybre>
banisterfiend: There's not really any such thing as a "module function", was my point.
<volty>
visof: i put a semicolon thinking you did put semicolon; just change it
<volty>
(not seeng well)
<banisterfiend>
xybre i assume he meant methods generated via the module_function keyword
rcedillor has quit [Ping timeout: 268 seconds]
Tomasso has quit [Ping timeout: 260 seconds]
<pcfreak30>
and are the like "attr abc" for attribute accessors stuff in a class/module a function?
<xybre>
pcfreak30: Try to avoid either one is the best practice. There's uses for each, but they're not a go-to solution.
iamjarvo has joined #ruby
<xybre>
banisterfiend: same here
<banisterfiend>
xybre out of interest, what do you think module_function does?
<pcfreak30>
xybre: I understand static funcions and static variables. So I am just tring to understand the ruby use case equiv
<xybre>
pcfreak30: no, but there's ways os making it happen. attr is just a helper that generates generic functions for instance variables.
<pcfreak30>
xybre: is attr a build in function or an internal statement
<volty>
attr is a helper for creating what is called attributes (or properties)
Lewix has quit [Remote host closed the connection]
<xybre>
banisterfiend: It makes methods defined after it class-level (can be accessed directly from a module without mixing it it, ie Module.method_name) and also makes them private methods on the module, so when the module is mixed-in the methods are available as private methods on the class.
rodacato has quit [Remote host closed the connection]
<volty>
"generates generic functions" is a sort of a language of puppet teachers
zastern has quit [Ping timeout: 248 seconds]
<banisterfiend>
xybre yeah
<volty>
and do not dare to say that i'm trolling
<volty>
having this one arround
Lewix has joined #ruby
adkron_ has joined #ruby
zastern has joined #ruby
<volty>
teaching but doesn't know what is in namespace, the function or its name
<pcfreak30>
as I am seeing what looks like function calls at the top of class files and trying to figure out if they are definition/statements or internel methods
* xybre
ignores volty
<volty>
i do not care if you ignore me
<volty>
i will make clear that you know little and talk much - making confusion
<xybre>
pcfreak30: the attr* methods are C functions, but they're treated like normal methods
d2dchat_ has quit [Remote host closed the connection]
starfox21 has quit [Quit: starfox21]
<volty>
if xybre wants to teach he has to learn before
adkron_ has quit [Ping timeout: 260 seconds]
<platzhirsch>
time for some discharge
Bira has quit [Remote host closed the connection]
<volty>
pcfreak30: multiple inheritance is a nightmare to implement in a scripting language like ruby
<volty>
i come from c++ and got used with mixins
<banisterfiend>
volty I think you're just jealous ;)
<volty>
ahahah
<pcfreak30>
volty: comping from a C backround it just seem cleaner as I can see you haing a 100 mixins compared to a few subclasses
<platzhirsch>
#c++ is a nightmare
saarinen has joined #ruby
<volty>
pcfreak30: why 100 mixins?
badabim has joined #ruby
lnormous has quit [Ping timeout: 264 seconds]
<xybre>
pcfreak30: I like know what you mean, but composition is a better approach (though not exclusive)
greenysan has joined #ruby
<pcfreak30>
volty: the fact that you can only sub class 1 time means that any future subclass has to be overwritten via mixn based on what i have understood
mlpinit has joined #ruby
<volty>
yes, #c++ is a nightmare when you get lost in ill-ingineered (or too complicated) hierarchy with templates above it
jibi has quit [Ping timeout: 264 seconds]
<Eiam>
anyone recommend a fuzzy matcher of sorts?
julweber has quit [Remote host closed the connection]
<xybre>
Eiam: in what environment/for what purpose?
<platzhirsch>
volty: I meant the channel
<xybre>
pcfreak30: I wouldn't recommend using lots of mixins, or many at all
<volty>
platzhirsch: i don't understand what you mean
<Eiam>
I've got a giant hash of attributes ranging from nicknames, email addresses, first & last names, alias names, and I'd like to snag the top say, 35 "best case" matches from this large dataset for a given string
<Eiam>
the hash is about 50 MB
<xybre>
pcfreak30: you can overwrite and reopen classes and subclasses, so no need to use mixins for that
beneggett has joined #ruby
Bira has joined #ruby
<Eiam>
xybre: env = ruby/sinatra
<Eiam>
+ redis
jibi has joined #ruby
<pcfreak30>
volty: they how do you do multiple sub classing? is subclasses and inheritance not the same?
<volty>
xybre: you cannot "overwrite" classes
<volty>
!
<platzhirsch>
Eiam: and is the Hash in memory?
<Eiam>
platzhirsch: yep
<volty>
this man makes me nervous by his fuzzy language
<xybre>
Eiam: The only thing I know of that does anything like that is a gem I worked on :/
<platzhirsch>
Eiam: implement a <=> only for this hash object, sort them and fetch the first 35?
pentameter has quit [Read error: Connection reset by peer]
<xybre>
pcfreak30: you can have multiple subclasses of a single superclass, if thats what you're asking
predator117 has quit [Ping timeout: 240 seconds]
<Eiam>
platzhirsch: sort them based on which key..
<pcfreak30>
how exactly do custom comparison operators even work
jibi has quit [Read error: Connection reset by peer]
<platzhirsch>
oh I thought there are other criteria for that
johnkary has joined #ruby
<Eiam>
platzhirsch: if the string I get is "12341" and their employee id is "1233" but their email address is "12341@gmail.com" how does it sort those? =)
<pcfreak30>
xybre: i mean C < B < A.
<volty>
pcfreak30: difficult to tell it in this, generic, way // give a real example and see what mixed ppl say :)
<xybre>
pcfreak30: You can have subclasses of subclasses as well
<shevy>
can I have the moebius strip of subclassing until they subclass each other
predator117 has joined #ruby
<pcfreak30>
volty: been reading and been seing like <=> as methods and such.
ckampfe has quit [Ping timeout: 240 seconds]
<platzhirsch>
Eiam: you said the best matches, what did you meant with this, something like a string search?
<Eiam>
platzhirsch: well "best" is clearly subjective, which is why i said a fuzzy matcher
mlpinit has quit [Ping timeout: 245 seconds]
<platzhirsch>
:|
<Eiam>
platzhirsch: in my given example, I'd expect both records to be returned
<Eiam>
the employee ID that nearly matches, and the email address that also nearly matches
<Eiam>
let the user decide which one they intended
<pcfreak30>
xybre: if so, then when should a mixin be used. By inharitance I take you cant accessa property in A from C?
tomzx_mac has joined #ruby
<xybre>
pcfreak30: You can define "class variables" that are accessible between subclasses
snath has quit [Ping timeout: 240 seconds]
<volty>
pcfreak30: quite a different story in ruby with modules and properties, modules do not have nor variables nor properties
<pcfreak30>
volty: I never stated module. I was referring to classes
<xybre>
pcfreak30: Rather, class variables are shared between all related classes. There's also class instance variables, whose contents are not shared.
<volty>
so, people: pcfreak30 is coming from c++, xybre seems to not have a minimal idea about inheriting object variables from multiple parent classes (c++), and go on on on and on
<pcfreak30>
xybre: I know. static and regular in C. Im stating due to non-multipl inheritance you cant access an instance variable in C from A?
<banisterfiend>
volty your fixation on xybre is weird, stop
emergion has joined #ruby
iamjarvo has quit [Remote host closed the connection]
DonRichie has quit [Quit: Verlassend]
<volty>
banisterfiend: i argument on what xybre writes, stop
iamjarvo has joined #ruby
<volty>
if I am wrong just tell me where I am wrong. stop
<banisterfiend>
volty Just leave him alone :)
badabim has quit [Quit: Leaving...]
<platzhirsch>
Eiam: that looks nice
<xybre>
pcfreak30: instance variables are encapsulated in their instance
<volty>
banisterfiend: just leave me alone :) // i confine myself to arguing, not to insulting
<Eiam>
so i figure I'll just match the provided string against every attribute in the hash
<banisterfiend>
volty if you pick at him again, i will kick you from this channel
<Eiam>
platzhirsch: sum the matches and take the ones that rank the closest to 1
<volty>
do it hunny, and again and again, the next times, so I can document on what issues i was banned
<Eiam>
err, average the matches
chimmy has joined #ruby
<pcfreak30>
xybre: ok so unlike C, you dont "define" a non-static/instance variable before hand? You just set it in the method?
<banisterfiend>
volty no problem
<volty>
what's the purpose of this chan? why I didn't have problems (on contrary!) with apeiros and so many others ... ?
<platzhirsch>
Eiam: sounds legitimate
<Eiam>
volty: its to get help and be helpful
<Eiam>
and learn
<platzhirsch>
and swag
<banisterfiend>
volty primarily you're being annoying, constantly picking at someone who is trying to provide help is not useful, it's clearly a personal beef you have with xybre, but you can keep it out of this channel
<volty>
i want to learn, and i want other people to learn, and i think that xybre, with his fuzzy language, is contributing to augment the confusion of novices
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<volty>
xybre's is not help, xybre's is just posing as a teacher without being qualified for it
<xybre>
pcfreak30: Right, there's no need to define instance variables in advance. It can be helpful to generate accessor/setter methods for them, but that can break encapsulation too.
Bira has quit [Remote host closed the connection]
<xybre>
pcfreak30: well, you need to define A, then B, then C
<pcfreak30>
xybre: "but that can break encapsulation too."? dont follow
dml_ has quit [Quit: Computer has gone to sleep.]
<xybre>
pcfreak30: directly accessing the internal state of another object breaks encapsulation
<pcfreak30>
xybre: I know the order is wrong, just typed it up quicly. In ruby, does the order that classe are defined matter?
<volty>
though you can Class A; end; // and later define it
<pcfreak30>
xybre: What you mean by encapsulation. dont understand that term
<xybre>
pcfreak30: in Ruby code is evaluated as its parsed (for the most part)
ckampfe has joined #ruby
mrsolo has quit [Read error: Connection reset by peer]
<xybre>
pcfreak30: so you can't refer to constants that haven't been defined yet according to the parser
<pcfreak30>
xybre: eh, i guess in php, its interpreted then executed
Croms has quit [Quit: Croms]
mrsolo has joined #ruby
tylersmith has quit [Remote host closed the connection]
<RenderRob>
not quite warming up to these classes and modules yet
<xybre>
pcfreak30: "What is encapsulation? Well, in a nutshell, encapsulation is the hiding of data implementation by restricting access to accessors and mutators.
<RenderRob>
what do modules do for me?
<banisterfiend>
pcfreak30 we can be sure that whatever php does it's probably doing it wrong
tylersmith has joined #ruby
<banisterfiend>
;)
<pcfreak30>
RenderRob: I agree. ruby's take on oranizing stuff is ratically different
<pcfreak30>
banisterfiend: eh well really no language can do someyhing "wrong". Its just its design and how view change
<platzhirsch>
RenderRob: they let you define behavior (methods). So you can group a certain group of behaviours into a module
<RenderRob>
are modules like static classes?
<platzhirsch>
RenderRob: I would say no
<RenderRob>
sounds like the same purpose
<xybre>
Another quote about encapsulation: "Encapsulation in Object Oriented programming refers to the convention of not allowing one part of a program to modify another part of the program without an interface. For example, one object should not modify the internal state (the instance variables) of another object without an interface. Doing so may cause undesirable and difficult to debug behavior."
<platzhirsch>
first I thought that, too
<pcfreak30>
RenderRob: Heres what i have understood so far
<RenderRob>
that's what we use static classes for in Laravel (PHP framework)
<volty>
modules add their methods to the existing class when mixed - that's all folks
<banisterfiend>
pcfreak30 that's really not true ;) languages can have bugs
<platzhirsch>
RenderRob: but modules unfold, when you use them as mixins
<pcfreak30>
RenderRob: a module is mainly for namespacing/packaging
<RenderRob>
oh shit, mixins.
<platzhirsch>
which means you have say a class Butterfly and a module FlyingThing
<pcfreak30>
RenderRob: a class is a subclass of a module thus gets all its ailities
<banisterfiend>
pcfreak30 even the 'design' can have bugs, for example in ruby 1.8 block variables were not local to the block, but closed over outer variables, this was fixed in 1.9
<volty>
"unfold" ? are you in the same class?
<pcfreak30>
RenderRob: a module doesnt have state nor can it have an instance so it IS like a static class in a sense.
<volty>
:)
gtrak has quit [Ping timeout: 264 seconds]
* platzhirsch
pokes volty in the eye with a hot fry
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pcfreak30>
RenderRob: but due to classes subclassing modules, a class can have a static (class method) too.
<volty>
must be a kind of glocal
<pcfreak30>
RenderRob: Thats when my brain melted tryin to find the use case :P
tylersmith has quit [Ping timeout: 240 seconds]
jonathanwallace has joined #ruby
<pcfreak30>
RenderRob: mixins i basically merging or includng a set of functions into a class from a module
katsrc has joined #ruby
gyre007 has quit [Remote host closed the connection]
<volty>
pcfreak30: you are right about that // mixins are,maybe, more about template programming than multiple inheritance (without properties!) logic
<RenderRob>
haha
Galgorth has joined #ruby
<platzhirsch>
I liked the approach of using modules for encapsulating behavior. Because through the classes you have a hierarchy with only one parent class. There can only be one direct ancestor. But modules allow you to add infinite behavior
<Galgorth>
what's the difference between a module mixing with a class and class inheritance?
<RenderRob>
okay, I think I see the logic
zarubin has quit [Ping timeout: 260 seconds]
<Galgorth>
isn't a module basically just a superclass that its 'mixed' classes inherit from?
cupakromer has left #ruby [#ruby]
<banisterfiend>
Galgorth not much, other than the singleton class for a class is mixed into the parallel (singleton) inheritance chain
jsatk has quit [Remote host closed the connection]
slyv has joined #ruby
<pcfreak30>
On that thought, how is it handled if you have mested modules/classes and you do a mixin of a parent module?
<RenderRob>
interesting that classes can be subclasses of modules or of other classes
<banisterfiend>
Galgorth with modules, only the module itself is mixed into the classes inheritance chain, but the singleton class inheritance chain is untouched
<volty>
yes platzhirsch, but the in the real world you have to deal with adding behavior TOGETHER with new, added, attributes (of that added behavior)
iliketur_ has quit [Quit: zzzzz…..]
<Galgorth>
banisterfiend: ok thanks
<platzhirsch>
volty: so?
<pcfreak30>
like you have class A in module a then module b in module a, then have a independant class C incuding modue a?
<xybre>
Well. Technically, modules are like uninstantiable classes. They can have class instance variables defined on them. Probably class variables as well, but I've never tried it.
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RenderRob>
sounds similar to traits in PHP, which is new and I haven't had a chance to use yet
mansi has joined #ruby
<volty>
so you can't just do it with mixins // you have to go another way