soypirate has quit [Remote host closed the connection]
flori has joined #ruby-lang
tjadc has quit [Ping timeout: 252 seconds]
imajes has quit [Ping timeout: 252 seconds]
gix has quit [Ping timeout: 260 seconds]
gix has joined #ruby-lang
flori has quit [Ping timeout: 240 seconds]
imajes has joined #ruby-lang
islander has joined #ruby-lang
macmartine has joined #ruby-lang
<islander>
is attr_accessor just a shortcut to make attributes for classes without having to define a lot of methods/variables?
mantono has joined #ruby-lang
<lianj>
islander: yes
bzalasky has quit [Read error: Connection reset by peer]
bzalasky has joined #ruby-lang
<islander>
@lianj thank you.
kurko_ has quit [Ping timeout: 244 seconds]
amerine has joined #ruby-lang
mantono has quit [Ping timeout: 246 seconds]
kurko_ has joined #ruby-lang
jxie has joined #ruby-lang
islander has quit [Remote host closed the connection]
mantono has joined #ruby-lang
bzalasky has quit [Read error: Connection reset by peer]
bzalasky has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby-lang
agarie has joined #ruby-lang
amerine has joined #ruby-lang
iamjarvo1 has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Remote host closed the connection]
jxie has quit [Ping timeout: 255 seconds]
zanea_ has quit [Ping timeout: 245 seconds]
zanea has joined #ruby-lang
noop has joined #ruby-lang
slyphon has joined #ruby-lang
islander has joined #ruby-lang
islander has quit [Read error: Connection reset by peer]
thone has joined #ruby-lang
Mawk has joined #ruby-lang
dhruvasagar has joined #ruby-lang
gregmor__ has joined #ruby-lang
gregmo___ has joined #ruby-lang
gregmor__ has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
thone_ has quit [Ping timeout: 276 seconds]
gregmoreno has quit [Ping timeout: 244 seconds]
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
kurko_ has quit [Ping timeout: 256 seconds]
iamjarvo has joined #ruby-lang
kurko_ has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 246 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
Mawk has quit [Quit: Mawk]
Mawk has joined #ruby-lang
nXqd has joined #ruby-lang
antbody has joined #ruby-lang
antbody has quit [Client Quit]
slyphon has quit [Quit: slyphon]
macmartine has joined #ruby-lang
islander has joined #ruby-lang
mantono has quit [Ping timeout: 246 seconds]
Mon_Ouie has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
slyphon has joined #ruby-lang
rolfb has joined #ruby-lang
ridget has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 252 seconds]
antbody has joined #ruby-lang
kurko_ has joined #ruby-lang
charliesome has joined #ruby-lang
dc5ala has joined #ruby-lang
beho has joined #ruby-lang
slyphon has quit [Quit: slyphon]
idkazuma has quit [Remote host closed the connection]
macmartine has quit [Quit: Computer has gone to sleep.]
mjio has quit []
imajes has quit [Ping timeout: 255 seconds]
Mon_Ouie has quit [Ping timeout: 276 seconds]
b1rkh0ff has quit [Read error: Operation timed out]
nXqd has quit [Ping timeout: 276 seconds]
davidbalbert is now known as davidbalber|away
arubin has quit [Quit: Computer has gone to sleep.]
nXqd has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
beho has quit [Remote host closed the connection]
Mawk has quit [Quit: Mawk]
ohcomely has joined #ruby-lang
islander has quit [Remote host closed the connection]
b1rkh0ff has joined #ruby-lang
idkazuma has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
wmoxam has quit [Ping timeout: 245 seconds]
wmoxam has joined #ruby-lang
imajes has joined #ruby-lang
solars has joined #ruby-lang
chendo__ has joined #ruby-lang
ohcomely has quit [Quit: Leaving...]
workmad3 has joined #ruby-lang
Mawk has joined #ruby-lang
Mawk has quit [Quit: Mawk]
Mawk has joined #ruby-lang
thufir_ has joined #ruby-lang
chendo__ has quit [Quit: Computer has gone to sleep.]
gnufied has joined #ruby-lang
zcl0ud has quit [Ping timeout: 260 seconds]
zcl0ud has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 244 seconds]
Mawk has quit [Quit: Mawk]
zcl0ud has quit [Ping timeout: 255 seconds]
workmad3 has quit [Ping timeout: 276 seconds]
vlad_starkov has joined #ruby-lang
mercwithamouth has joined #ruby-lang
Mawk has joined #ruby-lang
faces has joined #ruby-lang
face has quit [Ping timeout: 245 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
tbuehlmann has joined #ruby-lang
fsvehla has joined #ruby-lang
vmoravec has joined #ruby-lang
JohnBat26 has joined #ruby-lang
ottbot has quit [Ping timeout: 276 seconds]
noop has quit [Ping timeout: 252 seconds]
fsvehla has quit [Ping timeout: 276 seconds]
dr_bob has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
maxmanders has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
tjadc has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 252 seconds]
ridget has joined #ruby-lang
thufir_ has quit [Quit: Leaving.]
KA_ has quit [Quit: KA_]
gnufied has quit [Quit: Leaving.]
marr has joined #ruby-lang
mantono has joined #ruby-lang
ryanf has quit [Quit: leaving]
noop has joined #ruby-lang
thelazycamel has left #ruby-lang [#ruby-lang]
KA_ has joined #ruby-lang
iamjarvo has quit [Quit: Leaving.]
gnufied has joined #ruby-lang
KA_ has quit [Quit: KA_]
amerine has quit [Quit: Computer has gone to sleep.]
KA_ has joined #ruby-lang
tbuehlmann has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
vlad_sta_ has quit [Remote host closed the connection]
robotmay has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 256 seconds]
dcwu has quit [Quit: Leaving.]
zmack has joined #ruby-lang
chekcmate has joined #ruby-lang
gregmo___ has quit [Remote host closed the connection]
<chekcmate>
mornüüün!
ridget has quit [Remote host closed the connection]
Nisstyre-laptop has quit [Ping timeout: 256 seconds]
ottbot has joined #ruby-lang
<jaska>
opening that graphviz png in ffox made x11 lock up for a minute :D hah
fsvehla has joined #ruby-lang
Criztian has joined #ruby-lang
fsvehla has quit [Ping timeout: 255 seconds]
<UziMonkey>
is this perverse, or good? Given an arbitrary Array of numbers and other Arrays such as [1,2,[3,4,[5],6],7,[8,9]] and the desired output of an Array of the same structure, but each element mapped, you can do this.
<UziMonkey>
I renamed it to rmap because "recmap" sounds like a reject alien from a B-movie
skade has joined #ruby-lang
judofyr has joined #ruby-lang
fsvehla has quit [Ping timeout: 240 seconds]
fsvehla has joined #ruby-lang
<judofyr>
morning
<certainty>
UziMonkey: nice
<certainty>
deep-map
adambeynon has joined #ruby-lang
<UziMonkey>
it doesn't work on hashes since hashes enumerated yield [k,v] arrays
<certainty>
make sense. the semantics of it would at least be unclear
<certainty>
apply the proc to values or keys, etc.
<certainty>
maybe treemap is another name
<UziMonkey>
ideally I'd like to apply the proc to anything enumerable spits out, but this can't tell the difference between a nested array and the [k,v] array from a hash
KA_ has quit [Quit: KA_]
<UziMonkey>
I suppose I can just do a special Hash#rmap since it's kind of an oddball
<UziMonkey>
or move it to Array
<judofyr>
UziMonkey: what are you working on?
<UziMonkey>
nothing, really
<UziMonkey>
I'm just playing
<certainty>
what would it do on hashes?
<UziMonkey>
I'll show you, brb
fsvehla_ has joined #ruby-lang
fsvehla has quit [Ping timeout: 246 seconds]
fsvehla_ is now known as fsvehla
agarcia has joined #ruby-lang
workmad3 has joined #ruby-lang
imajes has quit [Ping timeout: 276 seconds]
kcassidy has joined #ruby-lang
<UziMonkey>
yes, this is convoluted now
<UziMonkey>
I suppose it only does make sense if you want to map values
<certainty>
{a:1,b:{c:2,d:3},e:{f:4},g:5}.rvmap(:last){|v| v+1 } .. the parameter could default to nil which means identity ... but maybe that's too much
fsvehla has quit [Ping timeout: 245 seconds]
fsvehla_ is now known as fsvehla
<UziMonkey>
you could just default it to v yourself
<UziMonkey>
wait, what?
<certainty>
so that you can as well work on keys if you like {a:1,b:{c:2,d:3},e:{f:4},g:5}.invert.rvmap(:first){|k| k+1}
<UziMonkey>
well I have an rkmap too for mapping keys
beho has joined #ruby-lang
<certainty>
ah, that's what the v stands for
<certainty>
nevermind then
MaddinXx has joined #ruby-lang
<UziMonkey>
you could make it more complicated by passing two blocks
<certainty>
unless you have keys that are hashes that you want descent into :) but that's uhm uncommon
<UziMonkey>
no, the problem is here
<UziMonkey>
I don't even know
<UziMonkey>
I can't think of a use case for mapping keys _and_ values
<UziMonkey>
let alone in isolation, if you ahve a single block that maps both keys and values, how does it tell the difference between a [k,v] pair where v is nil, and one where the v is really a sub-hash but the method just passed it nil because expecting your block to also deal with sub-hashes is asking too much?
<UziMonkey>
damn.. I'm on 30mbit and I think it's plenty fast :P
<ggreer>
I bet it'd be faster if I tried it over ethernet
<chekcmate>
I'm not paranoid, that's an easy way to counter such arguments though, isn't it?
<injekt>
yeah im on 30 too going up to 60 soon and im pretty happy with it
<UziMonkey>
I had a download hit 2meg/s yesterday
<UziMonkey>
I doubt mine will get much faster, so I live in the middle of nowhere as far as bandwidth is concerned
<ggreer>
it is rather comical what one does with fast internet access. for example, I downloaded a blu ray rip of aliens but the default audio was french
<ggreer>
(english dialogue was still there, but I had to select it manually when I started playing the movie)
<injekt>
lol
<ggreer>
so I downloaded a different 20GB blu-ray rip
<ggreer>
instead of figuring out how to change a couple of flags in an mkv
<UziMonkey>
well that's just idiotic :P
<ggreer>
yeah next time I'll be sure to look at the nfo first
<chekcmate>
UziMonkey: Do you use tools like ghostery or any ad-block/tracking-killer?
<UziMonkey>
nope
<UziMonkey>
why?
<ggreer>
also changing the default language for that movie is a huge troll because the first 5 minutes have no dialogue
<chekcmate>
because they are very interesting when it comes to what actually gets collected
<chekcmate>
and I find that disturbingly much
<UziMonkey>
if you say so, Mr. Paranoid
<chekcmate>
ok, mr. argument
<UziMonkey>
I told you, I'm not arguing, you are
<chekcmate>
that's the keyboard ranger speaking, aight?
<ggreer>
there's some interesting stuff in google analytics, but it's mostly used for boring purposes (like trying to figure out the right adwords to buy)
<chekcmate>
Well, I would tell you what gets tracked and how it is used or may be used, but if you simply say "paranoid", you're asking me to continue to poke
<UziMonkey>
I really need to oil my keyboard tray... I pushed it in and woke up the dog from across the thouse
<Paradox>
blerg
<Paradox>
ggreer, you know you can configure VLC to always play english
<chekcmate>
you probably pushed it in your head, there seems to be a lot of hot air in there...
<chekcmate>
anyways, don't wanna continue wasting my time about this, you have your opinion, I have mine
<chekcmate>
now you told me that I'm paranoid and I told you about your hot air, we're even I guess
<ggreer>
Paradox: thanks. that's pretty useful
dhruvasagar has quit [Ping timeout: 252 seconds]
benanne has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ridget has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
Criztian has quit [Ping timeout: 245 seconds]
Criztian has joined #ruby-lang
vlad_starkov has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby-lang
<UziMonkey>
I have a bit of a strange setup. I run Windows, but Linux in VMWare using Unity so my Linux windows sit side by side with my Windows windows. When I make a request to a rails app on localhost:3000 from the VM, it's really fast. But when making a request from Windows on 192.168.1.6:3000, there's a 10 second pause on every request that it makes. That's not
<UziMonkey>
really a Windows question, but anyone have any ideas on that?
<charliesome>
chekcmate: we can now call him ex-benedict
<caral>
Hi. I have a "ordered" hash in ruby 1.9.3 like http://pastie.org/6116172 . How do I access the value at the key after :red? I do not find any method for that in the API.
<workmad3>
caral: hashes aren't meant for that sort of use
<judofyr>
caral: but do you care about "the next value"? why not just use color[:green]?
deribb_l has joined #ruby-lang
<workmad3>
caral: that's basically a usecase for 'I want my hash to act like an array of pairs'
<workmad3>
caral: at which point... just use an array of pairs ;)
<caral>
a good question :). I think I should think about it a little more.
Mon_Ouie has joined #ruby-lang
<caral>
oh :D I had an array of pairs earlier. Thx for the comments.
bhrgunatha has joined #ruby-lang
noop has quit [Remote host closed the connection]
svandiepen has joined #ruby-lang
kith has quit [Read error: Connection reset by peer]
kith has joined #ruby-lang
fsvehla has joined #ruby-lang
bhrgunatha has quit [Quit: ChatZilla 0.9.90 [Firefox 21.0a1/20130210031150]]
jxie has quit [Ping timeout: 264 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
lolzie has joined #ruby-lang
MartynKeigher has quit [Excess Flood]
MartynKeigher has joined #ruby-lang
erichmenge has quit [Quit: Arrivederci!]
<lolzie>
Hi guys. I wish to create a 2d image, modifying each individual pixel with a particular RGB - and then export it to a jpeg. How could I go about doing this / which library?
svandiepen has quit [Remote host closed the connection]
<injekt>
go for mini_magick unless you want issues
<injekt>
because fuck rmagick :(
<injekt>
lib has ruined my day more than once
<injekt>
and it's slow and full of memory leaks
<injekt>
I should point out that mini_magick wraps around imagemagicks cli tools, rmagick integrates the libmagick library
JohnBat26 has joined #ruby-lang
postmodern has quit [Quit: Leaving]
badeball has quit [Ping timeout: 252 seconds]
badeball has joined #ruby-lang
slyphon has joined #ruby-lang
<lolzie>
injekt: will bear that in mind!
<lolzie>
Have half-given-up installation of rmagick for now anyway
jperry2 has quit [Quit: jperry2]
<lolzie>
Wanted to quickly demo it, not spend half a day researching how to install it1
<injekt>
installation should be relatively easy if you've installed imagemagick
fsvehla has quit [Quit: fsvehla]
<injekt>
that said, it's always been a pita, switching my work apps over to mini_magick was the best thing I ever did
<injekt>
had a 60% speed increase for some things, too
vlad_starkov has quit [Remote host closed the connection]
beho has joined #ruby-lang
slyphon has quit [Quit: slyphon]
sush24 has joined #ruby-lang
chekcmate has quit [Quit: Page closed]
zmack has quit [Ping timeout: 260 seconds]
sailias1 has joined #ruby-lang
judofyr has quit [Read error: Connection reset by peer]
judofyr has joined #ruby-lang
dustint has joined #ruby-lang
iamjarvo has joined #ruby-lang
davidbalber|away is now known as davidbalbert
<Smol>
if you're on jruby, i'd use java.awt/javax.image directly
<judofyr>
image processing in Ruby has always been a bit crap :/
<judofyr>
I miss Imager (from Perl)
__BigO__ has joined #ruby-lang
iamjarvo has quit [Client Quit]
<UziMonkey>
jRuby is a pretty good idea here, you'll have access to anything on Java really, and I'm sure there's something appropriate
slyphon has joined #ruby-lang
Uranio has joined #ruby-lang
Bearproof has joined #ruby-lang
<UziMonkey>
the alternative is to output a simple image format yourself like a 24-bit bitmap and compress from the command line
fsvehla has joined #ruby-lang
Bearproof has left #ruby-lang [#ruby-lang]
srbaker has joined #ruby-lang
tomzx_mac has joined #ruby-lang
banisterfiend has quit [Ping timeout: 245 seconds]
agile has joined #ruby-lang
davidbalbert is now known as davidbalber|away
slyphon has quit [Ping timeout: 276 seconds]
rins has quit [Ping timeout: 246 seconds]
megha has quit [Ping timeout: 246 seconds]
davidbalber|away is now known as davidbalbert
deribb_l has quit [Ping timeout: 246 seconds]
lolzie has quit [Ping timeout: 245 seconds]
deribb_l has joined #ruby-lang
megha has joined #ruby-lang
Bearproof1 has joined #ruby-lang
Bearproof1 has left #ruby-lang [#ruby-lang]
kcassidy_ has joined #ruby-lang
glebm has joined #ruby-lang
willdrew has joined #ruby-lang
agarie_ has joined #ruby-lang
face has joined #ruby-lang
Y_Ichiro_ has joined #ruby-lang
Y_Ichiro_ has quit [Changing host]
Y_Ichiro_ has joined #ruby-lang
agarcia_ has joined #ruby-lang
kirin` has quit [Disconnected by services]
vbatts|w` has joined #ruby-lang
tpope_ has joined #ruby-lang
kirin` has joined #ruby-lang
asio_ has joined #ruby-lang
rebelcan_ has joined #ruby-lang
eam_ has joined #ruby-lang
dreinull_ has quit [Ping timeout: 276 seconds]
herpless has quit [Ping timeout: 276 seconds]
kcassidy has quit [Ping timeout: 276 seconds]
faces has quit [Ping timeout: 276 seconds]
vbatts|work has quit [Ping timeout: 276 seconds]
Spaceghostc2c has quit [Ping timeout: 276 seconds]
rebelcan has quit [Ping timeout: 276 seconds]
tpope has quit [Ping timeout: 276 seconds]
nibbo has quit [Ping timeout: 276 seconds]
asio has quit [Ping timeout: 276 seconds]
MartynKeigher has quit [Read error: Connection reset by peer]
agarcia has quit [Ping timeout: 276 seconds]
agarie has quit [Ping timeout: 276 seconds]
Y_Ichiro has quit [Ping timeout: 276 seconds]
priodev has quit [Ping timeout: 276 seconds]
eam has quit [Ping timeout: 276 seconds]
MrWGW- has quit [Ping timeout: 276 seconds]
priodev has joined #ruby-lang
asio_ is now known as asio
Spaceghostc2c has joined #ruby-lang
GarethAdams has quit [Remote host closed the connection]
MartynKeigher has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
tomzx_mac has quit [Ping timeout: 244 seconds]
djwonk has joined #ruby-lang
techlife has quit [Ping timeout: 255 seconds]
kirin` has quit [Ping timeout: 252 seconds]
kirin` has joined #ruby-lang
rins has joined #ruby-lang
riffraff has joined #ruby-lang
kirin` has quit [Ping timeout: 256 seconds]
bantic has joined #ruby-lang
nXqd has quit [Ping timeout: 252 seconds]
kirin` has joined #ruby-lang
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
slyphon has joined #ruby-lang
<Uranio>
hi all, what could be this /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- rubygems/format (LoadError)
<Uranio>
is rails compatible with ruby2?
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
<judofyr>
Uranio: I think so; not quite sure
techlife has joined #ruby-lang
<injekt>
Uranio: bundler isn't
<Uranio>
:-P
<injekt>
that's bundler trying to load rubygems/format
<injekt>
bundler head is, though
<injekt>
so maybe try that (good luck :P)
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
<Uranio>
so... must wait until bundle reach the present
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
nibbo has joined #ruby-lang
<injekt>
right
<UziMonkey>
I've run Rails on Ruby 2, works fine
techlife has joined #ruby-lang
<injekt>
bundler always have prelease gems though
methods has joined #ruby-lang
<injekt>
gem install bundler --pre
methods has left #ruby-lang [#ruby-lang]
megha has quit [Quit: WeeChat 0.4.0]
megha has joined #ruby-lang
kirin` has quit [Ping timeout: 255 seconds]
kirin` has joined #ruby-lang
arubin has joined #ruby-lang
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
mercwithamouth has joined #ruby-lang
GarethAdams has joined #ruby-lang
krz has joined #ruby-lang
kirin` has quit [Ping timeout: 252 seconds]
kirin` has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
io_syl has joined #ruby-lang
znake has joined #ruby-lang
znake has quit [Client Quit]
slyphon has quit [Quit: slyphon]
bzalasky has joined #ruby-lang
slyphon has joined #ruby-lang
slyphon_ has joined #ruby-lang
sailias1 has quit [Quit: Leaving.]
glebm_ has joined #ruby-lang
glebm has quit [Ping timeout: 240 seconds]
sailias has joined #ruby-lang
glebm_ is now known as glebm
kirin` has quit [Ping timeout: 245 seconds]
asdfqwer has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
slyphon_ is now known as slyphon
gnufied has joined #ruby-lang
kirin` has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
cirenyc has joined #ruby-lang
cirenyc has quit [Read error: Connection reset by peer]
<drbrain>
Uranio: if you get the error from bundler, make sure you are using the 1.3 prerelease
slyphon has joined #ruby-lang
<injekt>
drbrain: it's bundler and it's been fixed
<injekt>
yeah that was the issue
neocoin has joined #ruby-lang
jonahR has joined #ruby-lang
<drbrain>
ah, good
__BigO__ has joined #ruby-lang
<rwjblue>
Are at_exit blocks registered into an array that I can access from a test? I want to assert that a given method sets an at_exit block..
<rwjblue>
I didn't find anything obvious from a quick google...
<drbrain>
rwjblue: you can't access the registered at_exit blocks at runtime
<rwjblue>
drbrain: OK, thank you
<drbrain>
rwjblue: you can use IO.popen to test at_exit prints something
blazes816 has joined #ruby-lang
tylersmith has quit [Quit: tylersmith]
blazes816 has quit [Client Quit]
<rwjblue>
drbrain: I am trying to ensure that a pidfile is deleted at_exit; so I could spawn a new process and ensure that it creates/then deletes the file?
maxmanders has joined #ruby-lang
__butch__ has joined #ruby-lang
davidbalber|away is now known as davidbalbert
bryanl has quit [Ping timeout: 244 seconds]
__BigO__ has quit [Remote host closed the connection]
<drbrain>
rwjblue: yes
joevandyk has joined #ruby-lang
<drbrain>
rwjblue: if possible, I would make pidfile deletion a separate method
<drbrain>
so you can test it without popen, then you only need to test your at_exit handler
<drbrain>
… via popen
<crankharder>
how am i supposed to specify json >= 1.5.5, < 1.6 and future 1.5.x releases?
davidbalbert is now known as davidbalber|away
jtoy has joined #ruby-lang
<drbrain>
crankharder: '~> 1.5', '>= 1.5.5'
<crankharder>
ah, didn't know it could take two params
<rwjblue>
drbrain: OK, gotcha; so just call that delete method from the at_exit block? Then I can test the method independantly...
<drbrain>
as many as you like so long as it is a continuous range
<drbrain>
rwjblue: that's how I usually design it
<rwjblue>
drbrain: OK, cool thanks for your help
<drbrain>
even if you end up with at_exit { delete_pidfile } in your implementation, it's easier to test delete_pidfile without having to jump through IO.popen every time
ImSexyandIknowit has joined #ruby-lang
JohnBat26 has joined #ruby-lang
bryanl has joined #ruby-lang
<rwjblue>
drbrain: great!
<Uranio>
OMG! ascii_only?
tylersmith has joined #ruby-lang
s1n4 has quit [Quit: leaving]
slyphon has quit [Quit: slyphon]
slyphon has joined #ruby-lang
KA_ has quit [Quit: KA_]
<jtoy>
is there a way I can get all the command lines options of a script into a hash without actually parsing it? I mean with option parser I need to tell it what every option actually is, I just want the whole thing passed into a hash without me having to parse it
<canton7>
jtoy, like how trollop does it?
jonahR has quit [Quit: jonahR]
KA_ has joined #ruby-lang
<canton7>
except you *are* parsing the command-line flags... but I don't think that's how you meant it
<jtoy>
canton7: not exactly,
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
<canton7>
care to clarify then?
Mike26 has joined #ruby-lang
<jtoy>
i just want --random 1 --random2 8 -random3 4 to show up in a hash opts without me having to explicitly state random2 random3 , the reason i want this is because I take those options raw and pass a hash to a class which then parses the data
<jtoy>
if i have to explicitly parse the opts, then i am basically doing this twice
<jtoy>
canton7: you see what I mean?
<rwjblue>
canton7: I've used something like 'ARGV.include?('-blah') && ARGV[ARGV.index('-blah') + 1]' on occasion so I didn't have to care about the argument order. (I did eventually go with optparse though...)
<canton7>
do you want to be passing ARGV straight off?
madish has joined #ruby-lang
drbrain has quit [Remote host closed the connection]
<jtoy>
canton7: yes, I should convert it to a hash myself
<rwjblue>
jtoy: that makes some assumptions though
<jtoy>
rwjblue: right, that means every flag has an option
<rwjblue>
exactly, so if you have one that doesn't you will have to remove it from ARGV first...
<canton7>
yeah, that's thepotential problem. the reason that command-line flag parsers need information before they start parsing, is that that information is needed for parsing to happen
<rwjblue>
canton7: exactly
vlad_starkov has quit [Remote host closed the connection]
<jtoy>
you probably could make it smart enough just by checking if the next one has a -/-- or not, then the only other thing the option parsing does is have default values, a nice looking help, and changing types of values
<canton7>
and often some degree of validation, which ties into the help
ottbot has joined #ruby-lang
<rwjblue>
It really depends on what you are after. If it is a command line script that is only callable by code that you control (or you can assume so), then something simple would work, but as soon as you start getting outside input watch out!
<jtoy>
rwjblue: yes, its all controllable by me
Uranio has quit [Quit: while you reading this, a kitty dies]
joevandyk has quit [Quit: joevandyk]
KA_ has quit [Quit: KA_]
gnufied has joined #ruby-lang
rodj has quit [Ping timeout: 245 seconds]
SiliconDon has joined #ruby-lang
gnufied has quit [Client Quit]
benanne has quit [Quit: kbai]
fjfish has quit [Remote host closed the connection]
ottbot has quit [Ping timeout: 264 seconds]
joevandyk has joined #ruby-lang
joevandyk has quit [Client Quit]
ohcomely has joined #ruby-lang
davidbalber|away is now known as davidbalbert
SiliconDon has quit []
__BigO__ has joined #ruby-lang
j3rryg311 has joined #ruby-lang
jvrmaia has joined #ruby-lang
riffraff has quit [Quit: Leaving]
ivanoats has quit [Remote host closed the connection]
kogent has joined #ruby-lang
kogent has quit [Remote host closed the connection]
kogent has joined #ruby-lang
francisfish has joined #ruby-lang
nXqd has joined #ruby-lang
marr has joined #ruby-lang
ridget has joined #ruby-lang
fjfish has joined #ruby-lang
francisfish has quit [Ping timeout: 245 seconds]
ohcomely has quit [Quit: Leaving...]
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
ohcomely has joined #ruby-lang
ridget has quit [Remote host closed the connection]
jonahR has joined #ruby-lang
ottbot has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
JohnBat26 has quit [Remote host closed the connection]
<injekt>
it auto-creates options on the fly so you dont have to specify any
__BigO__ has quit [Remote host closed the connection]
Nisstyre has joined #ruby-lang
<jtoy>
injekt: cool. that is sweet
<jtoy>
injekt: i will try this, this probably fixes it
workmad3 has quit [Ping timeout: 245 seconds]
<whitequark>
injekt: that is as bad as openstruct :/
__BigO__ has joined #ruby-lang
<injekt>
whitequark: what?
enebo has quit [Quit: enebo]
benanne has joined #ruby-lang
<whitequark>
injekt: option autocreation
<injekt>
whitequark: why is that 'as bad as openstruct'?
<injekt>
it's an opt-in feature that's useful
<whitequark>
injekt: what would an use case be?
<injekt>
whitequark: ask jtoy, he's using it
<jtoy>
whitequark: i pass options directly to a class that parses the options, so i don't want to parse them twice
<jtoy>
it saves me time
<whitequark>
jtoy: i guessed it was something like that
<injekt>
whitequark: anyway, all it means is that you don't have to be explicit, what's wrong with that? I'm still confused as to why it's 'as bad as openstruct'
<whitequark>
injekt: it encourages building bad UI. for example, I'm fairly certain that jtoy's program doesn't respond to --help properly
maxmanders has joined #ruby-lang
Criztian has quit [Ping timeout: 252 seconds]
Criztian has joined #ruby-lang
<injekt>
that's up to the person using the library
<jtoy>
whitequark: i want it for simple scripts, but for more production items ill probably use optionparse
__BigO__ has quit [Remote host closed the connection]
<whitequark>
injekt: it is also up to a PHP programmer to use mysql_real_escape_string
<whitequark>
spaghetti-encouraging features in popular libraries make me sad :)
<whitequark>
*:(
<injekt>
slop is fine for doing anything optparse does, whitequark is just saying you should be explicit with your options and not rely on something like autocreate
__BigO__ has joined #ruby-lang
<injekt>
which i agree with
lcdhoffman has joined #ruby-lang
<jtoy>
injekt: yup
maxmanders has quit [Ping timeout: 252 seconds]
ImSexyandIknowit has quit [Quit: афк]
bluepojo has joined #ruby-lang
havenwood has joined #ruby-lang
Criztian has quit [Read error: Connection reset by peer]
Criztian_ has joined #ruby-lang
maxmanders has joined #ruby-lang
<naquad>
can i somehow load gem not from bundle when using bundler?
asdfqwer has quit []
stonerfish has joined #ruby-lang
adambeynon has joined #ruby-lang
<whitequark>
naquad: but what is the point of using bundler then
xcombelle has quit [Quit: Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC.]
ohcomely has quit [Quit: Leaving...]
<naquad>
whitequark, i have 3rd party application in production mode. seems that i've misconfigured it, but can't figure out which parameter is wrong. what i have is exception, so the plan is: bypass bundler, load debugger, start debugger in method raising exception, figure out what's wrong, revert all changes
cultureulterior_ has joined #ruby-lang
<whitequark>
naquad: you're better off simply adding your gem to the bundle
<naquad>
whitequark, and i won't be able to install because i have only user on this system
<naquad>
while gem is configured to install gems locally
<tjgillies>
is there a way to inspect what file a class was required from?
<tjgillies>
or any sort of provenance?
<whitequark>
tjgillies: a class, no
Bearproof has joined #ruby-lang
sailias has quit [Ping timeout: 245 seconds]
<whitequark>
but there is #source_location in Method and Proc
<tjgillies>
whitequark: what abotu a module?
<whitequark>
tjgillies: same
Bearproof has left #ruby-lang [#ruby-lang]
<mythogen>
tjgillies: why would you want to?
<tjgillies>
mythogen: im trying to figure out which gem is including this module, since its not my source
<mythogen>
tjgillies: Ah, ouch. Sounds like the old fashioned way will serve you best: remove gems until it stops doing whatever it is that it's doing.
workmad3 has joined #ruby-lang
<tjgillies>
mythogen: meh, ok thnx
TheMoonMaster has quit [Excess Flood]
jonahR has quit [Quit: jonahR]
<tjgillies>
whitequark: wow never knew about source_location, thats awesome thanks
TheMoonMaster has joined #ruby-lang
willdrew has quit [Remote host closed the connection]