Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
<matti>
Oh, handling rotation with logger.
<joshu>
Now my question is where to require 'logger'. I've tried in bin/ffm or lib/ffm.rb and it works in both places.
<joshu>
matti is that bad?
<apeiros_>
matti: during our 5y of latin, we got one little booklet, which contained 2 pages with famous quotes, and our latin teacher was like: "and if you don't remember ANYTHING from these 5y, at least remember this, with this you can look smart" :)
TheFuzzball has joined #ruby
<matti>
apeiros_: Haha
<apeiros_>
joshu: require loads a file once
<apeiros_>
it's perfectly fine to require something in multiple places
<apeiros_>
my basic rule is: every file requires *all* it depends on
<apeiros_>
so if you reference Logger in both lib/ffm.rb and bin/ffm, then you should require it in both.
postmodern has joined #ruby
bigrb has quit [Quit: bigrb]
jamesfung14 has quit [Ping timeout: 256 seconds]
johnkary has quit [Quit: @johnkary]
incorvia has joined #ruby
colonolGron has joined #ruby
<joshu>
apeiros_ oh ok
Trynemjoel has joined #ruby
<joshu>
apeiros_ and by referencing Logger you mean wherever a new Logger object is created as in this case Logger.new?
incorvia has quit [Read error: Connection reset by peer]
<apeiros_>
wherever you have the text `Logger` in your code
<joshu>
btw apeiros_ 5yrs of latin was this at university or before?
<joshu>
ok
<apeiros_>
I never know how to call it in english. it's called "Gymnasium" in switzerland. I think it's similar to high-school+lower grads university
<matti>
Its like that in Poland since some time too.
<joshu>
apeiros_ yeah before university
<matti>
Primary, Gymnasium and University
<apeiros_>
our school system is age 7-12 (6y) elementary school, 13-18 (6y) gymnasium, and then university which depends on the course (usually 3y bachelor, 4.5y master)
<joshu>
yeah same here more or less
<matti>
I was educated in pre-reformed system.
<apeiros_>
and latin is 14-18 there
<joshu>
but no latin
justsee has quit [Ping timeout: 264 seconds]
<joshu>
mandatory?
<matti>
8 years primary, 4 years high school and 3 or 5 years university.
<apeiros_>
of course, that's the academical way
<apeiros_>
type dependent - back in my time we had type A,B,C,D,E and some variations. I took B, which includes latin.
<apeiros_>
C would have had no latin and more maths
<matti>
C -- Cool Kids ;p
<apeiros_>
A was with ancient greek, E modern languages. forgot D.
* matti
had English and Russian ;p
colonolGron has quit [Ping timeout: 245 seconds]
<matti>
Haha
<joshu>
davi davi matti
<joshu>
haha
<matti>
LOL
harrymoreno has quit [Ping timeout: 256 seconds]
harrymoreno has joined #ruby
F1skr has quit [Quit: WeeChat 0.4.1]
johnkary has joined #ruby
Matip has joined #ruby
yacks has joined #ruby
<joshu>
so apeiros_ just checking but in my test_helper.rb I don't require anything but ffm. But according to apeiros_ 's rule 53 "thou shall require *all* a file depends on"…as I have this in test_helper.rb Mail.defaults do delivery_method :test end then I should require 'mail'?
Michael has joined #ruby
Michael is now known as Guest31624
<apeiros_>
ah, rule 53 applies to bin/lib only I think
<apeiros_>
with tests, test_helper specifically exists to reduce boiler-plate in the test-files
<matti>
Is there a rule like : Rule 1: Never talk about Ruby Rules
<matti>
?
<joshu>
haha
<matti>
;D
<apeiros_>
nope
DomKM has quit [Quit: Leaving.]
<joshu>
ok more about logger. I've noticed that when I run my tests the logging is written to stdout with the test results as opposed to the log file when not testing. I now understand that as testing does not run the binary that my config is not loaded. is this ok?
Nisstyre-laptop has joined #ruby
<apeiros_>
that's something you need to know
<apeiros_>
generally I'd consider logging to be part of the behavior of your library
<apeiros_>
in other words: something you should write tests against too
<apeiros_>
so I'd configure it to log into e.g. a StringIO, so you can test it
yacks has quit [Ping timeout: 264 seconds]
matt_ has joined #ruby
yacks has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
<joshu>
and for that to happen I would define the StringIO in my test_helper.rb?
LennyLinux has quit [Remote host closed the connection]
matt_ is now known as Guest54104
Guest54104 has quit [Client Quit]
postmodern has quit [Ping timeout: 246 seconds]
jimg has joined #ruby
ivanoats has quit [Remote host closed the connection]
interactionjaxsn has joined #ruby
freerobby has joined #ruby
marr has quit [Ping timeout: 256 seconds]
arquebus has quit [Quit: Konversation terminated!]
paolooo has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
freerobby has quit [Ping timeout: 256 seconds]
jds_ has joined #ruby
grnman has quit [Quit: leaving]
ereslibre has quit []
cj3kim has joined #ruby
ereslibre has joined #ruby
ereslibre has quit [Changing host]
ereslibre has joined #ruby
jztech101_ has joined #ruby
<joshu>
ok apeiros_ matti I'm going to bed. Have to sort out my tests tomorrow which aren't fully working and then gemify and hopefully deploy this before Monday.
JZTech101 has quit [Ping timeout: 256 seconds]
<joshu>
good night guys ;)
<matti>
Night joshu
Proshot is now known as statarb30
statarb30 has quit [Quit: Leaving]
verto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
slyv has joined #ruby
kil0byte has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
GeissT has joined #ruby
GeissT has quit [Read error: Connection reset by peer]
GeissT has joined #ruby
<apeiros_>
n8 joshu
mklappstuhl has joined #ruby
whowantstolivefo has joined #ruby
postmodern has joined #ruby
[WRD]Nakilon has joined #ruby
Guest31624 has quit [Remote host closed the connection]
<[WRD]Nakilon>
the shortest way to swap top 2 elements on Array?
timmow has joined #ruby
<[WRD]Nakilon>
*last
<apeiros_>
ary[a],ary[b] = ary[b],ary[a]
<[WRD]Nakilon>
omg, really
<[WRD]Nakilon>
thx
cj3kim has quit [Remote host closed the connection]
* [WRD]Nakilon
was thiking about stack << stack.pop.tap{ __ = stack.pop } ; stack << __
<[WRD]Nakilon>
..D
<[WRD]Nakilon>
i should communicate with rubyist more
timkohrumel has joined #ruby
<bnagy>
if you were doing it that way then you would do stack.push( *stack.pop(2).reverse )
timmow has quit [Ping timeout: 252 seconds]
<bnagy>
also underscrore as a variable isn't used much, but when it _is_ used it normally means "I have to assign to this, but I'm never going to use it, forget about it"
<[WRD]Nakilon>
yeah i use it in this way
ivanoats has joined #ruby
<[WRD]Nakilon>
like... .group_by{ |_| _ }.
<bnagy>
no, because that's using it
<[WRD]Nakilon>
..\
<Spooner>
bnagy: stack.push stack.pop, stack.pop works too ;)
senayar has quit [Quit: Quitte]
timkohrumel has quit [Ping timeout: 252 seconds]
<[WRD]Nakilon>
btw i stil dream about the method, which returns object itself, for such cases as with my group_by
paolooo has quit [Quit: Page closed]
cj3kim has joined #ruby
darthdeus has quit [Quit: Leaving...]
<bnagy>
Spooner: yeah true, and probably faster your way
<bnagy>
less transparent code though
echevemaster has joined #ruby
echevemaster has quit [Changing host]
echevemaster has joined #ruby
<Spooner>
Maybe. I just like the fact that it looks like you aren't actually doing anything ;)
timkohrumel has joined #ruby
timkohrumel has quit [Read error: Connection reset by peer]
ivanoats has quit [Ping timeout: 246 seconds]
timkohrumel has joined #ruby
DomKM has joined #ruby
takeru has joined #ruby
<Spooner>
I think ary[-1], ary[-2] = ary[-2], ary[-1] is probably clear enough, as apeiros_ suggested.
bsaboia_ has quit [Remote host closed the connection]
Ortuna has quit [Quit: Computer has gone to sleep.]
<apeiros_>
class Array; def swap(a,b); self[a],self[b] = self[b],self[a]; end; end
timkohrumel has quit [Ping timeout: 248 seconds]
<apeiros_>
ary.swap(-1,-2)
<apeiros_>
makes it obvious what you do
<Spooner>
stack[-2..-1] = stack.last(2).reverse ( I think we could go on all night with alternatives!)
* [WRD]Nakilon
was just implementing "\" operator for befunge interpreter
Ortuna has joined #ruby
kofno has joined #ruby
<apeiros_>
stack[-2,2] = stack.last(2).reverse
<apeiros_>
I prefer Array#swap or ary[a],ary[b] = ary[b],ary[a], though
banister`shop has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
<apeiros_>
IMO more clear
razi has quit [Quit: Leaving.]
freerobby has quit [Client Quit]
syntaxritual has joined #ruby
jonathanwallace has quit [Ping timeout: 245 seconds]
greenarrow has joined #ruby
mercwithamouth has joined #ruby
nfk has quit [Quit: yawn]
ybart has joined #ruby
<Spooner>
I like: stack = stack.shift(stack.size - 2).push(stack.pop).concat(stack)
<Spooner>
Couldn't be clearer.
<apeiros_>
job security device… :-)
Michael has joined #ruby
pinpin404 has quit [Quit: Screw you guys i'm going home ! KMP ! WeeChat 0.3.9.2]
<havenwood>
alfredpp: If you really want to fully understand the tool, I'd suggest chruby.
<alfredpp>
havenwood, OK
<havenwood>
alfredpp: But if you're going to run the install script, do read it. :)
<alfredpp>
havenwood, What is the difference between RVM and chruby?
slainer68 has quit [Ping timeout: 252 seconds]
<havenwood>
alfredpp: The difference between chruby and rbenv is easier to answer.
<alfredpp>
havenwood, both are tools to install ruby no? then why different methods?
<postmodern>
alfredpp, rbenv uses ruby-build and chruby can use ruby-build or ruby-install
<bnagy>
well technically speaking rbenv doesn't use ruby-build
<bnagy>
it _can_
philcrissman has quit [Remote host closed the connection]
<havenwood>
alfredpp: RVM handles many things, like installing, selecting, managing gemsets. Whilst chruby does one thing, select the current Ruby.
<bnagy>
I use it with hand compiled stuff, mainly
<postmodern>
bnagy, correct, ruby-build actually plugins into rbenv
<bnagy>
cause there wasn't ruby-build for jruby-head at the time
<havenwood>
bnagy: Have you taken a look at chruby? Uses env vars instead of shims.
<bnagy>
yeah I looked, it's clean
JoseeAntonioR has left #ruby ["Leaving"]
<bnagy>
but rbenv is pretty clean too, and shims are also fine as an approach
<bnagy>
so it would just be make-work to migrate my stuff
<alfredpp>
havenwood, so what you are saying is, rvm does everything at once while chruby we need to do that all
<alfredpp>
one by one
<havenwood>
alfredpp: Kinda. The Unix philosophy is to do one thing, and do it well. So ruby-install to install Ruby and chruby to change the selected Ruhy.
philcrissman has joined #ruby
<havenwood>
alfredpp: Mix and match with tools that play nice.
<bnagy>
does rvm still require a system ruby to bootstrap?
<havenwood>
bnagy: Nope.
<havenwood>
bnagy: RVM 2.0 may.
<postmodern>
yeah RVM 2.0 is part bash and part ruby
<alfredpp>
havenwood, I am running the rvm script now
<r0bglees0n>
RVM 2.0 seems nuts
<postmodern>
less nuts than writing all that complex code in bash
<r0bglees0n>
doesn't it install a package manager(homebrew) for you, and use that to install packages?
<r0bglees0n>
yeah, but the nuts is how complex it has become
<postmodern>
r0bglees0n, yep just like ruby-install
<postmodern>
r0bglees0n, i prefer that method instead of downloading openssl.tar.gz and compiling that somewhere
<r0bglees0n>
i dont see the benefit in doing all that. if i need packages i can source them myself(maybe package manager, maybe not).
<bnagy>
amen to that
<bnagy>
because I really want my scripting language messing with my OS package management, rite? :<
<r0bglees0n>
postmodern: id prefer to see "openssl X.XX is missing."
<r0bglees0n>
instead of a bunch of missing heads
<r0bglees0n>
headers*
<postmodern>
r0bglees0n, yeah just let ./configure catch it
<r0bglees0n>
but if RVM can do all that crazy, im sure it can pull that message off
<postmodern>
r0bglees0n, however all the libraries are required for cexts, so it will compile ruby without ssl support
<alfredpp>
havenwood, postmodern ,bnagy, why don't create an installer package for ruby?
Hanmac has joined #ruby
<bnagy>
no ssl should break gem
<bnagy>
alfredpp: postmodern did
wallerdev has quit [Quit: wallerdev]
<alfredpp>
bnagy, and?
<postmodern>
alfredpp, too many new versions of ruby to create packages for each one
<r0bglees0n>
rubinius has prebuilt binaries of rbx & llvm itself
<r0bglees0n>
llvm one being very handy
<alfredpp>
postmodern, can't we create a package that automatically installs the latest of them? Pardon me since I am newbie to Ruby as well as linux
DomKM has quit [Quit: Leaving.]
<bnagy>
alfredpp: the problem is that there are at least four 'mainstream' interpreters
<r0bglees0n>
yeah, so i'd need to update ruby-install to get new aliases.
<postmodern>
r0bglees0n, yep, but you can override them
ivanoats has joined #ruby
<r0bglees0n>
thats true, i wish it was magically automatic >_>
<postmodern>
r0bglees0n, automagic is hard :)
ehaliewicz has joined #ruby
<r0bglees0n>
postmodern: so now that you have these two tools(chruby+ruby-install), you've replaced both rbenv & ruby-build :p
<postmodern>
r0bglees0n, everything goes according to play :)
kofno has quit [Ping timeout: 248 seconds]
<postmodern>
r0bglees0n, yeah the hardcoded versions and no package manager integration caused me to write ruby-install
<r0bglees0n>
yeah, more tools the better
<r0bglees0n>
i think you would have met some resistence on the hardcoded versions
<r0bglees0n>
if you just did a PR
kofno has joined #ruby
<r0bglees0n>
and probably package managers too
<postmodern>
r0bglees0n, but it takes a couple weeks for someone to accept the PR into ruby-build
<postmodern>
r0bglees0n, would be nice if MRI etc just rolled their own .debs and .rpms
ivanoats has quit [Ping timeout: 248 seconds]
<postmodern>
r0bglees0n, and that rubygems defaulted to --user-install
<r0bglees0n>
totally
freerobby has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
<r0bglees0n>
prebuilt packages would make life so much easier for newbies and windows users
<r0bglees0n>
getting my brother setup with ruby on windows was tough because of his inexperience with programming and computers, so I ended up setting up jruby + rubymine, which is like one environment he could get stuff done.
<postmodern>
half the reason we install rubies, is so they are in /home/ and writtable by users
<r0bglees0n>
no switching between writing+running the file
<r0bglees0n>
which apparently is confusing with ruby files
<postmodern>
if rubygems finally switched to --user-install, this would reduce the need to install a custom version
danneu has quit [Quit: Leaving.]
<r0bglees0n>
yeah
<r0bglees0n>
seems like you coulv solve that problem with information as well
<r0bglees0n>
just tell people to put it in .gemrc :)
<postmodern>
and also put ~/.gem/.../bin in their $PATH
Dummies_freelanc has quit [Quit: Leaving.]
<r0bglees0n>
there's going to be people who hate that
<r0bglees0n>
but i think those are better defaults
diadara has joined #ruby
<r0bglees0n>
there's people who like to roll without any kind of rbenv/ruby-build
<postmodern>
i think a couple distros already support $HOME/bin
<r0bglees0n>
im not sure what zenspider uses
<postmodern>
yeah i do that for servers
<postmodern>
install into /usr/local
freerobby has quit [Ping timeout: 252 seconds]
diadara has quit [Client Quit]
yshh has joined #ruby
<r0bglees0n>
for development, ~ makes total sense, but on a server you'd need to undo the defaults because it wouldn't make as much sense
<r0bglees0n>
i use /opt
<r0bglees0n>
well, it'd just mean whoever runs bundler installs to ~
<r0bglees0n>
i could live with that
v0n has joined #ruby
<r0bglees0n>
has anyone used webmachine to render sinatra-like or rails-like views?
<Quadlex>
dward: Something::Somethingelse --> Somethingelse is defined inside Something
<Quadlex>
::Something --> Something is defined at the root level
Iszak has joined #ruby
<RomainT>
Does someone know if tools like Virtus are usable with ActiveRecord (i want to have a declarative list of fields my model has) ?
Speed has joined #ruby
mikewintermute has joined #ruby
takeru has joined #ruby
zen79 is now known as fritz79
lkba has quit [Ping timeout: 246 seconds]
fritz79 has quit [Quit: fritz79]
jbpros has quit [Quit: jbpros]
fritz79 has joined #ruby
Bry8Star{T2 has joined #ruby
mklappstuhl has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
jbpros has joined #ruby
mikewintermute has quit [Quit: mikewintermute]
danslo has joined #ruby
nari has joined #ruby
mklappstuhl has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
jbpros has quit [Quit: jbpros]
ivanoats has joined #ruby
end_guy has quit [Ping timeout: 240 seconds]
robscomputer has joined #ruby
end_guy has joined #ruby
ntus1017 has quit [Remote host closed the connection]
fritz79 has left #ruby [#ruby]
fritz79 has joined #ruby
robscomputer has quit [Ping timeout: 246 seconds]
freerobby has joined #ruby
ivanoats has quit [Ping timeout: 264 seconds]
srji has joined #ruby
harrymoreno_ has joined #ruby
harrymoreno has quit [Ping timeout: 246 seconds]
harrymoreno_ is now known as harrymoreno
eldariof has quit [Ping timeout: 248 seconds]
freerobby has quit [Ping timeout: 252 seconds]
Criztian has joined #ruby
Leighton has joined #ruby
vlad_sta_ has quit [Remote host closed the connection]
jimg has joined #ruby
vlad_starkov has joined #ruby
mklappstuhl has joined #ruby
spider-mario has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
Criztian has quit [Remote host closed the connection]
workmad3 has joined #ruby
Shirakawasuna has quit [Ping timeout: 256 seconds]
jimg has quit [Ping timeout: 246 seconds]
slainer68 has joined #ruby
mklappstuhl has joined #ruby
slainer68 has quit [Read error: Connection reset by peer]
dash_ has quit [Quit: Time to beer :)]
jds_ has quit [Ping timeout: 276 seconds]
spider-mario has quit [Remote host closed the connection]
m8 has joined #ruby
hamed_r has quit [Quit: Leaving]
spider-mario has joined #ruby
fritz79 has left #ruby [#ruby]
mklappstuhl has quit [Ping timeout: 256 seconds]
mklappstuhl has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
kote has joined #ruby
zmike has quit [Quit: Выходжу]
icole has joined #ruby
senayar has joined #ruby
incorvia has joined #ruby
fritz79_ has joined #ruby
icole has quit [Ping timeout: 248 seconds]
becom33 has joined #ruby
becom33 has joined #ruby
mklappstuhl has joined #ruby
thesheff17 has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
<becom33>
http://pastebin.com/HZwPzM0y I'm looking a way to search from the :id . if I is match I want the values of :id. :name, :age from that :id value
obs has joined #ruby
<bnagy>
that's going to be pretty inefficient
atmosx has joined #ruby
<bnagy>
like whatever.values.flatten.select {|s| s[:id} == whatever } ...
<becom33>
bnagy, hmm u think ?
<atmosx>
hi
<becom33>
wait lemme try that
alexmreis has joined #ruby
mklappstuhl has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
<g3orge>
what's the best way to manage gems? not for dependencies to an application. locally for libs and executables.. because everytime ruby gets updated I need to reinstall everything...
ronny has left #ruby ["WeeChat 0.3.9.2"]
beilabs has joined #ruby
daniel_-_ has joined #ruby
ephemerian has joined #ruby
adambeynon has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
bashdy has quit [Quit: bashdy]
k610 has joined #ruby
<joshu>
how do you deal with "abort" when using mintiest?
<apeiros>
stub it
<joshu>
apeiros hey ;) "stub it"?
ArchBeOS has joined #ruby
ArchBeOS has quit [Changing host]
ArchBeOS has joined #ruby
<g3orge>
nobody?
<apeiros>
google "test double", "stubbing" and "mocking"
jjbohn has joined #ruby
ivanoats has joined #ruby
<havenwood>
g3orge: Do you use RVM, chruby, rbenv or manage them yourself?
k610 has quit [Ping timeout: 245 seconds]
<havenwood>
g3orge: RVM has a command for it. With the others I think just copy em over maintain a little script that installs a list of the gems you want.
DomKM has joined #ruby
<joshu>
apeiros ok I've done that. What I guess I'm asking is that I have a single test_class.rb which contains my 5 method tests. I'm not testing everything just the important methods which send emails. So One of those methods in my class has an abort and when I run my tests the rest of them don't run when it reaches the method with the abort code.
arubin has joined #ruby
robscomputer has joined #ruby
<havenwood>
g3orge: Oops, meant to say copy em over OR maintain a script.
robscomputer has quit [Remote host closed the connection]
ivanoats has quit [Ping timeout: 264 seconds]
Michae___ has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
robscomputer has joined #ruby
<apeiros>
joshu: yes, that's what you stub the abort method
<havenwood>
g3orge: GEM_HOME, GEM_PATH, GEM_ROOT are prolly the env vars you'd want to look at. E.g.: echo $GEM_HOME
<g3orge>
havenwood: I manage them myself
<apeiros>
or rather, in your case actually you'd mock it. so it doesn't abort, but you can verify that abort was called.
alexandernst_ has joined #ruby
<g3orge>
havenwood: I just install with gem install and I update ruby regularly. I don't care about older version, but i don't want to install everything all over again to the correct 1.x.x folder ...
<r0bglees0n>
joshu: look at minitest/mock
<joshu>
apeiros I don't understand. I should mock the abort in my test_class.rb file? in the particular test_method ?
jimg has joined #ruby
<joshu>
r0bglees0n yeah on the site now but unsure
<g3orge>
havenwood: I don't have any of those set
<apeiros>
joshu: wherever you call a method which invokes abort
Neomex has joined #ruby
<apeiros>
I suggest you google the terms so you understand what it does
<g3orge>
are those control the install location of `gem install` ??
<havenwood>
g3orge: GEM_HOME is the default repository location for gem installation.
<havenwood>
g3orge: GEM_PATH is a colon-separated list of gem repository directories.
<r0bglees0n>
joshu: should the test be calling abort on a pass?
lkba has quit [Ping timeout: 248 seconds]
<havenwood>
g3orge: Maybe take a look at chruby, even if you don't want to use it it is an example of setting the env vars correctly: https://github.com/postmodern/chruby#readme
<g3orge>
havenwood: so if I don't have them set, libs and exec get installed into .gem/ ??
<r0bglees0n>
joshu: i wouldn't think it should if you're following a green path
<alexandernst_>
I'm looking for a way to have an infinite loop in C extension and call it from Ruby without blocking (aka return as soon as the method gets called) without using threads. Is there a way for doing it?
<g3orge>
havenwood: thanks.. any docs about those env-vars available?
<alexandernst_>
r0bglees0n: no, the requisite is to be non-blocking at all. Maybe a loop is not what I should be looking for in the first place. I'm getting data via msgrcv (linux IPC) and I need to call msgrcv constantly, but maybe if I could integrate it with Ruby's event loop instead of doing an infinite loop?
kote_ has quit [Remote host closed the connection]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
<g3orge>
havenwood: do you suggest rbenv for my case? or is it's just for changing rubies?
madb055 has quit [Ping timeout: 260 seconds]
<havenwood>
g3orge: rbenv uses shims instead of changing env vars, just a different way of managing
<havenwood>
g3orge: I prefer chruby personally, up to your preference
madb055 has joined #ruby
razieliyo has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mercwithamouth has joined #ruby
harrymoreno_ has joined #ruby
<r0bglees0n>
alexandernst_: i would read from the loop, push to a queue, and read from another thread, process there, i can't think of how to do it without threads of subprocesses.
mixel has quit [Quit: mixel]
harrymoreno has quit [Ping timeout: 264 seconds]
harrymoreno_ is now known as harrymoreno
<r0bglees0n>
or*
gyre007 has joined #ruby
<alexandernst_>
r0bglees0n: :( I was teached that threads are really really *really* the last resort for everything (generally speaking), so I'd like to avoid creating a thread for the loop (thou I know it's safe enough and easy)
<r0bglees0n>
joshu: so you're processing an unknown mail type for that to happen.is that suppose to happen? i cant help you if you dont even know if thats desired or not
<r0bglees0n>
alexandernst_: two threads is not that much
<r0bglees0n>
alexandernst_: just use a thread safe queue (ruby has one)
<jost>
Why does ruby always use other method names than the established ones? Why is it "strip!" instead of "trim!"?
arya_ has joined #ruby
<joshu>
r0bglees0n ok correct my script handles 4 specific emails. Anything that doesn't match those 4 is "processed" or "unknown" and the script aborts sending the "offending" email to faxmaster
<r0bglees0n>
established by who?
RomainT has joined #ruby
<jost>
by every other language I know. In Java, php and some more languages trimming a string is done by trim().
<rippa>
in python it's strip()
<r0bglees0n>
name 'some more languages'
arya has quit [Ping timeout: 248 seconds]
jjbohn has quit [Quit: Leaving...]
RomainT has quit [Ping timeout: 264 seconds]
<jost>
Only some: JavaScript, VBA, Pascal, Scheme, C#, SQL
cj3kim has quit [Remote host closed the connection]
<jost>
Don't want to start a flame war, was just pissed of for a moment that .trim! does not work :-)
<alexandernst_>
r0bglees0n: no, it isn't. But that's not the point. The point that threads should be avoided (or I was teached that way) if there's another way of doing the same in only 1 thread. For example, what I'm trying to do could be easily achieved in 1 thread with some kind of event loop integration between the extension and Ruby. Something that could call the do_msgrcv on each event-loop tick.
monkegjinni has joined #ruby
Guest3227 has quit [Quit: ばいばい]
rouss has joined #ruby
Neomex has quit [Quit: Neomex]
Xeago has quit [Remote host closed the connection]
<r0bglees0n>
what event loop
<r0bglees0n>
does it even exist
<r0bglees0n>
use eventmachine if you want a reactor loop
<joshu>
r0bglees0n do you understand what's happening with my code now?
chile_andes has joined #ruby
jonathanwallace has quit [Ping timeout: 252 seconds]
<|RicharD|>
i don't know how i can update a row after a select
<|RicharD|>
i looked into docs, but not found nothing of useful
<feniix>
hello I have this https://gist.github.com/anonymous/5694109 is there a way to iterate that but also the value to the left of each item? I want to be able to print the value and the description
<feniix>
forgive my newbieness :D
dmiller has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
<MrZYX>
feniix: google ruby hashes, then have a look at Hash#each in the docs
robscomputer has quit [Remote host closed the connection]
robscomputer has joined #ruby
robscomputer has quit [Remote host closed the connection]
daniel_-_ has joined #ruby
cj3kim has quit [Remote host closed the connection]
jds_ has joined #ruby
bigmac has joined #ruby
ivanoats has quit [Ping timeout: 245 seconds]
g3orge has quit [Quit: leaving]
nowthatsamatt has left #ruby [#ruby]
jasonkuhrt has quit [Quit: Leaving...]
robscomputer has joined #ruby
ntus1017 has joined #ruby
lucianosousa has quit [Quit: lucianosousa]
moos3 has joined #ruby
hogeo has joined #ruby
deception has joined #ruby
Destiny has quit [Quit: Leaving]
urbanmonk has quit [Quit: urbanmonk]
DomKM1 has joined #ruby
DomKM has quit [Read error: Connection reset by peer]
hogeo_ has quit [Ping timeout: 248 seconds]
cj3kim has joined #ruby
Galaxor has joined #ruby
<ShapeShifter499>
hi
kobain has joined #ruby
<ShapeShifter499>
can someone please suggest some free material that I can use to fully learn how to use ruby for a non-programmer?
madnificent has joined #ruby
<ShapeShifter499>
I am to learn ruby without spending a cent on books
<MrZYX>
what about online courses? :P
<MrZYX>
scnr
Nanuq has joined #ruby
<ShapeShifter499>
MrZYX, just to let you know I have a non-existent budget
<ShapeShifter499>
MrZYX, are there free courses?
<MrZYX>
I'm sure but I can't say anything about their quality
<madnificent>
with rmagick, is there any way to ensure the files have been converted and written to disk? i further process them, but i seem to be operating on the older files.
moos3 has quit [Quit: Computer has gone to sleep.]
altamic has joined #ruby
robscomputer has quit [Ping timeout: 264 seconds]
altamic has left #ruby [#ruby]
robscomputer has joined #ruby
senayar has quit [Ping timeout: 240 seconds]
<Xeago_>
madnificent: write them to disk and see if the file exists?
sambao21 has quit [Quit: Computer has gone to sleep.]
<ShapeShifter499>
MrZYX, what no learncodetheeasyway?
<ShapeShifter499>
lol
idoru has joined #ruby
<MrZYX>
I didn't try the ruby version but I can recommend the style
<Xeago_>
madnificent: e.g. abcdef123456.jpg => abcdef123456.orig.jpg + abcdef123456.100x100.jpeg
<madnificent>
Xeago_: that's somewhat complex. the file is created by Carrierwave. what I'm doing is allowing the user to manipulate the image (rotate) and i want the thumbnails to be generated correctly after that. however, the filename should stay the same for CarrierWave
<ShapeShifter499>
MrZYX, I'll check that one out
chile_andes has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<madnificent>
Xeago_: if not for that, your suggestion is sane (well, and the fact that the creation of the file doesn't ensure that the data has been written into it already)
jds_ has quit [Remote host closed the connection]
<ShapeShifter499>
MrZYX, I've tried tryruby.org the site kept failing to complete tasks making me have to reload challenges
dmiller has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 256 seconds]
bigmac has quit [Ping timeout: 246 seconds]
Ortuna has joined #ruby
<Xeago_>
madnificent: you can do blocking writes, depending on your filesystem reads after the last write operation being returned should be consistent
<havenwood>
ShapeShifter499: If you sign up at with CodeSchool it will save your spot.
RomainT has joined #ruby
nezumi has quit [Read error: Operation timed out]
<ShapeShifter499>
havenwood, oh I didn't know that
<ShapeShifter499>
havenwood, thank you for the tip
<madnificent>
Xeago_: now how to convince rmagick that that is a good thing to have :)
alexwh has joined #ruby
johnkary has quit [Quit: @johnkary]
mercwithamouth has joined #ruby
gluma83 has quit [Ping timeout: 248 seconds]
RomainT has quit [Ping timeout: 264 seconds]
<Xeago_>
also, I discourage rmagick, it leaks..
Naeblis|XChat has joined #ruby
<Xeago_>
not sure if there is a suitable alternative
<MrZYX>
mini_magick and carrierwave play pretty well together
<supaiku>
are there any downsides when casting a string (like "Hello World!") to a symbol except that it looks ugly? (:"Hello World!")
altivec has quit [Quit: Computer has gone to sleep.]
<Xeago_>
supaiku: permanent memory allocation
nomenkun has quit [Remote host closed the connection]
<MrZYX>
the Symbol will never get garbage collected, but the question is why you think you need that
<|RicharD|>
ShapeShifter499: try to contact author of some ruby book and ask a free copy
<madnificent>
MrZYX: i'm not convinced it wouldn't have the same issue i have now. but yes rmagick can apparently leak memory. not my main concern at the moment :)
senayar has joined #ruby
<ShapeShifter499>
|RicharD|, have you gotten a book that way?
<Xeago_>
I've gotten a c++ book that way
<|RicharD|>
no because i don't asked
<MrZYX>
mini_magick is no binding but a wrapper around the shell commands, so it naturally writes everything to disk all the time
altivec has joined #ruby
<|RicharD|>
i have a job and i live in a places not poor
<supaiku>
well, i use names as hash keys and some names unfortunately have a space... guess then I make up something else
<|RicharD|>
but i think that if you ask, they give it...
sayan has quit [Ping timeout: 246 seconds]
bradhe has joined #ruby
<MrZYX>
supaiku: hash has no problem with taking strings as keys
<Xeago_>
supaiku: never ever let user input turn into symbols
<|RicharD|>
also because there is also p2p…so i think that if you explain your situation, their know your need and give you
<|RicharD|>
i think that culture is over money
<ShapeShifter499>
Xeago_, |RicharD| I guess it couldn't hurt to try, I'd feel better about it over using some shady online method to get book content
phipes has joined #ruby
<|RicharD|>
exact… i think that they will appreciate it
<|RicharD|>
and give your a free book copy
<|RicharD|>
but remember(maybe i will banned for say this): don't stop for money
<|RicharD|>
if you want learn
<|RicharD|>
do it
<|RicharD|>
for your fortune there is many free books etc...
<supaiku>
Xeago_: ofc those names are handled by me no user interaction here. but i always assumed symbols would be better as keys because they always stay the "same" in memory
<heftig>
they are better, but only if you don't have to use to_sym
niklasb has quit [Read error: No route to host]
<MrZYX>
>> a = "Hello World"; b = a.dup; [a.hash == b.hash, a.object_id == b.object_id]
<|RicharD|>
when i learned at my times there aren't stack overflow etc… and linux isn't so evaluated and easy like now(ubuntu etc…) so you must used windows and if you don't had money, you can do only one thing…and i don't deny it…thanks to p2p i have learned , studied and make money…and NOW i buy ALL!
<atmosx>
|RicharD|: yeah I got it now, did you try return the value of :question to make sure it actually exists?
<|RicharD|>
now
<|RicharD|>
i check if the string
<|RicharD|>
have a [FIGURA something_variable]
<|RicharD|>
if yes it must remove it and update the row
leonid_ has quit [Ping timeout: 246 seconds]
<atmosx>
MrZYX: https://gist.github.com/atmosx/5694272 <-- any idea why if i call methods through case statement don't work but if I call them out of it work fine? … same error on rb1.9/2.0
kenneth has joined #ruby
spider-mario has joined #ruby
pitzips has quit [Ping timeout: 276 seconds]
lkba has joined #ruby
jeka-91 has quit [Ping timeout: 245 seconds]
mikepack has quit [Remote host closed the connection]
jetblack has joined #ruby
<MrZYX>
hm, no makes no sense to me
<atmosx>
MrZYX: ok thanks
timkohrumel has joined #ruby
<atmosx>
|RicharD|: you get no error, just the conversion never happens?
Ortuna has quit [Quit: Computer has gone to sleep.]
<|RicharD|>
atmosx: exact
<atmosx>
add some puts
yashshah_ has joined #ruby
<MrZYX>
atmosx: hm I get the same error outside the case
ArchBeOS has quit [Remote host closed the connection]
tanob has joined #ruby
RomainT has quit [Ping timeout: 252 seconds]
sqa_bm has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Ping timeout: 246 seconds]
nezumi has joined #ruby
<tanob>
hey, I have a class that implements to_json, it builds a hash and returns the result of #to_json on it. Problem is when I have a list of instances of that object, the result of #to_json in the array is producing a double encoded string, what's the issue?
timkohrumel has quit [Remote host closed the connection]
takeru has quit [Remote host closed the connection]
jinie_ is now known as jinie
brianstorti has left #ruby [#ruby]
brianstorti has joined #ruby
takeru has joined #ruby
ariedler has joined #ruby
incorvia_ has quit [Remote host closed the connection]
incorvia has joined #ruby
_cheney4 has joined #ruby
jinie has quit [Client Quit]
Michae___ has quit [Remote host closed the connection]
dmiller has joined #ruby
druonysus has joined #ruby
druonysus has joined #ruby
druonysus has quit [Changing host]
phipes has quit [Quit: phipes]
altamic has joined #ruby
altamic has quit [Client Quit]
harrymoreno_ has joined #ruby
takeru has quit [Ping timeout: 246 seconds]
sqa_bm has joined #ruby
harrymoreno has quit [Ping timeout: 276 seconds]
harrymoreno_ is now known as harrymoreno
<MrZYX>
tanob: implement as_json, not to_json and return something that should be called #to_json on, i.e. your hash without calling .to_json on it on your own
butblack has left #ruby [#ruby]
jimg has joined #ruby
agjacome has quit [Quit: leaving]
AndChat| has quit [Ping timeout: 252 seconds]
Banistergalaxy has joined #ruby
Ortuna has joined #ruby
awc737 has quit [Ping timeout: 240 seconds]
jimg has quit [Ping timeout: 246 seconds]
phipes has joined #ruby
jjbohn has quit [Quit: Leaving...]
timkohrumel has joined #ruby
dmiller has quit [Ping timeout: 245 seconds]
jinie has joined #ruby
jinie has quit [Remote host closed the connection]
Myconix has quit [Quit: Server Error 482: The server has been shot by a 12-gauge, please contact an administrator]
skattyadz has joined #ruby
jds_ has joined #ruby
yashshah_ has quit [Read error: Connection reset by peer]
paulswilliamsesq has joined #ruby
LyonJT has joined #ruby
teclator has joined #ruby
jds_ has quit [Ping timeout: 246 seconds]
IceDragon has joined #ruby
ehaliewicz has joined #ruby
viszu has quit [Quit: Leaving.]
druonysuse has joined #ruby
yashshah has joined #ruby
viszu has joined #ruby
h8R has quit [Ping timeout: 256 seconds]
druonysus has quit [Ping timeout: 245 seconds]
k610 has joined #ruby
<banister`canal>
havenwood: weird, he uses a separate ace editor for each input
<banister`canal>
havenwood: i dont know how heavy that is, but it feels heavy :P also try this
<banister`canal>
x = 10
<banister`canal>
x
<banister`canal>
the x is unavailable in the next line
<havenwood>
>.>
<banister`canal>
cos he creates a separate session for each invocation
RomainT has joined #ruby
<|RicharD|>
someone with experience with sequel ?
RomainT has quit [Client Quit]
ivanoats has joined #ruby
<havenwood>
ha, hadn't tried it yet, was looking at the repo - well that isn't very useful then
<banister`canal>
havenwood: he carries across method definitions though
<havenwood>
banister`canal: hmm
<banister`canal>
havenwood: ivars carry across too
<banister`canal>
so maybe it's just a binding issue
<banister`canal>
Binding*
jjbohn has joined #ruby
Kricir has joined #ruby
kidoz has quit [Read error: Operation timed out]
Michael__ has quit [Remote host closed the connection]
pkrnj has quit [Ping timeout: 245 seconds]
h8R has joined #ruby
echevemaster has joined #ruby
echevemaster has joined #ruby
echevemaster has quit [Changing host]
Michael__ has joined #ruby
IceDragon has quit [Ping timeout: 256 seconds]
dhruvasagar has joined #ruby
IceDragon has joined #ruby
kenneth has quit [Quit: kenneth]
<|RicharD|>
how i can fix the problem of insert a string with ' o " into db mysql ? i have problem because when i do: con.query("") or con.query('') often the string break the query
<|RicharD|>
orm fix it automaticaly
timkohrumel has quit [Remote host closed the connection]
krainboltgreene has quit [Quit: krainboltgreene]
madb055 has quit [Ping timeout: 248 seconds]
DonRichie has joined #ruby
sqa_bm has quit [Remote host closed the connection]
sqa_bm has joined #ruby
LyonJT has quit [Remote host closed the connection]
butblack has joined #ruby
jbpros has joined #ruby
csaunders has joined #ruby
ivanoats has quit [Ping timeout: 256 seconds]
ephemerian has left #ruby [#ruby]
teclator has quit [Ping timeout: 252 seconds]
sqa_bm has quit [Ping timeout: 246 seconds]
h8R has quit [Ping timeout: 246 seconds]
senayar has quit [Ping timeout: 240 seconds]
butblack has quit [Quit: butblack]
statarb3 has quit [Quit: Leaving]
ty-mat has quit [Ping timeout: 264 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
Banistergalaxy has quit [Ping timeout: 256 seconds]
Proshot has quit [Remote host closed the connection]
supaiku has quit [Ping timeout: 256 seconds]
seitensei has joined #ruby
<apeiros>
|RicharD|: never use string interpolation with db queries. you're creating a vulnerability right there. google sql injection.
yacks has quit [Quit: Leaving]
lucianosousa has quit [Quit: lucianosousa]
<apeiros>
|RicharD|: that's what bind variables exist for. with sequel, you probably don't even need that
Guedes has quit [Ping timeout: 245 seconds]
Cmg__ has joined #ruby
Takehiro has quit [Remote host closed the connection]
alexmreis has quit [Quit: Leaving.]
m8 has quit [Ping timeout: 264 seconds]
robscomputer has joined #ruby
fwaokda has joined #ruby
slash_nick has joined #ruby
slash_nick has joined #ruby
bluehavana_ has joined #ruby
IcyDragon has joined #ruby
<fwaokda>
I have a dynamic substring that I want to remove, it begins and ends with a pattern ( "/usr/local/" & ".txt"). How can I remove this substring based on that information from my string?
IceDragon has quit [Ping timeout: 276 seconds]
vlad_sta_ has quit [Remote host closed the connection]
m8 has joined #ruby
ThePicard has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby
mikepack has quit [Remote host closed the connection]
<MrZYX>
remove? so you always want to end up with /usr/local/.txt ?
<joshu>
I'm going to leave the testing for now and focus on fixing other issues.
motto has quit [Ping timeout: 252 seconds]
poga_ has joined #ruby
Retistic has quit [Quit: Retistic]
poga has quit [Read error: Connection reset by peer]
Michael__ has joined #ruby
alienven1m has quit [Ping timeout: 256 seconds]
b0oh has quit [Quit: Leaving.]
vlad_starkov has joined #ruby
<joshu>
Regarding building a gem which will be an executable. How should I deal with logging? At the moment in development I log to a file, but how does that work when my script is a gem, e.g. log/myscript.log file won't be accessible right?
slash_nick has joined #ruby
slash_nick has quit [Changing host]
slash_nick has joined #ruby
<Xeago>
joshu: write to stderr
<Xeago>
that is usually done, and allow for configuring of debug levels
jjbohn has joined #ruby
<joshu>
so in my code Logger.new($stderr) ?
<heftig>
just Logger.new, i guess. i think stderr as output is already the default
<heftig>
never mind, it's not
<joshu>
Xeago ok so when my script is a gem when the executable is run logging will show in the console? As this script will be run without user intervention how would I configure logging to a file when it's run as a gem?
ehaliewicz has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
codecop has quit [Ping timeout: 276 seconds]
<apeiros>
$stderr default, -l/--log FILE option for those who can't do `2> FILE`
LaPetiteFromage has joined #ruby
Jackneill has quit [Ping timeout: 276 seconds]
philcrissman has joined #ruby
ivanoats has quit [Remote host closed the connection]
Kricir has joined #ruby
sqa_bm has joined #ruby
<joshu>
apeiros so the first option -l/ --log FILE would require opt parse or similar…whereas `2> FILE` would just require executing the binary like this myscript 2> LOG_FILE
timonv has quit [Remote host closed the connection]
pskosinski has quit [Remote host closed the connection]
<MrZYX>
can we not call it a binary please? :P
becom33 has joined #ruby
becom33 has joined #ruby
<apeiros>
yupp. if you're the sole use of the tool, I'd probably not do -l/--log and just use stderr redirection
vlad_starkov has quit [Ping timeout: 276 seconds]
pskosinski has joined #ruby
jjbohn has quit [Ping timeout: 256 seconds]
Jalada has joined #ruby
motto has joined #ruby
m8 has quit [Ping timeout: 260 seconds]
rippa has quit [Ping timeout: 240 seconds]
mikepack_ has joined #ruby
sqa_bm has quit [Ping timeout: 256 seconds]
Elico has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
aspiers has joined #ruby
<Elico>
hey i'm looking to ues Net::Ping binding specific interface on my machine. can it be done?
Kricir has quit [Ping timeout: 246 seconds]
Ortuna has quit [Quit: Computer has gone to sleep.]
codecop has joined #ruby
senayar has joined #ruby
ariedler has quit [Remote host closed the connection]
Ortuna has joined #ruby
andikr has quit [Remote host closed the connection]
Guedes has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
<joshu>
MrZYX executable better?
<MrZYX>
hm, a little bit :P
alexmreis has joined #ruby
m_3 has joined #ruby
<joshu>
apeiros but when you helped me with my code bin/ffm and added a FFM.config do |ffm| block you had ffm.logger = Logger.new('log/ffm.log')
rangle has joined #ruby
<joshu>
apeiros then in lib/ffm.rb class << self alias tap config end @logger = Logger.new($stderr)
Neomex has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
m8 has joined #ruby
<matti>
joshu: ;]
<matti>
Mon_Ouie: ;]
johnkary has quit [Quit: @johnkary]
<joshu>
apeiros as I'm going to make this a gem as you've explained earlier. Is the bin/ffm config block irrelevant code?
<joshu>
matti jendobre kollega ;)
<matti>
joshu: Dobry, dobry.
thomaslee has quit [Remote host closed the connection]
<joshu>
matti you not bored today matti :P
Ortuna has quit [Client Quit]
<matti>
I am always bored.
motto has quit [Ping timeout: 276 seconds]
m_3 has quit [Remote host closed the connection]
bothra has quit [Read error: Connection reset by peer]
<atmosx>
Guys, in TCPServer and TCPSocket session.read and session.gets are teh same thing?
<Mon_Ouie>
'alut matti :)
bothra has joined #ruby
eldariof has quit [Ping timeout: 252 seconds]
razi has quit [Ping timeout: 245 seconds]
<matti>
Mon_Ouie: How's tricks?
m_3 has joined #ruby
<Mon_Ouie>
atmosx: #read reads the whole thing, until EOF; #gets reads a single line.
<atmosx>
Mon_Ouie: thanks
cyong has joined #ruby
<atmosx>
so I'll use read in teh object transfer, although...
<Mon_Ouie>
Fine. Exams starting on Tuesday
<atmosx>
hmm still I don't see how they are suppoesed to be used since data is serialized
<atmosx>
Mon_Ouie: exams? where you at?
Neomex has quit [Client Quit]
* atmosx
exams already started
<Mon_Ouie>
I'm in Belgium
<atmosx>
I'm in Czech Republic
<atmosx>
okay, good luck with your exams :-P
<Elico>
Good LUCK
<Mon_Ouie>
Same to you ;)
atno has quit [Remote host closed the connection]
<matti>
Mon_Ouie: Good luck!
<atmosx>
hah
<matti>
To you too atmosx
<atmosx>
thanls :-)
<atmosx>
ops thsnks
<atmosx>
asdlkfjal;sdkfjl;adskjfa
<atmosx>
thanks :-P
Ortuna has joined #ruby
jost has quit [Quit: jost]
incorvia has quit [Remote host closed the connection]
banister`canal has joined #ruby
workmad3 has joined #ruby
<Elico>
anyone?? about the Net::Ping thing I asked? maybe you have a clue?
timkohrumel has quit [Remote host closed the connection]
atno has joined #ruby
m8 has quit [Ping timeout: 246 seconds]
Guest59568 has quit [Quit: p33 ba115]
taqutor has joined #ruby
alexmreis has quit [Quit: Leaving.]
alexmreis has joined #ruby
cmgamer has joined #ruby
cmgamer has quit [Client Quit]
darthdeu has joined #ruby
Alina-malina has quit [Quit: Leaving]
Cmg__ has quit [Ping timeout: 276 seconds]
Alina-malina has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
<|RicharD|>
any alternative to sequel ?
<warlock>
Ok, noob here. If I define a method, is there a way to prototype it so I can write my main code before defining it?
iamjarvo has joined #ruby
codecop has quit [Ping timeout: 260 seconds]
darthdeus has quit [Ping timeout: 264 seconds]
razi has joined #ruby
iamjarvo has quit [Client Quit]
splittingred has joined #ruby
leonid_ has joined #ruby
momomomomo has joined #ruby
razi1 has joined #ruby
razi has quit [Read error: Connection reset by peer]
<atmosx>
|RicharD|: datamapper
<atmosx>
|RicharD|: but sequel is the stat-of-art
<|RicharD|>
i know
<atmosx>
|RicharD|: and of course if you're dealing with RoR ActiveRecord
mercwithamouth has quit [Ping timeout: 246 seconds]
<|RicharD|>
never used stack overflow but yes i will try it !
<|RicharD|>
only that i have few hours/day
m8 has joined #ruby
<|RicharD|>
and this is a internal script
<|RicharD|>
for a little task
paulswilliamsesq has quit [Remote host closed the connection]
<|RicharD|>
not a thing for users...
<atmosx>
|RicharD|: I like datamapper better over sequel's
slash_nick has quit [Ping timeout: 260 seconds]
<atmosx>
|RicharD|: but apparently sequel's code base is better, more polished etc. Try out datamapper anyway, they made a release a coupld of weeks before… (After 2 years or something)
<warlock>
atmosx: ok, then i'm doing something wrong... you just out the method name on a line to call it yes? I get the error "undefined local variable or method"
m8 has quit [Ping timeout: 252 seconds]
<warlock>
but i don't get that error if I try to call it after definition...
butblack has quit [Ping timeout: 256 seconds]
butblack_ is now known as butblack
<Mon_Ouie>
Then you didn't define it properly or you mistyped it somehow
<Mon_Ouie>
The order doesn't matter, it just has to be defined before it is called (and usually, by the time any method is run, everything has been defined already)
<atmosx>
warlock: show me the code
<warlock>
atmosx ok sure
<workmad3>
Mon_Ouie: unless you're writing something script-like, so your code execution is happening at the top level
<Mon_Ouie>
Yeah, then you'd need to wrap it in a method to swap the order
<warlock>
Total beginner here, just trying to write a simple menu method, no classes.
baroquebobcat has quit [Quit: baroquebobcat]
<atmosx>
Mon_Ouie: Can I serialize staff on the fly like: list = Marshal.dump(method(something))
<atmosx>
?
<atmosx>
I think i can (I should)
<Mon_Ouie>
Sure
<atmosx>
nice
Jaguarstrike has quit [Quit: Leaving]
<Mon_Ouie>
warlock: You do need to define display_menu before you call it.
butblack has left #ruby [#ruby]
<Mon_Ouie>
What we meant was, if you had another method that used display_menu, you could define it either before or after display_menu and it would work properly
<atmosx>
while warlock was asking things, I confused him with workmad3 … and I was like "I have the feeling this guy is asking strange things today :-p"
<warlock>
Mon_Ouie: Ok, so there's no way to prototype it before I define it, so I can use it beforehand?
<warlock>
atmosx: lol!
<Mon_Ouie>
well you could do something like def main; display_menu; end and call main at the end, that's not common practice though
<Mon_Ouie>
Notice method definition are regular expressions that need to be executed just like method calls, etc. — that's why the order matter in this case
jimg has joined #ruby
nezumi has joined #ruby
<warlock>
Mon_Ouie: Ok, so common practice is to define everything and then write the main code of the program?
Dummies_freelanc has joined #ruby
<MrZYX>
common practice is to properly structure your program into classes and modules
<Mon_Ouie>
Yes. Plus when programs start to get bigger, all the classes will be spread in a file for each of them and the main file in its own one
<MrZYX>
having a main file just doing require 'some_class'; SomeClass.new isn't bad IMO
banjara has joined #ruby
Axsuul has joined #ruby
<warlock>
Wow, ok.
m8 has joined #ruby
<Mon_Ouie>
Yes, that's what I usually do actually
ntus1017 has quit [Remote host closed the connection]
<warlock>
Then you could easily change or modify the class in a file without having to look through entire program for it.
<warlock>
Super good idea!
<r0bgleeson>
-_-
LaPetiteFromage has quit [Quit: LaPetiteFromage]
jimg has quit [Ping timeout: 276 seconds]
motto has quit [Ping timeout: 248 seconds]
Michael__ has quit [Remote host closed the connection]
mixel has quit [Quit: mixel]
vlad_starkov has joined #ruby
cortes has quit [Remote host closed the connection]
Michael__ has joined #ruby
jjbohn has joined #ruby
huoxito has joined #ruby
Kricir has joined #ruby
Michael__ has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 246 seconds]
splittingred has quit [Quit: splittingred]
Michael__ has joined #ruby
nignaztic has joined #ruby
poga_ has quit [Remote host closed the connection]
poga has joined #ruby
codecop has quit [Remote host closed the connection]
Ortuna has quit [Quit: Computer has gone to sleep.]
ariedler has joined #ruby
Kricir has quit [Ping timeout: 252 seconds]
choobie has quit [Ping timeout: 264 seconds]
nazty has quit [Ping timeout: 248 seconds]
jjbohn has quit [Ping timeout: 256 seconds]
jrajav has joined #ruby
Michael__ has quit [Ping timeout: 248 seconds]
daniel_-_ has quit [Quit: WeeChat 0.4.1]
brianstorti has quit [Quit: brianstorti]
ThePicard has joined #ruby
Ortuna has joined #ruby
druonysuse has quit [Quit: Konversation terminated!]
kil0byte has joined #ruby
nomenkun has joined #ruby
alexmreis has quit [Quit: Leaving.]
ivanoats has joined #ruby
drastic has joined #ruby
kote has quit [Remote host closed the connection]
jamesfung14 has joined #ruby
poga_ has joined #ruby
poga_ has quit [Remote host closed the connection]
banister`canal is now known as banister`shop
poga_ has joined #ruby
razi1 has quit [Quit: Leaving.]
banister`shop has quit [Remote host closed the connection]
<atmosx>
I'm trying to find the DNA sequence that produces a protein
Kar- has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
<epitron>
so you have the AA sequence
<epitron>
or do you only have the actual protein?
mogsy has quit [Read error: Connection reset by peer]
phipes has quit [Quit: phipes]
mogsy has joined #ruby
Kricir has joined #ruby
<atmosx>
I have the protein, which serves as a 'sample'.
<atmosx>
and the DNA in raw format. I translate several (hundreds or thousdans) sequences of DNA, turning them to AA trying to find a match
byprdct has joined #ruby
<atmosx>
once I found the match (must be 100% perfect in my case) I know from which part of the DNA that protein was produced
Opettaja has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Ping timeout: 260 seconds]
rickruby has quit [Remote host closed the connection]
leonid_ has quit [Ping timeout: 256 seconds]
<epitron>
ahhhhhh
<epitron>
interesting
Kricir has quit [Ping timeout: 276 seconds]
<epitron>
so this is for proteins that are made of multiple sub-units?
<epitron>
or i guess this works for solid proteins too
Guga_ has quit [Read error: Connection reset by peer]
Guga_ has joined #ruby
jjbohn has quit [Quit: Leaving...]
insel has joined #ruby
senayar has quit [Ping timeout: 240 seconds]
nuck has joined #ruby
mklappst_ has joined #ruby
NimeshNeema has quit [Ping timeout: 264 seconds]
<atmosx>
epitron: yes, proteins are made from sequences of amino-acids. The process of protein creation in Bacteria which have circular DNA, is really easy because slicing doesn't take place. So it's kinda straight-forward process. All you need is computer power, while in animal (human) cells the process in Helix-DNA is wayyyy more complicated.
ivanoats has quit [Remote host closed the connection]
m8 has quit [Read error: Connection reset by peer]
jimg has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
bitcycle has joined #ruby
hogeo_ has joined #ruby
r0bgleeson has quit [Ping timeout: 252 seconds]
Retistic has joined #ruby
jonathanwallace has quit [Ping timeout: 264 seconds]
hogeo has quit [Ping timeout: 256 seconds]
snearch has joined #ruby
k610 has quit [Ping timeout: 276 seconds]
tedwards_ has quit [Ping timeout: 256 seconds]
chrisseaton has joined #ruby
vlad_starkov has joined #ruby
yannis has quit [Quit: yannis]
mklappstuhl has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<epitron>
atmosx: oh, is it complex in humans because sections of coding DNA can be turned on and off by histones and other environmental influences?
<epitron>
i remember reading something recently about splicing
<chrisseaton>
Hello - @@ class variables: I don't quite get where they live. They're not instance variables in the class object, because you can access them from subclasses. So what are they? Where do they live and what is the lookup algorithm?
wmoxam has joined #ruby
bitcycle has quit [Remote host closed the connection]
<chrisseaton>
epitron: thanks for that - but it doesn't seem to mention class variables at all. Are you trying to say that they live in the class's singleton class? That doesn't explain how a subclass can see them.
eka has joined #ruby
Mekkis has joined #ruby
pkrnj has joined #ruby
sepp2k has quit [Quit: Leaving.]
<epitron>
i think class @instance variables live on the singleton
<epitron>
class variables live on the class
jonathanwallace has joined #ruby
Kricir has quit [Ping timeout: 246 seconds]
<epitron>
that's why you can't inherit class instance variables
interactionjaxsn has joined #ruby
<atmosx>
epitron: no, it's hard because it's not clear how slicing is perform in every situation
<atmosx>
epitron: also there are about 7.000 protein which we have no idea how they are made, probably more...
takezawa has quit [Remote host closed the connection]
mklappstuhl has quit [Ping timeout: 264 seconds]
<chrisseaton>
epitron: if @@ class variables live on the class object, how can you see them in a subclass? the subclass object is not a subclass of the superclass object or singleton, it's a subclass of Class
Davey has quit [Quit: Computer has gone to sleep.]
mikepack has joined #ruby
aces1up has joined #ruby
bionhart has joined #ruby
emergion has joined #ruby
Cultofmetatron has quit [Read error: Connection reset by peer]
atmosx has quit [Quit: And so the story goes…]
aces1up23 has quit [Ping timeout: 241 seconds]
Cultofmetatron has joined #ruby
Kricir has joined #ruby
lucianosousa has quit [Quit: lucianosousa]
lewix has quit [Remote host closed the connection]
Squarepy has quit [Quit: Leaving]
pskosinski has quit [Quit: pskosinski]
deception has quit [Quit: Goodbye]
interactionjaxsn has quit [Remote host closed the connection]
emergion has quit [Client Quit]
interactionjaxsn has joined #ruby
ixti has quit [Quit: WeeChat 0.4.1]
Ortuna has quit [Quit: Computer has gone to sleep.]
arya_ has joined #ruby
foxiness has joined #ruby
hogeo_ has quit [Remote host closed the connection]
interactionjaxsn has quit [Ping timeout: 246 seconds]
hogeo has joined #ruby
northelks_ has quit [Quit: ...]
arya has quit [Ping timeout: 248 seconds]
cHarNe2 has joined #ruby
predator217 has joined #ruby
takezawa has joined #ruby
jonathanwallace has quit [Ping timeout: 246 seconds]
nuck has quit [Ping timeout: 256 seconds]
<cHarNe2>
hi guys, i'v made a log-parser that goes thro' files that are 30mb big, and im dumping the data in mysql with AR. But im now sure if mysql if the right choise to use. is it easy to test some no-sql database?
mikepack has quit [Remote host closed the connection]
hogeo has quit [Ping timeout: 240 seconds]
predator117 has quit [Ping timeout: 256 seconds]
alexandernst_ has quit [Quit: Konversation terminated!]
pinpin404 has quit [Quit: d&dTime fatigué kmp prenez soin de vous]
<Retistic>
is there a way to pass in a block to sort_by as an argument?
jamesfung14 has joined #ruby
<havenwood>
cHarNe2: You could look at PostgreSQL's hstore. Redis is great.