<Radar>
That'll cover everything about Ruby that you need to know and probably a touch more. You know python already so a lot of the first couple of chapters should be familiar to you, but I'd recommend going through those.
<freudenshade>
thanks, i appreciate that
<freudenshade>
I've been using rubymonks mainly
Bloomer has joined #ruby
Rodya_ has joined #ruby
<wolffles>
ruby monks is pretty good
baweaver has quit [Remote host closed the connection]
<wolffles>
i just found out about projecteluer.net more complicated problems
blackmes1 has joined #ruby
<Ox0dea>
wolffles: Did you do #54?
al2o3-cr has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
<wolffles>
im struggling wiht number 4 in the archives :/
<wolffles>
speaking of which i need some help finding a simpler way to do this problem… i couldnt figure out which methods to use so i did it logically.
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
colegatron has quit [Ping timeout: 256 seconds]
sonOfRa has quit [Quit: Bye!]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
skade has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
sperant has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has quit [Ping timeout: 256 seconds]
craysiii has quit [Remote host closed the connection]
sonOfRa has joined #ruby
blackmes1 has quit [Ping timeout: 276 seconds]
<Eising>
hmm, I seem to have a gem in my Gemfile that pulls a specific version of json as dependency, and that specific version fails to build with the ruby 2.3 docker I'm running. Any idea what I could do to find out which one it is?
skade has joined #ruby
marcdel has joined #ruby
<jhass>
which version? bundle show json, bundle list | grep json or just look at your Gemfile.lock
<Eising>
there's only one mention of json and that's as (1.8.1)
<Eising>
but the newest is 1.8.3, and that is the one that will be installed with gem install...
Bloomer has quit [Remote host closed the connection]
stamina has joined #ruby
<Eising>
Furthermore the Gemfile only wants 'json', no specific version
djbkd has quit []
User458764 has joined #ruby
skade has quit [Ping timeout: 245 seconds]
hannelita has quit [Remote host closed the connection]
DirtyFInn has joined #ruby
<jhass>
Eising: that's just bundler doing its job
<jhass>
run bundle update json if you want to update it
colegatron has joined #ruby
binaryplease has joined #ruby
DirtyFInn is now known as That_Guy
tagrudev has joined #ruby
tagrudev has quit [Client Quit]
binaryplease has quit [Client Quit]
hannelita has joined #ruby
binaryplease has joined #ruby
Macaveli has quit [Ping timeout: 245 seconds]
lipoqil has joined #ruby
CloCkWeRX has quit [Ping timeout: 245 seconds]
skade has joined #ruby
last_staff has quit [Remote host closed the connection]
last_staff has joined #ruby
jottr has joined #ruby
skade has quit [Client Quit]
slackR has quit [Quit: Ready to take off..... 3.....2.....]
jgt has quit [Ping timeout: 264 seconds]
f4cl3y has quit [Ping timeout: 245 seconds]
CloCkWeRX has joined #ruby
usershell has joined #ruby
lxsameer has joined #ruby
platzhirsch has joined #ruby
blackgoat has joined #ruby
slackR has joined #ruby
dlitvak has joined #ruby
<DefV>
I have a specific method that I'm trying to improve memory usage on. Is there some way to benchmark this? Something I can wrap around the method call that gives me memory allocated / GC run etc, so I can see improvement?
howdoicomputer has quit [Ping timeout: 276 seconds]
bronson has joined #ruby
fsapo has joined #ruby
blackmes1 has joined #ruby
VaibhavRajput has joined #ruby
Coldblackice has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
chouhoulis has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marcdel has joined #ruby
<VaibhavRajput>
Are there any way to upload file (multipart_part post form) with only Net::HTTP::Post
dlitvak has quit [Ping timeout: 250 seconds]
dlitvak has joined #ruby
<adaedra>
?crosspost
<ruby[bot]>
Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<VaibhavRajput>
lol
<VaibhavRajput>
I apologize.
chouhoulis has quit [Ping timeout: 260 seconds]
marcdel has quit [Ping timeout: 255 seconds]
rns has joined #ruby
f4cl3y has joined #ruby
techsethi has quit [Quit: techsethi]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
al2o3-cr has quit [Quit: WeeChat 1.3]
FernandoBasso has joined #ruby
x0f has quit [Ping timeout: 240 seconds]
FooMunki has joined #ruby
dlitvak_ has joined #ruby
FernandoBasso1 has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Remote host closed the connection]
FernandoBasso1 has joined #ruby
yfeldblum has joined #ruby
tvw has quit [Ping timeout: 255 seconds]
ropeney has joined #ruby
codecop has joined #ruby
dlitvak has quit [Ping timeout: 276 seconds]
x0f has joined #ruby
FernandoBasso has quit [Ping timeout: 276 seconds]
ropeney has quit [Client Quit]
yfeldblum has quit [Remote host closed the connection]
blackmes1 has quit [Quit: WeeChat 1.3]
blackmesa has joined #ruby
myntcake has joined #ruby
techsethi has joined #ruby
al2o3-cr has joined #ruby
karapetyan has joined #ruby
astrobun_ has quit [Remote host closed the connection]
krz has quit [Read error: Connection reset by peer]
sunslide has joined #ruby
<sunslide>
hi guys, could use some very basic help with threads, I'm not sure how to return a value from a thread (using the 'thread' lib) as I can't really return a value from the callback nor can I pass it a variable by reference, anyone with a tip?
Kijkek has joined #ruby
<Mon_Ouie>
You can call Thread#value to get the value of the block that was executed in the thread (if the thread isn't done running, this causes it to wait)
<Mon_Ouie>
this causes the calling thread to wait*
dlitvak has joined #ruby
<TomyWork>
is anyone aware of a library that can walk remote commits, either via normal git protocols or via the gitlab api? kinda like rugged, just remote
Kijkek is now known as Maxona
<TomyWork>
right now I'm using rugged and I just run it locally on the gitlab server
Xeago has quit [Remote host closed the connection]
Maxona has quit [Quit: IRC]
dlitvak_ has quit [Ping timeout: 272 seconds]
sigurding has quit [Quit: sigurding]
<sunslide>
Mon_Ouie: thanks for your help man! do you have any idea how I can make this asynchronous? like maybe with a global variable or anything else?
skade has joined #ruby
spooq has quit [Ping timeout: 255 seconds]
spooq has joined #ruby
Xeago has joined #ruby
binaryplease has quit [Ping timeout: 265 seconds]
ferr has joined #ruby
usershell has quit [Read error: Connection reset by peer]
benhuda has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
usershell has joined #ruby
dmst has joined #ruby
marcdel has joined #ruby
jam_ has joined #ruby
techsethi has quit [Quit: techsethi]
<jhass>
samgerber: I yet have to find a good usecase to use an array as hash key
<jhass>
but if you do and don't freeze them you basically want to call .rehash all the time, so meh
<samgerber>
jhass: Thanks! I'll go read about .rehash!!
<jhass>
samgerber: I think you rather should think about why you think you need an array as hash key, as said usually you don't and if you do I'd be really curious as to why you think you do
marcdel has quit [Ping timeout: 260 seconds]
dlitvak_ has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
jam_ has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
<jhass>
TomyWork: I don't think "normal git protocols" even allow that
tvw has joined #ruby
lucasb has joined #ruby
Jardayn has joined #ruby
<samgerber>
jhass: I don't think I need them; just trying to soak up information at this point. Now I know not to use arrays as hash keys. Thanks!
<jhass>
great :)
kobain has joined #ruby
f4cl3y has quit [Ping timeout: 276 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
ereslibre has quit [Ping timeout: 245 seconds]
binaryplease has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
Mon_Ouie has quit [Ping timeout: 245 seconds]
Miuers has joined #ruby
<TomyWork>
jhass well a commit is an object. the normal git protocols should support querying objects, right?
<TomyWork>
the dumb http protocol at least *g*
anisha has quit [Quit: Leaving]
<jhass>
afaik they only support downloading them
c355e3b has joined #ruby
<jhass>
"give me the object id for this ref" and "give me everything from this object id to this object id"
dwfait has quit [Remote host closed the connection]
sftrabbit has joined #ruby
oo7cat has left #ruby [#ruby]
<TomyWork>
should be enough
<TomyWork>
unless "from A to A" means nothing
<jhass>
well, where ref is basic, not stuff like HEAD~50
ereslibre has joined #ruby
<jhass>
so you'd always have at least a shallow clone I guess
<jhass>
and then work on that locally
<jhass>
requires some disk/ramdisk space still
dlitvak has joined #ruby
aryaching has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
sigurding has joined #ruby
dlitvak_ has quit [Ping timeout: 255 seconds]
dwfait has joined #ruby
brendan- has joined #ruby
f4cl3y has joined #ruby
Jardayn has quit [Ping timeout: 260 seconds]
VaibhavRajput has quit []
ThirstForKnowled has quit [Ping timeout: 272 seconds]
dwfait has quit [Remote host closed the connection]
Snowy has quit [Remote host closed the connection]
casadei has joined #ruby
krz has joined #ruby
Miuers has quit [Remote host closed the connection]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dlitvak has quit [Remote host closed the connection]
Snowy has joined #ruby
Snowy has quit [Remote host closed the connection]
dlitvak has joined #ruby
aupadhye has joined #ruby
Snowy has joined #ruby
dwfait has joined #ruby
Snowy has quit [Remote host closed the connection]
dwfait has quit [Remote host closed the connection]
blackmesa has joined #ruby
TomPeed has joined #ruby
shinnya has joined #ruby
sigurding has quit [Quit: sigurding]
sigurding has joined #ruby
konsolebox has joined #ruby
gagrio has quit [Ping timeout: 276 seconds]
sdothum has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
hxegon has joined #ruby
samgerber has quit []
dlitvak has quit [Ping timeout: 256 seconds]
dlitvak has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marcdel has joined #ruby
howdoicomputer has joined #ruby
FernandoBasso has joined #ruby
dwfait has joined #ruby
GinoManWorks has quit [Read error: Connection reset by peer]
benhuda has joined #ruby
FooMunki has quit [Quit: FooMunki]
howdoicomputer has quit [Ping timeout: 240 seconds]
krz has quit [Ping timeout: 256 seconds]
marcdel has quit [Ping timeout: 264 seconds]
FernandoBasso1 has quit [Ping timeout: 276 seconds]
GinoManWorks has joined #ruby
emilford has joined #ruby
Snowy has joined #ruby
zacts has quit [Remote host closed the connection]
dlitvak_ has joined #ruby
dorei has joined #ruby
krz has joined #ruby
chouhoulis has joined #ruby
FernandoBasso1 has joined #ruby
gagrio has joined #ruby
dlitvak has quit [Ping timeout: 264 seconds]
skade has joined #ruby
govg has joined #ruby
sankaber has joined #ruby
futilegames_ has joined #ruby
usershell has quit [Remote host closed the connection]
FernandoBasso has quit [Ping timeout: 276 seconds]
futilegames has quit [Ping timeout: 255 seconds]
futilegames_ is now known as futilegames
chouhoulis has quit [Ping timeout: 272 seconds]
carraroj has quit [Ping timeout: 240 seconds]
arup_r has quit []
ferr has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 272 seconds]
emilford has quit [Ping timeout: 245 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
usershell has joined #ruby
pdoherty has joined #ruby
ghox has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
phredus has joined #ruby
sftrabbit has joined #ruby
grxpwa has joined #ruby
emilford has joined #ruby
Guest86995 is now known as saneax_AFK
dlitvak has joined #ruby
futilegames has quit [Read error: Connection reset by peer]
dlitvak has quit [Remote host closed the connection]
futilegames has joined #ruby
jghgh has joined #ruby
arup_r has joined #ruby
dlitvak_ has quit [Ping timeout: 250 seconds]
jghgh has quit [Remote host closed the connection]
frozen3 has joined #ruby
frozen3 has quit [Client Quit]
benjohn has quit [Remote host closed the connection]
grxpwa has quit [Remote host closed the connection]
krobzaur has joined #ruby
disconnekted has joined #ruby
ramortegui has joined #ruby
futilegames_ has joined #ruby
futilegames has quit [Ping timeout: 245 seconds]
futilegames_ is now known as futilegames
kalopsian has joined #ruby
benhuda has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krobzaur has quit [Ping timeout: 255 seconds]
floatingpoint has joined #ruby
marcdel has joined #ruby
futilegames has quit [Quit: futilegames]
floatingpoint has quit [Client Quit]
benjohn has joined #ruby
gagrio has quit [Ping timeout: 272 seconds]
myntcake has quit [Remote host closed the connection]
steffkes has joined #ruby
steffkes has joined #ruby
futilegames has joined #ruby
myntcake has joined #ruby
ixti has quit [Ping timeout: 256 seconds]
marcdel has quit [Ping timeout: 272 seconds]
osvimer has joined #ruby
B1n4r10 has joined #ruby
blackgoat has quit [Quit: WeeChat 1.3]
steffkes has quit [Ping timeout: 250 seconds]
steffkes has joined #ruby
stevenhaddox has joined #ruby
mfb2 has joined #ruby
codecop has quit [Remote host closed the connection]
TomPeed has joined #ruby
bronson has joined #ruby
konsolebox has quit [Ping timeout: 272 seconds]
jam_ has joined #ruby
aegis3121 has joined #ruby
atomical has joined #ruby
mfb2_ has joined #ruby
User458764 has joined #ruby
mfb2 has quit [Ping timeout: 255 seconds]
jam_ has quit [Ping timeout: 240 seconds]
B1n4r10 has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
ghox_ has joined #ruby
blur3d has quit [Quit: blur3d]
That_Guy has quit [Quit: (going home)]
mfb2_ has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ixti has joined #ruby
pdoherty has quit [Ping timeout: 260 seconds]
polysics has joined #ruby
bewie has quit [Quit: leaving]
ghox has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Ping timeout: 265 seconds]
dionysus69 has quit [Ping timeout: 255 seconds]
dfinninger has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has quit [Read error: Connection reset by peer]
<hxegon>
that feeling when you scrap 6 hours of work, rewrite it in 2 hours and its 100 * better :D
Xeago has joined #ruby
dmst has quit [Quit: Connection closed for inactivity]
<nickjj>
hxegon, welcome to programming
<hxegon>
I've been here a while, but it can be like looking for a light switch in a dark room sometimes. pretty nice when you find it though.
aegis3121 has quit [Ping timeout: 260 seconds]
steffkes has quit [Ping timeout: 240 seconds]
<nickjj>
i still go through similar things too
<nickjj>
write code -> make it work -> if it's worth it then make it better/more maintainable/etc.
<stevenhaddox>
This is pretty much the whole point of red -> green -> refactor. Our second time through will almost always be cleaner and worth the effort.
kerunaru has joined #ruby
<hxegon>
stevenhaddox finally got the diff between tdd and bdd and it's making my life so much simpler :)
<stevenhaddox>
hxegon: I think that line varies from person to person, but I loved that moment for me personally.
hehnope has joined #ruby
colegatron has quit [Quit: Leaving]
<hehnope>
anyone run activerecord behind pgpool with load balancing?
freerobby has joined #ruby
northfurr has joined #ruby
floatingpoint has joined #ruby
legit has left #ruby ["Leaving"]
casadei has quit [Remote host closed the connection]
dlitvak has joined #ruby
B1n4r10 has joined #ruby
usershell has quit [Remote host closed the connection]
carella has joined #ruby
northfurr has quit [Quit: northfurr]
dlitvak has quit [Ping timeout: 256 seconds]
Jardayn has joined #ruby
<hxegon>
is this a rails question, or just a general postgres question hehnope
<hehnope>
rails
<hxegon>
?rails hehnope
<ruby[bot]>
hehnope: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
TomPeed has joined #ruby
hehnope has left #ruby [#ruby]
<hxegon>
probably have better luck there
ta has quit [Remote host closed the connection]
victortyau has joined #ruby
fmcgeough has joined #ruby
pawnbox has quit [Remote host closed the connection]
nerfando has joined #ruby
pawnbox has joined #ruby
Xeago has quit [Remote host closed the connection]
crikiit has quit [Quit: Leaving]
nerfando has quit [Max SendQ exceeded]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
nerfando has joined #ruby
binaryplease has quit [Ping timeout: 260 seconds]
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gagrio has joined #ruby
weemsledeux has joined #ruby
troulouliou_div2 has quit [Ping timeout: 260 seconds]
<ericwood_>
and it hasn't for nearly a year now...you might want to look for another host :|
depesz has joined #ruby
hightower2 has joined #ruby
babblebre has joined #ruby
<Gasher>
I just thought about changing my sites to one site, gandi offers domains, VPSes and shared hosting.
carella has quit [Remote host closed the connection]
<depesz>
hi. i'm hitting strange thing. It looks that when I have "class Discover::AWS", and in that class, I do: ec2 = Aws::EC2::Client.new() - ruby tried to load Discover::AWS::Aws (and probably Discover::AWS::Aws::EC2::Client
<depesz>
any idea on why this might be?
agentmeerkat has joined #ruby
carella has joined #ruby
TomPeed has quit [Read error: Connection reset by peer]
<Gasher>
What was the change from Ruby 1 to Ruby 2 anyway?
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
fmcgeough has quit [Ping timeout: 260 seconds]
tenderlove has joined #ruby
<ericwood_>
Gasher: quite a few things...google "ruby 1.9.3 vs ruby 2" and you'll get a bunch of stuff
<ericwood_>
too many things to list out here
carella has quit [Remote host closed the connection]
<ericwood_>
but regardless, 1.9.3 as a requirement is irresponsible and a red flag
sandstrom has quit [Quit: My computer has gone to sleep.]
dlitvak_ has joined #ruby
User458764 has joined #ruby
User458764 has quit [Max SendQ exceeded]
<havenwood>
Gasher: Think of 1.9.3 as a release candidate for 2.0.
User458764 has joined #ruby
<workmad3>
depesz: constant lookup (e.g. Aws::EC2::Client) starts in the current scope and unwinds to the top... if the constant isn't found, ruby will raise an error with the current scope prefixed to the constant
carella has joined #ruby
dfinninger has quit [Remote host closed the connection]
marcdel has joined #ruby
<depesz>
workmad3: ok, how can I make it use "global" Aws::EC2::Client?
<depesz>
or any other class for that matter?
<workmad3>
depesz: it would 'just work' if that class was loaded... it sounds like it isn't
<depesz>
well, it is - i have "require 'aws-sdk'" at the beginning
<hightower2>
Hey, is there a way I can use alias_method to alias class/module method to instance method? Such as: alias_method My::Module.method, :method ?
<workmad3>
depesz: but if you want to force a top-level scope, you can use `::Aws::EC2::Client`
benhuda has joined #ruby
<workmad3>
depesz: is that pulling in `Aws::EC2` or `AWS::EC2` though?
<havenwood>
Gasher: The good news is its much easier to upgrade from 1.9+ than it was from 1.8 to 1.9. It may even *just work*.
dlitvak has quit [Ping timeout: 240 seconds]
<workmad3>
depesz: this stuff is case-sensitive
<depesz>
workmad3: will check, thank you.
gheegh has quit [Ping timeout: 276 seconds]
TomPeed has joined #ruby
<workmad3>
depesz: if it should be `AWS::EC2` then you'll definitely need to use `::AWS::EC2::Client` in your class
<depesz>
hmm .. it seems on work on one server, and doesn't on another.
<depesz>
AWS seems to work everywhere.
<workmad3>
as otherwise that first `::AWS` will conflict with your own class
<Bish>
i mean, if i do a group and count, it's still an instance of that model
<depesz>
workmad3: but I'm getting error on uniitialized constant Aws, not AWS
shinnya has quit [Ping timeout: 245 seconds]
YankNYC has joined #ruby
stamina has quit [Ping timeout: 240 seconds]
<workmad3>
depesz: which would imply that you have version 1 installed
<workmad3>
depesz: and are using version 2 docs
<depesz>
=$ gem list aws-sdk | grep 'aws-sdk '
<depesz>
aws-sdk (2.2.11, 1.64.0)
<depesz>
ok. i see that I have both. maybe that's the problem.
<workmad3>
depesz: could easily be
<depesz>
how can I make the script use v2 ?
benhuda has quit [Ping timeout: 255 seconds]
ferr has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rkazak has joined #ruby
<havenwood>
depesz: gem 'aws-sdk', '~> 2'
<volty>
gem server, search does not work. Do I miss something?
<depesz>
havenwood: in the .rb script?
<havenwood>
depesz: Check the aws-sdk docs, but yeah right before the require. (Assuming you're not using a Gemfile here.)
skade has quit [Quit: Computer has gone to sleep.]
<havenwood>
volty: gem -v
grasshopper has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<volty>
2.4.2
mary5030 has joined #ruby
<depesz>
havenwood: OK. added before 'require' and it works.
<havenwood>
volty: Well, that's not terribly old at all.
<depesz>
finally.
<havenwood>
volty: Current is: 2.5.1
mary5030 has quit [Remote host closed the connection]
<havenwood>
volty: What happens when you `gem search` then?
<volty>
havenwood: does gem server's search work for you ?
<volty>
havenwood: it says not found, always
<havenwood>
volty: Oh, maybe I misunderstood the question. What's the line you're trying?
mary5030 has joined #ruby
<volty>
No gems matched "mechanize"
aegis3121 has quit [Ping timeout: 265 seconds]
lacrymology has joined #ruby
<lacrymology>
I upgraded my system and now I'm getting this: /home/lacrymology/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require': This installation of RMagick was configured with ImageMagick 6.9.2 but ImageMagick 6.9.3-0 is in use. (RuntimeError)
<volty>
havenwood: I am talking about the gem server & browser accessing localhost:8808
<lacrymology>
I tried uninstalling activesupport and reinstalling it but I'm seeing the same error
<lacrymology>
how can I rebuild that?
<lacrymology>
or clean the cache
<havenwood>
volty: Yeah, just realized that. I thought you meant the two commands weren't working. What do you get for?: gem source
<havenwood>
lacrymology: Have you already?: rbenv rehash
lucasb has quit [Quit: leaving]
<volty>
havenwood: I have the page, I can click on single gems from the list (and consult the doc), but the search isn't working.
<havenwood>
lacrymology: For a fresh version of the cache see: gem help pristine
<havenwood>
volty: I'm trying to see what your gem source is. What was the output from the `gem source` command?
gbgdev has joined #ruby
ixti has quit [Ping timeout: 255 seconds]
fmcgeough has joined #ruby
<havenwood>
?rbenv lacrymology
<ruby[bot]>
lacrymology: Missing command under rbenv? Did you try `rbenv rehash`?
carella has quit [Remote host closed the connection]
<volty>
havenwood: you say I should try to regenerate it ?
aufi has quit [Quit: Konversation terminated!]
<havenwood>
The Bundler motto should be "Prefix `bundle exec` or it's not your Bundle!" and the rbenv motto should be "Run `rbenv rehash` or they might not be your gems!"
freerobby has quit [Quit: Leaving.]
lacrymology has quit [Ping timeout: 260 seconds]
<havenwood>
volty: That look right. Just wanted to make sure you had the right source. Can you `gem install` gems?
gagrio has quit [Ping timeout: 245 seconds]
<volty>
havenwood: yes, absolutely
<havenwood>
might not be your Bundle, I suppose...
<havenwood>
volty: Gist the output from?: gem source --debug
davedev24 has joined #ruby
drptbl_ has joined #ruby
lacrymology has joined #ruby
<lacrymology>
havenwood: yes
<stevenhaddox>
havenwood: Truth on both bundler & rbenv. I've got `b` aliased to `bundle exec`
pawnbox has quit [Remote host closed the connection]
casadei has quit [Read error: Connection reset by peer]
casadei_ has joined #ruby
pawnbox has joined #ruby
<havenwood>
volty: Still looks good.
drptbl has quit [Ping timeout: 240 seconds]
<volty>
havenwood: I am trying now to generate rdoc.
<volty>
regenerate
mark3 has quit [Quit: Leaving.]
aryaching has quit [Ping timeout: 250 seconds]
rippa has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
rippa has joined #ruby
<havenwood>
volty: I'm confused. What are you running exactly and what's the error?
codecop has joined #ruby
jam_ has joined #ruby
tenderlove has quit [Remote host closed the connection]
<volty>
gem server starts a server that serves rdoc at (default) port 8808. Then you go there and consult the rdoc for your installed gems. Above on the right is an input field for search, but doesn't find anything I type..
hannelita has quit [Remote host closed the connection]
bronson has joined #ruby
<volty>
and, of course, the url shorcuts do not get result (not found, always)
<havenwood>
volty: Aha, gotcha. I wonder if ruby-build had rdoc disabled when you installed Ruby?
govg_ has joined #ruby
hannelita has joined #ruby
polysics has quit []
<volty>
havenwood: have no idea. The fact is there is a list, but seems not indexed. I'll retry as soon as rdoc finishes the generation of the content. And hope.
<havenwood>
volty: Ahhh.
Xeago has joined #ruby
steffkes has joined #ruby
ixti has joined #ruby
jam_ has quit [Ping timeout: 272 seconds]
duckson has joined #ruby
psy_ has joined #ruby
chouhoulis has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
ixti has quit [Client Quit]
disconnekted has quit [Remote host closed the connection]
lacrymology has quit [Quit: leaving]
Bloomer has joined #ruby
shredding has quit [Ping timeout: 260 seconds]
osvimer has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 276 seconds]
usershell has quit [Read error: Connection reset by peer]
oo7cat has left #ruby [#ruby]
steffkes has quit [Ping timeout: 260 seconds]
usershell has joined #ruby
aegis3121 has joined #ruby
guacamole has joined #ruby
guacamole has quit [Client Quit]
govg_ has quit [Quit: leaving]
SCHAAP137 has quit [Remote host closed the connection]
<volty>
rdoc stuck. what is the latest ruby stable version ?
<havenwood>
volty: 2.3.0
<volty>
havenwood: do you use rbenv ?
<havenwood>
volty: nope, i use chruby
<volty>
ok , thx
<havenwood>
ruby-install --latest ruby
tesuji has quit [Ping timeout: 264 seconds]
aryaching has joined #ruby
dlitvak_ has quit [Ping timeout: 255 seconds]
ferr has quit [Ping timeout: 272 seconds]
Azulinho has quit [Read error: Connection reset by peer]
dcunit3d has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
Azulinho has joined #ruby
dlitvak has joined #ruby
<hxegon>
if I have 2 classes, say Person and People, would it make sense to have People inherit from Array?
Snowy has quit []
Rodya_ has joined #ruby
<aegis3121>
No
<aegis3121>
Well maybe
<volty>
better: or Array containing People or People containing array
<aegis3121>
but it would probably be better to just include Enumerable
chouhoulis has joined #ruby
Azulinho has quit [Client Quit]
<hxegon>
aegis3121 thats probably what I'm looking for, ty
davedev24 has quit [Ping timeout: 240 seconds]
Azulinho has joined #ruby
marcdel has joined #ruby
jbrhbr has joined #ruby
stevenhaddox is now known as stevenhaddox_
davedev24 has joined #ruby
sandstrom has joined #ruby
drocsid has joined #ruby
elaptics is now known as elaptics`away
futilegames has quit [Quit: futilegames]
tercenya_ has quit []
stevenhaddox_ has quit [Quit: Leaving]
futilegames has joined #ruby
maikowblue has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
skade has joined #ruby
<aegis3121>
hxegon delegate should be able to solve other problems you have (like using :[])
huyderman has quit [Remote host closed the connection]
davedev2_ has joined #ruby
dfinninger has joined #ruby
tenderlove has joined #ruby
skade has quit [Client Quit]
volty has quit [Quit: Konversation terminated!]
govg has quit [Ping timeout: 240 seconds]
dn` has joined #ruby
skade has joined #ruby
zambini has joined #ruby
NoTroutAboutIt has joined #ruby
davedev24 has quit [Ping timeout: 250 seconds]
dlitvak has quit [Remote host closed the connection]
yardenbar has quit [Ping timeout: 260 seconds]
scepticulous has quit [Ping timeout: 250 seconds]
zambini has quit [Client Quit]
zambini has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dfinninger has quit [Ping timeout: 264 seconds]
skade has quit [Client Quit]
houhoulis has joined #ruby
dlitvak has joined #ruby
ympeg has joined #ruby
govg has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has quit [Ping timeout: 240 seconds]
aegis3121 has quit [Ping timeout: 272 seconds]
Renich has joined #ruby
amclain has joined #ruby
davedev24 has joined #ruby
blackmesa has joined #ruby
ferr has joined #ruby
usershell has quit [Remote host closed the connection]
antgel has quit [Ping timeout: 265 seconds]
workmad3_ has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davedev2_ has quit [Ping timeout: 240 seconds]
tomphp_ has joined #ruby
howdoicomputer has joined #ruby
tomphp_ has quit [Client Quit]
dlitvak has joined #ruby
workmad3 has quit [Disconnected by services]
workmad3_ is now known as workmad3
TomyWork has quit [Ping timeout: 248 seconds]
einarj has quit [Remote host closed the connection]
usershell has joined #ruby
tomphp has quit [Ping timeout: 264 seconds]
ferr has quit [Ping timeout: 265 seconds]
yfeldblum has joined #ruby
carraroj has quit [Ping timeout: 265 seconds]
usershell has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 276 seconds]
drocsid has quit [Ping timeout: 264 seconds]
edwinvdgraaf has quit [Ping timeout: 264 seconds]
carraroj has joined #ruby
BrunoSaboia has joined #ruby
arthurix has quit [Read error: Connection reset by peer]
arthurix has joined #ruby
arthurix_ has joined #ruby
andikr has quit [Remote host closed the connection]
caffeinic has quit [Remote host closed the connection]
agentmeerkat has quit [Ping timeout: 256 seconds]
drptbl_ has quit [Quit: My MAC has gone to sleep. zZz..]
usershell has joined #ruby
sepp2k has quit [Quit: Leaving.]
BSaboia has quit [Ping timeout: 276 seconds]
<mikecmpbll>
bitwise operations on Bignum are like many many many multitudes slower than fixnum :'(
TomyLobo has joined #ruby
RobertBirnie has joined #ruby
blackms has quit [Quit: Leaving]
arthurix has quit [Ping timeout: 250 seconds]
dmolina has quit [Quit: Leaving.]
ico has joined #ruby
dmolina has joined #ruby
al2o3-cr has quit [Read error: Connection reset by peer]
FernandoBasso1 has quit [Quit: Leaving]
Xeago has quit [Remote host closed the connection]
tomphp has joined #ruby
al2o3-cr has joined #ruby
carella has joined #ruby
<mikecmpbll>
nvm i take that back
Macaveli has joined #ruby
Moblin has joined #ruby
Macaveli has quit [Client Quit]
ghox has quit [Read error: Connection reset by peer]
BrunoSaboia has quit [Read error: Connection reset by peer]
dmolina has quit [Ping timeout: 264 seconds]
BrunoSaboia has joined #ruby
jbrhbr has quit [Quit: Leaving.]
tmtwd has joined #ruby
ico_ has joined #ruby
<imperator>
there a nicer way to write this? results = network_interfaces.select{ |nic| nic if nic_ids.include?(nic.id) }
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Hounddog has quit [Ping timeout: 250 seconds]
NoTroutAboutIt has quit [Ping timeout: 250 seconds]
<Papierkorb>
imperator: leave out the 'nic if' part
workmad3_ has joined #ruby
<Papierkorb>
imperator: #select only cares about if the block returns truthy or falsy
<imperator>
Papierkorb, ah, true
finisherr has joined #ruby
carraroj has quit [Ping timeout: 260 seconds]
<Papierkorb>
imperator: isn't there "get network interface by nic id" method?
<Papierkorb>
+a
pdoherty has quit [Ping timeout: 276 seconds]
bMalum has joined #ruby
ico has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
dwfait has quit [Remote host closed the connection]
wolffles has joined #ruby
symm- has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
nettoweb has joined #ruby
c0m0 has quit [Ping timeout: 256 seconds]
ico_ has quit [Ping timeout: 260 seconds]
dlitvak_ has joined #ruby
norc_ has joined #ruby
Melpaws has joined #ruby
carraroj has joined #ruby
marcdel has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
BSaboia has joined #ruby
mikecmpbll has joined #ruby
BrunoSaboia has quit [Ping timeout: 256 seconds]
cschneid_ has joined #ruby
marcdel has quit [Ping timeout: 240 seconds]
dlitvak_ has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
chouhoulis has joined #ruby
usershell has quit [Remote host closed the connection]
dlitvak has joined #ruby
jpterry has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
usershell has joined #ruby
techsethi has joined #ruby
usershell has quit [Remote host closed the connection]
usershell has joined #ruby
User458764 has joined #ruby
DarkElement has joined #ruby
Melpaws1 has joined #ruby
beast has joined #ruby
<DarkElement>
How can I connect and parse a url with nokogiri/openuri? This is never connecting: Nokogiri::HTML.parse(open(url, :proxy => '159.122.253.8:3128'))
bronson has quit [Remote host closed the connection]
drocsid has joined #ruby
drocsid has quit [Remote host closed the connection]
usershell has quit [Remote host closed the connection]
Melpaws has quit [Ping timeout: 260 seconds]
usershell has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
jbrhbr has joined #ruby
<lucasb>
I wonder if it makes difference to prepende "http://" to your :proxy string
<lucasb>
*prepend
<zambini>
lucasb: I ran into this last week, if Nokogiri uses the `URI` lib, you need to prepend the protocol
usershell has quit [Ping timeout: 250 seconds]
BrunoSaboia has joined #ruby
UtkarshRay has quit [Ping timeout: 240 seconds]
<al2o3-cr>
lucasb: good call
agentmeerkat has joined #ruby
Azulinho has quit [Remote host closed the connection]
BSaboia has quit [Ping timeout: 250 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
finisherr has left #ruby [#ruby]
rkazak has joined #ruby
usershell has joined #ruby
dlitvak_ has joined #ruby
guacamole has joined #ruby
dlitvak has quit [Ping timeout: 256 seconds]
ThirstForKnowled has joined #ruby
RobertBirnie has quit [Ping timeout: 260 seconds]
B1n4r10 has quit [Ping timeout: 245 seconds]
<DarkElement>
I tried it both with and without that
<DarkElement>
Didn't make a difference
NoTroutAboutIt has joined #ruby
RobertBirnie has joined #ruby
<DarkElement>
:(
ThirstForKnowled has quit [Client Quit]
namic has joined #ruby
tmtwd has quit [Ping timeout: 272 seconds]
OmegaA_ has left #ruby [#ruby]
SenpaiSilver has joined #ruby
speaking1ode has quit [Read error: Connection reset by peer]
TomPeed has joined #ruby
Channel6 has joined #ruby
Melpaws1 has quit [Ping timeout: 240 seconds]
Melpaws has joined #ruby
speakingcode has joined #ruby
namic has quit [Quit: Page closed]
devbug has joined #ruby
howdoicomputer has joined #ruby
sigurding has quit [Quit: sigurding]
solars has quit [Ping timeout: 264 seconds]
floatingpoint has joined #ruby
<lucasb>
sorry, I don't know any further. but, open(url) doesn't give any errors?
howdoicomputer has quit [Ping timeout: 240 seconds]
carella has quit [Remote host closed the connection]
dlitvak_ has quit [Ping timeout: 240 seconds]
sol_ has quit [Ping timeout: 240 seconds]
camillo is now known as sol_
<DarkElement>
dorei, that works
<dorei>
DarkElement: if this doesnt work for the url you want, then maybe u need other lib to open the url, use wireshark to verify what's actually being send/received on the network
<dorei>
there are some shitty sites that endup in an endless loop unless you get their cookies
<DarkElement>
Do I need to do .parse for the doc variable now? (with nokogiri)
<dorei>
nop
<DarkElement>
awesome
<dorei>
doc is your nokogiri document
<DarkElement>
and I can just add :proxy => "http://ip:port" now
<dorei>
ready for your xpath queries
bronson has joined #ruby
marcdel has joined #ruby
NoTroutAboutIt has quit [Ping timeout: 260 seconds]
<DarkElement>
I prefer css selectors
<DarkElement>
but yea
<DarkElement>
Will it work with the :proxy => "http://ip:port" now?
<hxegon>
hmm... 'You may have encountered a bug in ruby'. You don't say.
jam___ has joined #ruby
drptbl has joined #ruby
<dorei>
DarkElement: no idea, give it a try
pdoherty has joined #ruby
<DarkElement>
I am
s00pcan has quit [Ping timeout: 250 seconds]
<dorei>
DarkElement: from open-uri documentation: The environment variables such as http_proxy, https_proxy and ftp_proxy are in effect by default.
<TomyLobo>
arlek, https://attractivechaos.github.io/plb/ in this benchmark LuaJIT is faster than all ruby implementations in all but 2 tests (patmch:1t and patmch:2t)
<TomyLobo>
those are regex stuff
<Papierkorb>
hxegon: That's far from being self-contained, right now don't have the time to dig through some whole app
<hxegon>
Papierkorb I'm reducing it now
iateadonut has quit [Ping timeout: 264 seconds]
krz has quit [Ping timeout: 276 seconds]
<TomyLobo>
arlek, the author notes that "Lua does not come with a real regex engine, so its string pattern matching functions were used instead, which were not intended for speed."
NoTroutAboutIt has quit [Ping timeout: 250 seconds]
<Papierkorb>
arlek: would've surprised me if LuaJIT would be slower, as it is really fast. Also, MRI does not do JITing.
podman has joined #ruby
nerfando has joined #ruby
<arlek>
Hm... so it seems like Ruby would be more on par with Python than it is Lua!
<arlek>
Lua's pretty fast!
depesz has left #ruby ["WeeChat 1.4-rc1"]
tomphp has quit [Client Quit]
DarkElement has quit [Quit: Leaving]
firstdayonthejob has joined #ruby
uri___ has joined #ruby
<TomyLobo>
and pretty limited :)
<TomyLobo>
i think the two are related
dlitvak_ has joined #ruby
d0nn1e has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
norc_ has quit [Ping timeout: 265 seconds]
<TomyLobo>
hah, there's llvm-lua
<Papierkorb>
Lua's standard library *is* really limited, but it serves a different purpose than say ruby, so that's fine.
d0nn1e has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
dlitvak_ has joined #ruby
<TomyLobo>
yep
<arlek>
Well is there a way to precompile scripts into bytecode with ruby?
<TomyLobo>
arlek, what do you mean by bytecode?
sankaber has joined #ruby
rdark has quit [Ping timeout: 256 seconds]
<TomyLobo>
like .pyc files in python??
<Papierkorb>
arlek: it's possible to do with ruby2.3, but not out of the box using some program parameter (AFAIK!). Also, this feature is experimental, and experimental features WILL be removed if people don't like it.
<TomyLobo>
-?
<al2o3-cr>
you mean as luac foo.lua arlek
<arlek>
Just an intermediate bytecode in order to get past parsing times
<arlek>
intermediate form*
<TomyLobo>
arlek, parsing is done once
<TomyLobo>
i would guess when the file is require'd
dlitvak has quit [Ping timeout: 260 seconds]
<TomyLobo>
or first required, rather
<Papierkorb>
arlek: Oh, and that file format is afaik not portable. So you could in theory cache it locally, but that's about it. But in general, I don't see the point of doing this...
blaxter has quit [Ping timeout: 250 seconds]
<arlek>
I see.
<TomyLobo>
Papierkorb, it could be used with omnibus
<Papierkorb>
TomyLobo: a what?
<TomyLobo>
or not?
<TomyLobo>
Papierkorb, do you know gitlab?
<TomyLobo>
it comes in a package with everything and its dog in it
<TomyLobo>
they call it an omnibus package
Darmani has joined #ruby
<Papierkorb>
ok
<TomyLobo>
after the thing they use to package it
<Darmani>
Hey kids<3
<TomyLobo>
it bundles at least the software itself, the required ruby version, nginx, postresql and probably some more things i'm not aware of
<TomyLobo>
oh, the gems of course
fantazo has joined #ruby
<Papierkorb>
TomyLobo: Well then, that package is then installed locally to your computer I take? Well, no, as far I recall reading the ruby discussion on this feature, it's not portable, so that won't work. You could be lucky that it works from x64 to x64 machine, but that's not guaranteed.
Papierkorb has left #ruby ["Konversation terminated!"]
Papierkorb has joined #ruby
<TomyLobo>
Papierkorb, so it's precompiled with cpu-specific optimization even?
einarj has joined #ruby
<Papierkorb>
TomyLobo: No idea why it's not portable, I guess the usual endianess issues. In general, no guarantee on being portable, so it's not portable and if it works, you're just lucky :)
steffkes has joined #ruby
steffkes has joined #ruby
<TomyLobo>
so let's say i have two amd64 ubuntu trusty machines. you're saying it's possible that it's not possible to run it on both?
<TomyLobo>
i.e. down to luck?
dpg_ has joined #ruby
finisherr_ has joined #ruby
<Papierkorb>
TomyLobo: As there is no guarantee given on that, yes. You could always be lucky that it works from x64 to x64 machine, but it could blow up if you e.g. to x64 to ARM.
aegis3121 has quit [Ping timeout: 255 seconds]
<TomyLobo>
gitlab omnibus packages package ruby
<TomyLobo>
which is a native platform-specific binary
<Papierkorb>
TomyLobo: I'm not claiming that what you think about won't work. The issue is not if it's possible, but if it's guaranteed to work. If it's not guaranteed, but it works, then you're just lucky that it does
<TomyLobo>
so amd64 <-> arm isnt even relevant here
DoubleMalt has quit [Remote host closed the connection]
stamina has quit [Ping timeout: 255 seconds]
<Papierkorb>
TomyLobo: there is no guarantee. It doesn't matter from what to what you go.
sftrabbit has joined #ruby
<TomyLobo>
oh well, they could always precompile in postinst
krz has joined #ruby
sakix has joined #ruby
freerobby has joined #ruby
radgeRayden_ has joined #ruby
victortyau has quit [Quit: Leaving]
Renich has quit [Remote host closed the connection]
aegis3121 has joined #ruby
Mackerel_ has joined #ruby
sandstrom has joined #ruby
Mackerel_ has quit [Client Quit]
BigFish has joined #ruby
tubuliferous_ has quit [Ping timeout: 250 seconds]
<jhass>
pizzaops: and now you learned why you should describe your problem, not the solution you imagine ;)
Ishido has quit [Remote host closed the connection]
dlitvak_ has quit [Ping timeout: 265 seconds]
emilford has joined #ruby
emilford_ has quit [Ping timeout: 255 seconds]
<pizzaops>
lol
<pizzaops>
What about this? allow settings.to receive(:host).and_return('pizza.vsphere.com')
<adaedra>
rspec?
<pizzaops>
yes
<adaedra>
you have other ways to mock in rspec iirc.
<Papierkorb>
adaedra: if you
bronson has joined #ruby
<adaedra>
why wouldn't we stop the xy and you explain the whole problem?
<jhass>
settings is the hash?
<Papierkorb>
adaedra: if you're thinking about #stub, that's deprecated :)
carraroj has quit [Remote host closed the connection]
Ishido has joined #ruby
carraroj has joined #ruby
<adaedra>
Papierkorb: I'm thinking I'm too old for this shit.
<pizzaops>
settings is the hash, yes. Basically I have some methods to load settings into said hash from env vars or from a file, but for the method that USES the settings, I want to mock out that file/envvar parsing bit
<pizzaops>
and just supply a valid hash
<jhass>
so do that?
<jhass>
why would you need to mock anything on the hash?
Mon_Ouie has joined #ruby
chouhoulis has joined #ruby
<jhass>
mock the method that returns it
<pizzaops>
If I knew the answers to those questions I wouldn't be asking :)
<pizzaops>
So mock out the parse_config_file method, basically?
vF3hNGxc47h8 has joined #ruby
<jhass>
you realize we don't see your screen?
<pizzaops>
Yes.
<pizzaops>
Just imagine I have some method that parses the config file and returns values, and some method that uses said values, and invokes parse_config_file to get them.
<jhass>
probably yes
<pizzaops>
And I'm trying to test the method that uses the values, not the functioning of my file parse.
<jhass>
it's still very vague
pawnbox has quit [Remote host closed the connection]
<Papierkorb>
adaedra: :P
cschneid_ has quit [Remote host closed the connection]
pwnd_nsfw has quit [Ping timeout: 260 seconds]
dwfait has quit [Remote host closed the connection]
dwfait has joined #ruby
ferr has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
dwfait has quit [Remote host closed the connection]
rkazak has quit [Quit: Sleep.....ing....]
dwfait has joined #ruby
jackjackdripper has joined #ruby
<adaedra>
pizzaops: If I understand correctly, you want to test that something that uses your option hash does it correctly?
<pizzaops>
Right.
<pizzaops>
And I don't want to test the logic that creates the hash (in this test)
<pizzaops>
I have a method that returns said hash, which should be tested separately, as I understand unit testing.
hannelita has quit [Remote host closed the connection]
<adaedra>
Just replace the hash by something else
babblebre has quit [Quit: Connection closed for inactivity]
<pizzaops>
adaedra: oh as in, I can replace the method that returns a hash, inside the tests for this thing that uses the tests, with just methodname = { somehash }?
dwfait has quit [Remote host closed the connection]
<pizzaops>
uses the hash*
gregf has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<adaedra>
or use rspec with expect(hash).to receive(:[]).with(:key).and_return(:potato) or something like that (I feel like Papierkorb wants to fix my syntax)
<adaedra>
you don't replace the method which returns the hash, you make something else in place.
<Papierkorb>
adaedra: looks fine. Although mocking a Hash sounds like overkill ^^;
<adaedra>
Papierkorb: have a better idea?
<pizzaops>
adaedra: the thing that "uses" the hash explicitly calls the method though, and sets local var "settings" equal to it. So how can I just use "something else?
<pizzaops>
I'm trying to test the initialize method.
<adaedra>
Because you use tabs and spaces mixed.
<adaedra>
:set sw=2 sts=2 sw=8 et
<adaedra>
(iirc)
<pizzaops>
adaedra: ah you know, the person I'm working with must be using tabs :P
dpg_ has joined #ruby
* adaedra
gives pizzaops the tab correcter
<Papierkorb>
adaedra: ok, in that case, both ways of "return a hash and expect(it) to receive :[] with :foo and_call_original" and "expect it to receive [] with :foo and return :bar" are equally good & ugly. Let's face it, those lines /are/ ugly ;)
<adaedra>
Also called "baseball bat"
<Papierkorb>
adaedra: Btw, sorry but I'm not closely following the conversation otherwise
<adaedra>
Once you checked the settings and thrown your colleague in a volcano, you can ggVG=.
<pizzaops>
adaedra: hah. So, it's line 15 that I'm talking about basically.
pwnd_nsfw has joined #ruby
<pizzaops>
process_environment_variables and process_config_file can both return a hash but I don't want to actually invoke those real methods when I test initialize.
<adaedra>
this gist lacks of tests.
puria has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
<pizzaops>
adaedra: because I'm not sure how to fake the hash so I'm not sure how to write the test :P
<pizzaops>
adaedra: added one thing I was considering trying in the comments.
<pizzaops>
It should at least illustrate what my intention is...
<adaedra>
Your before do nothing, as you're assigning a local variable which goes out of scope the line after.
<pizzaops>
adaedra: I realized that. But it still hopefully demonstrates what I'm trying to do.
<adaedra>
Also, you make me hungry with your pizza.
imperator has left #ruby ["Leaving"]
<pizzaops>
:)
tomchapin has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
spider-mario has joined #ruby
<adaedra>
Your file is not even valid
<pizzaops>
ok
<adaedra>
ah no, I misread
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rodya_ has quit [Remote host closed the connection]
<adaedra>
I hate github coloring.
<BigFish>
this is terrible
blackmesa has quit [Ping timeout: 245 seconds]
<BigFish>
why am i trying to introduce myself to coding, it's like giving myself splinters
Rodya_ has joined #ruby
maikowblue has quit [Ping timeout: 260 seconds]
yqt has joined #ruby
<adaedra>
that won't be testable that way
dpg_ has joined #ruby
howdoicomputer has joined #ruby
<adaedra>
you can't call process_envthing and process_confthing independently, as they are both called by initialize
dionysus69 has quit [Remote host closed the connection]
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rodya_ has quit [Remote host closed the connection]
dionysus69 has joined #ruby
ta has quit [Read error: Connection reset by peer]
<pizzaops>
It's fine for just one to return valid data.
<adaedra>
so yeah, you have to mock them before initializing your object
<pizzaops>
sure
ta has joined #ruby
jokke has quit [Disconnected by services]
krz has quit [Ping timeout: 264 seconds]
<adaedra>
and in this mock, return a stubbed hash to see if you hit the right boxes
jokke1 has joined #ruby
RalfJ has joined #ruby
Rodya_ has joined #ruby
<pizzaops>
So I tried https://gist.github.com/pizzaops/3f38f6ff44d58ddc88e2, and no matter where I put the before(:all) I get something like `The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported.`
<pizzaops>
I've tried it at the describe level, context level, it do level, and always that kind of error. Which makes me feel like I'm a crazy person.
<adaedra>
Should be valid in the it block
devbug has quit [Ping timeout: 256 seconds]
ldnunes has quit [Quit: Leaving]
Xeago has joined #ruby
ferr has joined #ruby
fsapo has quit [Remote host closed the connection]
dlitvak has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 240 seconds]
sigurding has quit [Quit: sigurding]
who42 has joined #ruby
<adaedra>
That's going too far into rspec for me
asmodlol has quit [Ping timeout: 256 seconds]
<awox>
Using savon, is there a way to dump the list of types from a WDSL? I see client.operations returns the functions, but I'm looking for a list of the objects
<pizzaops>
adaedra: thanks for trying :)
<Papierkorb>
pizzaops: first, put the hash into a let(:config_hash){ .. }. then expect (prefer that over allow if possible) to receive your method .and_return(config_hash) - Prefer that over doing the same in the block.
<Papierkorb>
pizzaops: then, don't use .should. just don't.
<pizzaops>
heh ok
<Papierkorb>
pizzaops: third, expect that process_env_vars to eq config_hash
asmodlol has joined #ruby
<Papierkorb>
pizzaops: you can also expect process_env_vars to *be* config_hash
<pizzaops>
Papierkorb: why not just let(:setting){..}?
<pizzaops>
erm s/setting/settings
PedramT has joined #ruby
<Papierkorb>
pizzaops: but IMO 'eq' is strong enough of an expectation here. The configuration class may create a #clone or #dup'licate of the hash, that won't alter the behaviour and thus will only crash your test for no gain (still, IMO)
<Papierkorb>
pizzaops: well, you can choose whatever name, both are fine to me
<pizzaops>
I just mean that settings is the actual variable the hash is stored in in the initialize method
emilford has quit [Ping timeout: 260 seconds]
<Papierkorb>
pizzaops: the let() block returns the settings hash (or in general, you use let() to return test data)
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Papierkorb>
pizzaops: also see the warning i wrote as comment
<pizzaops>
Papierkorb: ah I see, this makes sense, thanks.
vifino has quit [Ping timeout: 255 seconds]
<Papierkorb>
pizzaops: that method name sounds like it accesses ENV or some other (semi-)global variable. Consider modifying those instead.
<pizzaops>
Yes, it accesses ENV because I want users to be able to configure via env var
darkf has quit [Quit: Leaving]
<Papierkorb>
pizzaops: Like you could do before{ ENV['Foo'] = 'bar' } # And then check in the example that it was handled correctly
n00bdev has quit []
tomphp has joined #ruby
diegoviola has quit [Ping timeout: 260 seconds]
weemsledeux has joined #ruby
johnbburg has joined #ruby
usershell has quit [Remote host closed the connection]
dlitvak has joined #ruby
vifino has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
tomphp has quit [Client Quit]
fantazo has joined #ruby
<pizzaops>
Papierkorb: so this — https://gist.github.com/pizzaops/3f38f6ff44d58ddc88e2 — now returns `You must provide credentials in either environment variables or a config file.` but I know from manual testing it won't return that if the env vars are correctly set. So I feel like I'm not successfully faking the return value of #process_environment_variables.
<pizzaops>
That being said, #process_environment_variables is an instance method. Could that be why?
<Papierkorb>
pizzaops: ...Yes.
dlitvak has quit [Remote host closed the connection]
<norc>
Well. The excitement surely was preceeded by boredome.
<Darmani>
I wrote this script to check if a word could be an anagram. Do you think it's okay? Or could it be better?
<choke>
I dunno about that Ox0dea -- with ruby I GSD more than I ever did with PHP in a single day
fantasticsid has joined #ruby
xet7 has joined #ruby
bMalum has quit [Read error: Connection reset by peer]
dtordable has joined #ruby
<norc>
Darmani, you do not need the ternary operator at all.
<Darmani>
just noticed that norc lol
<norc>
Darmani, for extra points, refine that method into String.
<choke>
Darmani, yeah don't need that ternary... would be nicer if there was some sort of dictionary attached so input is one word... there's a big chance that if i have two words, I already know if they're anagrams of each other.
diego2 is now known as diegoviola
<norc>
Darmani, and by that I mean refinement. Not just monkey patching String.
<Ox0dea>
It used to be that you could refine #method_missing but not #const_missing; instead of making the latter refineable, they made the former not. :(
tubuliferous_ has joined #ruby
<norc>
Good.
<Ox0dea>
Fine.
<norc>
I have seen too many awful hacks using method_missing.
<norc>
They can remove the method altogether for all I care.
<carella>
havenwood: I dont think I can agree with you in general
<Darmani>
Why isn't my exception working?
<gerep>
Hello people. I'm using FPM and running it with bundle exec I get an error on a ruby 2.0.0 file: find.rb on line 40 No such file or directory (Errno::ENOENT). The gist with my command and the error message: https://gist.github.com/gerep/20bd09fa45fe80beb3e0
blackmes1 has quit [Read error: Connection reset by peer]
apneic has joined #ruby
<havenwood>
carella: It's true nonetheless.
<norc>
havenwood, look at some popular Java classes. The endless stream of FactoryFactories is their newest achievement.
<carella>
havenwood: Are you speaking about method that can't take arguments or about the method that can take no argument? :)
melter has joined #ruby
<carella>
I thought of the latter at first
<Ox0dea>
carella: Methods which take no arguments are likely to be more focused and thus easier to finagle into doing The Right Thing.
<Ox0dea>
Sometimes.
<carella>
Then you have to know what default will be use
<havenwood>
carella: Like use ''.chars (no arguments) rather than any combo of a method with arguments.
BrunoSaboia has quit [Quit: Leaving]
<norc>
Ox0dea, especially split. ;-)
<norc>
Hah!
<carella>
In that case, I agree
<norc>
What a horrid Perl remnant.
sakix has quit [Ping timeout: 265 seconds]
<havenwood>
carella: [:pie].one? rather than [:pie].size == 1
<norc>
Darmani, you are doing something like this.
<Darmani>
norc - I get that now.
<carella>
Unless is outer scope
emilford has joined #ruby
<norc>
Darmani, and again, arr.any?{ |i| i < 0 } - do it like that.
<Darmani>
I did. That's how it looks in my editor.
<Darmani>
norc - Thanks norc. For putting up with me and my stupid questions.
<Darmani>
You're my hero.
ramortegui has quit [Quit: Ex-Chat]
Jackneill has quit [Remote host closed the connection]
<lucasb>
Darmani: you are learning ruby pretty fast, congrats.
edwinvdgraaf has quit [Read error: Connection reset by peer]
bollullera has joined #ruby
edwinvdgraaf has joined #ruby
<Darmani>
lucasb - Thanks dude. But I can't actually create a program to save my life. I can write tiny scripts that do this and that. But that's all :P
dfinninger has joined #ruby
houhoulis has quit [Remote host closed the connection]
<Cohedrin>
Darmani what program do you want to be writting?
<Cohedrin>
most programs start as just writting a script
<Cohedrin>
then they evolve into a "program"
norc has quit [Ping timeout: 276 seconds]
TomPeed has joined #ruby
rodfersou|afk has quit [Quit: leaving]
<jbrhbr>
Integer() and .to_i differ in integer format error handling as well (exception vs do-your-best). it's for the same reason but i first ran across this inconsistency there
finisherr has quit [Ping timeout: 255 seconds]
<Darmani>
Cohedrin - yeah... I never know how to answer that question. That's what everyone keeps telling me though.
<Darmani>
Cohedrin - One of these days I want to make a music player of some sort. When I'm at Ox0dea's or Radar's level =P
<lacrymology>
how can I construct a list and then yield each element in it?
<apeiros>
Ox0dea: use glob and drop the .each ;-p
ur5us has quit [Remote host closed the connection]
<Darmani>
glob? Really that's a thing? lmao
<Ox0dea>
apeiros: Could still use #[].
<apeiros>
Ox0dea: sugared [] does not take blocks
<Ox0dea>
apeiros: I meant unsugared, of course.
<Ox0dea>
*desugared
<apeiros>
yeah, ew. don't :)
<Ox0dea>
Won't. :)
<apeiros>
sugarfree
choke has joined #ruby
Rodya_ has quit [Remote host closed the connection]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<carella>
what's that?)
<Ox0dea>
carella: Dir['*.foo'] returns all the files in the current directory that match that pattern. If you spell it differently, you can say Dir.glob('.*foo') { |f| ... } to "do something" with each file.
<Ox0dea>
Dir[foo] is just "sugar" for Dir.[](foo), but only the latter can take a block.
<carella>
So #[] is a syntax sugar for glob?
marr has quit [Ping timeout: 245 seconds]
<Ox0dea>
It's an alias, yeah.
<carella>
oh, thanks
croberts has joined #ruby
<Radar>
lacrymology: Do you have an example of what you're trying to do?
zenlot1 has joined #ruby
decoponio has quit [Quit: Leaving...]
moeabdol has joined #ruby
yfeldblum has joined #ruby
<lacrymology>
Radar: I get a list of objects, modify some of them, and filter them, it's kind of involved. At the end I have a list and I want the caller to do `foo do |e| ... end`
skade has quit [Ping timeout: 276 seconds]
<lacrymology>
with |e| being each element of that list
moeabdol has quit [Client Quit]
<Ox0dea>
lacrymology: list.each { |e| yield e }
diegoviola has joined #ruby
huluhuluhulu has joined #ruby
<Radar>
^
moeabdol has joined #ruby
<Ox0dea>
Can't say list.each(&method(:yield)) since yield isn't a method.
zenlot has quit [Ping timeout: 272 seconds]
johnzorn has quit [Remote host closed the connection]
<Ox0dea>
Hash#merge lets you pass a block for resolving conflicts; it'd be nice if #invert did too.
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
phredus has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aryaching has joined #ruby
CloCkWeRX has joined #ruby
<Derailed>
Hey everyone, newbie ruby question here: What's the different between defining classes in a module, versus defining a class like "class MyModule::MyClass"
casadei_ has quit [Remote host closed the connection]
aspire has quit [Quit: Leaving]
dlitvak has joined #ruby
Hammy_Work has joined #ruby
<carella>
Isn't MyModule::MyClass exist mostly for module extension?
devbug has joined #ruby
lucasb has quit [Quit: leaving]
<Derailed>
Ox0dea, thanks. I clearly need to get my head around constant resolution and namespaces in ruby. I'm looking at code that defines classes "Product", "Domestic::Product" and "International::Product", and just trying to work out if they might ever be 'mistaken' for each other
cicloid has quit [Quit: zzZZzzzZzzzzzZZZz]
myntcake has quit [Quit: Leaving]
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Derailed>
But I guess if you're ever referring to those classes, you would always do so with the fully qualified name?
karapetyan has quit [Remote host closed the connection]
<Derailed>
...unless you're a in a block delimited by 'module Domestic' for example?
<Ox0dea>
Derailed: `self` is the same in both of those.
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nerium has joined #ruby
<Ox0dea>
If you replace `p Foo` with `p self`, you get `M::C` in both cases.
<Ox0dea>
Resolving the constant `Product` is never a "guessing game", so to speak.
<BigFish>
the tutorial for Greeter classes are already giving me errors
<BigFish>
it's a sign, i should run while i can
<Ox0dea>
Yep.
phredus has joined #ruby
<Ox0dea>
Don't succumb to the sunk cost fallacy.
<BigFish>
sunk cost ?
<Derailed>
Ox0dea, I think I get it, I'll find something to read about the constant resolution
<BigFish>
.
who42 has quit [Ping timeout: 264 seconds]
<Ox0dea>
Derailed: It's more or less like method resolution.
<Ox0dea>
It walks up the ancestor chain looking for a matching constant; if it doesn't find one, it tries to invoke #const_missing on the receiver, and then walks up the ancestor chain resolving that.
herbst has joined #ruby
pdoherty has quit [Ping timeout: 250 seconds]
zambini has quit [Quit: Leaving.]
<Ox0dea>
You'd only have to use a qualifier if you wanted to refer to Domestic::Product from within Internation::Product or vice-versa.
rakm has joined #ruby
zambini has joined #ruby
NoTroutAboutIt has joined #ruby
<Derailed>
Ox0dea, side track: am I correct that the actual .rb files or directories these classes are defined in is meaningless? Unlike Python/java/etc, Ruby does not CARE what the filename is (although rails might care for it's magical autoloading?)
<Ox0dea>
Derailed: Just so.
<Ox0dea>
No harm in keeping things sanely organized, of course.
<Derailed>
For context, it's a rails project I'm reading. These are all different models
<Ox0dea>
Rails is picky about directory structure out-of-the-box, and there's little sense in bothering to circumvent it there.
sakix has joined #ruby
<Ox0dea>
Convention > configuration only works if everybody's on board. :P
babblebre has joined #ruby
wolffles has quit [Quit: wolffles]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
solocshaw has joined #ruby
<BigFish>
wrong number of arguments..
<BigFish>
I don't see how, I'm following the dumb tut just fine
DoubleMalt has quit [Remote host closed the connection]
<BigFish>
unless @name is a variable
<BigFish>
( ͡° ͜ʖ ͡°)
<Ox0dea>
¯\_(ツ)_/¯
<Ox0dea>
Learn the violin.
Rickmasta has joined #ruby
sakix has quit [Ping timeout: 260 seconds]
Axy has quit [Ping timeout: 256 seconds]
moeabdol has quit [Quit: WeeChat 1.4]
antgel has quit [Ping timeout: 264 seconds]
Mia has quit [Read error: Connection reset by peer]
<Radar>
BigFish: Just give it the right number of arguments.
sperant has joined #ruby
sperant has quit [Client Quit]
<Radar>
That'll fix it.
<BigFish>
stahp
<Radar>
BigFish: what version of Ruby do you have installed btw? 2.3 has a better error message for that case.
<BigFish>
i know you guys are programmers but these jokes give me no confidence
<carella>
so you wouldn't have to retype it everytime
mary5030 has joined #ruby
zambini has quit [Quit: Leaving.]
guacamol_ has joined #ruby
dpg_ has quit [Ping timeout: 260 seconds]
dlitvak has quit [Ping timeout: 250 seconds]
dlitvak_ has joined #ruby
herbst has joined #ruby
asmodlol has quit [Ping timeout: 260 seconds]
howdoicomputer has quit [Ping timeout: 260 seconds]
lucasb has joined #ruby
<Radar>
^
zambini has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
moeabdol has quit [Quit: WeeChat 1.4]
vikas027 has joined #ruby
guacamole has quit [Ping timeout: 245 seconds]
asmodlol has joined #ruby
zambini has quit [Client Quit]
chouhoulis has quit [Remote host closed the connection]
uri_ has quit [Ping timeout: 265 seconds]
mary5030 has quit [Ping timeout: 240 seconds]
eyesnot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dpg_ has joined #ruby
chouhoulis has joined #ruby
pawnbox has joined #ruby
dlitvak_ has quit [Ping timeout: 240 seconds]
<vikas027>
Hello Everyone, how can I write a file to a particular location in ruby, without location it is working fine though. - https://dpaste.de/FPiR
karapetyan has quit [Remote host closed the connection]
<Radar>
vikas027: line 13 is invalid syntax.
ur5us has joined #ruby
zast has joined #ruby
<Radar>
vikas027: Perhaps you meant FIle.join("/tmp/configs", job) ?
karapetyan has joined #ruby
ur5us has quit [Remote host closed the connection]
FernandoBasso has quit [Quit: Leaving]
<vikas027>
@Radar: No, I don't want to join the files
<carella>
it will join the name of the folder with the filename
<vikas027>
Radar: There are bunch of different files, which I want to write to a location
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lucasb>
I created a class Box with a single instance variable "@value", just to play with the concept of a variable storage as a first class object. this pattern has a name? is there example of this in the ecosystem or other languages?
<Radar>
vikas027: Line 13 should probably be open(File.join("/tmp/configs/",job), 'a') { |f|
zambini has joined #ruby
northfurr has joined #ruby
<vikas027>
carella: Ah, okay. Got it. Thanks, I will try this out.
<vikas027>
Radar: Thanks to you too. :)
devbug has quit [Ping timeout: 265 seconds]
<Radar>
?code lucasb
<ruby[bot]>
lucasb: We can't help you without your code, please post it to https://gist.github.com
<Radar>
lucasb: That's just an instance variable which is exactly what it says on the tin: a variable for just that one instance.
pawnbox has quit [Ping timeout: 272 seconds]
<Ox0dea>
lucasb: That should just be `Box = Struct.new(:value)`, mind.
<lucasb>
Ox0dea: indeed, that would be simpler
jottr has quit [Ping timeout: 256 seconds]
<Ox0dea>
Not simpler, but easier.
karapetyan has quit [Ping timeout: 260 seconds]
<lucasb>
I'm just playing with ideas, I still don't know what I really want :)
<lucasb>
anyway, I wanted a mutable self. But then I hit that error "Can't change the value of self"
zerowaitstate has quit [Quit: leaving]
<lucasb>
that's why I created this Box
<Ox0dea>
Are you sure you want a mutable self?
<vikas027>
Radar, Carella: Thank you for pointing me there. This is working fine :) https://dpaste.de/6gpJ
<Radar>
Great :)
<lucasb>
Ox0dea: well, I'm just experimenting
dpg_ has joined #ruby
rcs has quit [Remote host closed the connection]
<Ox0dea>
lucasb: I won't knock that.
astrofog has quit [Quit: Quite]
kalopsian has quit [Ping timeout: 250 seconds]
rcs has joined #ruby
aegis3121 has quit [Ping timeout: 260 seconds]
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
<carella>
lucasb: When you asked about the name of this pattern what exactly did you mean? A class that will consist of exactly one variable?
blackmes1 has joined #ruby
skade has joined #ruby
freerobby has quit [Quit: Leaving.]
<lucasb>
carella: yes, just wanted to know if there was something as simple as this concept in the wild. I think I saw something like that in Rust, but I don't understand that language very well
<Ox0dea>
Boxing is for when your primitive types can't behave like objects.
NoTroutAboutIt has quit [Ping timeout: 240 seconds]
futilegames has quit [Quit: futilegames]
<lucasb>
yeah, I know nothing about fiddle. I still need to clarify my ideas before asking something concrete. Thanks for the initial sanity check, people :)