ryanlecompte has quit [Remote host closed the connection]
maetthew has quit [Client Quit]
maetthew has joined #ruby
maetthew has left #ruby [#ruby]
qwerxy has joined #ruby
mrsolo has quit [Quit: Leaving]
krawchyk has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
friskd has quit [Ping timeout: 250 seconds]
krawchyk has quit [Remote host closed the connection]
nanothief has joined #ruby
wargasm has joined #ruby
hackerdude has quit [Remote host closed the connection]
verto is now known as verto|off
kokainepizza has joined #ruby
Teddy2steper has quit [Remote host closed the connection]
maetthew has joined #ruby
emocakes has quit [Quit: emocakes]
maetthew has quit [Client Quit]
maetthew has joined #ruby
stkowski has joined #ruby
emocakes has joined #ruby
thams has quit [Quit: thams]
omg765 has quit [Read error: Operation timed out]
d34th4ck3r has quit [Ping timeout: 246 seconds]
tjbiddle has joined #ruby
Teddy2steper has joined #ruby
mayhew has left #ruby [#ruby]
frem has quit [Quit: Computer has gone to sleep.]
tvw has quit [Remote host closed the connection]
Squarepy has quit [Quit: Leaving]
jenrzzz has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
g_bleezy has joined #ruby
emocakes has quit [Quit: emocakes]
squidBits has quit [Quit: whoops]
qwerxy has quit [Quit: offski]
sn0wb1rd has quit [Quit: sn0wb1rd]
rakl has joined #ruby
efrainolivares has quit [Quit: efrainolivares]
thecreators has quit [Quit: thecreators]
rakl has quit [Client Quit]
niklasb has joined #ruby
cousine has joined #ruby
cousine has quit [Remote host closed the connection]
phelps has joined #ruby
phelps has quit [Remote host closed the connection]
zarubin has quit []
whowantstolivefo has quit [Remote host closed the connection]
atno has quit [Quit: Leaving]
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
h4mz1d has quit [Ping timeout: 255 seconds]
cmyers has joined #ruby
jenrzzz has quit [Read error: No route to host]
<cmyers>
when using rspec, I want to print out a special message when an assertion fails, so I am doing something like this: "@foo.attribute.should == "value"" and make it so if it fails, the error message prints out "#{@foo.errors}" or something... does should have a way to include an error msg?
bricker is now known as bricker`away
Shadow_S has joined #ruby
punkrawkR^Home has quit [Ping timeout: 252 seconds]
passbe has joined #ruby
passbe has quit [Changing host]
passbe has joined #ruby
Teddy2steper has quit [Remote host closed the connection]
jimeh has quit [Quit: Computer has gone to sleep.]
Shadow_S has joined #ruby
Russell^^ has quit [Quit: Russell^^]
charliesome has joined #ruby
manizzle has joined #ruby
alanp has quit [Read error: Connection reset by peer]
alanjc_ has joined #ruby
alanp has joined #ruby
fir_ed has joined #ruby
_alejandro has quit [Remote host closed the connection]
kn330 has quit [Ping timeout: 246 seconds]
kn330 has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
pu22l3r has joined #ruby
nga4 has quit []
emergion has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<rwalker>
dead night
dmerrick has joined #ruby
shiin has quit [Quit: Computer has gone to sleep.]
emergion has quit [Client Quit]
browndawg has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
keanehsiao has joined #ruby
dmerrick has quit [Client Quit]
keanehsiao has quit [Client Quit]
brianpWins has joined #ruby
adkron has quit [Ping timeout: 265 seconds]
sayan has joined #ruby
love_color_text_ has quit [Remote host closed the connection]
arkiver has joined #ruby
benlieb has quit [Quit: benlieb]
v0n has quit [Ping timeout: 246 seconds]
<shevy>
rwalker hmmm we plan to take over the world with ruby one day
blakeeb has quit [Read error: No route to host]
tomzx_ has joined #ruby
v0n has joined #ruby
dross has quit [Ping timeout: 244 seconds]
io_syl has joined #ruby
goraxe has quit [Ping timeout: 245 seconds]
aharris6 has quit [Remote host closed the connection]
aedorn has joined #ruby
mguy has joined #ruby
internetishard has quit [Quit: Leaving.]
radic has quit [Disconnected by services]
radic_ has joined #ruby
benlieb has joined #ruby
robbyoconnor has joined #ruby
dross has joined #ruby
ryanlecompte has joined #ruby
rwalker has quit [Ping timeout: 255 seconds]
<charliesome>
shevy: one day all of earth's people will speak ruby
<charliesome>
and only ruby
<charliesome>
and unicode will be rendered worthless
emocakes has joined #ruby
greenarrow has quit [Quit: IRC is just multiplayer notepad]
blakeeb has joined #ruby
tomzx_ has quit [Ping timeout: 250 seconds]
ewag has joined #ruby
dross has quit [Ping timeout: 246 seconds]
emocakes has quit [Ping timeout: 264 seconds]
v0n has quit [Ping timeout: 265 seconds]
c0rn has joined #ruby
kn330 has quit [Ping timeout: 252 seconds]
nari_ has joined #ruby
IrishGringo has quit [Ping timeout: 252 seconds]
kn330 has joined #ruby
wsylvest has joined #ruby
chord_ has joined #ruby
stevechiagozie has joined #ruby
manizzle has quit [Ping timeout: 250 seconds]
rondale_sc has joined #ruby
cirwin has joined #ruby
<rking>
Hey RSpec fans. The top file doesn't do anything, the bottom one works perfectly. What's the trick to get it to work?: https://gist.github.com/4357513
<rking>
NM, ryanf got it solved. It's that I should run it with 'rspec' the binary
c0rn has quit [Quit: Computer has gone to sleep.]
IrishGringo has joined #ruby
aharris6 has joined #ruby
vlad_starkov has joined #ruby
benlieb has quit [Quit: benlieb]
dross has joined #ruby
hadees has joined #ruby
tommyvyo has joined #ruby
vlad_starkov has quit [Ping timeout: 255 seconds]
lolcathost has quit [Ping timeout: 252 seconds]
pzol has joined #ruby
lolcathost has joined #ruby
blakeeb has quit [Ping timeout: 264 seconds]
<shevy>
CodeRay is so cool
<ryanf>
yes
<shevy>
now in my shell when I do "cat bla.rb", and coderay is installed, it gets colourized happily
lolcathost has quit [Ping timeout: 244 seconds]
<shevy>
the only thing that confuses me is, there is a "jump" to the top left screen at the beginning
chendo_ has quit [Ping timeout: 252 seconds]
alanjc_ has quit [Quit: alanjc_]
Guest9041 has quit [Ping timeout: 264 seconds]
Guest9041 has joined #ruby
chendo_ has joined #ruby
aapzak has quit [Ping timeout: 264 seconds]
aapzak has joined #ruby
gridaphobe has quit [Ping timeout: 265 seconds]
Guest9041 has quit [Remote host closed the connection]
fflush has quit []
Hanmac1 is now known as Hanmac
h4mz1d has quit [Ping timeout: 252 seconds]
<shevy>
could this be the terminal "reset" command?
moshee has quit [Ping timeout: 246 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Bosox20051 has joined #ruby
Xeago has joined #ruby
<aedorn>
how did you setup your highlighting via cat?
browndawg1 has joined #ruby
billy_ran_away has joined #ruby
skcin7 has quit [Quit: Computer has gone to sleep.]
<shevy>
aedorn ah, 'cat' is just a substitute for read-content, in ruby ... let me try the real commandline cat
<shevy>
ok aedorn
<shevy>
this command here causes a jump too:
<shevy>
puts CodeRay.scan('', :ruby).term
<shevy>
I am going to look at what .term does
<ryanf>
term just formats it for terminal output
<ryanf>
i.e., puts in the highlighting as ansi codes
<aedorn>
hmm, interesting.. mine does not reset
rondale_sc has left #ruby [#ruby]
<shevy>
hmmmmmmm
browndawg has quit [Ping timeout: 265 seconds]
<shevy>
aedorn oh... when you are in irb, and hit a few newlines, and then you do puts CodeRay.scan('', :ruby).term
love_color_text has quit [Read error: Connection reset by peer]
karupanerura has quit [Excess Flood]
havenn has joined #ruby
keyvan has quit [Ping timeout: 255 seconds]
karupanerura has joined #ruby
ananthakumaran has joined #ruby
Xeago has quit [Remote host closed the connection]
<lewis1711>
another question - are there any test frameworks that don't require you to make a class? something where you can just require your file, and have top level methods like "check_equals"
havenn has quit [Ping timeout: 255 seconds]
love_col_ has quit [Read error: Connection reset by peer]
love_color_text has joined #ruby
love_color_text has quit [Read error: Connection reset by peer]
tar_ has joined #ruby
love_color_text has joined #ruby
love_color_text has quit [Remote host closed the connection]
<anarchist>
oh if you like flattr you'll love this
<anarchist>
7 digit accuracy micro-crowdfunding
<anarchist>
native cryptography
<anarchist>
digital asset contract negotiation with licensing and thousands of contractees
<anarchist>
contractors?
<anarchist>
decentralized payments processing (flattr is centralized)
browndawg has joined #ruby
<anarchist>
json-ld linked data standards
<anarchist>
and last but not least, mint your own currency
<anarchist>
again with native cryptography, decentralized payments processing, URIs are first class citizens
<anarchist>
eventually the payments intents specification will be an open standard (preferably W3C) for kickstarter like crowd funding
<chord_>
BITCOIN
<anarchist>
also there are lines of grant, so you can put $.50 on your knitting websites account, $5 on your music account, $10 on your movie/tv account and let websites deduct either automatically or ask every time
<anarchist>
it can also transact the BTC
<anarchist>
it's a linked data standard for BTC
<anarchist>
oh damn, that's who i should be asking
<anarchist>
i bet there's some ruby knowing bitcoin people
nemesit has joined #ruby
<anarchist>
refill those knitting, blog, music, movie accounts every month
<anarchist>
if you want to give .0000001 of a cent to someone it only costs you 1%
<anarchist>
instead of google's micropayments scheme where the minimum is 49 cents and they take a bigger cut (i'm guessing they take a bigger cut i don't know)
<anarchist>
anyway i just saw the hobbit so if one of you would lend me your sword, another your bow and the last one your axe that'd be awesome :-)
Slivka has joined #ruby
havenn has quit [Remote host closed the connection]
Dreamer3 has joined #ruby
<anarchist>
and of course since it's an open standard for the web you can start your own payments processor yourself (and then not pay the %1 to digital bazaar who wrote the standard). of course then you'll have to convince the banksters to allow you to, which will be aided greatly if digital bazaar is successful. or if we occupy them
eldariof has joined #ruby
_alejandro has joined #ruby
aharris6 has quit [Remote host closed the connection]
shemerey has joined #ruby
cirwin has quit [Remote host closed the connection]
rakl has joined #ruby
arietis has joined #ruby
adeponte has joined #ruby
Axsuul has quit [Ping timeout: 252 seconds]
_alejandro has quit [Remote host closed the connection]
ninegrid has quit [Ping timeout: 264 seconds]
sandGorgon has joined #ruby
obind has quit []
bluOxigen has joined #ruby
atmosx has joined #ruby
nemesit has quit [Quit: Leaving...]
topriddy has quit [Read error: Connection reset by peer]
sandGorgon1 has joined #ruby
Slivka has quit [Remote host closed the connection]
Slivka has joined #ruby
blueoxigen has joined #ruby
Slivka has quit [Remote host closed the connection]
<atmosx>
Hello
<atmosx>
I'm trying to load a css file into views/layout.haml without success. At views/layout.haml I have this line: %link(rel="stylesheet" href="css/styles.css") and the styles.css is located at public/css/ any ideas why that happens? :/ I'm using sinatra as a framework
Slivka has joined #ruby
love_color_text has quit [Read error: Connection reset by peer]
S0da has joined #ruby
love_color_text has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
love_color_text has quit [Read error: Connection reset by peer]
codezombie has joined #ruby
love_color_text has joined #ruby
love_color_text has quit [Remote host closed the connection]
topriddy has joined #ruby
browndawg has quit [Quit: Leaving.]
Slivka has quit [Quit: Slivka]
hero has joined #ruby
hero has quit [Changing host]
hero has joined #ruby
love_color_text has joined #ruby
Monie has quit [Read error: Connection reset by peer]
keyvan has joined #ruby
keyvan has quit [Read error: Connection reset by peer]
love_color_text has quit [Read error: Connection reset by peer]
love_color_text has joined #ruby
S0da has quit [Remote host closed the connection]
<chord_>
anarchist: WE NEED BITCOIN TO TAKE OFF
Slivka has joined #ruby
<anarchist>
chord_: would you be willing to help build a transaction processor for bitcoin (but also many other currencies as well) using a JSON-LD parser for ruby?
adeponte has quit [Remote host closed the connection]
love_color_text has quit [Read error: Connection reset by peer]
love_color_text has joined #ruby
<chord_>
anarchist: would you be willing to teach me how in god's hell the cryptography in bitcoin works ;)
<anarchist>
i could teach you a lot about bitcoin
<anarchist>
including where the first bitcoins came from
<anarchist>
i don't know a lot about cryptography specifically though
jgrevich has quit [Quit: jgrevich]
<chord_>
how can you build a bitcoin processor without knowing how the cryptography works
<anarchist>
well the mining part doesn't change, this is just adding structured data so that people know there was a transaction, what size it was for, who made the transaction (if that information is made public on the web), some other things
sandGorgon1 has quit [Read error: Operation timed out]
<anarchist>
so if you have FOAF (friend of a friend) information, or SIOC (semantically interconnected online communities) talking about specific transactions that could all work together
elkclone has joined #ruby
<anarchist>
it's pretty structured already, what this would do is create the same structured data for transactions in ALL currencies not just bitcoin
<anarchist>
it HAS structure but it's not yet JSON-LD
<chord_>
wait why in hell would anyone tel lyou about their credit card transactions
<anarchist>
well think about social movements
<anarchist>
occupy wall street for instance
sandGorgon has quit [Ping timeout: 260 seconds]
<chord_>
why would they need to know
squidBits has joined #ruby
<anarchist>
participatory budgeting needs there to be some transparency of financial information
<anarchist>
or else it's not an open collaborative process and there's accounting questions like happened with occupy
<chord_>
so you build some website, why should anyone believe the data on the website
<atmosx>
anarchist: my problem with BT is the exchange, I cannot exchange the money *at any given time*
<atmosx>
anarchist: other than that, I'd gladly use it
<anarchist>
actually it's not a website, it's a payment standard for all programming languages, starting with php, then node.js and hopefully now ruby
<chord_>
what do you mean payment standard, bitcoin already exists right?
<anarchist>
so that means every php site, every node.js site, every ruby site that transacts in BTC, dollars, yen or even new currencies that people make up
emocakes has joined #ruby
<anarchist>
i mean a standard that interoperates with the linked data cloud
<chord_>
so why would anyone use something that has a single point of eavesdropping
<anarchist>
or even if that standard is not linked data in itself, although if it were payswarm it would be, then at least it should transact as many currencies as possible
<anarchist>
well if you're talking about the actual currency mint that's almost always centralized bitcoin being the notable exception
<anarchist>
if you're talking about transactions processing that's decentralized in payswarm
<anarchist>
so there's two kinds of things, payment authorities and payments processors
<anarchist>
in the case of bitcoin the payment authority is the big ol' blockchain in the sky
<anarchist>
but anybody could be a payments processor using JSON-LD and the Payswarm standard
love_color_text has quit [Remote host closed the connection]
<chord_>
i'm not getting it what is the point of payswarm if bitcoin already exists
adambeynon has joined #ruby
lenovodroid has joined #ruby
<anarchist>
to make that data interoperable with other ontologies for linked data that already exist like FOAF, SIOC or that will exist in the future like ontologies for parts suppliers and parts numbers for electronics and where to buy them
<anarchist>
it doesn't make bitcoin more centralized, in fact it allows bitcoin to interoperate with ontologies and linked data that are highly decentralized
<chord_>
you are making no sense, need a concrete example of how this gets used
<anarchist>
well let's say you're writing accounting software for a workers' coop that makes paraffin wax heaters and you want to open source your business model so others can build the heaters because you'd rather have cheaper heaters so you can get started open sourcing more technologies
adambeynon has quit [Client Quit]
<chord_>
ok
<anarchist>
you need a way to expose data about what parts you're buying, how much you bought, what departments bought what, how to link that to the exact time in the archived audio/video conference where you made the decision, relevant keyword searches from the minutes for that meeting
<anarchist>
maybe some of your donors want to see how you're spending the money or they won't give
lapinferoce has left #ruby ["Konversation terminated!"]
<chord_>
so you have a sql database whats the problem
<anarchist>
so you want a way of showing how their exact transaction got spent exactly on the thing you said you'd spend it on
lepht has quit [Quit: wat was that i dont even]
<anarchist>
well the problem with a sql database is that the data lives in a silo
<anarchist>
you can say you're exposing it on the web, but nobody else can use your sql database the way you do
<chord_>
the data has to be on same computer
<anarchist>
makes it very hard to do forensic accounting
<chord_>
so you gotta put the data on some computer
<anarchist>
yeah but even when you put data on the same computer, if in one table "name" means the person's name but in another table "name" means a username
<anarchist>
and both datasets are about usernames on a website
<anarchist>
then they can't seamlessly interoperate
topriddy has quit [Read error: Connection reset by peer]
lepht has joined #ruby
<chord_>
so how is payswarm relevant at all to this
shtirlic_ has joined #ruby
<anarchist>
because it's written in JSON-LD (javascript serialized objection notation for linking data)
<anarchist>
so it's interoperable with other linked data
<chord_>
and why is json-ld going to fix everything
<anarchist>
not fix everything
<anarchist>
fix the interoperability of data problem
<chord_>
how do you plan on forcing people to use json-ld
<anarchist>
same way people are 'forced' to use any web technology. because that's what all the cool stuff runs on
love_color_text has joined #ruby
Slivka has quit [Remote host closed the connection]
love_color_text has quit [Remote host closed the connection]
Slivka has joined #ruby
<chord_>
so whats the api that is exposed?
love_color_text has joined #ruby
Slivka has quit [Remote host closed the connection]
love_color_text has quit [Read error: Connection reset by peer]
arkiver has quit [Max SendQ exceeded]
love_color_text has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
arkiver has joined #ruby
<anarchist>
chord_: did you see Watson Jr. ?
<anarchist>
on jeopardy
blakeeb has joined #ruby
<anarchist>
can beat any human opponent
<chord_>
yah
<anarchist>
let's say i were to ask you on jeopardy. these are the names of the top 10 largest holders of bitcoins
<anarchist>
or "the second and seventh largest holders of bitcoins earned their bitcoins primarily by doing this"
Slivka has joined #ruby
<anarchist>
well linked data can answer questions like that on the fly
love_color_text has quit [Remote host closed the connection]
<anarchist>
because the intelligence is in the data not in the application
<chord_>
so whats the point of using sqarql and not sql
<anarchist>
so the answer to that question would just be a sparql query against databases that store relevant information no matter where the data is at on the web
<chord_>
or something else like couchdb
<chord_>
how would a sparql query know where the databases are
<anarchist>
there's a standard place for sparql endpoints and standardized linked data for how to get all the sparql endpoints programmatically from any website you consume linked data from
<anarchist>
so it's probably in the standard place, and if it's not, there could be a programmatic way of finding out the sparql endpoint just because you happened on a link to that data from someplace random
<chord_>
and how does data get added to these databases and what does this data look like
<anarchist>
it basically means automating application development once there are linked data content management systems (not to produce data which is simple but to consume it)
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
<anarchist>
instead of a programmer taking a week an ontological philosopher could write an app in an hour
<anarchist>
intelligent agents basically
g_bleezy has joined #ruby
<chord_>
i'm not getting what exactly is this app suppose to do?
<anarchist>
the occupy ontology is not an app itself it's just the data model
<anarchist>
music bore is an app though
browndawg has joined #ruby
Monie has joined #ruby
<anarchist>
it browses music datasets, dbpedia, and other linked data to do the job of a disc jockey
<chord_>
so you are thinking about some website that lets you browse json-ld that has somehow been submitted?
g_bleezy has quit [Ping timeout: 256 seconds]
<anarchist>
the json-ld is generated alongside a normal human readable application
<anarchist>
but when you do an http GET on an http URI you hope to return RDF
<anarchist>
instead of a human readable page
<anarchist>
and that RDF data allows you to dereference other URIs that may be of interest
yxhuvud2 has joined #ruby
<anarchist>
so the musicbore doesn't know what it's going to find, it just follows its nose. it would be hard to write an application that tells you how the last artist in a random playlist is connected to the current artist playing otherwise
<chord_>
you need to make like some prototype gui that shows exactly what this is suppose to do, because i'm just not getting it
<anarchist>
the thing is it's very much not about the GUI
<anarchist>
it might as well be a SIRI like app that just speaks to you directly with text to speech
<anarchist>
the reason for GUIs is human readability
<chord_>
a prototype to show what the transaction json data is suppose to look like
<anarchist>
and a payswarm client in ruby should be ~1300 lines of code
ProZzZz is now known as Proshot
Guest25886 has joined #ruby
blakeeb has quit [Ping timeout: 250 seconds]
Vert has joined #ruby
blacktulip has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
h4mz1d has joined #ruby
yacks has joined #ruby
blacktulip has quit [Remote host closed the connection]
<oxman>
the next Datamapper 2 will be awesome :)
luckyruby has joined #ruby
arkiver has quit [Ping timeout: 252 seconds]
h4mz1d has quit [Ping timeout: 252 seconds]
Guest25886 has quit [Ping timeout: 265 seconds]
marr has joined #ruby
sayan has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
yacks has quit [Read error: Operation timed out]
Tux-Tn has joined #ruby
Guest25886 has joined #ruby
arkiver has joined #ruby
jwang has quit [Quit: Leaving]
emocakes has joined #ruby
whowantstolivefo has joined #ruby
emocakes has quit [Read error: Operation timed out]
arkiver has quit [Ping timeout: 255 seconds]
workmad3 has quit [Quit: Lost terminal]
vlad_starkov has joined #ruby
rakl has quit [Quit: sleeping]
emocakes has joined #ruby
vlad_starkov has quit [Ping timeout: 255 seconds]
cantonic has quit [Quit: cantonic]
lenovodroid has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
lkba has quit [Ping timeout: 246 seconds]
lenodroid has joined #ruby
lenovodroid has quit [Read error: Connection reset by peer]
sayan has joined #ruby
Banistergalaxy has joined #ruby
cantonic has joined #ruby
ikaros has joined #ruby
havenn has joined #ruby
yxhuvud has joined #ruby
pavilionXP has joined #ruby
woolite64 has quit [Ping timeout: 245 seconds]
lenodroid has quit [Read error: Connection reset by peer]
lenodroid has joined #ruby
yxhuvud2 has quit [Ping timeout: 255 seconds]
thone has joined #ruby
lenodroid has quit [Read error: Connection reset by peer]
Neomex has joined #ruby
lenodroid has joined #ruby
Neomex has quit [Client Quit]
rakl has joined #ruby
thone_ has quit [Ping timeout: 252 seconds]
Virunga has joined #ruby
havenn has quit [Remote host closed the connection]
Slivka has quit [Remote host closed the connection]
aapzak has quit [Ping timeout: 250 seconds]
aapzak has joined #ruby
maesbn has joined #ruby
cantonic has quit [Quit: cantonic]
rippa has joined #ruby
arkiver has joined #ruby
nari_ has quit [Ping timeout: 252 seconds]
ozgor has joined #ruby
lenodroid has quit [Ping timeout: 250 seconds]
maesbn has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
verto|off is now known as verto
generalissimo has joined #ruby
marr has quit [Ping timeout: 255 seconds]
generalissimo has quit [Remote host closed the connection]
lkba has joined #ruby
sayan has quit [Read error: Connection reset by peer]
_64k has joined #ruby
samuel02 has joined #ruby
<emocakes>
i never knew ricky martin was gay :\
<atmosx>
emocakes: seriously?
<atmosx>
emocakes: I don't want to ruin your childhoot, but Keanu Reeves is gay too.
lkba has quit [Quit: Bye]
pmros has joined #ruby
lkba has joined #ruby
<pmros>
hi
TheFuzzball has quit [Ping timeout: 255 seconds]
banisterfiend has joined #ruby
<emocakes>
bullshit atmosx
<emocakes>
really?
berserkr has joined #ruby
<atmosx>
well, yeah..
<emocakes>
thanks for spoiling my xmas
<whowantstolivefo>
how can i kill webrick from bash ? it says from bash i say rails server and i get the following error /home/aslan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/utils.rb:85:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
atno has joined #ruby
<emocakes>
ps -A | grep webrick
<emocakes>
:p
<emocakes>
kill pid
<emocakes>
or killall webrick
<atno>
morning
rakl has quit [Quit: gone]
<emocakes>
those are rumors atmosx
<emocakes>
:\
<atmosx>
Sure, I don't know him in person.
<atmosx>
You probably need to figure why someone being queer bothers you.
Nuck has joined #ruby
xbob has joined #ruby
_bart has quit [Quit: _bart]
maesbn has joined #ruby
Xeago has joined #ruby
<apeiros_>
atmosx +1
horofox has joined #ruby
* apeiros_
never got why other people's sexual preference bothers people
<apeiros_>
ZOMG it destroys the sanctity of marriage! *eyeroll*
<apeiros_>
ah, no, that was gay marriage *needstowakeup*
nomenkun_ has joined #ruby
nomenkun has quit [Read error: Connection reset by peer]
<GodFather>
newbie trying to find doc on '!' in this context cmd.chomp! help please
<Mon_Ouie>
It's just part of the name of the method (chomp and chomp! are two different methods)
<Mon_Ouie>
In this case, it means it mutates the object you call the method on, instead of returning a new one
nemesit has quit [Quit: Leaving...]
<Mon_Ouie>
More generally it denotes something dangerous (in particular, a "dangerous" variant of another method)
shemerey has quit [Quit: Leaving...]
rwalker has joined #ruby
sayan has joined #ruby
ToTo has quit [Quit: Leaving...]
lawgic has joined #ruby
Takehiro has quit [Remote host closed the connection]
slainer68 has quit [Remote host closed the connection]
lawgic has quit [Client Quit]
love_color_text has quit [Remote host closed the connection]
Takehiro has joined #ruby
<GodFather>
Mon_Ouie, thank you, and happy holidays
<Mon_Ouie>
No problem ;) and same to you
freeayu has quit [Remote host closed the connection]
Guest25886 has quit [Read error: Connection reset by peer]
GodFather has quit [Quit: Leaving]
yacks has quit [Ping timeout: 255 seconds]
wf2f has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Quit: Leaving]
elaptics is now known as elaptics`away
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
<samuel02>
does anyone now of a lib that can get me a title an summary of a web page?
rwalker is now known as reppard
<samuel02>
*and a summary...
<Mon_Ouie>
Depends on what you mean by "summary". Finding the title of the page should pretty simple using an HTML/XML parser
F1skr has joined #ruby
<Mon_Ouie>
(e.g. Nokogiri)
Takehiro has quit [Remote host closed the connection]
<samuel02>
Mon_Ouie, yeah I've been experimenting a bit with Nokogiri and Pismo but I guess I need something that can do some language processing or write it all myself..
trying has joined #ruby
shtirlic has quit [Remote host closed the connection]
<samuel02>
Mon_Ouie: Have you used the Flipboard app for iOS?
<Mon_Ouie>
Nope
<samuel02>
Mon_Ouie, ok well basically it gives the first paragraphs of the text and manages to not show other stuff like the navigation, sidebars, ads etc.
shemerey has joined #ruby
<samuel02>
or kind of like what Google does for search results
lolcathost has joined #ruby
Goles has joined #ruby
<Mon_Ouie>
I'm not sure exactly what google does, but I think they start with simply checking a meta node in the page's header
<samuel02>
Mon_Ouie, I'm not positive either but I don't think that's true, most people don't care about adding all that meta data
pavilionXP has quit [Ping timeout: 265 seconds]
<samuel02>
Mon_Ouie, e.g. wikipedia
<Mon_Ouie>
Sure, but I think it does have precedence if it's there
love_color_text has quit [Ping timeout: 244 seconds]
<yxhuvud2>
Most classes are plain factories. Struct is a factory factory.
<RomainT>
:/
<swarley>
It seems stupid to me that OpenStruct doesn't have a #[]
<Hanmac>
like a bead toaster maker :D
johnmilton has joined #ruby
ryanlecompte has quit [Ping timeout: 252 seconds]
<oxman>
could you give me a sample to copycat the Struct class ?
nilg has quit [Ping timeout: 265 seconds]
<SqREL>
Hi. Can anybody help me with openssl? I need to write this "openssl dgst -sign some_cert_with_keys.pem -out output.txt -md5 input.txt" on ruby's OpenSSL. When i do this http://pastebin.com/m3yjMwYX i get a little different code, that native openssl generates
hoelzro|away is now known as hoelzro
alanjc_ has joined #ruby
<apeiros_>
banisterfiend: very nice
wallerdev has quit [Quit: wallerdev]
<apeiros_>
banisterfiend: why `rake pry`? o0
<banisterfiend>
apeiros_: ah that's just what we use when we're working on HEAD
<jzig>
I understand I should make it as easy as possible for anyone to help me, I guess I just don't understand what is wrong with the default indenting from sublime text or why it indents ruby code in a way that is not the convention.
<swarley>
jzig; just go to your syntax settings and change tabs to spaces and tab width to two
<swarley>
For ruby only
<oxman>
thanks
<swarley>
That's my setting on sublime
<jzig>
awesome, thanks
slainer68 has quit [Remote host closed the connection]
<swarley>
without the { } if you already have a base configuration
chussenot has joined #ruby
whowantstolivef1 has joined #ruby
<aedorn>
is there some way of seeing gems released recently on rubygems.org?
ltsstar has joined #ruby
<jzig>
swarley: Looks great, thanks
<jzig>
little things the tutorials don't tell you
Takehiro has quit [Read error: Connection reset by peer]
reppard has joined #ruby
_bart has quit [Ping timeout: 246 seconds]
yxhuvud has joined #ruby
tjbiddle has joined #ruby
iamjarvo has joined #ruby
Virunga has quit [Remote host closed the connection]
horofox has quit [Quit: horofox]
anarchist has quit []
yxhuvud2 has quit [Ping timeout: 256 seconds]
<matip>
what type do you use when you want a time column with timezone in datamapper?
sepp2k1 has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
sepp2k has quit [Ping timeout: 265 seconds]
pyr0commie has joined #ruby
<matip>
type DataTime and Time creates a column with type "timestamp without time zone" in postgresql
nerd has quit [Quit: WeeChat 0.3.9.2]
wermel has quit [Remote host closed the connection]
chussenot has quit [Ping timeout: 252 seconds]
jimeh has quit [Quit: Computer has gone to sleep.]
regedarek has quit [Quit: Lost terminal]
kiyoura has joined #ruby
<Kneferilis>
why you need two ifs here: if KEYWORDS.include?(identifier) in javascript you would do if( keywords.indexOf(identifier) !== -1 )
reppard has quit [Ping timeout: 260 seconds]
maesbn has joined #ruby
<apeiros_>
where do you see two if's there?
<Kneferilis>
there is a ? in the there
<Kneferilis>
what does it do?
<jrajav>
That's just part of the name of the method
icole has joined #ruby
<Kneferilis>
looked like the alternative if syntax
<jrajav>
Nope
<jrajav>
And that's not an alternative if you're thinking of, it's the ternary operator
browndawg has quit [Quit: Leaving.]
<jrajav>
There are subtle differences
jlwestsr has quit [Read error: Operation timed out]
<jrajav>
Generally, in Ruby, if you see a method that has ? at the end, it's to indicate that it's a method that tests some condition and returns a boolean value
h4mz1d has joined #ruby
<Kneferilis>
I see.
jenrzzz has joined #ruby
<jrajav>
There are other such conventions - for instance, a method ending in ! means that instead of returning a new object with the given operation applied, it instead applies that operation to the original object (the ! stands for "dangerous", since it's mutating the object)
banisterfiend has joined #ruby
iamjarvo has quit [Quit: Leaving.]
<Kneferilis>
does this add a string to the array?
<Kneferilis>
tokens << [identifier.upcase.to_sym, identifier] it doesn't look like a string
maesbn has quit [Remote host closed the connection]
bigmac has joined #ruby
maesbn has joined #ruby
dsdeiz has quit [Ping timeout: 265 seconds]
jgrevich has joined #ruby
slainer68 has joined #ruby
atno has quit [Ping timeout: 255 seconds]
iamjarvo has joined #ruby
<swarley>
Kneferilis; no it does not
<Kneferilis>
what does it add?
<swarley>
an Array
skcin7 has joined #ruby
<swarley>
[1] pry(main)> [1,2,3] << [1,2]
<swarley>
=> [1, 2, 3, [1, 2]]
pmros has quit [Read error: Connection reset by peer]
hoelzro|away is now known as hoelzro
pmros has joined #ruby
<Kneferilis>
I see!
tjbiddle has quit [Quit: tjbiddle]
bluOxigen has joined #ruby
<Kneferilis>
and what is this: else tokens << [:IDENTIFIER, identifier] end
Teddy2steper has joined #ruby
<Kneferilis>
the :IDENTIFIER?
kirun has quit [Ping timeout: 265 seconds]
Jasko has quit [Read error: Connection reset by peer]
banisterfiend has quit [Ping timeout: 245 seconds]
Jasko has joined #ruby
Karasuhebi has joined #ruby
Karasuhebi has left #ruby [#ruby]
squidBits has joined #ruby
<shevy>
Kneferilis a symbol
<shevy>
Kneferilis do you have irb
<shevy>
start irb
<shevy>
then do this:
sepp2k1 has quit [Ping timeout: 265 seconds]
<shevy>
:IDENTIFIER.class
<shevy>
go start irb now Kneferilis!!!!!
<shevy>
a symbol is always unique
<shevy>
memory efficient, always the same
<Kneferilis>
ok
<shevy>
:foo.object_id # => 153778
<shevy>
:foo.object_id # => 153778
stevechiagozie has quit [Ping timeout: 255 seconds]
<shevy>
it has always the same object id
<shevy>
compare to string "foo":
<aedorn>
way too excited about symbols there
<shevy>
"foo".object_id # => -616078768
<shevy>
"foo".object_id # => -616081358
<iamjarvo>
i have been doing some pratice probs and i am noticing a pattern but cant describe it. so say you have a hash. the keys are words to be replaced and values are the new words. my initial thought process was to loop through the string and do the replacing but they looped through the hash
<Kneferilis>
but shevy the example folder does not have an identifier class
<shevy>
Kneferilis what does that mean
<shevy>
Kneferilis do you try to decipher code written by someone else? :\
<Kneferilis>
shevy: yes
<shevy>
it's not good...
<Kneferilis>
I don't know much ruby
<shevy>
you need your brain to be active
gener1c has quit [Remote host closed the connection]
thams has quit [Read error: Connection reset by peer]
love_color_text has joined #ruby
thams has joined #ruby
chussenot has quit [Ping timeout: 252 seconds]
<aedorn>
I'm sure it wouldn't take much effort to use mruby in a browser plugin to do that .. of course, as a means to have a GUI I don't think it's worth it for that alone.
yfeldblum has quit [Ping timeout: 252 seconds]
yxhuvud has quit [Ping timeout: 264 seconds]
<hoelzro>
aedorn: I've thought of doing something like that
vlad_starkov has quit [Ping timeout: 250 seconds]
<hoelzro>
but I think that the future (at least for now) is compiling to JS
Bedry has left #ruby [#ruby]
<apeiros_>
go both ways
<apeiros_>
have a plugin which can do it natively
<apeiros_>
and a ruby.js runtime as fallback for all the others
<hoelzro>
that would be nice
love_color_text has quit [Ping timeout: 265 seconds]
maetthew has joined #ruby
omg765 has joined #ruby
ozgor has quit [Quit: ozgor]
<aedorn>
well, we experimented with a full ruby environment called from firefox to do "inline ruby" in the browser
<apeiros_>
nice
<apeiros_>
how did it go?
wargasm has joined #ruby
_bart has joined #ruby
<aedorn>
Not too bad. You don't much overhead if you're just talking to a separate process and feeding information back and forth as required. And it's actually not too much code to do it
jonathanwallace1 has quit [Quit: WeeChat 0.3.9.2]
<aedorn>
You don't get* even ..
g_bleezy has quit [Remote host closed the connection]
hackerdude has joined #ruby
<aedorn>
In fact, the only reason we scrapped the whole thing was because it was going to take too long to remove stuff we didn't want, rather than add the things we did.
<Kneferilis>
aedorn: someone could write a javascript library that parses ruby code
<Kneferilis>
what I do now is a language that runs on javascript
<canton7>
Doesn't seem to. Probably someone being over-zealous
love_color_text has joined #ruby
VegetableSpoon has joined #ruby
stevechiagozie has joined #ruby
QKO has joined #ruby
Dario_ has quit [Ping timeout: 255 seconds]
brianpWins has quit [Quit: brianpWins]
love_color_text has quit [Ping timeout: 252 seconds]
lolcathost has quit [Quit: leaving]
horofox has quit [Ping timeout: 246 seconds]
snearch has quit [Quit: Verlassend]
Takehiro has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
QKO_ has quit [Ping timeout: 272 seconds]
slainer68 has quit [Remote host closed the connection]
Catnaroek has joined #ruby
nomenkun has quit [Remote host closed the connection]
voodoofish has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
slainer68 has joined #ruby
kenneth has joined #ruby
<kenneth>
hey, can you make a gem spec draw its dependencies form the gemfile?
<kenneth>
instead of repeating them
nyuszika7h has joined #ruby
<canton7>
kenneth, other way around: specify gems in your gemspec, and "import" those into your gemfile
<thibauts>
Hi, what would be a clean way to serialize to json an object whose properties can be objects or arrays of objects (with arbitrary nesting depth) ?
<canton7>
thibauts, and the json library doesn't handle it properly?
cantonic has quit [Ping timeout: 260 seconds]
cantonic_ is now known as cantonic
<canton7>
(the answer is "recursively" - each object defines a #to_json, which builds its json representation by calling its members' #to_json methods. But the json library should do that)
<thibauts>
canton7: I tried to_json but it renders sub-objects as string representation of themselves. For some context i'm trying to serialize output from ruby-whois
atmosx has quit [Quit: Computer has gone to sleep.]
<thibauts>
Thanks guys, i only had to make Struct serializeable, and all subclasses provided by ruby-whois serialized fine. I hadn't practiced ruby for a few years and I had forgotten those nice features. That's amazing :)
<canton7>
awesome :)
<csmrfx>
thats freakin
stevechiagozie has quit [Quit: leaving]
ryanlecompte has joined #ruby
arturaz has quit [Ping timeout: 245 seconds]
<shevy>
cool
<shevy>
serializeable structs
<thibauts>
For me it really is. I didn't expect to solve that so easily
<shevy>
immortal objects residing on the www
joeycarmello has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
Axsuul has joined #ruby
<csmrfx>
I'd prefer marshal any day tho
nathan28 has joined #ruby
joeycarmello has quit [Remote host closed the connection]
<nathan28>
anyone got a handy piece of regex to reject html color hex values from an array of strings?
<thibauts>
csmrfx: for a web service ? BTW if you can point me to a clean solution to putting this queryable via HTTP i will be thankful
cousine has joined #ruby
<csmrfx>
nathan28: css?
<csmrfx>
just extracting color hex values from any arbitrary string is going to lead to problems
<shevy>
guys, I have a module, let's say module Foo. In that module, I have a debug constant, let's call it DEBUG. I can access it via Foo::DEBUG, by default this variable is false. I believe I can set it to Foo::DEBUG = false, but constants should not be changed or? so I wonder, what else to use, if I want to "store" state in a module
<shevy>
I meant Foo::DEBUG = true
<csmrfx>
for example, "abba" and "caffee" are both valid hex strings
<nathan28>
csmrfx: yeah ii'm trying to parse rss feeds and some of them are full of html color codes but [a-f0-9] looks dangerous
<thibauts>
shevy: use an instance variable and store your constant's value in it ?
<shevy>
the reason I want to have this is so I can toggle it on a per-project base actually, in one place, for the whole project
<shevy>
hmm that would work thibauts?
havenn has joined #ruby
topriddy has joined #ruby
rburton- has joined #ruby
<nathan28>
csmrfx: looks like more than regex would be necessary, got to yank out any inline tags i guess
<thibauts>
csmrfx: well, i'd prefer not to reimplement http if possible ^^
crackfu has joined #ruby
<csmrfx>
thibauts: see the code example under "A simple server would look like"
<apeiros_>
um, bad idea
<csmrfx>
on its own, probably so
<apeiros_>
csmrfx: "a webservice" is lingo for "SOAP Webservice"
<csmrfx>
yeah
<apeiros_>
Socket is quite a bit too low level for that.
<csmrfx>
with a nice simple function, might be all you need
<canton7>
for me, sinatra every time for simple web stuff
WanderingGlitch has quit [Changing host]
WanderingGlitch has joined #ruby
<nathan28>
^
<nathan28>
sinatra is great
<apeiros_>
thibauts: I'd google or go to ruby-toolbox, there's probably some gems for rails, sinatra or rack which make creating webservices rather easy
<canton7>
or eventmachine + one of the http extensions/plugins/whatever they're called
<apeiros_>
thibauts: I think one such lib is RABL
omg765 has joined #ruby
<thibauts>
i come from python, i'm used to mount functions in a few lines of code with wsgi. i'm looking for something similar in ruby
chussenot has quit [Quit: chussenot]
<apeiros_>
thibauts: the wsgi equivalent would be Rack
bluebie has left #ruby [#ruby]
<apeiros_>
and this is a valid rack app: proc { |env| [200, {:"content-type" => "text/plain"}, ["Hello World!"]] }
<csmrfx>
do you really need rack if thats all you need?
<thibauts>
apeiros_: That looks *awesome* :p
<apeiros_>
i.e., anything that responds to "call", accepts 1 param (env, containing the request and a bit more) and returns an array with 3 items (status code, headers, body)
eldariof has quit []
<apeiros_>
csmrfx: try and see how much time you need to do even a minimal implementation of what rack does for you…
cousine has quit [Remote host closed the connection]
<csmrfx>
yeah, probably
<thibauts>
does rack have an embedded web server ?
<apeiros_>
hint, if it's more than 1h, reading racks docs is probably the easier route.
<csmrfx>
haha
<apeiros_>
thibauts: no idea, but since there's like twenty thousand ruby based webservers (one in stdlib), there's no real need I guess
<apeiros_>
I'd assume that rack can run standalone and will use webrick (the stdlib webserver)
<csmrfx>
apache or nginx
<canton7>
apeiros_, sounds right
<apeiros_>
ah, yes, I remember, rack can run standalone, see rackup
<thibauts>
apeiros_: Ok, i should be able to find my way
<apeiros_>
thibauts: anyway, rack is sufficiently documented iirc
<canton7>
or it can use thin, etc
<apeiros_>
and if you can't find your way around, you can still come back and ask :-p
<apeiros_>
yeah, thin, unicorn, nginx or apache are recommended
<apeiros_>
first 2 are ruby based webservers, last 2 you probably know from elsewhere
<thibauts>
Just out of curiosity, how does it interface with nginx ? fastcgi ?
<apeiros_>
passenger
<apeiros_>
passenger-phusion, an extension. same one for apache.
<apeiros_>
(or phusion-passenger? memory is low atm)
<thibauts>
ok, looks like uwsgi for ruby
<canton7>
the latter
<canton7>
or you can reverse-proxy to thin, unicorn, etc
<apeiros_>
when in doubt, canton7
<apeiros_>
we do nginx reverse-proxy to unicorn at work
<canton7>
thibauts, 1) don't require rubygems (unless you're running 1.8). 2) line 35: if ARGV.empty? Also exit with a non-zero code, but that's not really ruby-related. Also, why mongrel?
<canton7>
otherwise looks good
<thibauts>
canton7: i'm running 1.8 (apt-get ..), is it "wrong" ? mongrel because i lazily copy pasted code that used it :p
<canton7>
thibauts, aha. 1.8 is not really recommended, but hey. that'll explain how you got mongrel to work anyway (iirc mongrel + ruby1.9 = no worky)
nemesit has quit [Quit: Leaving...]
<thibauts>
canton7: if i install 1.9, what would be the best bet for a handler ? also, i'm worried that i won't be able to plug my code to passenger in case i want to, is there a "portable" way to make it work both as an embedded app and s a standalone server ?
benlieb has quit [Quit: benlieb]
Proshot has quit [Quit: Leaving]
Catnaroek has quit [Ping timeout: 265 seconds]
<canton7>
thibauts, I'd use thin instead of mongrel, either way. Look at config.ru. That's what passenger uses to start your rack app
slainer68 has joined #ruby
Catnaroek has joined #ruby
<canton7>
then a call to 'rackup' will start your app using whatever handler (thin, mongrel, etc), and passenger can just start it natively
<havenn>
unicorns and rainbows!
v0n has quit [Read error: Connection reset by peer]
EhyehAsherEhyeh has quit [Ping timeout: 265 seconds]
benlieb has joined #ruby
love_color_text has joined #ruby
lenovodroid has joined #ruby
Averna has joined #ruby
icole has quit [Remote host closed the connection]
statarb3 has joined #ruby
love_color_text has quit [Ping timeout: 260 seconds]
statarb3 is now known as Proshot
reppard has joined #ruby
alanp has quit [Read error: Connection reset by peer]
alanp has joined #ruby
koshii has joined #ruby
tchebb has quit [Ping timeout: 252 seconds]
ninegrid has joined #ruby
johnmilton has quit [Quit: Leaving]
Dario_ has joined #ruby
tchebb has joined #ruby
RomainT has left #ruby [#ruby]
<thibauts>
canton7: this looks much better now .. running on thin
<canton7>
cools. with rackup?
jaygen has quit [Remote host closed the connection]
Dario_ has quit [Ping timeout: 255 seconds]
<thibauts>
canton7: yes
jrajav has quit [Read error: Connection reset by peer]
jrajav has joined #ruby
forcefsck has joined #ruby
icole has joined #ruby
<canton7>
thibauts, nice :)
mercwithamouth has joined #ruby
mage_ has left #ruby [#ruby]
bobrossasaurus has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
Takehiro has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
mockra has joined #ruby
Kneferilis has left #ruby [#ruby]
yxhuvud2 has joined #ruby
yxhuvud has quit [Ping timeout: 264 seconds]
mockra has quit [Ping timeout: 252 seconds]
alanjc_ has joined #ruby
skcin7 has quit [Quit: Computer has gone to sleep.]
benlieb has quit [Quit: benlieb]
berserkr has quit [Quit: Leaving.]
reppard has quit [Ping timeout: 244 seconds]
pen has quit [Read error: Connection reset by peer]
eka has quit [Quit: Computer has gone to sleep.]
pen has joined #ruby
Tumulte has quit [Remote host closed the connection]
eka has joined #ruby
tenmilestereo has quit [Quit: Leaving]
wargasm has quit [Ping timeout: 265 seconds]
havenn has quit [Remote host closed the connection]
tr4656 has quit [Ping timeout: 250 seconds]
vlad_starkov has joined #ruby
lenovodroid has quit [Remote host closed the connection]
squidBits has joined #ruby
kiyoura` has joined #ruby
parzorep has quit [Remote host closed the connection]
parzorep has joined #ruby
neurotech has joined #ruby
<shevy>
hmm I just noticed something
<shevy>
in .rb files, you can do stuff like this
jaygen has joined #ruby
<shevy>
cd '/tmp/foo-1.0'
<shevy>
and cd() could be a call to Dir.chdir()
<shevy>
that is almost as good as bash shell scripts
<shevy>
except that in the latter, you could do this:
<bobrossasaurus>
You can run just shell scripts too.
<shevy>
cd /tmp/foo-1.0
<bobrossasaurus>
system("cd ~/") works
koshii has quit [Read error: Connection reset by peer]
<hoelzro>
isn't there a shell gem or something that does that?
emergion has joined #ruby
<bobrossasaurus>
Maybe, there's almost a gem for everything. But I wouldn't see why you'd need one given that you can just pipe all your shell commands through Ruby's system() call or use backticks in your scripts
<bobrossasaurus>
Example: `cat ~/somefile.txt`
<canton7>
bobrossasaurus, that doesn't change the wd of the script, though
<bobrossasaurus>
canton7: True, you'd have to use Dir.chdir() for that I believe
rakl has joined #ruby
<shevy>
bobrossasaurus hmm, ruby code is easier to read when it becomes very complex in my opinion
<canton7>
bobrossasaurus, yup
<canton7>
shevy, what did you do to make your `cd '/tmp/foo-1.0'` work in a ruby script? What am I missing?
<shevy>
well, cd 'bla' is valid ruby code
<shevy>
where cd() would be a method
<canton7>
aah, you define 'cd'
<canton7>
gotcha
<shevy>
so that is quite short
<shevy>
bash, in this example, can be even shorter though
<shevy>
cd bla
<canton7>
I was wondering what you were requiring...
<atmosx>
shevy: chitin
koshii has joined #ruby
<atmosx>
although chitin is somewhat the opposite of what hyou described, it's ruby in bash/zsh (shell)
<shevy>
huh?
<shevy>
you could do:
<atmosx>
you can use ruby to handle files, which can turn pretty handy
<shevy>
cd bla/ble
<shevy>
with this?
<thibauts>
canton7: now running on 1.9, that's even better. Thanks again for your help (and the others too ...)
<canton7>
thibauts, cool! yeah no worries
vlad_starkov has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
Iszak has joined #ruby
<thibauts>
now i want to learn more ruby, hehe. could you give me some pointers to cool things to learn about the language / ecosystem ?
<shevy>
well
<shevy>
not sure about the ecosystem
<atmosx>
our ecosystem
<shevy>
thibauts, it may be very boring BUT I recommend you to read through the _names_ of the methods in the classes first
<thibauts>
shevy: i see, used to dir() in python, good idea
<canton7>
yeah, the standard library for ruby is amazing. and large. It's generally worth having the relevant page from ruby-doc open when writing stuff, and always check to see whether the method you're about to write exists already
benlieb has joined #ruby
<bobrossasaurus>
I remember being blown away by some of the stuff Ruby does for you for free. For example, subtracting two arrays from each other to find the difference: [0,1,2,3] - [1,2,3] returns [0]
thams has quit [Read error: Connection reset by peer]
thams has joined #ruby
g_bleezy has joined #ruby
<thibauts>
i was looking into Array, just saw it, the stdlib seems easily on par with python
Slivka has joined #ruby
<canton7>
way better imo
<canton7>
python does have a set of idioms for doing common operations ("there's one obvious way to do it"), so to do a given operation to this data structure you use these lines of code. Ruby has a function to do it
<canton7>
imo way cleaner and easier to learn / referene / interpret / etc
<thibauts>
you may well be right
<canton7>
*reference
<canton7>
also python loves its global methods. urgh
<thibauts>
years passing, i tend to favor language constructs that make usual operations *very* concise, i'm bored dealing with usual logic
jslowe has joined #ruby
<thibauts>
yeah there are may things not quite right in python, but the libs are very good
<thibauts>
how do you manipulate lists in ruby ?
xcvd`` has joined #ruby
<canton7>
what do you want to do to them?
<canton7>
(and they're arrays in ruby)
g_bleezy has quit [Ping timeout: 245 seconds]
<thibauts>
[a.get('foo') for a in as if a] for exemple
icole has quit [Remote host closed the connection]
shemerey has quit [Quit: Leaving...]
Iszak has quit []
<thibauts>
i really love this in python, make operations on large lists with one liners
<canton7>
as.compact.map{ |a| a.get('foo') }
jslowe has quit [Ping timeout: 246 seconds]
<canton7>
it's more readable in ruby ;)
<banister_>
thibauts: "a.get('foo') for a in as if a" is not even grammatical
<banister_>
i mean it doesn't make sense in english
<canton7>
(if the test was more complex, I'd use #select instead of #compact)
<canton7>
banister_, s/as/myarray, and it's *sort of* readonable
<canton7>
(readable
<thibauts>
i think it may be even more readable with combinators, i read something about this not long ago, like a method to run a getter on elements of an array
tar_ has quit [Quit: farewell]
kokainepizza has quit [Quit: My pooter is sleep.]
<thibauts>
banister_: yes you're right ..
<bobrossasaurus>
I just discovered a new method the other day: partition. You pass it a conditional in a block and it'll partition the array into two sections, one being where the condition returned true, the other false.