apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
_whitelogger has joined #ruby
_whitelogger0 has joined #ruby
_whitelogger0 has joined #ruby
Poapfel has joined #ruby
bluenemo_ has joined #ruby
jbw has joined #ruby
rcs has joined #ruby
sj26 has joined #ruby
Vert has joined #ruby
niklasb has joined #ruby
CheeToS has joined #ruby
dbgster has joined #ruby
sharms has joined #ruby
danheberden has joined #ruby
khakimov has joined #ruby
philcrissman has joined #ruby
benatkin has joined #ruby
uris has joined #ruby
arturaz has joined #ruby
cha1tanya has joined #ruby
TDJACR has joined #ruby
alx- has joined #ruby
lucasefe_ has joined #ruby
tayy has joined #ruby
emet has joined #ruby
<luke3321>
Hey all, I am having an issue with Net::FTP#putbinaryfile. It gives an EOF when I try to pass a jpg
<luke3321>
eph3meral: That is a pretty nifty CP. they also exposed it over REST
<Spaceghostc2c>
This is the old dashboard.
<luke3321>
So, who wants to play "Break Luke's rails app?" :D
<eph3meral>
i should hope it's an old shot, Ubuntu 7.04! :P
workmad3 has joined #ruby
kstephens has joined #ruby
<luke3321>
Spaceghostc2c: Which startup do you work at?
<Spaceghostc2c>
DealerMatch.
<Spaceghostc2c>
So, it's a Sunday, let's see how long Linode takes to respond.
<luke3321>
Ah. Cool concept. You all do pretty well for yourselves businesswise?
MrGando has joined #ruby
foofoobar has joined #ruby
<Spaceghostc2c>
luke3321: We're doing really stellar, actually. We're a startup of Cox Enterprises, so our amount of data in the vehicle trade field is massive.
ph^ has joined #ruby
<luke3321>
Spaceghostc2c: Ah. Very cool. Lots of dealerships changing hands then I guess? Something you never really think about :P
<foofoobar>
Hi. I'm using webrick for a simple http proxy. Is it possible to add/delete/modify some headers before sending it to the client?
<luke3321>
Spaceghostc2c: Good for you guys to find a niche in there :D
<Spaceghostc2c>
luke3321: Yeah, we just launched in March.
<luke3321>
Spaceghostc2c: Ooh. Even newer than us. Cool cool
<Spaceghostc2c>
luke3321: Already have 1.5 million cars in the database (way way way more than our competitors) and we have users actually asking when they can start paying to use our service.
<Spaceghostc2c>
We had our first trade in the system last week. $4400 for a car. Then another the following day, I don't know the details on that trade though.
<shevy>
nono not so unspecific... just show him the specific warts we discovered so far :D
<shevy>
I should make my new profession "professional wart finder"
<luke3321>
workmad3: Ah. Placeholder with a link to an article about the aquisition
<luke3321>
Waiting to hear what article to put in there
cha1tanya has joined #ruby
<workmad3>
shevy: if you can get paid well for it, that's a good idea :) it's pretty easy with JS after all... print off the code, hang it on the wall and throw darts at it. Anywhere the dart lands will be a wart :)
<shevy>
hmm
<shevy>
I dont like JS enough :(
<luke3321>
workmad3: Truer words have never been spoken
<shevy>
I mean to spend serious time with it
<luke3321>
I am a fan of Node.js, but past that.....
A124 has joined #ruby
nimeacuerdo has joined #ruby
A124 has quit [#ruby]
<luke3321>
Are you guys really reading the JS source? :P
<shevy>
ewwwww
<shevy>
not me
<shevy>
my eyes turn blind if I look at wart code
<shevy>
workmad3 is the professional
<shevy>
he can look at uglies all the time
<luke3321>
Okay good, because that's where I hid all the company passwords, in the JS comments
macmartine has joined #ruby
<luke3321>
I have code that could make even him go blind ;)
<workmad3>
luke3321: I had a quick look at what sources there were but it all looked fairly stock jquery stuff tbh
<workmad3>
luke3321: and I cba to read through jquery plugin code :)
<luke3321>
JQuery and Backbone.js
<luke3321>
Yeah.
<luke3321>
Mostly standard
<luke3321>
Works, despite the uglies
<luke3321>
That's all I care about lol
<workmad3>
can't see any backbone in there (I'm looking at the testnew site)
<luke3321>
nono, go and try buy something, there is more past what you are seeing
<workmad3>
ah, I can't get to buying
<luke3321>
Why's that?
<workmad3>
it asks to link your instagram account and a) I wouldn't link an account to a beta site and b) I don't have an instagram account :)
<luke3321>
Ah. fair enough.
<luke3321>
That's where the heavy JS comes in
<workmad3>
makes sense
<luke3321>
its actually somewhat beautiful
<luke3321>
and horrid
<workmad3>
sounds like javascript
<luke3321>
sounds like php
<luke3321>
:P
<workmad3>
no... PHP can't achieve beautiful
<luke3321>
It can be beatiful for PHP
<workmad3>
best PHP can manage is 'sorta pretty if you squint'
<luke3321>
I'm too tired to be allowed on the internet
<workmad3>
it's not normally 1... l = 4, 3 % 5, l = 5, 4 % 6...
<workmad3>
ah, other way around, yeah :)
j-okta has joined #ruby
tayy has joined #ruby
<workmad3>
ooh, fun... 2 % 0 :D
<workmad3>
-1 % 1...
<workmad3>
err... 1 % -1 even
<luke3321>
You aren't supposed to think this far into it. Stop that
<workmad3>
but it's fun.... it's like trying to work out numbers in base -2 :D
<workmad3>
except a bit easier :P
j-okta has joined #ruby
<luke3321>
lol. base -2. I know what I'm doing now....
* workmad3
wonders if luke3321's tired brain will explode with trying to work out base -2 numbering :D
<workmad3>
banseljaj: because then we won't know who wins!!!
<banseljaj>
:P
<luke3321>
banseljaj: It's really quite simple
<virunga>
omg that vid is awesome
Manhose__ has joined #ruby
pdtpatrick has joined #ruby
<luke3321>
RoR/Ruby > PhP
* luke3321
managed to mistake octal values for 1-8 on his Discrete Math midterm, he has no chance here
<workmad3>
luke3321: what? even CakePHP???
<seanstickle>
Ruby vs APL!
KL-7 has joined #ruby
<workmad3>
luke3321: also, intercal > *
<workmad3>
luke3321: that's a valid (if unconventional) set of symbols for octal
<luke3321>
workmad3: Not if you don't compensate for them being shifted up lol
<workmad3>
luke3321: the question is, would you alter all values to correspond as 0 = 1, 1 = 2, etc... or just 8 = 0? :)
<luke3321>
workmad3: in my case, 1=1 ... 8=8
<workmad3>
luke3321: they're just symbolic representations... any 8 symbols will do :)
<Veejay>
Ruby weeks start on a Monday, right?
<seanstickle>
Yes, because Ruby is all about work.
<workmad3>
luke3321: right... so you had an inconsistent symbolic representation for octal then :P
<luke3321>
workmad3: Spot on. Best part is I knew it better than anyone else there
<seanstickle>
Veejay: but, no seriously
<seanstickle>
Veejay: Ruby weeks start on Sunday
<luke3321>
workmad3: Shows what working fast can do for you
<seanstickle>
Date.today.wday #=> 0
<workmad3>
luke3321: I've picked up a very... peculiar... interpretation of maths nowadays :) basically, anything goes as long as you define it up front ;) it just doesn't examine well
<luke3321>
workmad3: As nice as that sounds, that doesn't fly in a university math course
<luke3321>
:P
<workmad3>
luke3321: I *think* it's what you're meant to aim for with maths nowadays, but obviously they don't tell you about it @ school
<Veejay>
seanstickle: Don't think so
<workmad3>
luke3321: state your axioms, it's all just formal systems
<Veejay>
Unless at_beginning_of_week does something tricky where it doesn't actually brings you to the beginning of the week
<luke3321>
workmad3: True. The issue is, I don't think some of the professors grasp the concepts enough to understand that
<luke3321>
workmad3: Its a sad day when you realize you know more in a class than the instructor
<workmad3>
luke3321: I notice that with a lot of things... it's not so much about knowing as about understanding
<luke3321>
workmad3: Exactly. Sure, you can regurgitate the 2s compliment on an exam, but do you understand it well enough to be able to extend it to a 7s compliment
etehtsea has joined #ruby
daniel_hinojosa has joined #ruby
<seanstickle>
Veejay: That looks a lot like Rails code
savage- has joined #ruby
<seanstickle>
Veejay: not Ruby code
tayy has joined #ruby
<workmad3>
luke3321: yeah... and in my case with 2's complement, I'd probably go with 'no' :)
<seanstickle>
Veejay: which, as you can see, starts on Monday
<workmad3>
seanstickle: it *defaults* to starting on monday... you can change it :)
<luke3321>
workmad3: As a definition, (base)^(num digits) - (number to take compliment of in the base at left)
<seanstickle>
workmad3: yes
<workmad3>
luke3321: I never cared enough about 2's complement representation tbh...
<luke3321>
workmad3: Nor do I. Knowing != caring :P
<Veejay>
seanstickle: Yeah I just realized that
<Veejay>
Sorry
<seanstickle>
No worries
<workmad3>
luke3321: low level internals never fascinated me enough, and now I've been out of uni for almost 5 years the non-fascinating stuff is starting to fade :)
<Veejay>
Damn Rails creating inconsistencies
<luke3321>
workmad3: I am 2 weeks out of the test and it is starting to fade ;) I much prefer the higher level stuff
cbuxton has joined #ruby
<workmad3>
luke3321: I just remain confident that if I needed to, I know enough about representations etc. to figure it out from wikipedia ;)
nobitanobi has joined #ruby
<luke3321>
workmad3: And that is all you really need. Its the "why memorize someones phone number if I have a phone book to look it up in"
<seanstickle>
People still use phone books?
<luke3321>
No lol
<workmad3>
luke3321: oh, that one is easy... you lose your phone and need to call someone on a payphone
<luke3321>
Not quite the point
<luke3321>
workmad3: Tell Einstein that, not me :P
<nobitanobi>
Given I have an array of hashes like this [{:category=>1, :name => 'rock'},{:category => 1, :name => 'indie'},{:category => 2, :name => 'classic'}]. How can I get an array with say, just hashes with category=1 ?
<Spaceghostc2c>
sebcioz: You should also support tar.gz and 7z!
tommyvyo has joined #ruby
waxjar has joined #ruby
<tommylommykins>
hmm
<tommylommykins>
one thing that's annoying me atm
<tommylommykins>
is that printing of error messages is not serialised with things printed by puts in the same thread
<apeiros_>
sebcioz: nice
<tommylommykins>
so if a lot of stuff is being printed
<tommylommykins>
the error message gets lost
<apeiros_>
tommylommykins: it's your duty to handle error message and printing, so it's your duty to fix that…
ryandev70 has joined #ruby
<tommylommykins>
hmm, I assume this means puts/print is nonblocking?
igotnolegs has joined #ruby
<apeiros_>
it means puts/print is (almost) completely unaware of threading.
<apeiros_>
if you thread, you are responsible for handling shared resources.
prometheus has joined #ruby
<apeiros_>
since you print to the same $stdout, the $stdout is a shared resource. synchronize access (= printing) to it according to how you need/want it.
aj910martin has joined #ruby
dev_ryan70 has joined #ruby
<tommylommykins>
mm, but in the case of an unhandled exception, I can't control how it's printed?
aj910martin has quit [#ruby]
<apeiros_>
of course. handle it.
dev_ryan70 has joined #ruby
<apeiros_>
have a toplevel rescue in your thread
zakwilson has joined #ruby
andrewhl has joined #ruby
maxok has joined #ruby
benatkin has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
aj910martin has joined #ruby
aj910martin has quit [#ruby]
Bosma has joined #ruby
nobitanobi has joined #ruby
sgaedu has joined #ruby
bak has joined #ruby
mikeric has joined #ruby
strife25 has joined #ruby
Russell^^_ has joined #ruby
workmad3_ has joined #ruby
LiranV has joined #ruby
LiranV has quit ["Leaving"]
burgestrand has joined #ruby
looopy has joined #ruby
bradyl0ve has joined #ruby
ukd1 has joined #ruby
Russell^^_ has joined #ruby
CheeToS has joined #ruby
indeterminate has joined #ruby
alem0lars has joined #ruby
rdesfo has joined #ruby
nobitanobi has joined #ruby
dv310p3r has joined #ruby
havenn has joined #ruby
kenperkins has joined #ruby
hukl_ has joined #ruby
rdesfo has quit [#ruby]
skaczor has joined #ruby
ronniy has joined #ruby
artm has joined #ruby
JonnieCache` has joined #ruby
zakwilson has joined #ruby
rdesfo has joined #ruby
andrewvos has joined #ruby
andrewvos has joined #ruby
andrewvos has quit [#ruby]
cdepue_ has joined #ruby
Bosma has joined #ruby
adman65 has joined #ruby
<shevy>
dumdedum
twinturbo has joined #ruby
<canton7>
slowday sunday
<dross>
a bit
<dross>
coding here
jgrevich_ has joined #ruby
Bosma_ has joined #ruby
kstephens has joined #ruby
audy has joined #ruby
<audy>
what is the ampersand syntax doing in ary.map &:to_i ?
piotr__ has joined #ruby
<canton7>
it's a litle cludge, called Symbol#to_proc
<Spaceghostc2c>
^
<Spaceghostc2c>
kludge, even.
<TTilus>
audy: its telling ruby that :to_i is _the_ parameter =D
nobitanobi has joined #ruby
<TTilus>
audy: for real
<canton7>
yeah, tired finger :S
<TTilus>
audy: it tags parameter as block parameter
<TTilus>
canton7: ampersand is no cludge, :to_i as block parameter is
<audy>
you have confused me!
<audy>
ary.map &:to_i is the same as ary.map { |x| x.to_i }
<TTilus>
audy: as you probably know, every ruby method can receive a block as the last parameter even if it is not explicitly in parameter list
<canton7>
the article I read originally was of the opinion that Symbol having a magic method that turned it into a proc, and using ampersand to magically call this method, was a bit of a kludge
<audy>
so all the ampersand does is convert the symbol to a function and apply it to whatever variable the enumerator emits?
<TTilus>
udk: ampersand does not do that
<TTilus>
audy: ^
<TTilus>
udk: sorry
punkrawkR has joined #ruby
<TTilus>
audy: Symbol#to_proc does it
<audy>
but it's not a proc. There is a missing variable there
<TTilus>
audy: if .map gets something else than a proc as the block parameter, it calls #to_proc on it
<TTilus>
audy: and lambda { |x| x.to_i } happens to be what #to_proc returns if you call it on :to_i
<audy>
ah okay.
tayy has joined #ruby
<TTilus>
audy: try it :to_i.to_proc.call("1")
baroquebobcat has joined #ruby
<audy>
and that's how I'm going to program from now on
josefig has joined #ruby
<TTilus>
audy: you can use the to_proc feature of #map et.al. yourself
<TTilus>
audy: just remember how confused you were when you first saw it and only use it where speed is not crucial (it is slow) and it is readable
<Spaceghostc2c>
dagnachewa: Using rvm?
becom33 has joined #ruby
<Spaceghostc2c>
TTilus: Is the symbol to proc slow?
<dagnachewa>
Spaceghostc2c, yes
<TTilus>
audy: and if you really wanna confuse readers of your code, this is a nice way of accomplishing it, just define your own useful #to_proc shortcuts here and there and use them with #map et.al.
<Spaceghostc2c>
TTilus: That reminds me of the dubstep tutorial song.
<audy>
:to_proc.to_proc ??
<TTilus>
audy: you got it \o/
sebastorama has joined #ruby
<Spaceghostc2c>
Wrap that in a proc!
<TTilus>
audy: or redefine Proc#to_proc and start having fun =D
<canton7>
:to_proc.to_proc.call(:to_s).call(1)
<dagnachewa>
Spaceghostc2c,
<becom33>
https://gist.github.com/2552889 in this i made if only age is and if name is not set to enter the name 1st . but the problem is if I do like "ruby name.rb -a 21 -n John" it will check if the name is set 1st but I have enterd name in the list . how can I fix that .
<audy>
lol
<becom33>
another thing . Im not sure if I did this correctly
<becom33>
anyone ?
* becom33
?
<canton7>
becom33, I'm not convinced you're doing it right... I'm not an OptionParser fan myself, but the man page suggests that you should be doing something like opts.on('-n', '--name NAME', 'Your name') do |name| ....
otherj has joined #ruby
<becom33>
canton7, well I dont get . can you help ?
<otherj>
guys, is there some easy way to separate objects in an array into categories to loop through? like i have @windows and or 3 of the things in the array thing.category is 'blue', and i want to loop through the blue bits into a table
<becom33>
in |name| is just a boolian right ?
<shevy>
use pp man
<shevy>
pp name.class
<TTilus>
becom33: id just switch to trollop right away...
<canton7>
yeah, trollop is fantastic
waigani has joined #ruby
<becom33>
shevy, Im sorry ? and TTilus what trollop ?
<canton7>
becom33, yeah, that's just because I overwrote ARGV for testing purposes. Just nuke it
<becom33>
aghhh alright
jondot_ has joined #ruby
nobitanobi has joined #ruby
<becom33>
I commented infront of it
<jondot_>
a testing related question - how would you deal with an integration test going out to a 3rd party web service, and that service is stateful. would you mock out the service? how would you mock the state of it?
<jondot_>
integration isn't between services/products, but between modules of your application
<Spaceghostc2c>
integration is full stack testing.
<jondot_>
the 'dry' definition, is integrating modules. modules can be classes, namespaces, services, products, buildings, etc.
<Spaceghostc2c>
And yes, it's still integration when you test third party services. I just don't test them like that. I might smoke test in production. Otherwise, a mock.
<Spaceghostc2c>
I don't do integration testing much. There's a number of other test types I use, and I really don't int test all that much.
<Spaceghostc2c>
If you want to use your definition, I use request specs for int testing like that.
<jondot_>
in the case of the mock, although i've done it quite a few times, i find myself into an interesting problem, where i'm kinda coding the service's logic.
<Spaceghostc2c>
You shouldn't have to.
<jondot_>
its not a big deal, its the service's logic in the most dumbest way, but it s still not simple to my taste
<jondot_>
Spaceghostc2c, the simplest example, imaging the service just keeps array of things. every time you call it: Service.add(1), it will return the complete new array
<jondot_>
so Service.add(1) => [1], Service.add(2) => [1,2]
<msch>
is there any place like shootout.debian for the different ruby implementations?
bradyl0ve has joined #ruby
<jondot_>
now you need to mock that in test
<Spaceghostc2c>
msch: There's the shootout.
<Spaceghostc2c>
jondot_: There's libs for helping out with it.
<msch>
Spaceghostc2c: doesn't that only have one ruby implementation?
<Spaceghostc2c>
It has a few.
<jondot_>
what will you do? hold a temporary variable to represent the state, then mock it with something like rr. you'll give the mock a body to execute which will push things into the array.
<msch>
Spaceghostc2c: ah it has JRuby and Ruby 1.9. too bad i would have hoped for it to also have 2.0 and rbx
<Spaceghostc2c>
They aren't even that updated.
<jondot_>
when you do Service.get_array, you'll return that same variable, again mocked out the function's logic to return the temporary variable thats bound to the test method scope
<Spaceghostc2c>
I use jruby 1.7 (jruby-head) with the latest jdk release on java 7
<Spaceghostc2c>
jondot_: So then define a method if you're going to be testing it.
<jondot_>
what do you mean?
<Spaceghostc2c>
If you need to test against an api and don't want a mock to gobble stuff up entirely, then perhaps, you know, do what you need to make your tests pass.
<jondot_>
well i already have a working solution, i'm trying to advise with others to make sure i am also doing the 'clean' solution
nobitanobi has joined #ruby
cek has joined #ruby
mikeric has joined #ruby
<cek>
dear friends, i've got ulimit -d equal to 1 and the following program succeeds: ruby -e 'zz="a"*1024*2'. Why?
kenichi has joined #ruby
hadees has joined #ruby
kvirani has joined #ruby
Watcher7 has joined #ruby
davidw has joined #ruby
srnty has joined #ruby
d3c has joined #ruby
luckyruby has joined #ruby
sohocoke has joined #ruby
jgrevich has joined #ruby
<macmartine>
I have a Time object. And I have a tzinfo object. How do I set the offset of the time object to the tzinfo offset?
Zolrath has joined #ruby
nobitanobi has joined #ruby
jarred has joined #ruby
<toloykhan>
canton7, virunga, thank you so much it's worked
<virunga>
:)
francisfish has joined #ruby
ersoy has joined #ruby
yoklov has joined #ruby
gen0cide_ has joined #ruby
waxjar has joined #ruby
<macmartine>
How do I take a time '2012-05-03 07:45:00 UTC' and get the exact same time but with a new offset such as '2012-05-03 07:45:00 -0700' ?
nobitanobi has joined #ruby
looopy has joined #ruby
headius has joined #ruby
nobitanobi has joined #ruby
<shevy>
ewww crossposting
waigani has joined #ruby
waigani has joined #ruby
kvirani has joined #ruby
looopy has joined #ruby
vitor-br has joined #ruby
me_ has joined #ruby
Targen has joined #ruby
robert___ has joined #ruby
ziggles has joined #ruby
rdesfo has joined #ruby
nobitanobi has joined #ruby
me_ has joined #ruby
workmad3 has joined #ruby
jetblack has joined #ruby
noric has joined #ruby
greenarrow has joined #ruby
me_ has joined #ruby
eko has joined #ruby
eko has joined #ruby
eko has joined #ruby
me_ has joined #ruby
<tchebb>
Is there a difference in behavior between . and :: or are they syntactically equivalent?
zakwilson has joined #ruby
krz has joined #ruby
thismax has joined #ruby
thismax has joined #ruby
locriani has joined #ruby
<shevy>
tchebb for the most part. but . is shorter. and :: allows you to use it like so:
<shevy>
::Foo
thismax has joined #ruby
<shevy>
which you cant quite do with . unless there is a recieve before
<shevy>
*reciever
<shevy>
when a method is call I try to prefer Foo.method_name rather than Foo::method_name
<shevy>
*called
<shevy>
somehow my words are not quite complete today :\
<tchebb>
shevy: I see. So the convention is to use :: for subclasses and class methods, and . for instance methods?
dv310p3r has joined #ruby
KL-7 has joined #ruby
toddmorrill has joined #ruby
<shevy>
I dont think there is any solid convention
lucasefe has joined #ruby
<shevy>
you'll have to see what you prefer for yourself mostly
<shevy>
I know I did not like the Foo::bla scheme
<tchebb>
shevy: Alright. Thanks for the help!
<shevy>
I'd also use . for all methods, irrelevant of whether they are class methods or instance methods
<shevy>
and Constants via ::
<shevy>
class Foo # <-- is also a constant
<shevy>
module Bla; class Foo
<shevy>
foo = Blaa::Foo.new
<shevy>
foo.hello
ersoy has quit ["Leaving"]
nimeacuerdo has joined #ruby
<nimeacuerdo>
hi there
sebcioz has joined #ruby
eko has joined #ruby
eko has joined #ruby
pubis has joined #ruby
baroquebobcat has joined #ruby
thorncp has joined #ruby
nobitanobi has joined #ruby
zschallz has joined #ruby
sohocoke has joined #ruby
zschallz has joined #ruby
nobitanobi has joined #ruby
Divinite has joined #ruby
redgetan has joined #ruby
nobitanobi has joined #ruby
c0rn has joined #ruby
tommyvyo has joined #ruby
cordoval has joined #ruby
eko has joined #ruby
eko has joined #ruby
nobitanobi has joined #ruby
cordoval has quit [#ruby]
nobitanobi has joined #ruby
Targen has joined #ruby
tommyvyo has joined #ruby
baroquebobcat has joined #ruby
jkingkong has joined #ruby
<jkingkong>
so I'm trying to set up a rails environment in ubuntu
<jkingkong>
when i run a rake db migrate
<jkingkong>
i get an uninitialized constant error for Footnotes::Note::LogNote
<jkingkong>
any ideas?
becom33 has joined #ruby
<jkingkong>
it seems to be related to an active support dependency
<deryl>
github.com/deryldoucette/gist it works. does the job but definitely not professional
OomElvis has joined #ruby
OomElvis has quit ["Leaving"]
khakimov has joined #ruby
<deryl>
i even fixed up the standalone
<banisterfiend>
deryl: yeah, i wish defunkt would look into it
<deryl>
figured it'll work for now
<deryl>
yeah
<banisterfiend>
rking: we may be able to get around it by writing out the highlighting as html and setting the file type as html
mrTheShadow has joined #ruby
<banisterfiend>
but i havent looked into that yet
kaos01 has quit [#ruby]
<deryl>
banisterfiend: well my cheapskate fix 8does* work. I use it locally
<rking>
banisterfiend: Right. I was wondering that. BTW when it worked did it correctly distinguish between pry prompts, output, and code output?
<banisterfiend>
rking: it never displayed prompts, does it now?
sam113101 has joined #ruby
<banisterfiend>
it should output stuff as:
<banisterfiend>
input
<banisterfiend>
# => result
<deryl>
not that i see
<deryl>
yeah that it does
<rking>
banisterfiend: Oh yeah, crud. I'm sorry - it does.
<deryl>
banisterfiend: what i was gisting to you yesterday or the day before that *had* the prompt stuff was when I was C&Ping to gist
<banisterfiend>
yeah
<deryl>
oh cool, you knew that. ok :)
<rking>
banisterfiend: The case that I was doing I was trying to show why a certain thing was a syntax error, so I C&P'd it for that as well.
<rking>
(Because pry doesn't consider a syntax error to be an input expression.)
<banisterfiend>
rking: hmm ok
<banisterfiend>
let me check
<rking>
But yeah, if the input\n# => result stuff was syntax highlighted, that would be fine.
<banisterfiend>
rking: yeah you're right
Seoman has joined #ruby
chrxn_ has joined #ruby
<banisterfiend>
rking: do u find gist -h sufficient to know how to work it?
savage- has joined #ruby
<rking>
banisterfiend: Actually, my gist command is busted for some reason. I switched from rvm to rbenv, and it still has the rvm bangpath... and at this very moment I was trying to "gem install gist" again to see if I could fix it, but I am seeing this odd warning about not having libyaml -- even though that was the very first thing that came with "rbenv install 1.9.3-p194"
snip_it has joined #ruby
tommyvyo has joined #ruby
<rking>
OK, despite the warning - the reinstall of the gist gem worked, and I can see -h fine. banisterfiend: what was your question about it?
sohocoke has joined #ruby
<banisterfiend>
rking: is it enough info to understand how to properly use gist, is there any confusion about the options?
<rking>
Nah, no confusion.
Beoran__ has joined #ruby
<banisterfiend>
rking: is it clear what 'input expression history' is?
<banisterfiend>
i never explained they correspond go the [n] beside the pry prompt
<rking>
Oh, hehe.. you weren't talking about $PATH's gist -h, but pry's gist -h.
<banisterfiend>
rking: Yeah
<rking>
banisterfiend: I think I do understand it OK... unless you're saying there actually is a way to get a busted input expression to count as one that gist -i sees.
<deryl>
banisterfiend: i had the gist gem installed already so i didn't notice, however, is the gist that pry doing using that gem or its own internal?
<deryl>
just a driveby question
<banisterfiend>
deryl: we use the gem, but our 'gist' command is quite different
<banisterfiend>
as it lets you gist stuff from the pry environment
<rking>
deryl: show-command gist. =)
<deryl>
ok. was just checking
<banisterfiend>
like methods, input, etc
<deryl>
gotcha. i was going to sunhday drive through pry's source later this week. definitely going to do so, now that we're talkinga bout it :)
Akuma has joined #ruby
<banisterfiend>
deryl: you can drive through it in pry itself, very cute ;)
<deryl>
hahah thats cool actually :)
<deryl>
just to look at things. i'm still working the well grounded rubyist so my ruby isn't up to where *I* want it, however, i wanted to see how things were done, learn a few things. so i'll definitely do :)
c0rn has joined #ruby
<deryl>
i want to complete at least *one* damned book on the subject :) I've been toying around with ruby long enough. time to actually invest some education time, and then start writing a crapload of throwaways
<deryl>
and pry is just my ticket to see where the hell i screw up :) (and learn a "so far proving pretty frickin snazzy" tool along the way)
<banisterfiend>
deryl: i thought you'd been doing ruby for ages now
skaczor has joined #ruby
<deryl>
well i've been around the channels for oh.. 2 years (?) but its been about a year that i've been writing stuff. but mostly half hazardly. i never really *sat down* and *really* attempted to learn it.
waxjar has joined #ruby
waigani has joined #ruby
<deryl>
i've done pretty damned good for doing it that way, but now i really want to get serious with it. i've got my hands in enough pies, written some stuff thats used daily, but *I* don't really consider myself high calibre. so i asked myself what it was that i felt i needed to do *to* become that. complete a book on it, and knuckle down is what i came up with. so.. thats what i'm doing
<rking>
Wow. These pry plugins are great.
<banisterfiend>
rking: which ones?
<deryl>
banisterfiend: i'v got a lot of holes in my knowledge is the problem. so, i'm reading the well grounded rubyist and walking the language end to end. like i had a *sever* misunderstanding of 'self' and scopes.
<rking>
banisterfiend: Well, the architecture itself is something I like (the way it loads any /^pry-/ gem automatically, but you can disable that entirely or as 1-offs), but I'm liking pry-git already.
<rking>
Seems like pry-colline is now core functionality?
<banisterfiend>
rking: hehe, pry-git is just experimental ;) i'm going to pump it up when i get the time
<banisterfiend>
rking: not quite, we now color lines after enter is pressed automatically in core, but pry-cooline has the ability to highlight code as you type it in
* rking
expects to see pryde soon. (Complete IDE from within pry)
<rking>
Aha.
<banisterfiend>
rking: try it out, gem install pry-coolline
<Spaceghostc2c>
banisterfiend: Whoa whoa whoa.
<banisterfiend>
let me know if it works for u
<Spaceghostc2c>
That's fucking bro.
<rking>
banisterfiend: Yep! Is nice.
<banisterfiend>
Spaceghostc2c: what are you referring to?
<rking>
Actually, what IDE features are even missing at this point?
<Spaceghostc2c>
coolline
eph3meral has joined #ruby
<eph3meral>
is there some sort of timer object for constructing loops?
Xylo has joined #ruby
Targen has joined #ruby
<rking>
eph3meral: I don't follow.
<eph3meral>
like animation loops? in Qt for example (but not Qt, cuz I don't want to pull in Qt if possible)
<eph3meral>
rking, well it just seems that while dont_quit ... isn't very good "form"
Peaker has joined #ruby
<rking>
eph3meral: Hrm. Maybe some of the lighter game engines?
<Peaker>
What's a good ruby REPL?
<rking>
Peaker: pry!!
<Peaker>
is there a package name on Ubuntu?
<eph3meral>
rking, I really want to use as few libs/gems as possible
<eph3meral>
if I need a lib for it, then I'll just stick with while foo...
<rking>
Peaker: I would do it as: gem install pry{,-doc}
Indian has joined #ruby
<rking>
eph3meral: I don't understand the problem still. while dont_quit seems fine to me, if that's all you are after. I thought you meant some kind of complicated timing setup, like what would be in a game engine.
<Peaker>
rking, I'm worried of making a mess w.r.t apt-get/dpkg
vitor-br has joined #ruby
<rking>
Peaker: gems will install fine. They are their own ecosystem that won't compete with .deb's.
khakimov has joined #ruby
levity_island has joined #ruby
<Spaceghostc2c>
Peaker: Don't be. They're completely separate.
<eph3meral>
rking, well, gaming engine timing setups (depending on the game) actually aren't that complicated - at least for e.g. a simple 2d physics sandbox, you just set up a timer to trigger say, every 5ms
<Spaceghostc2c>
Don't use dpkg or apt-get to install ruby. Use rvm.
<Peaker>
I thought "ruby" was the REPL (much like "python") and was initially disappointed at such a crappy REPL :)
<eph3meral>
rking, I don't even need that kind of granularity, really I only need to trigger about once every minute
<rking>
I say use rbenv instead of rvm, I think.
<rking>
Peaker: Hehe... it's more of a REP than a REPL.
<eph3meral>
though I do need to spawn about 1000 similar/nearly-identical workers each minute
<rking>
Actually, an RE.
<tchebb>
Peaker: irb is the default
<Spaceghostc2c>
eph3meral: Lolwat.
<Spaceghostc2c>
Using fork+exec?
alek_b has joined #ruby
<eph3meral>
Spaceghostc2c, I hadn't gotten that far, that was mostly an aside, ignore that requirement for now
<rking>
eph3meral: Regarding timer every 5ms... what about when the system gets lagged >5ms?
<eph3meral>
for now I'm just dealing with getting one of them working
<eph3meral>
rking, yeah, it's a very good question, one I was also about to pose
<rking>
eph3meral: That's what I'm meaning re "complicated timing" loop that any game engine will solve.
<eph3meral>
k
<Peaker>
generally you just skip timings that end up in the past?
<rking>
And then you have the other side - the case where the machine is ahead of schedule and the user wants to increase the graphics/physics resolution even more.
<eph3meral>
ok, well I'll look in to some lightweight game engines in the future, for now I'll stick with `while` - it works for now, I'll abstract/adapt it when I get a little further with the app
<Spaceghostc2c>
banisterfiend: Didn't you have a game that you used when showing off pry that had ticks nad timers?
<banisterfiend>
Spaceghostc2c: yeah
<rking>
eph3meral: Yeah. In the end it isn't more than a hearty paragraph of code.
<deryl>
now just need a vim plugin to call pry when i'm in editing a ruby file (muahaha)
<rking>
Hrm. So I'm getting no problem with "ruby -ryaml" (or "ruby -rpsych"), but "gem help" complains about missing psych. How would I start pry on "`which gem`"?
<deryl>
lol will you stop?? you're fulfulling all my wishes! :)
<deryl>
banisterfiend: lol, niiice
* deryl
peers at banisterfiend
<deryl>
you sure you're not a genie?
sohocoke has joined #ruby
<banisterfiend>
deryl: that blog post isn't mine ;) but its a nice trick
<banisterfiend>
however i dont use vim
Manhose has joined #ruby
zakwilson has joined #ruby
dagnachewa has joined #ruby
<deryl>
i flip between textmate and vim
<deryl>
more and more i'm in vim. especially now that i have tmux, tmuxinator, and most of the top plugins for it.
<rking>
banisterfiend: Is it possible to invoke a ruby script from pry and have it follow into it?
<deryl>
finding less and less reason to use TM other than the def<tab> for method completion and stuff. which snipmate heps with
sohocoke has joined #ruby
philcrissman has joined #ruby
<banisterfiend>
rking: using pry-nav u mean?
rodayo has joined #ruby
<rking>
Hrm, I missed pry-nav, because "gem search" doesn't show descriptions. Is there a way to fix this?
<rodayo>
How would I remove occurences of a "\" in a string?
<rking>
rodayo: .gsub '\\', ''
<rodayo>
rking, great thank you. i was fumbling with the escapes and couldn't get it right
igotnolegs has joined #ruby
<rking>
rodayo: It's kind of tricky to learn, but eventually you'll get it. The only one that happens, there, is the Ruby parser that builds the string -- it will take \x and turn it into the escaped char, so you have to do \\ to get a string with '\'
<rodayo>
rking, alright i'll keep that in mind =)
<deryl>
rking: gem search pry-nav -dr
<deryl>
-d shows descriptions -r for remote -l for local
apok has joined #ruby
c0rn has joined #ruby
<deryl>
works with gemn list as well
<rking>
Oh, shoot... there it is, -d under "Options" of gem search --help.
<deryl>
:)
kuzushi has joined #ruby
<deryl>
i rarely search anymore without including -d
<rking>
Right. Most distro tools are like that, by default (e.g., apt-cache and eix).
<deryl>
well, there's a new primary link for my browser (heh)
<rking>
banisterfiend: Excellent. I still don't quite get how to work pry into an executable... other than "(echo 'require "pry"; pry; cat `which the-exe`) > tmp-exe; ruby tmp-exe
<binaryplease>
can someone give me a hint, im beginner
<deryl>
#rubyonrails is probably your better bet
<deryl>
binaryplease: and you need to read your error messages. you're missing a javascript runtime
<binaryplease>
deryl: but i installed it
<deryl>
go hit that execjs url for one for your platform and follow the instructions over there. but i'll bet you didn;'t add it to your Gemfile and bundle install