pepperbreath1 has quit [Ping timeout: 272 seconds]
lwu has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
pepperbreath has joined #ruby
paulcsmith has joined #ruby
millerti has quit [Read error: Connection reset by peer]
choke has joined #ruby
Kallis has joined #ruby
mistermocha has joined #ruby
deject3d has joined #ruby
paulcsmith has quit [Ping timeout: 246 seconds]
choke has quit [Client Quit]
<nofxx>
What's the nice way to add a dev lib folder to load path? bin/foo will require 'foo' from the gems, force it in dev mode to require '../lib/foo'
<nofxx>
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) solves but its ugly change the bin =/
nngrey has joined #ruby
choke has joined #ruby
mistermocha has quit [Ping timeout: 252 seconds]
mary5030 has joined #ruby
arooni-mobile has joined #ruby
choke has quit [Client Quit]
nngrey has quit [Remote host closed the connection]
arooni-mobile__ has joined #ruby
h4ckurate has quit [Quit: h4ckurate]
choke has joined #ruby
<shevy>
I usually define the path to the gem-directory
<havenwood>
sarmiena_: Do you need to be able to switch Rubies?
hotpancakes has quit [Remote host closed the connection]
<sarmiena_>
havenwood: yeah i do need to switch rubies
<havenwood>
Only MRI?
<havenwood>
sarmiena_: Production or development?
<nofxx>
sarmiena_, between versions?
<sarmiena_>
yeah.
einarj has quit [Remote host closed the connection]
<Ox0dea>
ya all dat plz halp
<nofxx>
sarmiena_, out of curiosity, why?
<nofxx>
really old rails projects? =D
doritostains has joined #ruby
<sarmiena_>
havenwood: so you’re saying this that it shoudn’t matter that —autolibs is used vs not used. it would either say binary isn’t there, or it is there?
Liam` has quit [Ping timeout: 244 seconds]
<Ox0dea>
sarmiena_: Why RVM?
<havenwood>
sarmiena_: The precompiled binaries for 2.2.2 haven't been uploaded yet. They have been for 2.2.1.
<sarmiena_>
nofxx: before we upgrade ruby, we like to install version & gemset. allows for easy rollback in event of something we hadn’t considered
<havenwood>
sarmiena_: If you want to compile and not use the precompiled binary: --disable-binary
<havenwood>
which is what happens anyways
<nofxx>
sarmiena_, I'd say use a CI for that.
<nofxx>
we are cheap bastards here, and their are very expensive either way, so it's running inside, in an relative old i7 we got
<nofxx>
gitlab-ci* btw
ramfjord has joined #ruby
deject3d has quit [Quit: Computer has gone to sleep.]
devoldmx has joined #ruby
<sarmiena_>
i see
deject3d has joined #ruby
<nofxx>
sarmiena_, that way neither dev or production needs to worry with rvm
PhantomSpank has quit []
h4ckurate has joined #ruby
Kallis has quit [Read error: Connection reset by peer]
Encapsulation has joined #ruby
chouhoulis has joined #ruby
deject3d has quit [Client Quit]
devoldmx has quit [Ping timeout: 250 seconds]
mdavid613 has quit [Quit: Leaving.]
bruno-_ has quit [Ping timeout: 250 seconds]
Cronon has quit [Read error: Connection reset by peer]
Liam` has joined #ruby
Cronon has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
neurotech has joined #ruby
<neurotech>
Hi! I'm coming back to Ruby after spending some time learning some other languages and wanted to know if rbenv is still the best way to work with multiple ruby versions?
zanloy has quit [Ping timeout: 240 seconds]
<wmoxam>
neurotech: it's certainly a popular and well supported way to do it
<havenwood>
neurotech: chruby is a very nice alternative
hotpancakes has joined #ruby
<neurotech>
Ah neat. Thanks
chouhoulis has joined #ruby
mary5030 has quit [Remote host closed the connection]
arooni-mobile has quit [Ping timeout: 246 seconds]
j75 has joined #ruby
mary5030 has joined #ruby
arooni-mobile__ has quit [Ping timeout: 244 seconds]
deject3d has joined #ruby
malnek has quit [Quit: WeeChat 1.1.1]
j3r0 has joined #ruby
djbkd has quit [Quit: Leaving...]
shock_one has joined #ruby
<j75>
If i am using a function alias in .bashrc like f() { #!/usr/bin/env ruby <<-EORUBY [ruby code here] EORUBY } how can I call variables such as $1? That way when I run 'f param1' I can have my function read param1
mary5030 has quit [Ping timeout: 244 seconds]
<Ox0dea>
But... why?
<j75>
just curious how it can be done
<Ox0dea>
j75: Do you just not know about Ruby's -e flag?
<j75>
yes but and -a
<j75>
but i can't seem to get them to pick it up in my .bashrc function
<Ox0dea>
I'm afraid I don't follow.
shock_on_ has joined #ruby
basmoura has quit [Remote host closed the connection]
<Ox0dea>
j75: <<-'EORUBY' ... EORUBY, if you really must.
shock_on_ has quit [Remote host closed the connection]
<j75>
.bashrc allows for functions: f() {echo $1} when you run 'f test' from the terminal it will then just output test.
<j75>
how do i get <<- 'EORUBY' ... EORUBY to access arguments like $1
<Ox0dea>
j75: ARGV?
<j75>
doesn't seem to want to read it
deepu has joined #ruby
shock_one has quit [Ping timeout: 240 seconds]
<j75>
it puts a size of 0
<j75>
it's not actually getting the arguments
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<j75>
I tried /usr/bin/env ruby <<-EORUBYputs ARGV.sizeputs ARGV.classEORUBY}
deepu has quit [Client Quit]
tennis_ has quit []
<shevy>
can this work? ARGV is only available within a .rb file isn't it?
saddad has quit [Ping timeout: 246 seconds]
jester13 has joined #ruby
<shevy>
could you not invoke a ruby script directly by the way, from bash? and just pass it the arguments?
j3r0 has quit [Ping timeout: 246 seconds]
<Ox0dea>
j75: Perhaps you might explain why you think you need to do it this way?
sarkyniin has quit [Ping timeout: 250 seconds]
j3r0 has joined #ruby
<j75>
It's not entirely necessary just wondering how I could keep my .bashrc file from having to look at external files to run a short ruby script
<Ox0dea>
But... why? :'(
<j75>
to easily move .bashrc between setups without having to remember where different files are that's all
<Ox0dea>
loop { case socket.gets; when foo; end } to turn them into "servers". :P
Synthead has joined #ruby
jasonbeale has quit [Remote host closed the connection]
casadei_ has joined #ruby
<hyy>
how do I write a guide for myself to learn Ruby well enough for my router to boot this little program?
<hyy>
or receive this file
<shevy>
just create a class that does the functionality you require
<hyy>
TFTPSender
h4ckurate has quit [Quit: h4ckurate]
dorei has quit []
<hyy>
TFTPFileSender sends a single file to a specified host then it crumples itself destroying the server connection and recording how many bytes were transferred
<shevy>
Ox0dea lol I just realized the title you used in the shell script... retarded.sh
omegamike has quit [Ping timeout: 245 seconds]
<Ox0dea>
Si vicium in calceus.
<hyy>
I'd laugh if you guys pointed me to a learning resource
<Ox0dea>
shevy: There's a typo in [k-'s docfix. :/
<shevy>
lol
<shevy>
I COULD FIX THAT
<neurotech>
Ox0dea: The culture, the community, stuff happening etc
<sarmiena_>
ok so using brightbox now. can’t seem to switch the ruby version using ruby-switch. keeps pointing to 1.9.3 (the system install) when using ruby -v
<cscheib>
installing xcode installs the tools (these days)
<cscheib>
you can either install just the tools or all of xcode
<cscheib>
which xcode-select --install gets you
<cscheib>
I seem to remember reading somewhere that some libraries may be in different places on 10.11 beta 4, but I can't find that article again
spacemud has joined #ruby
<cscheib>
(of note: this is a system that was on non-beta before, and everything was working fine and dandy)
tkuchiki has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
dtcristo has joined #ruby
h4ckurate has joined #ruby
CatMartyn has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
The_Phoenix has joined #ruby
<cscheib>
I'll probably just move back to 10.10 tomorrow
<Ox0dea>
Downgrading is for quitters.
saddad has quit [Ping timeout: 260 seconds]
* [k-
downgrades [k-
bmurt has joined #ruby
<cscheib>
agreed... but, I use boxen to configure my dev environment on my laptop, and I'd rather not manually configure everything.
darkf has joined #ruby
<[k->
^
gix has quit [Ping timeout: 244 seconds]
<[k->
configuring is for people who like challenges!
stoodfarback has joined #ruby
<[k->
i prefer everything to be done for me
<shevy>
[k-
braincrash has quit [Quit: bye bye]
<[k->
PONG: [k-
dseitz has joined #ruby
<shevy>
Ox0dea> shevy: There's a typo in [k-'s docfix. :/
<shevy>
if I fix your typo then we would be on equal commit-parity
PVico has quit [Quit: Page closed]
<cscheib>
[k-: the trolling is unnecessary.
<[k->
that is actually a real fact about me
<[k->
go ahead shevy!
<shevy>
I don't know how to do it though
<cscheib>
nevermind then. felt like trolling
<[k->
sorry
<[k->
shevy: just fork documenting-ruby
gix has joined #ruby
<Radar>
cscheib: +1 for moving back to 10.10. I had a junior dev at work who had a hell of a time installing our app's dependencies on 10.11
<cscheib>
spent a lot of time working on my boxen/puppet shit, so it wasn't really done for me... but I agree
<[k->
and make changes
<[k->
and pr!
<cscheib>
Radar: only things I've really had issues with are the Box drive client and... this
<Radar>
cscheib: We spent 4 hours trying to figure out how to install Poltergeist and then found some obscure instructions somewhere that fixed it.
braincrash has joined #ruby
<Radar>
I personally like to wait for OS releases like the normal folk
<cscheib>
well, it's not the end of the world for me... I've got 2 OSX laptops, so I can always pull the other one out (that's why I use boxen to standardize my config)
<cscheib>
so I usually run betas, unless there's something critically wrong
cashnguns has quit [Ping timeout: 244 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cscheib>
the only issue switching is re-generating all of my keys/one-time-passwords
ThaiWood has quit [Quit: leaving]
Synthead has quit [Ping timeout: 244 seconds]
ccbn has joined #ruby
pepperbreath has joined #ruby
iamninja has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
j4cknewt has quit [Remote host closed the connection]
sdothum has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
dopie has quit [Quit: This computer has gone to sleep]
vdamewood has quit [Quit: Life beckons.]
ramfjord has joined #ruby
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jorgevaldez has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
jonee has quit [Ping timeout: 272 seconds]
<jorgevaldez>
Hi, is there anyone from Japan here? Please send me a private message
<Ox0dea>
Ohaiou gozaimasu!
devoldmx has joined #ruby
<Ox0dea>
I can't even into Weeaboo. :/
<[k->
Fauxwapanese!
Synthead has joined #ruby
sphex_ has quit [Ping timeout: 250 seconds]
sphex has joined #ruby
<Ox0dea>
jorgevaldez: Watashi no puroguramu wa doko desu ka.
<Radar>
Is that... I am a programmer, what do you do?
* Radar
knows no Japanese
<[k->
what if i wanted to do 5 <=> 1 <= 6
<Ox0dea>
[k-: Then you can fuck right offf.
<Ox0dea>
"off and only off"
<[k->
:>
<Ox0dea>
Radar: I said "Where is my program?".
jackjackdripper has joined #ruby
<[k->
i still dont see && at all?
<Radar>
Ox0dea: ok, I am terrible at interpreting then :D
<Ox0dea>
[k-: ":>" is the syntax for Tab in LOLCODE.
<Ox0dea>
[k-: Why do you think an && is necessary?
dopie has joined #ruby
<[k->
self && prev.send (...)?
<[k->
you must make sure both sides are true?
devoldmx has quit [Ping timeout: 244 seconds]
<Ox0dea>
[k-: You're misunderstanding the call to `super`, I reckon.
<[k->
much misunderstand
<Mon_Ouie>
That's nasty and kind of cool
jorgevaldez has quit []
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
`1 < 2` sets $1 to "2" and returns `true`, `1 < 2 < 3` is then `true < 3`, which recalls the previous value ("2"), converts it to a Float (to cleanly handle all Numerics), and calls the operator on that with the RHS.
<Ox0dea>
[k-: Rinse and repeat.
jorgevaldez has joined #ruby
baweaver has joined #ruby
Synthead has quit [Ping timeout: 244 seconds]
countryHick has quit [Quit: Connection closed for inactivity]
<Ox0dea>
But yeah, you didn't misunderstand the `super`, just... all the other madness.
<Mon_Ouie>
Of course the problem with floats is that 1e500 <= 1e400
<Ox0dea>
Stick a `return false unless self` in there somewhere.
<[k->
i didnt even need to run it!
<Mon_Ouie>
Or just define each operation in FalseClass to return false
ccbn has left #ruby [#ruby]
<[k->
you didnt even test!
<[k->
much dismay
mrod has joined #ruby
pepperbreath has quit [Ping timeout: 256 seconds]
<[k->
i even have to write code to prove my point!
<Ox0dea>
> and instance
<Ox0dea>
^.^
<[k->
this is in violation of the [k--[k--[k--Ox0dea agreement
<Ox0dea>
In any case, refining Booleans is insane.
<Ox0dea>
Probably not as bad as this !== I've added to my local trunk, though.
<jorgevaldez>
guys... i know this is completely out of topic and sorry for that... but just wondering if anyone here can help me find someone that speaks both english and japanese... I'm a ruby developer so that's why I'm looking here
<Ox0dea>
Everything works, but I'm having trouble pinning down the semantics, which I suppose would explain its nonexistence.
<Ox0dea>
?guys jorgevaldez
<ruboto>
jorgevaldez, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
<Radar>
jorgevaldez: Why do you need someone who speaks both English and Japanese?
<Ox0dea>
To translate, obviously.
<Radar>
but to translate wht?
<jorgevaldez>
ok sorry about the guys thing :)
<[k->
self || send(...)
<Ox0dea>
Early exit = high performance.
tkuchiki has quit [Remote host closed the connection]
<[k->
yes, exactly
<mrod>
I have an object that gets updates from a websocket. I have to pull a snapshot of the original object, then update it with the events from the websocket. The snapshot and the events have sequences so you can download say, snapshot 3, then apply message 4, 5, 6 etc. I want to start the websocket and queue the messages, get a snapshot, then apply any messages whose sequences are higher than that of the snapshot.
saddad has joined #ruby
<Ox0dea>
mrod: Use ActionCable!
bmurt has quit []
<jorgevaldez>
so... a little bit out of topic (sorry) but... I need to get in contact with the owner of an Instagram account to make him an offer ($) for his user name... but he's Japanese and it's kinda hard for me to contact him... I'm willing to pay someone to help me to this negotiation
Aww is now known as NotAww
<mrod>
Thanks Ox0dea , I'll check it out
<[k->
this is not related to Ruby
NotAww is now known as Aww
<[k->
you can search somewhere else!
<[k->
off you go!
Aww has left #ruby ["Leaving"]
<Ox0dea>
jorgevaldez: Stahp.
<[k->
this is like wayyyy off topic
<jorgevaldez>
ok sorry... just thought of this as an option because there might be intelligent people here who speak both languages and want to easily earn some money with this... but yeah, I understand... sorry :( nevermind
<[k->
just because Matz is japanese doesnt mean this is related!
<jorgevaldez>
yeah i know, lol
<Ox0dea>
So lacist.
<Ox0dea>
*racist
<[k->
so, english-japanese people elsewhere arent intelligent?
<Ox0dea>
Sorry, L and R are right next to each other on my Colemak keyboard.
<jorgevaldez>
wtf? that was meant as a compliment for this channel
<[k->
Congrats, Ox0dea, you are an intelligent anglo-japanese!
<Ox0dea>
Onoes!
danieli has joined #ruby
<Ox0dea>
I didn't make any preparations for having my ass kissed this evening.
<[k->
jorgevaldez: some things *shouldn't* be said
jeadr has joined #ruby
<[k->
watashi [k- desu!
jorgevaldez has left #ruby [#ruby]
<Ox0dea>
[k-: I once wrote a function for determining the number of common bits between two integers.
<Ox0dea>
mrod: What sort of error(s) are you getting?
bmurt has joined #ruby
workmad3 has joined #ruby
<Ox0dea>
[k-: Positional number systems should be *really* easy to understand for somebody who already groks the essentials of programming. :/
<mrod>
Well, that apply_orderbook_snapshot doesn't seem to run. I'm just instantiating an Orderbook in pry but the queue fills up and it slows down. I'm not getting errors. I try to #join the thread to see what's going on but it just blocks.
<Ox0dea>
More guns doesn't make shooting in the dark any more likely to bear fruit.
<Ox0dea>
Never mind why we're firing at apple trees.
gix has quit [Ping timeout: 265 seconds]
<[k->
it's not like there is a list of things programmers should know :/
<Ox0dea>
Radices are just applied addition, exponentiation, and modular division, doe.
<[k->
do O levels cover that?
bmurt has quit [Ping timeout: 260 seconds]
jester13 has quit [Quit: ChatZilla 0.9.91.1 [Firefox 39.0.3/20150806001005]]
workmad3 has quit [Ping timeout: 264 seconds]
gix has joined #ruby
iamjarvo has joined #ruby
wldcordeiro_ has quit [Remote host closed the connection]
<Ox0dea>
[k-: Your patch is wasteful; no need to update $1 in the case of falsity, since the rest of the chain must be false.
<Ox0dea>
I'd like to generalize it, but storing other's class in $2 (to maintain thread-safety) wouldn't suffice.
<Ox0dea>
There's no generalized way to instantiate objects from strings.
<[k->
Thread.current[:things]
* [k-
knocks Ox0dea's head
jonee has quit [Ping timeout: 252 seconds]
<Ox0dea>
I'm going to use a module variable and you can't stop me.
<[k->
but that isnt safe!
* [k-
waits for a "your face" comment
<Ox0dea>
Thread#[]= is just another way to spell global variables.
<[k->
but it is thread local
<heftig>
fiber local
wldcordeiro_ has joined #ruby
<Ox0dea>
But anybody can access it at any time.
<[k->
Thread.current changes for the current thread
<Ox0dea>
I'm aware.
<[k->
anyone can access $1 at any time
pepperbreath has quit [Ping timeout: 244 seconds]
<Ox0dea>
But that's a scope-local variable.
jackjackdripper has quit [Quit: Leaving.]
<[k->
anyone can access module variables at any time
<Ox0dea>
U LIE!
<[k->
ruby is a reflective language!
<Ox0dea>
We're not supposed to have to namespace our variables in not-C.
djbkd has quit [Quit: Leaving...]
<heftig>
fiber-locals are used for recursion guards, for example
sepp2k has quit [Read error: Connection reset by peer]
iateadonut has joined #ruby
<[k->
what do you mean namespacing variables
j3r0 has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
<Ox0dea>
[k-: If I used Thread#[], I'd have to stick some arbitrary prefix on the variable names.
<Ox0dea>
Arbitrarity is worst arity.
<[k->
why not (Your Module Name Here)
Ann has joined #ruby
zz_Outlastsheep has joined #ruby
<Ox0dea>
I can redefine the comparison operators on all the modules that include Comparable when my thing is first `using`'d, but I can't hook arbitrary method definitions to pick up new candidates. :/
iamninja has quit [Read error: Connection reset by peer]
danieli has quit [Quit: *does an epic backflip into nowhere*]
<nofxx>
This is too crazy: this gem using httparty in a self.class.post() on machine A sends a 'GET', machine B sends a 'POST' ... already installed all gems again, any idea?
<Radar>
slani: Can you write a small program which reproduces the problem?
<Radar>
Hard to know without seeing what kpi is
hahuang61 has quit [Quit: WeeChat 1.2]
peteykun has joined #ruby
wldcordeiro_ has quit [Read error: Connection reset by peer]
<slani>
Radar: 2.2.2 :100 > kpi = {23=>{'Sun, 09 Aug 2015'=>0.7021276595744681}, 1=>{'Sun, 09 Aug 2015'=>1.0}} => {23=>{"Sun, 09 Aug 2015"=>0.7021276595744681}, 1=>{"Sun, 09 Aug 2015"=>1.0}}
<slani>
kpi = {23=>{'Sun, 09 Aug 2015'=>0.7021276595744681}, 1=>{'Sun, 09 Aug 2015'=>1.0}}
dopie has joined #ruby
<Radar>
and what is e?
<Radar>
Oh
<slani>
2.2.2 :086 > e = Hash.new(0)
devoldmx has joined #ruby
hahuang65 has joined #ruby
swgillespie has joined #ruby
rehat has joined #ruby
<Radar>
Silex: You should put a space around the *0.2, so it's * 0.2
<Radar>
Otherwise it will interpret it as an argument to .first
<slani>
Radar: thanks
<slani>
I'm new in Ruby
<Radar>
np
swgillespie has quit [Max SendQ exceeded]
<Radar>
It's an edge case that you've just stumbled across there. Just remember to put spaces either side of your operators +,-,/,*, and you should be ok
swgillespie has joined #ruby
peteykun has quit [Ping timeout: 250 seconds]
devoldmx has quit [Ping timeout: 264 seconds]
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has joined #ruby
<al2o3-cr>
slani: e = kpi.each_with_object(Hash.new(0)) { |(user_id, date), hsh| hsh[user_id] += kpi[user_id].values.first * 0.2 } # this will work to :)
<al2o3-cr>
try it out in irb/pry to see why it work :)
<al2o3-cr>
*works
<[k->
you do not need to access kpi[user_id]
<[k->
it is provided in date
<al2o3-cr>
[k-: good call :)
<Radar>
date should then probably be called data instead.
<Ox0dea>
I thought that was a style violation.
<Radar>
is it?
mary5030 has quit [Remote host closed the connection]
<al2o3-cr>
yeah, that would be a better variable name
<Ox0dea>
It's all data.
<Ox0dea>
> Variable naming conventions can often turn into a religious war, but I'm entirely confident when I declare The World's Worst Variable Name to be: $data
<slani>
al2o3-cr: is there any performance improvemnt
<[k->
all this shows is that everyone wants to move away from java
<[k->
and lua people are quiet
shoutsid has quit [Remote host closed the connection]
<al2o3-cr>
slani: idk have not benchmarked it
einarj has quit [Ping timeout: 244 seconds]
<al2o3-cr>
[k-: /j #lua they're nutters :)
bruno- has joined #ruby
djbkd has joined #ruby
<slani>
hash.delete(key)
<slani>
hash.delete(key1)
<slani>
can I do this in one lien
<slani>
line*
mary5030 has joined #ruby
<[k->
hash.delete(key1) && hash.delete(key2)
<[k->
do you need to preserve kpi?
<slani>
yes
<slani>
only delete two kesy
<[k->
also note that the above code does not work all the time
<Ox0dea>
slani: Do you know what [k- meant by "preserve kpi"?
workmad3 has joined #ruby
<pontiki>
i don't know what that means
<pontiki>
"Key Performance Indicator" ?
<Ox0dea>
Could well be.
bruno- has quit [Ping timeout: 255 seconds]
fedexo has quit [Ping timeout: 246 seconds]
<bnagy>
slani: [k1,k2].each {|k| hsh.delete k }, but for two why bother
<nofxx>
Radar, found the why: httparty fallback to GET on redirection. Now, both computers are on the same LAN, connecting to the same internet server
<nofxx>
somehow one is receiving a redirect, I'm getting two of evertying, every GET, and so every post becomes a GET... the strangest part: server get only 1 request
<slani>
Ox0dea: I hope so
<Ox0dea>
slani: Hash#delete does not preserve the receiver.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<slani>
I will still have other keys and vale in kpi
<Ox0dea>
slani: Yes, but kpi will be mutated.
<[k->
Ox0dea but in the case of a hash, wouldn't a loop be slower
dopamean_ has quit [Quit: leaving]
<Ox0dea>
[k-: I was only demonstrating #delete{,_if}'s mutative natures.
workmad3 has quit [Ping timeout: 264 seconds]
<nofxx>
FUCK! 4 hours of my life... it's the damn httpS! NON-S redirects to HTTPS, httparty fallbacks to GET, I could be riding my bike, stealing and killing but no! 4 hours for an 's'
<nofxx>
hate computers, going to the hills live on subsistance agriculture
tkuchiki has quit [Remote host closed the connection]
<al2o3-cr>
better to use reject then?
CatMartyn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<slani>
Ox0dea: what shoul I use then
<Ox0dea>
slani: Do or do you not wish to leave kpi in its previous state?
<Ox0dea>
Is it okay if the entries you #delete disappear forever?
<slani>
yes it is ok for me
<slani>
to disappear
<Ox0dea>
How many entries do you need to remove? Just the two?
<slani>
just two
devbug has quit [Read error: Connection reset by peer]
<Ox0dea>
Then just use two #deletes on two lines, man.
<[k->
^
devbug has joined #ruby
<slani>
Ok
<slani>
thanks
<Ox0dea>
slani: I see where you were coming from, but optimizing for code height is pretty much never a good idea.
<[k->
not what rubocop thinks
<[k->
curse rubocop!
<slani>
Ox0dea: :d
ndrei has joined #ruby
<slani>
kpi
sargas has joined #ruby
yardenbar has joined #ruby
mary5030 has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
hotpancakes has quit [Remote host closed the connection]
yardenbar has quit [Remote host closed the connection]
yardenbar has joined #ruby
arooni-mobile has quit [Ping timeout: 246 seconds]
halcyone3 has quit [Ping timeout: 260 seconds]
arooni-mobile__ has quit [Ping timeout: 244 seconds]
hyy has joined #ruby
null_ref_ has joined #ruby
shinnya has quit [Ping timeout: 250 seconds]
Mendenhall has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Remote host closed the connection]
kies has quit [Ping timeout: 272 seconds]
saddad has quit [Ping timeout: 260 seconds]
bustrarm has joined #ruby
banister has joined #ruby
chris2 has quit [Ping timeout: 240 seconds]
busterarm has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
arescorpio has quit [Quit: Leaving.]
sargas has quit [Quit: This computer has gone to sleep]
AlexRussia has quit [Ping timeout: 256 seconds]
mistermocha has joined #ruby
kies has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
mistermocha has quit [Read error: Connection reset by peer]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistermocha has joined #ruby
fullofcaffeine has joined #ruby
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has quit [Quit: Leaving...]
shoutsid has joined #ruby
hyy has quit [Ping timeout: 244 seconds]
jackjackdripper has quit [Quit: Leaving.]
mistermocha has quit [Ping timeout: 250 seconds]
User458764 has quit [Read error: Connection reset by peer]
<slani>
how can I round float on 2 decimals
<slani>
0.45
lxsameer has quit [Remote host closed the connection]
krz has quit [Read error: Connection reset by peer]
iateadonut has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
iateadonut has quit [Client Quit]
choke has joined #ruby
mistermocha has joined #ruby
workmad3 has joined #ruby
jonee has joined #ruby
einarj has joined #ruby
baweaver has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 250 seconds]
shock_one has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
lxsameer has quit [Ping timeout: 250 seconds]
einarj has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
shock_one has quit [Remote host closed the connection]
krz has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
Jackneill has joined #ruby
tkuchiki has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
yfeldblum has quit [Read error: Connection reset by peer]
roolo has joined #ruby
yfeldblum has joined #ruby
jonee has quit [Ping timeout: 246 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
hotpancakes has quit [Ping timeout: 250 seconds]
dgutierrez1287 has joined #ruby
niemcu has joined #ruby
postmodern has quit [Quit: Leaving]
yfeldblu_ has joined #ruby
User458764 has joined #ruby
dgutierrez1287 has quit [Ping timeout: 260 seconds]
dopie has quit [Quit: This computer has gone to sleep]
halcyone3 has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
cornerma1 has joined #ruby
krz has quit [Ping timeout: 260 seconds]
cornerman has quit [Ping timeout: 265 seconds]
cornerma1 is now known as cornerman
jonee has joined #ruby
sdwrage has joined #ruby
tkuchiki has quit [Remote host closed the connection]
krz has joined #ruby
yfeldblu_ has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 256 seconds]
yfeldblum has joined #ruby
rehat has quit [Ping timeout: 244 seconds]
symm- has quit [Ping timeout: 252 seconds]
ctalr has quit [Ping timeout: 244 seconds]
TomyLobo has joined #ruby
stoodfarback has joined #ruby
krz has quit [Read error: Connection reset by peer]
gard has joined #ruby
yfeldblu_ has joined #ruby
krz has joined #ruby
jonee has quit [Ping timeout: 246 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
bricker has quit [Quit: leaving]
oliver__ has joined #ruby
dtcristo has joined #ruby
null_ref_ has quit [Quit: leaving]
devbug has quit [Read error: Connection reset by peer]
Mendenhall has joined #ruby
khebbie has joined #ruby
hotpancakes has joined #ruby
banister has joined #ruby
symm- has joined #ruby
khebbie has quit [Ping timeout: 260 seconds]
Feyn has joined #ruby
radgeRayden has quit [Ping timeout: 265 seconds]
jonee has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
Violentr has joined #ruby
<nofxx>
Is there some way to make the .git ext optional, that wont change the <repo> match? /^(ssh:\/\/)?git@github.com:(?<user>[^\/]+)\/(?<repo>.+)\.git$/
lxsameer has joined #ruby
<nofxx>
if I (\.git)? What was 'repo' will be 'repo.git' .... I may gsub/tr later, but just so I know if there's a better way
choke has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
Sembei has joined #ruby
mistermocha has joined #ruby
Pisuke has quit [Ping timeout: 252 seconds]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<[k->
what is wrong?
<greenarrow>
fluffykat, whats the error
<fluffykat>
basically it's always returning type_a.name as the winner.....
<greenarrow>
if statement is fine something wrong with your logic
mistermocha has quit [Ping timeout: 246 seconds]
<greenarrow>
you dont the the wrapping brackets on this fyi if (self.type_a.pick('5'))
<[k->
yup, if you dont run into an error, it's not the code, it's the logic
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<fluffykat>
yeah, i'll take out those brackets and see if it makes a difference
<[k->
it wont make a difference
<[k->
what does `self.type_a.pick('5')` return?
<fluffykat>
hmm...im checking in irb
<fluffykat>
it return '5'
<[k->
5 is a truthy valie
<[k->
value
<[k->
it will always be treated as true
<fluffykat>
`self.type_a.pick('2')` returns '2'
<[k->
what do you expect pick to return?
<[k->
is it your code?
<fluffykat>
yes
<[k->
do you know ruby?
<fluffykat>
just learning
casadei_ has joined #ruby
<[k->
what should pick return?
dseitz has joined #ruby
<fluffykat>
basically if i enter test.type_a.pick('5') it returns '5', which is correct
<fluffykat>
in irb
<[k->
and what should the if statement do?
<lannonbr>
I think [k- is asking what is the purpose of the function pick
<[k->
lannonbr, no
<[k->
im asking if he actually expected a boolean
Trynemjoel has quit [Ping timeout: 245 seconds]
<[k->
anyways
<[k->
fluffykat, how is the if statement supposed to work?
<[k->
if it is 5? if it is 2? if it is not 5? etc etc
Trynemjoel has joined #ruby
AlphaAtom has joined #ruby
<fluffykat>
i'm checking if type_a has picked 5 and type_b has picked 2 in the first test and if so then type_a wins. the method .pick returns the string '5' or '2'
<fluffykat>
sorry the method pick returns the argument value passed into it
casadei_ has quit [Ping timeout: 246 seconds]
<[k->
so you want to see if 5 is more than 2?
<fluffykat>
no
<[k->
that seems to be what you want to do
<[k->
so you want to check if a is 5 and b is 2, right?
<fluffykat>
is this the correct expression? - if ((self.type_a.pick('5')) == '5') && (self.type_b.pick('2') == '2')
<[k->
yes
<lannonbr>
It may be, but it doesn't seem what you really want to do
<lannonbr>
It is valid
<fluffykat>
let me check
<[k->
?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.
edwinvdgraaf has quit [Remote host closed the connection]
charliesome has joined #ruby
edwinvdgraaf has joined #ruby
doosy has quit [Remote host closed the connection]
edwinvdg_ has joined #ruby
hotpancakes has joined #ruby
jonee has quit [Ping timeout: 246 seconds]
Tamae has joined #ruby
edwinvdgraaf has quit [Ping timeout: 252 seconds]
thiagovsk has joined #ruby
ruurd has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 246 seconds]
basmoura has joined #ruby
oliver__ has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
einarj has joined #ruby
Kallis has joined #ruby
halcyone3 has quit [Ping timeout: 272 seconds]
dling` has joined #ruby
banister has joined #ruby
brain_shim has quit [Ping timeout: 265 seconds]
dling has quit [Ping timeout: 260 seconds]
<fluffykat>
hmm, the code is still not working
gunslinger has joined #ruby
<gunslinger>
Is it possible to find the object causing an exception in ruby?
<gunslinger>
I get an "Undefined method [] for Nil::Nilclass" error,
shazaum_ has joined #ruby
<gunslinger>
but IDK which object is causing it
<sevenseacat>
the one you're calling [] on, in the line raising the error
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gunslinger>
sevenseacat: I'm not currently sure which line gets the Error, my exception
<gunslinger>
loop just prints the message
einarj has quit [Ping timeout: 246 seconds]
<sevenseacat>
gist the code and error?
sargas has joined #ruby
<fluffykat>
I've tested it in irb and what is happening is this: when i define type_a.pick = '5' and type_b.pick = '2' then Irb works fine when I check what value type_a is and value type_b is. As soon as I run the program, the type_b changes its value?? bizarre
sargas has quit [Client Quit]
<[k->
post what you typed into irb
<fluffykat>
as soon as i run test.play i meant to say*
<jhass>
gunslinger: also you should do posts.first(10).each do |post| instead of your while construct. Or posts.reverse.first(10) if you really care about iterating in reverse
<fluffykat>
[k-: apologises - I was distracted from the screen. I think I understand what explain the error. Let me paste the irb as requested...give me a moment please.
j3r0 has joined #ruby
<jhass>
gunslinger: and actually it's a .map not an .each
gorgoroth has joined #ruby
<gunslinger>
jhass: Is there a significant advantage to using map instead?
<jhass>
it's a lot prettier?
<gunslinger>
Utility-wise?
Coldblackice has quit [Ping timeout: 244 seconds]
<gunslinger>
How'd you get the idea I wanted to iterate in reverse (& this is why I hate correcting code that isn't my own :/)
doosy has joined #ruby
<sylvain31>
hi, when I define a top level function, how do I test that the method name exist in the current context, normally the scope is global and I should be able to call it from everywhere.
<jhass>
the while condition got me all dizzy ;)
tmtwd has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
<jhass>
something into that direction, should be about a third of the lines of code -> a lot easier to understand
<gorgoroth>
anyone knows what this might be?
<jhass>
gorgoroth: I suspect you messed up your system by mindlessly using root because something "didn't work"
<[k->
gorgoroth: at least provide us with more info
<gorgoroth>
ok, I'll try
Feyn has quit [Quit: Leaving]
dorei has joined #ruby
<fluffykat>
[k-: I've fixed my problem. I couldn't resist making the change in the code and seeing if it worked in IRB. Basically the error is in this line " if (self.type_a.pick('5')) && self.type_b.pick('2')" . When it reaches this line it changes type_b to the value 2 even if I had previously assigned the value '5' to it. I had to instead save the value in a method that doesn't ask for any arguments. the code now works
conor_ has joined #ruby
<[k->
ok
<[k->
congrats
mhib has quit [Ping timeout: 250 seconds]
<shevy>
what a nick
<shevy>
sevenseacat may get jealous to see a fluffykat
<[k->
this feels dejá vu
jackjackdripper has joined #ruby
phutchins has joined #ruby
<shevy>
says the [k-cat
pgatt has quit [Quit: Connection closed for inactivity]
jackjackdripper has quit [Client Quit]
<gunslinger>
jhass: That looks really nice, I'm still a pythonic coder so I tend to type that way but ty
pafin has quit [Read error: Connection reset by peer]
pafin has joined #ruby
<[k->
do you want to ruby or python
<shevy>
how about rython
<gunslinger>
[k-: I like ruby, but I'm used to doing python. but you learn what you need to to get a job
<[k->
dont use python as an excuse
<[k->
GET ON THE RUBY BOAT!
<jhass>
gunslinger: that looks more like java or C than python to me...
<jhass>
in python it would be something like results = [{...} for post in posts[10:]] or idk
<gunslinger>
It's not mine :) but mine would sorta look less rubyish TBH
cashnguns has joined #ruby
marr has quit [Ping timeout: 250 seconds]
<gunslinger>
I believe the guy who wrote it was all about that Java
<gunslinger>
IDK why he keeps using ; at the end lol
devoldmx has joined #ruby
<[k->
ugh java
jonee has quit [Ping timeout: 255 seconds]
<[k->
shevy's favorite
chouhoulis has joined #ruby
ruurd has joined #ruby
mhib has joined #ruby
<shevy>
too verbose
<[k->
im sure you love it!
<shevy>
I never liked verbosity, I use e rather than puts for instance!
<[k->
e?
<shevy>
yeah
<gunslinger>
what's e?
devoldmx has quit [Ping timeout: 246 seconds]
qiukun has quit [Ping timeout: 244 seconds]
<shevy>
I dunno
<shevy>
I think it evolved historically but I no longer have the intermediary code :/
<gunslinger>
I mean, how do you use it?
<[k->
puts is verbose?
<shevy>
it had something to do with colourization
<shevy>
yeah [k- 4 chars, inacceptable
<shevy>
gunslinger well e 'Hello world!'
gard has quit [Ping timeout: 244 seconds]
<[k->
shevy APL is perfect for you!
oliver__ has quit []
<shevy>
I was using term-ansicolor back then
<shevy>
e 'red'.red
<[k->
look, it evens take advantage of Unicode
<[k->
echo?
<shevy>
why would I need unicode
chouhoulis has quit [Ping timeout: 264 seconds]
<jhass>
I guess we should be glad that shevy only brags but never actually shares any of his code
<shevy>
[k- I don't remember... e for echo would make sense, but I think there was some intermediary step
j3r0 has quit [Ping timeout: 255 seconds]
<[k->
i think o would be good for you shevy
<shevy>
I think I may have some old backup from where I could find out
<Mon_Ouie>
(You need one more backslash in the string as seen by gsub, so you need two more backslashes in your string literal)
<sylvain31>
Mon_Ouie, … I see. test_that? doesn't look like a private method to me… But I can handle that.
<Papierkorb>
Mon_Ouie: oh well. thanks
k1v4n has joined #ruby
<Mon_Ouie>
sylvain31: "private methods" in Ruby means you can't call them with an explicit receiver, i.e. you can't do 3.test_that? --- but you can still do test_that? when self is 3
conor_ has joined #ruby
<sylvain31>
Mon_Ouie, I would like to share the top-level method with other code too
casadei_ has quit [Ping timeout: 255 seconds]
mistermocha has joined #ruby
Aridere has quit [Ping timeout: 255 seconds]
<Mon_Ouie>
module Kernel; module_function; def test_that?(num); …; end; end <- this is how most methods in Kernel are defined
<sylvain31>
Mon_Ouie, I don't want to put it at Kernel level, I just want to be able to call it inside the DelegateClass. I found: if Object.send(:test_that?, num); … ; end; is working…
j4cknewt has joined #ruby
workmad3 has joined #ruby
<Mon_Ouie>
What do you mean "not put it at Kernel level"?
<Mon_Ouie>
If you just want it inside your delegator that's where you can define it
<sylvain31>
Mon_Ouie, I don't want to change the way the top-level method is defined, only the way to reach it inside the DelegateClass subclass with its restriction
<Mon_Ouie>
Why is the way that the method is defined a constraint? A module function on Kernel is a valid way to define a 'global function'-like method
mcgain has joined #ruby
<Mon_Ouie>
But yes, you can just do send(:test_that?, num) on any object if you really don't want to touch the method definition
The_Phoenix has quit [Quit: Leaving.]
j4cknewt has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
<sylvain31>
I can do both. But I only have one DelegateClass, the constraint is here, I will fix it here, Thank I will read the doc about "module function on Kernel", thanks
ivanskie has joined #ruby
bronson has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
Axy is now known as Mia
calleerlandsson has joined #ruby
dardo82 has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
bronson has quit [Ping timeout: 244 seconds]
<dardo82>
hello
<sylvain31>
Mon_Ouie, do you know where I can find the restrictions on DelegateClass?
<dardo82>
i have some problems with homebrew on a mac
<Mon_Ouie>
I looked at their implementation of method_missing to understand this, I don't know if it's mentioned in the documentation
<dardo82>
"brew tests" fails saying something about ruby
<dardo82>
"Could not find 'bundler' (>= 0) among 29 total gem(s) (Gem::LoadError)"
<sylvain31>
Mon_Ouie, OK thanks.
<dardo82>
i should ask about it here or on the machomebrew channel?
<Mon_Ouie>
dardo82: It looks like you need to 'gem install bundler'. They probably know more about the specific dependencies of homebrew though.
blue_deref has joined #ruby
zarubin_ has joined #ruby
zarubin_ has quit [Client Quit]
jamesaxl has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
j416 has quit [Read error: Connection reset by peer]
j416_ has joined #ruby
<dardo82>
Mon_Ouie: when i try it i get the error "Symbol not found: _SSLv2_client_method"
j416_ is now known as j416
dopie has joined #ruby
hotpancakes has joined #ruby
<Mon_Ouie>
Could it be that your Ruby's OpenSSL extension was linked against a incompatible version of OpenSSL?
omegamike has joined #ruby
gorgoroth has quit [Quit: gorgoroth]
<dardo82>
Mon_Ouie: maybe, how i can check that?
<Mon_Ouie>
I don't know, not very familiar with how dynamic libraries work on Mac OS X
<[k->
only something that does the job sastisfactory or unsatisfactory
fullofcaffeine has quit [Remote host closed the connection]
<cscheib>
[k-: well, let's be truthful... there is certainly bad
Vile` has joined #ruby
<[k->
:3
<ght>
Question: Is there any way to quickly determine if a begin...while loop is in its first iteration without having to use supplemental "is_first_loop" boolean variable or counter variable?
<ght>
TomyLobo: We've used rest-client for years, all successfully, so yes, rest-client works perfectly fine.
<ght>
The syntax can take some getting used to, but once you do it has worked every time so far.
<TomyLobo>
thanks :)
<TomyLobo>
looks fine to me
<[k->
ght finite (countable) loop?
<ght>
Yeah, I've never encountered a situation where rest-client hasn't done everything we needed to do, with the exception of XMLRPC-based API endpoints.
<ght>
[k-: No, it's not finite.
<TomyLobo>
nah i just need json
ndrei has quit [Ping timeout: 240 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
khebbie has quit [Remote host closed the connection]
<TomyLobo>
should i use "do |foo| end" or "{ |foo| }"?
workmad3 has joined #ruby
narak has joined #ruby
<[k->
depends
<TomyLobo>
are they not equivalent?
<Mon_Ouie>
They have different precedence
<TomyLobo>
well, for a single argument
<Mon_Ouie>
`foo bar do |foo| end' is not the same as foo bar { |foo| }
ohaibbq has joined #ruby
<TomyLobo>
well yeah
<Mon_Ouie>
Other than that, they are functionally equivalent, but people prefer one over the other in different circumnstances
<TomyLobo>
i'd actually like it to behave more like a function argument than that special snowflake syntax with the braces :)
ctalr has joined #ruby
mikecmpbll has joined #ruby
marr has joined #ruby
<TomyLobo>
hnnng, you're right... do..end looks kinda bad with gsub
Respek has quit [Quit: gone to sleep. ZZZzzz…]
<Mon_Ouie>
One convention is to use do … end for multiple lines and { … } for single line. Another one is do … end for blocks that have side-effects (and "do" things), and { … } for blocks that just calculate some value. Also people tend to prefer { … } when chaining.
chinmay_dd has quit [Read error: Connection reset by peer]
basmoura_ has joined #ruby
chinmay_dd has joined #ruby
<TomyLobo>
hmm i thought i know what you meant when you said "`foo bar do |foo| end' is not the same as foo bar { |foo| }", but i don't
<TomyLobo>
can you elaborate?
<Mon_Ouie>
foo bar do |foo| end is parsed as foo(bar) do |foo| … end
<Mon_Ouie>
foo bar { |foo| } is parsed as foo(bar { |foo| })
<TomyLobo>
oh
<TomyLobo>
eww
workmad3 has quit [Ping timeout: 245 seconds]
<[k->
another convention is do..end for multiline blocks and {...} for one line (chaining)
jud has joined #ruby
basmoura has quit [Ping timeout: 256 seconds]
<TomyLobo>
i'll just use do..end until it fails, since that is more consistent with the other block syntaxes
Inside has joined #ruby
Inside has joined #ruby
<TomyLobo>
but "FuseFS.main() { |options| HelloDir.new }" does look nice
<TomyLobo>
the one line/multiple lines rule seems the most sensible
<Mon_Ouie>
It used to be the most common one. Now I feel like the second one is somewhat more popular.
Muhannad has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
mclee has quit [Ping timeout: 264 seconds]
apofis has quit [Ping timeout: 240 seconds]
tectonic has joined #ruby
h4ckurate has joined #ruby
mclee has joined #ruby
djbkd has joined #ruby
darkf has quit [Quit: Leaving]
samu has joined #ruby
<samu>
Hi!
<[k->
Hi
<samu>
I have a customer running ruby-1.8.7-p374 on FreeBSD 10.2-RC3 via rvm (which should not be the case here)
hyy has quit [Remote host closed the connection]
<samu>
I'm trying to install mysql2 gem for him, but the gem utility keeps complaining that it can't find the mysql.h header file
halcyone3 has quit [Ping timeout: 245 seconds]
<havenwood>
samu: Is MySQL installed?
<samu>
yes, the devel packages are also installed
<samu>
but because it's freebsd, the include and lib files are prefixed under /usr/local, so mysql.h is actually under /usr/local/include/mysql/mysql.h
Guest84 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<samu>
now, in the gem output I can see that it tries to use /usr/local/bin/mysql_config, and that script gives the right information, the -I and -L flags point to the right directories: -I/usr/local/include/mysql and -L/usr/local/lib/mysql
casadei_ has joined #ruby
<samu>
I cannot re-create this problem under my account on the same type of server (exact same os/hardware), so I'm blindly asking for help now
fullofcaffeine has quit [Remote host closed the connection]
<cscheib>
win 3
<cscheib>
damn irssi
casadei_ has quit [Ping timeout: 260 seconds]
khapa_ has joined #ruby
khapa has quit [Ping timeout: 244 seconds]
Musashi007 has joined #ruby
<samu>
crap, I have to make this work somehow ;D
Oka has joined #ruby
hotpancakes has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 250 seconds]
<TomyLobo>
() or no ()?
<TomyLobo>
around method arguments
<TomyLobo>
intuitively (and that intuition is informed by qbasic being the first language i ever learned), i'd say () around methods where you use the return values in some way
djbkd has joined #ruby
conor_ has quit [Remote host closed the connection]
Muhannad has joined #ruby
<jhass>
TomyLobo: I tend to leave them off where syntactically and semantically allowed
<jhass>
but most keep them for at least method definitions
<TomyLobo>
yeah i leave them for method definitions too
codecop has joined #ruby
codecop_ has joined #ruby
rehat has quit [Remote host closed the connection]
codecop_ has quit [Client Quit]
<TomyLobo>
i think i'll put return everywhere too, except for one-liner blocks
h4ckurate has quit [Quit: h4ckurate]
mistermocha has joined #ruby
saddad has quit [Ping timeout: 245 seconds]
yh has joined #ruby
<Mon_Ouie>
Are you sure you understand the semantics of the keyword `return' inside blocks?
<TomyLobo>
oh right
<Mon_Ouie>
def foo; array.each { return x }; end <- this method returns the first element of array
phutchins has joined #ruby
<TomyLobo>
yeah for all blocks then :)
thiagovsk has quit [Quit: Connection closed for inactivity]
<TomyLobo>
is there any way to explicitly return a value from a block btw?
<Mon_Ouie>
(Well if you add the missing |x| anyway)
h4ckurate has joined #ruby
<TomyLobo>
like in a short-cut if
<Mon_Ouie>
Yes, using `next value'
sdwrage has quit [Quit: This computer has gone to sleep]
<TomyLobo>
ah
<Mon_Ouie>
this looks misleading for blocks that aren't used to iterate over a collection, but what it really does is return to the point where the block was called
<TomyLobo>
yep
<TomyLobo>
and especially giving a value to "next"
<TomyLobo>
are there module-local variables?
n008f4g_ has joined #ruby
hotpancakes has joined #ruby
roolo has quit [Remote host closed the connection]
<Mon_Ouie>
Like @@foo? You can also simply use @foo when self is a Module (those have different semantics, of course)
<havenwood>
Any RVM user on OS X want to grab master and try installing Ruby 2.2.2 with the just-uploaded precompiled binary?
phutchins has quit [Ping timeout: 256 seconds]
<Mon_Ouie>
Depends on how you plan to use it, but yes, that could make sense
<havenwood>
If you want to test just uninstall 2.2.2 and reinstall after a: rvm get master
jbw has quit [Ping timeout: 260 seconds]
<TomyLobo>
hmm then something is wrong here...
<havenwood>
A sanity check that it works on one other person's machine would be nice. ;)
yqt has joined #ruby
jbw has joined #ruby
<TomyLobo>
Mon_Ouie, i'm using that from a method that is invoked from a place where the module is included
<TomyLobo>
puts @routes shows an empty line
mistermocha has quit [Ping timeout: 264 seconds]
Guest84 has joined #ruby
<Mon_Ouie>
Since it is an instance variable, you can only directly access it when self is the Module itself, so one way to use it is to define a reader for convenience's sake and then use Routing.routes
h4ckurate has quit [Quit: h4ckurate]
<TomyLobo>
but then i'd always have the module's instance, right?
whiteline has quit [Remote host closed the connection]
<Mon_Ouie>
In your example it seems @@routes = Hash.new { … } should work (it does mean that in any class where the module is included, @@routes will refer to the same hash)
<Mon_Ouie>
Having mixins that need their own instance variables is not easy to do, and I would generally avoid it. In this example I would just have def routes; @routes ||= Hash.new { … }; end and always access the instance variable through that method
radgeRayden has joined #ruby
<Mon_Ouie>
The argument of Module#included is the class that included module. Do you want one hash per class that includes the module?
<TomyLobo>
nope, per instance
<TomyLobo>
actually
<Mon_Ouie>
Then the code you found wouldn't work (it sets an instance variable on the class itself)
<TomyLobo>
i only have per-instance routes as a workaround anyway
<TomyLobo>
i'd rather have things like "route_add :list, '/issues', to: :list_issues" in the class scope instead of the initializer
<TomyLobo>
but still reference methods from that class
<Mon_Ouie>
Are you aware of Module#extend? That looks like what you'd want
<TomyLobo>
nope, lemme google it
swgillespie has joined #ruby
<TomyLobo>
ah, yeah that sounds like it
arooni-mobile has joined #ruby
arooni-mobile__ has joined #ruby
<TomyLobo>
how do i get something into a class-specific variable there?
fantazo has joined #ruby
<TomyLobo>
specific to the extended class
conor_ has joined #ruby
<Mon_Ouie>
From where? Inside your methods (e.g. route_add), @instance_variables will be specific to the class itself.
<shevy>
anyone remembers offhand what ruby installs into bin/ ? I assume: ruby, irb, ri ... did I forget anything?
arooni-mobile has quit [Max SendQ exceeded]
<Mon_Ouie>
Don't we also have rake and gem?
Kallis has joined #ruby
arooni-mobile has joined #ruby
<miah>
erb gem irb rake rdoc ri ruby
dimasg has quit [Ping timeout: 260 seconds]
<shevy>
thanks
<miah>
i just did a ls ~/.rubies/ruby-2.2.2/bin
<miah>
fwiw
<Mon_Ouie>
That's harder to do when using your system's Ruby :p
conor_ has quit [Remote host closed the connection]
<miah>
who in their right mind would do that? (unless you're running archlinux) ;)
<Mon_Ouie>
That's my case, as it happens
<miah>
thats the case on every one of my systems apart from my work laptop (which i'm using currently)
<TomyLobo>
some systems need ruby for system stuff
<miah>
which?
<TomyLobo>
so you get a system ruby
<miah>
maybe opensuse, iirc yast is rewritten in ruby now
<Mon_Ouie>
Doesn't Mac OS X come with stuff written in Ruby? I remember it doing so.
<TomyLobo>
that would be strange
chinmay_dd has quit [Quit: Leaving]
<shevy>
miah yeah that list looks good enough; I am trying to clean up my system so I had leftovers at /usr/bin/, but also in a versioned directory similar to your ~/.rubies (but I had like 30 entries there, from some gems what they install into bin/). Now I cleaned everything up \o/
<havenwood>
Mon_Ouie: Aye, it does.
dgutierrez1287 has joined #ruby
<TomyLobo>
it not being a terribly open system and all
h4ckurate has quit [Quit: h4ckurate]
<shevy>
was yast written in python before?
<shevy>
I think the last time I used it was like in 2006 or something like that
pawnbox has joined #ruby
<miah>
shevy: python iirc
Ox0dea has quit [Read error: No route to host]
<miah>
the redhat installer 'anaconda' was also python too i have no idea if thats the case these days
<shevy>
ok I guess I misremembered... "YaST was developed in YCP ? a custom, simple, inflexible language."
<TomyLobo>
(ctrl-f common idiom)
workmad3 has joined #ruby
j75 has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
<Mon_Ouie>
You still see it very often, if you need to provide class and instance methods
wookiehangover has quit [Ping timeout: 246 seconds]
<TomyLobo>
shevy, yep that sounds exactly like suse :D
omegamike has joined #ruby
pawnbox has joined #ruby
<shevy>
"Why did you pick Ruby?" - [...] "Technically it was on par with other languages we considered (mainly Python and JavaScript/CoffeeScript), so the internal knowledge and standardization was the decisive factor."
sarkyniin has joined #ruby
<shevy>
ruby won a rare battle! \o/
aphprentice has joined #ruby
shinnya has quit [Ping timeout: 256 seconds]
<TomyLobo>
by means of vendor lock-in \o/
lapide_viridi has joined #ruby
fullofcaffeine has joined #ruby
<shevy>
well pick your poison from other distributions - like if you don't want systemd :)
<shevy>
I am surprised that they did not pick python though
<TomyLobo>
there's no way around systemd if you want a stable distribution anyway
Respek has joined #ruby
<TomyLobo>
except maybe slackware or something
atomical has joined #ruby
last_staff has joined #ruby
apt-get_ has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
<miah>
or are running kernel 2.0 - 2.4
jgpawletko has quit [Quit: jgpawletko]
omegamike has quit [Ping timeout: 244 seconds]
wookiehangover has joined #ruby
khebbie has joined #ruby
Nieralyte has joined #ruby
apfeluser has quit [Ping timeout: 246 seconds]
<yh>
shevy: yeah, python always seems to win over Ruby in these debates
<yh>
I simply don't find python as intuitive or its docs as easy to dip in & out of
<yh>
It's a shame. It makes me view Ruby as a product with a limited shelf-life that's looming
youch has quit [Quit: Konversation terminated!]
Musashi007 has joined #ruby
khebbie has quit [Remote host closed the connection]
Respek has quit [Quit: gone to sleep. ZZZzzz…]
sevvie has quit [Ping timeout: 252 seconds]
rehat has joined #ruby
ramfjord has joined #ruby
Nieralyte has quit [Quit: Nieralyte]
Nieralyte has joined #ruby
myztic has quit [Ping timeout: 265 seconds]
<darix>
shevy: i think the factor that suse does many ruby projects wasnt that small either
sevvie has joined #ruby
tomphp_ has joined #ruby
hotpancakes has quit [Remote host closed the connection]
fullofcaffeine has quit [Remote host closed the connection]
devoldmx has joined #ruby
khebbie has joined #ruby
<shevy>
good! I hope their default ruby works better than the default debian ruby :D
gsingh93 has joined #ruby
<darix>
shevy: sure.
<darix>
shevy: we even have a nice way to use additional MRI versions without rvm or so
arooni-mobile has quit [Ping timeout: 244 seconds]
<gambl0re>
what is orm, haml and medis?..
<havenwood>
gambl0re: types of sandworms
arooni-mobile__ has quit [Ping timeout: 244 seconds]
<shevy>
darix how or where do the multiple versions get installed?
<yh>
shevy: what's wrong with debian default ruby?
<darix>
shevy: just normal paths. the /usr/bin/{ruby,gem} is locked to the default ruby. so you have to use the full paths for the other versions.
yardenbar has quit [Quit: Leaving]
<yh>
I deploy most apps to Docker so I wouldn't know
<shevy>
hmm so you have /usr/bin/ruby2.1 too?
<gsingh93>
i'm using rbenv for a project and i set the version to 2.1.6. when i do `bundle install` gems are installed in $GEMDIR/ruby/2.2.0. shouldn't they be installed in $GEMDIR/ruby/2.1.6?
<shevy>
yh debian changes some paths and makes some modifications such as removes 'mkmf' by default
<nymous>
i need to go through several xml entries, so i don't think adding too much variables would improve readability
tvw has joined #ruby
<dcope>
triangles: ok i found an ugly solution... but it works! :)
Trynemjoel has quit [Ping timeout: 250 seconds]
sdwrage has joined #ruby
<apeiros>
nymous: add your own .try then. maybe a specialized variant for your case of "if present, dig deeper, else use default"
<gsingh93>
how do i install bundler for ruby 2.1? i'm using rbenv, and i install bundler with `gem install bundler`, but `bundle env` says it's using ruby 2.2
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Trynemjoel has joined #ruby
dionysus69 has quit [Quit: dionysus69]
cornerma1 has joined #ruby
mhib has quit [Remote host closed the connection]
<apeiros>
nymous: in this case also maybe possible - query cdatas[0] in your xpath. not sure whether that's at all possible, though. my xpath isn't that good :)
kirun has quit [Quit: Client exiting]
sarkyniin has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 246 seconds]
cornerman has quit [Ping timeout: 244 seconds]
cornerma1 is now known as cornerman
wprice has quit [Quit: wprice]
_ht has quit [Quit: Konversation terminated!]
<nymous>
the problem is i need to query xml for a value, but it might not exist at all
ndrei has joined #ruby
lapide_viridi has quit [Quit: Leaving]
sarmiena_ has joined #ruby
<sarmiena_>
i’m experiencing a segfault with a ruby gem (twilio-ruby) when trying to run it in a threaded environment (sidekiq)
dseitz has joined #ruby
skade has joined #ruby
<sarmiena_>
the guys here are saying to put a global mutex lock around twilio, but having a hard time figuring out where to do that
dimasg has joined #ruby
<apeiros>
nymous: why's that a problem? xpath will return nil in that case
<apeiros>
which you can easily map to your default vaue via `xpath || default`
sdwrage has quit [Quit: This computer has gone to sleep]
Nahra has joined #ruby
<gsingh93>
i really need some help here, i've been stuck on this for an hour. bundler keeps installing gems in ruby/2.2.0, i can't figure out why
hotpancakes has quit [Remote host closed the connection]
blue_deref has quit [Quit: bbn]
h4ckurate has joined #ruby
krz has quit [Quit: WeeChat 1.2]
<nymous>
apeiros: you mean something like memory = root.elements['//TEMPLATE/MEMORY'] || "0"?
basmoura_ has quit [Remote host closed the connection]
Jarboe has joined #ruby
<jhass>
gsingh93: I believe there's an #rbenv
<jhass>
wait, there isn't?
<havenwood>
jhass: nope
<jhass>
how disappointing
<jhass>
I guess nobody actually uses it :P
<gsingh93>
:(
<havenwood>
jhass: #rvm or #chruby but tweet @DHH for rbenv support
devoldmx has joined #ruby
<jhass>
I mean there could be at least a community supported one
<apeiros>
nymous: yes, except a) to have the .cadatas[0] part of the xpath and b) your original has 0, not "0" as default
<jhass>
gsingh93: you're through the standard troubleshooting? check rbenv is properly loaded, actually thinks the right ruby is selected, 2.1 is the first ruby in your path etc?
devoldmx has quit [Ping timeout: 256 seconds]
Respek has quit [Quit: gone to sleep. ZZZzzz…]
<gsingh93>
jhass: yea, ruby -v, gem -v, which ruby, and which gem all look right
ndrei has quit [Ping timeout: 240 seconds]
<gsingh93>
point to the rbenv version of ruby, 2.1.6
<havenwood>
gsingh93: and rehashed your shims?
einarj has joined #ruby
<gsingh93>
yup
<havenwood>
gsingh93: switch to chruby.
<jhass>
what about which bundle?
h4ckurate has quit [Ping timeout: 255 seconds]
<jhass>
:D
mary5030 has quit [Remote host closed the connection]
Jackneill has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
<havenwood>
:)
hotpancakes has quit [Ping timeout: 240 seconds]
ndrei has joined #ruby
chabil has quit [Quit: WeeChat 1.2]
<gsingh93>
i'm on archlinux, i have ruby-bundler installed which adds /usr/bin/bundle which selects the correct version of bundler from ~/.gems
<gsingh93>
and in .gems i only have one version of bundler
<TomyLobo>
i have this in an extend method body: hash[:to] = self.method(hash[:to])
<TomyLobo>
this cant find a method of the extended class
<TomyLobo>
not without the "self." either
<jhass>
gsingh93: ruby-bundler hardcodes /usr/bin/ruby into the hashbang, but your rbenv should put a different bundle script in front of it into your $PATH
bronson has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
brain_shim has quit [Ping timeout: 250 seconds]
<jhass>
however if ruby -v is correct you can probably workaround with ruby -S bundle
willharrison has joined #ruby
<jhass>
?code TomyLobo
<ruboto>
TomyLobo, We can't help you without your code, please post it to https://gist.github.com
mistermocha has quit [Ping timeout: 252 seconds]
Ox0dea has joined #ruby
<gsingh93>
jhass: omg
<Ox0dea>
TomyLobo: Module#extended takes an argument that you should use.
<gsingh93>
i completely forgot about the hashbang
<gsingh93>
rbenv doesn't provide a bundler shim
brain_shim has joined #ruby
<jhass>
it should
<TomyLobo>
>> module Foo def foo() self.method(:bar) end class Bar extend Foo def bar end end Bar.new.foo()
<ruboto>
TomyLobo # => /tmp/execpad-7debe4650287/source-7debe4650287:2: syntax error, unexpected keyword_class, expecting k ...check link for more (https://eval.in/414371)
pollyprissypants has joined #ruby
<TomyLobo>
oh well
<TomyLobo>
>> module Foo def foo() self.method(:bar) end end class Bar extend Foo def bar end end Bar.new.foo()
<ruboto>
TomyLobo # => /tmp/execpad-6b0908a24586/source-6b0908a24586:2: syntax error, unexpected keyword_class, expecting k ...check link for more (https://eval.in/414372)
<gsingh93>
jhass: i tried changing the hashbang to /usr/bin/env ruby and it worked
<Ox0dea>
?experiment TomyLobo
<ruboto>
TomyLobo, Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
<TomyLobo>
i give up. i'll try that argument
<gsingh93>
although that's not really a proper solution, given that it's a system installed file
<jhass>
gsingh93: meh, that'll break with the next bundler update
<gsingh93>
but at least i know the problem now
<gsingh93>
yea
<Ox0dea>
TomyLobo: Module#extended and/or #super_method seem to be the methods you're looking for.
<jhass>
now you know why nobody uses rbenv :P
<gsingh93>
haha
<TomyLobo>
undefined method `super_method' for HelloDir:Class
<Mon_Ouie>
I like pp because any class can change how it is displayed simply by redefining #pretty_inspect and some libraries do so for their own classes. Last time I used ap you couldn't easily change how it handled custom classes and it didn't fall back on pp's behavior for objects it didn't know how to print.
<shevy>
you have way too much time available Ox0dea!
phutchins has quit [Read error: Connection reset by peer]
<Ox0dea>
You seem to have concluded that I've read all the RFCs.
<shevy>
you read a pig rfc!
<Mon_Ouie>
Just read all the April's Fools RFCs
<shevy>
oh damn
<shevy>
I missed the date :(
bweston92 has quit [Ping timeout: 250 seconds]
<Mon_Ouie>
I AM A TEAPOT
dgutierrez1287 has quit [Remote host closed the connection]
<Ox0dea>
IPoAC is best 4/1 RFC.
workmad3 has joined #ruby
<apeiros>
IPoAC can actually reach quite high bandwidths. but latency sucks.
omegamike has joined #ruby
lannonbr has quit [Ping timeout: 250 seconds]
h4ckurate has quit [Ping timeout: 265 seconds]
saddad has joined #ruby
yardenbar has joined #ruby
einarj has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
twistedpixels has quit [Remote host closed the connection]
<TomyLobo>
it's the modem of animal-borne communication protocols
<TomyLobo>
dialup modem*
Zggb has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
sdwrage has quit [Quit: This computer has gone to sleep]
EllisTAA has joined #ruby
pollyprissypants has left #ruby ["Leaving"]
<TomyLobo>
Ox0dea, so what do i do with the reference to the method? i cant store it with the class because i cant get a reference to that class later on (which is kind of the initial problem)
<Mon_Ouie>
I think that, to achieve high bandwidths, you have to violate the Frame Format suggested by the RFC, which means your implementation is not compatible with compliant avian carrier receptors.
omegamike has quit [Ping timeout: 272 seconds]
<TomyLobo>
and i cant store it with the module, since i dont get a separate instance per class (or do i?)
mcgain has quit [Ping timeout: 255 seconds]
mcgain_ is now known as mcgain
brnpcn has quit []
brnpcn has joined #ruby
fullofcaffeine has joined #ruby
<Ox0dea>
TomyLobo: You can always get a reference to any class.
arup_r has joined #ruby
<Ox0dea>
Could you perhaps clarify what exactly you're trying to do?
mary5030 has joined #ruby
fullofca_ has joined #ruby
lannonbr has joined #ruby
Mendenhall has quit [Ping timeout: 255 seconds]
Yzguy has joined #ruby
<Ox0dea>
TomyLobo: Also, nobody seems to have shown you autovivifying Hashes:
<Ox0dea>
>> auto = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; auto[1][2][3] = 4; auto
tkuchiki has quit [Remote host closed the connection]
nahtnam has joined #ruby
Ann has quit [Ping timeout: 246 seconds]
f4cl3y__ has joined #ruby
cashnguns has quit [Ping timeout: 244 seconds]
mcgain has quit [Quit: mcgain]
doosy_ has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Yzguy has joined #ruby
Ann has joined #ruby
EllisTAA has joined #ruby
niemcu has quit [Ping timeout: 240 seconds]
doosy has quit [Ping timeout: 245 seconds]
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
workmad3 has joined #ruby
mcgain has joined #ruby
Ann has joined #ruby
tkuchiki has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
workmad3 has quit [Ping timeout: 250 seconds]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Trynemjoel has quit [Ping timeout: 245 seconds]
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Ann has quit [Max SendQ exceeded]
Ann has joined #ruby
Trynemjoel has joined #ruby
doosy_ has quit []
ohaibbq has quit [Remote host closed the connection]
ohaibbq has joined #ruby
ahuman has joined #ruby
lapide_viridi has quit [Quit: Leaving]
<Inside>
Hey guys ~ web server question here.
<Inside>
Um.... I... am not understanding what roles rack/nginx/rails/etc serve; ie: how the whole stack works together
<Inside>
Anyone have a link to an article bookmarked that explains it all in general terms since I can't seem to find anything that explains it
<apeiros>
Inside: one example - browser sends request to server, server is nginx. nginx figures the request is handled by rack, dispatches request to rack. rack dispatches to rails.
ahuman_ has quit [Ping timeout: 250 seconds]
<apeiros>
and rack is the layer between webserver and framework. like a database independence layer for databases.
<Inside>
okay so something like WEbrick serves as both nginx/rack?
<apeiros>
no
<apeiros>
webrick serves as nginx
<apeiros>
rack is still in there
* Inside
scratches his head.
<apeiros>
just that there you could have ruby without rack in between
ahuman has quit [Remote host closed the connection]
<apeiros>
rack still serves the same purpose - it makes all webservers look the same to the webframework.
<havenwood>
Inside: Maybe try making a plain vanilla Rack app.
<Inside>
Yeah, I'm trying to create a super simple website and while I have experience with rails (it seems to "just work" for me), I want to figure out how all this works.
j4cknewt has joined #ruby
<Inside>
I think I even spoke to you a couple of days ago :P
<apeiros>
Inside: or from the other side: rack makes all webframeworks look the same to the webserver
skade has quit [Quit: Computer has gone to sleep.]
<apeiros>
as said, it works similar to how a DBI works for databases.
<havenwood>
Inside: Rails is one of many optional Rack adapters.
<Inside>
well, I get that
<havenwood>
Inside: You can not use a Rack adapter at all and make a pure Rack app.
<Inside>
from your example :D
<apeiros>
and middleware fits into that picture as stuff the request goes through before or after reaching the webframework
<Inside>
and why do we want middleware?
<apeiros>
because you don't want to code against each webframework but still have shared interests
<apeiros>
take a look at some existing middleware. many things are not framework specific.
SCHAAP137 has quit [Remote host closed the connection]
shazaum_ has joined #ruby
mistermocha has joined #ruby
shellie_ has left #ruby [#ruby]
devoldmx has joined #ruby
mistermo_ has joined #ruby
Pisuke has joined #ruby
workmad3 has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
MyMind has quit [Ping timeout: 260 seconds]
<Yzguy>
anyone got a moment to look at my code for a sec, can't figure out why it won't print
<Yzguy>
value from optprase
<Yzguy>
parse
<Inside>
So... looks like it's up to the webserver to take in data over the socket and then turn it into a rack environment hash
<Inside>
interesting
<Radar>
Yzguy: !gist
<Radar>
Yzguy: ?gist
<Radar>
?gist
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<Radar>
Finally.
<Inside>
but then the question is - if the popular webservers already smoosh everything into a rack environment info hash, why not just push that to the application? :P
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Rinzlit>
Ox0dea, what is msf? I couldn't find it from duckduckgo
<Ox0dea>
This guy.
dgutierrez1287 has joined #ruby
Ropeney has joined #ruby
michael_mbp has joined #ruby
<Ox0dea>
It's what people who actually use Metasploit call Metasploit.
arooni-mobile has quit [Ping timeout: 244 seconds]
<Rinzlit>
Ox0dea, I just wanna learn to be a badass script kiddie D:
arooni-mobile__ has quit [Ping timeout: 244 seconds]
<shevy>
yeah see
<Ox0dea>
How tragic.
<shevy>
use php
<Rinzlit>
shevy php is harder and doesn't get paid as much .-.
<Inside>
Ox0dea: so if my app has two seperate functions (web server request->attached printer prints something and on database update->automatically print something) which don't really talk to each other than to start up/shutdown together, should I just like run thin in one thread and then run the automatic printer in another?
<Ox0dea>
Inside: If you're really sure they don't need to coordinate, that should do.
<Inside>
huh
<Inside>
I don't get why it took me that long to come to that conclusion, haha.
mago0 has quit [Ping timeout: 244 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
rehat_ has quit [Read error: Connection reset by peer]
dgutierrez1287 has quit [Ping timeout: 240 seconds]
whiteline has quit [Quit: Leaving]
mago0 has joined #ruby
whiteline has joined #ruby
lannonbr has joined #ruby
bodgix has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Remote host closed the connection]
rehat has joined #ruby
ecksit has joined #ruby
_blizzy_ has joined #ruby
<ecksit>
heya, where is the documentation on what `%()` is? i found some docs on `%q()` but nothing on it