<xybre>
I've worked with Rails for 7 years and I just feel it steers people the wrong way and encourages bad habits.
<xybre>
Especially noobs.
<epochwolf>
xybre: noobs will always noob.
poga has quit [Remote host closed the connection]
<xybre>
epochwolf: of course. But Rails gives them the rope with which to hang themselves.
<epochwolf>
if you give them a box cutter instead of safety scissors, they'll do stupid things.
<rien>
xybre: I agree, but I'd be interested to know from you which bad habits you think it encourages.
mklappstuhl has quit [Ping timeout: 276 seconds]
<epochwolf>
xybre: counter point: let'em hang
efrainolivares has quit [Read error: Connection reset by peer]
<xybre>
If you've been doing it a while and understand object oriented programming and you work on a team that understands Ruby, you can work around it, but Rails will not make it easy.
efrainolivares has joined #ruby
<xybre>
epochwolf: Yeah, that'd be great, but they're hanging the whole team, including myself.
Dwarf_ has joined #ruby
<epochwolf>
xybre: you're saying there's a mismatch between rails and good practices?
<rien>
xybre: wow you seem to be in a similar situation to mine
<epochwolf>
in general
<xybre>
Yes
predator117 has quit [Ping timeout: 264 seconds]
<epochwolf>
I'd tend to agree.
sambao21 has joined #ruby
<epochwolf>
forms -> AR is not a good idea.
<rien>
why?
<xybre>
ActiveRecord is really neat and quick for prototyping, but for the real world it encourages you to put everything in your model. People will honestly have no idea where to put code if it can't go in the model.
<epochwolf>
rien: the data you need to collect on a particular form won't match the database representation in most apps.
<xybre>
The USER model. The USER. Thoe horror. The cyclopean horror.
<epochwolf>
The model shouldn't need to compensate for that.
<xybre>
Every system the User becomes a god object.
<rien>
xybre: That is one of the most important reasons I want to switch away from Rails (models encourage incorrect modeling of the business domain)
<epochwolf>
^^^^^^^^^^^^^^^^^^^^^
<epochwolf>
It would be nice if rails could have a better way to seperate that stuff out.
<rien>
I always hear that but I don't have the USer-god problem
baroquebobcat has quit [Quit: baroquebobcat]
ehc has quit [Quit: ehc]
<xybre>
ActiveRecord::Base objects are not "models". They are allll kinds of things, but not actual models. If you use them like repositories (as per Object ORiented Rails) things get much better.
<epochwolf>
rien: I've worked on several enterprise apps, it's a problem.
fgo has joined #ruby
* xybre
nods
<rien>
epochwolf: maybe I'm misidentifying. what's a clue that I have a god object?
lucazi_ has quit [Ping timeout: 276 seconds]
<heftig>
it contains 50% of your code
<rien>
oh....
<rien>
that's Fulfillment for me
<epochwolf>
rien: models become messes containing view <-> database mapping, business logics, and querying.
<rien>
yep, Fulfillment then :)
narcan has joined #ruby
<epochwolf>
rien: models should never contain business logic beyond basic database validation.
RichardBaker has quit [Quit: RichardBaker]
<entelechios>
Hello all
<epochwolf>
unfortunaetly rails doesn't have a good way to split taht up
<entelechios>
If anyone has any tips as to what might be something close to finding a solution that'd be highly regarded :)
dankest has joined #ruby
<rien>
epochwolf: that's my hang up with it. Rails does not encourage proper modeling, division of concerns, etc. it thinks tables have a 1-to-1 relationship with models. ugh.
efrainolivares has quit [Quit: efrainolivares]
<rien>
luckily I didn't let it taint the word "model" in my team.
<rien>
we design the proper domain models around rails
<heftig>
well, activerecord classes map tables
<heftig>
but those need not be your only model classes
_bart has quit [Remote host closed the connection]
ehc has joined #ruby
<rien>
xybre: any tips for when I migrate (rewrite in) to sinatra? things you miss the most, or new ways to think about things? (I've never been deep into Rails so not much unlearning to be done I guess)
fenicks has quit [Remote host closed the connection]
yfeldblum has joined #ruby
lucazi has joined #ruby
<rien>
heftig: it's like epochwolf said, people don't know where to put their stuff so they shove it into the models for the tables
<rien>
it doesn't provide the right encouragement and it misconstrues what a model is.
<rien>
xybre: another reason I'm moving away is all the implicit magic Rails is so fond of, that gives me so much pain when troubleshooting, as Rails loves to throw exceptions left and right and often its exceptions mask the real exception that I'm interested in
emanu has quit [Quit: emanu]
renderful has joined #ruby
<rien>
so I might use DataMapper instead of AR when I switch.
sanitypassing has quit [Quit: WeeChat 0.4.1]
<rien>
as it's less magical
ehc has quit [Client Quit]
<rien>
epochwolf: the app I work on is not customer facing, so that's probably why User isn't a god object here
<xybre>
rien: there's no router helpers in Sinatra, but then again its also trivial to figure out whats going on because the Sinatra DSL lets you define them inline. There's no hard "controller" object, but you can make them if you want.
shiroginne has joined #ruby
<rien>
xybre: I've always thought Rails handling of routing so opaque. I really like Sinatra's approach in that regard.
<xybre>
rien: You'll need an ORM of some sort, if you can lend a hand with development I recommend Ruby Object Mapper, and if not, take a look at Sequel (I assume you're using SQL).
<rien>
ruby object mapper, never heard of it, googling it now
Kricir has quit [Remote host closed the connection]
<xybre>
rien: it's being built by the Datamapper guys, completely rewritten and modular
tabolario has joined #ruby
<rien>
rom-rb.org ?
<rien>
oh wow interesting... why are the datamapper guys doing this? (what's the motive)
tommyvyo has quit [Quit:]
dEPy has quit [Remote host closed the connection]
Sporer has joined #ruby
<xybre>
It's a pure agnostic library. One of the devs mentioned they ran into a guy at a meetup who was using the Axiom lookup language they developed (sorta like Arel) to query data he loaded from files he parsed (no DB, jsut querying raw ruby objects).
x1337807x has joined #ruby
Fractional has quit [Ping timeout: 256 seconds]
<epochwolf>
I like the way rail's routes work
<epochwolf>
It's very nice to be able to seperate the names from the urls.
<xybre>
rien: They wanted to release a new version of Datamapper but they took it back to the drawing board, and realized they could make each component stand alone, it resulted in a completely new set of gems that they've been working on for the last 3 years.
ccolorado has joined #ruby
ccolorado has left #ruby [#ruby]
<xybre>
epochwolf: There's no relationship between URL and object name in Sinatra.
<rien>
epochwolf: I say it's opaque because I don't like the stuff like new/member/collection... I'd rather see the url in the open
<rien>
cognitive load is then lower
wmoxam has joined #ruby
gstamp has quit [Quit: Computer has gone to sleep.]
renderful has quit [Remote host closed the connection]
renderful has joined #ruby
zeade has quit [Quit: Leaving.]
<rien>
xybre: I wonder why they decided to have explicit schema in ROM. Datamapper doesn't (afaik) and it's very nice also because of that
kaspergrubbe has joined #ruby
<rien>
xybre: the very first example in rom-rb.org already shows code duplication :/
mansi has joined #ruby
Dwarf has quit [Excess Flood]
Dwarf_ is now known as Dwarf
bricker is now known as bricker-away
Dwarf_ has joined #ruby
Dwarf_ has quit [Max SendQ exceeded]
lucazi has quit [Remote host closed the connection]
Dwarf_ has joined #ruby
Dwarf_ has quit [Max SendQ exceeded]
gazarsgo has quit [Quit: gazarsgo]
hogeo has joined #ruby
centr0 has quit [Quit: centr0]
Dwarf_ has joined #ruby
gstamp has joined #ruby
pyrac has quit [Quit: pyrac]
smathieu_ has quit [Remote host closed the connection]
jjbohn has joined #ruby
dayepa has quit [Quit: dayepa]
renderful has quit [Read error: Operation timed out]
dayepa has joined #ruby
<xybre>
rien: Datamapper has the schema defined in every object, similar to how Mongoid does it.
etman has joined #ruby
kaspergrubbe has quit [Ping timeout: 245 seconds]
<rien>
xybre: right, just once.
<epochwolf>
xybre: I would miss migrations.
iliketurtles has quit [Quit: zzzzz…..]
krainboltgreene has joined #ruby
<rien>
epochwolf: why? I never understood the point.
Kruppe has joined #ruby
<epochwolf>
rien: migrations make life a lot easier.
<xybre>
epochwolf: I'd miss migrations if any company I'd worked for kept them up to date
<rien>
I feel your answer will finally make me understand it
<rien>
what palpable advantage do they provide?
<epochwolf>
xybre: the apps I used always used migrations to upgrade the schema
<xybre>
Our mgirations here won't even run, you have to load the schema.
<rien>
maybe I'm takingsomething for granted as I do use migrations now and I keep them up to date
rbento has quit [Quit: ZZZzzz…]
<xybre>
rien: thats not actually duplication you're seeing, they're demonstrating how mapping works
<epochwolf>
xybre: oh, the migrations never ran from beginning to end. We just used them to migrate from development to production.
poga has joined #ruby
<rien>
epochwolf: how do they make life easier? I could never understand the triplication of data between migrations, schema.rb and AR
<epochwolf>
rien: schema.rb isn't duplicated.
<epochwolf>
it's a cache
<rien>
xybre: ah, ok. I'll look deeper in the docs.
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<epochwolf>
schema.rb is generated form the database.
<xybre>
epochwolf: yeah, but you can always do what migrations do .. Datamapper does it implicitly, for instance.
<epochwolf>
xybre: that only works if you add columns.
<epochwolf>
if you do anything more than that, you need manual scripts.
smathieu has joined #ruby
<rien>
epochwolf: schema.rb I can understand, but what about the migrations themselves?
m8 has quit [Quit: Sto andando via]
<xybre>
Migrations are just helpers.
<epochwolf>
rien: they are scripts to change the schema.
rickruby has joined #ruby
<epochwolf>
rien: migrations are 100% detached from AR.
<rien>
I didn't know they were detached, interesting.
<rien>
oh, all migrations are are scripts to change schema.rb ?
<epochwolf>
no.,
<epochwolf>
They edit the database directly.
x1337807x has joined #ruby
<epochwolf>
Schema.rb is generated from the database.
<rien>
why is schema.rb not enough, though?
<epochwolf>
schema.rb is used to built the database for tests.
twoism has joined #ruby
<epochwolf>
rien: schema.rb is a cache for the tests. AFAIK, it's never used outside of tests.
<rien>
ok I get schema.rb, I don't have a problem with it as it's generated automatically anyway :)
<epochwolf>
rien: schema.rb is a cache file.
<rien>
But I don't see the advantage of writing migrations, nor do I see the point, and I'm honestly trying to understand because clearly I'm missing something if you think they're helpful
etman has quit [Quit: etman]
<rien>
and I already respect your opinions from your previosu messages :)
<epochwolf>
rien: migrations are sql scripts in a different format. That's all.
pipework has joined #ruby
twoism has quit [Remote host closed the connection]
<epochwolf>
rien: it's a formalized way to make database changes. That's actually really important.
<epochwolf>
Otherwise you need to find another solution for making database schema changes.
jjbohn has quit [Quit: Leaving...]
twoism has joined #ruby
etman has joined #ruby
<epochwolf>
Given the idiots I've worked with, rails migrations save hundreds of hours of trouble shooting per year.
<epochwolf>
if not thousnads.
bklane has joined #ruby
<rien>
epochwolf: if a given team documents their changes to the database in a file changes-db.txt and commits that file to source control diligently, would it be the same advantage?
fyz1x has joined #ruby
echevemaster has joined #ruby
<epochwolf>
rien: not quite.
<epochwolf>
rien: you'd need to save a script that makes the db changes.
<epochwolf>
both up and down for every change.
<epochwolf>
and a way to record which migrations have been applied.
rickruby has quit [Ping timeout: 276 seconds]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<rien>
epochwolf: we never write the down ones... why are they useful?
<epochwolf>
rien: if you need to roll back.
<rien>
well we test stuff before deploying
<epochwolf>
rien: that works in theory
<epochwolf>
in practice, something can go really wrong.
jjbohn has joined #ruby
<epochwolf>
If you can rollback with one command, you can get services back up quickly.
<epochwolf>
okay, I need to go eat dinner.
<epochwolf>
rien: rails provides a ton of things you don't realize you need until everything goes to shit.
<rien>
epochwolf: thanks for taking the time to explain
randomautomator has quit [Ping timeout: 245 seconds]
<rien>
epochwolf: I'll hit some SO articles to get a better picture of it
Diranged has joined #ruby
Deele has quit [Ping timeout: 240 seconds]
<epochwolf>
rien: read the rails guides instead
hogeo has quit [Remote host closed the connection]
<rien>
epochwolf: yes that's exactly why I was asking. I need to know what I'll miss if I switch from Sinatra
<Diranged>
In ruby, can i configure my object class so that its never instantiated more than once?
<Diranged>
similar to a singleton type object in python?
<rien>
like I said, I am probably taking for granted the advantages of migrations because I do use them
hogeo has joined #ruby
<epochwolf>
rien: I did a php app the other weekend
<rien>
epochwolf: well I'm more looking for a synthesized explanation of why migrations save your bacon
<rien>
some SO articles sometimes hitthat spot nicely
zastern has quit [Remote host closed the connection]
buzzybron has joined #ruby
rgbdev has joined #ruby
<epochwolf>
rien: rails has built in crypot available, php requires me to compile extra modules.
hamakn has joined #ruby
<epochwolf>
openssl_random_pseudo_bytes isn't in stock php
<rien>
epochwolf: I understand your point, but I prefer to have control over that instead of delegating it to any framework. I, however, am biased towards configuration over convention.
hamakn has quit [Read error: Connection reset by peer]
<epochwolf>
my server's packaged version has it.
hamakn has joined #ruby
<epochwolf>
rien: I used to be until I did some php, some lua, and some sinatra and realized everything rails provides for free.
havenwood has quit [Remote host closed the connection]
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<epochwolf>
rien: rails is pretty damn secure by default. Everything else requires constant awareness of security issues.
Spooner has quit [Remote host closed the connection]
Kricir has joined #ruby
<rien>
epochwolf: I should first qualify my project is not customer facing, so security is not a priority, but point well taken
<epochwolf>
okay, I need foodz
<rien>
I'll keep that in mind, definitely
<epochwolf>
rien: I don't ever design without security.
<rien>
epochwolf: nice chatting, bon appetit!
tkuchiki has joined #ruby
<rien>
they don't pay me enough to be concerned about security, hah
<rien>
or rather, they themselves don't care about it.
<epochwolf>
rien: I'm a professional. Not some hack.
<rien>
me too. all my time is taken by delivering stuff that works.
<epochwolf>
If I can avoid it, I don't work for a company that doesn't care.
hamakn has quit [Remote host closed the connection]
<epochwolf>
rien: yeah, I know the feeling.
<epochwolf>
still, security is automatic for me.
hamakn has joined #ruby
kreeves has joined #ruby
wesside has quit [Quit: I think I heard an ice cream truck..]
<epochwolf>
When I take shortcuts, I quanfity them and design them carefully.
cougarten has joined #ruby
buzzybron1 has joined #ruby
<epochwolf>
It's just not in my nature to bang out code without thinking. I got out of that 4 years ago.
Cyrus has joined #ruby
<rien>
epochwolf: I think I need to pick up a book on how to design with security in mind, then.
<epochwolf>
rien: eh… I learned it over time.
<rien>
epochwolf: I never bang out code either. my coworkers and I go to the whiteboard to model stuff first
buzzybron has quit [Ping timeout: 268 seconds]
fgo has quit [Remote host closed the connection]
<epochwolf>
rien: there's just a few small things to remember.
<rien>
epochwolf: I'm a book rat, I only learn over time stuff there's no books for :)
<epochwolf>
rien: a book on web security would be too broad.
cowgarden has quit [Read error: Operation timed out]
tkuchiki has quit [Remote host closed the connection]
buzzybron1 has quit [Client Quit]
<rien>
I believe I might have come across a thin tome on "security for developers"
<epochwolf>
you just need basic web app security and basic server security
<rien>
can't remember the name now of course
<epochwolf>
k
* epochwolf
tries to leave again
tkuchiki has joined #ruby
<rien>
epochwolf: I know for instance not to use md5 and other easy hash algos for passwords
redmenace has quit [Ping timeout: 256 seconds]
<epochwolf>
rien: one of several things.
<rien>
epochwolf: we can talk more later :)
c0rn has quit [Ping timeout: 264 seconds]
<epochwolf>
no, I don' thave time.
snovak has joined #ruby
<epochwolf>
I need to be taking care of moving to my new job.
<rien>
oh wow, congrat
<rien>
s
<rien>
you should go then. thanks for the nice convo.
hamakn has quit [Ping timeout: 256 seconds]
<epochwolf>
I'm really stressed right now and it's not going to get better if I can't do some writing.
<epochwolf>
okay, out
<rien>
see ya!
cowgarden has joined #ruby
brbcoding has quit [Ping timeout: 264 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
snovak has quit [Ping timeout: 264 seconds]
cougarten has quit [Ping timeout: 264 seconds]
terrellt has quit [Ping timeout: 264 seconds]
chuk has quit [Ping timeout: 264 seconds]
guilleiguaran_ has quit [Ping timeout: 264 seconds]
Guest85414__ has quit [Ping timeout: 264 seconds]
aryaching has joined #ruby
ilyam has quit [Quit: ilyam]
aaroncm has quit [Quit: No Ping reply in 180 seconds.]
aaroncm_ has joined #ruby
cowgarden has quit [Ping timeout: 245 seconds]
marcgg_ has quit [Read error: Connection reset by peer]
Astralum has quit [Read error: Connection reset by peer]
marcgg has joined #ruby
Astralum has joined #ruby
buzzybron has joined #ruby
pen has quit [Remote host closed the connection]
Vivekananda has quit [Ping timeout: 245 seconds]
justsee has quit [Ping timeout: 276 seconds]
ner0x has quit [Quit: Leaving]
Rezwan has quit [Ping timeout: 246 seconds]
wmoxam has quit [Ping timeout: 264 seconds]
moses_m has quit [Ping timeout: 268 seconds]
Es0teric has joined #ruby
cantonic_ has joined #ruby
St_Marx has quit [Remote host closed the connection]
butblack has joined #ruby
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
St_Marx has joined #ruby
jjbohn has quit [Quit: Leaving...]
sevenseacat has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dagnachew has joined #ruby
wesside has joined #ruby
bklane has quit [Remote host closed the connection]
brennanMKE has joined #ruby
Targen has quit [Read error: Connection reset by peer]
<Kol>
not too happy with the thought, but it'sseems to be the only way to exactly replicate that behavior
<Kol>
which is kinda ridiculous imo
stuartrexking has joined #ruby
<rien>
Kol: DateTime.valid_date?
braincra- has joined #ruby
braincrash has quit [Read error: Operation timed out]
endash has quit [Quit: endash]
<rien>
no, not that either, sorry
marcdel has quit [Ping timeout: 256 seconds]
tommyvyo has joined #ruby
mando has joined #ruby
renderful has joined #ruby
ziggles has joined #ruby
<rien>
every solution in that page is misguided
ner0x has joined #ruby
marcdel has joined #ruby
JZTech101 is now known as JZ|Zzz
<ziggles>
I'm currently writing a gem that scrapes a data source for different kinds of data. Right now it's a bunch of scrapers and im realizing that a good solution would be to have "models" that basically provide consumers with normalized data... and then "scrapers" that do the dirty work of getting data off pages... Any suggestions for existing gems or patterns i should consider before diving in?
madumo has quit [Quit: madumo]
tjad has joined #ruby
gazarsgo has joined #ruby
<ziggles>
Right now i was simply going to use PORO and go to town but figured i'd ask before.
renderful has quit [Ping timeout: 245 seconds]
<sevenseacat>
ive done something similar - have an object that represents the scraped page, and another object that builds data records based off that page
<ziggles>
sevenseacat: yeah pretty much. Like if you wanted to scrape twitter.. you might have a scraper for TweetScraper, UserScraper, SearchScraper etc...
<ziggles>
Then obviously some models like Tweet, User, Search etc.
<ziggles>
Maybe a client that u can do like TwitterClient.search("whatever") and it returns a bunch of Tweet objects
<ziggles>
sevenseacat: it seems really common so I was thinking maybe there's already an established way of doing similar things or a gem specifically for scraping in that fashion
tgunr has quit [Ping timeout: 264 seconds]
mando has quit [Remote host closed the connection]
twoism has quit [Remote host closed the connection]
<sevenseacat>
i dont know
twoism has joined #ruby
Godd2 has joined #ruby
Lewix has quit [Remote host closed the connection]
smathieu has quit [Remote host closed the connection]
twoism has quit [Ping timeout: 245 seconds]
butblack has quit [Quit: butblack]
Davey has joined #ruby
cantonic has quit [Quit: cantonic]
<rien>
ziggles: may I ask what is your tooling for scraping those pages?
<ziggles>
rien: you're asking about my tooling and you don't even buy my dinner?
BillCriswell has quit [Remote host closed the connection]
<ziggles>
lol
rbento has joined #ruby
<ziggles>
rien: I'm not sure exactly what you mean, but i'm just basically pulling page data out with nokogiri
<xybre>
It does say it right there resting. And yes, everything in Ruby is an object, even numbers, booleans, and strings.
zeade has joined #ruby
<xybre>
Godd2: that seems.. bad.
stuartrexking has joined #ruby
<xybre>
Especially on Windows.
<Godd2>
bad as in I shouldn't do that? or bad as in I shouldn't use Windows?
<resting>
sevenseacat: i tried po (the object that i inspected), po.dirname.downcase, irb reports there's no downcase method, that why i inspected it, but have no clue what type it is
tjad has quit [Ping timeout: 276 seconds]
rbento has quit [Quit: ┐('~`;)┌]
etman has joined #ruby
nari has joined #ruby
<resting>
sevenseacat: i'm learning ruby, so in these cases, we would usually convert them to strings with .to_s ? i'm just trying to know the underlyings so i avoid trial and errors
amacgregor_ has joined #ruby
<sevenseacat>
im confused.
<resting>
lol..hm..
saarinen has quit [Quit: saarinen]
<xybre>
Godd2: well, "t" mode is text mode, which could have really weird repucussions on a binary file. Give it a shot, but be careful.
amacgregor has quit [Ping timeout: 246 seconds]
<resting>
what i'm trying to say, how do i know what data type Pathname::dirname returns? i dont think its a string
<xybre>
resting: when you call .inspect a lot of objects will straight up TELL you what they are. "#<ThisIsWhatIAm:23423>"
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
Randomage has joined #ruby
<xybre>
resting: Or.. you could, you know jsut call po.class and it will give you the object's class.
ner0x has quit [Quit: Leaving]
<sevenseacat>
+1
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
Gooder has joined #ruby
<xybre>
And then you can sue the magic of http://apidock.com/ruby to search for the class (if its Core or Standard library) to find out more info.
<xybre>
s/sue/use
<resting>
xybre, sevenseacat thanks..while trying to explain i think i can call the notation of "#<ThisIsWhatIAm:23423>" as an object?
<resting>
well..everything in ruby is an object..but to do downcase, i need to convert that Pathname object to a string object?
vlad_starkov has joined #ruby
<xybre>
resting: its just a description of an object
<resting>
xybre: thanks..that clears things up for a noobie..lol..
bklane_ has quit [Remote host closed the connection]
<xybre>
resting: If you want to downcase a Pathname, you have to convert it to a string with .to_s
AndChat| has joined #ruby
nari has quit [Read error: Connection reset by peer]
<Godd2>
xybre: alright, I'll keep that in mind. thanks for your help
<xybre>
resting: .inspect sends a messageto the object saying "tell me about yourself" and the string you get back is the object's way of describing what it is. But if you just want the string representation of it (not always the same thing) you can call .to_s on it.
<xybre>
Godd2: np :)
<resting>
xybre: sure :)
Banistergalaxy has quit [Ping timeout: 245 seconds]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x1337807x has joined #ruby
browndawg has joined #ruby
Kricir has joined #ruby
sonne has quit [Ping timeout: 256 seconds]
tommyvyo has quit [Quit:]
intuxicated has joined #ruby
macmartine has joined #ruby
kevinykchan has joined #ruby
robscomputer has joined #ruby
txdv has quit [Read error: Operation timed out]
Kricir has quit [Ping timeout: 276 seconds]
nmabry has joined #ruby
julweber has joined #ruby
zeade has quit [Read error: Connection timed out]
siera08 has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
stevenrockarts has joined #ruby
alpha123 has quit [Quit: sleeps]
robscomputer has quit [Remote host closed the connection]
gazarsgo has quit [Quit: gazarsgo]
diegoviola has joined #ruby
robscomputer has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
Spami has quit [Quit: This computer has gone to sleep]
julweber has quit [Ping timeout: 245 seconds]
apeiros has joined #ruby
tommyvyo has joined #ruby
tonini has joined #ruby
amacgregor_ has joined #ruby
apeiros has quit [Remote host closed the connection]
amacgregor has quit [Ping timeout: 246 seconds]
staafl has joined #ruby
apeiros has joined #ruby
pumper has quit [Ping timeout: 264 seconds]
Guest73293 has joined #ruby
Guest73293 has quit [Quit: Leaving]
io_syl has joined #ruby
l34ch has joined #ruby
<l34ch>
hey guys
yacks has quit [Ping timeout: 256 seconds]
Badreddin has joined #ruby
Zolo has quit [Remote host closed the connection]
Kol has quit [Ping timeout: 245 seconds]
ananthakumaran has quit [Quit: Leaving.]
<Godd2>
mornin
apeiros has quit [Remote host closed the connection]
orion has left #ruby [#ruby]
Diranged has joined #ruby
tomzx_mac has quit [Ping timeout: 264 seconds]
thebastl has joined #ruby
Kol has joined #ruby
sonne has joined #ruby
l34ch has quit [Ping timeout: 245 seconds]
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
marcdel has joined #ruby
julweber has joined #ruby
raul782_ has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
Evixion has joined #ruby
tagrudev has joined #ruby
julweber has quit [Remote host closed the connection]
yacks has joined #ruby
enroxorz has joined #ruby
rickmasta has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
ArchBeOS has quit [Ping timeout: 268 seconds]
enroxorz is now known as ArchBeOS
workmad3 has joined #ruby
ArchBeOS has quit [Read error: Connection reset by peer]
ArchBeOS has joined #ruby
parzo has joined #ruby
tommyvyo has quit [Quit:]
zeade has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.1]
sarkis has quit [Ping timeout: 245 seconds]
amacgregor_ has quit [Read error: Connection reset by peer]
amacgregor has joined #ruby
goleldar has quit [Ping timeout: 264 seconds]
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
butblack has left #ruby [#ruby]
macmartine has quit [Quit: Computer has gone to sleep.]
apeiros has joined #ruby
snovak has joined #ruby
ccolorado has joined #ruby
marcdel has joined #ruby
maasdesigner1 has joined #ruby
ananthakumaran has joined #ruby
maasdesigner1 is now known as maasdesigner
JDHankle has quit [Remote host closed the connection]
rezzack has joined #ruby
rurufufuss has joined #ruby
<ccolorado>
Hi, i want to "consume" the trailing words from a string if they are within a list of words. The string is a movie record which contains the name followed by a set of keywords that specify if the movie is on 3D, imax and so on.
snovak has quit [Ping timeout: 246 seconds]
Levin_22 has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
<ccolorado>
I can't think of a mechanism to substract in reverse that doesn't involve splitting the string by each word
apeiros has quit [Ping timeout: 264 seconds]
tjbiddle_ has quit [Quit: tjbiddle_]
St_Marx has quit [Quit: Leaving]
sayan has quit [Ping timeout: 276 seconds]
<rien>
ccolorado: can you provide example data and what they'd look like after the transformation you're proposing?
zeade1 has joined #ruby
zeade has quit [Ping timeout: 246 seconds]
_honning_ has joined #ruby
tommyvyo has joined #ruby
wudofyr has quit [Remote host closed the connection]
<sevenseacat>
looks like you just want the first word then?
blaxter_ has joined #ruby
noop has joined #ruby
<ccolorado>
sevenseacat: it certantly looks like that, perhaps not the best example, "Wolvering the inmortal Dig 3D Dolby" , this would idealy return result { :title => "Wolvering the inmortal", :specs => [3D, Dolby] }
<sevenseacat>
so where did Dig go and why?
tonini has quit [Ping timeout: 264 seconds]
<ccolorado>
sevenseacat: typo
<ccolorado>
First I thougth you where looking for user 'Dig'
<sevenseacat>
well that helps
jds has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
tonini has joined #ruby
zeade1 has quit [Quit: Leaving.]
<ccolorado>
it should have been result = { :title => "Wolvering the inmortal", :specs => [Dig, 3D, Dolby] } #order of result["specs"] doesn't really matter
JZ|Zzz has quit [Ping timeout: 264 seconds]
horofox has quit [Ping timeout: 245 seconds]
jarray52 has left #ruby [#ruby]
noop is now known as noopq
<sevenseacat>
but Dig isnt in your list of stopword-type things
Kelet has quit [Quit: Leaving]
tommyvyo has quit [Quit:]
ntus1017 has quit [Remote host closed the connection]
JZ|Zzz has joined #ruby
JZ|Zzz is now known as JZTech101
jds has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
apeiros has quit [Ping timeout: 246 seconds]
Gooder has quit [Remote host closed the connection]
<rien>
ccolorado: is Dig always the word that divids the title from the tags?
<rien>
sevenseacat: what's the bot sigil here?
ebanoid has joined #ruby
<sevenseacat>
bot sigil?
amacgregor has quit [Read error: Connection reset by peer]
<rien>
> 1 + 1
amacgregor_ has joined #ruby
<rien>
! 1 + 1
<rien>
the symbol we type for the bot to run some code... that should be in the /topic
<ccolorado>
sevenseacat: that was probably my fault
<rien>
ccolorado: ok you want this: "Wolverine is immortal Dig 3D Dolby".split.split_at_index("Dig"){|title,specs| # do something with title and spec)
<rien>
ccolorado: all you need to do now is code split_at_index... just find the first index for the parameter given, then pass those two arrays to a yield block
tonni has joined #ruby
cj3kim has joined #ruby
<rien>
"those two arrays" being the two arrays you'll get when you do yield array[0..index-1], array[index..-1]
<ccolorado>
rien: The keword list in the record do not allways start with Dig
julweber has joined #ruby
<rien>
then do .... split_at_index(/(Dig|Dag|Dog)/){|title,specs| .... same deal
<rien>
this top down approach will take you far. now you know which method you need to code, and how it needs to behave
JZTech101 has quit [Ping timeout: 246 seconds]
persand has joined #ruby
Senjai has quit [Ping timeout: 268 seconds]
rickmasta has joined #ruby
<ccolorado>
rien: I see now, thanks so much rien & sevenseacat
aryaching has joined #ruby
tonini_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
<rien>
ccolorado: :)
Lewix has quit [Remote host closed the connection]
<tobiasvl>
iIlL10Oo: why did you think they would have the same class? what were you trying to do?
ferdev has quit [Ping timeout: 268 seconds]
dwype has joined #ruby
ferdev_ is now known as ferdev
dwype has quit [Max SendQ exceeded]
graydot has joined #ruby
troessner has joined #ruby
dwype has joined #ruby
dwype has quit [Max SendQ exceeded]
dsaravel has joined #ruby
jefflyne has quit [Ping timeout: 268 seconds]
love_color_text has quit [Read error: Connection reset by peer]
mbuf has joined #ruby
e3r98gh35t has quit [Remote host closed the connection]
e3r98gh35t has joined #ruby
<mbuf>
is there an example on how to use begin..rescue..end for system commands executed within backquote? or is there any other recommended option?
dwype has joined #ruby
e3r98gh35t has quit [Remote host closed the connection]
dwype has quit [Max SendQ exceeded]
e3r98gh35t has joined #ruby
dwype has joined #ruby
dwype has quit [Max SendQ exceeded]
<iIlL10Oo>
tobiasvl: I just thinking , not realy doing something
jefflyne has joined #ruby
zeropx has joined #ruby
nomenkun has joined #ruby
<tobiasvl>
ok
dwype has joined #ruby
browndawg has quit [Ping timeout: 246 seconds]
klaut has joined #ruby
dwype has quit [Max SendQ exceeded]
dwype has joined #ruby
dwype has quit [Max SendQ exceeded]
ezotrank has joined #ruby
jonkri has joined #ruby
jonkri has quit [Changing host]
jonkri has joined #ruby
iIlL10Oo has left #ruby [#ruby]
maasdesigner has quit [Read error: Connection reset by peer]
dwype has joined #ruby
maasdesigner has joined #ruby
dwype has quit [Max SendQ exceeded]
dwype has joined #ruby
e3r98gh35t has quit [Read error: Connection reset by peer]
dwype has quit [Max SendQ exceeded]
dwype has joined #ruby
troessner has quit [Ping timeout: 245 seconds]
dwype has quit [Max SendQ exceeded]
dwype has joined #ruby
ezotrank has quit [Client Quit]
dwype has quit [Max SendQ exceeded]
hamakn_ has quit [Remote host closed the connection]
troessner has joined #ruby
dwype has joined #ruby
dwype has quit [Max SendQ exceeded]
hamakn has joined #ruby
snovak has joined #ruby
dwype has joined #ruby
Inside has joined #ruby
anay has joined #ruby
e3r98gh35t has joined #ruby
e3r98gh35t has quit [Read error: Connection reset by peer]
browndawg has joined #ruby
julweber has joined #ruby
anay has quit [Remote host closed the connection]
hamakn has quit [Ping timeout: 246 seconds]
devoldmx has joined #ruby
troessner has quit [Ping timeout: 256 seconds]
snovak has quit [Ping timeout: 268 seconds]
apeiros has joined #ruby
mercwithamouth has quit [Quit: leaving]
troessner has joined #ruby
troessner has quit [Max SendQ exceeded]
mercwithamouth has joined #ruby
troessner has joined #ruby
julweber has quit [Ping timeout: 276 seconds]
julweber has joined #ruby
shiroginne has quit []
postmodern has joined #ruby
maasdesigner has quit [Read error: Connection reset by peer]
mneorr has quit [Remote host closed the connection]
maasdesigner has joined #ruby
renothing has joined #ruby
<bnagy>
mbuf: backtick commands won't raise
<bnagy>
ever, as far as I know
<eliasp>
does Mocha provide a way, to ignore any invokations of an .expect()-ed method besides the one matching the specified .with() params, e.g. Dir.expects(:exists?).with('/sys/class/net').returns(true)
<bnagy>
if you want the error status look at something in Open3 imo
<eliasp>
right now, it monitors all invokations of Dir.exists? even with completely different params than specified in .with()
<bnagy>
depending on your distro that might mean you just need OS build tools package, or it might mean you need a ruby-dev package, depending how you installed ruby
Alina-malina has quit [Read error: Connection reset by peer]
smathieu has joined #ruby
<Quest>
bnagy, nope. iam using linux
<Quest>
ubuntu
mbuf has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
Alina-malina has joined #ruby
<Quest>
bnagy, istalled it by package manager
<bnagy>
ok. Like I said, for some distros, which I think includes ubuntu, the 'normal' package doesn't install the ruby dev stuff, which is kinda lame
<Quest>
bnagy, going to install ruby-dev
e3r98gh35t has joined #ruby
<bnagy>
I would recommend installing it via chruby or something, fwiw, but try ruby-dev
e3r98gh35t has quit [Read error: Connection reset by peer]
julweber has quit [Ping timeout: 245 seconds]
<bnagy>
maybe ubuntu has a ruby-xxx-full package as well.. I forget
anay has joined #ruby
gstamp has quit [Quit: Computer has gone to sleep.]
jefflyne has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
e3r98gh35t has joined #ruby
mneorr has joined #ruby
<Quest>
k
smathieu has quit [Ping timeout: 276 seconds]
e3r98gh35t has quit [Read error: Connection reset by peer]
jds has quit [Ping timeout: 276 seconds]
bluOxigen has quit [Read error: Network is unreachable]
bluOxigen has joined #ruby
e3r98gh35t has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
mneorr has quit [Remote host closed the connection]
e3r98gh35t has quit [Read error: Connection reset by peer]
e3r98gh35t has joined #ruby
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
allsystemsarego has joined #ruby
<dagobah>
How can I get the previous object in an iteration, the opposite of next?
aryaching has joined #ruby
<bnagy>
you can't
<bnagy>
gone forever
e3r98gh35t has quit [Read error: Connection reset by peer]
jim0thy_ has quit [Quit: jim0thy_]
<bnagy>
you can use each_with_index, or you could use inject or something horrible
e3r98gh35t has joined #ruby
<Quest>
bnagy, its working but giving dependancy problem too.
Inside has quit [Read error: Connection reset by peer]
<Quest>
bnagy, do you know scss / sass ? error main.scss (Line 3: Undefined variable: "$h-shadow".)
<Quest>
for @nixin boxShadow($h-shadow:0px, $v-shadow:2px, $blur:2px, $spread:0px, $color:black, $inset:outset) {
vadelius has quit [Ping timeout: 268 seconds]
<bnagy>
nope, means nothin to me
<Quest>
nothing?
<Quest>
k
intuxicated has quit [Ping timeout: 245 seconds]
sjltaylor has joined #ruby
<dagobah>
bnagy: How can I use each with index? Just decrement the index?
<apeiros>
Quest: shouldn't that be @mixin ?
e3r98gh35t has quit [Read error: Connection reset by peer]
<buzzybron>
whats the difference between the PGconn & PG::Connection under Classes/Modules?
anay has quit [Read error: Connection reset by peer]
sqd has quit [Quit: sqd]
anay has joined #ruby
dodosan has quit [Remote host closed the connection]
BRMatt has joined #ruby
aryaching_ has joined #ruby
maasdesigner is now known as maasdesigner1
maasdesigner1 is now known as maasdesigner
maxmanders has quit [Quit: Computer has gone to sleep.]
eldariof has joined #ruby
anay_ has quit [Ping timeout: 264 seconds]
havenwood has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 256 seconds]
_bart has joined #ruby
mklappstuhl has joined #ruby
tkuchiki has quit [Remote host closed the connection]
vadelius has quit [Ping timeout: 268 seconds]
callmeivan has joined #ruby
browndawg1 has quit [Ping timeout: 256 seconds]
jim0thy_ has joined #ruby
<callmeivan>
does somebody know how i can save my regex command into a string so i can pass it to my function? it does not seem to work as soon as i save the regex into a variable and pass it to my function
<Quest>
how do I create a generic @mixin in sass for multiple values with comma , and i might now know how many values would each include of mixin would have? http://pastebin.com/nP4DBGFX
shaunbak_ has joined #ruby
vadelius has joined #ruby
<callmeivan>
ah, i did not realize / .... / could not be in the object
eka has joined #ruby
<tobiasvl>
the slashes are the regexp delimiters
<tobiasvl>
like the quotation marks are string delimiters
mansi has quit [Ping timeout: 264 seconds]
agjacome has quit [Ping timeout: 264 seconds]
cj3kim has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
khushildep has joined #ruby
jeekl has quit [Remote host closed the connection]
<callmeivan>
yes, thank you
jeekl has joined #ruby
apeiros has joined #ruby
codecop has quit [Read error: Operation timed out]
<shevy>
I want to check whether cmake is available from within a ruby script
<shevy>
is x = system 'cmake' an ok way to do so? x seems to be nil when the argument given could not be found
cj3kim has joined #ruby
IceyEC has joined #ruby
ferdev has quit [Quit: ferdev]
realDAB has quit [Quit: realDAB]
n00b2 has joined #ruby
jp- has quit [Quit: OK, I believe you… but my tommy gun don't]
cj3kim has quit [Ping timeout: 245 seconds]
jdenen has joined #ruby
snovak has joined #ruby
<n00b2>
please help. Why is 'while 1\n ret = myloop(arg) \n arg = ret' not working as I expected. I'm new to ruby, please forgive my perhaps stupid question
mbenson3 has joined #ruby
shaunbak_ has quit [Remote host closed the connection]
<tobiasvl>
n00b2: use ; instead of \n for readability
<tobiasvl>
why are you using an endless while loops?
<tobiasvl>
ruby doesn't use loops a lot
emergion has quit [Quit: Computer has gone to sleep.]
tanema has quit [Remote host closed the connection]
codecop has joined #ruby
nari has joined #ruby
<n00b2>
that's not the problem. but the problem is the loop keeps looping with the arg (=string) defined before the while loop
<tobiasvl>
please post the whole code in a gist (see topic)
persand has quit [Quit: persand]
eka has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
renothing has joined #ruby
postmodern has quit [Quit: Leaving]
<shevy>
n00b2 you don't show where arg is defined
<shevy>
btw if you want to use a loop like this, use loop { } rather than while 1, that is just ugly
<n00b2>
arg is defined before the while loop like so: arg = "a" -> then the myloop returns "ab" for example and I want the myloop("ab") in the second run
ntus1017 has joined #ruby
mlpinit has joined #ruby
fermion has joined #ruby
<tobiasvl>
n00b2: please post the whole code in a gist (see topic)
julweber has joined #ruby
<tobiasvl>
i don't want to have to piece together the code you're running from your implications
vince_prignano has quit [Remote host closed the connection]
<shevy>
n00b2 you need to show all code that is relevant to your problem, ideally as little as possible, in one pastie, including the error message there
<shevy>
also "not working as I expected" does not really describe much, what else did you expect, what error do you recieve etc...
jjbohn has quit [Quit: Leaving...]
Banistergalaxy has quit [Ping timeout: 246 seconds]
<n00b2>
striped down it comes down to this...
<n00b2>
def myloop(a); return a + "b"; end; arg="x";while 1;ret=myloop(arg);arg=ret;end
sjltaylor has joined #ruby
<shevy>
well the code works as expected
<shevy>
you are running the loop ;)
tanema has joined #ruby
nomenkun has quit [Remote host closed the connection]
_veer has joined #ruby
_veer has quit [Changing host]
_veer has joined #ruby
<shevy>
hmm is there an easy way to remove array entry 5 from an array?
<shevy>
array = %w( a b c d e f g h i j )
nomenkun has joined #ruby
tanema has quit [Remote host closed the connection]
<tobiasvl>
shevy: delete_at
<shevy>
ah cool, thanks
d45h has joined #ruby
freeayu has joined #ruby
<n00b2>
damn! sorry guys! my mistake was returning the wrong value! Thanks for your help anyway!! I was looking for the error in the wrong place :-(
browndawg has joined #ruby
dash_ has quit [Ping timeout: 264 seconds]
<tobiasvl>
n00b2: great!
eldariof has quit [Ping timeout: 264 seconds]
mark_locklear has joined #ruby
Tricon has joined #ruby
<tobiasvl>
shevy: remember that indices start at 0 ;)
mdaubs has joined #ruby
<shevy>
hmmm damn yeah
JDHankle has joined #ruby
n00b2 has left #ruby [#ruby]
<shevy>
I am trying to map pure "linux commands" to ruby commands
jefflyne has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<shevy>
so "ln foo bar" but also "ln -v foo bar"
<shevy>
or "cp" etc... so that these things can work on windows too when one has installed only ruby
emergion has joined #ruby
<shevy>
I did split at ' ' though, and then "ln -v foo bar" was different to "ln foo bar", leading to a small bug
jonahR has joined #ruby
JDHankle has quit [Ping timeout: 268 seconds]
Badreddin has quit [Ping timeout: 268 seconds]
jp- has joined #ruby
ferdev has joined #ruby
sevenseacat has joined #ruby
headius has joined #ruby
linux_noob_666 has joined #ruby
<jp->
shevy, i'd use the which command or check in $PATH with ruby.
mdaubs has quit [Remote host closed the connection]
<tobiasvl>
strings can't "contain" nil, variables can have nil as value
<jlebrech>
yeah but the string might be a nil object, want it to count as blank too
tomzx_mac has joined #ruby
moosya has quit [Quit: moosya]
<zets>
just check if the object is nil
eka has quit [Ping timeout: 264 seconds]
<jp->
puts "It's nil!" if foo.nil?
moosya has joined #ruby
<tobiasvl>
ok, what about the blank? if the string just contains a blank anywhere? if it's one character which is a blank? var == ' '
<banister>
jlebrech: str.to_s.empty?
momomomomo has joined #ruby
<tobiasvl>
why to_s ?
diegok has joined #ruby
<tobiasvl>
oh, for nil
<banister>
tobiasvl: so that it also checks for str == nil
codecop has quit [Remote host closed the connection]
kreeves has quit [Ping timeout: 268 seconds]
<tobiasvl>
ah, "blank" means empty string...
<tobiasvl>
thought it meant space
<tobiasvl>
or whitespace
eka has joined #ruby
<tobiasvl>
in that case banister's way is best
Fire-Dragon-DoL has quit [Quit: Leaving.]
JDHankle_ has quit [Remote host closed the connection]
weeb1e has quit [Quit: No Ping reply in 180 seconds.]
<_br_>
banister: Intersting article! Thanks for that. Psych papers have to be taken really skeptical these days... Need to ask my remote-prof about this :)
wu_lmao has quit [Quit: wu_lmao]
sergicles has joined #ruby
<banister>
_br_: it reminded me of what you were saying, they also indicate in that article that there is currently a re-evaluation going on a large number of psych studies (just as you said) :)
mklappst_ has quit [Remote host closed the connection]
<_br_>
banister: Yeah, that will be really interesting. I suspect they will come back and knock out maybe 30-50% of papers as faked data, false math etc. terrible. Certainly going to hurt the field, but bad science is bad science.
headius has quit [Ping timeout: 276 seconds]
DrShoggoth has quit [Read error: No route to host]
<Stelian1>
I take it #ruby don't love #rails that much? :)
<_br_>
Well, I don't really care. Its just yet another framework.
<Donovan>
I see a lot of people dive into rails without understanding ruby first. IMO.
<Stelian1>
Donovan: that makes 0 sense
<Donovan>
well, meaning they learn just enough ruby to code in rails.
huoxito has joined #ruby
Guest87977 has joined #ruby
<Donovan>
they don't really understand the nuances of ruby and what you can do with it.
* Donovan
shrugs
<Stelian1>
I find that to be retarded...
<Stelian1>
than again I come from a php background where people don't understand types
<Stelian1>
or computers
<_br_>
Anyone remember the days when Zed Shaw used to write alot of fun articles about the "Rails is a Ghetto" ? :)
jefflyne has joined #ruby
jefflyne has quit [Max SendQ exceeded]
<Donovan>
heh
<shevy>
I remember it was a good day for he switched to python
jefflyne has joined #ruby
tonni has joined #ruby
<_br_>
hehe
tagrudev has quit [Remote host closed the connection]
mansi has joined #ruby
<shevy>
Stelian1 the two communities partially overlap, but also partially do not overlap. If I would have to pull out a number, I would say that about 50% of the people here on #ruby do not use rails
<_br_>
well, he is quite a character. The mongrel2 codebase is quite interesting though.
Fire-Dragon-DoL has quit [Quit: Leaving.]
zoee has quit [Quit: zoee]
s2013 has quit [Ping timeout: 240 seconds]
acrussell has joined #ruby
d45h has quit [Ping timeout: 256 seconds]
<shevy>
rails indeed attracted a lot of people to ruby
asterite has joined #ruby
<Donovan>
it did me
<_br_>
tell me about it. Have a guy here working, who recently learned abit of rails and speaks of it as it having "god powers" --- wth.
<Donovan>
I was a perl/python programmer... dove into rails to see what the hubub was all about, that launched me into ruby. Never looked back.
<shevy>
hehe
troessner has quit [Ping timeout: 264 seconds]
<shevy>
god powers?
<shevy>
that almost sounds like a religion :)
dash_ has joined #ruby
<Donovan>
isn't it?
<Donovan>
=)
tonni has quit [Remote host closed the connection]
<_br_>
ahh rails as a religion. get off my lawn.. :]
freerobby has quit [Quit: Leaving.]
<Donovan>
heh
thebastl has joined #ruby
<shevy>
Donovan, why did you not stay with python instead?
<Donovan>
people tend to get very emotional about their chosen paths in life, be it programming language de jour
<Donovan>
or whatnot
dayepa has joined #ruby
freerobby has joined #ruby
camilasa_ has quit [Read error: Connection reset by peer]
<Donovan>
shevy: I found ruby more to my syntactic liking
<Donovan>
something pure about it, can't really put my finger on it
camilasan has joined #ruby
freeayu has quit [Remote host closed the connection]
jjbohn is now known as jjbohn|afk
<_br_>
Sugar, everyone loves the sugar.
<Donovan>
yeah, I suppose so
acrussell has left #ruby [#ruby]
weeb1e has joined #ruby
<shevy>
hmm
<shevy>
it is more than sugar alone, it helps my brain think
v0yager has quit [Remote host closed the connection]
JDHankle has quit [Remote host closed the connection]
<Donovan>
yeah. When I was first starting out, if I wanted to code something I would just code it the way I thought it should be... and more often than not, it either worked, or was very close.
v0yager has joined #ruby
<Donovan>
so me, that's elegant
asterite has left #ruby [#ruby]
<shevy>
yeah
sarkis has joined #ruby
<shevy>
syntactically ruby is rather flexible
<_br_>
yep, classical TMTOWTDI
<_br_>
got that from perl I think.
<Donovan>
yeah
<Donovan>
which is why I prefer it to python
Badreddi1 has joined #ruby
<shevy>
perl is syntactically a mess though
<Donovan>
but, also, the code it readable.
mengu has joined #ruby
<shevy>
foreach my $key (keys %apip) {
Badreddi1 has quit [Client Quit]
<shevy>
$wd{$apip{$key}} = "!!!!MISSING!!!!";
<Donovan>
I would often find myself going back over perl code I wrote just months earlier trying to figure out what I was doing. Even with comments, it was a pain.
<_br_>
quite right, in perl you can build which is after a couple of days really unreadable.
<diegok>
shevy: sure. I prefer ruby, but we had perl as a real option for production code loong before and it can do almost the same as ruby (and still faster in many aspects)
troessner has joined #ruby
<diegok>
also, gems are still not there to CPAN
huoxito has quit [Quit: Leaving]
<diegok>
hope it will some day
<Donovan>
I'm a long-time perl developer. I never use it anymore.
ahawkins has quit [Quit: leaving]
<Donovan>
but yes, CPAN is very nice.
<Donovan>
however, bundler is quite nice too
ahawkins has joined #ruby
coveira has joined #ruby
<Donovan>
along with rvm
<diegok>
Donovan: I still do lot of things in perl because very fast XS extensions from CPAN
<Donovan>
I suppose it depends on what you need to do
<Donovan>
the right tool for the job, right?
<diegok>
I really love ruby because it takes lot of things I love from perl in deed :)
mklappstuhl has quit [Read error: Operation timed out]
<diegok>
then I won't be picking the best tool for the job :-/
<Donovan>
LOL
<diegok>
Donovan: other thing I really love of working with perl is module support and docs.
rhys has joined #ruby
<Donovan>
ruby has that too, I don't miss that at all
<banister>
blocks in ruby annoy me though
huoxito has joined #ruby
<_br_>
why?
<diegok>
ruby blocks rock's!
yacks has quit [Ping timeout: 245 seconds]
<Donovan>
yeah, I like blocks in ruby too
persand has quit [Quit: persand]
fantazo has joined #ruby
<banister>
because they're special-cased, they're not normal arguments. So you have to treat them differently
tealmage has joined #ruby
<banister>
but that is also their greatest strength, so it's a double edged sword :)
<diegok>
my point is that perl still is a really GOOD tool on my toolbox and being a ruby programmer is super easy to use/copy from perl/CPAN stuff :)
weeb1e has joined #ruby
nucatus has quit [Read error: Connection reset by peer]
<diegok>
I've ported resque to perl/CPAN and I can mix both of my loves into my daily work :)
<banister>
_br_: if you start trying to do functional programming in ruby, then you get a lot of incidental complexity managing blocks, so recently i've just started passing explicit lambdas instead, which almost look as good
nucatus has joined #ruby
<banister>
my_method ->(x) { "hi boys!" }
<Donovan>
diegok: that's great. Doing that would hurt my head. =)
go|dfish has quit [Remote host closed the connection]
<diegok>
oh!, BTW, in some stupid tests I did, it was faster over resque on 1.9 :-)
ananthakumaran has quit [Quit: Leaving.]
<diegok>
Donovan: :)
blaxter has quit [Quit: foo]
<_br_>
banister: Well, thats the lisp inheritance. There is much in ruby which is certainly not perfect... hopefully getting there ... 3.0 4.0 :)
vlad_sta_ has quit [Remote host closed the connection]
banister has quit [Read error: Connection reset by peer]
maz-dev has quit [Read error: Connection reset by peer]
banister has joined #ruby
go|dfish has joined #ruby
<waxjar>
does anyone else think "functional programming" is a terrible name? :p
<_br_>
how would you else call it?
Kricir has joined #ruby
<waxjar>
no clue
<Donovan>
heya waxjar
troessner has quit [Ping timeout: 240 seconds]
<_br_>
Logical, Procedural, Object Orientated, Aspect Orientated, Functional, ... I think I'm still missing some
<waxjar>
hi Donovan
Taranis has left #ruby [#ruby]
nadirvar_ has joined #ruby
mklappstuhl has joined #ruby
<Donovan>
let the marketing folks come up with the press jargon. =)
tommyvyo has quit [Quit:]
coderhut has joined #ruby
<_br_>
Anyone here using AOP these days?
codecop_ has joined #ruby
<waxjar>
i dont even know what that is
<_br_>
Rather fun actually, supposed to be the next big thing after OOP.
mklappstuhl has quit [Remote host closed the connection]
<speakingcode-wor>
banister: thanks
<Xeago>
banister: weird that you ahve to specify the @ sign in there
itcharlie has joined #ruby
<Xeago>
what can it return if you omit it?
nanoxd_ has quit [Ping timeout: 256 seconds]
<banister>
Xeago: i dont know, try it :P
zetaspartan2552 has quit [Quit: zetaspartan2552]
agjacome has quit [Ping timeout: 256 seconds]
<speakingcode-wor>
banister: anything similar for local variables, class variables, etc?
renderfu_ has joined #ruby
<banister>
speakingcode-wor: local variables you just use eval()
<speakingcode-wor>
ah
<banister>
speakingcode-wor: class variables, maybe, but who cares about those
cmarques has quit [Ping timeout: 256 seconds]
arturaz has quit [Ping timeout: 245 seconds]
nfk has quit [Quit: yawn]
mercwithamouth has quit [Ping timeout: 276 seconds]
nanoxd has joined #ruby
pjeide has joined #ruby
pjeide has quit [Changing host]
pjeide has joined #ruby
<speakingcode-wor>
banister: thanks. one more question. how can i assign a value to the var returned by instance_variable_get? doing instance_variable_get(...) = value doesn't seem to work
ezotrank has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thebastl_ has quit [Remote host closed the connection]
slash_nick has joined #ruby
r4nd0m1 has joined #ruby
Solnse has joined #ruby
ezotrank has joined #ruby
brtdv has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikepack has joined #ruby
tealmage has joined #ruby
soukihei has joined #ruby
ExxKA has joined #ruby
codecop_ has quit [Ping timeout: 276 seconds]
Squarepy has quit [Quit: Leaving]
marr has joined #ruby
Lewix has joined #ruby
SweeT_PoTaTo has joined #ruby
Xeago has quit [Remote host closed the connection]
SweeT_PoTaTo has left #ruby [#ruby]
Megtastique has joined #ruby
Lewix has quit [Remote host closed the connection]
<_br_>
ravster: Something like this will spit out HTTP status codes for you. Doesn't do perfectly what you want, its just a snipped I took from a local gem here we made. @app.call(env).on_complete { |response| status_code = response[:status].to_i }
chasep_work has quit [Remote host closed the connection]
<_br_>
ravster: inside that block we have a case statment which throws custom exceptions for us
RichardBaker has quit [Quit: RichardBaker]
marcgg has quit [Remote host closed the connection]
jefflyne has joined #ruby
RichardBaker has joined #ruby
jerius has joined #ruby
alem0lars has quit [Ping timeout: 246 seconds]
tealmage has quit [Ping timeout: 256 seconds]
gyzmodo has quit [Ping timeout: 245 seconds]
justinweiss has joined #ruby
nadirvar_ has joined #ruby
tjad has quit [Ping timeout: 264 seconds]
randomautomator has joined #ruby
davedev24 has quit [Read error: Connection reset by peer]
bzitzow has joined #ruby
davedev24 has joined #ruby
io_syl has quit [Quit: io_syl]
tjbiddle has quit [Quit: tjbiddle]
codecop_ has joined #ruby
_jesse_ has joined #ruby
ananthakumaran has joined #ruby
macmartine has joined #ruby
bluOxigen has quit [Ping timeout: 256 seconds]
mmitchell has joined #ruby
moses_m has joined #ruby
Kricir has quit [Remote host closed the connection]
filipe has quit [Read error: Connection reset by peer]
efrainolivares has joined #ruby
jefflyne has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Vivekananda has joined #ruby
jefflyne has joined #ruby
jefflyne has quit [Client Quit]
ephemerian has quit [Quit: Leaving.]
rbwsam has joined #ruby
vadelius has quit [Ping timeout: 264 seconds]
Lewix has joined #ruby
noname001 has quit [Ping timeout: 245 seconds]
r4nd0m1_ has joined #ruby
alex__c2022 has joined #ruby
kevinykchan has joined #ruby
pel_daniel has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
r4nd0m1 has quit [Ping timeout: 264 seconds]
nomenkun has quit [Remote host closed the connection]
ryandeussing has quit [Remote host closed the connection]
<ravster>
How do I find out what http error codes match to faraday errors?
moses_m has quit [Ping timeout: 240 seconds]
kpshek has joined #ruby
<ravster>
I'm trying to confirm that a ClientError isn't thrown when the server responds with a HTTP-422.
<Guest87977>
this seems to opacify correct but doesnt lightens the color. background-color: opacify(lighten( rgba($baseColorRed,$baseColorGreen,$baseColorBlue, 0.3), 10%),0.8); why is that?
<Guest87977>
sass ^
Diranged has joined #ruby
mikeg has joined #ruby
HJvortex has joined #ruby
<HJvortex>
hi
<HJvortex>
can someone please help me in this small problem . i have explained it in gits
<_br_>
Guest87977: Well this isn't #css or #sass here, but opacity controls the alpha channel, not the luminance. RGB does not support that. For luminance you would need the data in e.g. HSV format
jefflyne has joined #ruby
<Guest87977>
_br_, i have done darken() and lighten() on rbga. it works fine.
<Guest87977>
but its not working ok in combination with opacity
RichardBaker has quit [Quit: RichardBaker]
Voodoofish430 has joined #ruby
<_br_>
HJvortex: Don't use "$" in your variable names. That is probably your issue.
<_br_>
HJvortex: That is perlism. In ruby $ variables are globals and use is discouraged.
vadelius has joined #ruby
dagobah has quit [Remote host closed the connection]
<HJvortex>
_br_: so if i remove the $ then what should i use in the puts to evaluate the final value
r4nd0m1 has joined #ruby
<ravster>
_jesse_: thanks
<_br_>
HJvortex: Your example is a bit weird you coded there. You are trying to get the value of a new variable which name you constructed?
Kricir has joined #ruby
<_br_>
Guest87977: Go to #sass or #css
<HJvortex>
_br_: yes
tjad has joined #ruby
<Guest87977>
ok
jim0thy_ has joined #ruby
<HJvortex>
_br_: so the idea is to construct the variable from what user input and then print out the value of that variable which is pre set
luke has joined #ruby
banister has quit [Remote host closed the connection]
marius has joined #ruby
<_br_>
HJvortex: I think you are trying to do something like this (guessing here) @actualvalue = 100 ; abc = "act" ; xyz = "ual"; result = instance_variable_get( "@#{abc}#{xyz}value" )
<_br_>
(according to your example)
luke is now known as Guest9567
<HJvortex>
_br_: ill try that :)
<_br_>
have fun
JohnBat26 has quit [Ping timeout: 245 seconds]
brtdv has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
love_color_text has joined #ruby
yfoo has joined #ruby
yfoo has left #ruby [#ruby]
mark_locklear has quit [Ping timeout: 276 seconds]
sarkis has quit [Ping timeout: 240 seconds]
echevemaster has joined #ruby
tatsuya__ has joined #ruby
khushildep has quit [Quit: khushildep]
moses_m has joined #ruby
julweber_ has quit [Remote host closed the connection]
barratt has quit [Ping timeout: 245 seconds]
codecop_ has joined #ruby
asterite has joined #ruby
asterite has left #ruby [#ruby]
echevemaster has quit [Client Quit]
Guest9567 has quit [Ping timeout: 245 seconds]
Kelet has joined #ruby
PanPan has joined #ruby
<HJvortex>
_br_: no luck its printing out an empty string
_bart has quit [Remote host closed the connection]
<_br_>
HJvortex: paste "@actualvalue = 100 ; abc = "act" ; xyz = "ual"; result = instance_variable_get( "@#{abc}#{xyz}value" )" into your irb and look at the result variable
tatsuya_o has quit [Ping timeout: 264 seconds]
dweeb has quit [Quit: Computer has gone to sleep.]
newUser1234 has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 264 seconds]
<HJvortex>
_br_: ahaaa missed the @ sign
Kricir has quit [Remote host closed the connection]
efrainolivares has quit [Quit: efrainolivares]
DrCode has quit [Ping timeout: 240 seconds]
brain_shim has joined #ruby
Astral_ has joined #ruby
sayan has joined #ruby
pothibo has joined #ruby
ericmathison has joined #ruby
amacgregor__ has joined #ruby
moosya_ has joined #ruby
zombiebi_ has joined #ruby
mneorr_ has joined #ruby
geekbri_ has joined #ruby
ryandeus_ has joined #ruby
zombiebit has quit [Read error: Connection reset by peer]
efrainolivares has joined #ruby
ryandeussing has quit [Read error: Connection reset by peer]
moosya has quit [Read error: Connection reset by peer]
tjbiddle has joined #ruby
shaunbak_ has quit [Remote host closed the connection]
havenwood has joined #ruby
moosya_ is now known as moosya
stkowski has joined #ruby
niceguyjames has quit [Quit: Computer has gone to sleep.]
<davidcelis>
ah, yeah. so the return values are the same too
miah has joined #ruby
<davidcelis>
sometimes they arent
tonni has joined #ruby
<Kelet>
! methods by convention should return self (thus, sort! should return itself, which is what you're saying)
ColKurtz has joined #ruby
<Kelet>
Although all standard library stuff that has ! returns self, it might be worth testing libraries that implement ! methods, because you can't trust everyone to follow convention.
neg_01 has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
moosya has quit [Quit: moosya]
Al_ has quit [Quit: Al_]
Heskie has quit []
zeade has quit [Quit: Leaving.]
marius has quit [Ping timeout: 256 seconds]
Astral__ has joined #ruby
Peej has joined #ruby
xpirator has joined #ruby
xpirator has quit [Remote host closed the connection]
agjacome has joined #ruby
<bzitzow>
I'm looking for an open source library to contribute to
_honning_ has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
gazarsgo has quit [Quit: gazarsgo]
<neg_01>
I have rspec Automation script, I am searching continues integration with hudson, any suggestion?
kpshek has quit []
stkowski has quit [Quit: stkowski]
mrsolo has joined #ruby
kaldrenon has quit [Remote host closed the connection]
stkowski has joined #ruby
Astral_ has quit [Ping timeout: 246 seconds]
aaronmcadam has quit [Quit: Leaving...]
phreax_ has quit [Ping timeout: 264 seconds]
brennanMKE has quit [Remote host closed the connection]
zeade has joined #ruby
v0n has joined #ruby
<davidcelis>
bzitzow: ok
kpshek has joined #ruby
mansi has joined #ruby
<YaNakilon>
Kelet ! methods should return nil sometimes
mansi has quit [Remote host closed the connection]
spider-mario has quit [Read error: Connection reset by peer]
<davidcelis>
why coerce a nil *args into an empty array, but not a nil **args into an empty hash?
ebanoid has quit [Quit: brbomgwtfbbq]
<bzitzow>
I should specify, I'm new to ruby and looking for some low hanging fruit on an open source project or two to contribute
mansi has quit [Ping timeout: 276 seconds]
<YaNakilon>
"I hate consistency" (c) matz lol
<pjeide>
".. as a reason to change."
mansi has joined #ruby
DanKnox is now known as DanKnox_away
neg_01 has left #ruby [#ruby]
<YaNakilon>
btw i never used nil.to_a
spider-mario has joined #ruby
<jp->
is it just me or is using ruby for development with anything other than the standard library un-necessarily difficult on centos 6? gems seem either unavailable through the package manager or just won't install using gem.
vlad_starkov has joined #ruby
<jp->
maybe it's the antiquated version it ships with.
gazarsgo has joined #ruby
kaldrenon has joined #ruby
<_br_>
bzitzow: Just find some project you like and see if there are open issues you can tackle. Try to fix it and (in case its on github) send a pull-request.
<Guest87977>
_br_, i guess scss is better and latest?
<_br_>
Guest87977: Please follow the advice of apeiros and banister. This is not #sass, this is #ruby.
Nisstyre-laptop is now known as Nisstyre
geekbri has joined #ruby
<Guest87977>
_br_, if they asked politely. sure.
<Guest87977>
_br_, thanks. and no problem if you cant help
<_br_>
Dangerious waters.
Guest87977 was kicked from #ruby by apeiros [polite enough?]
<apeiros>
what a douche
<_br_>
jep.
c0rn has quit [Quit: Computer has gone to sleep.]
<apeiros>
I mean at the very least you, _br_, asked him politely.
<Diranged>
Hey I'm working on some ruby code and trying to build a unit test, but I've got a bit of a problem..
Guest87977 has joined #ruby
* Guest87977
slaps apeiros
<matti>
Who
Guest87977 has left #ruby ["Leaving"]
<matti>
I missed kicking.
<matti>
apeiros: ;]
<_br_>
apeiros: I think I told him that before several times already.
<apeiros>
well, guess then…
JZTech101 is now known as JZ|Zzz
<_br_>
Quite justified.
c0rn has joined #ruby
<Diranged>
The unit=testing framework is rspec-puppet, and we create a function in puppet called 'getsecret'. I can unit-test that function just fine. However, that function creates an object of class 'Thycotic' and I'm not sure how to mock that class..
<Diranged>
I'm more of a python person, so i'm a little stuck here
geekbri_ has quit [Ping timeout: 245 seconds]
YaNakilon has quit [Ping timeout: 276 seconds]
<apeiros>
Diranged: would depend on the mock/stub framework you use
Ry0_ has joined #ruby
<apeiros>
and pretty sure its documents show how to mock a class
<Diranged>
I'm a bit confused about how to mock it though when its created from within the puppet function?
nucatus has joined #ruby
<spike|spiegel>
poor little Guest87977
<Diranged>
In python, I can just access the variables inside the first package, get the object its created, and then mock parts of that object..
geekbri has quit [Remote host closed the connection]
diegoviola has joined #ruby
alvaro_o has joined #ruby
popcornlover has quit []
YaNakilon has joined #ruby
codecop_ has quit [Ping timeout: 245 seconds]
Fire-Dragon-DoL1 has joined #ruby
workmad3 has joined #ruby
Badreddi1 has quit [Ping timeout: 268 seconds]
Fire-Dragon-DoL has quit [Ping timeout: 276 seconds]
banister has quit [Remote host closed the connection]
RichardBaker has quit [Quit: RichardBaker]
iliketurtles has quit [Quit: zzzzz…..]
niceguyjames has joined #ruby
Travis-42 has joined #ruby
<Travis-42>
What memory profiling tools are there for ruby 2.0? Most seem to be for 1.8
r4nd0m1 has joined #ruby
maxmanders has joined #ruby
noopq has quit [Ping timeout: 256 seconds]
SHyx0rmZ has joined #ruby
graydot has quit [Quit: graydot]
Kricir has joined #ruby
r4nd0m1_ has quit [Ping timeout: 240 seconds]
mmitchell has joined #ruby
robscomputer_ has quit [Read error: Connection reset by peer]
robscomputer has joined #ruby
kirun has joined #ruby
efrainolivares has joined #ruby
robscomputer has quit [Read error: Connection reset by peer]
sambao21 has quit [Quit: Computer has gone to sleep.]
codecop has joined #ruby
<_br_>
shevy: yeah MRI ftw
<spike|spiegel>
Travis-42: pretty much forget about profiling.
banister has joined #ruby
postmodern has joined #ruby
<Travis-42>
spike|spiegel: Is there a good approach to identifying memory leaks without profiling? I've got a process that grows from 100MB of memory to 500MB over several hours, but am having trouble figuring out where the mistake is.
Kricir has quit [Remote host closed the connection]
<_br_>
Travis-42: You can use RubyProf::Memory and Kcachegrind I think.
<Travis-42>
I'll look at them br, thanks
mumble has quit [Ping timeout: 240 seconds]
<spike|spiegel>
not on 2.0 AFAIK
<_br_>
Hm, long running ruby processes, always seem to be a source of pain.
sambao21 has joined #ruby
neg_01 has left #ruby [#ruby]
Kricir has joined #ruby
tealmage has joined #ruby
ctp has joined #ruby
gazarsgo has quit [Quit: gazarsgo]
_honning_ has quit [Ping timeout: 264 seconds]
devoldmx3 has joined #ruby
robbyoconnor has quit [Max SendQ exceeded]
<spike|spiegel>
Travis-42: the question is: does it keep growing or halts at 500?
jlast has joined #ruby
<spike|spiegel>
rails is horrible in that regard, it hogs in hunderds quite easily
gazarsgo has joined #ruby
<Travis-42>
spike|spiegel: That's the memory limit of the instance it's in (512). But the graph is a linear increase.
robbyoconnor has joined #ruby
ryandeus_ has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 245 seconds]
mumble has joined #ruby
ryandeussing has joined #ruby
stevefink has joined #ruby
_honning_ has joined #ruby
kaspergrubbe has joined #ruby
tealmage has quit [Ping timeout: 276 seconds]
mansi has quit [Read error: Connection reset by peer]
mansi has joined #ruby
kaspergr_ has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
JZ|Zzz is now known as JZTech101
jarray52 has joined #ruby
cheenpo_ has joined #ruby
<cheenpo_>
anybody run into...
<cheenpo_>
mysql.h is missing. please check your installation of mysql and try again.
<cheenpo_>
when trying to install the mysql2 gem with MariaDB?
<shevy>
I sometimes have this when another error happens before, and the reporting is then too stupid to give me the real error, often enough this can be seen in a file though like config.log or similar logs
kaspergr_ has quit [Remote host closed the connection]
<cool>
Guys, I am solving Problem Euler problems to learn ruby & I am stuck at problem #8. can anyone point out what I am doing wrong? https://gist.github.com/anonymous/6234753
<shevy>
I dont know what is problem euler, I am not sure what problem you have either
codecop has quit [Read error: Operation timed out]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Mon_Ouie>
cool: You're not adding the solution to your result array
<cool>
shevy: I am referring to http://projecteuler.net. basically, there is a 1000digit number, we have find greatest product of five consecutive digits
Zolo has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 246 seconds]
<shevy>
ok
laurone16 has quit [Quit: laurone16]
<shevy>
yeah, realized that then ... five_digit_pair.map {|elem| elem.to_i}.reject(&:zero?).inject(:*) # => 360, you indeed do not seem to collect these results
robustus has quit [Ping timeout: 245 seconds]
Spami has quit [Quit: This computer has gone to sleep]
SHyx0rmZ has joined #ruby
<cool>
now i get 31752 as answer but site says its wrong. where did I go wrong? should I be accounting for zeros?
<cool>
or there is some other error I am making
robustus has joined #ruby
<apeiros>
reject zero?
<apeiros>
is that allowed by the question?
<shevy>
why do you reject zeros
<apeiros>
the product of the five consecutive digits "74902" is 0
<Nilium>
Is this that one where it's got like eight rows of digits?
Peej has quit [Remote host closed the connection]
<Nilium>
Just use your eyeballs.
<apeiros>
not 504
saarinen has joined #ruby
towelette55 has joined #ruby
Megtastique has joined #ruby
Guest77690 has joined #ruby
<shevy>
good point
<apeiros>
cool: also to_i only once and work from the resulting array -> faster
<apeiros>
cool: and Array#each_cons ;-)
<Nilium>
Also, if you've got a zero anywhere in your five digits, the answer is incorrect, just so you know.
<apeiros>
basically, #8 is a nice 1 liner without any bad code in it
<cool>
apeiros: I removed request zero call but still same wrong result. 31752
* cool
checks Array#check_cons
mneorr_ has quit [Remote host closed the connection]
<snovak>
Ooo - each_cons.
<snovak>
I forgot about that.
intuxicated has joined #ruby
kaspergrubbe has joined #ruby
<apeiros>
cool: I can give you a hint: it's too small
Guest77690 is now known as diegoviola
<apeiros>
cool: the other thing you go wrong:
<Mon_Ouie>
Yeah, the fastest way to find it is probably just to Ctrl+F "99…"
<apeiros>
with your approach, in "1234567890" there's only 2 products
<apeiros>
Mon_Ouie: only because they badly distributed their factors :-p
<cool>
yes, I want to divide everything into 200pices of 5 each. Sum them & get the max
<apeiros>
cool: yeah, that's wrong
Xeago has joined #ruby
thebastl has quit [Quit: Ex-Chat]
<cool>
oh
<apeiros>
in "1234567890" there's 5 times 5 consecutive digits
Peej has joined #ruby
<apeiros>
"12345", then "23456", then "34567" etc.
<apeiros>
but you make it "12345", then "67890". you miss 3.
shunt has joined #ruby
<apeiros>
oh, actually in 10 digits, there's 6 groups of 5 consecutive digits.
ryannielson has quit [Quit: ryannielson]
<cool>
Right, that's mean I will have to try out all the permutations of that 1000digit number!
<apeiros>
no
<apeiros>
only consecutive ones
foohey_ has quit [Quit: leaving]
<apeiros>
you start at string[0,5], move on to string[1,5], then string[2,5] etc.
nitish has quit [Remote host closed the connection]
chrisja has joined #ruby
efrainolivares has quit [Ping timeout: 264 seconds]
browndawg has left #ruby [#ruby]
<canton7>
cool, apeiros missed the each_cons(5), like he said on the next line
Lewix has quit [Remote host closed the connection]
<canton7>
so n.scan(/\d/).map(&:to_i).each_cons(5).map { |n| n.inject(:*) }.max
<banisterfiend>
Nilium: so you'd just wrap a fixnum and do a bunch of bitwise operations on it but expose a nice interface?
<Nilium>
A fixnum or an array of fixnums.
<cool>
canton7: Right!
<cool>
works now!
mansi has quit [Remote host closed the connection]
Demo_of_doom_ has quit [Remote host closed the connection]
efrainolivares_ has quit [Ping timeout: 256 seconds]
mumble has quit [Ping timeout: 268 seconds]
evenix has quit [Remote host closed the connection]
mansi has joined #ruby
Xiti` has quit [Ping timeout: 243 seconds]
anderson has joined #ruby
<Nilium>
A bignum could probably be used as a bitset if it had a []= method to match its [], but I'm not sure how bignum's implemented, so it might not be possible to modify one.
jaimef has quit [Excess Flood]
<Nilium>
A Fixnum provides [] to access bits, but you can't modify those.
mansi_ has joined #ruby
mansi has quit [Read error: Connection reset by peer]
<Nilium>
So an array of Fixnums is usually the best bet.
<diegoviola>
gotta love chruby, finally something that makes sense
brbcoding has quit [Ping timeout: 256 seconds]
<Mon_Ouie>
I'd think String would be the best way to implement it
<canton7>
Nilium, why not use the old bitwise operators? mybignum |= (1 << whatever)
<Nilium>
That's what I do.
mark_locklear has quit [Ping timeout: 240 seconds]
<Nilium>
Well, for fixnums, anyway.
Neomex has joined #ruby
<Nilium>
Doing it for a bignum would probably result in a new bignum being allocated per bitwise op.
codecop has quit [Read error: Operation timed out]
<banisterfiend>
Mon_Ouie: Nope.
Kricir has joined #ruby
cads has quit [Ping timeout: 276 seconds]
jaimef has joined #ruby
Companion is now known as companion
<Mon_Ouie>
banisterfiend: It's not the same when you do it.
IceyEC has quit [Quit: IceyEC]
<banisterfiend>
Mon_Ouie: I'm still learning :P
Senjai is now known as sirsenjai
sirsenjai is now known as Senjai
gyre007 has joined #ruby
<shevy>
lol.... errno.h documentation:
<shevy>
"EGRATUITOUS: This error code has no purpose."
<Nilium>
You could do it with a string, too, just by using set/getbyte.
rurufufuss has joined #ruby
Kricir has quit [Ping timeout: 264 seconds]
ssvo has joined #ruby
spider-mario has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
anonymuse has joined #ruby
popl has quit [Quit: We must make an idol of our fear, and call it God.]
Megtastique has quit [Quit: Megtastique]
<Nilium>
Thinking about it more, yeah, definitely use a string.
<Nilium>
Should sort of ensure cache locality and you don't lose a bit to a fixnum.
<banisterfiend>
Nilium: btw when you were evaluating ruby gaming libraries, did you look at Mon_Ouie's one?
<banisterfiend>
(ray)
<Nilium>
No.
<Nilium>
I haven't evaluated them in the first place.
Matriks has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<Nilium>
I evaluated the options for GL bindings and GL context/window creation libs, and if the gem went beyond the scope of that I ignoredi t.
<Nilium>
*ignored it
tommyvyo has joined #ruby
mansi_ has quit [Remote host closed the connection]
ukd1 has joined #ruby
agjacome has joined #ruby
mansi has joined #ruby
Neomex has quit [Quit: Neomex]
saarinen has quit [Quit: saarinen]
mansi_ has joined #ruby
mansi has quit [Read error: Connection reset by peer]
arietis has joined #ruby
pipework has quit [Remote host closed the connection]
jim0thy_ has joined #ruby
<zorg24>
how does one get the current URI in rspec?
codecop has joined #ruby
<Nilium>
A current URI for what?
tatsuya_o has joined #ruby
<zorg24>
I'm writing tests for a rails app
<Mon_Ouie>
I assume you're talking about some web framework that you didn't mention
<Mon_Ouie>
(Well, now you did)
<Nilium>
A current URI for a test or something?
<Nilium>
Like URI(__FILE__)?
<Mon_Ouie>
Asking on #rubyonrails would probably make more sense
<zorg24>
ok thanks
Wildhoney has joined #ruby
Solnse has quit [Ping timeout: 276 seconds]
saarinen has joined #ruby
Lewix has joined #ruby
jim0thy_ has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
stkowski has joined #ruby
Solnse has joined #ruby
sjltaylor has joined #ruby
devoldmx3 has quit [Ping timeout: 240 seconds]
Xeago has quit [Remote host closed the connection]
differentSmoke has joined #ruby
Solnse has quit [Read error: Connection reset by peer]
sjltaylor has quit [Client Quit]
<differentSmoke>
hello
ner0x has quit [Remote host closed the connection]
zz_dbRenaud is now known as dbRenaud
ice has quit [Remote host closed the connection]
<differentSmoke>
I got a short rails related but ultimately core ruby question
kaldrenon has quit [Remote host closed the connection]
<shevy>
ack
bdscvr has joined #ruby
efrainolivares__ has quit [Read error: Operation timed out]
<differentSmoke>
yes!
<Nilium>
Well, ask and then we'll maybe tell you to ask the rails channel.
<differentSmoke>
is there a way from preventing ruby from escaping strings?
<apeiros>
differentSmoke: ruby does not escape strings
<differentSmoke>
a way OF preventing
<Nilium>
What do you mean by ruby escaping strings?
<apeiros>
are you confusing inspect output with print output?
<Nilium>
Are you confusing interpolation with escapes?
<differentSmoke>
maybe.
<Nilium>
Give us an example string that is being escaped, as it were.
<zets>
are you talking about rails?
<Nilium>
He is, but he seems to think it's a core ruby thing, and I have no idea what he's actually talking about
codecop has quit [Ping timeout: 246 seconds]
<differentSmoke>
well, I was given the impression for reading a large number of stack overflow posts that ruby did indeed escaped strings
breakingthings has quit [Quit: breakingthings]
<Nilium>
What do you mean by escape?
thepumpkin has joined #ruby
<Nilium>
You really, really need to clarify that first.
<differentSmoke>
the internal representation of the string is with the backslashes
<jrobeson>
differentSmoke, notice the difference .. with " or '
jim0thy_ has quit [Ping timeout: 264 seconds]
<apeiros>
differentSmoke: no
<canton7>
differentSmoke, no. the internal representation doesn't have the backslashes. The backslashes are put in by the 'inspect' method on String
<differentSmoke>
ok ok.
deviantlinux has joined #ruby
<apeiros>
and the backslashes are needed when you write a string literal. "\"" does not internally consist of "backslash followed by quote". it's just "quote".
<differentSmoke>
so "blabla""blabla" is a vaild string?
<apeiros>
no
<apeiros>
well, yes, but not the way you mean
<deviantlinux>
In a "rescue" block inside a begin/end block, Can I use any valid Ruby code, such as an if statement, or can you only use certain things there?
<orionstein>
"blabla\"\"blabla"
rickmasta has joined #ruby
<apeiros>
deviantlinux: rescue code can contain any ruby code.
<differentSmoke>
but what get's stored is "blabla""blabla"
<canton7>
the quotes around the whole thing are needed so that ruby knows that you want to store a string, as opposed to an int, value of another variable, etc
<apeiros>
this is a special case
<orionstein>
"\"blabla\"\"blabla\""
freerobby has joined #ruby
<apeiros>
your first string is "blabla", your second is "blabla", and ruby concatenates them
<deviantlinux>
apeiros: thanks.
<apeiros>
that's really a special case
<apeiros>
and a bad example
saarinen has quit [Quit: saarinen]
<differentSmoke>
haha, sorry
<jrobeson>
*special*
<differentSmoke>
ok. I guess a rails method is passing the result of inspect rather than the actual string
slash_nick is now known as slash_nickcomple
<apeiros>
differentSmoke: almost certainly not
<apeiros>
differentSmoke: but since you said "backtrace" - in a backtrace you would *of course* use inspect
mneorr has quit [Ping timeout: 240 seconds]
<apeiros>
anything else makes no sense.
<differentSmoke>
I said backtrace?
jp- has quit [Quit: OK, I believe you… but my tommy gun don't]
<apeiros>
oh, no, you said stack *overflow*
<deviantlinux>
Are variables inside a begin/end only available in the begin/end, or can I use them outside of it?
sambao21 has joined #ruby
<apeiros>
somehow overread that as stack trace
<differentSmoke>
could they get inspected when retrieved from an Array?
tylersmi_ has quit [Read error: Connection reset by peer]
<apeiros>
differentSmoke: dude, what *actual* problem do you experience
tylersmith has joined #ruby
v0n has joined #ruby
<apeiros>
deviantlinux: begin/end does not introduce a new lexical scope. variables are visible outside.
mneorr has joined #ruby
codecop has joined #ruby
<differentSmoke>
json stored as a string in a MySQL database gets passed to a render json: arrayofrecords, and instead of getting a json array containing json objects, I get a json array containing strings
devoldmx3 has joined #ruby
<apeiros>
differentSmoke: my bet is on you doing a double to_json
fyz1x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<differentSmoke>
uhm, yes now that you mention it that sounds pretty logical
<deviantlinux>
apeiros: Any idea why this http://pastebin.com/0P9j4ZCP (see Line 25-28) causes code below that line (the reply ERROR) not to be executed? Something's wrong there
<differentSmoke>
is there a to_unjson? (trying to be funny, hope I convey my meaning)
<apeiros>
deviantlinux: use something non-ad ridden and I'll look at it. e.g. gist.github.com
<apeiros>
and the other (stupid) way would be plain JSON.parse.
<differentSmoke>
well, there is an implicit to json
<apeiros>
yeah, you use render :json
<apeiros>
don't
<apeiros>
use render :text
<apeiros>
and set the proper headers.
<differentSmoke>
ok, will investigate. thanks!
<apeiros>
also, that part would be #rubyonrails
<apeiros>
as in "how do I render a json string without it getting called to_json on it again" (or somesuch)
Nisstyre-laptop has joined #ruby
dtcrshr has quit [Quit: poff]
<differentSmoke>
yes yes, I apologize
<apeiros>
no need to apologize. just pointing out.
<differentSmoke>
now I understand why all the "how do I prevent ruby from escaping..." in StackOverflow were always left unanswered or the subject was changed
robscomputer has joined #ruby
newUser1234 has quit [Remote host closed the connection]
zorg24 has quit [Ping timeout: 256 seconds]
seich- has quit [Ping timeout: 245 seconds]
rickmasta has quit [Quit: Leaving...]
axiak has joined #ruby
<deviantlinux>
apeiros: ads? Adblocker plugins are your friend, but ok, sec
<apeiros>
deviantlinux: adblocker plugins are for suckers
bdscvr has left #ruby [#ruby]
<apeiros>
I understand that the content I want needs ads to survive
<deviantlinux>
saves lives, man
<differentSmoke>
:/
<differentSmoke>
render text: still gives me the escaped representation
robscomputer_ has quit [Ping timeout: 256 seconds]
coveira has joined #ruby
sparq_ has joined #ruby
<apeiros>
differentSmoke: then your double to_json happens earlier
Spooner has joined #ruby
Nisstyre-laptop is now known as Nisstyre
<cheenpo_>
anybody here have the mysql2 gem with MariaDB on centos 6.4 ?
pskosinski has joined #ruby
newUser1234 has joined #ruby
<apeiros>
differentSmoke: looking at my own controllers, render :json does not actually call to_json
<differentSmoke>
uhm...
coveira has quit [Excess Flood]
<apeiros>
at least not on a string
robscomputer has quit [Remote host closed the connection]
robscomputer has joined #ruby
elux_ has quit [Quit: Bye!]
robscomputer has quit [Read error: Connection reset by peer]
<apeiros>
deviantlinux: other than that code itself erroring out, I see no reason why it would
robscomputer has joined #ruby
seich- has joined #ruby
<deviantlinux>
apeiros: it seems like simply having the if statement there causes the issue. Like it doesn't like my variable.
<apeiros>
deviantlinux: well, do you get an exception? if not, wrap it into a begin/rescue and see whether it errors out?
rickmasta has joined #ruby
<apeiros>
you only show a part of your code, there's various reasons line 25-28 could raise
<differentSmoke>
Ok. This only works when I pass it the json field of one record, directly. So render json: MyModel.first.json_record works as I want, but if i render json: MyModel.first what I get is the whole row as json, with the json_record field being a large string.
<apeiros>
differentSmoke: errr… yes, of course
<apeiros>
what'd you expect?
<apeiros>
AR::Base#to_json will invoke to_json on all members.
mmitchell has quit [Ping timeout: 245 seconds]
<apeiros>
write a proper as_json method in MyModel
<differentSmoke>
ok, so there is a to_json
<differentSmoke>
happening
butblack has joined #ruby
andikr has quit [Remote host closed the connection]
codecop_ has joined #ruby
andikr has joined #ruby
stuff has quit [Read error: Connection reset by peer]
oz has quit [Ping timeout: 264 seconds]
JDHankle has quit [Remote host closed the connection]
stuff has joined #ruby
awarner_ has joined #ruby
reset has joined #ruby
<differentSmoke>
well, thanks a lot, it's been dishearteningly clarifying but ultimately very helpful
codecop has quit [Ping timeout: 264 seconds]
madumo has quit [Quit: madumo]
tealmage has joined #ruby
oz has joined #ruby
awarner__ has joined #ruby
<apeiros>
o0
* apeiros
decides to stop reading after "thanks a lot". the rest is just confusing :-p
<apeiros>
yw
mneorr has quit [Remote host closed the connection]
<shredding>
apeiros: To give it a fresh start, what's wrong with my attitude=
<shredding>
Attitude towards what?
tacos1de has quit [Ping timeout: 240 seconds]
rickmasta has quit [Quit: Leaving...]
<apeiros>
"this so easy in python, but impossible in ruby". what's the point of that claim? the only one I see is "come on, feel provoked! prove me wrong!"
Astral__ has quit [Ping timeout: 240 seconds]
<apeiros>
and you know what? I'm not playing along.
<shredding>
apeiros: You really got that wrong.
Kricir has quit [Ping timeout: 245 seconds]
<shredding>
I'm coming from python and am learning ruby.
BillCriswell has quit [Remote host closed the connection]
IceyEC has joined #ruby
<differentSmoke>
I hear you brother!
<apeiros>
shredding: so?
<shredding>
I'm coming as well from php and everyones provoking me all the time just because of that.
tylersmi_ has joined #ruby
go|dfish has quit [Remote host closed the connection]
tylersmith has quit [Read error: Connection reset by peer]
<apeiros>
again: so? you didn't show me what the point of that claim is.
<shredding>
Why on earth should i come into ruby irc with a problem and provoke someone?
<apeiros>
probably because you somewhere learnt that it works.
<apeiros>
that you can push peoples buttons that way.
<shredding>
My point was: Hey guys, I'm new to ruby i know a bit of python i do it there this way, how to do it in ruby?
rbwsam has joined #ruby
<apeiros>
shredding: with *that*, I wouldn't have had a single issue.
<apeiros>
but that's not what you said.
<differentSmoke>
apeiros, I think you are reading an intention that wasn't there. I think it was an honest question like "maybe monkey patching is not the ruby way and you have to try something else?"
<shredding>
apeiros: yeah, maybe you read a bit to much between the lines.
tacos1de has joined #ruby
qhartman_ has joined #ruby
<cheenpo_>
can I provoke somebody about a mysql2 gem install question? (he asked, to ease the tension) ahahahaa
<apeiros>
differentSmoke: no.
<apeiros>
differentSmoke: shredding may not have intended to offend anybody.
<finges>
shredding: It's how you posed the question... when you say something is doable in python.. and impossible in ruby... it comes off confrontational.
<apeiros>
differentSmoke: but it totally is a "I push peoples buttons" move.
go|dfish has joined #ruby
<apeiros>
and I call him out for it
<shredding>
basically i did not even say that you can't monkey patch in ruby, as I already learned you can.
interactionjaxsn has quit [Remote host closed the connection]
<shredding>
I asked, because "require()" is a method call.
<shredding>
Whatever.
ericmathison has quit [Ping timeout: 245 seconds]
<apeiros>
basically you said "i guess that's not possible in ruby"
interactionjaxsn has joined #ruby
newUser1234 has joined #ruby
<apeiros>
anyway, I told you whats wrong with your attitude.
qhartman has quit [Ping timeout: 264 seconds]
<apeiros>
up to you to use that information, or toss it away and hope for somebody else to answer.
<apeiros>
idc
<shredding>
I really do not believe that something is wrond with my attitude.
<apeiros>
that was expected.
kirun has quit [Remote host closed the connection]
<yfeldblum>
even if someone asks a question in a confrontational tone, it's still cool to answer in a way that will be seen by the questioner as kind
sayan has quit [Ping timeout: 256 seconds]
<apeiros>
yfeldblum: nobody stops you.
<shevy>
shredding I think python's import functionality may be more advanced than ruby's load/require actions
<shredding>
I really did not mean to have a confrontational tone!
<shredding>
Sorry, if that came out wrong.
<shredding>
I'm not even natural english speaker.
<shevy>
you can see the chaos that happens in ruby land with the introduction of require_relative
devoldmx27 has quit [Read error: Connection reset by peer]
devoldmx3 has joined #ruby
<apeiros>
yfeldblum: again, go ahead.
<apeiros>
nobody stopping you.
<shevy>
I like it
<shevy>
"Other people's code is often bad."
<shredding>
shevy: Basically, in python it's not really mocking what you're doing on imports, you just overwrite. That's why i'm unsure if it's even the right hook point to "mock" out the httparty gem
interactionjaxsn has quit [Ping timeout: 240 seconds]
<yfeldblum>
shredding, in ruby, you can replace a class with another class, or a method with another method; there are plenty of mocking frameworks and libraries around to use or to learn from
Speed has joined #ruby
shunt has quit [Ping timeout: 256 seconds]
dllama has joined #ruby
<shredding>
yfeldblum: Ok, that's the functionality I'm looking for!
<yfeldblum>
shredding, however, modifying Kernel#require is not generally a good approach
sambao21 has quit [Quit: Computer has gone to sleep.]
wmoxam has quit [Ping timeout: 268 seconds]
<shevy>
shredding you should be able to do something similar, in ruby you can always reopen and change existing classes and methods or just load/require a .rb file again (hmm... I think load() actually... one of them loads only once...)
<shevy>
shredding you can also keep an alias to the original method
<shredding>
shevy: So basically, how would one put a class that uses a gem? This overwriding of require does not feel like the way to go ...
<shevy>
"So I hereby declare the future deprecation of autoload. Ruby will keep autoload for a while, since 2.0 should keep compatibility to 1.9. But you don't expect it will survive further future, e.g. 3.0." - matz
<shevy>
shredding wait...
<shredding>
shevy: Ok, i haven't yet heared of autoload.
<shevy>
in general the easiest convention is to have "name_of_project" become require "name_of_project"
maroloccio has joined #ruby
<shevy>
ok, let's say you do: require 'bla', where bla is the name of the gem
mlpinit has quit [Remote host closed the connection]
<shevy>
then usually, depending on how complex that gem project is, you may pull in lots of different .rb files
tgunr has quit [Quit: Nity nite]
devoldmx3 has quit [Read error: Connection reset by peer]
<shevy>
in most examples, they will reside in a namespace
<shevy>
usually in that case, module Bla
<yfeldblum>
shevy, yeah, avoid autoload ...
<shevy>
except for apeiros who often uses class Bla ;-)
<shredding>
yfeldblum: interesting approach
robscomp_ has joined #ruby
cody-- has quit [Quit: Computer has gone to sleep.]
<shredding>
shevy: in my case it's just this require 'httparty'
<shevy>
shredding within your project, you could either then do include Bla, to make the namespace available in your module/class
<yfeldblum>
shredding, it's just a very simple example of what i said before: "in ruby, you can replace a class with another class"
baordog has quit [Remote host closed the connection]
<shredding>
As all is depending on that
<shevy>
hmm I am not familiar with httparty
jerius has quit [Ping timeout: 240 seconds]
robscomputer has quit [Ping timeout: 264 seconds]
robscomputer_ has quit [Read error: Connection reset by peer]
<shevy>
let me install that gem
<shredding>
Okay, i think i can figure the details out.
<shredding>
shevy:
<shredding>
shevy: you don't have to
<shredding>
the code works fine.
mansi has quit [Ping timeout: 264 seconds]
<shredding>
I just wonder how to test the code.
<dllama>
hi guys. noob question here if u dont mind. how would i go about treating attr_accessor as an array? Preferably w/o overriding active record initializer ?
Davey_ has joined #ruby
<shevy>
shredding hehe yeah, I often wonder how I should test myself
peregrine81 has quit [Quit: peregrine81]
<shredding>
I guess i can figure out the details, I just wondered what is the "ruby way to go"
twoism has quit [Read error: Connection reset by peer]
itcharlie has left #ruby [#ruby]
twoism has joined #ruby
<virtualize|work>
dllama just assign it as an array
<virtualize|work>
attr_accessor :foo
<virtualize|work>
foo = [1,2,3]
<shredding>
So, if "replacing the class with your fake class" is the ruby way (which is what i did a lot in python btw), I'll try that.
<shevy>
ok... seems the main module there is module HTTParty
<shredding>
Thanks for your help.
<shredding>
shevy: Yes!
<shevy>
it has some spec test code in spec/ not sure if that is of any help
ferdev has quit [Read error: Connection reset by peer]
ferdev has joined #ruby
ColKurtz has quit [Ping timeout: 276 seconds]
<dllama>
virtualize|work, I did that, however, when trying to build a form and have :foo["bar"], it returned errors. So i thought i had setup the accessor wrong
kobain has joined #ruby
Guest6856 has quit [Ping timeout: 264 seconds]
<shevy>
hmm is :foo["bar"] even valid syntax?
kobain_ has quit [Ping timeout: 276 seconds]
jlast has quit [Remote host closed the connection]
<apeiros>
shevy: valid syntax yes, otherwise not so much
<dllama>
:foo[:bar]*
<apeiros>
it calls [] on :foo, with an argument "bar"
<dllama>
hmm, hopefully smilie didn't pass in
<shevy>
hehe
<shredding>
I'll just try to read into this exchange classes.
Davey has quit [Ping timeout: 276 seconds]
devoldmx3 has joined #ruby
rismoney has joined #ruby
Sp4rKy has quit [Ping timeout: 276 seconds]
<apeiros>
well, actually since 1.9, Symbol has String methods on it, so it might even work
<shredding>
My book "eloquent ruby" just arrives at "metaprogramming", so that may be of help :)
fridim_ has joined #ruby
<shevy>
cool... I did not even know symbols have []
<virtualize|work>
shevy: you might need to provide some code in order to diagnose it a little more
<apeiros>
shevy: it even works. it's the same as String#[] on Symbol
<apeiros>
basically Symbol#[] is like to_s[]
ColKurtz has joined #ruby
bdscvr has joined #ruby
orionstein is now known as orionstein_away
Sp4rKy has joined #ruby
ctp has joined #ruby
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
ctp has quit [Client Quit]
sjltaylor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tgunr has joined #ruby
bluOxigen has quit [Ping timeout: 264 seconds]
apeiros_ has joined #ruby
codecop has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
AndChat|677369 has joined #ruby
shredding has quit [Quit: shredding]
workmad3 has quit [Ping timeout: 268 seconds]
jjbohn has quit [Quit: Leaving...]
sparr has joined #ruby
DanKnox is now known as DanKnox_away
mengu has joined #ruby
slash_nickcomple is now known as slash_quit
hamakn has quit [Ping timeout: 264 seconds]
mengu has quit [Read error: Connection reset by peer]
c0rn has quit [Quit: Computer has gone to sleep.]
mengu has joined #ruby
<sparr>
is an empty array true or false?
<apeiros_>
true-ish
<apeiros_>
everything but nil/false is true-ish
bdscvr has quit [Ping timeout: 256 seconds]
dankest has quit [Quit: dankest]
DanKnox_away is now known as DanKnox
nomenkun has joined #ruby
twoism has quit [Remote host closed the connection]
Tricon has joined #ruby
twoism has joined #ruby
newUser1234 has quit [Remote host closed the connection]
sjltaylor has joined #ruby
pskosinski_ has joined #ruby
twoism_ has joined #ruby
twoism has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
nucatus has quit [Remote host closed the connection]
jdenen has quit [Quit: Leaving.]
freerobby has quit [Quit: Leaving.]
splittingred_ has joined #ruby
splittingred has quit [Ping timeout: 268 seconds]
splittingred_ is now known as splittingred
alex__c2022 has quit [Quit: alex__c2022]
nomenkun has quit [Ping timeout: 245 seconds]
pskosinski has quit [Ping timeout: 240 seconds]
agjacome has quit [Remote host closed the connection]
devoldmx27 has joined #ruby
pskosinski_ has quit [Client Quit]
Tricon has quit [Quit: Leaving...]
freerobby has joined #ruby
rhys has quit [Quit: Leaving]
jonkri has quit [Quit: jonkri]
devoldmx3 has quit [Ping timeout: 245 seconds]
brennanMKE has quit [Read error: Connection reset by peer]
rbwsam has left #ruby [#ruby]
Tricon has joined #ruby
brennanMKE has joined #ruby
ericmathison has joined #ruby
evenix has joined #ruby
snath has quit [Ping timeout: 246 seconds]
gazarsgo has quit [Quit: gazarsgo]
JDHankle has joined #ruby
apeiros_ has quit [Ping timeout: 245 seconds]
zorg24 has joined #ruby
_honning_ has quit [Ping timeout: 276 seconds]
brisbin has joined #ruby
anderson has quit [Quit: Leaving]
brennanMKE has quit [Ping timeout: 245 seconds]
brisbin has quit [Client Quit]
splittingred has quit [Quit: splittingred]
brisbin has joined #ruby
saarinen has joined #ruby
julweber has joined #ruby
Megtastique has joined #ruby
evenix has quit [Ping timeout: 268 seconds]
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rickmasta has joined #ruby
geggam has quit [Remote host closed the connection]
rickruby has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
tealmage has joined #ruby
failshell has joined #ruby
huevon has quit [Quit: WeeChat 0.4.1]
Wildhoney has quit [Quit: Wildhoney]
Wildhoney has joined #ruby
tommyvyo has quit [Quit:]
deviantlinux has quit [Quit: Leaving.]
jhn has quit [Ping timeout: 264 seconds]
jonahR has joined #ruby
differentSmoke has quit [Quit: ChatZilla 0.9.90.1 [Firefox 23.0/20130730113002]]
pentameter has quit [Read error: Connection reset by peer]
failshell has quit [Remote host closed the connection]
seich- has quit [Ping timeout: 264 seconds]
milardovich has joined #ruby
snovak has joined #ruby
Bry8Star{T2_ has quit [Remote host closed the connection]
phantummm has quit [Quit: phantummm]
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
m8 has quit [Quit: Sto andando via]
Bry8Star{T2 has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
c0rn has joined #ruby
tealmage has quit [Ping timeout: 240 seconds]
rickruby has quit [Remote host closed the connection]
Neener54 has joined #ruby
deviantlinux has joined #ruby
vlad_sta_ has quit [Remote host closed the connection]
sjltaylor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snovak has quit [Ping timeout: 276 seconds]
MrZYX is now known as MrZYX|off
Davey_ is now known as Davey
butblack has quit [Quit: butblack]
vince_prignano has quit [Remote host closed the connection]
vince_prignano has joined #ruby
apeiros has joined #ruby
vince_prignano has quit [Client Quit]
iliketurtles has quit [Quit: zzzzz…..]
vince_prignano has joined #ruby
vince_prignano has quit [Max SendQ exceeded]
rupee has quit [Quit: Leaving]
vince_prignano has joined #ruby
IceyEC has quit [Quit: IceyEC]
<xybre>
sparr: open irb and run `if Array.new then; puts "truthy"; else; puts "falsey"; end` and replace `Array.new` with whatever object you want.
stkowski has quit [Quit: stkowski]
mansi has joined #ruby
<xybre>
sparr: If you do that, you'll see apeiros is correct, only nil + false will return "falsey".
<eka>
anyone here knows dragonfly? I have an app that stores image urls… I would like to use DragonFly in rails for those, I have entry.image_url …. the file is not stored locally though
tylersmith has quit [Read error: Connection reset by peer]
tylersmi_ has joined #ruby
<superscott[8]>
anybody have any generic guidelines on when to use include vs. extending a Ruby class?
Nisstyre has quit [Ping timeout: 240 seconds]
<eka>
superscott[8]: "is a" vs "has a"
<eka>
superscott[8]: a car "has a door" etc..
<eka>
superscott[8]: an apple "is a" fruit
<superscott[8]>
eka, ah, good example. i know what you're saying
<eka>
that's the simplest explanation
tylersmi_ has quit [Read error: Connection reset by peer]
<zets>
superscott: the other thing to take into account is that you can only have one immediate superclass, whereas you can have multiple mixins
hamakn has joined #ruby
tylersmith has joined #ruby
<zets>
I typically lean towards using mixins, less messy if the classes eventually diverge
<superscott[8]>
zets: true dat
nucatus has joined #ruby
<eka>
zets: superscott[8]: imho mixing doesn't provide identity but a subset of services… (can't describe well sorry)
tylersmi_ has joined #ruby
tylersmith has quit [Read error: Connection reset by peer]
<zets>
eka: yeah I know what you mean
<superscott[8]>
yeah, i'm with you
tealmage has joined #ruby
seich- has joined #ruby
aalmenar has quit [Ping timeout: 264 seconds]
hamakn has quit [Ping timeout: 256 seconds]
<eka>
I like OOP more cause it can describe the problem I'm trying to solve… still trying to gasp on functional though
<eka>
"pure functional"
ereslibre has quit [Ping timeout: 264 seconds]
tealmage has quit [Remote host closed the connection]
<superscott[8]>
eka which one you working with currently?
<eka>
superscott[8]: none… just looking at elixir for fun… love ruby though
marius has joined #ruby
<superscott[8]>
yeah word, i was checking that out a bit too. cause of the RR podcast?
<eka>
ah… no.. cause valim. got the book, also there is a video on peepcode
<superscott[8]>
ah word.
<eka>
got subscription to peepcode
<eka>
so
<superscott[8]>
you like it?
<eka>
but still, not much time
<eka>
if I like what?
nucatus has quit [Ping timeout: 245 seconds]
<superscott[8]>
peepcode
kobain_ has joined #ruby
staafl has quit [Ping timeout: 245 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
pjeide has quit [Ping timeout: 256 seconds]
aalmenar has joined #ruby
aalmenar has joined #ruby
ereslibre has joined #ruby
ereslibre has joined #ruby
<zets>
superscott: how is RR? I just heard about it a bit ago, been meaning to check it out
<eka>
superscott[8]: yes and no… little disappointed… my problem is, most of the ppl there says "if I would do it right I would do it other way" why they don't do it right for peepcode?
brisbin has quit [Read error: Connection reset by peer]
<superscott[8]>
zets: majority of episodes are pretty fantastic.
<zets>
sweet :D
<superscott[8]>
eka: ah =/
rickruby has joined #ruby
kobain has quit [Ping timeout: 245 seconds]
justsee has quit [Ping timeout: 240 seconds]
heftig has quit [Quit: Quitting]
brisbin has joined #ruby
heftig has joined #ruby
ereslibre has quit [Remote host closed the connection]
aalmenar has quit [Remote host closed the connection]
devoldmx has joined #ruby
rickruby has quit [Ping timeout: 264 seconds]
ereslibre has joined #ruby
ereslibre has joined #ruby
aalmenar has joined #ruby
aalmenar has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
tylersmi_ has quit [Read error: Connection reset by peer]
tylersmith has joined #ruby
Wildhoney has quit [Quit: Wildhoney]
Gnubie is now known as Guest41314
YaNakilon has quit [Ping timeout: 256 seconds]
Cyrus has quit [Quit: Cyrus.sleep()]
c0rn has joined #ruby
ehc has quit [Quit: ehc]
colonolGron has quit [Quit: peace]
snovak has joined #ruby
optimusprimem has quit [Ping timeout: 245 seconds]
dankest has joined #ruby
vlad_starkov has joined #ruby
YaNakilon has joined #ruby
mlpinit has quit [Remote host closed the connection]
mlpinit has joined #ruby
ccolorado has left #ruby [#ruby]
mlpinit has quit [Read error: Connection reset by peer]
tabolario has joined #ruby
mlpinit has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
snovak has quit [Ping timeout: 276 seconds]
vlad_starkov has quit [Ping timeout: 268 seconds]
nignaztic has quit [Read error: Connection reset by peer]
tealmage has joined #ruby
llirkaz has joined #ruby
nignaztic has joined #ruby
vince_prignano has joined #ruby
vince_prignano has quit [Max SendQ exceeded]
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
butblack has joined #ruby
vince_prignano has joined #ruby
ner0x has quit [Quit: Leaving]
St_Marx has quit [Ping timeout: 240 seconds]
marius has quit [Quit: -]
predator117 has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
AndChat|677369 has quit [Remote host closed the connection]