kvs has quit [Read error: Connection reset by peer]
toretore has quit [Quit: Leaving]
Brainix has joined #ruby-lang
faustroll has quit [Remote host closed the connection]
kvs has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
arubin has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
geopet has quit [Quit: geopet]
jonahR has quit [Quit: jonahR]
ryanv-raptor has joined #ruby-lang
swav has joined #ruby-lang
sailias has quit [Quit: Leaving.]
bluepojo_ has quit [Ping timeout: 252 seconds]
carsonm has joined #ruby-lang
carsonm has left #ruby-lang [#ruby-lang]
sn0wb1rd has joined #ruby-lang
unix has joined #ruby-lang
sn0wb1rd has quit [Remote host closed the connection]
kvs has quit [Read error: Connection reset by peer]
adgar has quit [Ping timeout: 276 seconds]
kvs has joined #ruby-lang
Qwak has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
nXqd has joined #ruby-lang
<freedrull>
assuming im using hoe, how should a rubygem with a binary in bin/ require its code in lib? require 'lib/mygem'? and have that file in lib/mygem.rb require everything else?
<drbrain>
freedrull: require 'mygem' then have lib/mygem.rb require other stuff as needed
<drbrain>
freedrull: test with: ruby -Ilib bin/mygem ...
Brainix has quit [Quit: Brainix]
Graham_K has joined #ruby-lang
nXqd has quit [Ping timeout: 264 seconds]
sduckett has joined #ruby-lang
agile has joined #ruby-lang
Graham_K has quit [Client Quit]
jbsan has quit [Read error: Connection reset by peer]
jbsan has joined #ruby-lang
mistym has quit [Remote host closed the connection]
Qfwfq has joined #ruby-lang
cirenyc has joined #ruby-lang
<freedrull>
ah ok
<freedrull>
so just pass -Ilib when testing
<freedrull>
didnt wanna get into the mess of modifying the load path in the code :)
<drbrain>
freedrull: usually my files in bin are three lines long so I can test the functionality from regular tests
glebm has quit [Quit: Computer has gone to sleep.]
<drbrain>
the shebang, require 'mylib' and MyLib.run ARGV
<freedrull>
ah cool
kvs has quit [Read error: Connection reset by peer]
kvs has joined #ruby-lang
sduckett has quit [Ping timeout: 245 seconds]
amerine has quit [Quit: Computer has gone to sleep.]
kiwnix has quit [Quit: Leaving]
amerine has joined #ruby-lang
dankest has quit [Ping timeout: 255 seconds]
S2kx has joined #ruby-lang
lcdhoffman has joined #ruby-lang
tylersmith has quit [Quit: tylersmith]
lcdhoffman has quit [Client Quit]
kvs has quit [Read error: Connection reset by peer]
io_syl has quit [Ping timeout: 255 seconds]
sailias has joined #ruby-lang
S1kx has quit [Ping timeout: 255 seconds]
sailias has quit [Client Quit]
blowmage has quit [Ping timeout: 252 seconds]
blowmage has joined #ruby-lang
baba has joined #ruby-lang
unix has quit [Ping timeout: 256 seconds]
kvs has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
yfeldblum has quit [Quit: Leaving]
yfeldblum has joined #ruby-lang
L0rdShrek____ has joined #ruby-lang
kvs has quit [Read error: Connection reset by peer]
beawesomeinstead has joined #ruby-lang
havenwood has joined #ruby-lang
kvs has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
slaytanic has quit [Read error: Connection reset by peer]
Demux_ has quit [Ping timeout: 256 seconds]
slaytanic has joined #ruby-lang
Weems has joined #ruby-lang
apeiros_ has joined #ruby-lang
ryanv-raptor has quit [Quit: Leaving.]
datanoise has quit [Ping timeout: 276 seconds]
apeiros_ has quit [Ping timeout: 255 seconds]
sush24 has joined #ruby-lang
seoaqua has joined #ruby-lang
arubin has quit [Quit: Computer has gone to sleep.]
ryanv-raptor has joined #ruby-lang
ryanv-raptor has quit [Client Quit]
Qwak has quit [Ping timeout: 255 seconds]
kvs has quit [Read error: Connection reset by peer]
kvs has joined #ruby-lang
slaytani1 has joined #ruby-lang
slaytanic has quit [Ping timeout: 255 seconds]
slaytani1 is now known as slaytanic
lsegal has joined #ruby-lang
JohnBat26 has joined #ruby-lang
datanoise has joined #ruby-lang
geopet has joined #ruby-lang
slyphon has quit [Quit: slyphon]
soypirate has quit [Ping timeout: 255 seconds]
wmoxam has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
pr0ton has joined #ruby-lang
pr0ton has quit [Client Quit]
klebervi_ has quit [Remote host closed the connection]
klebervirgilio has joined #ruby-lang
r0bby has joined #ruby-lang
klebervirgilio has quit [Ping timeout: 245 seconds]
Qfwfq has quit [Ping timeout: 255 seconds]
thufir_ has joined #ruby-lang
kogent has joined #ruby-lang
kogent has quit [Client Quit]
Qfwfq has joined #ruby-lang
geopet has quit [Quit: geopet]
sush24 has quit [Quit: This computer has gone to sleep]
bluepojo has joined #ruby-lang
jbsan has quit [Read error: Connection reset by peer]
jbsan has joined #ruby-lang
macmartine has joined #ruby-lang
swav has quit [Remote host closed the connection]
swav has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 255 seconds]
swav has quit [Ping timeout: 248 seconds]
Bosox20051 has quit [Quit: Leaving]
rc- has joined #ruby-lang
<yfeldblum>
how are times in different timezones compares, e.g., `[time1, time2, time3].max` ?
<drbrain>
yfeldblum: they're compared via UTC: t = Time.now; p t < t.utc
<yfeldblum>
drbrain, so in my example it's effectively doing `[time1, time2, time3].map(&:getutc).max`?
<drbrain>
yeah
<yfeldblum>
drbrain, thanks
kvs has quit [Read error: Connection reset by peer]
segfault has joined #ruby-lang
segfault is now known as Guest10079
kvs has joined #ruby-lang
seoaqua has quit [Quit: 离开]
sush24 has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
gregmoreno has joined #ruby-lang
wmoxam has quit [Ping timeout: 256 seconds]
thufir_ has quit [Quit: Leaving.]
rc- has quit []
io_syl has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
Mawk has quit [Quit: Mawk]
gregmoreno has quit [Remote host closed the connection]
Qfwfq has quit [Remote host closed the connection]
Qfwfq has joined #ruby-lang
bluepojo has quit [Ping timeout: 252 seconds]
r0bby is now known as robbyoconnor
noop has joined #ruby-lang
krz has joined #ruby-lang
kvs has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
kvs has joined #ruby-lang
brianpWins has joined #ruby-lang
stonerfish has joined #ruby-lang
Qfwfq has quit [Ping timeout: 255 seconds]
Sonarcade has joined #ruby-lang
rippa has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
geopet has joined #ruby-lang
dyln has joined #ruby-lang
kvs has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby-lang
kvs has joined #ruby-lang
KM has joined #ruby-lang
KM is now known as Guest14150
wardrop has quit [Quit: wardrop]
vlad_starkov has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
sepp2k has joined #ruby-lang
baba has quit [Read error: Connection reset by peer]
wmoxam has quit [Ping timeout: 260 seconds]
<freedrull>
has anyone tested s3 uploads with vcr? i cant think of a way to do it without giving away my creds in the code...
techlife has quit [Ping timeout: 256 seconds]
<freedrull>
i checked out how paperclip does it, seems like they just have a test called s3_live_test that isnt normally run im guessing, it gets the s3 creds from env vars
techlife has joined #ruby-lang
bedouin has joined #ruby-lang
dedis has quit [Ping timeout: 260 seconds]
snk has quit [Ping timeout: 260 seconds]
brianpWins has joined #ruby-lang
amerine has joined #ruby-lang
snk has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 255 seconds]
bedouin has quit [Client Quit]
<lsegal>
freedrull yes, you put your creds in the environment or load them from a file
<freedrull>
but then if you distribute this in a gem, dont the creds have to be loaded for the vcr test to playback properly
bedouin has joined #ruby-lang
bedouin has quit [Client Quit]
<freedrull>
or would they already be recorded
<lsegal>
no, you're not actually sending the request the second time if you're packaging up the vcr data in your gem
unix has joined #ruby-lang
<lsegal>
but, you should expect your users have their credentials setup anyway, if they plan on using something that communicates with s3
bedouin has joined #ruby-lang
<freedrull>
right
<havenwood>
y
<freedrull>
it would be nice if the tests could pass on say, travis or whatever if i release this
bedouin has quit [Client Quit]
delqn has joined #ruby-lang
delqn has quit [Client Quit]
kvs has quit [Read error: Connection reset by peer]
delqn has joined #ruby-lang
delqn has quit [Client Quit]
sn0wb1rd has joined #ruby-lang
delqn has joined #ruby-lang
workmad3 has joined #ruby-lang
delqn has quit [Client Quit]
<freedrull>
what i tried was setting the credentials in env vars, recording the request, it passed. then i tried running the test without the env vars set, and i get this error https://gist.github.com/anonymous/5011429
<lsegal>
ah
<lsegal>
you'll want to set some default creds in the tests if no env is set
<lsegal>
the sdk is trying to check if you're on an ec2 instance and grab credentials from the instance metadata
delqn has joined #ruby-lang
francisfish has joined #ruby-lang
delqn has quit [Client Quit]
delqn has joined #ruby-lang
<lsegal>
(because nothing was set)
delqn has joined #ruby-lang
<freedrull>
ah ok, so it will raise an error if there are no credentials, even if its not technically going to use them since im using this vcr playback
delqn has quit [Client Quit]
<lsegal>
right
delqn has joined #ruby-lang
delqn has quit [Client Quit]
<freedrull>
awesome, this works great now as long as i have the key id and secret token set
<freedrull>
and the same bucket that i used in the vcr cassette
havenn has quit [Remote host closed the connection]
<yorickpeterse>
I have to store data at some point, either in a register or a stack (in my current implementation of the linter it's using a stack based approach)
probst has joined #ruby-lang
GarethAdams has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
<whitequark>
yorickpeterse: um, both of these machines are as unsuited for transformations as it is possible
<yorickpeterse>
eh?
torrieri has joined #ruby-lang
gregmoreno has joined #ruby-lang
kvs has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
<yorickpeterse>
If I'm not supposed to use a register or stack, how the fuck do I store data then?
<yorickpeterse>
to clarify: I *have* to store data somewhere for a certain period of time for proper analysis
<yorickpeterse>
so unless I'm an idiot I have to use a register, stack or the likes
<yorickpeterse>
And I'm not going to pass it around as arguments
probst has quit [Quit: probst]
torrieri has quit [Ping timeout: 276 seconds]
sush24 has joined #ruby-lang
havenwood has joined #ruby-lang
Qfwfq has quit [Ping timeout: 255 seconds]
blacktulip has joined #ruby-lang
<soahccc>
Is there any standalone autoloader for ruby? I do not mean the lazy sort of autoload function but more the behaviour of Rails. But I wasn't able to find the technique behind it and I'm afraid I can't lightweight use it in my non rails stuff, can I?
elico has joined #ruby-lang
kvs has quit [Read error: Connection reset by peer]
glebm has joined #ruby-lang
Qwak has quit [Ping timeout: 255 seconds]
kvs has joined #ruby-lang
injekt has joined #ruby-lang
babinho has joined #ruby-lang
<yorickpeterse>
There's Kernel.autoload but it will be removed in the future
<whitequark>
yorickpeterse: read that PDF.
<whitequark>
SCCP is what you're going to implement for analysis.
<whitequark>
basically you have a map of SSA instructions to their values.
torrieri has joined #ruby-lang
tdy_ has quit [Ping timeout: 276 seconds]
<yorickpeterse>
This makes no sense, I'd rather see some actual code
<yorickpeterse>
this is probably the part where people come in and yell "YOU DIRTY DROPOUT!!!!"
* whitequark
shrugs
toretore has joined #ruby-lang
<whitequark>
I'm a dropout as well, for that matter. And I wasn't even in anything CS-related.
<whitequark>
This is one of those cases when you could either learn the damn thing, or spend half a year writing a slow and buggy reimplementation of it.
<soahccc>
yorickpeterse: Yeah this is what I meant with "lazy". It has no real sense except saving memory. I want a AUTOloader
<whitequark>
soahccc: Rails-style autoloader involves some really evil hacks
<whitequark>
well, Rails generally features this kind of stuff more often than a lot of us would wish...
glebm has quit [Ping timeout: 264 seconds]
zmack has joined #ruby-lang
<soahccc>
I don't care if I'm honest. It works at least, my approach struggles with ruby's constant lookup.
zmack has quit [Remote host closed the connection]
<whitequark>
soahccc: you can reuse that component of ActiveSupport.
<yorickpeterse>
whitequark: the fact that the whole paper uses all kinds of terms and characters I'm not familiar with don't exactly make it easier
<soahccc>
alternatively if this is "cleaner" I would be satisfied as well but I guess not: Just require the whole everything :)
unix has quit [Quit: WeeChat 0.4.0]
unix has joined #ruby-lang
<yorickpeterse>
It's not a matter of not wanting to learn, it's just that it doesn't make any sense
schaerli has joined #ruby-lang
<whitequark>
yorickpeterse: google for "sparse conditional constant propagation"
<whitequark>
there are all sorts of explanations
<whitequark>
yorickpeterse: I've also PM'ed you the code from Foundry.
<yorickpeterse>
I saw that
<whitequark>
"top" value means that we have to visit this SSA insn yet; "bottom" one means that it varies at runtime.
<whitequark>
you probably know what "reachable in CFG" and "worklist" mean.
torrieri has quit [Ping timeout: 256 seconds]
ebouchut has quit [Remote host closed the connection]
kvs has quit [Read error: Connection reset by peer]
<yorickpeterse>
I think that the first step for me is to translate my AST into a set of (easier) instructions
<yorickpeterse>
Without deciding yet what storage mechanism I'll use, for as much as that's possible
glebm has joined #ruby-lang
<whitequark>
yea
kvs has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
<yorickpeterse>
Out of curiosity, how does one store nested data in a register where childs/parents refer to data in other registers?
<yorickpeterse>
Should you in that case just store the register IDs?
<yorickpeterse>
(think of a parent and child class for example)
<yorickpeterse>
With stacks this is relatively easy, you just create a new one and embed it in the parent
<whitequark>
yorickpeterse: what?
vlad_starkov has joined #ruby-lang
<whitequark>
you don't.
<yorickpeterse>
Well say you have two classes: A and B which extends A
<whitequark>
register and stack machines are similar in that they only keep pointers to data in the slots
<yorickpeterse>
Ah, so you'd keep the register ID
<whitequark>
no.
<whitequark>
you have a heap.
<whitequark>
you create objects on heap, but manipulate them through registers or stack slots.
<yorickpeterse>
So the registers contain mere references to data in the heap?
<whitequark>
if this doesn't quite make sense to you, then it's because you don't really need either a register or a stack machine; you don't need to lower your instructions to anything (like machine code)
<lupine>
given the size of registers, that's kind of essential
<whitequark>
yorickpeterse: yes, exactly
<yorickpeterse>
hmm
beho has quit [Remote host closed the connection]
<yorickpeterse>
heh, then I think I more or less already implemented this without explicitly knowing it in my current implementation
<whitequark>
lupine: not exactly size. amount, mainly
<whitequark>
lupine: and the fact that data structures can be self-referential
<whitequark>
lupine: and the fact that register machines lower well to both direct hardware register access and access to spill slots on stack
<whitequark>
unlike stack machines, which require somewhat more preprocessing
gnufied1 has joined #ruby-lang
gnufied has quit [Ping timeout: 264 seconds]
banisterfiend has quit [Remote host closed the connection]
gustavnils has joined #ruby-lang
Stilo has joined #ruby-lang
beho has joined #ruby-lang
torrieri has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
tbuehlmann has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
tbuehlmann has joined #ruby-lang
kvs has quit [Read error: Connection reset by peer]
kvs has joined #ruby-lang
cultureulterior_ has joined #ruby-lang
cirenyc has joined #ruby-lang
unix has quit [Read error: Connection reset by peer]
jbsan has quit [Quit: jbsan]
torrieri has quit [Ping timeout: 252 seconds]
Qfwfq has joined #ruby-lang
gnufied1 has quit [Quit: Leaving.]
glebm has quit [Quit: Computer has gone to sleep.]
unix has joined #ruby-lang
<yorickpeterse>
So what type of data structure would you use for a heap? A Hash?
<yorickpeterse>
The latter makes me feel like it's already both: a heap and a register
adambeynon has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
Qfwfq has quit [Ping timeout: 255 seconds]
<whitequark>
yorickpeterse: oh, very simple
<whitequark>
the ruby heap.
vlad_starkov has joined #ruby-lang
<whitequark>
you don't need that additional layer of indirection.
<yorickpeterse>
eh? I need to store it somewhere so I can access it again
<yorickpeterse>
e.g. storing a class definition has to be done in some class so that it can be accessed later on
<whitequark>
I just have a class VM::Class which has a `constants' Hash
<whitequark>
and there's VM::Object = VM::Class.new
<whitequark>
you get the idea.
<whitequark>
shape your data structures after your semantics.
adambeynon has quit [Ping timeout: 264 seconds]
gnufied has joined #ruby-lang
<whitequark>
(the name collisions might be funny, though.)
glebm has joined #ruby-lang
<yorickpeterse>
Well yeah that's what I meant
<yorickpeterse>
So the register would basically be something like { :r1 => 'String' } where :r1 is the register index and "String" the key of said "constants" Hash?
<whitequark>
yorickpeterse: no.
adambeynon has joined #ruby-lang
klebervi_ has joined #ruby-lang
<whitequark>
each embedded-Ruby object is represented by a hosted-Ruby object.
<whitequark>
a hypothetical register hash would look like { 1 => #<VM::String "String"> }.
klebervi_ has quit [Read error: Connection reset by peer]
<yorickpeterse>
And the value is just a reference to whatever is in the heap?
klebervi_ has joined #ruby-lang
<whitequark>
the value is just the value
<whitequark>
you do not need any additional layers of indirection
<yorickpeterse>
eh? Then what use is having both a heap and register if you're going to store values in the register anyway?
kvs has quit [Read error: Connection reset by peer]
<whitequark>
you're not storing values "in" the register, you are storing references to values in the register.
<whitequark>
the heap itself is implicit here, as you do not need to make it explicit
vlad_starkov has quit [Read error: Connection reset by peer]
<whitequark>
if you did, you would need, for example, to care about garbage collection
vlad_starkov has joined #ruby-lang
<yorickpeterse>
That's exactly what I meant with "the value is just a reference..."
<whitequark>
apart from obvious and significant performance hit
<whitequark>
yorickpeterse: it wasn't clear for me if you've expected another layer of indirection there or not.
<whitequark>
what is the meaning of keys in the `heap' Hash?
ddd_ has joined #ruby-lang
klebervi_ has quit [Ping timeout: 255 seconds]
<yorickpeterse>
what data structure would you use otherwise?
<whitequark>
you only have two 'true' roots in Ruby, that is, `Object' (which can be accessed from anywhere with ::Foo and also implicitly) and $globals
klebervi_ has joined #ruby-lang
<whitequark>
so, you need to store a reference to your `class Object' somewhere, and a hash of globals.
<MrWGW->
GarethAdams: your name seems familiar btw, did you publish a book on Ruby?
carloslopes has joined #ruby-lang
Eising has joined #ruby-lang
torrieri has quit [Ping timeout: 255 seconds]
<GarethAdams>
not that I know of
<Eising>
hey there. I have created a monster. I'm parsing lots of configuration, and my script has reached an astounding 800 lines of mostly if res = line.match(/regex/); end statements. It works, and it works well, but it is a monster. In an idea world, how should I have done it if I should have made it more elegant?
<MrWGW->
Eising: well, I myself have also written adhoc parsers and they do tend t be monstrous
<MrWGW->
the right way is to write a proper tokenizer/parser with a formal grammar
<MrWGW->
but I haven't attempted to do it yet in that manner
<MrWGW->
there are also a lot of good books on how to use Ruby to implement a DSL
<MrWGW->
and you should check those out, that will definitely point you in the direction you want to go
<Eising>
MrWGW-: yeah, my computer science friend suggested that I write it in yacc...
tomzx_mac has joined #ruby-lang
<MrWGW->
indeed yacc and lex are the traditional tools for that
<MrWGW->
but if you're working in Ruby, there are many books that detail Ruby-specific DSL implementation
<MrWGW->
Puppet and Chef are examples of programs that implement a DSL in Ruby
neocoin has left #ruby-lang [#ruby-lang]
<Eising>
I can't help but think that it is very cumbersome. It's mostly IOS configuration, which I know you're familiar with, so that language isn't exactly well-structured.
ryez_ has quit [Quit: Page closed]
beho has quit [Remote host closed the connection]
<MrWGW->
I'm having a strange problem in this script I'm writing where the command line argument is winding up as standard input
<MrWGW->
I don't see anything unusual about my script that could be causing it
<MrWGW->
when I attempt to get user input in the normal way via gets.chomp its instead printing the argument and a no file or directory error, ENOENT
pnr has joined #ruby-lang
judofyr has joined #ruby-lang
unix has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
chekcmate has quit [Quit: Page closed]
<injekt>
MrWGW-: want to show us some code?
dblack_ has joined #ruby-lang
gouthamvel has joined #ruby-lang
torrieri has joined #ruby-lang
<MrWGW->
injekt: I got it fixed, I did not realize that gets would read arguments if they weren't shifted
<MrWGW->
as opposed to $stdin.gets.chomp
<MrWGW->
so I just modified my argument handler
adambeynon has joined #ruby-lang
torrieri has quit [Ping timeout: 260 seconds]
ruurd has quit [Quit: Leaving...]
yfeldblum has quit [Ping timeout: 264 seconds]
kurko__ has joined #ruby-lang
krz has quit [Quit: krz]
skade has joined #ruby-lang
drbrain has quit [Ping timeout: 248 seconds]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
drbrain has joined #ruby-lang
mistym has quit [Remote host closed the connection]
tomzx_mac has quit [Ping timeout: 260 seconds]
sailias has joined #ruby-lang
mr_white_ has joined #ruby-lang
rsl has joined #ruby-lang
agib has left #ruby-lang [#ruby-lang]
wmoxam has joined #ruby-lang
gouthamvel has quit [Remote host closed the connection]
<eam>
here's what I'm adapting, I just dropped in sort_by and it appears to work - looks like I can remove the decorating maps now? https://gist.github.com/eam/5014944
* apeiros_
was just born too late…
<apeiros_>
I did that without knowing it existed
<whitequark>
apeiros_: well, it's not like you will never able to invent merge sort by yourself. or, I dunno, SCCP
<whitequark>
it's just a convenient way to name the concept.
<apeiros_>
:)
<apeiros_>
sure
<apeiros_>
but if I had been earlier, it might be named after me ;-D
<eam>
randal didn't invent it though
<eam>
you could re-popularize it!
<havenwood>
apeiros_: p392 is out, so many patches! :O
glebm has quit [Ping timeout: 276 seconds]
havenwood has quit [Remote host closed the connection]
klebervi_ has quit [Remote host closed the connection]
dzhulk has joined #ruby-lang
klebervirgilio has joined #ruby-lang
<Br4nd0n>
I am not sure if this is the right place to get help. But I would really like to figure out why Ruby isn't working on my OSX - and why paths seems to be so inconsistent. Any pointers?
<apeiros_>
with that little information - I wouldn't know how
<Br4nd0n>
I know…
<Br4nd0n>
I think I am having a problem with paths
<Br4nd0n>
I am not a coder… I just want to be able to take advantage of ruby scripts to do simple automation with Hazel, or be able to use apps like Alfred to execute scripts.
<Br4nd0n>
Simple scripts that seem to work for other users fail on my machine
<outoftime>
RVM is probably simple enough for non-coders, right?
<soahccc>
Br4nd0n: What is the exact problem? You might use the kinda outdated system ruby
klebervirgilio has quit [Ping timeout: 260 seconds]
Graham_K has joined #ruby-lang
<Br4nd0n>
Well, just trying to execute this shell script fails: ~/bin/cloudapp_upload "{query}"
<soahccc>
"fails" isn't an exact description :)
<Br4nd0n>
:)
<Br4nd0n>
My terminal window opens and says: /Users/Brandon/bin/cloudapp_upload: No such file or directory
sn0wb1rd_ has joined #ruby-lang
vlad_starkov has quit [Read error: Connection timed out]
<mistym>
I was blown away by how fast it got funded!
<soahccc>
havenwood: Hmm am I right that chruby is kinda rbenv but without those bloody shims?
dzhulk has joined #ruby-lang
<havenwood>
soahccc: yeah, basically
<Br4nd0n>
sorry guys, had to take a phone fall. I don't believe I have install the new ruby
<Br4nd0n>
and I do not have bee installed
<havenwood>
soahccc: uber-minimalist, no shims, works :D
<soahccc>
Br4nd0n: You have, via rvm
MaddinXx_ has joined #ruby-lang
<Br4nd0n>
ok
<soahccc>
havenwood: have it something to build? I like rbenv except the shims
<havenwood>
soahccc: It has a side script (setup.sh) that automates building latest Ruby, JRuby and RBX. Postmodern has said he's gunna break it out into its own gem but it works great.
<havenwood>
soahccc: Also you can build ruby with anything and then point chruby at it.
<havenwood>
soahccc: I usually use the build scripts on the chruby wiki.
<soahccc>
Hmm I'll keep that in mind and see how it evolves
beho has joined #ruby-lang
<soahccc>
Currently I'm already served with rebundling every app due to a new ruby... I'm too impatient :)
<havenwood>
soahccc: With 0.4.0 i think chruby will be the only ruby version manager with a man page! :O
davidbalber|away is now known as davidbalbert
beho has quit [Remote host closed the connection]
Graham_K has quit [Quit: Graham_K]
<havenwood>
I thought the `man ruby` was an interesting read. I was kinda surprised that the first paragraph of Description didn't mention Smalltalk.
<soahccc>
Br4nd0n: I'm not that familiar with rvm but if "/usr/bin/env ruby -v" shows your 1.9.* installation you just have to install the gems without the "sudo" and it should work
<havenwood>
**second paragraph rather
<havenwood>
Br4nd0n: If you go with rvm, make sure to occasionally update it with: rvm get stable
<havenwood>
Br4nd0n: Also good to check that you have installed all the requirements: brew requirements
kurko__ has quit [Ping timeout: 264 seconds]
<Br4nd0n>
havenwood: I don't have brew installed
<soahccc>
havenwood: The script runs but it doesn't find the gems so I guess new ruby and gems got installed in old
<Br4nd0n>
OK, so according to JewerlyBox I have 1.92 AND 1.93 installed
dyln has quit [Remote host closed the connection]
<havenwood>
Br4nd0n: I highly recommend installing Homebrew, it is an OS X package manager written in Ruby. Very nice for easily installing dependencies.
<Br4nd0n>
Havenwood: will brew clean up my existing ruby set up?
<havenwood>
Br4nd0n: I don't know if you are missing dependencies. It is work having brew just for convenience. You'll need packages sooner or later. :)
<havenwood>
Br4nd0n: For that matter, you can: brew install ruby
Graham_K has joined #ruby-lang
<soahccc>
So I gonna go... check what I said, install the gems without sudo... cya
<Br4nd0n>
thanks saohcc!
klebervirgilio has joined #ruby-lang
<Br4nd0n>
So for what it worth, I can't install Gems without Sudo
<darix>
gem install --user-install
<Br4nd0n>
"You don't have write permissions into the /Library/Ruby/Gems/1.8 directory."
<darix>
also /Library/Ruby/Gems/1.8 would that be system ruby and now the homebrew version?
<havenwood>
Br4nd0n: You have to use `sudo` with system Ruby on OS X.
<Br4nd0n>
darix: --user-install worked
<Br4nd0n>
darix: I don't have brew installed
<darix>
ah
<darix>
just saw it mentioned earlier
<havenwood>
Br4nd0n: Open Terminal and run the Brew install script. :P
<Br4nd0n>
ok, ok, I will havenwood
<Br4nd0n>
As Sudo or not"?
<havenwood>
not
hahuang65 has joined #ruby-lang
<Br4nd0n>
==> Downloading and Installing Homebrew...
slyphon has quit [Quit: slyphon]
Graham_K has left #ruby-lang [#ruby-lang]
Graham_K has joined #ruby-lang
slyphon has joined #ruby-lang
<Br4nd0n>
Ha, that was funny… at the beginning of the install is stated: ==> Downloading and Installing Homebrew... And then: ==> havenwood Loves Homebrew
mistym has joined #ruby-lang
cirenyc has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<Br4nd0n>
OK, home-brew installed! No what?
<havenwood>
Br4nd0n: Run: brew doctor
__butch__ has joined #ruby-lang
<Br4nd0n>
havenwood: Just did… bunch of warnings
<havenwood>
Br4nd0n: Good idea to go ahead and fix the path warnings, delete the cruft it asks you to.
jonahR_ has joined #ruby-lang
<apeiros_>
zzak: ping
<apeiros_>
zzak: Object#<=> could use a generic documentation (i.e., how to implement when creating a class) along with a reference to Comparable
<havenwood>
Br4nd0n: Kinda a pain, but worth getting the brew doctor stuff out of the way for proper brewing.
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
<havenwood>
Br4nd0n: (Add the PATHS under `brew doctor` to your `/etc/paths` file in the order it asks.)
<havenwood>
Br4nd0n: Pretty important to have working compilers, so I'd get the newest Xcode with command-line-tools. Do also add '/usr/local/sbin' to your `/etc/paths` file as well.
dhruvasagar has joined #ruby-lang
dhruvasagar has quit [Client Quit]
<havenwood>
Br4nd0n: The orphaned dylibs and static libraries aren't as likely to cause problems, but I'd prolly nuke em anyways: cd /usr/local/Library && git stash && git clean -f
<havenwood>
Br4nd0n: Then... :P rerun: brew doctor
<havenwood>
Br4nd0n: Just have to do this once, but yeah it can be a pain. Worth doing.
ryanf has joined #ruby-lang
<Br4nd0n>
Wow. LAtest Xcode 1.5 GB
dhruvasagar has joined #ruby-lang
<havenwood>
>.>
dhruvasagar has quit [Client Quit]
<apeiros_>
zzak: see e.g. Fixnum#<=>
<Br4nd0n>
havenwood: how do I amend my PATH variable?
<apeiros_>
zzak: should mention in which case nil should be returned (namely if self can't be compared with other)
<havenwood>
Br4nd0n: Open `/etc/paths` file in a text editor.
<havenwood>
Br4nd0n: e.g., I use TextMate 2, so: mate /etc/paths
<apeiros_>
zzak: I'm currently busy with writing docs & tests for https://github.com/apeiros/sorting - but after that I can write a draft if you like
<Br4nd0n>
havenwood: I have text mate too, but hat doesn;t work
<havenwood>
Br4nd0n: Open TextMate and under the TextMate menubar item, select Preferences, then the Terminal tab.
marcostoledo has joined #ruby-lang
<havenwood>
Br4nd0n: And click the install button to add shell support for `mate`.
<zzak>
apeiros_: that would be great, there's no rush either
<Br4nd0n>
havenwood: shell support already installed
<zzak>
apeiros_: if you want to work on it, go for it
<havenwood>
Br4nd0n: I guess click uninstall then install again?
<Br4nd0n>
havenwood: location ~/bin/mate
<havenwood>
Br4nd0n: I have mine at /usr/local/bin/mate but either should be find.
<havenwood>
fine**
<Br4nd0n>
Havenwood: I am telling you… anytime I see *bin* I am looking at a probelm
<Br4nd0n>
havenwood: unistalled, reinstalled using the pull down location, and selected your path - works now
<Br4nd0n>
havenwood: added /usr/local/sbin to PATH
banister_ has joined #ruby-lang
<havenwood>
Br4nd0n: Recheck brew doctor, to make sure it doesn't complain about the order of PATHS now.
kevinfagan has joined #ruby-lang
<Br4nd0n>
havenwood: It is still compalining
<zzak>
apeiros_: i'll ping you if i get to it first haha
<havenwood>
Br4nd0n: Restart Terminal.
<apeiros_>
zzak: :) ok
srbaker has quit [Quit: Computer has gone to sleep.]
<Br4nd0n>
havenwood: still complaining, and I double checked the paths files
<havenwood>
Br4nd0n: Saved the changes to paths?
<Br4nd0n>
havenwood: indeed
thillux has quit [Remote host closed the connection]
<havenwood>
Br4nd0n: Is the complaint still about it being missing, or now about the order its in?
<Br4nd0n>
havenwood: same warning: "Consider amending your PATH variable so it contains:"
<havenwood>
Br4nd0n: Even after restarting Terminal.app? Hrmmm...
<havenwood>
Br4nd0n: Hmm, it is the last on the list not loading, makes me wonder if it need a hard-return after the last item. Does it work if you put /usr/local/sbin higher on the list?
<havenwood>
Br4nd0n: The are other ways to modify your path, but /etc/paths is preferred. If adding a return or changing order don't work, you could add the following to your .bashrc: export PATH="/usr/local/sbin:$PATH"
<havenwood>
s/don't/doesn't
breakingthings has joined #ruby-lang
workmad3 has joined #ruby-lang
<Br4nd0n>
havenwood: moved it up to the third line. Home Brew stopped whinning
Squarepy has joined #ruby-lang
<havenwood>
Br4nd0n: Good deal. One down!
<Br4nd0n>
havenwood: 1 min left in Xcode d/l
maxmanders has joined #ruby-lang
Squarepy has quit [Changing host]
Squarepy has joined #ruby-lang
<havenwood>
Br4nd0n: Did you already do?: cd /usr/local/Library && git stash && git clean -f
eklarkri has joined #ruby-lang
<Br4nd0n>
havenwood: tried to
<Br4nd0n>
havenwood: No local changes to save
<Br4nd0n>
Not removing Contributions/cmds/
<Br4nd0n>
Not removing Homebrew/vendor/multi_json/engines/
<havenwood>
Br4nd0n: Try fetching an updated list of brews, and installing chruby?: brew update && brew install chruby
thufir_ has quit [Quit: Leaving.]
<havenwood>
Br4nd0n: And install the Ruby dependency brews: brew install openssl readline libyaml gdbm libffi
thufir_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
thufir_ has quit [Client Quit]
<Br4nd0n>
havenwood: I will do as soon as Xcode is done
workmad3 has quit [Ping timeout: 248 seconds]
eklarkri has quit [Quit: leaving]
<havenwood>
Br4nd0n: Yeah, that is prolly best. Also remember to open Xcode, and under Preferences > Downloads, install command-line-tools.
eklarskov has joined #ruby-lang
<Br4nd0n>
havenwood: good point
<havenwood>
Br4nd0n: Might also want to `brew cleanup` to get rid of any cruft.
carloslopes has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
mistym has quit [Remote host closed the connection]
eklarskov has quit [Client Quit]
eklarskov has joined #ruby-lang
<jtoy>
what is the simplest library i can add to give web CRUD to a postgresql database? I don't want to write a rails app or any web app if possible, but i would like to be able to modify it if need be, it doesn't have to be in ruby if there is something easier
<havenwood>
jtoy: I really like Sinatra with Sequel. If you don't want to use a web server, you could make a straight-up Rack app.
<havenwood>
jtoy: sinatra and sequel gems**
Graham_K has quit [Quit: Graham_K]
<darix>
jtoy: if i recall correctly django has builtin forms for crud
<darix>
jtoy: also there are a few plugins like activeadmin for rails
<Br4nd0n>
havenwood: is Sinatra a web server or sorts?
__butch__ has quit [Quit: Leaving.]
<jtoy>
darix: even without the onslaught on rails lately, i really feel like it solo heavy, every single time i change something in my rails app something always braks
<havenwood>
Br4nd0n: Sinatra is a Rack web framework. Rack webservers include Unicorn, Rainbows!, Thin, Webrick, etc.
<jtoy>
havenwood: id have to code that up i think, the forms to data insert i mean
<havenwood>
Br4nd0n: cool, so since you said you built Rubies with JewelryBox, add the following line to your .bashrc: RUBIES=(~/.rvm/rubies/*)
<Br4nd0n>
havenwood: :) How?
<havenwood>
or .bash_profile i mean
<havenwood>
Br4nd0n: mate ~/.bash_profile
<havenwood>
Br4nd0n: And past this in as well: source /usr/local/opt/chruby/share/chruby/chruby.sh
justinram has joined #ruby-lang
<havenwood>
Br4nd0n: and, I'd also do: source /usr/local/opt/chruby/share/chruby/auto.sh
ivanoats has quit [Remote host closed the connection]
__BigO__ has quit [Remote host closed the connection]
<havenwood>
(For auto-switching Rubies based upon .ruby-version file when you enter a directory.)
nazty has quit [Read error: No route to host]
__BigO__ has joined #ruby-lang
<havenwood>
Br4nd0n: But yeah, you can add any Ruby on your system to chruby by opening .bash_profile and putting the Ruby dir location into the $RUBIES env var.
<havenwood>
Br4nd0n: Then restart Terminal or `source ~/.bash_profile` to see them when you type: chruby
<Br4nd0n>
havenwood: I just want one Ruby… that works!
<apeiros_>
havenwood: writing tests first, then gem
<havenwood>
apeiros_: nice
carloslopes has quit [Remote host closed the connection]
kuja has joined #ruby-lang
<havenwood>
Br4nd0n: You said you just want one Ruby, so I'd go with 1.9.3-p392. Here is install script to build it and put it where chruby expects by default: https://gist.github.com/havenwood/5016450
<Br4nd0n>
havenwood: still making perl
<havenwood>
Br4nd0n: Assuming you want 1.9.3 by default, create a ~/.ruby-version file and put just one line in it: 1.9.3
<havenwood>
Br4nd0n: mate ~/.ruby-version
<havenwood>
Br4nd0n: chruby does fuzzy matching by ruby name, so if you decide you want to install jruby or whatev, you can switch between them by doing `chruby 1.9` or `chruby jruby`, etc.
ottbot has quit [Ping timeout: 252 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
<havenwood>
Br4nd0n: But if you want just 1.9, put 1.9 in your .ruby-version file and it will always be default.
gnufied has joined #ruby-lang
gnufied has quit [Client Quit]
melter has quit [Remote host closed the connection]
<havenwood>
Br4nd0n: Yes, it is trying to find a 1.9 in /opt/rubies or ~/.rubies but you haven't installed one there yet.
<havenwood>
Br4nd0n: You can build your Ruby however you'd like, but quite simple to build it yourself.
<Br4nd0n>
havenwood: so download the file, or just follow along line by line?
<havenwood>
just paste it to Terminal
<havenwood>
Br4nd0n: It downloads, 1.9.3-p392, untars it, builds it and puts it in ~/.rubies so you don't have to sudo
<havenwood>
Br4nd0n: Then if you `source ~/.bash_profile` or restart Terminal you'll be on the latest 1.9.3.
<Br4nd0n>
I don't have wget?
<havenwood>
Br4nd0n: brew install wget
MaddinXx has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
sduckett has joined #ruby-lang
<Br4nd0n>
havenwood: do I need to sudo wget? I am getting permission denied
<havenwood>
Br4nd0n: Make sure you're in your User dir: cd
<havenwood>
Br4nd0n: but yeah, if you'd like to install it in a folder you don't have permissions for `sudo`.
<havenwood>
Br4nd0n: It is just a temporary file, once you build Ruby you can delete it.
lectrick has joined #ruby-lang
g0bl1n has quit [Quit: g0bl1n]
eklarskov has quit [Ping timeout: 264 seconds]
lcdhoffman has joined #ruby-lang
agarie has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
kain has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
sn0wb1rd has joined #ruby-lang
eklarskov has joined #ruby-lang
kurko__ has joined #ruby-lang
Mizpah has quit [Ping timeout: 245 seconds]
sduckett has quit [Ping timeout: 264 seconds]
<Br4nd0n>
havenwood: phew - I am done
<Br4nd0n>
havenwood: chruby: unknown Ruby: 1.9.3
ruurd has quit [Quit: Leaving...]
<havenwood>
Br4nd0n: What do you get (after restarting Terminal) from just: chruby
<Br4nd0n>
havenwood: chruby: unknown Ruby: 1.9.3
JohnBat26 has quit [Remote host closed the connection]
<UziMonkey>
what? Ruby?
<UziMonkey>
oh.. what? Why does IRCCloud keep putting me in #ruby-lang?
<UziMonkey>
not that I'm complaining... :P
<havenwood>
Br4nd0n: back in a min, not sure what problem is?? hrmm..
havenwood has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
<Br4nd0n>
havenwood: ya! * 1.9.3-p392
ivanoats has quit [Remote host closed the connection]
zorbyte has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<Br4nd0n>
havenwood: Doesn't look like I have solved my Ruby issue yet. But it at least feels like I have gotten closer to solving my problem. As much as I would love to stay and take advantage of your generosity and knowledge - I have to go get my kid from school. I hope we can catch each other here another time to continue. THANKS SO MUCH for all your help!
marcostoledo has quit [Quit: Leaving...]
havenwood has joined #ruby-lang
<havenwood>
Br4nd0n: Did 1.9.3 compile and get to ~/.rubies okay?
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby-lang
<havenwood>
Br4nd0n: Might want to double check the script, I made a typo in the original one and fixed it - testing it (works on my machine >.>): https://gist.github.com/havenwood/5016450
drueck has joined #ruby-lang
RickHull has joined #ruby-lang
<RickHull>
I found a weird issue with Timeout. Timeout.timeout can throw a weird exception: