<ryannielson>
So I managed to get a pages html with Nokogiri, and add an element. I then use to_html to return it and it renders the page. The only issue is images that were simply /image.jpg instead of the whole sites url, are broken because it's trying to get /image.jpg from me locally. Any way around that?
<swarley_>
everyone calm down, i'm back now
<matti>
swarley_: Yay!
<swarley_>
:D
ryanf has quit [Quit: leaving]
swarley has quit [Disconnected by services]
swarley has joined #ruby
hbpoison has joined #ruby
swarley has quit [Disconnected by services]
swarley_ is now known as swarley
swarley| has joined #ruby
brianpWins has quit [Quit: brianpWins]
savage- has quit [Remote host closed the connection]
jitesh_shetty has quit [Remote host closed the connection]
irleif has quit [Client Quit]
Michae___ has joined #ruby
Takehiro has quit [Remote host closed the connection]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Remote host closed the connection]
w2f2 has quit [Read error: Connection reset by peer]
arubin has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
_Rui_ has joined #ruby
aantix has quit [Ping timeout: 246 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
_Rui_ has left #ruby [#ruby]
robertotauille has joined #ruby
rcosta has joined #ruby
iamjarvo has joined #ruby
kiyoura has joined #ruby
MentalGrinds has quit [Quit: MentalGrinds]
xbayrockx has quit [Ping timeout: 246 seconds]
Konboi has joined #ruby
bricker has quit [Ping timeout: 260 seconds]
LouisGB has joined #ruby
stkowski has quit [Quit: stkowski]
SegFaultAX|work has quit [Ping timeout: 272 seconds]
judd7 has joined #ruby
dpatel has quit [Quit: dpatel]
tjbiddle has quit [Ping timeout: 272 seconds]
drago757 has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
dylanjha has joined #ruby
bradhe has joined #ruby
ryanf has joined #ruby
apok has quit [Ping timeout: 260 seconds]
JonnieCache has joined #ruby
drago757 has quit [Ping timeout: 260 seconds]
<Spooner_>
RyanNielson You can access Img/src and set the fully qualified address. You know what the page's original address was so you just need to add the rest of the URI before the image.
mahmoudimus has quit [Quit: Computer has gone to sleep.]
samphippen has quit [Quit: Computer has gone to sleep.]
<ryannielson>
Spoonder_: Ya, I thought of that after I wrote teh question. Thne ya, used URI to fix any relative image links. :) Thanks
<Spooner_>
RyanNielson: THought you mighjt have worked it out by the time I looked at #ruby again, but thought I'd poke you in case you hadn't ;)
stephh has quit [Ping timeout: 252 seconds]
<ryannielson>
Spooner_: Ya, I appreciate the help. If I didn't figure it out, that would have helped me immensely.
artOfWar has quit [Remote host closed the connection]
judd7_ has joined #ruby
judd7_ has quit [Client Quit]
stephh has joined #ruby
mahmoudimus has joined #ruby
rburton- has quit [Quit: Leaving...]
xbayrockx has joined #ruby
manizzle has quit [Ping timeout: 260 seconds]
daniel_- has quit [Quit: WeeChat 0.3.9]
sjuxax has joined #ruby
judd7 has quit [Ping timeout: 245 seconds]
yshh has joined #ruby
xaq has joined #ruby
<sjuxax>
Hi all. I need something like setuid to a non-privileged user. It is my understanding that setuid can only be used by root, so I don't want to use it directly. Basically, I want to replace the shell with the shell of the right user, if possible. I tried calling su with Process::spawn, but the program just waits until I exit that shell to continue.
<sjuxax>
Is there a way to do this, or am I going to have to use setuid?
<sjuxax>
The shell that I ran "ruby ..." from. Basically, I want to drop privileges, set uid on the script before its execution continues
Astral is now known as Guest17270
<sjuxax>
as not root
icole has quit [Remote host closed the connection]
<heftig>
if you're not root, you have no privileges to drop
kiyoura has quit [Quit: Leaving]
<heftig>
(well, barring setcap, but that's rare)
kiyoura has joined #ruby
Bosma has joined #ruby
ryannielson has quit [Ping timeout: 245 seconds]
Astral_ has quit [Ping timeout: 265 seconds]
drago757 has joined #ruby
<sjuxax>
Right, "drop user" I guess. ;)
walbert has quit [Remote host closed the connection]
<heftig>
you need root to change user
<heftig>
(helpers like su and sudo are setuid root)
heriC has joined #ruby
baphled has joined #ruby
heriC has left #ruby [#ruby]
Bosox20051 has quit [Remote host closed the connection]
<sjuxax>
Yeah. I was hoping there was some su trickery I could use to change the process without running the script itself as root, because I have passwordless sudo configured. In Ruby, it seems Process::Sys.setuid would work, but I don't know how to say "do this to process id xxx", and feed the current pid in. Seems I have to spawn a process for it to be effective.
<heftig>
you can
<heftig>
you can't do that
bigmcq77 has joined #ruby
khakimov has joined #ruby
<sjuxax>
heftig: OK, thanks.
<sjuxax>
Is there a way to setuid on current process with Ruby's setuid stuff? It seems designed only to work on spawned processes.
reset has joined #ruby
reset has quit [Read error: Connection reset by peer]
sent-hil has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
roadt has joined #ruby
MentalGrinds has joined #ruby
<heftig>
sjuxax: setuid always affects the current process
sn0wb1rd has quit [Quit: sn0wb1rd]
<nesoi>
hi, what's a good and easy way to send mail from a ruby program?
<matti>
nesoi: Net::SMTP?
<matti>
nesoi: Simple API.
endzyme has quit [Remote host closed the connection]
jxf has quit [Read error: Connection reset by peer]
stephenjudkins has quit [Quit: stephenjudkins]
miso1337 has joined #ruby
<nesoi>
thanks matti. any idea where I'd find documentation/examples?
<banisterfiend>
where 'binding' has self set to a class
<sent-hil>
banisterfiend: ah cool, thx
<Spooner_>
sent-hil : class instance variables don't exist, per se, in Ruby. They would be self.class.instance_variables
radic_ has quit [Read error: Connection reset by peer]
UberNerdGirl has quit [Quit: UberNerdGirl]
radic has joined #ruby
<swarley>
is there a way to enforce mutex within a class itself?.. this probably isnt good practice but until i can find a way to make this thread safe there is just no way
<swarley>
Ah, i'm dumb
voodoofish430 has quit [Quit: Leaving.]
<swarley>
Yes, i know the answer to the mutex question
<swarley>
carry on
Michael__ has joined #ruby
Takehiro_ has joined #ruby
Takehiro_ has quit [Remote host closed the connection]
judd7 has quit [Quit: judd7]
cbuxton has joined #ruby
cbuxton has left #ruby [#ruby]
nesoi has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
<nesoi>
so what's a good way to do a mailmerge kind of thing in ruby? I want to send an email to recepients from a database, and fill in their name and other details in each message.
baphled has quit [Ping timeout: 246 seconds]
stephenjudkins has joined #ruby
lledet has quit [Quit: lledet]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
ryanf has joined #ruby
erichmenge has quit [Quit: Be back later]
<nesoi>
another way to ask that is, what's a good way to insert variable information into a string :)
gabrielrotbart has quit [Remote host closed the connection]
caleb_io has joined #ruby
Takehiro_ has joined #ruby
c0rn_ has joined #ruby
icole has quit [Remote host closed the connection]
MentalGrinds has quit [Quit: MentalGrinds]
gabrielrotbart has joined #ruby
icole has joined #ruby
h4mz1d has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<swarley>
actually, how do i utilize mutex in the C code?
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<swarley>
well, i guess i could proxy it through a function in ruby
<nesoi>
so do #{name} and then what's the syntax for substituting it?
<emdub>
when you have a string, say "Hello, my name is #{name}", ruby will automatically put the value of the variable name in place of the #{name} portion
<nesoi>
with what syntax?
<emdub>
so if you did new string = "Hello, my name is #{name}"
<emdub>
and name = "fred"
<emdub>
string would be "Hello, my name is fred"
<nesoi>
what about when I want name to be "george" later?
<emdub>
well, if you want to be able to change the name, i'd probably make a method to do it, something like this (sec)
jjang has quit [Remote host closed the connection]
<nesoi>
yeah #{name} doesn't work unless name is defined first
<nesoi>
I need to define the string first, then put in different values and output in a loop
<nesoi>
odd that people don't use that approach more. I looked this up and found all kinds of complicated ways to do it
<nesoi>
emdub : how would I make a default value for the variables in case they are not supplied to the routine or are null
gabrielrotbart has quit [Remote host closed the connection]
<nesoi>
?
<emdub>
you'd do def hello(name="john")
<emdub>
and if name wasn't passed to hello, it would be "john"
<Paradox>
def goodbye { exit }
chin-tastic has quit [Ping timeout: 240 seconds]
<nesoi>
thanks Paradox!
<nesoi>
I mean, thanks emdub
<emdub>
that only works if the variable isn't passed, passing nil is perfectly valid
<emdub>
if you did, hello(nil), name would be nil
gabrielrotbart has joined #ruby
<emdub>
you should put some logic around your calls to the hello method to make sure that name is valid, if you have concerns about the input being bogus
<nesoi>
hm. it still seems to requrie both variabls
<nesoi>
variables
<emdub>
not sure what you mean both variables
<nesoi>
I mean a parameter
<emdub>
are you trying to have multiple params with default values?
<emdub>
and only passing some of them?
<nesoi>
yeah, just in case
<emdub>
that gets a bit more complex
FifthWall has joined #ruby
<nesoi>
actually it doesn't accept nil, it wants a string
<emdub>
well sure, if you pass nil it's going to barf
<rking>
apple: There are thousands. What are you interested in?
<apple>
something which a new-mid level guy ilk eme can spend a week to get a hang of the code and start writing features or do bug fixes
<apple>
have any repos in mind?
<apple>
or have ur own?
ryanf has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
Takehiro_ has quit [Remote host closed the connection]
<rking>
Hehe, that would be so self-serving if I was to draw you into my labyrinth of pain, suffering, and vain ambitions.
<rking>
But do you have a Github account?
Monie has joined #ruby
Monie has joined #ruby
Monie has quit [Changing host]
tchebb has quit [Ping timeout: 255 seconds]
Banistergalaxy has quit [Ping timeout: 252 seconds]
glyytchy has quit [Ping timeout: 244 seconds]
ryanf has quit [Quit: leaving]
ryanf has joined #ruby
bluOxigen has joined #ruby
siyusong has quit [Quit: Computer has gone to sleep.]
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
freezey has quit [Quit: freezey]
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
tnk1 has joined #ruby
<burgestrand>
apple: %
<burgestrand>
Uh. ^
ckrailo has quit [Quit: Computer has gone to sleep.]
<apple>
yes
<apple>
murtuzakz is my handle
chin-tastic has joined #ruby
<burgestrand>
apple: if I were you I’d find a project I enjoy using, look at the issues, possibly mail the maintainer (or mailing list) and just contribute something, even if it’s just a fix for trailing whitespace.
mneorr has quit [Remote host closed the connection]
<burgestrand>
You don’t necessarily need to understand the entirety of a project to contribute it.
mneorr has joined #ruby
<apple>
i forked out some projects like capistrano etc
<apple>
but got lost in code
<apple>
and heirarchy
<burgestrand>
Documentation is often easy to start with. ^^
<rking>
If you go through some amount of suffering to learn some software, you can leave a trail for the next guy (and save the developers some time, while also getting feedback from them on what you produce)
peterhellberg has joined #ruby
chin-tastic has quit [Ping timeout: 272 seconds]
Elhu has joined #ruby
<rking>
apple: If you want to learn Pry, its Wiki could definitely use some help from someone new to it.
Villadelfia has quit [Remote host closed the connection]
SeySayux has quit [Remote host closed the connection]
SeySayux has joined #ruby
<peterhellberg>
JonnieCache: vim-ruby-xmpfilter is able to run only the selected code (visual mode)
Villadelfia has joined #ruby
<JonnieCache>
peterhellberg: thats very nice for you. i said a sublime plugin :)
<peterhellberg>
JonnieCache: Yeah… :)
<peterhellberg>
JonnieCache: How well does the "vim-mode" in Sublime work?
<JonnieCache>
peterhellberg: its pretty basic. any proper user of vim will complain that it only supports a fraction of their favourite mortal kombat style keyboard incantations
<peterhellberg>
JonnieCache: Haha, good to know :)
<JonnieCache>
however the vim mode is entirely implemented in sublime's extension apis so if you really are a proper user of vim it should be pretty trivial to port them
<peterhellberg>
Sounds neat, but I’ll stick with Vim
<JonnieCache>
heh im not trying to convert you (that never works) just spreading information
xpen has quit [Remote host closed the connection]
<peterhellberg>
Yes, and I’m grateful for that :)
xpen has joined #ruby
<peterhellberg>
I’ve finally figured out how to use RSolr from Sidekiq (Celluloid)
<peterhellberg>
Turns out that Celluloid is pretty awesome, and that it doesn’t really care if your code is using blocking i/o… but I did need to open a new connection to Solr for each thread (obviously, but I found it to be a bit tricky to achieve)
kartouch has joined #ruby
<peterhellberg>
I can also highly recommend the connection_pool gem
<pigggie>
if i have class One with two child classes - Two and Three, what is the preferred way to refer to Two from within the definition for Three? Should I use the whole name "One::Two", or just "Two"?
v0n has quit [Ping timeout: 246 seconds]
mneorr has joined #ruby
justinmcp has joined #ruby
chin-tastic has joined #ruby
<pigggie>
Is it just a matter of taste? Or should I avoid one or the other?
<banisterfiend>
if accessed properly you do get access to constants defined in the enclosing class
<banisterfiend>
but that's more a function of constant look up rules, not really 'inner class' stuff
<pigggie>
banisterfiend: A class defined within a class that provides some sort of service to that class... What would that be called?
<banisterfiend>
pigggie: hmm, i dont think we have a name for them really, i guess we call them 'nested classes'
<banisterfiend>
we can call them*
<banisterfiend>
pigggie: but they dont have any privileged access to data in the enclosing class
<banisterfiend>
except for some constants (but again that's a function of constant lookup rules)
<peterhellberg>
pigggie: I’m currently reading Practical Object-Oriented Design in Ruby: An Agile Primer by Sandi Metz, and it is shaping up to be a REALLY good book.
under_my_shoes has quit [Quit: Leaving]
robozahn_ has joined #ruby
<pigggie>
banisterfiend: So lets substitute "child" for "nested" in my original question, what would the case be then? (I'll repost it if you want)
under_my_shoes has joined #ruby
<banisterfiend>
pigggie: repost
jxf has joined #ruby
<pigggie>
peterhellberg: Thanks Peter, that sounds like just the kind of thing I need ;)
<banisterfiend>
peterhellberg: how does it compare to 'eloquent ruby' ? tell me something cool you learned already :)
<peterhellberg>
pigggie: Oh, and you can do something like this for DI: def foo(klass = Bar); klass.do_something; end;
<peterhellberg>
banisterfiend: Oh, that was the book I read just before POODR
<pigggie>
banisterfiend: Okay, if I have class One with two nested classes (Two and Three), what is the preferred way to refer to Two from wihtin the definition of Three? Should I use the whole name "One::Two", or just "Two"?
robozahn has quit [Ping timeout: 244 seconds]
<banisterfiend>
pigggie: it depends how yu open Three
<peterhellberg>
banisterfiend: Eloquent was more on the idiomatic side of Ruby, POODR isn’t necessarily limited to Ruby
jenrzzz has quit [Ping timeout: 260 seconds]
<banisterfiend>
pigggie: if you open Three like this: class One::Three then you cannot access Two without fully qualifying it as One::Two
<peterhellberg>
banisterfiend: As in being more concerned with the design aspects of the system, rather than syntax.
<banisterfiend>
pigggie: but if you open Three like this: class One; class Three; then u can access Two without full qualification (i.e just as Two)
beiter has joined #ruby
<banisterfiend>
peterhellberg: so it's all about design patterns or what? also, how does it compare to 'refactoring: ruby edition' i have that, too. And it's great
<pigggie>
banisterfiend: Ah okay, I see. And is there anything wrong with the latter?
<peterhellberg>
banisterfiend: I haven’t read the refactoring book yet, so I can’t really compare the two. (One of my all time favorite Ruby books is 'Design Patterns in Ruby')
<banisterfiend>
pigggie: no...i prefer the latter, as i get access to constants defined in One
robozahn_ has quit [Ping timeout: 244 seconds]
<banisterfiend>
pigggie: the only advantage in class One::Two is that it maybe looks slightly neater
<banisterfiend>
also, u dont have to remember if One is a class or a module :)
<peterhellberg>
banisterfiend: From the introduction of POODR: "This book is about designing object-oriented software. It is not an academic tome, it is a programmer’s story about how to write code. It teaches how to arrange software so as to be productive today and to remain so next month and next year."
<banisterfiend>
pigggie: so, you can later refactor One from Class to Module or vice versa and it'll still work, but that's rare i guess and not tha tmuch of an advantage
<pigggie>
banisterfiend: Yeah, I went through my code using only the second case but in some cases thought the naming wasn't entirely clear without the context so I suppose it's a stylistic thing.
<pigggie>
peterhellberg: Looks like I've found my next book then!
<peterhellberg>
Oh, and it looks like that is the sample chapter (aka: free)
<peterhellberg>
:)
robozahn has joined #ruby
<peterhellberg>
Sandi is also a great speaker, I met her at Rocky Mountain Ruby this year, and will do so again at Øredev
Zai has joined #ruby
bradhe has quit [Ping timeout: 256 seconds]
<banisterfiend>
peterhellberg: what's her name again?
<peterhellberg>
banisterfiend: Sandi Metz
<peterhellberg>
Good checklist for dependencies: An object has a dependency when it knows he name of another class, the name of a message, the arguments that a message requires, the order of those arguments.
lolmaus has joined #ruby
Agis__ has quit [Quit: Agis__]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
hsbt has quit [Ping timeout: 264 seconds]
hsbt has joined #ruby
SeySayux has quit [Read error: Connection reset by peer]
Villadelfia has quit [Read error: Connection reset by peer]
Zai has quit [Read error: Connection reset by peer]
Progster has joined #ruby
gokul has joined #ruby
<peterhellberg>
Also “It is not the class of the object that’s important, it’s the message you plan to send to it.”
<peterhellberg>
I should probably stop quoting that book now, but it is just that good :)
<Xeago>
workmad3: I've not seen that in production here, have seen ||..
jayeshsidhwani has quit [Quit: jayeshsidhwani]
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
and we had issues with it
<workmad3>
Xeago: it's not our fault that your production code doesn't do the more normal way of providing default options
<workmad3>
Xeago: :P
<Xeago>
wait!
<Xeago>
code from the company I currently am an intern
<Xeago>
which I didn't make myself
awestroke has joined #ruby
<workmad3>
Xeago: I know ;) I'm teasing you now ;)
<Xeago>
tbh, videofy.me is a mess
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
in the month I have been coding here, I've written more documentation than they have over 3years
withnale has joined #ruby
<Xeago>
and my documentation fits under 2kb
awestroke has joined #ruby
<Xeago>
you can count the words in your head..
<workmad3>
heh
<workmad3>
documentation... fun :P
awestroke has quit [Read error: Connection reset by peer]
<workmad3>
right, back to proof-reading
awestroke has joined #ruby
<workmad3>
:(
awestroke has quit [Read error: Connection reset by peer]
awestroke has joined #ruby
awestroke has quit [Read error: Connection reset by peer]
<workmad3>
Xeago: also, I got the merge the wrong way around... it should be args = default_options.merge(args)
<workmad3>
Xeago: and then obviously you specify a default_options hash somewhere :)
awestroke has joined #ruby
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
i'd use args.merge! default_options
awestroke has joined #ruby
<Xeago>
let me test
<workmad3>
Xeago: no, that would overwrite args with default_options if they conflicted
<Xeago>
crap
<Xeago>
das wrong ;p
<workmad3>
Xeago: which is what I meant when I got it the wrong way around :P
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
well then, args.reverse_merge!
<Xeago>
HA!
<workmad3>
heh
awestroke has joined #ruby
<Xeago>
except it doesn't exist outside of active support
<Xeago>
damn that gem is big
<workmad3>
yeah, they added things like that in... specifically to support the easy use of default options like this ;)
awestroke has quit [Read error: Connection reset by peer]
awestroke has joined #ruby
awestroke has quit [Read error: Connection reset by peer]
<workmad3>
it's worth having a look through active support, they have some other nice option processing stuff in there, iirc... including things like throwing argument errors if unknown option keys are passed
<JonnieCache>
Xeago: its constructed so you can require it piecemeal
<workmad3>
^^ that too (at least since 3.0)
awestroke has joined #ruby
<Xeago>
I just hit a brick wall everytime I open irb
<workmad3>
Xeago: give than a #!, make it executable, viola, project-specific IRB script ;)
<workmad3>
*that
<JonnieCache>
ohhh
<Xeago>
it requires validation of the db
awestroke has joined #ruby
<Xeago>
for weird reasons
<Xeago>
(mostly importing test data it seems >.<)
g-ram has quit [Quit: Computer has gone to sleep.]
awestroke has quit [Read error: Connection reset by peer]
awestroke has joined #ruby
Progster has quit [Ping timeout: 246 seconds]
asuka_ has quit [Ping timeout: 246 seconds]
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
we're using virtual models aswell
<Xeago>
which makes it worse
jxf has quit [Ping timeout: 246 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
awestroke has joined #ruby
asuka has joined #ruby
<Xeago>
not to start about inheritance in the sequel addon gem
mneorr has quit [Remote host closed the connection]
<Xeago>
that requires 4 queries per model that inherits
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
and they are slow queries
<workmad3>
Xeago: see above regarding project-specific IRB script so you don't need to spend half your life remembering which gems to load in IRB :P
<Xeago>
I us eirbc.rc
awestroke has joined #ruby
mneorr has joined #ruby
mucker has joined #ruby
<workmad3>
is that ruby code?
<Xeago>
yea
<JonnieCache>
requires validation of the db? is it often broken then?
awestroke has quit [Read error: Connection reset by peer]
<JonnieCache>
that sounds painful
<Xeago>
JonnieCache: 'ish
Guest80824 has joined #ruby
<Xeago>
it is..
<workmad3>
Xeago: so add in a 'load ENV['HOME'] + '.eirb.rc' ' line
irleif has joined #ruby
jayeshsidhwani has joined #ruby
awestroke has joined #ruby
<Xeago>
why that? I can just require 'active_support'
zmo_ has joined #ruby
awestroke has quit [Read error: Connection reset by peer]
<workmad3>
Xeago: what about if you don't have active_support in a project?
<Xeago>
tbh, I'd prefer to use padrino console
<Xeago>
and strip out sequel
<workmad3>
Xeago: also it would be 'active_support/all' ;)
awestroke has joined #ruby
<Xeago>
because I am not dealing with that
<Xeago>
aah
<Xeago>
thanks for /all
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
as I'd like most of my models to be available
<Xeago>
but I don't need database interaction
<Xeago>
only elasticsearch
awestroke has joined #ruby
<workmad3>
that /all won't load all your stuff, that's just for loading all of active_support
<Xeago>
requiring 'active_support' didn't give me reverse_merge :P
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
/all did
<workmad3>
Xeago: yeah :)
<workmad3>
Xeago: because 'require "active_support" ' doesn't really load much
awestroke has joined #ruby
<workmad3>
ok, I'm now procrastinating...
awestroke has quit [Read error: Connection reset by peer]
<Xeago>
been doing that for a week now lol
<Xeago>
if you get the subscription for safaribooks
elsifaka has quit [Quit: Veloma e!]
<Xeago>
are you limited in the amount books to read?
emergion has quit [Quit: Computer has gone to sleep.]
<Xeago>
what is the bookshelf thing?
<JonnieCache>
no
<JonnieCache>
i wasnt when i used to have it
<JonnieCache>
maybe there are some account types that are limited though
lkba has joined #ruby
beiter has joined #ruby
elsifaka has joined #ruby
anoNxeRo has joined #ruby
meskyanichi has joined #ruby
Xeago has quit []
Xeago has joined #ruby
rumba has joined #ruby
Axsuul has quit [Ping timeout: 268 seconds]
Guest80824 has quit [Ping timeout: 246 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
anoNxeRo has quit [Max SendQ exceeded]
hsbt is now known as hsbt_away
rakl has joined #ruby
hsbt_away is now known as hsbt
anoNxeRo has joined #ruby
Mathieu has joined #ruby
Guest80824 has joined #ruby
mucker has quit [Quit: leaving]
<ecksit>
i am looking to write a gem for interacting with git (retrieving commits, author details, repo stats). would using grit be a better idea?
robozahn has quit [Ping timeout: 244 seconds]
<banisterfiend>
ecksit: it entirely depends if grit is good enough 4 u
<banisterfiend>
ecksit: i thin kthere's a better thing called rugged
<banisterfiend>
check that out 1st
<Xeago>
else, libgit
<rumba>
how can i use SOAP::WSDLDriver with HTTP authentication? my code currently looks like this: http://pastebin.com/AH2qaSup but it doesn't reach line 11
<Xeago>
or was it libgit2
mucker has joined #ruby
<banisterfiend>
Xeago: rugged uses libgit2
<banisterfiend>
it's a rub wrapper around it
<banisterfiend>
ruby
<ecksit>
ah right. i see
<Xeago>
ah cool!
<ecksit>
sad face. i was going to write a gem for this. :(
<banisterfiend>
ecksit: u still could, grit is pretty buggy and weird
hsbt has quit [Ping timeout: 256 seconds]
<banisterfiend>
and i could never get rugged working
Eplemosen has joined #ruby
reinaldob has joined #ruby
<ecksit>
i want a mroe straight forward gem though. something like my_repo.commits.last to get the last commit
<rumba>
or could someone recommend some other module?
<ecksit>
or repo.authors.view_details(author_name)
vlad_starkov has joined #ruby
<banisterfiend>
ecksit: u coudl always write a wrapper around grit/rugged
<banisterfiend>
rather than reimplementing everything yourself
LennyLinux has quit [Remote host closed the connection]
<ecksit>
but then i also inherit the issues or problems that grit/rugged have.
<ecksit>
tough one
<Xeago>
if you're gonna wrap rugged, you might aswell use libgit2 directly imo
hsbt has joined #ruby
RudyValencia- is now known as RudyValencia
vlad_starkov has quit [Ping timeout: 272 seconds]
robozahn has joined #ruby
rclark has joined #ruby
mklappstuhl has joined #ruby
rclark has quit [Client Quit]
rippa has joined #ruby
Guest80824 has quit [Ping timeout: 246 seconds]
haxrbyte_ has quit [Ping timeout: 246 seconds]
chin-tastic has joined #ruby
rdark has joined #ruby
rdark has quit [Client Quit]
kaawee has joined #ruby
LennyLinux has joined #ruby
rdark has joined #ruby
graeme has quit [Quit: graeme]
mklappstuhl has quit [Remote host closed the connection]
pdelgallego has quit [Remote host closed the connection]
nick_h has joined #ruby
lorn has joined #ruby
Zai has joined #ruby
Dreamer3 has quit [Quit: Leaving...]
joaoh82 has quit [Remote host closed the connection]
joaoh82 has joined #ruby
<ecksit>
ah got it. cmake was fubar.
josh^ has quit [Remote host closed the connection]
binarypl1 has quit [Quit: WeeChat 0.3.9]
kaawee has joined #ruby
rabidpraxis has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
rabidpraxis has quit [Read error: Connection reset by peer]
frogprince_mac has quit [Quit: Leaving...]
apple has quit [Quit: apple]
Doc_X_ is now known as Doc_X
under_my_shoes has quit [Quit: Leaving]
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
under_my_shoes has joined #ruby
tos9 has quit [Quit: Gone.]
enroxorz-work has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
<sonne>
using form_for() in rails i see that i can use the "submit" method to create a submit button... i've seen examples around that specify an image instead of a button (f.submit "foo", :type => image)
reisl has joined #ruby
<sonne>
i can't find any docs on it... how do i find out what are the accepted types of submits?
berserkr has quit [Quit: Leaving.]
larissa has quit [Ping timeout: 246 seconds]
linoj has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
margle has quit [Quit: Computer has gone to sleep.]
rdark has quit [Ping timeout: 246 seconds]
<Xeago>
sonne: you could read the code
<Xeago>
you should ask in #rails tho
rdark has joined #ruby
yshh has joined #ruby
<sonne>
Xeago, tried the latter... i'm quite scared by the former :)
mercwithamouth has joined #ruby
cantonic_ has joined #ruby
jcaudle has joined #ruby
dhruvasagar has quit [Ping timeout: 245 seconds]
cantonic has quit [Ping timeout: 246 seconds]
cantonic_ is now known as cantonic
mneorr has quit [Remote host closed the connection]
akemEikko has quit [Ping timeout: 260 seconds]
mneorr has joined #ruby
somazero has joined #ruby
tos9 has joined #ruby
tos9 has quit [Client Quit]
<tommyvyo>
anyone have any recommendations on a solid stable websocket engine?
Ktaze has joined #ruby
slainer68 has joined #ruby
Konboi has quit [Remote host closed the connection]
emergion has joined #ruby
<zykes->
anyone tha can help me with how I can "split" http://paste.ubuntu.com/1289261/ into 2 files ? The first file should have the content until the line "ALTER TABLE ach" and the other one from that line and onwards
geekbri has joined #ruby
joaoh82 has quit [Remote host closed the connection]
GoGoGarrett has joined #ruby
apple has joined #ruby
joaoh82 has joined #ruby
kaneda__ has quit [Ping timeout: 246 seconds]
zmo_ has quit [Quit: Leaving]
nitti has joined #ruby
matti is now known as zombie_matti
Konboi has joined #ruby
rdark has quit [Ping timeout: 256 seconds]
zombie_matti is now known as matti
profx_ has quit [Remote host closed the connection]
<love_color_text>
why would that never happen? isn't ruby all about being able to modify itself? and arent you doing anaphora by referring to p in the way you are doing so? what syntax would you have preferred? are we talking about your example still?
<love_color_text>
correction, by modify itself i mean being able to extend the language into any form you want
<peterhellberg>
love_color_text: The point is that I’d like not having the "p" at all
<love_color_text>
modify the language*. and thanks i'll read this
`brendan has joined #ruby
roadt has quit [Ping timeout: 246 seconds]
Floydzy has quit [Quit: Floydzy]
axl__ has joined #ruby
mmlac has joined #ruby
<peterhellberg>
I’ve still to get a grip on the status of “autoload” in Ruby.
<Montas>
peterhellberg: so if i get it right, You create Hash that can do hash["asd"]["qwe"]["zxc"] = "qwe" ?
<peterhellberg>
I guess it is better to disregard it completely (since it is to be removed in Ruby 3)
burgestrand has quit [Quit: Leaving.]
<peterhellberg>
Montas: Yes
v0n has joined #ruby
v0n has quit [Client Quit]
samphippen has quit [Quit: Computer has gone to sleep.]
kpshek has joined #ruby
nateberkopec has joined #ruby
hoofman has joined #ruby
mando has quit [Remote host closed the connection]
samphippen has joined #ruby
_md has joined #ruby
mmlac has quit [Quit: mmlac]
havenn has joined #ruby
reisl has quit [Quit: Leaving]
Araxia has joined #ruby
metrix has joined #ruby
beiter has quit [Quit: beiter]
troessner has joined #ruby
Spooner has joined #ruby
iamjarvo has joined #ruby
<metrix>
I am running applications on a windows platform where I won't have access to creating my own scheduled tasks.. Is there a good(popular) ruby schedular that I can create as a service one time that I can use to schedule processes from a ruby script?
samphippen has quit [Quit: Computer has gone to sleep.]
jenrzzz has quit [Ping timeout: 244 seconds]
<peterhellberg>
metrix: I’ve been very happy with https://github.com/daddye/forever (But I’m not sure if it would run under Windows, I don’t touch that with a stick :)
LennyLinux has quit [Remote host closed the connection]
philcrissman has joined #ruby
Goles has joined #ruby
<metrix>
I have a Debian virtualBox when I need to do something that Cygwin couldn't do, but in general I just use Cygwin. Policy at my place of work is that all servers must be Windows based.
<troessner>
lol
<troessner>
seriously?
<troessner>
may i ask where you work metrix
<matti>
Yeah.
<matti>
So we can put it on a "avoid list" ;]
samphippen has joined #ruby
<troessner>
:D
<metrix>
LOL it's a city in West Texas
<metrix>
you can just avoid the area ;)
<matti>
Phew.
<matti>
I am safe in London ;d
<matti>
metrix: :)
<troessner>
and i assume all your grapic designers must use Plan 9 as a policy
<troessner>
:)
<matti>
Hahah
<metrix>
This is a small shop.... Only 4 programmers
manizzle has quit [Ping timeout: 260 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
klaas has quit [Ping timeout: 260 seconds]
metrix has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121010144125]]
h4mz1d has joined #ruby
under_my_shoes has quit [Quit: Leaving]
tjbiddle has joined #ruby
under_my_shoes has joined #ruby
scx has joined #ruby
chrisramon has joined #ruby
dnstbr has quit [Quit: Computer has gone to sleep.]
tomsthumb has joined #ruby
BiHi has quit [Read error: Connection reset by peer]
chin-tastic has joined #ruby
<Montas>
guys, simple... how do i turn "súčasťou" to "sucastou" ? remove all interpuction
robotmay has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
robotmay has joined #ruby
khakimov has joined #ruby
haxrbyte has joined #ruby
Rizzle has joined #ruby
roadt has joined #ruby
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
Floydzy has joined #ruby
frogprince has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
hsbt has quit [Ping timeout: 244 seconds]
frogprince has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
cnf has joined #ruby
Michael- has joined #ruby
Michael- has quit [Client Quit]
roadt has quit [Ping timeout: 246 seconds]
Elhu has quit [Ping timeout: 245 seconds]
hotovson_ has joined #ruby
davidcelis has joined #ruby
<the_jeebster>
can't wait for rubyconf!
hadees_ has joined #ruby
davidcelis has quit [Client Quit]
<the_jeebster>
excited to check out denver as well
Elhu has joined #ruby
Liothen_ has joined #ruby
mikekelly has quit [Ping timeout: 256 seconds]
matrixise has quit [Ping timeout: 260 seconds]
mikepack has joined #ruby
WhereIsMySpoon_ has quit [Quit: No Ping reply in 180 seconds.]
hadees has quit [Ping timeout: 246 seconds]
hadees_ is now known as hadees
_cheney2 has joined #ruby
WhereIsMySpoon has joined #ruby
moshee has quit [Ping timeout: 260 seconds]
meskyanichi has quit [Ping timeout: 246 seconds]
hotovson has quit [Ping timeout: 246 seconds]
_cheney has quit [Ping timeout: 246 seconds]
dreamfall has quit [Ping timeout: 246 seconds]
alanp has joined #ruby
hsbt has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
vitor-br has quit [Ping timeout: 246 seconds]
rking has quit [Ping timeout: 246 seconds]
Liothen has quit [Ping timeout: 246 seconds]
QaDeS has quit [Ping timeout: 246 seconds]
rking has joined #ruby
dreamfall has joined #ruby
fbernier has joined #ruby
Ankhers has quit [Remote host closed the connection]
vitor-br has joined #ruby
QaDeS has joined #ruby
mikekelly has joined #ruby
elsifaka has quit [Quit: Veloma e!]
minijupe has joined #ruby
d2dchat has joined #ruby
scx has quit [Read error: Connection reset by peer]
Ankhers has joined #ruby
Artheist has quit [Remote host closed the connection]
bricker has joined #ruby
<Uranio>
guest that I'm already make this question but.. hoe could I dialogue with a html form
<Uranio>
I mena... get a page, fill the form, get the cookie and continue authenticated for the enxt page
<Uranio>
s/mena/mean/
invisime has joined #ruby
<Uranio>
s/hoe/how/
<love_color_text>
Uranio: uhm... try looking at Capybara or Mechanize or using Net::HTTP or HTTParty ....
chrisramon_ has joined #ruby
<love_color_text>
or Selenium even
chin-tastic has quit [Ping timeout: 245 seconds]
aganov has quit [Remote host closed the connection]
<Uranio>
I prefer Net::HTTP... with curl in bash I use the -d option for send the for anme and value
<Uranio>
I think ruby must have better way for do that
Appineer has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
freezey has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
chrisramon has quit [Ping timeout: 244 seconds]
chrisramon_ is now known as chrisramon
kpshek has quit []
uris has quit [Remote host closed the connection]
<love_color_text>
a web form is nothing but a way for the user to fill in fields that ultimately end up as parameters that get sent to the server. so if you know these parameters you can send them with net::http
Appineer has left #ruby [#ruby]
<love_color_text>
you'll need to know if its a POST, PUT, DELETE, etc
graeme has quit [Quit: graeme]
<love_color_text>
and then just construct your request with Net::HTTP and you're good to do. take a look at Net::HTTP documentation (and yes this is the best option in order to not have dependencies in your program, since Net::HTTP is part of ruby standard lib)
<love_color_text>
good to go*
graeme has joined #ruby
slainer68 has quit [Remote host closed the connection]
joeycarmello has joined #ruby
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
<Uranio>
love_color_text: now but for example, the page have a form named "user" for username
<Uranio>
and a button for submit, how could that in NET::HTTP
<ddd>
write it for me! i don't want to look at docs!
<Uranio>
(I dont't ask you programing, jsut the grose idea)
maesbn has joined #ruby
<Uranio>
ddd: for exmaple, that would be "get the page, parse it and send the post"
<Uranio>
that culd be a answer to my question
maesbn has quit [Remote host closed the connection]
noyb has quit [Ping timeout: 246 seconds]
<Xeago>
Uranio: parsing html is a devious process
<ddd>
he just told you basically that, and told you to look at the docs for an example and the methods Net::HTTP uses to do that
tjbiddle has quit [Quit: tjbiddle]
<Uranio>
ok.. could be sayed that Net::HTTP native support the bussine of the auth with forms
zmo_ has quit [Quit: Leaving]
caleb_io has joined #ruby
Vinz_` is now known as Vinz_
v0n has joined #ruby
dnyy has joined #ruby
caleb_io has quit [Client Quit]
somazero has joined #ruby
ryanlecompte has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
d2dchat has quit [Remote host closed the connection]
perry has quit [Excess Flood]
banseljaj has quit [Excess Flood]
banseljaj has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
margle has joined #ruby
hoelzro is now known as hoelzro|away
UberNerdGirl has joined #ruby
perryh has joined #ruby
mmlac has joined #ruby
chin-tastic has joined #ruby
under_my_shoes has quit [Quit: Leaving]
areil has quit [Remote host closed the connection]
under_my_shoes has joined #ruby
klaas has joined #ruby
kpshek has joined #ruby
awarner has joined #ruby
savon_noir has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
savon_noir has left #ruby ["I'm busy"]
answer_421 has quit [Remote host closed the connection]
Uranio has quit [Quit: WeeChat 0.3.8]
<minijupe>
is there string enclosing syntax other than ' and " ?
<love_color_text>
minijupe: there are a lot of ways to create string literals in ruby
<love_color_text>
%{} is a favorite of mine
hadees has quit [Quit: hadees]
v0n has quit [Ping timeout: 246 seconds]
dnstbr has joined #ruby
kpshek has quit [Client Quit]
<love_color_text>
googling "ruby string literal constructors" or something to that effect might bring up the list
sertaconay has joined #ruby
<minijupe>
got it, was trying but apparently the 'literal' part is what i needed
jso has quit []
sertaconay has quit [Remote host closed the connection]
<troessner>
i think only perl has equally many ways to construct strings
answer_421 has joined #ruby
<troessner>
in ruby it's like a gazillion
<troessner>
just a rough estimate
<minijupe>
love_color_text: looks like % and any {} () ... pair will work
GraemeLion has quit [Quit: out]
<troessner>
not to forget about %w!! %W!! and its friends
aantix has joined #ruby
<troessner>
errrr
<troessner>
with "q", not "w" of course
jipiboily has left #ruby [#ruby]
Elhu has quit [Ping timeout: 245 seconds]
under_my_shoes has quit [Quit: Leaving]
kpshek has joined #ruby
under_my_shoes has joined #ruby
jipiboily has joined #ruby
<ddd>
so many ways to do things
fourlastor has joined #ruby
<fourlastor>
hello everyone :)
hbpoison has joined #ruby
<fourlastor>
is there any library to edit ebooks (epub,mobi) inline? eg putting a social drm in the ebook?
<ddd>
great thing bout lurking here, so many little items covered daily. whether they apply to your day or not, someone somewhere asks something that gets solved that leaves you going "Oh cool! Didn't think of that!"
alvaro_o__ has joined #ruby
rakl has joined #ruby
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
Elhu has joined #ruby
awestroke has quit [Remote host closed the connection]
chrishunt has joined #ruby
davidcelis has joined #ruby
caleb_io has joined #ruby
jonathanwallace has joined #ruby
alvaro_o_ has quit [Ping timeout: 244 seconds]
sideshowcoder has quit [Ping timeout: 248 seconds]
<lolzie>
Running that results in bob.rb:14:in `name': wrong number of arguments (0 for 1) (ArgumentError)
etherdev has joined #ruby
<lolzie>
I'd like to not have to write a whole bunch of def attr; attr; end; methods
<Spooner>
lolzie : You can't do that in Ruby is the simple answer. We don't have polymorphic functions./
<Spooner>
So your def age(age) will overwrite the attr_reader version of age().
carloslopes has joined #ruby
<lolzie>
I don't remember Ruby lacking that 0_o
<lolzie>
wow
<xclite>
lolzie, shouldn't this really be bob = Person.new(21, 180, "Bob")
<lolzie>
I'm a little rusty on this
<Spooner>
When we want setters, we do def age=(age); @age = age; end
<lolzie>
xclite: I was just experimenting
<xclite>
lolzie, i figured it was a little contrived
<Spooner>
(or attr_writer :age, of course, which does the same thing).
baphled has quit [Ping timeout: 276 seconds]
<xclite>
you could extend object with a method that creates the sort of thing you're looking for
<xclite>
sorry, Object
icole has joined #ruby
rdark has quit [Ping timeout: 255 seconds]
baphled has joined #ruby
g-ram has joined #ruby
<Spooner>
lolzie : But anyway, even if you didn't have the attr_readers, setting values like that in Ruby would be very unusual.
<arubin->
lolzie: Why not pass that information to the constructor?
<xclite>
arubin-, already covered that lol
<lolzie>
I'm trying to remember where I saw this sort of pattern before, I recall it being justified in its circumstances
siyusong has quit [Quit: Computer has gone to sleep.]
<Spooner>
lolzie : You could also allow Person.new age: 21, height: 180, name: "Bob" if you had a lot of values and wanted them named rather than just a big list.
FDj has joined #ruby
UberNerdGirl has quit [Quit: UberNerdGirl]
<FDj>
what's the best way to create a path of nested directories? i.e. mkdir -p my/nested/directory/path ?
<Spooner>
The problem with that example, is that a Person that isn't set isn't really a full person, so those sort of values should be in the constructor (or defaulted if that is appropriate). At the point of Person.new the object is actually unusable.
the_jeebster has quit [Quit: Leaving.]
bradhe_ has quit [Read error: Connection reset by peer]
<Spooner>
lolzie : Yeah, it is the 1.9 hash syntax.
Goles has quit [Read error: Operation timed out]
slainer68 has joined #ruby
<Spooner>
lolzie : Though if you only have 3 params, then it probably isn't such a problem if you just use ordering for parameters. I don't like using Hash options except for options, rather than to name params. Maybe in 2.0 I'll change my mind though.
akem has joined #ruby
cpruitt has joined #ruby
wuzzzzaah has joined #ruby
Xeago has joined #ruby
headius has quit [Quit: headius]
sideshowcoder has quit [Read error: Operation timed out]
<Spooner>
*lolzie : Yeah, it is the 1.9 syntax for Hashes with symbolic keys.
sdwrage has joined #ruby
love_color_text has quit [Ping timeout: 264 seconds]
kirun has joined #ruby
slainer68 has quit [Ping timeout: 255 seconds]
manizzle has joined #ruby
stkowski has quit [Quit: stkowski]
love_color_text has joined #ruby
<lolzie>
Spooner: cheers mate :)
lolzie has quit [Quit: Page closed]
<Spooner>
lolzie the other config idiom that is popular is: Person.new do |p| p.name = "frog"; p.age = 21; end (e.g. used in gemspecs).
Neomex has quit [Quit: Neomex]
sagax has joined #ruby
Russell^^ has joined #ruby
nitti_ has quit [Remote host closed the connection]
jbw has quit [Ping timeout: 240 seconds]
phinfonet has joined #ruby
bemson has joined #ruby
chrisramon has joined #ruby
yaymukund has joined #ruby
fermion has quit [Quit: P]
<bemson>
ruby noob here - anyone know if there is any gem comparable to node's express.js?
<Spooner>
bemson : We probably don't know what express.js is, even if we know about similar gems.
dnstbr has quit [Quit: Computer has gone to sleep.]
<oz>
Spooner: well express.js is kinda similar to Sinatra :)
<Spooner>
bemson : Sinatra ;)
<bemson>
Spooner: yes, sorry.. express.js lets you easily define routes for a server to respond with
kil0byte_ has joined #ruby
<bemson>
Spooner: yes, I believe it borrows from Sinatra
stephh has quit [Ping timeout: 248 seconds]
<Spooner>
oz Ta :D
daniel_- has joined #ruby
sent-hil has joined #ruby
stkowski has joined #ruby
kil0byte has quit [Ping timeout: 256 seconds]
apok has quit [Remote host closed the connection]
<bemson>
Spooner: many thx - just found sinatrarb.com and it's exactly the same api
<bemson>
thx!
love_color_text has quit [Ping timeout: 252 seconds]
apok has joined #ruby
<Spooner>
bemson : Sinatra is ace, so you can't go wrong.
hotovson_ has quit [Remote host closed the connection]
BSaboia__ has joined #ruby
vlad_starkov has joined #ruby
cableray has joined #ruby
_Mon_Ouie_ is now known as Mon_Ouie
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
love_color_text has joined #ruby
BSaboia has quit [Ping timeout: 248 seconds]
IrishGringo has joined #ruby
xorigin has joined #ruby
dmiller has quit [Remote host closed the connection]
wuzzzzaah has quit [Ping timeout: 260 seconds]
wuzzzzaah has joined #ruby
SegFaultAX|work has quit [Ping timeout: 246 seconds]
UberNerdGirl has joined #ruby
chrisramon has quit [Ping timeout: 260 seconds]
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
armenb has quit [Ping timeout: 248 seconds]
stephh has joined #ruby
yaymukund has quit [Ping timeout: 264 seconds]
Takehiro has joined #ruby
yaymukund has joined #ruby
sambio has joined #ruby
<shevy>
hmm off topic... I have a .pdf file and would like to modify it. any ideas how to? like, highlight some text parts yellow
kil0byte_ has quit [Remote host closed the connection]
sailias has quit [Read error: Operation timed out]
hsbt is now known as hsbt_away
<rking>
Man, I've completely awoken from the rspec spell. For so many reasons, MiniTest is the one true way for me.
<swarley>
rking; i use minitest/spec :p
<rking>
My #1 complaint is that it compiles to junky ASTs. Test::Unit style is Plain Old Classes. minitest/spec fixes that somewhat
hsbt_away is now known as hsbt
freezey has quit [Quit: freezey]
love_color_text has quit [Remote host closed the connection]
h4mz1d has joined #ruby
<rking>
But I've been using the non-spec minitest stuff, and I don't miss ".should" at all
hbpoison has joined #ruby
<rking>
This way makes it so easy to scan and see what's boilerplate stuff versus what is assertions.
<rking>
it "blah" do … end doesn't communicate any more (or even golf down) def test_blah … end
alvaro_o__ has quit [Ping timeout: 268 seconds]
mengu has joined #ruby
<swarley>
rking; i like the minitest/unit stuff as well. Especially the "must" trick
<rking>
I do like how really advanced use, with implied subjects, etc., can look… but I view RSpec (and specs) as an interesting but overly-fancy experiment.
<ddd>
hehe keep feeding me these testunit and minitest urls
<ddd>
i'll take em all day long
mengu has quit [Read error: Connection reset by peer]
tomku has quit [Quit: WeeChat 0.3.7]
mengu has joined #ruby
vlad_starkov has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
tomku has joined #ruby
<rking>
swarley: What am I missing? Why would it be better to say must 'foo' do … end over def test_foo … end ?
hsbt has quit [Ping timeout: 246 seconds]
mando has quit [Remote host closed the connection]
<rking>
All that does is obscure the actual method that will be created, so you have a harder time tinkering around at run-time (e.g. from within irb or pry)
<swarley>
It's just for readability
<rking>
That's not any more readable IMO
peregrine81 has joined #ruby
<rking>
It makes you stop and say, "wait, huh… oh, Ok… I guess."
<swarley>
It will say something along the lines of
<swarley>
Failed test "must be empty"
<rking>
Your eyes instantly filter the "def test_" part down
blazes816 has joined #ruby
<ddd>
mine don't but that i think is because i'm new to it
<rking>
The output of test_foo is similar
hbpoison has quit [Ping timeout: 265 seconds]
hsbt has joined #ruby
workmad3 has joined #ruby
<rking>
ddd: So when you're reading somebody's suite, you feel like if you saw:
<rking>
must 'swizwangle' do
jenrzzz has joined #ruby
dnyy has quit [Read error: Connection reset by peer]
<rking>
That would help you more than seeing the same body prefixed by:
<rking>
def test_swizwangle
<ddd>
rking: for *me* yes
<rking>
Kk, I appreciate that feedback.
<ddd>
but again, thats probably because i'm new to tu and mt
<rking>
I've seen Test::Unit style methods too much to be slowed down by that.
<rking>
Actually I don't even read that thing at first, I just look at what it says after "assert…"
dnyy has joined #ruby
<ddd>
to *me* that reads normal enough english to instantly grok it without the added mental step of removing the def test_ part and then going on with the test meat
<rking>
Then back up to what it did to get to the assertion (and again, in Test::Unit style you can see which are the assertions and which are the setup much easier than RSpec)
<rking>
*Then* I might read the name of the test
<rking>
ddd: Well, for all we know "must" is some special thing that does more than simply assert.
<rking>
Urr, it doesn't assert. It just runs.
<rking>
I assume (after glancing around at it)
<ddd>
rking: i'm actually in the process of trying to rewrite all my rspecs into minitest so i know both syntax structures.
awarner has quit [Remote host closed the connection]
<rking>
That's exactly my point, we're clueless about whether it's a synonym or a subtle distinction.
<rking>
ddd: Cool exercise.
<ddd>
rking: come see me when i'm done. it migh tbe that with the exposure of doing so, my mind will change. idk
under_my_shoes has quit [Quit: Leaving]
sambio has joined #ruby
<rking>
ddd: Are you using plymouth? It's fun.
under_my_shoes has joined #ruby
<ddd>
no. i'm still in the educate-myself mode
<ddd>
reading
<ddd>
i've never written a single TU or MT before. read them in other people's source but not written a single one of my own
<ddd>
went from cuke to turnip+rspec, to just rspec. only TFs i've used.
<rking>
plymouth is a bit of an experimental workflow. Sometimes it wins, sometimes it loses.
<ddd>
ehh ignore that #readme part, just c7P'd my go bar
kendrick_ has quit [Remote host closed the connection]
freezey has joined #ruby
aquaranto has quit [Remote host closed the connection]
g-ram has quit [Quit: Computer has gone to sleep.]
<rking>
ddd: c7P'd?
freezey has quit [Client Quit]
<ddd>
huh, supports rspec too i see. i'll play with it
<ddd>
hehe forgot to press shift. meant &
<rking>
c&p, sorry
<rking>
Hehe, yeah, not trying to give you a hard time. I thought I was about to learn some cool clipboard-related shortcut. ☹
<rking>
ddd: Yeah, that plymouth.
<Eiam>
if I have an array like a = ["a","z","hello","test"] and another array thats b= ["z","a","yo","hello"], I want to sort b so it matches a as closely as it can in order
<rking>
BTW be warned that it will work with rspec, but it'll work better with Test::Unit
<ddd>
rking: thanks. i'll spend the weekend playing with it then.
<Eiam>
so b would be sorted like ["a","z","hello","yo"]
<rking>
ddd: Please do. There are lots of exciting possibilities for streamlining the testing process through something like this.
<ddd>
rking: btw, still wanting to do the docs, just working on some stuff before i get to that.
walbert has joined #ruby
baphled has joined #ruby
<graft>
hey anyone know a good colormapping gem?
<rking>
ddd: Yep, same here man.
<ddd>
kids interupting mostly hehe
<swarley>
graft; for what?
<graft>
for, say, turning 0.0-1.0 to colors from blue to red
<Spooner>
Eiam: b.sort_by {|x| [a.index(x), a] }
<yxhuvud>
eiam: b.sort_by {|el| a.index(el)}
<rking>
Winner: yxhuvud.
reset has joined #ruby
<Spooner>
rking Not on my screen ;)
<rking>
Oh snap
<Eiam>
i see Spooner first
<Eiam>
hehe
<Eiam>
ill give it a worl
<yxhuvud>
not on mine either.
<Eiam>
whirl
<Eiam>
thakns
frogprince_mac has quit [Ping timeout: 260 seconds]
<rking>
Nono, I mean by virtue of a simpler solution in (almost) the same time.
<Spooner>
Eiam : However, the answers are different. Depends how you want things sorted if they aren't in the a list.
<rking>
Actually, yxhuvud's fails
under_my_shoes has quit [Ping timeout: 246 seconds]
<rking>
So does Spooners.
stephenjudkins has quit [Quit: stephenjudkins]
deadalus has quit [Ping timeout: 256 seconds]
<rking>
You guys just sketch straight into IRC? =P
<yxhuvud>
yes?
zigomir has quit [Quit: Leaving]
<Spooner>
Yep ;) I was in a race...
<rking>
b.sort_by {|el| a.index(el) || 0}
<swarley>
:p i never test my one liners before posting them
<rking>
Un-pro.
<swarley>
Well, my correct to incorrect ratio is pretty good so far
<yxhuvud>
rking: uh. that will position all the unincluded matches along with the first element.
<Spooner>
rking : Still doesn't give ["a","z","hello","yo"], but it doesn't fail ;)
<swarley>
so i'd say i'm doing pretty well
<rking>
Here's the one-liner for the incurably lazy: gem install pry && pry -e ' a = ["a","z","hello","test"] ; b= ["z","a","yo","hello"]; b.sort_by {|el| a.index(el) || -1}'
havenn has quit [Remote host closed the connection]
<rking>
Spooner: How can you get "yo" out of "test"?
<swarley>
lol
<swarley>
<Eiam> so b would be sorted like ["a","z","hello","yo"]
<swarley>
rking; how do you get test out of yo?
Araxia has quit [Read error: No route to host]
<Spooner>
rking : b.sort_by {|x| a.index(x) || Float::INFINITY } Is strictly correct ;) However, how it works with multiple unfound elements is undefined by the original spec :D
mockra has joined #ruby
Araxia has joined #ruby
<swarley>
wait what are we doing?
<yxhuvud>
I suppose (a & b) + (b - a) might work too
<swarley>
What is the goal?
jitesh_shetty has quit [Remote host closed the connection]
<yxhuvud>
though it depends on how duplicates should be handled
nemesit has joined #ruby
<rking>
swarley: The input says "test" and the output says "yo"
<rking>
Spooner: I like that.
<Spooner>
a = ["a","z","hello","test"]; b= ["z","a","yo","hello"]; something to get ["a","z","hello","yo"] by sortin b as much as possible similarly to a.
<swarley>
ah
<rking>
Spooner: Either Float::INFINITY or -1 are right answers
<swarley>
hm
<pothibo>
can you manipulate a?
Servidorv has joined #ruby
<Spooner>
rking : No, since in the example output, the unfound item is at the end, so -1 is not correct.
Dreamer3 has joined #ruby
caleb_io has quit [Quit: Leaving...]
<rking>
Spooner: Aha, I missed his 2nd line. You're right.
<swarley>
b = a (b-a)
<swarley>
:)
<Dreamer3>
Something.new() => nil - can i write code to do that?
codezombie has joined #ruby
Ziioynx has quit [Remote host closed the connection]
<swarley>
err
mneorr has quit [Remote host closed the connection]
<Spooner>
rking : However, I failed in my original, so I count it as a shared victory ;)
nwertman has joined #ruby
<yxhuvud>
swarley: no. you have to remove the parts of a that isn't in b. Also, duplicates.
<pothibo>
b = (a & b).uniq ?
<Spooner>
Dreamer3 : That makes no sense whatsoever. You could do it but it would be fundamentally wrong :D
<codezombie>
can anyone take a look at this, and let me know if I'm doing anything incredibly stupid? I'm trying to efficiently convert a PDF to JPG, and resize to various versions for display.
<Ivo>
If I want to create a hash which uses an array for keys and the values all '1', what's the nicest way to do that?
<swarley>
(a - (b-a))
deadalus has joined #ruby
deadalus has quit [Changing host]
deadalus has joined #ruby
<swarley>
oh
krawchyk has quit [Remote host closed the connection]
<swarley>
i was trying to get
<pothibo>
((a&b) + b).uniq
<yxhuvud>
swarley: no. that will give you a list of all elements in a that isn't in b.
<Spooner>
Dreamer3: Yes, you should raise on a constructor error. Doing it the other way is just wrong. You _could_ however, make a different constructor: def Generic.moop(arg); arg ? Generic.new(arg) : nil; end
<swarley>
"yo", so i had it right
<swarley>
i changed it to get the opposite
awarner has joined #ruby
<pothibo>
I didn't see you had to keep the "yo"
<swarley>
(a - (a-b)) + (b-a) :p
Gajanan has quit [Client Quit]
<Spooner>
swarley And sort them based on the postion in a.
<swarley>
That's what I had before i started working on the wrong thing
<swarley>
Ah, good point
<Dreamer3>
Spooner: ha, why didn't i think of that :)
<swarley>
- doesnt care
recycle has joined #ruby
<pothibo>
am I gettting ignored?
<yxhuvud>
swarley: go back up your scrollback and read my previous answer using & - and +.
dylanjha has quit [Quit: Leaving...]
<Spooner>
Dreamer3 : Oh good. I persuaded you not to break .new for humanity ;)
recycle has quit [Remote host closed the connection]
<swarley>
Does position in b matter?
sideshow1oder has joined #ruby
<Spooner>
swarley: No idea, we got lost and I think the questioner fell in a pit trap.
SJr has quit [Excess Flood]
sideshowcoder has quit [Ping timeout: 252 seconds]
SJr has joined #ruby
SJr has quit [Excess Flood]
slainer68 has joined #ruby
deadalus has quit [Ping timeout: 264 seconds]
piotr__ has quit [Read error: Operation timed out]
rubious has quit [Read error: Connection reset by peer]
`brendan has quit [Ping timeout: 276 seconds]
rubious has joined #ruby
c0rn_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
SJr has joined #ruby
piotr_ has joined #ruby
judd7 has joined #ruby
caleb_io has joined #ruby
<Spooner>
Ivo h = [:a, :b].each_with_object({}) {|e, h| h[e] = 1 }; h[:a] #=> 1
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
fantazo has joined #ruby
awestroke has quit [Remote host closed the connection]
<mr-rich>
Is there a way to quell warnings within a ruby script? Because of rvm, I have to shebang the call to ruby (#!/usr/bin/env ruby) and it does not allow the passing of arguments like -W0 ...
<swarley>
Spooner; i found a solution!!!... its probably able to be optimized, have fun
<swarley>
[26] pry(main)> (a.each_with_object([a.dup, b.dup, [], []]) {|x,y| if(y[1].include? y[0][0]) then y[2].push y.first.shift; y[1].delete(y[2].last); else y.last.push y[0].shift end })[2,3].flatten
<swarley>
=> ["a", "z", "hello", "test"]
<Spooner>
swarley : You are perverse.
<swarley>
indeed
<swarley>
wait
<Spooner>
Pity the output should be ["a","z","hello","yo"] :D
<swarley>
I totally missed using the each lol
<swarley>
WAT
<swarley>
damn it
nina has joined #ruby
<swarley>
it should be
<Spooner>
Output should be elements of b, ordered the same as a (with elements not in a at the end).
<swarley>
else y.last.push y[1].shift
mark_locklear has quit [Remote host closed the connection]
<swarley>
Yeah, that's probably not the best way to do it.. but it works
yekta has quit [Quit: yekta]
<Spooner>
Poor guy who asked the question never thought it would take 1000 lines of of IRC to solve ;)
<swarley>
LOL
<swarley>
It was probably an exercise in a book too
maletor has joined #ruby
yoklov has quit [Quit: bye!]
<shevy>
hmm
<shevy>
I have something like this right now...
<shevy>
user_input = $stdin.gets.chomp
<swarley>
mk?
<shevy>
and then, I have two case/when menus.
<swarley>
"The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well." -- Phil Wadler, POPL 2003
<shevy>
the first acts on the first word (until ' ' was found), the second acts on all words
sdwrage has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
<shevy>
I dont remember why I wanted to use two different case / when menus back then... hmmm
<shevy>
but it annoys me!
haxrbyte has joined #ruby
<shevy>
I dont remember why I did that
invisime has quit [Quit: Leaving.]
cpruitt has quit [Quit: cpruitt]
haxrbyte has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
<shevy>
this will be one huge case / when menu
<shevy>
like 3000 lines
robustus has joined #ruby
NemesisD has joined #ruby
<Spooner>
swarley : "The essense of XML is that regardless of how bad it is, it is still getting used almost ubiquitously because people have sunk so much time working with it in the past" -- Spooner 2012
Takehiro has joined #ruby
<NemesisD>
hi all, i've got a datetime in the format of 2012-10-19 16:18:15, I'm pretty sure that's eastern time. is there a reliable way to parse it to UTC?
bradhe has quit [Ping timeout: 244 seconds]
Morkel has quit [Quit: Morkel]
<workmad3>
Spooner: added to which, XML isn't actually too bad... just it's used for so many fracking unsuitable things
<swarley>
no its just awful
<NemesisD>
i can't just add -0500 to the end of it because that number changes according to daylight savings time. i'd prefer to not add activesupport as a dependency as well
<swarley>
it looks awful, its terrible to write
<swarley>
0 readability
<workmad3>
swarley: it's actually a really nice, readable format for some things
geekbri has quit [Remote host closed the connection]
<workmad3>
swarley: but most of those aren't the things that it's used for
<swarley>
Usually when i see something using XML i say to myself
<swarley>
"Wow, if only this used YAML or JSON"
bigmcq77 has quit [Quit: Computer has gone to sleep.]
<swarley>
"Maybe i could see what the hell was going on"
Takehiro has quit [Ping timeout: 246 seconds]
<troessner>
:D
<troessner>
same with me swarley
<troessner>
but i guess the same goes for EVERY non java dev
<swarley>
i understand that sometimes you want a schema or whatever
<workmad3>
troessner: I'm no java dev :P
<troessner>
workmad3, no offense.:)
awestroke has joined #ruby
sailias2 has quit [Quit: Leaving.]
<troessner>
to be fair, 80% of all java devs i know prefer json over xml
<workmad3>
sometimes XML fits... I don't find YAML more readable for largish tree structures, for example, and I don't find large JSON readable at all
<troessner>
so there IS progress
<troessner>
:)
mando has joined #ruby
<workmad3>
but there's a massive amount of XML misuse, and I certainly don't think it's very good for machine-machine communication :)
icole has quit [Ping timeout: 260 seconds]
nitti has quit [Remote host closed the connection]
hbpoison has joined #ruby
robertotauille has quit [Quit: Leaving...]
<swarley>
its too big for machine to machine
<swarley>
having all of the open and close tags
<Servidorv>
hey guys how are you??
<troessner>
actually I'd say if you have huge xml trees your data abstractions are wrong
<troessner>
but that's a cheap shot, i know
<workmad3>
troessner: not huge, just largish ;)
Bosma has quit [Quit: leaving]
<troessner>
ah, there's a difference, i see..:D
<swarley>
Yeah, XML should be reserved for standardized variance
nitti has joined #ruby
<swarley>
where things can be wildly different
<swarley>
but sort of the same
burgestrand has joined #ruby
<swarley>
i.e HTML
ryanlecompte has joined #ruby
drago757 has joined #ruby
sdwrage has quit [Read error: Connection reset by peer]
nitti has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 276 seconds]
LucidDreamZzZ has quit [Remote host closed the connection]
iamjarvo has quit [Quit: Computer has gone to sleep.]
skaczor has joined #ruby
Xeago has quit [Remote host closed the connection]
burgestrand has quit [Quit: Leaving.]
troessner has quit [Quit: Leaving]
conor_ireland has joined #ruby
timonv has joined #ruby
stephenjudkins has joined #ruby
caleb_io has quit [Quit: Leaving...]
g-ram has joined #ruby
MrVamp has joined #ruby
manizzle has quit [Ping timeout: 252 seconds]
blazes816 has quit [Quit: blazes816]
asobrasil has left #ruby [#ruby]
bradhe has joined #ruby
<MrVamp>
is someone here on the CS169.1x ?
<swarley>
?
nitti has joined #ruby
<MrVamp>
its an online course
<MrVamp>
and is using Ruby
<MrVamp>
:d
nitti has quit [Remote host closed the connection]
<conor_ireland>
MrVamp: any good? what level is it at?
<MrVamp>
saas
GoGoGarrett has quit [Remote host closed the connection]
<conor_ireland>
ah
<MrVamp>
check it out at edx.org
<conor_ireland>
I watched some of that last time, did some of the assignments too
icole has joined #ruby
<MrVamp>
im really newbee on programation and got stuck in some things...
jenrzzz has joined #ruby
<MrVamp>
wonder if someone could assist or kind og walkthrought
<conor_ireland>
MrVamp: someone might, you will have to ask a question to find out though
<Spooner>
MrVamp : Don't ask us. We are the worst kind of Roobs.
<conor_ireland>
My Ruby is just poor php and some decent java in ruby syntax
graft has quit [Ping timeout: 272 seconds]
bluOxigen has quit [Ping timeout: 276 seconds]
Araxia_ has joined #ruby
<MrVamp>
lol
Araxia has quit [Read error: No route to host]
Araxia_ is now known as Araxia
bapa has joined #ruby
<Spooner>
MrVamp : But yes, since we have varying interests and specialities, it is best to ask so that we can decide to answer, not ask for an individual who knows the answer to all questions.
timonv has quit [Remote host closed the connection]
<conor_ireland>
Spooner: where is that person, I would like to meet them
under_my_shoes has quit [Quit: Leaving]
g-ram has quit [Quit: Computer has gone to sleep.]
under_my_shoes has joined #ruby
<Spooner>
conor_ireland : She's too busy to hang out in #ruby to answer questions ;)
mneorr has quit [Remote host closed the connection]
<MrVamp>
haha thanks people
mneorr has joined #ruby
sepp2k has quit [Remote host closed the connection]
philcrissman has quit [Remote host closed the connection]
havenn_ has joined #ruby
rburton- has joined #ruby
devdazed has quit [Quit: Bye]
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
Araxia has quit [Ping timeout: 246 seconds]
<MrVamp>
in %td= link_to "#{movie.release_date}", movie_path(movie) how to i change the output from 1992-11-25 00:00:00 UTC to 1992-11-25 ?? anu sugestion :D
<conor_ireland>
use a formatting method on that release_date most likely
<Spooner>
MrVamp : #strftime
<asteve>
strftime
<asteve>
damn, too late
stephh has quit [Ping timeout: 248 seconds]
peregrine81 has quit [Quit: Goodbye.]
<asteve>
but, .strftime("Y-m-d")
<swarley>
%Y-%m-%d
<asteve>
that's what I said
<MrVamp>
ok let me try, thanks steve
<Spooner>
I was letting MrVamp look it up ;)
stephenjudkins has quit [Quit: stephenjudkins]
<asteve>
Spooner: don't let people think for themselves
<swarley>
But without % :p
<asteve>
you'll never create sheeps
<asteve>
swarley: I'm pretty sure they're there
<conor_ireland>
I don't like how ruby uses functions sometimes but methods other times, is date not an object?
<rking>
Hehe, in this gem, somebody uses a temp var "map" and another "inject", for random things.
<rking>
Kinda confusing to read.
<rking>
(Within 3 lines of each other, BTW.)
<Spooner>
Any reason why I should get a certificate verify failed error pushing a gem? I have double-checked my ./gem/credentials file is correct.
sdwrage has joined #ruby
swarley has joined #ruby
sdwrage has quit [Read error: Connection reset by peer]
<Spooner>
rking : in making games, I often confuse myself by having a map object ;) But at least that is a map.
sent-hil_ has joined #ruby
timonv has joined #ruby
<conor_ireland>
x_map
sdwrage has joined #ruby
<rking>
map_ maybe?
<Spooner>
rking : I used to work with a "professional" programmer who named all his variables after characters/creatures in the LotR books. Needless to say, they couldn't fire him ;)
<rking>
I think that's a Python custom (because they have so many important things in global namespace)
dmerrick has quit [Ping timeout: 246 seconds]
<Paradox>
Spooner, map inherits enumerable which lets you map maps
<rking>
Spooner: That's cool. I like that guy.
caleb_io has joined #ruby
<rking>
"Code obscurity is job security." — Ingy döt Net
<conor_ireland>
except at a good company
<Spooner>
rking : When he wasn't doing that, he was sleeping or playing flash games. It was not terribly good for morale that he literally couldn't get himself fired for that ;)
sent-hil has quit [Ping timeout: 260 seconds]
answer_421 has quit [Ping timeout: 276 seconds]
<caleb_io>
rking maybe when you've been employed 5 years.. if you go into a company and start writing obscure code, I feel that you wouldn't last very long ;P
<caleb_io>
unless you're the only programmer.
<rking>
Oh yeah
<rking>
You gotta give it that first month of pretending to try.
<rking>
If I was malicious, I'm 100% sure I could get hired at a series of 3 or 4 jobs in sequence and get paid by doing this maneuver.
<caleb_io>
exactly. then you're valued when the other programmers can't figure out what you're typing ;) you appear.... more intelligent.
<conor_ireland>
unless they have code reviews, like any decent company
<rking>
Just work a bit, ensconce a bit, chill a lot.
<rking>
conor_ireland: Sure. And decent companies are what, 1 out of 10?
<Spooner>
rking yeah, I was going to say that :D
<rking>
You could get hired on the 9 out of 10 companies and do just enough to be unfirable, then go play in the daisies for a living.
<caleb_io>
that's why you work in internal tools... surely anything you make could be an internal tool ;)
<caleb_io>
you just happen to create a media encoder to watch a movie.
<rking>
Haha
<conor_ireland>
rking: yes, but I would sooner actually work there than get an easy "for-life" job writing obscure code at a bad one
under_my_shoes has quit [Quit: Leaving]
Faris has joined #ruby
<rking>
conor_ireland: Absolutely my man. I'm just talking a hypothetical, here.
under_my_shoes has joined #ruby
<conor_ireland>
rking: yeah, I agree with the point and have seen it several times
<conor_ireland>
but it is a generally silly one imo
erichmenge has joined #ruby
rowsdower has quit [Quit: Konversation terminated!]
theRoUS has quit [Ping timeout: 264 seconds]
<swarley>
If i get hired, I'll just use a code compresser to take out all unnecessary spaces, tabs, and new lines. Then store the original code on a flash drive that i'll keep in my closet c:
Monie has joined #ruby
Monie has quit [Changing host]
Monie has joined #ruby
<swarley>
boom stupid job security
erichmenge has quit [Client Quit]
<Spooner>
swarley : If you were serious, you'd write all your code as regexps!
<conor_ireland>
as butterfly flaps
<swarley>
LoL
h4mz1d has quit [Ping timeout: 246 seconds]
<swarley>
conor_ireland; nice xkcd reference :p
<conor_ireland>
love xkcd
vhd has joined #ruby
<caleb_io>
anyone see opal today? the ruby -> javascript compiler?
Faris has quit [Client Quit]
<Spooner>
swarley : The problem with the white-space remover is that you can jsut spit it through some sort of lint to get it all formatted again. You need to auto-rename all methods and variables as x_000001, etc too, for that to work properly.
armenb has quit [Ping timeout: 260 seconds]
<caleb_io>
Spooner: can obfuscate like Google does.
<rking>
I plan on making a project where, in vim, before I edit any files I gg=G, but after I'm done I :%ce
nitti has joined #ruby
<rking>
Or :%ri, I haven't decided.
<rking>
But if you did a subtle form of that you could be absolutely irremovable.
burgestrand has joined #ruby
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
<Spooner>
Ultimately, though, they could fire you and get someone to rebuild it. You need to make sure the thing you make is core functionality and not easily replicable.
Pip has joined #ruby
<Pip>
Any good IDE for ruby on windows?
<Spooner>
I think slacking, at that level, is probably hard work ;)
icooba has quit [Quit: Computer has gone to sleep.]
alanp_ has joined #ruby
<Spooner>
pip I use Rubymine
<conor_ireland>
rking: I have a feeling some people have that option by the way some of their code is
<swarley>
Spooner; i could always just encrypt the code with a salted encryption
<Pip>
Spooner, Is it free software?
<swarley>
also, did you guys know that begin; rescue; end structures have an else clause for if rescue is never reached?
<Spooner>
swarley : Yeah, but you'd have to unencrypt it at run-time, so they could access it easy enough.
<swarley>
Because i didnt
timonv has quit [Remote host closed the connection]
<rking>
conor_ireland: Yes, but then *they* have to deal with it. What's that one "cleverness principle", Kernigan I think, that says "Later on, I'll have less context than I do now. So, by definition, if I write the cleverest code possible, I'll be unable to understand it afterward."
jeffreybaird has quit [Quit: jeffreybaird]
<Spooner>
Pip nope. You didn't specify (I use a free version though, since I only make free, open source software with it).
<conor_ireland>
rking: sometimes, a lot of the time, they don't have to deal with it
mjbamford has quit [Quit: Leaving...]
<Pip>
Spooner, Is there a free version of it?
<conor_ireland>
Pip: netbeans
<Spooner>
Pip No, you have to apply for a free license to use it for non-commerical open source work.
<caleb_io>
pip I also use RubyMine, I like it. I know that Aptana has one I think.
<conor_ireland>
not based off that, it is just a great free ide that is decent with ruby
<Spooner>
pip 30 day trial though.
<Pip>
conor_ireland, Isn't it outdated plugin?
<caleb_io>
RadRails I think, never used it.
nitti has quit [Ping timeout: 246 seconds]
* Pip
forgets about Rubymine
<caleb_io>
And NetBeans has a ruby plugin for an older NetBeans.
<conor_ireland>
Pip: yeah, still works though
<rking>
It's Kernigʜan, and, "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"
<caleb_io>
If you do a lot of Ruby/Rails pip, RubyMine is worth the cost imo.
<conor_ireland>
I used textmate, no windows version
<Pip>
I don't want to pay half a penny for this
mjbamford has joined #ruby
* Pip
goes to install ruby plugin for netbeans
<caleb_io>
Aptana RadRails is free.
<caleb_io>
and open source.
icooba has joined #ruby
<caleb_io>
it's built on eclipse I think though.
bwlang has left #ruby [#ruby]
alanp has quit [Ping timeout: 276 seconds]
<Pip>
Is it better than netbeans?
<caleb_io>
I used to use Zend Studio for Eclipse for PHP, and really liked Eclipse.
<Spooner>
caleb_io : As you say, I think it would be worth it if you used it commercially...and if you are non-commercial it is free. Nothing to complain about there.
<caleb_io>
and used Aptana Studio as well and liked it, so I can imagine RadRails would be good.
<caleb_io>
Spooner: I use it both at work (commercially) and at home (paid for even though I only use it for non-commercial)
<Spooner>
caleb_io : I'll pay for it if I ever manage to get paid for Ruby, which is unlikely :D
zodiak has quit [Ping timeout: 244 seconds]
<caleb_io>
haha why is that.
Dreamer3 has quit [Quit: Computer has gone to sleep.]
hadees has quit [Quit: hadees]
<swarley>
i would love to get paid for ruby
<swarley>
but i know i probably wont
<Spooner>
swarley : If I give you $1 for Ruby and you give me $1 for Ruby, then we both get paid ;)
<caleb_io>
why not? j/w.
<swarley>
Ya
<swarley>
The most likely way currently that you would get paid to code in ruby is rails
<Spooner>
caleb_io Because he thinks he sucks and I know I suck.
<swarley>
i suppose i could force myself to use rails..
<swarley>
Spooner; no you dont lol
koivula has quit [Ping timeout: 240 seconds]
<swarley>
also, aren't you working on the new make system?
koivula has joined #ruby
<Spooner>
swarley : Make? Nope.
roychri has quit [Quit: And that's the way the cookie crumbles!]
<swarley>
I can't remember what it was
<Spooner>
Do you mean Releasy?
<swarley>
what's your github page?
<swarley>
Yes that
Montas has quit [Quit: Page closed]
<caleb_io>
hey I suck too but got hired. I did PHP for a decade and got hired for Ruby and just learn as I go.
<swarley>
caleb_io; doing rails work?
iamjarvo has joined #ruby
<caleb_io>
yep
c0rn_ has quit []
locriani_ has quit [Read error: Connection reset by peer]
<swarley>
yeah that's the thing
<davidcelis>
careful...
<caleb_io>
but I do just plain ruby as well, a lot of our internal stuff just relies on Ruby.
<Spooner>
caleb_io : When can swarley start? He'll code for food stamps, you know!
<swarley>
I indeed
robotmay has quit [Read error: Connection reset by peer]
<swarley>
I already code constantly anyway
<swarley>
might as well get paid for it
<davidcelis>
swarley: ABC
<Spooner>
swarley : If you are getting paid for it, though, you aren't allowed to build XML parsers.
<davidcelis>
err, ABS
robotmay has joined #ruby
tomsthumb has quit [Quit: Leaving.]
tommyvyo has joined #ruby
<swarley>
Spooner; I'm currently converting rapidxml's header to C. I'll write my own parser after i've had more time to spend on theory and design.
<Eiam>
swarley, rking sorry I had to step out to some meetings. You were correct in that unfound items are just appended at the end and their order isn't 'relevant' as long as they are at the end
<kkiero>
ok thanks, but I thought more of simple kind of algorithms task to get to know ruby better
<kkiero>
or any other language in the future
uris has quit [Quit: Leaving]
<davidcelis>
the koans _would_ give you ruby knowledge
ebobby has joined #ruby
<davidcelis>
or programming knowledge that would help you learn other languages
enricostn has quit [Remote host closed the connection]
caleb_io has joined #ruby
LouisGB has joined #ruby
robotmay has quit [Read error: Connection reset by peer]
<kkiero>
well I don't have problems with learning new languages. the point is to have some problem to solve so you can get familiar with syntax in practice
<swarley>
try the book, the well grounded rubyist
caleb_io has quit [Client Quit]
_JamieD_ has quit [Quit: _JamieD_]
robotmay has joined #ruby
bemson has quit [Quit: bemson]
<swarley>
good god i'm having such a hard time focusing on code
BSaboia__ has quit [Read error: Connection reset by peer]
chin-tastic has joined #ruby
freeayu has joined #ruby
<bricker>
How would I store a Proc or similar in a hash as a value, so that when the pair gets called, the Proc gets called? I ask because I'm storing a Time value in a hash which is a class constant
<swarley>
you mean, like a dynamic key?
bbttxu has joined #ruby
marius has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
<bricker>
swarley: no, the value is dynamic. DEFAULTS = { time: -> { Time.now } }
<swarley>
oh
jenrzzz has quit [Ping timeout: 272 seconds]
<swarley>
in that example
<swarley>
DEFAULTS[:time][]
kpshek has quit []
<swarley>
[] is the same as doing DEFAULTS[:time].call
<bricker>
swarley: so I can call DEFAULTS[:time].call, but I am looking for how to make that happend automatically since I'll be passing that constant directly into a method
<swarley>
ah
<swarley>
use lazy
pdswan_ has joined #ruby
<swarley>
do this
mikepack has quit [Remote host closed the connection]
pdswan has quit [Ping timeout: 246 seconds]
pdswan_ is now known as pdswan
a_a_g has quit [Quit: Leaving.]
<swarley>
you'd need to use the lazy gem.. But in all honesty, its not that complicated
Kruppe has joined #ruby
Liothen_ is now known as Liothen
Liothen has quit [Changing host]
Liothen has joined #ruby
<bricker>
swarley: yeah this isn't a big enough to deal to use a gem. I think I might just put the hash into a method and do it that way
workmad3 has quit [Read error: Operation timed out]
<swarley>
you can easily implement the class in a few lines i think
Tearan has joined #ruby
kaawee has quit [Ping timeout: 255 seconds]
nanderoo has quit [Quit: Leaving.]
kaawee has joined #ruby
mjbamford has quit [Quit: Leaving...]
<swarley>
ah, lazy isnt always dynamic
TomRone has quit [Ping timeout: 240 seconds]
EPIK has quit [Read error: Connection reset by peer]
EPIK has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
stopbit has quit [Quit: Leaving]
chrishunt has quit [Ping timeout: 255 seconds]
mando has quit [Remote host closed the connection]
shadoi has quit [Quit: Leaving.]
Koshian__ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
Pip has quit [Ping timeout: 245 seconds]
TomRone has joined #ruby
artOfWar_ has quit [Ping timeout: 252 seconds]
rowsdower has joined #ruby
pdswan_ has joined #ruby
Koshian__ has joined #ruby
lindenle_ has joined #ruby
<lindenle_>
If I have two versions of a gem installed is there a way to say use version A?
chrishunt has joined #ruby
Pip has joined #ruby
pdswan has quit [Ping timeout: 246 seconds]
pdswan_ is now known as pdswan
nitti has joined #ruby
LucidDreamZzZ has joined #ruby
<Spooner>
lindenle_ : Bundler is the standard way to specify gem versions.
sambio has quit [Ping timeout: 264 seconds]
<lindenle_>
Spooner: can I use rvm?
Dreamer3 has joined #ruby
<Spooner>
lindenle_ : Yeah, you can use gem-sets in rvm too, but I haven't used them, since the Bundler gem is fine.
hoelzro|away is now known as hoelzro
Solnse2 has joined #ruby
chichou has joined #ruby
m_3 has quit [Ping timeout: 252 seconds]
c0rn_ has joined #ruby
banseljaj is now known as imami|afk
nitti has quit [Ping timeout: 260 seconds]
rowsdower has quit [Remote host closed the connection]
rowsdower has joined #ruby
m_3 has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
Solnse has quit [*.net *.split]
fixl has quit [*.net *.split]
cibs has quit [*.net *.split]
Ivo has quit [*.net *.split]
bier has quit [Ping timeout: 246 seconds]
icooba has quit [Quit: Computer has gone to sleep.]
mmitchell has joined #ruby
Floydzy has joined #ruby
ebobby has quit [Ping timeout: 276 seconds]
Xeago has joined #ruby
UberNerdGirl has joined #ruby
robotmay has quit [Remote host closed the connection]
piotr_ has quit [Read error: Operation timed out]
mmlac has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
clj_newb has quit [Ping timeout: 260 seconds]
mmitchell has quit [Ping timeout: 246 seconds]
UberNerdGirl has quit [Client Quit]
bemson has joined #ruby
bradhe has quit [Remote host closed the connection]
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
fixl has joined #ruby
codewrangler has joined #ruby
niklasb has quit [Ping timeout: 264 seconds]
hbpoison has joined #ruby
graeme has joined #ruby
bier has joined #ruby
lkba has quit [Ping timeout: 272 seconds]
bemson has quit [Quit: bemson]
codewrangler has quit [Remote host closed the connection]
rasbonics has quit [Quit: rasbonics]
LouisGB has quit [Ping timeout: 260 seconds]
reset has quit [Ping timeout: 276 seconds]
armenb has joined #ruby
hbpoison has quit [Ping timeout: 265 seconds]
moshee has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
ebobby has joined #ruby
ebobby is now known as Guest80007
cakehero has quit [Quit: Computer has gone to sleep.]
ffranz has quit [Quit: Leaving]
LucidDreamZzZ has quit [Ping timeout: 276 seconds]
hoelzro is now known as hoelzro|away
davidcelis has quit [Quit: K-Lined.]
nina has quit [Quit: Leaving.]
<kkiero>
is there any library so I can genereate graphic output on os x?
g-ram has joined #ruby
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
Takehiro has joined #ruby
lkba has joined #ruby
<shadewind>
where can I find a complete reference for ruby regex?
palyer has joined #ruby
palyboy has quit [Read error: Connection reset by peer]
Canthar has joined #ruby
Solnse2 has quit []
chichou has quit [Remote host closed the connection]
nina has joined #ruby
nina has left #ruby [#ruby]
LucidDreamZzZ has joined #ruby
<shadewind>
nevermind, I found it :)
glyytchy has joined #ruby
yaymukund has quit [Quit: leaving]
<Spooner>
kkiero : You mean opengl type output or imagemagick type or GUI type?
<swarley>
fuck xml.
miso1337 has joined #ruby
<Spooner>
swarley : I believe XML may be your White Whale!
Takehiro has quit [Ping timeout: 265 seconds]
<swarley>
I'm going to finish this x_x
<swarley>
I swear to god, if this is slow as hell when i'm done i'm going to be pissed lol
<kkiero>
Spooner: something like new windows pop ups and script is drawing basic shapes in it
<Spooner>
kkiero : Right. Try the one of the "games" libraries, like Gosu or Ray.
<Spooner>
kkiero : You could also maybe use a GUI library and make an drawing canvas inside that window, but I'm not up on which GUI libraries still work ;)
emergion has joined #ruby
<kkiero>
ok, thanks
awarner has quit [Remote host closed the connection]
<swarley>
When i finish this. I really hope it doesnt suck ass
<swarley>
i dont know why i'm saying that. because it will
Guest80007 is now known as fms
<Spooner>
swarley : People have been writing XML libraries for decades. If you can do better in a week, then you truly are the master!
fms is now known as ebobby
<Spooner>
Nothing to lose.
emergion has quit [Client Quit]
Canthar has left #ruby [#ruby]
<Spooner>
Although if it is slower than a pure-Ruby XML library, then you really do suck ;)
JonnieCache has joined #ruby
<swarley>
I'm avoiding using the ruby api until the last minute, for lazy evaluation sort of.
Goles has joined #ruby
<swarley>
Since having everything in C structs is better for memory and a lot faster
<Spooner>
Yep.
under_my_shoes has quit [Quit: Leaving]
under_my_shoes has joined #ruby
<shadewind>
hmm... class methods cannot be called without the class name from an instance method?
<swarley>
if you define it as
<swarley>
ClassName.method_name
pdswan has quit [Ping timeout: 252 seconds]
<swarley>
i.e def Foo.bar(); ...; end
<swarley>
then you have to call it as Foo.bar
<Spooner>
shadewind : Yeah, otherwise you'd be calling the instance method.
<shadewind>
I'm just used to every other language where both class methods and instance methods occupy the same namespace
<Spooner>
shadewind : Though you could delegate by making an instance method that called the class method if that is appropriate (def frog(*args); self.class.frog(*args); end).
havenn_ has quit [Remote host closed the connection]
ngoldman has quit [Remote host closed the connection]
<shadewind>
I think I'll just make it an instance method instead so I don't have to type as much ;)
Xeago has quit [Remote host closed the connection]
<Spooner>
Well, sounds like it was an instance-method all the time.
<swarley>
shadewind; be careful
<swarley>
they are for different uses
<swarley>
Foo.bar is not meant to be used the same way as Foo.new.bar generally
pdswan_ has joined #ruby
<swarley>
well, that's a bad example
JonnieCache has quit [Ping timeout: 240 seconds]
snuglepuss has joined #ruby
<Spooner>
No, but if Foo.bar is only called from inside an instance and doesn't maintain state (civars) then it might as well be an instance method.
<swarley>
I'm trying to say that class methods should be used when you want to provide a method without needing the scope of an object
<shadewind>
Spooner: well, it was but it probably shouldn't be since it doesn't access any members of the instance
SegFaultAX|work has quit [Ping timeout: 276 seconds]
reuf has joined #ruby
<shadewind>
in C++, I generally make such "utility methods" static (a class method, in other words)
kiyoura has joined #ruby
<Spooner>
I generally wouldn't in Ruby. I'd just make them protected instance methods.