<havenwood>
_rukh: Ruby appeals to a variety of programmers.
<_rukh>
so I've seen
Nawn has quit [Quit: Page closed]
<_rukh>
I'll find this offtopic room now
ledestin has joined #ruby
<havenwood>
_rukh: yeah, for non-Ruby stuff or general discussions about other languages (or hangman) the #ruby-offtopic channel is a good place.
Contigi has joined #ruby
<_rukh>
okay, I'll be there from now on
_rukh has left #ruby [#ruby]
jesseherrick has joined #ruby
_rukh has joined #ruby
jesseherrick has quit [Client Quit]
Nawn has joined #ruby
paulcsmith has quit [Ping timeout: 244 seconds]
jher has quit [Ping timeout: 240 seconds]
Nawn has quit [Client Quit]
Nawn has joined #ruby
tuxero has quit [Quit: tuxero]
Ox0dea has quit [Read error: Connection reset by peer]
jgpawletko has joined #ruby
Ox0dea has joined #ruby
radgeRayden has joined #ruby
kies has joined #ruby
<Ox0dea>
shevy: Your wonky results are probably to do with the sleep being too fine; changing the coefficient to something greater than 0.01 would probably help.
<Nawn>
Hey guys, I'm trying to keep my code 'DRY'. It works, but I don't know if I can make it even smaller. anyone willing to take a look?
<al2o3-cr>
or using a mutex
<Ox0dea>
?guys
<ruboto>
Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<Ox0dea>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
<havenwood>
Nawn: Yeah, do you have a link to a Gist of your code?
<Nawn>
havenwood: Any suggestions? Or is that as 'DRY' as I can make it? :)
<nofxx>
EllisTAA, depict the problem, not how you're solving it
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<nofxx>
Ox0dea, hey that's nice
dstarh has joined #ruby
<Ox0dea>
nofxx: It avoids the explicit creation of a throwaway Array, if nothing else.
benlovell has joined #ruby
tvw has quit [Remote host closed the connection]
ecnalyr has quit [Ping timeout: 260 seconds]
<Ox0dea>
Nawn: This is a pretty imperative task, so there's not a lot of room for cleanup. You could use weird tricks to make it shorter, but they wouldn't be improvements.
solocshaw has quit [Ping timeout: 246 seconds]
<Nawn>
:P Okay, but overall it's okay, right? :) I had it repeating the :(puts "HUH!? SPEAK UP, SONNY!") code like on 3 different lines, but i cleaned that up. :) Just making sure I didn't miss anything
devoldmx has joined #ruby
<Nawn>
Practice does not make perfect! D: Perfect practice, makes perfect ;)
bruno- has joined #ruby
northfurr has quit [Quit: northfurr]
<havenwood>
Nawn: As you proceed you might also enjoy feedback from Exercism exercises: http://exercism.io
<havenwood>
Nawn: And do ask here! :D
tubuliferous has quit [Read error: Connection reset by peer]
pocketprotector has quit [Remote host closed the connection]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bmurt has quit []
SilentEcho has quit [Ping timeout: 250 seconds]
<havenwood>
That would be a good thing to pay someone to complete. ;)
<Moonlightning>
Ox0dea: authenticity—i.e. /these data are the ones published by the author; they have not been modified or tampered with/
SilentEcho has joined #ruby
jesterfraud has joined #ruby
<Ox0dea>
Moonlightning: In that case, you did mean consistency, in which case a simple checksum should suffice.
chipotle has quit [Ping timeout: 246 seconds]
tmtwd has quit [Ping timeout: 256 seconds]
dopamean_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
braincrash has joined #ruby
<Moonlightning>
Ox0dea: probably not. It would have to be a cryptographic hash, not a simple checksum, and the hash would have to have been signed by the author (or at least served by the gem servers, over TLS).
kies has joined #ruby
xcesariox has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
cgfbee has joined #ruby
xcesariox has quit [Client Quit]
cfloare has joined #ruby
xcesariox has joined #ruby
houhoulis has quit [Remote host closed the connection]
craysiii has joined #ruby
<havenwood>
Moonlightning: To verify the latest Rails gem for example: ruby -rrubygems/package -e "p Gem::Package.new('rails-4.2.4.gem').verify"
prestorium has joined #ruby
<havenwood>
Moonlightning: ^ if you wanted to manually check the checksum
allcentury has joined #ruby
lampshades has joined #ruby
<Moonlightning>
Thanks, havenwood
mistermocha has joined #ruby
dfinninger has quit [Remote host closed the connection]
Blaguvest has quit []
ecnalyr has joined #ruby
Volsus has joined #ruby
dfinninger has joined #ruby
mistermocha has quit [Remote host closed the connection]
lampshades has quit []
allcentury has quit [Ping timeout: 244 seconds]
podman has quit [Quit: Connection closed for inactivity]
dseitz has quit [Read error: Connection reset by peer]
bigredboots has joined #ruby
hawkface has joined #ruby
dseitz has joined #ruby
towski__ has joined #ruby
evserykh has joined #ruby
bodgix has quit [Ping timeout: 256 seconds]
Rickmasta has quit [Ping timeout: 268 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Rickmasta has joined #ruby
ecnalyr has quit [Ping timeout: 246 seconds]
devoldmx has joined #ruby
bodgix has joined #ruby
towski__ has quit [Remote host closed the connection]
<Radar>
Moonlightning: I suggest using Ruby 2.2.3 instead of the 2.2.2 which is mentioned in the guide. That's because 2.2.3 is the latest now.
<Moonlightning>
Radar: even though I'm not doing development?
<sevenseacat>
what are you installing ruby and gems for then?
<Radar>
Moonlightning: You're... using Ruby but not doing development?
<Moonlightning>
sevenseacat, Radar: because… http://supmua.org is a gem? :?
ekleog has quit [Ping timeout: 244 seconds]
jackjackdripper has quit [Quit: Leaving.]
Skelz0r has quit [Ping timeout: 272 seconds]
devoldmx has joined #ruby
chinmay_dd has quit [Quit: See ya!]
devoldmx has quit [Remote host closed the connection]
<sevenseacat>
ah hah
devoldmx has joined #ruby
aibo has quit [Ping timeout: 250 seconds]
<sevenseacat>
looks nice
Skelz0r has joined #ruby
ekleog has joined #ruby
tmtwd has joined #ruby
<Moonlightning>
Honestly, the only reason I'm even here is because Homebrew doesn't do gems et al like most package managers do >.>
juanpablo_ has joined #ruby
Zarthus has quit [Ping timeout: 256 seconds]
<sevenseacat>
which is a good thing
quazimodo has quit [Ping timeout: 250 seconds]
<sevenseacat>
if you're not actually interested in using ruby, then I would just use the ruby that comes pre-installed on your OSX
<Moonlightning>
Yeah. I get to deal with half a dozen different package managers. 9.9
oo_ has quit [Ping timeout: 265 seconds]
mhenrixon has quit [Ping timeout: 264 seconds]
<sevenseacat>
and then gem install sup
Zarthus has joined #ruby
rubie has quit [Remote host closed the connection]
oo_ has joined #ruby
majjoha has joined #ruby
<cscheib>
using a package manager that didn't understand and resolve ruby dependencies would be a nightmare
<cscheib>
gem + bundler ftw
mhenrixon has joined #ruby
<cscheib>
(and in my case, puppet)
<Moonlightning>
> You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
<Moonlightning>
Hence my asking about redoing the gem system here.
<sevenseacat>
then you'll need sudo
theery has quit [Remote host closed the connection]
NeverDie has joined #ruby
dfinninger has quit [Remote host closed the connection]
<cscheib>
for i in `gem list | cut -f1 -d' '`; do sudo gem uninstall $i; done; <--- rough answer to your first(ish) question... test it first, that's off the top of my head
juanpablo_ has quit [Ping timeout: 250 seconds]
minimuffins has quit [Ping timeout: 255 seconds]
bronson has joined #ruby
<Moonlightning>
I thought `sudo gem` was a bad idea?
<cscheib>
you're uninstalling the gems you installed with sudo
<cscheib>
it's allowerd
renodice has joined #ruby
<sevenseacat>
it is, for development
pawnbox has joined #ruby
<baweaver>
chances are high if you aren't a sysadmin you should not touch sudo on a server
<baweaver>
and even then only with great care
<Ox0dea>
baweaver: How about `machinectl shell`?
<havenwood>
sudo htop
swgillespie has joined #ruby
<baweaver>
Unix is not built for safety, it's built to deliver Mr Bullet to Mr Foot in the most efficient way possible
bricker has joined #ruby
<baweaver>
there are exceptions, but that's why I said chances are high
pawnbox has quit [Remote host closed the connection]
<Moonlightning>
sevenseacat: why for development but not otherwise?
<Moonlightning>
Ox0dea: I never could figure out how to get it to keep different folder hierarchies for different accounts
dhjondoh has joined #ruby
khebbie has joined #ruby
<cscheib>
send a note in to Linux Journal, Kyle Rankin there is a mutt enthusiast. I'm sure he's got a neat multi-account setup
khebbie has quit [Remote host closed the connection]
<Moonlightning>
No thanks. x.x
thomas has joined #ruby
grenierm has quit [Quit: grenierm]
dgutierrez1287 has joined #ruby
thomas has quit [Client Quit]
kidmillions has joined #ruby
grenierm_ has joined #ruby
kies has quit [Ping timeout: 264 seconds]
grenierm_ has left #ruby [#ruby]
kies has joined #ruby
pawnbox has joined #ruby
Tempesta has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
moeabdol has quit [Quit: WeeChat 1.3]
dgutierrez1287 has quit [Ping timeout: 256 seconds]
skade has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
skade has joined #ruby
<Radar>
How do I prevent guard from stopping when it encounters an exception? I keep getting "15:27:19 - INFO - Guard::Nanoc has just been fired" and I have to restart guard before it will continue compiling.
lampshades has joined #ruby
skade has quit [Client Quit]
bigredboots has joined #ruby
chinmay_dd has joined #ruby
xet7_ has quit [Ping timeout: 255 seconds]
lampshades has quit [Remote host closed the connection]
lampshades has joined #ruby
bigredboots has quit [Remote host closed the connection]
lampshades has quit [Remote host closed the connection]
luksaur has quit [Ping timeout: 265 seconds]
tkuchiki has quit [Remote host closed the connection]
xet7_ has joined #ruby
aganov has joined #ruby
luksaur has joined #ruby
lampshades has joined #ruby
techsethi has joined #ruby
lampshades has quit [Remote host closed the connection]
casadei has quit [Remote host closed the connection]
lampshades has joined #ruby
renodice has quit [Ping timeout: 246 seconds]
benlieb has joined #ruby
rushed has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Swappticon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jordanloky has joined #ruby
tagrudev has joined #ruby
pawnbox has quit [Remote host closed the connection]
<acosonic>
shouldn't there be something like node.js but for ruby like node.rb ? :)
<Radar>
lol
<Radar>
Why do you think so?
last_staff has joined #ruby
<acosonic>
I've been reading that quora thread and I'm afraid of delphi destiny, I was a big fan od delphi...
<shevy>
it's not just an old question, it's where you have n different answers that don't really provide a lot of insight into any real answer. "Today's cool kids are pushing on into Functional Programming languages like Haskell, Erlang and Clojure."
ksteck has quit [Ping timeout: 264 seconds]
<baweaver>
languages don't ever really die
<baweaver>
see: COBOL, RPG
<baweaver>
Where there's a line of production code, there's a way.
<Radar>
acosonic: If anything, now is the time for new people to be getting into Ruby.
<Radar>
There is a huge uptick in the amount of people using it and we're crying out for new developers.
<shevy>
yeah they don't really die, but they can stagnate or lose out on new people adopting the language
bruno- has quit [Ping timeout: 240 seconds]
<Radar>
At the meetup in Melbourne, we have 120 people attend. 15 of those people got up to say that their companies were hiring.
<Radar>
I _constantly_ get asked if I am looking for more work.
<baweaver>
People keep stealing the good ruby people before we can get them :/
<shevy>
Radar are you looking for more work? :)
<baweaver>
and that's in SF, the tech capital
<baweaver>
already tried shevy ;)
<Radar>
shevy: hells to the no
ereslibre has joined #ruby
RobertBirnie has joined #ruby
<acosonic>
Radar: what kind of projects do you need developers for?
<acosonic>
Radar: well that's just one project, I tought you were reffering to something related to success of Ruby as a platform
tkuchiki has joined #ruby
<sevenseacat>
ruby is already successful as a platform
dseitz has quit [Ping timeout: 264 seconds]
<Radar>
acosonic: realestate.com.au is hiring a boatload of developers, as is redbubble and envato.
<baweaver>
and Apple and Sony and Amazon and....
<Radar>
Ruby is not dying.
<cscheib>
even if you don't want to exclusively dev, everyone is either looking for ruby or python (or both) for sysadmin/devops/whatever-you-wanna-call it positions
<acosonic>
Nah I run my own company, just want to see what are long-term plans to conquer digital world and take a peace of marketplace from PHP or Node.js
<sevenseacat>
lol
devoldmx has quit [Remote host closed the connection]
<Radar>
troll detected
<sevenseacat>
that doesnt even make sense
<shevy>
acosonic is github no success to you
* baweaver
readies lazerz
<shevy>
that dam lazerz
<shevy>
well defended beaver home
<baweaver>
dam right
pepperbreath1 has left #ruby [#ruby]
<Radar>
wood you guys please stop it with the puns
<Radar>
oh no I'm about to get ?guys
<Radar>
I am sorry :(
<baweaver>
?guys
<ruboto>
Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
* Radar
dies
<sevenseacat>
GAWD RADAR
<baweaver>
first legit in a while
<sevenseacat>
you should know better
* sevenseacat
is mortally offended
* Radar
should, but doesn't.
ruby[bot] has quit [Quit: leaving]
<baweaver>
though me and shevy are male, so....
<shevy>
baweaver time for aussie jokes!
<shevy>
Arrrr
riotjones has joined #ruby
<shevy>
ok, I can't come up with anything creative myself :(
<baweaver>
They're aussies, that's already enough of a joke :P
ferhaty has joined #ruby
<shevy>
haha
<jesterfraud>
on a tenuously related note — I've seen a few writers always assuming females in writing... is there some kind of movement I missed there?
<Radar>
acosonic: What do you mean to take a piece of marketplace from PHP or Node.js? Do you intend to create your own language?
Lycanii has joined #ruby
<Ox0dea>
jesterfraud: They're likely just trying to redress the imbalance of the last few centuries.
<baweaver>
mainly towards gender neutral terms than anything, though much into that and we should probably take it to #ruby-offtopic
<baweaver>
Oh come now trolls, we gave you a perfectly good shot there.
<shevy>
acosonic went silent
<jesterfraud>
baweaver, could it be that... the internet is growing up?
<baweaver>
jesterfraud: wouldn't that be something?
<shevy>
jesterfraud I am educating 4chan!
<jesterfraud>
I've clearly got my optimistic hat on
<acosonic>
Radar: I loved the coffescript concept, I loved node.js so I clicked on that damn quora thread about ruby dying
<jesterfraud>
although every time I go to change it, someone else has beaten me to it.
hs366 has joined #ruby
<baweaver>
quora is a thinly veiled yahoo answers with extra layers of pretension on top
<shevy>
hehe
<Radar>
acosonic: ... that... that did not answer my question
opensource_ninja has quit [Remote host closed the connection]
<Radar>
Are you channeling Kanye from last night? Are you about to announce a run for President also?
codenapper has joined #ruby
<sevenseacat>
imma let you finish, but nodejs is the best language of all time?
<baweaver>
haskell
<sevenseacat>
baweaver: you misspelt ruby.
anisha has joined #ruby
<acosonic>
Radar: seems like you are asking about my guidelines on how should ruby proceed, but I can't give you answer to that one. All I'm sure of is that people constantly need something "new and hot" regardless of it's logic, or logic behind it...
pawnbox_ has joined #ruby
<sevenseacat>
thats not what hes asking at all
<Radar>
lol
<Radar>
acosonic: I don't even know what this conversation is about any more.
<Radar>
high / drunk?
<shevy>
acosonic is doing that on purpose :(
pawnbox has quit [Ping timeout: 265 seconds]
<baweaver>
Radar: give me about a half hour
dionysus69 has joined #ruby
blarghlarghl has quit [Quit: Lost terminal]
chipotle has quit [Quit: cheerio]
konsolebox has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
Soda has quit [Remote host closed the connection]
<baweaver>
acosonic: so are we going to get to the part where you out yourself as a troll?
<acosonic>
shevy: I'm not I just wondered about your ideas for something like node.rb to spark some new & hot project
wldcordeiro__ has joined #ruby
<[spoiler]>
Hello lovelies!
ndrei has joined #ruby
<sevenseacat>
most of us are in the business of building software that works and is dependable, not 'new and hot'
konsolebox has quit [Max SendQ exceeded]
<certainty>
moin moin
<baweaver>
alo
<[spoiler]>
sevenseacat: what's wrong with new and hot? :P
<sevenseacat>
nothing, as long as it also works and is dependable first
<[spoiler]>
Everything that's used in production was "new and hot" at some point
<baweaver>
become a sysadmin and install all the new hotness
<baweaver>
if you still have hair and aren't in the hospital from heart failure, I'll be impressed.
<[spoiler]>
Lmao
<[spoiler]>
I do work as a sys admin, I just said there's nothing wrong with new-n-hot
<baweaver>
and you wonder how grey beards are made, they're forged in the fires of beta software hotness
<shevy>
hmmmm losing hair...
<acosonic>
I am a sysadmin department head, my company first had "work and reliable" honeywell systems, then they replaced it with PC, now they replaced PC with cloud... All I asked is shoudn't there be something like node.rb and I got trolling answers :)
techsethi has quit [Quit: techsethi]
<shevy>
no that is not right
<shevy>
your first action was a link
* cscheib
gets his popcorn
<acosonic>
shevy: well ok I admit that was trolling :|
<shevy>
a real troll never admits to be trolling
bigredboots has joined #ruby
<Radar>
acosonic: What would node.rb do?
<Radar>
acosonic: what would node.rb do that node.js or Ruby in its current form doesn't do?
ereslibre has quit [Remote host closed the connection]
<shevy>
acosonic well it's a difference over whether you have your own opinion or would just quote on opinions from others; for instance, a programming language I myself is really dying is Tcl
<[spoiler]>
Radar: it would sound hipper then either node.js or ruby, you peasant
ereslibre has joined #ruby
<sevenseacat>
Radar: something new and hot, duh.
<[spoiler]>
^
<acosonic>
Radar: that's up to ruby community, since node.js is throwing new servers I guess it needs to do something else or different
<Radar>
acosonic: ok, so you clearly have no idea further than a name. It's been fun talking. I've got work (in Ruby) to do.
<cscheib>
I generally try not to kill them, especially outdoors
<Nilium>
*personal
<shevy>
cscheib lol did you run into it with your mouth open?
<Nilium>
At the office, I will basically leave all spiders alone and just shuffle them out onto my balcony
<sevenseacat>
if a spider is in my vicinity, it gets dead, very fast.
<shevy>
who would have known there are spider friends on #ruby
<Nilium>
A lot of baby spiders keep lowering themselves onto my desk (and who knows how many directly into my hair), and I just move them to other peoples' cubicles
<cscheib>
shevy: no, just had spider web all up in my dome every time I left the house
<Nilium>
I figure sharing the love is important.
<Nilium>
Obviously, I don't tell them they've got a new spider-baby-buddy but they'll appreciate it later.
<cscheib>
I've never had a spider problem at an office
relix has joined #ruby
relix has quit [Remote host closed the connection]
<Nilium>
Spiders have been something of a problem lately here. They're just now showing up all over the place.
<cscheib>
close to water?
<Nilium>
There's a lake within walking distance.
<Nilium>
Within a couple days of the janitors cleaning off the balcony, at least eight reasonably large spiders will have set up webs.
<Nilium>
I'm not even in Australia, so it's just weird.
<cscheib>
I've observed that they seem to be worse close to large-ish bodies of water
<zenspider>
?ot
<ruboto>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<zenspider>
says the spider...
<baweaver>
irony
<Nilium>
I don't see any on-topic discussions, so motion declined.
<Nilium>
He's asking why the escape moves to the #
<baweaver>
magic
<zenspider>
oh. it's arbitrary which one you're escaping
<zenspider>
you have to lex "#{" to start an interpolation, so it doesn't matter which one you interrupt
<Nilium>
>> "#{\}"
<ruboto>
Nilium # => /tmp/execpad-9566926ecacd/source-9566926ecacd:2: syntax error, unexpected $undefined ...check link for more (https://eval.in/425861)
ruurd has quit [Quit: ZZZzzz…]
<Nilium>
Unless it's the closing brace.
<zenspider>
unclosed interpolation
<Nilium>
i.e., it's not arbitrary which you escape
<zenspider>
yes, it is.
baweaver has left #ruby [#ruby]
baweaver has joined #ruby
<Ox0dea>
Nilium: It's arbitrary between the '#' and the '{'.
<Nilium>
Listen, he wanted a stupid Ruby discussion, he's getting one.
<Ox0dea>
...?
<Nilium>
We're going full on semantics here.
<shevy>
the ruby parser is a thing of wickedness
<Nilium>
More or less.
<zenspider>
yes. yes it is.
<zenspider>
go look at my code for proof. the bullshit I have to do...
<shevy>
hehe
<cscheib>
you just went full semantics, man. you never go full semantics.
<Nilium>
It and Perl have a unique hatred of parsing.
<baweaver>
>> ?a
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
Nilium: luckily ruby isn't as bad as perl (yet?)
<Nilium>
I'm not sure.
<zenspider>
I am
<Nilium>
It doesn't have barewords, at least.
<zenspider>
see ruby_parser for proof
<zenspider>
you can't statically parse perl. you can statically parse ruby
<Nilium>
It more depends on which Perl
<baweaver>
Ox0dea: any other amazing ones off the top of your head?
<zenspider>
mmm... I think that's true back to perl 4
<Ox0dea>
As amazing as the teleporting backslash? Certainly not.
<zenspider>
not sure. def perl 5
<Nilium>
Problem is I can't say anything about Perl 6 'cause I don't even know if it works
<zenspider>
ruby certainly has some seriously stupid shit in it tho
<Ox0dea>
zenspider: What's the stupidest thing?
<Nilium>
Your code ಠ_ಠ
<Ox0dea>
Nilium: Are you salty about the '#{' lexeme or something?
<Nilium>
No, I'm just remembering your code golfing.
bayed has joined #ruby
lampshades has joined #ruby
<Ox0dea>
It wasn't golf.
<Nilium>
I'm calling it code golfing because any other explanation terrifies me.
<shevy>
eam collected things of ruby parser madness
<zenspider>
def m(a=<<-EOD); a; end
<zenspider>
wtf
<zenspider>
EOD
<zenspider>
that kills me
<acosonic>
Ox0dea: VW golf 2 - best car ever
<Nilium>
It bothers me that that one makes perfect sense to me due to shell scripting
pawnbox has joined #ruby
<zenspider>
the argument is OUTSIDE the method definition. I die a little everytime I see that
<Nilium>
It's awful if anyone does it, it's just that syntactically I understand it
lampshades has quit [Remote host closed the connection]
<Ox0dea>
It's pretty gnarly, but that semantics for heredocs is occasionally pretty useful.
ruurd has joined #ruby
<Ox0dea>
Ruby's test suite uses it liberally, at any rate.
lampshades has joined #ruby
<Nilium>
e.g., (for i in {1..8} ; do cat <<EOF ; done) | tr -s 'w' 'b'¬woop¬EOF¬
bigredboots has quit [Remote host closed the connection]
ICantCook has quit [Quit: Leaving]
<zenspider>
def m(a=<<-EOD, b=a*2); b; end
<zenspider>
wtf
<zenspider>
EOD
<zenspider>
that's just fucking wrong
lampshad_ has quit [Ping timeout: 268 seconds]
<zenspider>
here, I think this is a "better" example
<zenspider>
def m(a=42, b=<<"EOD"); b; end
<zenspider>
wtf #{a}
<zenspider>
EOD
TvL2386 has joined #ruby
<zenspider>
ok. gloving up and processing 4 trays of dehydrated hatch chiles
<Nilium>
At least it doesn't have Python's wonky argument behavior
<zenspider>
which?
ecnalyr has joined #ruby
pietr0_ has quit [Quit: pietr0_]
<[spoiler]>
"the teleporting backslash" I am too scaed to google this
<[spoiler]>
scared*
kidmillions has quit [Quit: kidmillions]
michael_mbp has quit [Excess Flood]
bronson has joined #ruby
crdpink2 has quit [Ping timeout: 244 seconds]
crdpink has joined #ruby
michael_mbp has joined #ruby
leat has quit [Remote host closed the connection]
Lucky__ has joined #ruby
ecnalyr has quit [Ping timeout: 244 seconds]
bronson has quit [Ping timeout: 256 seconds]
crdpink2 has joined #ruby
crdpink has quit [Ping timeout: 244 seconds]
MIGGER has joined #ruby
leat has joined #ruby
jas02 has joined #ruby
wldcordeiro__ has quit [Remote host closed the connection]
Voker57 has joined #ruby
<shevy>
Hmm... In the old days, I used to have a website with on-hover-mouse highlighting upon wanting to select menu entries, through 2 different images in use - the default one, and then a highlighted variant of that image. Only recently did I find out that this can be done via javascript/jquery/css, through opacity... without having to use two different images. This I found to be rather mind boggling
ndrei has quit [Ping timeout: 240 seconds]
<zenspider>
gah. so much chile dust in my nose
ndrei has joined #ruby
leat has quit [Remote host closed the connection]
chenillen has quit [Quit: chenillen]
nso95 has joined #ruby
rakm has joined #ruby
leat has joined #ruby
<Radar>
chilli?
baweaver has quit [Remote host closed the connection]
nofxx has quit [Ping timeout: 240 seconds]
Voker57 has quit [Ping timeout: 255 seconds]
iateadonut has joined #ruby
iateadonut has quit [Client Quit]
nso95 has quit [Remote host closed the connection]
<quazimodo>
chingy
<quazimodo>
input
jgt3 has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
leat has quit [Remote host closed the connection]
<jhass>
shevy: google "do a barrel roll", all CSS
rushed has quit [Quit: rushed]
ohaibbq has quit [Quit: Leaving...]
gagrio has joined #ruby
Iskarlar has joined #ruby
pawnbox has quit [Remote host closed the connection]
jellyjellyrobot has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
90% of the global usage I've seen was actually a constant, the rest could've been hidden/scoped into your library module as a module level instance var with accessors
<apeiros>
it's not ruby centric, so not everything may apply to ruby
jellyjellyrobot has joined #ruby
<jhass>
there's no need to contend on the globals namespace
<apeiros>
PaulVern: in general, you want to restrict visibility of data as much as possible
jellyjellyrobot has quit [Max SendQ exceeded]
oo_ has quit [Remote host closed the connection]
<PaulVern>
Thanks, I'll give that link a read
araujo has quit [Ping timeout: 255 seconds]
jellyjellyrobot has joined #ruby
jellyjellyrobot has quit [Max SendQ exceeded]
jellyjellyrobot has joined #ruby
oo_ has joined #ruby
jellyjellyrobot has quit [Max SendQ exceeded]
jellyjellyrobot has joined #ruby
michael_mbp has quit [Excess Flood]
Cust0sLim3n has quit [Ping timeout: 265 seconds]
michael_mbp has joined #ruby
jellyjellyrobot has quit [Client Quit]
jgt3 has joined #ruby
bstrarm has joined #ruby
howdoi has joined #ruby
PaulVern has quit [Ping timeout: 244 seconds]
bustrarm has quit [Ping timeout: 250 seconds]
juanpablo_ has joined #ruby
jas02 has quit [Ping timeout: 255 seconds]
DiscoM_ has left #ruby [#ruby]
banister has joined #ruby
Cust0sLim3n has joined #ruby
astrobun_ has quit [Remote host closed the connection]
zacts has quit [Read error: Connection reset by peer]
eightfold has joined #ruby
TheHodge has joined #ruby
araujo_ has quit [Quit: Leaving]
zacts has joined #ruby
juanpablo_ has quit [Ping timeout: 244 seconds]
fretted has joined #ruby
bluOxigen has quit []
jas02 has joined #ruby
marr has joined #ruby
Hounddog has joined #ruby
roxtrong_ has joined #ruby
wildlander has joined #ruby
ta has quit [Remote host closed the connection]
ta has joined #ruby
sysanthrope has quit [Quit: No Ping reply in 180 seconds.]
araujo has joined #ruby
deepthought42 has joined #ruby
<zenspider>
ah. the quiet hour where the distractions stop and I can finish things :P
leafybasil has quit [Remote host closed the connection]
<apeiros>
zenspider: shush! back to work!
<apeiros>
;-)
_vision has quit [Ping timeout: 260 seconds]
sysanthrope has joined #ruby
roxtrong_ has quit [Ping timeout: 244 seconds]
ElderFain has quit [Max SendQ exceeded]
hawkface has quit [Ping timeout: 265 seconds]
redmaverick has joined #ruby
choke has joined #ruby
_vision has joined #ruby
banister has left #ruby [#ruby]
_vision is now known as Guest43268
banisterfiend has joined #ruby
ElderFain has joined #ruby
ElderFain has quit [Changing host]
ElderFain has joined #ruby
choke has quit [Client Quit]
banisterfiend is now known as sdfsdf
<sdfsdf>
.
sdfsdf is now known as banisterfiend
<adaedra>
trying new nicks?
jds has joined #ruby
einarj has joined #ruby
einarj has quit [Remote host closed the connection]
einarj has joined #ruby
chthon has joined #ruby
astrobun_ has joined #ruby
dumdedum has joined #ruby
sevenseacat has quit [Quit: .]
ferhaty has joined #ruby
psy_ has quit [Ping timeout: 264 seconds]
skade has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
morning
ecnalyr has joined #ruby
<[spoiler]>
yorickpeterse: morning <3></3>
davedev24 has joined #ruby
Voker57 has quit [Read error: Connection reset by peer]
aspiers has joined #ruby
HoloIRCUser1 has joined #ruby
HoloIRCUser1 has quit [Remote host closed the connection]
crazydiamond has joined #ruby
akemrir has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
ecnalyr has quit [Ping timeout: 246 seconds]
[k- has joined #ruby
postmodern has quit [Quit: Leaving]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
You're going to keep doing that forever now aren't you?
<ljarvis>
moin
<ljarvis>
'grats, yorickpeterse
Iskarlar has joined #ruby
<yorickpeterse>
ty
<yorickpeterse>
I'll be joining the work-from-home nerds club soon
<yorickpeterse>
what kind of terrible bedroom is that
<[spoiler]>
LMFAO
<yorickpeterse>
fake gold plated walls...really?
<yorickpeterse>
the suit might as well be fake while we're at it
<[spoiler]>
Oh man I am dying this video is perfect
jgt3 has joined #ruby
deepthought42 has joined #ruby
deepthought42 has quit [Client Quit]
michele has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
<michele>
hi there, I have an Array with three sets inside (L = [set1, set2, set3])
<michele>
I want to: set1 & set2 & set3
<michele>
So I did: L.map(&)
<michele>
however, it does not work
<michele>
how should I do that?
jenrzzz has joined #ruby
ByronJohnson has joined #ruby
<suchness>
michele: You might use inject
<suchness>
L.inject(L.first) {|result, item| result & item}
<michele>
works :)
ecnalyr has joined #ruby
<michele>
how come map is not suitable for that? because it applies '&' to every single element whilst inject applies to all the collection ?
<adaedra>
.inject(&:&) no?
<suchness>
adaedra: Not sure if that would work without a starting element to build on.
<[spoiler]>
michele: inject runs "between" (unjects between them) elements, and map runs *on* single elements
<michele>
L.inject(:&) works
<suchness>
Neat
<michele>
thanks :)
radgeRayden_ has joined #ruby
<suchness>
I wonder how it determines what to start with, I'll have to look at the docs.
benlovell has quit [Read error: Connection reset by peer]
<adaedra>
suchness: If you do not explicitly specify an initial value for memo, then the first element of collection is used as the initial value of memo.
<suchness>
michele: Sure thing
<adaedra>
(from the doc)
<suchness>
adaedra: Ah, thats good to know, I had no idea. I have been writing my injects long hand it seems.
wildlander has quit [Quit: Saliendo]
<wasamasa>
apeiros: what's up with that video
<wasamasa>
apeiros: I don't get it at all
<wasamasa>
apeiros: why is it even that specific actor
<apeiros>
wasamasa: don't worry. that's ok.
ByronJohnson has quit [Ping timeout: 264 seconds]
<adaedra>
>trying to understand the internet
<[spoiler]>
wasamasa: you don't need to know. You just need to accept
ruurd has quit [Quit: ZZZzzz…]
mprelude has joined #ruby
majjoha has joined #ruby
radgeRayden has quit [Ping timeout: 268 seconds]
ecnalyr has quit [Ping timeout: 250 seconds]
scripore has joined #ruby
jalnt has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby
techsethi has quit [Quit: techsethi]
jokke- is now known as jokke
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ByronJohnson has joined #ruby
phutchins has joined #ruby
Iskarlar has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
jokke has quit [Disconnected by services]
chussenot has quit [Quit: chussenot]
ByronJohnson has quit [Ping timeout: 256 seconds]
jokke- has joined #ruby
oo_ has quit [Remote host closed the connection]
neanderslob has quit [Quit: No Ping reply in 180 seconds.]
user1138 has joined #ruby
gizmore has joined #ruby
arian0n has quit [Ping timeout: 246 seconds]
arian0n has joined #ruby
neanderslob has joined #ruby
oo_ has joined #ruby
radgeRayden_ has quit [Ping timeout: 255 seconds]
lampshades has joined #ruby
lampshades has quit [Remote host closed the connection]
jgt3 has quit [Ping timeout: 240 seconds]
lampshades has joined #ruby
hackeron_ has joined #ruby
TvL2386 has quit [Ping timeout: 252 seconds]
majjoha has quit [Ping timeout: 244 seconds]
neanderslob has quit [Client Quit]
hackeron has quit [Ping timeout: 264 seconds]
khebbie has quit [Remote host closed the connection]
neanderslob has joined #ruby
sepp2k has joined #ruby
Squarepy has joined #ruby
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
neanderslob has quit [Client Quit]
davedev24 has joined #ruby
Gnomethrower has quit [Read error: Connection reset by peer]
eGGsha is now known as eGGshke
livathinos has joined #ruby
neanderslob has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
neanderslob has quit [Quit: No Ping reply in 180 seconds.]
codecop has joined #ruby
charliesome has joined #ruby
roadt has quit [Ping timeout: 252 seconds]
sdothum has joined #ruby
neanderslob has joined #ruby
eGGshke is now known as eGGsha
ByronJohnson has joined #ruby
stan has joined #ruby
Kallis has joined #ruby
Kallis has quit [Max SendQ exceeded]
<shevy>
flughafen no flughafen jokes today, it's too hot to take off
khebbie has joined #ruby
messysaurus has joined #ruby
<flughafen>
i haven't been outside since this morning shevy , i dind't see it's 31
<flughafen>
yay klima!
khebbie has quit [Remote host closed the connection]
techsethi has joined #ruby
ruurd has joined #ruby
Akagi201 has joined #ruby
Mendenhall has quit [Ping timeout: 250 seconds]
benlovell has quit [Ping timeout: 268 seconds]
dgutierrez1287 has joined #ruby
Kallis has joined #ruby
ferhaty has quit []
My_Hearing has joined #ruby
fretted has quit [Quit: Leaving]
neanderslob has quit [Ping timeout: 272 seconds]
jgt3 has joined #ruby
banister has joined #ruby
rodferso1 has joined #ruby
rodfersou has quit [Ping timeout: 250 seconds]
chussenot has joined #ruby
ruby-lang991 has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Spami has joined #ruby
Gnomethrower has joined #ruby
Gnomethrower has quit [Changing host]
Gnomethrower has joined #ruby
Gnomethrower has quit [Max SendQ exceeded]
Gnomethrower has joined #ruby
Gnomethrower has quit [Changing host]
Gnomethrower has joined #ruby
aspiers has quit [Ping timeout: 240 seconds]
meph has quit [Quit: Leaving.]
benlovell has joined #ruby
ruby-lang477 has joined #ruby
<ruby-lang477>
is there a way to get index of key in hash ?
northfurr has quit [Quit: northfurr]
<jhass>
you're probably using the wrong datatstructure or algorithm if you have that desire
<jhass>
?xy
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
ruby-lang991 has quit [Ping timeout: 246 seconds]
Iskarlar has joined #ruby
<apeiros>
hash.keys.index(key) # but seriously, what jhass said. this is a strong code smell.
szarubin has joined #ruby
messysaurus has quit [Remote host closed the connection]
pythonix has joined #ruby
syath has joined #ruby
jellyjellyrobot has joined #ruby
PaulVern has joined #ruby
leat has quit [Remote host closed the connection]
leat has joined #ruby
Galaxy83 has joined #ruby
atomical has joined #ruby
allcentury has joined #ruby
aspiers has joined #ruby
tesuji has quit [Ping timeout: 240 seconds]
m1lt0n has joined #ruby
szarubin has quit [Quit: Leaving]
majjoha has joined #ruby
michele has left #ruby ["WeeChat 1.3"]
messysaurus has joined #ruby
juanpablo_ has joined #ruby
devoldmx has joined #ruby
m1lt0n has quit [Client Quit]
Ropeney has joined #ruby
lele|w has quit [Ping timeout: 250 seconds]
p8952 has joined #ruby
pythonix has quit [Ping timeout: 260 seconds]
ramadoka has quit [Remote host closed the connection]
<canton7>
seems bad to have a singleton owning a db resource
<canton7>
why can't they instantiate MyGem?
<[spoiler]>
that too ^
astrobun_ has quit [Remote host closed the connection]
majjoha has quit [Ping timeout: 260 seconds]
<jhass>
actually
<jhass>
?fake
<ruboto>
Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
<Galaxy83>
No. Not a singleton. This will run only as the app is starting
<canton7>
as in.. why are you forcing them to call 'MyGem.do_action' rather than 'mygem = MyGem.new; mygem.do_actoin'?
ferhaty has joined #ruby
techsethi has quit [Quit: techsethi]
benlovell has joined #ruby
<[spoiler]>
Galaxy83: read what Mr. Ruboto said
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dorei has joined #ruby
jonnie has quit [Ping timeout: 240 seconds]
lele|w has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
skade has joined #ruby
patrick_star has quit [Ping timeout: 264 seconds]
Kallis has quit [Read error: Connection reset by peer]
<Galaxy83>
The real code is almost identical. The db_resource is actually a Redis gem and do action will get/set a row. The app will start, call MyGem.do_action 50-100 times (but never inside a loop) and never run again until app restart
ndrei has quit [Ping timeout: 252 seconds]
casadei has joined #ruby
<jhass>
you really should allow the app to provide the redis instance
<jhass>
def self.do_x(redis=Redis.new)
Pumukel has quit [Remote host closed the connection]
<Galaxy83>
but i want to make the Gem's implementation as simple as posible
ndrei has joined #ruby
dhjondoh has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
<[spoiler]>
Galaxy83: what you did is not a step in that direction
Quandl has joined #ruby
techsethi has joined #ruby
<[spoiler]>
Galaxy83: people will need to go to hackish lengths to change the redis instance if they wish to do so
Cust0sLim3n has quit [Ping timeout: 240 seconds]
uri_ has joined #ruby
<Galaxy83>
the redis config will be configured in the Gem's config file
<shevy>
Galaxy83 there is absolutely zero need to have to require an user to use two method calls when a single one could suffice
<Galaxy83>
or the Gem's config hash
meatherly has joined #ruby
<Galaxy83>
shevy - if option 1 - then the method will be called only once in the beginning of the program.
Queeniebee has quit [Ping timeout: 256 seconds]
<Galaxy83>
the real question i guess: how costly is ||= ?
ecnalyr has joined #ruby
jdawgaz has joined #ruby
skade has quit [Ping timeout: 265 seconds]
<[spoiler]>
Galaxy83: not very :/
* apeiros
blinks
<[spoiler]>
Lol
<apeiros>
Galaxy83: are you *sure* the cost of ||= is a concern?
avril14th has joined #ruby
<apeiros>
(besides that `a ||= b`'s cost is probably more dictated by the specific expressions which make up a & b than ||= itself…)
<Galaxy83>
apeiros: thats why i'm here. I prefer second option since then the user will deal only with one method
<darix>
that if nil should be rather cheap no?
khebbie has joined #ruby
<apeiros>
Galaxy83: that's rather unrelated to what I said
k3asd` has quit [Ping timeout: 265 seconds]
<apeiros>
Galaxy83: how about you benchmark it
<apeiros>
once with ||=, once with dedicated init
khebbie has quit [Remote host closed the connection]
Cust0sLim3n has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
<apeiros>
but the full method
ndrei has quit [Ping timeout: 240 seconds]
patrick_star has joined #ruby
eGGsha is now known as eGGshke
lkba has joined #ruby
roxtrong_ has joined #ruby
uri__ has joined #ruby
Akagi201 has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
ecnalyr has quit [Ping timeout: 244 seconds]
hawkface has joined #ruby
jgt3 has quit [Ping timeout: 264 seconds]
<Galaxy83>
I will benchmark it later.. But if you had to choose (intuitively/ruby way/user friendliness/whatever) - what would you choose (question to everyone who read the original question)
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[spoiler]>
Galaxy83: probably the second way, but ideally it should be instance + do action
<Galaxy83>
thank you [spoiler]
eGGshke is now known as eGGsha
roxtrong_ has quit [Ping timeout: 246 seconds]
allcentury has quit [Ping timeout: 265 seconds]
<Galaxy83>
that's 3 for second and 0 for first. I think we have a winner. Thanks guys.
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
?guys Galaxy83
<ruboto>
Galaxy83, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
linduxed has joined #ruby
<apeiros>
I better don't make it 3:1 then? :)
jonnie has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
<apeiros>
*iff* it's a method without any params and there's no point in state, then I prefer MyModule.do_stuff!
ferhaty has quit []
<apeiros>
maybe s/iff/if/, not sure.
<avril14th>
good morning, has anyone had success using mongoid 5 gem?
sevenseacat has joined #ruby
havenwood has joined #ruby
jonnie has quit [Ping timeout: 246 seconds]
<Galaxy83>
Let's not make an issue out of it... I'm not a native eng speaker but I've watched enough shows/movies to hear a lot of times that someone was relating to a group of people as "guys" even when there were females/other in that group.
s2013 has joined #ruby
<apeiros>
Galaxy83: we don't make in issue of it. we gently tell you.
<apeiros>
Galaxy83: what you make of it is where it's at
<havenwood>
good mornin'
<apeiros>
moin havenwood
<shevy>
havenwood did you have a coffee yet
<havenwood>
shevy: nope! beware...
jonnie has joined #ruby
auzty has quit [Quit: Leaving]
<havenwood>
shevy: thanks for reminding me, I'll fix that! :D
<shevy>
yeah keep that error rate down with more coffee!
khebbie has joined #ruby
dawkirst has joined #ruby
sarkyniin has joined #ruby
khebbie_ has joined #ruby
charliesome has joined #ruby
majjoha has joined #ruby
kljds has quit [Quit: WeeChat 1.3]
cornerma1 has joined #ruby
meatherly has quit []
juanpablo_ has joined #ruby
khebbie has quit [Ping timeout: 264 seconds]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Soda has quit [Read error: Connection reset by peer]
khebbie_ has quit [Ping timeout: 256 seconds]
khebbie has quit [Remote host closed the connection]
khebbie has joined #ruby
<shevy>
hmm
<shevy>
is open-uri slow?
jxpx777 has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
lkba has quit [Read error: Connection reset by peer]
allcentury has quit [Ping timeout: 240 seconds]
s00pcan has quit [Ping timeout: 244 seconds]
Guest50 has joined #ruby
<oddmunds>
shevy: open-uri seemed almost broken to me last night
<adaedra>
define "slow"
<oddmunds>
but i assumed the error was elsewhere
enebo has quit [Quit: enebo]
codenapp_ has joined #ruby
<shevy>
oddmunds hmm
<oddmunds>
seems to be ok now
<oddmunds>
i think my app is just very brittle
s00pcan has joined #ruby
<shevy>
I guess I may download a big page... since I need only information from the ~middle I should perhaps stop the moment I have the required information rathern than continue to slurp
robh71 has joined #ruby
izzol has joined #ruby
<izzol>
jefus:
<izzol>
ahh sorry.
Voker57 has joined #ruby
<izzol>
I'm looking some good solution for the queue system. I simply want to send some command to the queue and then I want to execute it by some sort of scheduler.
codenapper has quit [Ping timeout: 272 seconds]
<oddmunds>
shevy: should you happen upon a technique that will let you read "files" over internet from the end to start, i would be interested :)
dstarh has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
troulouliou_div2 has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
michael_mbp has quit [Excess Flood]
pyo_ has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
pyo_ has quit [Max SendQ exceeded]
michael_mbp has joined #ruby
psycho_one has joined #ruby
techsethi has quit [Quit: techsethi]
khebbie has quit [Remote host closed the connection]
nhhagen has quit [Remote host closed the connection]
majjoha has quit [Ping timeout: 240 seconds]
nhhagen has joined #ruby
charliesome has joined #ruby
allcentury has joined #ruby
Cust0sLim3n has quit [Ping timeout: 268 seconds]
<shevy>
oddmunds hmm guess the packets are sent first from top to bottom
apt-get_ has joined #ruby
<shevy>
I have two small scripts that feed info on the commandline; the first one tells me the local weather in celsius; the other one returns a number about some gem-statistics... the latter perhaps somewhere has hidden some json data for that... if I could only be bothered to find it, but it's way too hot to code really...
lkba has joined #ruby
skade has joined #ruby
marcoecc has joined #ruby
sarkyniin has quit [Ping timeout: 250 seconds]
nhhagen has quit [Read error: Connection reset by peer]
nhhagen has joined #ruby
<shevy>
I am still happy that I discovered jquery though. I can use ruby to auto-generate the ugly javascript mess, and it works. I am playing "lights on" and "lights off" with images now :)
redmaverick has quit [Remote host closed the connection]
nym has quit [Quit: Connection closed for inactivity]
<oddmunds>
shevy: yeah, i think i should think about the problem differently
<oddmunds>
the thing is that i parse huge CSV i pull off a site
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
futilegames has joined #ruby
leat has joined #ruby
<oddmunds>
instead of having my whole app do everything on each request, i'd rather make something concurrent that keeps busy at sensible internvals and just delivers what data it has upon requests
Iskarlar has joined #ruby
rushed has quit [Quit: rushed]
<shevy>
that's the age of big data
<shevy>
fat CSVs!
futilegames has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 255 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ThaiWood has joined #ruby
robh71 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eGGsha is now known as eGGshke
timanema has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
truenito has joined #ruby
nirjhor has joined #ruby
<oddmunds>
yeah
speaking1ode has joined #ruby
TvL2386 has quit [Ping timeout: 252 seconds]
tvw has joined #ruby
speakingcode has quit [Ping timeout: 264 seconds]
rails528 has quit [Ping timeout: 246 seconds]
benlovell has quit [Ping timeout: 252 seconds]
iamninja has joined #ruby
dawkirst has quit [Ping timeout: 260 seconds]
ndrei has joined #ruby
<jhass>
izzol: sidekiq, resque & delayed_job are the big three
eGGshke is now known as eGGsha
chussenot has joined #ruby
<oddmunds>
shevy: it's a prime candidate to get my elixir fu going
jonnie has left #ruby [#ruby]
rbennacer has joined #ruby
_blizzy_ has quit [Ping timeout: 255 seconds]
decoponio has joined #ruby
<mna>
hi. how to check what's the ruby version installed in my shell account?
<snockerton>
i can use #{} within a string, which lets me include an expression
<snockerton>
maybe i'm thinking about this wrong
havenwood has quit [Ping timeout: 255 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bricker>
snockerton: you can't do it inline with the hash initialization, there's no syntax to support that.
chussenot has quit [Quit: chussenot]
baweaver has quit [Remote host closed the connection]
hanmac has joined #ruby
freerobby has quit [Quit: Leaving.]
JamesPPP has joined #ruby
jackjackdripper has joined #ruby
jacaballero has quit [Read error: Connection reset by peer]
christiandsg has joined #ruby
jacaballero has joined #ruby
kinduff has joined #ruby
freerobby has joined #ruby
dfinninger has joined #ruby
cantaberry has quit [Ping timeout: 244 seconds]
kinduff has quit [Max SendQ exceeded]
cantaberry has joined #ruby
havenwood has joined #ruby
rakm has joined #ruby
bronson has quit [Remote host closed the connection]
demonlove has joined #ruby
<scpike>
What's the best way to call a ruby script with a specific gemset / rvm managed ruby version? I've got `BUNDLE_GEMFILE=/path/to/Gemfile bundle exec ruby /path/to/script.rb` in a bunch of places right now.
<scpike>
script.rb is in a subfolder of the folder with Gemfile in it, if that helps
<bougyman>
i just rvm use 2.x.x@gemset-name in the shell
wldcordeiro__ has quit [Quit: Leaving because reasons...]
lea has quit [Ping timeout: 252 seconds]
<scpike>
bougyman: but won't it look for a Gemfile relative to where I'm calling the script from, not the script itself?
jenrzzz has quit [Ping timeout: 246 seconds]
<bougyman>
depends. I also cd into the tree and make it my CWD, usually.
<bougyman>
otherwise I make a bin/run.sh which does all of this for me and just call that
<bougyman>
bundler and rvm will make such wrappers for you, too, but I make my own for more flexibility and CI fiddling, most times.
<apeiros>
scpike: I think that's what rvm's wrappers are there for
rehat_ has quit [Read error: Connection reset by peer]
<scpike>
Hmm, I'm trying to come up with a solution where I can have ruby scripts I can invoke from anywhere (put the folder in PATH) that use a Gemfile
<bougyman>
yes, what apeiros said.
<bougyman>
scpike: and that's what mine do.
dseitz has joined #ruby
<bougyman>
using the run.sh wrapper I include in the projects.
<scpike>
bougyman: could I #! the run.sh wrapper somehow?
<bougyman>
so my ci can mindlessly always run projectname/bin/run.sh rake and expect it to do everything necessary to run tests.
kidmillions has joined #ruby
suchness has quit [Remote host closed the connection]
user1138 has joined #ruby
anandubajith has quit [Quit: Connection closed for inactivity]
<scpike>
The cwd trick messes some things up though, like if the script tries to output to a relative path
<bougyman>
not necessarily
freerobby has quit [Quit: Leaving.]
kidmillions has quit [Client Quit]
<bougyman>
my deployments symlnk things like PROJECTROOT/config and PROJECTROOT/log to avoid some of those issues.
wldcordeiro__ has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
apt-get_ has quit [Read error: No route to host]
<bougyman>
there's tradeoffs with allowing it to run outside the projectroot.
RobertBirnie has joined #ruby
rideh has quit [Remote host closed the connection]
rideh has joined #ruby
sarkyniin has joined #ruby
kidmillions has joined #ruby
<scpike>
bougyman: I think my use case is a little different. It's not one ruby project being deployed somewhere; I have a tree full of standalone CLI tools, but they use libraries in a single Gemfile
<bougyman>
you could export that BUNDLE_GEMFILE and put an rvm use in your scripts and be just fine in any cwd
hessparker has quit [Read error: Connection reset by peer]
stamina has joined #ruby
<scpike>
oh that's a great idea, let me play with that
uri_ has joined #ruby
hessparker has joined #ruby
baweaver has joined #ruby
<baweaver>
snockerton: hash.reject
workmad3 has quit [Ping timeout: 246 seconds]
hessparker has left #ruby [#ruby]
nertzy has quit [Quit: This computer has gone to sleep]
hahuang65 has quit [Ping timeout: 244 seconds]
victortyau has joined #ruby
pandaant has joined #ruby
chipotle has joined #ruby
dgutierrez1287 has joined #ruby
hmnhf__ has quit [Ping timeout: 250 seconds]
<scpike>
bougyman: it works! thanks so much
messysaurus has quit [Read error: Connection reset by peer]
jacaballero has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruurd has quit [Quit: ZZZzzz…]
rbennacer has quit [Remote host closed the connection]
dgutierrez1287 has quit [Ping timeout: 268 seconds]
rbennacer has joined #ruby
diegoaguilar has joined #ruby
dgutierrez1287 has joined #ruby
<snockerton>
how do i merge two arrays of hashes with the same key names?
kies has joined #ruby
<hanmac>
snockerton: use inject or each_with_object
codecop has quit [Remote host closed the connection]
meatherly has quit []
lea has joined #ruby
<snockerton>
all i can get is the 2nd array nested as a new object in the first array
vF3hNGxc47h8 has joined #ruby
rushed has joined #ruby
<apeiros>
?example snockerton
<ruboto>
snockerton, Please provide us with an example of valid input for your problem, the output that you're getting, and the output that you were expecting.
<hanmac>
snockerton: show us sample data and what your output do you want from it
hahuang65 has joined #ruby
autrilla has quit [Quit: Connection closed for inactivity]
<dman777_alter>
javsascript has a way I can use a object to get a property of a object... such as session[request.method](do something). does ruby have a way that is similar?
<shevy>
dman777_alter is it a method call in javascript?
hahuang65 has quit [Ping timeout: 244 seconds]
moeabdol has quit [Ping timeout: 265 seconds]
<dman777_alter>
shevy: no
<jhass>
dman777_alter: do you look for public_send?
<dman777_alter>
it's just a plug it in
Cust0sLim3n has quit [Read error: Connection reset by peer]
<jhass>
(do not pass unvalidated userinput into it)
<luckyruby>
Would love to see a second argument to Array#join that let's you specify a wrapper.
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 246 seconds]
JoshGlzBrk has joined #ruby
riotjones has joined #ruby
<apeiros>
dman777_alter: since ruby does not have properties, there's no direct equivalent. you can call methods using Object#public_send
davejlong has joined #ruby
mhib has quit [Quit: Leaving]
<dman777_alter>
hmm... so if request.method is "get".... how could I use it to do session.get()?
<apeiros>
session.public_send(request.method)
messysaurus has quit [Read error: Connection reset by peer]
davejlong has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 264 seconds]
neanias has quit [Excess Flood]
neanias has joined #ruby
davejlong has joined #ruby
sshuff|gone has left #ruby [#ruby]
umgrosscol has joined #ruby
messy has quit [Read error: Connection reset by peer]
messysaurus has joined #ruby
robbyoconnor has joined #ruby
michael_mbp has quit [Excess Flood]
dgutierrez1287 has joined #ruby
iamninja has joined #ruby
towski_ has joined #ruby
minimuffins has joined #ruby
psycho_one has joined #ruby
choke has joined #ruby
thang has joined #ruby
s00pcan has joined #ruby
al2o3-cr has joined #ruby
retornam has joined #ruby
miliarch has joined #ruby
rmrrn has joined #ruby
rehat has joined #ruby
rikai has joined #ruby
xxneolithicxx has joined #ruby
mburns has joined #ruby
wedgwood has joined #ruby
atomical has joined #ruby
hawkface has joined #ruby
AnoHito has joined #ruby
kappy has joined #ruby
jbw has joined #ruby
monsieurp has joined #ruby
phreakocious has joined #ruby
pleiosaur has joined #ruby
jtdowney has joined #ruby
martinbjeldbak has joined #ruby
Adran has joined #ruby
adamholt has joined #ruby
ByronJohnson has joined #ruby
tchebb has joined #ruby
Aria has joined #ruby
nickjj has joined #ruby
irk has joined #ruby
jinie has joined #ruby
rdark has joined #ruby
dogeuira has joined #ruby
Coraline has joined #ruby
sarid has joined #ruby
rhg135 has joined #ruby
camilasan has joined #ruby
sn0wb1rd has joined #ruby
olblak has joined #ruby
robbyoconnor has quit [Client Quit]
sarid has quit [Max SendQ exceeded]
ivanskie has joined #ruby
sarid has joined #ruby
sarid has quit [Changing host]
sarid has joined #ruby
sshuff has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
mary5030 has joined #ruby
truenito has quit [Quit: truenito]
illbyte has quit [Quit: Connection closed for inactivity]
Quandl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has quit [Ping timeout: 246 seconds]
solocshaw has joined #ruby
michael_mbp has joined #ruby
David27 has joined #ruby
luckyruby has quit [Quit: Leaving...]
kinduff has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
centrx has joined #ruby
meatherly has joined #ruby
nerium has joined #ruby
googya has quit [Quit: Leaving.]
<nerium>
Any one knows a good way to parse/extract text from a document in plain text (without using regexp)? I need a less error prone way to parse the data
googya has joined #ruby
kidmillions has joined #ruby
SolarSailor has quit [Quit: My Turing machine has gone to sleep. ZZZzzz…]
jacaballero has quit [Read error: Connection reset by peer]
demonlove has quit [Remote host closed the connection]
jacaballero has joined #ruby
rikai has quit [Ping timeout: 255 seconds]
<jhass>
well, that's highly contextual on the data
toretore has quit [Quit: This computer has gone to sleep]
<baweaver>
Short of writing your own lexer/parser
<eam>
most of which use regexes anyway
<jhass>
There's also things like StringScanner
<atmosx>
nerium: just give a simple to the guys at #regex they'll work the rest out. You could also use 'rubular', but generally speaking if the data is complex, you need regex.
<shevy>
oh is it create-your-language time again
<shevy>
nerium one poor man's variant may be to use .each and extract on a per-line basis if you don't use a regex
<nerium>
I’m currently using regexp, but its impossible to debug
<nerium>
I’ll give an example
<shevy>
you can combine the regex with non-regex code to make it more robust
<shevy>
I hate the votality of $1 for instance
<eam>
nerium: have you ever looked at how a parser works?
<shevy>
erm *volatility
<nerium>
eam: Yeah. I took a programming language course during my last semester so I know the basics
<eam>
so, you can break up your patterns into small units
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
michael_mbp has quit [Excess Flood]
<My_Hearing>
Show us the input and how you want to break it up
My_Hearing is now known as Mon_Ouie
arup_r has joined #ruby
<nerium>
In short: I’m trying to parse an SAT like test. There are al kind of different questions and set ups
JamesPPP has joined #ruby
<nerium>
Regexp works but is impossible to debug and maintain. I’m looking for a better wat
<nerium>
*way
benlovell has joined #ruby
allcentury has joined #ruby
<jhass>
it seems like you try to write a single regex for all cases
Queeniebee has joined #ruby
<nerium>
I’m not looking for a solution to my problem, just the correct tools
<Mon_Ouie>
Well, using StringScanner in combinations with regexps is a way that way mentioned already
<baweaver>
Example input / example output?
<nerium>
Mon_Ouie: aha, missed that
<jhass>
use ^ to split up into smaller chunks (like each question answer block), detect type, parse accordingly
<nerium>
There’s a lot of problems here. One is that the questions are stored in a pdf. In plain text everyting *might be* on one line
<baweaver>
Split the text on /^\d+\./ to get your number blocks
<nerium>
baweaver: ^
Pilate has joined #ruby
<nerium>
^ wont work
<Pilate>
?guys
<ruboto>
Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<baweaver>
!mute Pilate
Pilate has left #ruby [#ruby]
<baweaver>
anyways
<nerium>
baweaver: So the number 11. in this case might not be on it’s own row
<baweaver>
!ban Pilate
fantazo has quit [Quit: Verlassend]
<baweaver>
!ban Pilate !T 1d troll be gone
<ruboto>
baweaver, could not find a matching user for "Pilate"
<baweaver>
aw, fine.
<baweaver>
danke
workmad3 has quit [Ping timeout: 256 seconds]
<baweaver>
Do you have an example of the plaintext rip?
benlovell has quit [Ping timeout: 250 seconds]
<nerium>
baweaver: I can create one, hold on
<baweaver>
probably the best bet is to try and get some consistency there.
<nerium>
baweaver: ”123. This is a question A Option One B Option two C Danke D Nope"
<baweaver>
Fun part is what happens when there's more than one A, B, C, or D?
nettoweb has joined #ruby
<nerium>
baweaver: There’s is allways A-D and there might be a E
<baweaver>
If you can guarantee punctuation on the end of the question you have some leverage
<baweaver>
No, I mean what if the question starts as "A person..."
<nerium>
baweaver: I can’t :)
<nerium>
The question always starts with a \d+\.
jeadre has quit [Remote host closed the connection]
<atmosx>
so 'everyone' is okay?
<jhass>
sure
<nerium>
atmosx: I’m not following
<nerium>
Or are you talking with someone else?
benlovell has joined #ruby
<atmosx>
nerium: I was talking to jhass actually, I don't think any other operator is alive. There was an ongoing discussion about the use of the word 'guys' on github.. so...
<atmosx>
anyway
<atmosx>
I'm off to bed, night
<nerium>
atmosx: Hehe, okay
jeadre has joined #ruby
arup_r has quit [Remote host closed the connection]
<baweaver>
Yeah, that'll be interesting.
<miah>
'everyone' is all encompassing, so of course its ok.
Usaur has quit [Quit: Leaving]
rubie has joined #ruby
freerobby has joined #ruby
rakm has joined #ruby
benlovell has quit [Ping timeout: 250 seconds]
DLSteve has joined #ruby
blue_deref has quit [Quit: Taking myself out of hear.]
jds has quit [Quit: Connection closed for inactivity]
davejlong has quit [Remote host closed the connection]
<nerium>
baweaver: I’ve a plan.
messysaurus has quit [Remote host closed the connection]
kidmillions has quit [Ping timeout: 265 seconds]
bronson has joined #ruby
Mendenhall has joined #ruby
<nerium>
baweaver: How about spliting the questions into blocks of questions/options
michael_mbp has quit [Excess Flood]
<nerium>
and then run a smaller regexp on this block?
<baweaver>
If possible, but if the text option has nothing to hook off of it's risky.
<nerium>
baweaver: Why not just match between 1. and 2.
<nerium>
and then 2. and 3.
modern has quit []
michael_mbp has joined #ruby
<baweaver>
1. A person does this A Option
<baweaver>
splitting options was what I was more worried on
kidmillions has joined #ruby
radgeRayden_ has joined #ruby
<nerium>
baweaver: Given that you have the questions/options as one block?
c1v0 has joined #ruby
nertzy has joined #ruby
<baweaver>
Yep.
<baweaver>
see that example above
<nerium>
How about starting from the back. Match Everything from ”E” to the end
<baweaver>
how do you know which A to tag as an option?
bootstrappm has joined #ruby
<nerium>
Remove it, then ”D"
<baweaver>
What if an option has a cap?
axl_ has quit [Quit: axl_]
<nerium>
baweaver: You don't
bootstrappm has left #ruby [#ruby]
ghr has joined #ruby
<baweaver>
then reverse would be safe.
roxtrong_ has quit [Ping timeout: 250 seconds]
scripore has joined #ruby
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nerium>
baweaver: Exactly
<nerium>
baweaver: This is good
scripore has quit [Remote host closed the connection]
dopie has joined #ruby
jeadre has quit [Remote host closed the connection]
roxtrongo has joined #ruby
scripore has joined #ruby
<baweaver>
>> 'A option B option C option D option'.reverse.split(/[ABCD]/).map { |s| s.strip.reverse }
<stef1a>
what's the difference between these two snippets of code? s.bids.each { |b| include = true and break if b.quarter == quarter } and s.bids.each { |b| include = true && break if b.quarter == quarter }
<stef1a>
How would the distinction between `and` and `??` be relevant here?
scripore has quit [Client Quit]
<stef1a>
I've read that `and` has higher precedence, but I don't know how that would affect this code.
last_staff has quit [Ping timeout: 265 seconds]
scripore has joined #ruby
<baweaver>
best to avoid the english version in most cases.
mrtomme has quit [Ping timeout: 264 seconds]
<stef1a>
baweaver: why? in this case, the English version does what i want, and the symbolic version does not
Silox| has quit [Quit: Connection closed for inactivity]
kirun has quit [Remote host closed the connection]
<naftilos76>
Hi, i am using ruby 2.2 . Is there a way to detect whether a file is being read? I basically want to delete a file after the read access from another source ceases.
dawkirst has joined #ruby
michael_mbp has joined #ruby
chichou has joined #ruby
<slash_nick>
naftilos76: can you send a signal when the read ceases? then delete when the signal is received?
<baweaver>
The other way will be faster
opensource_ninja has joined #ruby
<naftilos76>
slash_nick, i want to delete a zip file after it is downloaded in rails
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoaguilar has quit [Ping timeout: 244 seconds]
<naftilos76>
after it i downloaded through the send_file method
<baweaver>
either way have to get back to some work.
diegoaguilar has joined #ruby
zendrix has quit []
<slash_nick>
naftilos76: so (pseudocode) send_file(file); send_the_send_file_finished_signal... you can do it pub-subbishly using ActiveSupport::Notifications
<nerium>
baweaver: Performence is not really a problem as it’s used in an admin panel. The code you posted had some smaller buggs
DoubleMalt has quit [Remote host closed the connection]
roxtrongo has quit [Ping timeout: 252 seconds]
<naftilos76>
slash_nick, let me see send_file in rails api
majjoha has joined #ruby
dawkirst has quit [Ping timeout: 246 seconds]
<slash_nick>
naftilos76: looking now... but we should move this conversation to #rubyonrails
<naftilos76>
slash_nick, sure
nhhagen has quit [Ping timeout: 255 seconds]
rdark has quit [Ping timeout: 255 seconds]
mary5030 has quit [Ping timeout: 256 seconds]
nhhagen has joined #ruby
skade has joined #ruby
roxtrongo has joined #ruby
_djbkd has quit [Remote host closed the connection]
jeadre has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
dfinninger has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
scripore has joined #ruby
jordanloky has joined #ruby
majjoha has quit [Ping timeout: 260 seconds]
jeadre has joined #ruby
_djbkd has joined #ruby
chichou_ has joined #ruby
chipotle has quit [Remote host closed the connection]
jordanloky has quit [Read error: Connection reset by peer]
vdamewood has quit [Quit: Life beckons.]
baweaver has quit [Remote host closed the connection]
wldcordeiro__ has quit [Quit: Leaving because reasons...]
freerobby has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<nerium>
Mon_Ouie: Nice, i’ll give it a try
mary5030 has quit [Remote host closed the connection]
TeresaP has joined #ruby
<nerium>
Mon_Ouie: Any idea how to split the questions into parts?
<TeresaP>
OT: Did web chat.freenode.net get an upgrade?
<nerium>
Mon_Ouie: Like this one data = "This is stuff 1. Number one 2. Number two 5. End of line"
nettoweb has joined #ruby
<nerium>
Mon_Ouie: Output: [”Number one”, Number two”, ”End of line”]
wldcordeiro__ has joined #ruby
<nerium>
Mon_Ouie: I tried using data.scan(/\d+\.\s+(.+?)(?=\d+\.\s+)/m).to_a, but the output isn’t correct
<jhass>
?ot TeresaP ;)
<ruboto>
TeresaP, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
iamninja has quit [Read error: Connection reset by peer]
<TeresaP>
I said "OT" but didn't realize there was an off-topic changel
<Mon_Ouie>
Same idea as for splitting questions and answers, but with / (\d+)\. / as a regexp?
<TeresaP>
thanks
iamninja has joined #ruby
shadoi has joined #ruby
syath has quit [Quit: WeeChat 1.2]
<nerium>
Mon_Ouie: The problem is that the numbers arn’t in order
yfeldblum has quit [Ping timeout: 246 seconds]
baweaver has joined #ruby
havenwood has joined #ruby
beefcakeba has joined #ruby
<Mon_Ouie>
You can grab the number with the capture group (scanner[1]), put them in a hash of idx => option and then collect them in order in an array
<nerium>
Mon_Ouie: Can I use then for anything? I mean, I might just have extracted #1, that doesn’t mean that #2 is next
bstrrm has quit [Ping timeout: 244 seconds]
<Mon_Ouie>
/ (\d+)\. / is going to match no matter what number is next
kristian_on_linu has joined #ruby
<kristian_on_linu>
hi
<kristian_on_linu>
Could not find 'listen' (~> 2.7) - did find: [listen-3.0.3] (Gem::LoadError)
<kristian_on_linu>
this means that I have the gem, but too new a version ... eh?
scripore has quit [Quit: This computer has gone to sleep]
David27 has quit [Read error: Connection reset by peer]
<adaedra>
but bundle should install the right version
dzejms has joined #ruby
mjuszczak has joined #ruby
<kristian_on_linu>
hurm
<adaedra>
you don't run bundle under sudo, right?
<kristian_on_linu>
no
<kristian_on_linu>
I usually just gem install stuff
badfish129 has joined #ruby
<kristian_on_linu>
but I think I have rvm
<adaedra>
gem install will pickup the last version if you don't give specifications on the version
<Mon_Ouie>
You have to skip the "This is a stuff" part before you can use the scan loop
<badfish129>
anyone can help with mocha, how would I mock a method that returns nothing but changes one of its arguments
<Mon_Ouie>
e.g. with scan_until
<Mon_Ouie>
(scan matches at the beginning of the remaining string)
Majost__ has joined #ruby
<nerium>
Mon_Ouie: Got an example? :/
<Mon_Ouie>
x = "before 1. after"; before = scanner.scan_until(/(?= \d\. )/); while …
<Majost__>
Can someone explain this to me: /(.\d\.\d.\d|.\d\.\d)/.match('1.0') => nil
wldcordeiro__ has quit [Quit: Leaving because reasons...]
<Majost__>
It matches 10.0 and 10.0.0 correctly though... is anything < 10 not concidered a digit or something?
<shevy>
the | there I think
<shevy>
it should be or
<Mon_Ouie>
Well it doesn't match because the first pattern (before the '|' is any character, followed by a digit, followed by a dot, followed by a digit, followed by any character, followed by a digit
<nofxx>
Majost__, 10 is not 1 digit
yfeldblum has joined #ruby
<nofxx>
2 digits, \d+
<nofxx>
or \d{2,}
<Mon_Ouie>
Second one is any character followed by a digit followed by a dot, followed by a digit.
<nofxx>
ops, \d{1,}
<jhass>
{1,} is +
<nofxx>
jhass, yup
<Majost__>
ah
<Majost__>
\d+ fixed it
<Majost__>
thanks
wldcordeiro__ has joined #ruby
<nofxx>
jhass, was going to say about {1,x} later
riotjones has joined #ruby
<nofxx>
Majost__, if you know how many digits
shadoi has quit [Quit: Leaving.]
chipotle has joined #ruby
sts has joined #ruby
modern has quit [Ping timeout: 272 seconds]
<sts>
hello folks. I found a gem once which made it easy to align text properly, forgot about its name tho. Any ideas?
pawnbox has quit [Remote host closed the connection]
nhhagen has quit [Remote host closed the connection]
<ruboto>
kristian_on_linu, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
dzejms has quit [Remote host closed the connection]
<shevy>
neither
AlphaAtom has quit [Client Quit]
<shevy>
install a gem :)
<shevy>
I use require to load some local .rb file
<shevy>
require_relative is so long to type
<dfockler>
I don't want it to be a gem
meatherly has quit []
messysaurus has joined #ruby
centrx has joined #ruby
dgutierrez1287 has quit [Ping timeout: 264 seconds]
<baweaver>
everything is a gem
<baweaver>
_everything_
<dfockler>
haha
<dfockler>
I thought everything was an Object
<baweaver>
Object is a gem
<baweaver>
\o/
<dfockler>
haha
kinduff has quit []
<baweaver>
(not really, just being cheeky by now)
<baweaver>
well, rubinius
michael_mbp has joined #ruby
Jackneill has quit [Ping timeout: 268 seconds]
<banisterfiend>
baweaver sup weave-dogg
<baweaver>
alo
yashinbasement has joined #ruby
<banisterfiend>
sup
erts has joined #ruby
<baweaver>
waiting for pull requests to get done.
<shevy>
pull that dam already!
eightfold has quit [Quit: eightfold]
jgpawletko has joined #ruby
ghr has quit [Read error: No route to host]
tmtwd has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
ghr has joined #ruby
luksaur has quit [Ping timeout: 250 seconds]
renodice has joined #ruby
freerobby has joined #ruby
freerobby has quit [Client Quit]
michael_mbp has quit [Excess Flood]
quazimodo has quit [Ping timeout: 246 seconds]
mleung has joined #ruby
ghr has quit [Ping timeout: 268 seconds]
rubie has quit [Remote host closed the connection]
Respek has quit [Quit: gone to sleep. ZZZzzz…]
rubie has joined #ruby
Oka has joined #ruby
dfockler has quit [Remote host closed the connection]
michael_mbp has joined #ruby
Jardayn has quit [Quit: Leaving]
ruby-lang494 has joined #ruby
A_ron has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Sou|cutter>
I'm finding myself writing interfaces that lean heavily on #call lately. I can't tell if this is a good or bad thing yet :/
PenguinMan98 has quit [Ping timeout: 246 seconds]
ledestin has joined #ruby
quazimodo has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
davedev24 has joined #ruby
robbyoconnor has joined #ruby
renodice has left #ruby ["Silentium est aureum"]
dfockler has joined #ruby
lxsameer has quit [Remote host closed the connection]
<shevy>
do you know what is going on?
barhum2013 has joined #ruby
renodice has joined #ruby
ruby-lang494 has quit [Ping timeout: 246 seconds]
<centrx>
shevy, WHAT IS GOING ON!?!?
tuxero has quit [Ping timeout: 265 seconds]
umgrosscol has quit [Remote host closed the connection]
robbyoconnor has quit [Client Quit]
Voker57 has quit [Remote host closed the connection]
PenguinMan98 has joined #ruby
<shevy>
I mean the #call-able interfaces
iamninja has quit [Ping timeout: 264 seconds]
<banisterfiend>
Sou|cutter soon you'll be writing pure functions :)
<banisterfiend>
i mean if your objects are small enough to have one method as their public interface you'll probably go whole-hog and just have single functions altogether, then you'll be blogging about haskell and monads soon enough..
tmtwd has joined #ruby
renodice has left #ruby [#ruby]
alejandrok5 has quit [Read error: No route to host]
alejandrok5 has joined #ruby
* baweaver
hides monad tutorial slowly
* Sou|cutter
nods sadly
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
nertzy has quit [Quit: This computer has gone to sleep]
messysaurus has quit [Ping timeout: 240 seconds]
mjuszczak has joined #ruby
mleung has quit [Quit: mleung]
chipotle has quit [Quit: cheerio]
<aep>
hm, rand() is too random for me. i wonder if there is a form of 'random' that is biased towards even distribution
<Sou|cutter>
I'm really curious why anyone would ever use .() on a #call-able
mleung has joined #ruby
michael_mbp has quit [Excess Flood]
<banisterfiend>
Sou|cutter in the case of lambdas it's just cos it looks more like () i guess
<banisterfiend>
which ruby doesnt allow for various reasons
Yzguy has joined #ruby
mleung has quit [Client Quit]
<Sou|cutter>
it looks so janky
<centrx>
aep, I thought rand already used a uniform distribution?
<Sou|cutter>
banisterfiend: probably true
<banisterfiend>
Sou|cutter if you're writing something full of lambdas like the y-combinator, it can look a little neater
<banisterfiend>
though still pretty janky yeah
<banisterfiend>
but a lil nicer than #call everywhere imo
ghr has joined #ruby
<aep>
centrx: probably, but i need more. i'm using it for a binary choice and it just returned 10 times true in a row. humans will think its broken
<zenspider>
I'd honestly rather use call than .()
<zenspider>
but I'll stick to []
<zenspider>
mmm... no, apparently I use .call a fair amount too
<zenspider>
maletor: I don't think I understand your question
<centrx>
aep, that gives you a randomly sorted array of the numbers 1 through 10
mprelude has quit [Ping timeout: 246 seconds]
<zenspider>
maletor: round returns a new value, and an integer... so...
<Sou|cutter>
banisterfiend: I like(d) Jim a lot, but I think we have different aesthetic tastes
<aep>
centrx: i dont understand how thats less random
<centrx>
aep, each number appears only once. So figure out what the actual parameters of your randomness are. The same number appearing ten times in a row is unlikely, it's not going to happen to a lot of people, maybe no one else
<aep>
aah!
<aep>
unfortunatly i have true/false. but the idea was good
<Sou|cutter>
or he's just challenging me, and my subconscious doesn't like that ;)
<zenspider>
aep: (1..10).to_a is about as less random as you'll get
chouhoulis has quit [Remote host closed the connection]
<zenspider>
Sou|cutter: I don't think that talk was representative of his normal style. IIRC, he says something to that effect at the start
<maletor>
zenspider: i think it's because round has a ceiling of ~16
gamename has quit [Remote host closed the connection]
<maletor>
if it were any more than the float couldn't be trusted to be accurate
<zenspider>
not to say that I don't disagree with many of his design choices
maletor_ has joined #ruby
<maletor>
zenspider: which is a practical limit of floats in the first place
<aep>
actually this is exactly what i need (([true]*5)+([false]*5)).to_a.shuffle thanks centrx
wldcordeiro__ has quit [Ping timeout: 250 seconds]
<Sou|cutter>
yea
<zenspider>
maletor: again, I'm not sure what you're asking. afaik, ruby implements ieee754 directly. Refer to that document
nahtnam has joined #ruby
<banisterfiend>
zenspider "not" to say that i "dont" "dis"agree, for someone who doesnt even liek to use "unless" in ruby that hurt my tiny pigeon brain :)
* centrx
hopes aep is not writing the next version of OpenSSL
<zenspider>
banisterfiend: jim didn't use unless?
<banisterfiend>
zenspider i was just referring to your use of negatives in that sentence :)
<banisterfiend>
not, dont, disagree
<banisterfiend>
could also be because it's nearly 1am and i'm drunk though..
<aep>
centrx: hehe. nah, its a coin toss. and humans get frustrated when it 'feels' not random