RegulationD has quit [Remote host closed the connection]
roshanavand has joined #ruby
finisherr has joined #ruby
hooker has joined #ruby
grotewold has joined #ruby
replay has quit [Ping timeout: 260 seconds]
shazaum_ has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
Xeago has joined #ruby
peteyg_ has quit [Quit: leaving]
sepp2k1 has quit [Read error: Connection reset by peer]
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
maloik has joined #ruby
SleepySensei has joined #ruby
peteyg has joined #ruby
Xeago has quit [Remote host closed the connection]
calderonroberto has quit [Ping timeout: 250 seconds]
maloik has quit [Ping timeout: 260 seconds]
gigetoo has quit [Ping timeout: 260 seconds]
pjs has joined #ruby
Xeago has joined #ruby
jhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gigetoo has joined #ruby
<pjs>
Hey all.. Trying to update redmine from 2.6-stable to 3.0-stable. Doing bundle update gives me compat errors with json module, which isn't installed. See output & gem list here:
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
<jhass>
isn't there a #redmine?
<pjs>
any ideas? I'm not really a Ruby guy so beyond the basics, I'm a little lost.
hooker has quit [Quit: Lost terminal]
<jhass>
I'm tempted to tell you let them deal with their broken bundler setup
<pjs>
jhass, yes, but this isn't necessarily redmine specific. I did ask there
astrobun_ has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
<zenspider>
pjs: you're listing json in your gemfile and other stuff is depending on a different version.
<jhass>
it kinda is in the sense that you as a user shouldn't need to deal with such issues, so if redmine doesn't get its act together to hide them from you, it's kinda their problem to explain them to you
<jhass>
sfmk: since you call your class before you define it
<zenspider>
jhass: I doubt the problem is the resolver... the update past 1.9 seems mostly annoying to teams at this oint
<zenspider>
point
dimik has quit [Ping timeout: 260 seconds]
patdohere has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
<jhass>
zenspider: yeah, we had a fight with them over the whole writing the bundler version to the lock thing
tsou has joined #ruby
<jhass>
zenspider: 1.10 has optional groups though <3
Gnut has quit [Ping timeout: 260 seconds]
IanV0rn2341 has quit [Client Quit]
<pjs>
could the issue be that active support version 3.2.22 and 3.2.21 are already installed and that's an issue for the 4.x.x versions? (just thinking out loud)
<jhass>
pjs: let's try something different. copy your Gemfile somewhere so you have a backup, get a new Gemfile (and Gemfile.lock if they provide one) from the upstream git or a release tarball or something. Do the minimal mess you have to do for redmine to it and run bundle install
<jhass>
pjs: no, it has nothing to do with which gems are installed or not
<jhass>
that's completely irrelevant really
<mg^>
last time I installed Redmine, I grabbed a docker container and used that instead...
arthurnn has quit [Ping timeout: 260 seconds]
maloik has joined #ruby
patdohere has quit [Ping timeout: 260 seconds]
jottr_ has quit [Quit: WeeChat 1.3]
<jbrhbr>
Ox0dea: well, i either missed it in the docs or it isn't documented, but i dug through the code and found that Pry has a truncated output option built-in, although it's not partial display, it's a more draconian approach
<jbrhbr>
you just type 'change-inspector clipped' into the pry console
cwong_on_irc has quit [Quit: Leaving.]
spacemud has quit [Ping timeout: 260 seconds]
tubulife- has joined #ruby
<pjs>
jhass, Just tried.. same thing. The Gemfile from the repo and the one locally were an exact match as well
<jhass>
pjs: wat
<jhass>
then they made a broken release or something
spacemud has joined #ruby
<jhass>
really, go and complain to them to fix their shit
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 250 seconds]
jessemcgilallen has quit [Quit: jessemcgilallen]
krobzaur has quit [Ping timeout: 245 seconds]
maloik has joined #ruby
karapetyan has joined #ruby
casadei has joined #ruby
duncan_bayne has quit [Quit: Page closed]
cmoneylulz has joined #ruby
SleepySensei has quit [Read error: Connection reset by peer]
cmoneylulz has quit [Remote host closed the connection]
pwnd_nsfw has quit [Quit: Leaving]
reoring has quit []
johnhamelink has joined #ruby
pwnd_nsfw has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pwnd_nsfw has quit [Read error: Connection reset by peer]
maloik has quit [Ping timeout: 260 seconds]
<RickHull>
anyone want to help me confirm a bug?
aspiers has quit [Ping timeout: 260 seconds]
casadei has quit [Ping timeout: 245 seconds]
shinenelson has joined #ruby
<RickHull>
hmm, i seem to have found some `ri` weirdness
<RickHull>
on a debian system: type "ri" (no quotes) then <tab key> then "-h"
<RickHull>
then <enter key>
pwnd_nsfw has joined #ruby
braincrash has quit [Quit: bye bye]
<RickHull>
alternatively: "ri<space><tab>-h"
casadei has joined #ruby
<RickHull>
<enter> ... what should happen?
gusTester has left #ruby [#ruby]
karapetyan has quit [Remote host closed the connection]
Eiam_ has joined #ruby
ur5us has quit [Remote host closed the connection]
<RickHull>
compare to: "ls<space><tab>-h<enter>"
grotewold is now known as grotewold[afk]
braincrash has joined #ruby
cycorld has joined #ruby
jdawgaz has quit [Read error: Connection reset by peer]
railswebdev has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
grotewold[afk] is now known as grotewold
<blubjr>
whats your problem
h99h9h88 has quit [Remote host closed the connection]
juddey has quit [Ping timeout: 260 seconds]
<blubjr>
ls -h is for printing file sizes neatly..
cmoneylulz has joined #ruby
<RickHull>
i think it's that `ri -h` opens an interactive console
<RickHull>
but something with tab completion is messing with it on debian
roshanavand has joined #ruby
calderonroberto has joined #ruby
<RickHull>
what happens when you type "ri<space><tab>-h<enter>" ?
casadei has quit [Remote host closed the connection]
<RickHull>
for me, i get a blank prompt, and I have to SIGTERM out of it
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RickHull>
it might just be `-h` weirdness specific to ri
<RickHull>
though i would say that `-h` is the standard help output switch
<RickHull>
but my real problem is with Rye -- it has different behavior for Rye::Set#disable_safe_mode versus Rye::Set#safe = false
<havenwood>
RickHull: ri --help
alem0lars has joined #ruby
<RickHull>
havenwood: what happens with "ri<space><tab>--help<enter>" ?
<RickHull>
i get a blank prompt, waiting for (who knows what) input
<blubjr>
if its the tab that does it i would imagine the problem is with whatever completion your bash is configured with
Guest16359 has joined #ruby
<blubjr>
-h is not standard for help on unix
<RickHull>
i think it is the tab that is pivotal
<RickHull>
i should have a bog standard debian system in this respect
bronson has quit [Remote host closed the connection]
<RickHull>
it is not problematic for e.g. `ls` only `ri` so far
<blubjr>
i dont know about how debian's bash comes preconfigured, but that would be where to look
<blubjr>
ri wont even be seeing the tab
<RickHull>
compare "ls<space><tab>-h<enter>" to "ri<space><tab>--help<enter>"
roshanavand has quit [Ping timeout: 250 seconds]
<RickHull>
totally different behavior on my system
<blubjr>
yes, bash has programmable tab completion
<blubjr>
again, ri won't even be seeing the tab. bash is screwing something up
rikai_ has quit [Ping timeout: 244 seconds]
<RickHull>
only for ri, not for ls?
<RickHull>
based on the behavior, it looks like ri is doing a $stdin.gets before it ought to
<blubjr>
bash has programmable tab completion, ie, it can be set up to complete differently for different commands
baweaver has joined #ruby
grotewold is now known as grotewold[afk]
maloik has joined #ruby
<RickHull>
hm, I haven't done any setup there
rikai has joined #ruby
<blubjr>
the debian maintainers probably did
jdawgaz has joined #ruby
<RickHull>
the closest thing I've done to mess with tab completion for bash is git completion
<RickHull>
anyway, the `ri` thing is just a curiousity
<RickHull>
i was trying to find a valid command on my system that is not on the Rye whitelist of commands
Xeago has joined #ruby
<RickHull>
the main issue I'm having is that Rye::Set#safe is reporting false, yet I'm hitting an exception on a line that strongly implies @safe == true
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arescorpio has quit [Quit: Leaving.]
cmoneylulz has quit [Remote host closed the connection]
daivyk has quit [Read error: Connection reset by peer]
cmoneylulz has joined #ruby
grotewold[afk] is now known as grotewold
pawnbox has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
dfinninger has joined #ruby
Guest16359 has quit [Quit: This computer has gone to sleep]
<RickHull>
there are two ways to disable safe mode for Rye: obj.disable_safe_mode vs obj = Rye::Foo.new(safe: false)
<RickHull>
only the latter seems to work
bronson has joined #ruby
<RickHull>
the former seems broken and looks like a bug
Xeago has quit [Ping timeout: 250 seconds]
<RickHull>
safe mode means that @safe is true and method_missing will raise quickly if the command is not on the whitelist
graydot has joined #ruby
Guest16359 has joined #ruby
<RickHull>
i was trying to use `ri` for a command that is not on the whitelist -- and then I hit the weirdness with tab completion
<RickHull>
a better command that is not on the whitelist is `find`. e.g. Rye::Box.new(host).find '.'
<RickHull>
that will fail, because find is not on the whitelist
calderonroberto has quit [Ping timeout: 250 seconds]
<RickHull>
you can do Rye::Box#disable_safe_mode # seems broken
h99h9h88 has joined #ruby
<RickHull>
or Rye::Box.new(host, safe: false) # works
djbkd has joined #ruby
<RickHull>
in my specific case, I am working with a Rye::Set, a container of Rye::Box
<RickHull>
but the API takes pains to be consistent across Sets vs individual boxes
dfinninger has quit [Client Quit]
solocshaw has quit [Ping timeout: 245 seconds]
juddey has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
lakin has quit [Quit: WeeChat 0.4.2]
djbkd has quit [Quit: My people need me...]
h99h9h88 has quit [Remote host closed the connection]
pawnbox has quit []
graydot has quit [Quit: graydot]
maloik has joined #ruby
cmoneylulz has quit [Remote host closed the connection]
<RickHull>
> I haven't been able to wrangle Net::SSH to do my bidding. "My bidding" in this case, is maintaining an open channel between commands. I'm using Net::SSH::Connection::Session#exec for all commands which is like a funky helper method that opens a new channel each time it's called. This seems to be okay for one-off commands but changing the directory only works for the channel it's executed in. The next time exec is called, there's a new channel
<RickHull>
which is back in the default (home) directory.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<RickHull>
anyone else gone through similar frustrations?
anaeem1 has joined #ruby
slawrence00 has joined #ruby
xelfer has joined #ruby
cdg has joined #ruby
beast has quit [Ping timeout: 244 seconds]
anaeem1 has quit [Read error: Connection reset by peer]
howdoicomputer has quit [Ping timeout: 245 seconds]
anaeem1 has joined #ruby
grotewold has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anaeem1 has quit [Remote host closed the connection]
qiukun has quit [Quit: qiukun]
Klumben has joined #ruby
<xelfer>
ive installed 2.2.3 (on osx el capitan) 3 times and i'm still getting "kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)" on gem install bundle, any ideas what might be wrong here? my google isnt helping
h99h9h88 has joined #ruby
beast has joined #ruby
maloik has joined #ruby
roshanavand has joined #ruby
BlackCoyote has quit [Remote host closed the connection]
<RickHull>
xelfer: paste a gist, with some basic system info
<RickHull>
then a gist with the commands you're running, and the error messages / failures
<RickHull>
the info you've posted so far is insufficient for troubleshooting, at least from here
h99h9h88 has quit [Ping timeout: 245 seconds]
<xelfer>
ah.. even my gist command is no longer working. haha. one sec
<RickHull>
i'm not sure what commands you need for basic system info for Mac OS. `uname -a` `which gem` `gem env` come to mind, at least
<xelfer>
trying that out before trashing my entire rbenv
<RickHull>
though given bash conventions and evaluation rules, i honestly have given up any prediction / expectation
<RickHull>
if it works, great. if not, keep trying
<RickHull>
last resort: try seriously to understand the execution / evaluation model
<xelfer>
yeah, if this fails ill go with Radar's blog and trash .rbenv
peteyg has joined #ruby
CloCkWeRX has quit [Ping timeout: 260 seconds]
saneax_AFK is now known as saneax
codecop has joined #ruby
paradisaeidae has joined #ruby
maloik has joined #ruby
snockerton has joined #ruby
pawnbox has joined #ruby
roshanavand has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<snockerton>
once I have a RestClient::Resource defined with a url, how can i update a single attribute (url) of that object without recreating it from scratch?
qiukun has quit [Quit: qiukun]
<RickHull>
snockerton: probably you can't -- resource is a noun-oriented approach
<snockerton>
i define a RestClient::Resource object with a bunch of custom options + headers, then need to pass entire (new) urls to it, rather than appending to the url
roshanavand has quit [Ping timeout: 250 seconds]
karapetyan has quit [Remote host closed the connection]
<snockerton>
i have to do GETs on lots of urls, and was hoping to just pass the entire thing to RestClient without carving up the URI and using the resource[suffix] syntax
<RickHull>
the resource abstraction wants to be 1-1 from URL - resource
<RickHull>
so you don't want to make 1 resource that represents many URLs
<snockerton>
drat
<RickHull>
there are many alternative models
karapetyan has joined #ruby
<snockerton>
i also tried doing one offs of `RestClient.get( url, headers )` - but I need to add verify_ssl: false
<snockerton>
this only seems to work as an option with Resource.new
<RickHull>
yeah, that is probably the right approach
karapetyan has quit [Read error: Connection reset by peer]
<snockerton>
cool gem btw
<RickHull>
please let me know if it works for your use case
<RickHull>
and if not, why not
pontiki has quit [Ping timeout: 272 seconds]
<Radar>
xelfer: how'd it go?
<RickHull>
one problem is: lacking robust https support
pontiki has joined #ruby
<snockerton>
i just need verify_ssl: false
<RickHull>
that should be trivial
<RickHull>
not sure about your use case
<snockerton>
laziness
<RickHull>
well, get unlazy
karapetyan has joined #ruby
<RickHull>
step 1: don't be lazy. step 2: get unlazy
karapetyan has quit [Remote host closed the connection]
<RickHull>
important corollary: if the reason you are asking a question here is laziness: don't
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<snockerton>
s/laziness/internal political issues/
karapetyan has joined #ruby
<RickHull>
fair enough...
Cork has quit [Ping timeout: 246 seconds]
karapetyan has quit [Read error: Connection reset by peer]
<RickHull>
but setting that particular option should be no trouble for RestClient::Resource -- without Mudbug
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
jackcom has joined #ruby
ta has quit [Remote host closed the connection]
RickHull has joined #ruby
bronson has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 260 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
mary5030 has joined #ruby
edwinvdg_ has joined #ruby
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
edwinvdgraaf has quit [Ping timeout: 250 seconds]
roxtrongo has quit [Read error: Connection reset by peer]
roxtrongo has joined #ruby
edwinvdg_ has quit [Ping timeout: 250 seconds]
mary5030 has quit [Ping timeout: 260 seconds]
RickHull has left #ruby [#ruby]
krz has joined #ruby
ff7f00 has joined #ruby
haraoka has joined #ruby
roshanavand has joined #ruby
mooru has joined #ruby
aganov has joined #ruby
lxsameer has joined #ruby
karapetyan has joined #ruby
cycorld has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
cycorld has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
<ff7f00>
Hi, I just created a new gem using the "bundle gem tool-subtool" command. This organizes my gem into Tool::Subtool where Tool and Subtool are both modules. The problem is that for this gem it makes more sense for Subtool to be a class. However my directory structure also includes tool/subtool/package.rb where Tool::Subtool::Package.new would also make sense. Should I instead leave Subtool as a module and do something like Tool::Subtool::SubtoolInstance.new?
karapetyan has joined #ruby
<ff7f00>
(sorry, struggling a bit on how to explain this and that's the best I could do)
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby
claw has quit [Ping timeout: 245 seconds]
karapetyan has quit [Read error: Connection reset by peer]
tomchapin has joined #ruby
<xybre>
ff7f00: The general pattern is to use the top level namespace of your gem (Subtool in this case) for one or two invokation/helper methods and then put all the actual functionality into objects in that namespace.
karapetyan has joined #ruby
<ff7f00>
xybre: all right, yea that's the feeling I got. I think I found a class name that will make sense here. thanks
skade has joined #ruby
ss_much has joined #ruby
trautwein has joined #ruby
tagrudev has joined #ruby
<shevy>
ff7f00 I often found that, the simpler to use an API the better; Tool::Subtool::Package.new would strike me intuitively as easier to use than Tool::Subtool::SubtoolInstance.new; you could also add to the Subtool namespace and make e. g. a module method there, depending on what it does. like, I dunno ... Tool::Subtool.create_project('dragons')
karapetyan has quit [Read error: No route to host]
qiukun has quit [Quit: qiukun]
rony has joined #ruby
rony has left #ruby [#ruby]
claw has joined #ruby
maloik has joined #ruby
yardenbar has joined #ruby
sapslaj_ has quit [Ping timeout: 240 seconds]
sapslaj has joined #ruby
roshanavand has joined #ruby
aufi has joined #ruby
mooru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
maloik has quit [Ping timeout: 245 seconds]
towski_ has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
ta has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
timonv has joined #ruby
rghose has quit [Quit: Leaving.]
rghose has joined #ruby
lokulin has quit [Changing host]
lokulin has joined #ruby
pawnbox has quit [Remote host closed the connection]
vdamewood has joined #ruby
<blubjr>
whats the best way to capitalise the first alpha char in a string
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Client Quit]
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
akosednar has quit [Quit: byeee....]
maloik has joined #ruby
stannard has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
gaussblurinc1 has joined #ruby
jas02 has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
maloik has quit [Ping timeout: 245 seconds]
skade has joined #ruby
qiukun has quit [Quit: qiukun]
zast has quit [Quit: Leaving.]
ta has quit [Remote host closed the connection]
<blubjr>
so im calling a method on an object, using case to pick which method to call. in lisp i would write (funcall (cond (case-1 fn-1) (case-2 fn-2)) obj), is that sort of thing done in ruby, and if so how do you write it, or should i just have when case_1; obj.fn_1; when case_2; obj.fn_2
bronson has joined #ruby
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
qiukun has joined #ruby
Guest90599 is now known as aps
gambl0re has quit [Read error: Connection reset by peer]
gambl0re has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
tvw has joined #ruby
bronson has joined #ruby
kerunaru has joined #ruby
maloik has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
<shevy>
you could try via .send
solars has joined #ruby
<shevy>
via .instance_methods(false) you should be able to reliably determine what methods your object responds to, then you could use .select to find the proper match
maloik has quit [Ping timeout: 245 seconds]
kerunaru has joined #ruby
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
kerunaru has quit [Read error: Connection reset by peer]
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
Gnut has quit [Ping timeout: 260 seconds]
JamesArlen has joined #ruby
<JamesArlen>
I HATE RUBY
<JamesArlen>
why does such an awful language exist?
kerunaru has joined #ruby
<JamesArlen>
so much room to make mistakes with ruby that it's not even funny
bronson has quit [Remote host closed the connection]
snockerton has quit [Quit: Leaving.]
<JamesArlen>
finding syntax errors in ruby is horrible
vdamewood has quit [Quit: Life beckons.]
<shevy>
lol
<shevy>
our good old webchatster friend has returned
solars has quit [Quit: WeeChat 0.4.2]
ff7f00 has quit [Quit: Leaving.]
andikr has joined #ruby
solars has joined #ruby
<blubjr>
ty shevy
<JamesArlen>
why are you a fucking NIGGER shevy
<shevy>
countdown started!
<havenwood>
!ban JamesArlen !P racism
JamesArlen was banned on #ruby by ChanServ [JamesArlen!*@*]
JamesArlen was kicked from #ruby by ChanServ [Banned: racism]
kerunaru has quit [Read error: Connection reset by peer]
kerunaru has joined #ruby
qiukun has quit [Quit: qiukun]
Macaveli has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
rghose has quit [Quit: Leaving.]
skade has quit [Quit: Computer has gone to sleep.]
qiukun has joined #ruby
rghose has joined #ruby
PaulCapestany has quit [Quit: .]
sigurding has joined #ruby
ur5us has joined #ruby
anisha has joined #ruby
kerunaru has joined #ruby
weemsledeux has joined #ruby
PaulCapestany has joined #ruby
cycorld has quit [Remote host closed the connection]
qiukun has quit [Remote host closed the connection]
thisuser has quit [Ping timeout: 260 seconds]
qiukun has joined #ruby
Emmanuel_Chanel has joined #ruby
tvw has quit []
sandstrom has joined #ruby
timonv has quit [Ping timeout: 250 seconds]
vikas027 has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
blaxter has joined #ruby
kerunaru has joined #ruby
Shapeshifter has joined #ruby
ur5us has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
<Shapeshifter>
Is there a name for when doing something like Config[:some_prop]? and what exactly would this do? Does it check whether the property exists or does it check if it's true?
skade has joined #ruby
baweaver has quit [Remote host closed the connection]
<apeiros>
Shapeshifter: [] is a method in ruby, it just has a sugared syntax.
bweston92 has joined #ruby
<apeiros>
i.e., the name of the method is "[]". you can call it like any other method too: Config.[](:some_prop). and Config[:some_prop] is just syntax sugar for that.
edwinvdgraaf has joined #ruby
<apeiros>
and like all methods, what [] does depends on the object you call it on. in most classes it's looking up a value by key or index (like Hash/Array)
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
qiukun has quit [Remote host closed the connection]
desmondhume has quit [Read error: Connection reset by peer]
desmondhume has joined #ruby
kerunaru has joined #ruby
poorBastard has joined #ruby
InvGhost has joined #ruby
<xybre>
Shapeshifter: most types that use [] will return nil if nothing is found
kerunaru has quit [Read error: Connection reset by peer]
<al2o3-cr>
Shapeshifter: fetch can return a default value happy days
Puffball has quit [Read error: Connection reset by peer]
<xybre>
s/use/respond_to
vondruch has joined #ruby
Puffball has joined #ruby
kerunaru has joined #ruby
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
howdoicomputer has joined #ruby
al2o3-cr has quit [Ping timeout: 260 seconds]
al2o3-cr has joined #ruby
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
marr has joined #ruby
qiukun has quit [Remote host closed the connection]
kerunaru has joined #ruby
qiukun has joined #ruby
howdoicomputer has quit [Ping timeout: 250 seconds]
kerunaru has quit [Read error: Connection reset by peer]
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
edwinvdgraaf has quit []
qiukun has quit [Remote host closed the connection]
stan has joined #ruby
kerunaru has joined #ruby
qiukun has joined #ruby
qiukun has quit [Remote host closed the connection]
kerunaru has quit [Read error: Connection reset by peer]
qiukun has joined #ruby
qiukun has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
qiukun has joined #ruby
desmondhume has quit [Remote host closed the connection]
desmondhume has joined #ruby
kerunaru has joined #ruby
unshadow has joined #ruby
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
symm- has quit [Ping timeout: 260 seconds]
kerunaru has quit [Read error: Connection reset by peer]
rghose has joined #ruby
qiukun has quit [Remote host closed the connection]
kerunaru has joined #ruby
qiukun has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
adeponte has left #ruby [#ruby]
al2o3-cr has quit [Quit: WeeChat 1.3]
bMalum has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
al2o3-cr has joined #ruby
devbug has joined #ruby
Macaveli has joined #ruby
kerunaru has joined #ruby
poorBastard is now known as freddyG
freddyG has quit [Quit: Leaving]
kerunaru has quit [Read error: Connection reset by peer]
Xzanron has joined #ruby
dlitvak has joined #ruby
kerunaru has joined #ruby
sdoda has joined #ruby
adeponte has joined #ruby
blaxter has quit [Ping timeout: 250 seconds]
haraoka has quit [Ping timeout: 260 seconds]
kerunaru has quit [Read error: Connection reset by peer]
glenny has joined #ruby
qiukun has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 260 seconds]
rghose1 has joined #ruby
rghose1 has quit [Max SendQ exceeded]
glenny has quit [Read error: Connection reset by peer]
rghose1 has joined #ruby
rghose1 has quit [Max SendQ exceeded]
rghose1 has joined #ruby
glenny has joined #ruby
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
davedev2_ has quit [Remote host closed the connection]
rghose has quit [Ping timeout: 250 seconds]
ruby-lang730 has joined #ruby
<TomyWork>
hi
qiukun has joined #ruby
b0yzn01z3 has joined #ruby
<TomyWork>
i've traced a proxy problem from gitlab to httparty to Net::HTTP. The problem is that it seems to ignore the "no_proxy" environment variable. Is there anything I can do about it? like setting a different environment variable that it doesnt ignore?
kerunaru has joined #ruby
stannard has joined #ruby
rodfersou has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
baweaver has joined #ruby
<xybre>
TomyWork: what versions?
<TomyWork>
gitlab 7.1.1, let me check the other ones
diegoaguilar has quit [Remote host closed the connection]
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
<TomyWork>
however, the part that invokes Net::HTTP is HTTParty, which is a gem used by gitlab. that's 2 layers removed from what i'm willing to mess with
BSaboia has joined #ruby
cwong_on_irc has quit [Quit: Leaving.]
howdoi has joined #ruby
kerunaru has joined #ruby
<xybre>
Hmm, I don't know too much about gitlab itself, but I'm not seeing no_proxy mentioned in its source code.
<xybre>
Ditto with HTTParty.
kerunaru has quit [Read error: Connection reset by peer]
symm- has joined #ruby
<xybre>
It is mentioned in URI though.
yfeldblum has quit [Quit: Leaving...]
kerunaru has joined #ruby
ss_much has quit [Quit: Connection closed for inactivity]
<Bish>
i need to patch a gem, what's the best approach to do that?
kerunaru has quit [Read error: Connection reset by peer]
<Bish>
install locally? patch?
symm- has quit [Ping timeout: 260 seconds]
kerunaru has joined #ruby
yfeldblum has joined #ruby
ur5us has quit [Remote host closed the connection]
mooru has quit [Ping timeout: 260 seconds]
yfeldblum has quit [Remote host closed the connection]
mooru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
nettoweb has joined #ruby
<pontiki>
fork it, install that version? send back the PR and wait for the owner to merge it
<pontiki>
idk, i tend to forget to look for updates when i do that :(
<Bish>
how do i fork a gem?
<adaedra>
Go the the GitHub page, click "Fork"
<Bish>
or do you mean like, on filsystem level
<Bish>
yeah okay.. sigh
<pontiki>
i'm assuming it's source is on github or bitbucket
<Bish>
yeah and i have a feeling that people would never use my patch
<pontiki>
yeah, and then you're sort of stuck with that dance forever
<adaedra>
Do a PR afterwards to have it merged upstream?
<xybre>
Bish: is it possible to wrap the gem instead of modifying the source?
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
<Bish>
xybre, im afraid not, because the gem will use that class, even if i create my own, could make monkeypatch it, but i already done that too much :D
<Bish>
and the fact there is a comment "this is not like rails does it herpderp" does tell me, they don't want it that way
<Bish>
since the comment is longer than the code that would actually do it
<xybre>
Bish: if you can't work around it, then you'll have to either not use that gem, or else monkey patch it :(
kerunaru has quit [Read error: Connection reset by peer]
Anderson69s has quit [Client Quit]
<Bish>
same thing :D
<adaedra>
But yeah, you have to define the constant somewhere if you want to use it
simplyianm has quit [Remote host closed the connection]
<Bish>
so i will stick with argumenterror :D
Anderson69s has joined #ruby
<adaedra>
It's good to have specialized error classes, it allows to filter errors
RegulationD has quit [Ping timeout: 250 seconds]
<Bish>
yeah i know, but i am lazy, and i have to get this done ;D
th0m__ has joined #ruby
<Bish>
instead i am monkey patching.
brunto has joined #ruby
sigurding has joined #ruby
kerunaru has joined #ruby
<Bish>
>> exception handling to the rescue
<ruboto>
Bish # => /tmp/execpad-40d92a83d453/source-40d92a83d453:3: syntax error, unexpected keyword_rescue ...check link for more (https://eval.in/478394)
kerunaru has quit [Read error: Connection reset by peer]
<Bish>
giggles are always worth it
Macaveli has joined #ruby
<adaedra>
This is not you average lazyness. This is... advanced lazyness.
krz has quit [Quit: WeeChat 1.2]
sepp2k has joined #ruby
<adaedra>
laziness, even.
Rickmasta has joined #ruby
vakor has joined #ruby
<Bish>
you'd be surprised
<Bish>
this is not even my final form.
<TomyWork>
xybre i figured it out. Net::HTTP supports no_proxy, but not the suffix syntax wget etc. support
<TomyWork>
no wildcards either
<TomyWork>
since i just need a single host, i added that explicitly
kerunaru has joined #ruby
Coldblackice has quit [Ping timeout: 276 seconds]
kerunaru has quit [Read error: Connection reset by peer]
yardenbar has quit [Ping timeout: 250 seconds]
gaussblurinc1 has joined #ruby
gaussblurinc1 has quit [Client Quit]
dionysus69 has quit [Ping timeout: 250 seconds]
vasilakisfil has joined #ruby
sankaber has joined #ruby
decoponio has joined #ruby
kerunaru has joined #ruby
InvGhost has quit [Ping timeout: 264 seconds]
vasilakisfil has quit [Read error: Connection reset by peer]
vasilakisfil has joined #ruby
arup_r has quit [Remote host closed the connection]
ibouvousaime has joined #ruby
gaussblurinc1 has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
vasilakisfil_ has joined #ruby
allcentury has joined #ruby
vasilakisfil__ has joined #ruby
vasilakisfil has quit [Ping timeout: 240 seconds]
b0yzn01z3 has quit [Remote host closed the connection]
symm- has joined #ruby
kerunaru has joined #ruby
jdawgaz has joined #ruby
gaussblurinc1 has joined #ruby
gaussblurinc1 has quit [Client Quit]
karapetyan has joined #ruby
vasilakisfil_ has quit [Client Quit]
vasilakisfil has joined #ruby
b0yzn01z3 has joined #ruby
dhjondoh has quit [Remote host closed the connection]
gaussblurinc1 has joined #ruby
gaussblurinc1 has quit [Client Quit]
karapetyan has quit [Remote host closed the connection]
kerunaru has quit [Read error: Connection reset by peer]
dhjondoh has joined #ruby
shredding has quit [Ping timeout: 260 seconds]
Vitor_ has joined #ruby
TheBloke has joined #ruby
tk_ has joined #ruby
<shevy>
hmmm
<shevy>
rescue nil is quite cool
vasilakisfil__ has quit [Ping timeout: 240 seconds]
<shevy>
I wonder if we could do it shorter
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
arup_r has joined #ruby
<Bish>
x=['exception handling to']['the']
<Bish>
:3
<Bish>
or was it irony because everything undefined is nil?
benlovell has joined #ruby
joonty has quit [Quit: joonty]
yardenbar has joined #ruby
arup_r has quit [Ping timeout: 250 seconds]
kerunaru has joined #ruby
yoongkang has quit [Remote host closed the connection]
arup_r has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
stannard has joined #ruby
toretore has joined #ruby
CloCkWeRX has joined #ruby
postmodern has quit [Quit: Leaving]
nertzy has joined #ruby
xfbs has joined #ruby
kerunaru has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
stannard has quit [Ping timeout: 260 seconds]
JDiPierro has joined #ruby
<xybre>
TomyWork: interesting, good to know
<shevy>
Bish well you made bare words work above there via rescue nil
Robert___ has joined #ruby
<shevy>
the only other way I know of how to do this is by using method_missing
shanemcd has joined #ruby
<shevy>
Imagine if it would be some special token or something
<shevy>
hmm... can't think of something shorter than "rescue nil" though
kerunaru has quit [Read error: Connection reset by peer]
CloCkWeRX has quit [Read error: Connection reset by peer]
<adaedra>
shevy: like Ox0dea's rugen does?
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CloCkWeRX has joined #ruby
SOLDIERz has joined #ruby
bronson has joined #ruby
Elysia has joined #ruby
<Bish>
next challenge, how do i save that stuff in a database :/ why did i take sql
<Bish>
gee.
<adaedra>
Sequel!
<shevy>
adaedra what is rugen? if it is by Ox then it is most likely really scary
<Bish>
yeah i already use sequel, its great, but doesn't help me much with unspecified amount of columns
Ropeney has joined #ruby
InvGhost has joined #ruby
<adaedra>
shevy: github -> Ox0dea/rugen
<adaedra>
s/Ox/0x/
casadei has joined #ruby
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
SalviaNobile has joined #ruby
xfbs has quit []
Ropeney has quit [Client Quit]
shanemcd has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
mooru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Bish>
storing json in mysql feels so dirty :/ 5.7 has a datatype for that but still
cycorld has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 260 seconds]
kerunaru has joined #ruby
<arup_r>
I am trying to refactor this ugly code, https://gist.github.com/aruprakshit/156ea9040da0213aebc5 .. I tried twice to make it beautiful, but failed. I only see 3 classes can be extracted from there.. but not able to see what behaviours are common.. Not able to apply Inhritance there..
<arup_r>
any hints.. from where to start ?
<Bish>
use case and when?
User458764 has joined #ruby
sdothum has joined #ruby
connor_goodwolf has joined #ruby
<arup_r>
asking me ?
kerunaru has quit [Read error: Connection reset by peer]
kerunaru has joined #ruby
InvGhost has quit [Ping timeout: 260 seconds]
yardenbar has quit [Ping timeout: 260 seconds]
<NET||abuse>
hi guys. i'm trying to debug yaml files,,, puppet stuff.... i use ruby -e "require 'yaml'; YAML.load_file '/etc/puppet/hiera/locations/aws/prod/jenkins.yaml';" and i get /usr/share/ruby/psych.rb:205:in `parse': (/etc/puppet/hiera/locations/awseuwest1/dotcom/prod/jenkins.yaml): did not find expected key while parsing a block mapping at line 2 column 1 (Psych::SyntaxError)
<Bish>
asking you if you know that would be a good idea, since it's exactly the case for what case is for
<Bish>
for the rest: you cannot make it pretty, since having the version decided in the protocol isn't pretty to begin with
kerunaru has quit [Read error: Connection reset by peer]
<gregf_>
arup_r: i'd just create 3 private methods? assuming those variables are globals
d0nn1e has quit [Ping timeout: 260 seconds]
sdoda has quit [Ping timeout: 260 seconds]
`derpy has quit [Remote host closed the connection]
adaedra has quit [Remote host closed the connection]
<arup_r>
you mean each inner if-else is one method ?
devbug_ has quit [Ping timeout: 245 seconds]
baweaver has joined #ruby
rghose1 has quit [Quit: Leaving.]
<arup_r>
those if-else code has repetition ,, but not much common in between though, so it is hard to refactor
<apeiros>
NET||abuse: so your yaml files has invalid syntax starting latest at line 2, column 1
d0nn1e has joined #ruby
<apeiros>
NET||abuse: can't say more without seeing the yaml
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
<NET||abuse>
apeiros: i've copied and pasted the first few lines from the alternate jenkins.yaml in stage directory, and it's not working.
adaedra has joined #ruby
rghose has joined #ruby
psantos has joined #ruby
<arup_r>
but I was trying it to do.. when I ended up with 3 classes, but really couldn't throw out those if-else .. there are sticked like a tatto
<apeiros>
NET||abuse: given that it says *line 2*, that's quite expected.
<NET||abuse>
line 2 of the yaml file yes? I've take the first 10 or so lines from a working file and copied and pasted them in and it's not working.
JDiPierro has quit [Remote host closed the connection]
<gregf_>
arup_r: right, also i dont get that return. it will 'always' return?
<apeiros>
NET||abuse: I can't help with "not working" either.
<gregf_>
oh, theres more code that follows :|
troulouliou_div2 has joined #ruby
<apeiros>
as said: gist yaml and exception
<arup_r>
gregf_: it is a Rails code, but Ruby thing.. So in benteen when I am rendering, need to HARD return
`derpy has joined #ruby
<apeiros>
arup_r: no you don't.
<apeiros>
arup_r: you need to control your flow so that nothing else happens
baweaver has quit [Ping timeout: 260 seconds]
<arup_r>
apeiros: after the if-else also some code they also render, so before them if I want to render and I need to return to avoid double render exception
<apeiros>
"I need return" translates to "I do stuff after those lines unconditionally, but shouldn't under certain conditions, therefore I do (not need) return"
<apeiros>
arup_r: see? nailed it.
<apeiros>
don't justify bad code with the presence of other bad code.
<NET||abuse>
apeiros: I mean, i have stage/jenkins.yaml and /prod/jenkins.yaml The former file works, prod/jenkins.yaml has the error "line 2 column 1" error,,, then i copied and pasted the first 10 or so lines from stage/jenkins.yaml into prod/jeknins.yaml overwritting those lines.. and it still returns the same error
kerunaru has joined #ruby
<apeiros>
NET||abuse: then something isn't working the way you assume it to work. anyway, with the given information, I can't help.
<pontiki>
NET||abuse: gist the bloodly file, it'd help oh so much
kerunaru has quit [Read error: Connection reset by peer]
hanmac1 has quit [Ping timeout: 250 seconds]
<arup_r>
this is the codebase I got and I need to add feature,, it is not me .. it is someone else, but I am trying to give it a shape.. but I am failed now. :)
<arup_r>
it is a result of not reviewed codebase.. it became a shit now
yfeldblum has quit [Ping timeout: 250 seconds]
<apeiros>
arup_r: no wonder if you stop half-way.
<apeiros>
arup_r: either give it a shape or leave it be. half-arsed stuff won't help anybody.
User458764 has quit [Ping timeout: 260 seconds]
<apeiros>
in the opposite - it'll only make things worse
<arup_r>
you are correct
<arup_r>
it is hard
<arup_r>
I will add featured in between those if-else..
ibouvousaime has quit [Ping timeout: 260 seconds]
<NET||abuse>
apeiros: i'll setup a gist or something, give me a few mins.
<arup_r>
what a job I got.. :/
<NET||abuse>
pontiki: no need for abbrasiveness.. we're all friends here..
<pontiki>
are we?
<pontiki>
then why don't you do what's been asked several times?
kerunaru has joined #ruby
<NET||abuse>
pontiki: sometimes it's hard to paste things due to content, passwords, company privacy,, so it's not always obvious
* apeiros
wouldn't have categorized that as abrasive
<arup_r>
apeiros: thanks for the suggestion though.
User458764 has joined #ruby
<pontiki>
that is in the first two lines of you yaml file??
<apeiros>
NET||abuse: that just means you have to work a bit harder.
aryaching has joined #ruby
sdoda has joined #ruby
<apeiros>
as in: replace sensitive information by non-sensitive information.
<NET||abuse>
apeiros: yup, i'm donig that, just taking a minute to prepare the files
<apeiros>
but as pontiki suggested - yaml reports an error in the 2nd line. you can just cut everything after.
* apeiros
brb
kerunaru has quit [Read error: Connection reset by peer]
<NET||abuse>
pontiki: the mystery is that the first 2 lines of the file are identical to the first 2 lines of a file that works fine.
TomPeed has joined #ruby
allcentury has quit [Ping timeout: 260 seconds]
Robert___ has quit [Ping timeout: 250 seconds]
ibouvousaime has joined #ruby
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
jas02 has joined #ruby
Anderson69s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
howdoicomputer has joined #ruby
gusTester has joined #ruby
shredding has joined #ruby
nateberkopec has joined #ruby
dhjondoh has quit [Remote host closed the connection]
dhjondoh has joined #ruby
hanmac has joined #ruby
kerunaru has joined #ruby
sdoda has quit [Quit: Leaving]
howdoicomputer has quit [Ping timeout: 245 seconds]
kerunaru has quit [Read error: Connection reset by peer]
Anderson69s has joined #ruby
tvw has quit [Ping timeout: 240 seconds]
sgambino has joined #ruby
bluOxigen has joined #ruby
kerunaru has joined #ruby
xfbs has joined #ruby
ta_ has quit [Remote host closed the connection]
gaussblurinc1 has joined #ruby
<apeiros>
NET||abuse: that sounds more and more like it's not loading the file you think it's loading
TheBloke has quit [Read error: Connection reset by peer]
kerunaru has quit [Read error: Connection reset by peer]
aryaching has quit [Ping timeout: 250 seconds]
TheBloke has joined #ruby
xfbs has quit [Client Quit]
stamina has joined #ruby
dhjondoh has quit [Remote host closed the connection]
dhjondoh has joined #ruby
aryaching has joined #ruby
wprice has joined #ruby
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
joonty has joined #ruby
psantos has quit [Read error: Connection reset by peer]
psantos has joined #ruby
sepp2k has quit [Ping timeout: 245 seconds]
bMalum has joined #ruby
cycorld has joined #ruby
sphex has joined #ruby
voodo has joined #ruby
kerunaru has joined #ruby
TomPeed is now known as pdev_memories
yoongkang has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
mooru has joined #ruby
TheHodge has joined #ruby
xfbs has joined #ruby
joonty has quit [Quit: joonty]
bMalum has quit [Ping timeout: 250 seconds]
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
vikas027 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kerunaru has quit [Read error: Connection reset by peer]
darkxploit has joined #ruby
vikas027 has joined #ruby
akem has joined #ruby
andikr has quit [Remote host closed the connection]
TheBloke has joined #ruby
psantos has quit [Read error: Connection reset by peer]
_stu_ has joined #ruby
aganov has quit [Remote host closed the connection]
psantos has joined #ruby
kerunaru has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
GinoManWorks has joined #ruby
rodfersou is now known as rodfersou|lunch
psantos has quit [Read error: Connection reset by peer]
JDiPierro has quit [Remote host closed the connection]
psantos has joined #ruby
<GinoManWorks>
Hey, I'm on windows and I noticed that there are two *.a files in the "lib" directory of my ruby installation. one is libx64-msvcrt-ruby210.dll.a and the other is libx64-msvcrt-ruby210-static.a... shouldn't those have a .dll, and .lib extension respectively?
psantos has quit [Read error: Connection reset by peer]
pdoherty has joined #ruby
kerunaru has joined #ruby
psantos has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
<symm->
dll files can be any extension if you load them explicitly with LoadLibrary
InvGhost has joined #ruby
<symm->
I have libx64-msvcrt-ruby210.dll.a too on windows... and it's not even a PE/DLL file
gaussblurinc1 has joined #ruby
joonty has joined #ruby
casadei has joined #ruby
mooe has quit [Quit: Connection closed for inactivity]
allcentury has joined #ruby
vikas027 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kerunaru has joined #ruby
Guest16359 has quit [Ping timeout: 260 seconds]
diegoviola has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
nateberkopec has quit [Quit: Leaving...]
unshadow has quit [Quit: leaving]
kerunaru has joined #ruby
svoop has joined #ruby
DurstBurger has joined #ruby
minimalism has quit [Quit: leaving]
kerunaru has quit [Read error: Connection reset by peer]
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
rghose has quit [Quit: Leaving.]
maloik has quit [Ping timeout: 250 seconds]
kerunaru has joined #ruby
frem has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
DurstBurger has quit [Ping timeout: 260 seconds]
stannard has joined #ruby
maloik has joined #ruby
vasilakisfil_ has quit [Read error: Connection reset by peer]
InvGhost has quit [Ping timeout: 260 seconds]
nateberkopec has joined #ruby
tagrudev has quit [Remote host closed the connection]
benlovell has quit [Quit: Lost terminal]
arup_r has quit [Remote host closed the connection]
griffindy has joined #ruby
maloik has quit [Ping timeout: 245 seconds]
pwnd_nsfw has quit [Ping timeout: 260 seconds]
maloik has joined #ruby
DexterLB has quit [Ping timeout: 260 seconds]
pestle has quit [Ping timeout: 260 seconds]
Nilium has quit [Ping timeout: 260 seconds]
simplyianm has joined #ruby
last_staff has quit [Quit: last_staff]
gf3 has joined #ruby
mooru has quit [Ping timeout: 250 seconds]
amoeba_ has joined #ruby
sankaber has quit [Remote host closed the connection]
DexterLB has joined #ruby
pestle has joined #ruby
last_staff has joined #ruby
sankaber has joined #ruby
psantos has quit [Read error: Connection reset by peer]
amoeba has quit [Killed (leguin.freenode.net (Nickname regained by services))]
amoeba_ is now known as amoeba
psantos has joined #ruby
rghose has joined #ruby
amoeba` has joined #ruby
RegulationD has joined #ruby
simplyianm has quit [Ping timeout: 250 seconds]
roxtrongo has quit [Read error: Connection reset by peer]
Nilium has joined #ruby
dmonster has quit [Quit: Leaving]
anisha has quit [Quit: Leaving]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jackcom has joined #ruby
jackcom has left #ruby [#ruby]
roxtrongo has joined #ruby
infernix has quit [Ping timeout: 250 seconds]
psantos has quit [Read error: Connection reset by peer]
yardenbar has quit [Ping timeout: 245 seconds]
grill has joined #ruby
psantos has joined #ruby
mjuszczak has joined #ruby
zotherstupidguy has quit [Quit: WeeChat 1.3]
pwnd_nsfw has joined #ruby
last_staff has quit [Quit: last_staff]
pandaant has joined #ruby
suchness has quit [Ping timeout: 246 seconds]
moeabdol1 has joined #ruby
momomomomo has joined #ruby
gaussblurinc1 has joined #ruby
Guest16359 has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
saneax_AFK is now known as saneax
howdoicomputer has joined #ruby
<ljarvis>
can anyone recommend a gem for handling cc validation? (luhn alg but with more functionality for ex)
<apeiros>
ljarvis: if all you want is luhn, then that's trivial to implement. recognizing the cc type is a bit of more work. but mostly just a lookup. I have some code lying around already (not yet used in prod, though)
<ljarvis>
yeah, maybe I shouldnt care about that
<ljarvis>
right now we ask for the type anyway, and I don't care much about validating against the type. Maybe in the future
<apeiros>
oh, though, my code is based on a library I haven't released yet :-/
<ljarvis>
I guess I'm over complicating it and I probably just want luhn
<yorickpeterse>
ljarvis: regex
* yorickpeterse
runs
<apeiros>
yeah, well, luhn really is trivial. and given how trivial it is, I'd assume the link you showed will work just fine.
<jhass>
dreamscape: that's hard to estimate, given you didn't describe your problem at all
<millerti>
I'm encountering something weird. I'm calling a method using the splat operator. The array being splatted may have 2 or 3 elements. So I have 2 and 3-argument versions of the method being called. However, when I call using splat, I get an error that I'm passing 2 instead of 3 arguments. Have I encounted a weird Ruby corner case?
pandaant has quit [Remote host closed the connection]
<havenwood>
dreamscape: Have it installed yet? What's not working?
<mozzarella>
millerti: show code and error
<jhass>
millerti: probably not, can't judge without seeing code and real error message
bronson has quit [Ping timeout: 260 seconds]
nfk|laptop has quit [Quit: yawn]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<argoneus>
I'm starting out with ruby and all the time I see code like Configurer do |config| config.bla end, is there a name for this?
<havenwood>
argoneus: A block?
<havenwood>
argoneus: The `|config|` is a block argument.
<jhass>
argoneus: not really, it's just calling a block and yielding an object with accessors to it
Jardayn has joined #ruby
<dreamscape>
yes i have Ruby
hxegon has joined #ruby
<havenwood>
dreamscape: And it's version 1.9+ as well?
Ox0dea has joined #ruby
gsingh93 has joined #ruby
<dreamscape>
not to worry I've got it working now :) thank you for your help
<Ox0dea>
argoneus: I've seen it referred to as a "configurator", but that's not particularly great.
<argoneus>
hm
<havenwood>
dreamscape: Yell if you get stuck. Happy coding!
<dreamscape>
thank you
Spleeze has joined #ruby
<Ox0dea>
centrx: For what it's worth, Ruby is sufficiently malleable that you can essentially bolt on "method overloading": https://eval.in/434678
<argoneus>
I guess I need to read up on a bit more
<Ox0dea>
It's not something you should actually do, of course, but I think it's a really neat trick.
<argoneus>
this "object do |bla|" syntax is new to me still
<centrx>
neato
<Ox0dea>
argoneus: s/object/method/
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kies has joined #ruby
robbyoconnor has joined #ruby
InvGhost has joined #ruby
anti-freeze has joined #ruby
codecop has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
sigurding has quit [Quit: sigurding]
InvGhostt has joined #ruby
momomomomo has quit [Quit: momomomomo]
gaussblurinc1 has joined #ruby
roxtrongo has joined #ruby
InvGhosttt has joined #ruby
maloik has joined #ruby
sigurding has joined #ruby
TheBloke- has joined #ruby
TheBloke has quit [Read error: Connection reset by peer]
<argoneus>
ah
<argoneus>
so basically the method do |stuff| stuff
<argoneus>
basically the method yields values and I process them, right?
InvGhost has quit [Ping timeout: 264 seconds]
gaussblurinc1 has joined #ruby
InvGhostt has quit [Ping timeout: 264 seconds]
kies has quit [Ping timeout: 260 seconds]
hectortrope has quit [Remote host closed the connection]
<jhass>
argoneus: usually you just yield an object with accessors, class Config; attr_accessor :foo; end; def configure; config = Config.new; yield config; config; end; result = configure |config| config.foo = "bar"; end; result.foo #=> "bar"
gaussblurinc1 has quit [Client Quit]
roxtrongo has quit [Ping timeout: 260 seconds]
<jhass>
er plus the missing do
maloik has quit [Ping timeout: 245 seconds]
<jhass>
I returned the Config instance here, but usually you would save it to an instance variable or something
<argoneus>
why yield config; config;?
Vitor_ has quit [Remote host closed the connection]
towski_ has joined #ruby
<argoneus>
so it returns config?
momomomomo has joined #ruby
<jhass>
yield config calls the block and passes config as the first argument
<jhass>
the second config just returns it from the method call
<jhass>
replace ; with newlines
Couch has quit [Ping timeout: 260 seconds]
<argoneus>
so that way I can both use it with a block
<argoneus>
or just do something like config = configurer
momomomomo has quit [Client Quit]
gaussblurinc1 has joined #ruby
based_pdev_ has joined #ruby
tildes has joined #ruby
gaussblurinc1 has quit [Client Quit]
Osw has joined #ruby
`based_pdev` has quit [Ping timeout: 245 seconds]
Pumukel has quit [Ping timeout: 250 seconds]
krobzaur has quit [Quit: WeeChat 1.2]
<argoneus>
ruby is hard
<jhass>
argoneus: well, not in this case, the yield is unconditional, so when there's no block ruby will raise
<argoneus>
oh
brunto has quit [Ping timeout: 260 seconds]
devbug has joined #ruby
<adaedra>
ruby's not so hard.
<jhass>
I just returned it for demonstration purposes here really
<argoneus>
I like some of the syntax
<argoneus>
like array.collect!, the !
<adaedra>
aah, the !.
<argoneus>
its like collect it you dork or ill have your head!
<adaedra>
It usually denotes a mutating operation.
<adaedra>
like collect! is like collect, except it does it in place.
<jhass>
and/or require "bundler/setup" at the top of your Rakefile
cornerma1 has joined #ruby
<NET||abuse>
jhass: thanks for that.
ddubs has quit [Ping timeout: 250 seconds]
Snowy has quit []
howdoicomputer has joined #ruby
gaussblurinc1 has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
Rodya_ has joined #ruby
DurstBurger has quit [Ping timeout: 260 seconds]
bap1313 has joined #ruby
Macaveli has joined #ruby
cornerman has quit [Ping timeout: 260 seconds]
cornerma1 is now known as cornerman
Rodya_ has quit [Remote host closed the connection]
rghose has quit [Quit: Leaving.]
pietr0 has joined #ruby
maloik has joined #ruby
shinenelson has joined #ruby
neanderslob has joined #ruby
voodo has quit [Quit: Leaving...]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
DurstBurger has joined #ruby
krobzaur has quit [Quit: WeeChat 1.2]
krobzaur has joined #ruby
rghose has joined #ruby
rakm has joined #ruby
rghose has quit [Max SendQ exceeded]
fantazo has joined #ruby
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
maloik has quit [Ping timeout: 250 seconds]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
moeabdol has joined #ruby
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
DurstBurger has quit [Ping timeout: 245 seconds]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
griffindy has quit [Ping timeout: 245 seconds]
gaussblurinc1 has joined #ruby
gaussblurinc1 has quit [Client Quit]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
rghose has joined #ruby
rghose has quit [Max SendQ exceeded]
rghose has joined #ruby
neanderslob_ has joined #ruby
`based_pdev` has joined #ruby
neanderslob has quit [Ping timeout: 250 seconds]
neanderslob_ has quit [Client Quit]
based_pdev_ has quit [Ping timeout: 245 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lubekpl has joined #ruby
pietr0 has quit [Ping timeout: 245 seconds]
b0yzn01z3 has quit [Remote host closed the connection]
pietr0 has joined #ruby
galeido has quit [Ping timeout: 276 seconds]
momomomomo has quit [Quit: momomomomo]
b0yzn01z3 has joined #ruby
<NET||abuse>
jhass: thanks for that tip earlier, still having issues with the Rakefile but it got past that first issue :(
AndyBotwin has joined #ruby
<NET||abuse>
I'm just trying to spin up a vagrant setup to test the rake file with centos ruby rather than archlinux ruby
linc01n has quit [Ping timeout: 260 seconds]
<jhass>
hah, good luck and sorry for your pains in advance
maloik has joined #ruby
howdoicomputer has quit [Ping timeout: 250 seconds]
linc01n has joined #ruby
grotewold is now known as grotewold[afk]
baweaver has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
grotewold[afk] is now known as grotewold
roxtrongo has joined #ruby
jackjackdripper has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
agit0 has joined #ruby
<NET||abuse>
jhass: not normally a ruby guy, but i need to get used to it, too prevelant in devops'y type tooling.. pretty much need to be a python AND ruby pro, i'm only the former. Couldn't hurt to be up on golang too these days. going nuts now... polyglot ops engineers.
xfbs has joined #ruby
<jhass>
NET||abuse: aha. If you have any real question, just ask
xfbs has quit [Client Quit]
bratchley has joined #ruby
bratchley has left #ruby [#ruby]
karapetyan has joined #ruby
mjuszczak has quit []
blaxter has quit [Quit: foo]
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
WeiJunLi has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
<Sou|cutter>
if it makes you feel any better, I use ruby a lot and find rake to be a sort of awkward dsl
grotewold is now known as grotewold[afk]
hakunin has quit []
<NET||abuse>
Sou|cutter: cheers, yeh, i find ruby's plasticity hard, being able to override any symbol you like, is good for generating dsl's, but makes the language unpredictable.
ldnunes has quit [Ping timeout: 260 seconds]
<Ox0dea>
Isn't Rake the "original" DSL?
RegulationD has joined #ruby
<Ox0dea>
NET||abuse: "Any symbol"?
ldnunes has joined #ruby
<NET||abuse>
Ox0dea: well maybe i'm still not informed enough to comment on it, but i thought just about anyting can be overridden in ruby,
renderfu_ has quit [Read error: Connection reset by peer]
<Sou|cutter>
I think he means that classes are open for modification?
renderfu_ has joined #ruby
<Sou|cutter>
*they (ugh)
<Ox0dea>
Methods and the like, sure, but you've gotta go way outta your way to modify actual Symbols.
grotewold[afk] is now known as grotewold
devbug has quit [Read error: Connection reset by peer]
RegulationD has quit [Remote host closed the connection]
[Butch] has quit [Quit: I'm out . . .]
<Ox0dea>
Sou|cutter: In your defense, it's a decidedly masculine nick.
desmondhume has quit [Remote host closed the connection]
troulouliou_div2 has quit [Quit: Leaving]
<NET||abuse>
hah, yes,s male here
RegulationD has joined #ruby
baweaver has quit [Remote host closed the connection]
devbug has joined #ruby
<Ox0dea>
Attack helicopter here.
platzhirsch has left #ruby [#ruby]
grill has joined #ruby
Hounddog has quit [Read error: Connection reset by peer]
baweaver has joined #ruby
uri has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
Pupp3tm4st3r has joined #ruby
arup_r has quit []
maloik has joined #ruby
gaussblurinc1 has joined #ruby
gaussblurinc1 has quit [Client Quit]
bkxd_ has joined #ruby
cycorld has left #ruby ["WeeChat 0.4.2"]
bkxd has quit [Ping timeout: 260 seconds]
cycorld has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
baweaver has quit [Remote host closed the connection]
casadei has quit [Remote host closed the connection]
iateadonut has quit [Ping timeout: 260 seconds]
ddubs has joined #ruby
Guest38 has joined #ruby
elektronaut has quit [Ping timeout: 240 seconds]
InvGhosttt has quit [Ping timeout: 250 seconds]
b0yzn01z3 has quit [Remote host closed the connection]
humd1ng3r has quit [Ping timeout: 260 seconds]
s00pcan has quit [Remote host closed the connection]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BSaboia has quit [Ping timeout: 250 seconds]
skade has joined #ruby
mjuszczak has joined #ruby
dlitvak has joined #ruby
threh has joined #ruby
simplyianm has quit [Remote host closed the connection]
simplyianm has quit [Remote host closed the connection]
mudtose is now known as threh
last_staff has joined #ruby
b0yzn01z3 has quit [Read error: Connection reset by peer]
Jackneill has quit [Quit: Leaving]
xfbs has quit [Ping timeout: 246 seconds]
darkf has quit [Quit: Leaving]
Rodya_ has joined #ruby
b0yzn01z3 has joined #ruby
TomPeed is now known as TomPeedOnMe
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xfbs has joined #ruby
`based_pdev` has quit [Ping timeout: 260 seconds]
shadoi has joined #ruby
maloik has joined #ruby
momomomomo has joined #ruby
monthy has quit [Read error: Connection reset by peer]
Dood__ has quit [Ping timeout: 260 seconds]
nkwsy___1 has quit [Ping timeout: 260 seconds]
momomomomo has quit [Client Quit]
peterhil_ has quit [Ping timeout: 260 seconds]
skade has quit [Quit: Computer has gone to sleep.]
B1n4r10 has quit [Ping timeout: 260 seconds]
BTRE has quit [Quit: Leaving]
Rodya_ has quit [Ping timeout: 250 seconds]
peterhil_ has joined #ruby
prasselpikachu is now known as Fridtjof
jbrhbr has joined #ruby
BTRE has joined #ruby
maloik has quit [Ping timeout: 250 seconds]
grotewold has joined #ruby
rghose has quit [Quit: Leaving.]
<snockerton>
so I have a ` require 'active_support/all'` in my ruby script, and it has no issues loading the gem, but when I use pry and do a manual require, it says "cannot load such file"
<snockerton>
what gives?
dlitvak has quit [Ping timeout: 250 seconds]
<apeiros>
snockerton: different gemfile?
<apeiros>
different ruby?
<apeiros>
different gemset?
<snockerton>
not that i know of
<snockerton>
running ruby script.rb and pry in the same context, same shell
bkxd_ has quit [Ping timeout: 260 seconds]
<jhass>
snockerton: ruby -v & pry -v ?
ibouvousaime has joined #ruby
<apeiros>
and after that, check the gem envs
B1n4r10 has joined #ruby
krz has quit [Ping timeout: 260 seconds]
brunto has joined #ruby
hobodave has joined #ruby
spider-mario has joined #ruby
dlitvak has joined #ruby
babblebre has joined #ruby
DurstBurger has joined #ruby
bkxd has joined #ruby
simplyianm has joined #ruby
gaussblurinc1 has joined #ruby
grotewold is now known as grotewold[afk]
jpfuentes2 has joined #ruby
gaussblurinc1 has quit [Client Quit]
Osw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DataKid has joined #ruby
juddey has joined #ruby
peterhil_ has quit [Ping timeout: 260 seconds]
gaussblurinc1 has joined #ruby
threh has quit [Quit: Leaving]
threh has joined #ruby
bubbys has quit [Ping timeout: 250 seconds]
bluOxigen has joined #ruby
maloik has joined #ruby
dEPy has joined #ruby
<dEPy>
Yo
marr has joined #ruby
<blubjr>
hi depy
`based_pdev` has joined #ruby
<dEPy>
Is it ok to say here that we need a Ruby programmer?
hahuang65 has joined #ruby
blueOxigen has quit [Ping timeout: 245 seconds]
<dEPy>
Or do you have any recommendation to where to find Ruby programmers to hire?
hobodave has quit [Quit: Computer has gone to sleep.]
<apeiros>
dEPy: until it becomes a problem, recruiting is fine here.
momomomomo has joined #ruby
based_pdev_ has quit [Ping timeout: 260 seconds]
xfbs has quit []
<DataKid>
what do you need dEPy?
unsymbol has quit [Ping timeout: 260 seconds]
<dEPy>
Well I said it already I guess. More info privately or at matjaz@codeable.io - basically we need a Ruby/Rails programmer to help with development/refactoring and improving our backend/API.
maloik has quit [Ping timeout: 245 seconds]
baweaver has joined #ruby
<dEPy>
We would prefer someone that is mainly Ruby over someone that mains Rails.
<centrx>
Is it fun?
ebertx has quit [Ping timeout: 245 seconds]
isjaylee has joined #ruby
<dEPy>
We would like to drive our app development into the direction of DDD and hexagonal approach slowly as it is getting harder to maintain and develop trying to do it the rails way.
<dEPy>
centrx: well. I am the 1st employee in the company and after more than 3 years I'm still here. My previous record was 2 years. :)
grotewold[afk] is now known as grotewold
unsymbol has joined #ruby
hobodave has joined #ruby
isjaylee has left #ruby [#ruby]
<centrx>
I only do octagonal XXX development
karapetyan has quit [Remote host closed the connection]
<Ox0dea>
Kinky.
ebertx has joined #ruby
<dEPy>
octagonal sounds awesome :P
karapetyan has joined #ruby
janno has quit [Remote host closed the connection]
<dEPy>
No but in all seriousness no matter what you call it, getting core domain logic out of rails is a good idea imo.
Karunamon has quit [Ping timeout: 260 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
dEPy: not sure whether I should be impressed. 8y where I'm now :)
cdg has quit [Remote host closed the connection]
colleenmcguckin has joined #ruby
myztic has quit [Ping timeout: 245 seconds]
<dEPy>
apeiros: not sure what you mean. :)
lacuna has joined #ruby
ldnunes has quit [Ping timeout: 260 seconds]
<apeiros>
relating to 3y as "long"
<dEPy>
well the company is 3 years so that's the upper limit :)
<dEPy>
and my whole career is less than 10y. Cut me some slack. :)
<apeiros>
hehe, ok
kirun has joined #ruby
brunto has quit [Ping timeout: 260 seconds]
<blubjr>
is there a root printing function that always gets used
<jhass>
blubjr: what's your issue?
failshell has joined #ruby
<apeiros>
you mean whether puts/printf/print etc. use a common method?
bubbys has joined #ruby
Karunamon has joined #ruby
DataKid has quit [Ping timeout: 252 seconds]
<blubjr>
i want something like lisp's fresh-line, that prints a newline unless you're already at the start of a line. the only way i can see to do that would be if theres a base printing function, to advise that to watch the last thing printed
RobertBirnie has joined #ruby
desmondhume has joined #ruby
bigmacher has joined #ruby
<Ox0dea>
You could query the terminal.
<blubjr>
and hopefully stdout isnt a special case
maloik has joined #ruby
<jhass>
I'd suggest a wrapper around $stdout that tracks it and use that everywhere (maybe even reassign $stdout to it)
Pumukel has quit [Ping timeout: 250 seconds]
arup_r has joined #ruby
diegoaguilar has joined #ruby
<blubjr>
i mean i would want it to work regardless of where youre writing to
<Ox0dea>
blubjr: Sounds like you want to redefine IO#write.
<Ox0dea>
Rather, that's the immediately obvious "solution".
<toretore>
sounds like a bad idea overall to me
<Ox0dea>
But the man wants fresh lines, and he shall have them!
desmondhume has quit [Ping timeout: 245 seconds]
roxtrongo has quit [Remote host closed the connection]
<blubjr>
woman
<shevy>
you just can't solve blubjr's problem!
<blubjr>
thank you, ill look into it
karapetyan has quit [Remote host closed the connection]
SalviaNobile has quit [Remote host closed the connection]
maloik has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
<Ox0dea>
blubjr: I'm trying to think of the cleanest way to have IO#write still do what it's supposed to do.
<Ox0dea>
It's the "base printing function", after all.
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
<Ox0dea>
Why didn't you "correct" me when I called you pg's son?
karapetyan has quit [Read error: Connection reset by peer]
<blubjr>
i did
karapetyan has joined #ruby
InvGhosttt has joined #ruby
<Ox0dea>
Shit, you did.
<Ox0dea>
My apologies.
isjaylee1 has joined #ruby
asteros has joined #ruby
isjaylee1 has left #ruby [#ruby]
yoongkang has joined #ruby
juddey has quit [Ping timeout: 250 seconds]
elaptics is now known as elaptics`away
sepp2k has joined #ruby
gsingh93 has quit [Ping timeout: 260 seconds]
<Ox0dea>
I don't see how to do it in pure Ruby. :<
Pupp3tm4st3r has quit [Remote host closed the connection]
<Synthead>
this helps a lot, thanks guys!
<apeiros>
Synthead: IMO the thing to do there is not use **params but host: nil, login: nil etc.
<apeiros>
?guys Synthead
<ruboto>
Synthead, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<Synthead>
apeiros: agreed, will do
<apeiros>
thanks :)
baweaver has quit [Remote host closed the connection]
nettoweb has joined #ruby
yoongkang has quit [Ping timeout: 250 seconds]
<Ox0dea>
Synthead: It's unclear to which of apeiros' advisements you were agreeing; could you clarify?
<shevy>
I am folk
<apeiros>
the shevy folk
<Ox0dea>
#ruby is a gang-free environment.
<Synthead>
Ox0dea: the params suggestion
<apeiros>
oh :(
<Ox0dea>
The {m,s}adness will never end.
<apeiros>
and there I hoped they'd say "both"
karapetyan has quit [Remote host closed the connection]
<centrx>
'Maybe consider using "hey gang" or a gang sign like "\/_\/"'
<apeiros>
preferably from dr. horrible's sing-along
<apeiros>
oh, sign, not song. quite a misread…
diegoaguilar has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
<slash_part>
Ox0dea: what about the dollars? they're not like the typical color gangs
karapetyan has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
<Ox0dea>
slash_part: Are you expressing anarchist sentiments?
sandstrom has quit [Quit: My computer has gone to sleep.]
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
<Ox0dea>
I'll grant you that, but I maintain that symmetry is a Good Thing, and that "it'll confuse somebody" is a poor reason not to do something.
baweaver has joined #ruby
Dood__ has joined #ruby
nkwsy___ has joined #ruby
<Ox0dea>
For certain definitions of "confuse" and "somebody", of course. In short, %'' is not obfuscation.
desmondhume has joined #ruby
<yardenbar>
Hi all, what can cause ruby process to exit with code '-6'?
<hxegon>
but it does trigger rubocop warnings, which is kind of annoying
<yardenbar>
The process is running an eventmachine
<jhass>
it does, ' is no longer a visual indicator for the "interpolation" property that I have strongly associated with it in Ruby, having to check for % is actually removing semantic for me
<jhass>
yardenbar: what reports -6 to you?
<Ox0dea>
jhass: Is there some justification for %() besides its being "the done thing"?
<yardenbar>
jhass, The process is managed by CircusD, and there's a plugin that emits the process lifecycle events
<jhass>
Ox0dea: no, I just consider it the least conflict free. And actually "what most people use" is not a too bad reason too
<yardenbar>
This is where I see the -6 code
maloik has joined #ruby
jetpackjoe has joined #ruby
jetpackjoe has quit [Max SendQ exceeded]
cyberfawkes has joined #ruby
<Ox0dea>
hxegon: Take your pick, but RuboCop will probably complain about almost all of them. :P
s1kx has joined #ruby
desmondhume has quit [Ping timeout: 260 seconds]
threh has joined #ruby
threh has quit [Client Quit]
jetpackjoe has joined #ruby
<Ox0dea>
jhass: I just wish whoever decided %w() > %w[] had realized Ruby isn't actually Lisp.
Dood__ has quit [Ping timeout: 245 seconds]
jetpackjoe has quit [Max SendQ exceeded]
grotewold is now known as grotewold[afk]
nkwsy___ has quit [Ping timeout: 260 seconds]
asteros has quit [Quit: asteros]
Wsewolod has quit [Ping timeout: 250 seconds]
Giordano has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
yardenbar: I can't find a special meaning to it adhoc, are you sure your application isn't exiting with it explicitly? Note "exit 250" might produce the same
kerunaru has quit [Ping timeout: 245 seconds]
grotewold[afk] is now known as grotewold
decoponio has quit [Quit: Leaving...]
maloik has quit [Ping timeout: 245 seconds]
<yardenbar>
Found "smallbin double linked list corrupted" in logs
<imperator>
i dunno, i guess i just thought it would be nice to have a more elegant solution
<imperator>
not a huge deal
tomchapin has joined #ruby
vikas027 has joined #ruby
cdg has joined #ruby
<imperator>
but thank you all for your tips :)
<Derailed>
Hi all. I'm a newbie reading through a whole lot of rails code. I'd just like to confirm something about Ruby: What happens if you define the same class twice?
<adaedra>
That's a solution, but no, there's nothing built-in, imperator
Azulinho has quit [Quit: Azulinho]
<Ox0dea>
Derailed: You "re-open" it.
asteros has joined #ruby
<adaedra>
Derailed: You don't, you re-open it.
<adaedra>
Dammit.
<Ox0dea>
<3
duncannz has joined #ruby
<imperator>
adaedra, do you think it's worth a RFC?
Azulinho has joined #ruby
<Derailed>
:-) So "re-open" is a term I'm not familiar with, but I assume you mean I can add more methods to it, and those all end up in the original class?
<Ox0dea>
Derailed: Ruby classes are subject to modification at all times.
<imperator>
or are we getting into "may as well add type checking" territory?
<adaedra>
>> class Potato; def cook; end; end; po = Potato.new; class Potato; def shout; %(I'm a potato!) end; end; po.shout # Derailed
<Derailed>
Ox0dea, What happens if you redefine an already-defined *method* in this case?
<imperator>
How are you doing? Because I'm a potato.
<Ox0dea>
Derailed: It gets overwritten.
<adaedra>
imperator: i'm not familiar with Ruby politics.
<Derailed>
Ox0dea, Over-written, not necessarily the same as 'over-ridden'? I guess it works out the same.
<Ox0dea>
Derailed: Aye, same thing.
<Ox0dea>
As per what I imagine is your definition of those terms, anyway.
<adaedra>
Derailed: try all of that and see
casadei has quit [Ping timeout: 260 seconds]
<Derailed>
Ox0dea, Thanks. Let me give you context: I was trying to work out how adding this gem was adding routes to the rails project I'm reading: https://github.com/AbleTech/easy_admin
peterhil_ has joined #ruby
TomPeedOnMe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GinoManWorks has quit [Read error: Connection reset by peer]
<Derailed>
the part that really confused me is that it seems like installing the gem is all you need to do, you don't even need to 'require' it!
sepp2k1 has joined #ruby
<Ox0dea>
Derailed: It's being autoloaded.
AndyBotwin has quit [Ping timeout: 245 seconds]
<Ox0dea>
Rails magic best magic.
sepp2k has quit [Ping timeout: 260 seconds]
<Derailed>
Ox0dea, ...and the autoloading is a 'Rails' thing, NOT a ruby thing, right?
<Ox0dea>
No, it's a Ruby thing, but Rails "augments" it.
<adaedra>
It's a Bundler things, technically
<Ox0dea>
You have to explicitly declare that you want some constant to trigger a load in straight Ruby, but Rails hooks #const_missing to do it automagically.
<adaedra>
Ah, this
<jhass>
adaedra: that'd be a broad definition of autoloading
<mfqr>
1/3
<Derailed>
Is rails auto-loading stuff based on the Gemfile?
<jhass>
no
<Ox0dea>
No, missing constants.
<adaedra>
The Gemfile part is Bundler, the missing constants part is Rails.
<adaedra>
(I thought they were referring to the "add the gem to Gemfile and it's done" part)
<Derailed>
Ox0dea, thanks for your help. Do you know where in docs I might get a concise explanation of that?
<nchambers>
ruboto is closed source right?
snj has joined #ruby
<Ox0dea>
Derailed: Of #const_missing, or?
<Ox0dea>
nchambers: Yes, as is eval.in.
snj has left #ruby [#ruby]
<adaedra>
nchambers: yes.
<adaedra>
Ox...
<Derailed>
based on what you've told me, I understand how easy_admin is defining some classes to use, and then you 're-open' them in the rails app. But I'm still unclear on how 'easy_admin' is getting loaded into my rails project
<nchambers>
shame :L
<Ox0dea>
adaedra: I need to break a finger or something.
colegatron has joined #ruby
<nchambers>
I wish I still had that email from the author... oh well
<Ox0dea>
Hm?
<nchambers>
didn't charlie some write it?
<Ox0dea>
Yes.
<nchambers>
yeah I emailed him a bit about it before
<Ox0dea>
Derailed: You're referring to `EasyAdmin` by name at some point, yeah?
peterhil_ has quit [Ping timeout: 250 seconds]
Spleeze has joined #ruby
chinmay_dd has quit [Ping timeout: 260 seconds]
<adaedra>
Derailed: well, you added it to your Gemfile, right?
Coldblackice has quit [Read error: Connection reset by peer]
<Derailed>
Ox0dea, no, but the classes with the same name are being defined in: class Admin::JobsController < Admin::BaseController
<Ox0dea>
Ah, then it's Bundler doing the loading.
tomchapin has quit [Read error: Connection reset by peer]
AndyBotwin has joined #ruby
<Derailed>
adaedra, "easy_admin" is in the Gemfile, yes.
<adaedra>
So yes, bundler "Magic".
<adaedra>
In fact, the Bundler.require that lies in config/application.rb
twilling has quit [Quit: twilling]
chinmay_dd has joined #ruby
<adaedra>
(For rails at least.)
casadei has joined #ruby
InvGhosttt has joined #ruby
<adaedra>
(Night time, see y'all)
babblebre has quit [Quit: Connection closed for inactivity]
<jhass>
nchambers: what do you want to know about it?
<Ox0dea>
Au revoir, adaedra.
<nchambers>
jhass, just looking at how it does eval
<nchambers>
jhass, nice. I was thinking of doing a thing with lxc
Azulinho has joined #ruby
vdamewood has joined #ruby
User458764 has quit [Ping timeout: 245 seconds]
AndyBotwin has quit [Max SendQ exceeded]
casadei has quit [Remote host closed the connection]
AndyBotwin has joined #ruby
User458764 has joined #ruby
<jhass>
I think charliesome is running just a seccomp filter with a quite elaborated whitelist (looking at arguments too)
<jhass>
+ some resource limits
<Ox0dea>
nchambers: See also OpenBSD's tame(2) and FreeBSD's capsicum(4).
<Ox0dea>
Both pretty "get your hands dirty", as best I can tell.
<Ox0dea>
(I do realize that's probably not what you want.)
nkwsy___1 has joined #ruby
`based_pdev` has joined #ruby
blubjr has joined #ruby
Dood__ has joined #ruby
yardenbar has joined #ruby
DurstBurger has quit [Ping timeout: 260 seconds]
kadoppe has quit [Ping timeout: 260 seconds]
karapetyan has quit [Read error: Connection reset by peer]
based_pdev_ has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
AndyBotwin has quit [Max SendQ exceeded]
DEVELOPERS has joined #ruby
zeroDivisible has quit [Quit: WeeChat 1.3]
kadoppe has joined #ruby
simplyianm has joined #ruby
DEVELOPERS has quit [Client Quit]
senayar has joined #ruby
snockerton1 has joined #ruby
snockerton has quit [Ping timeout: 265 seconds]
roshanavand has joined #ruby
zeroDivisible has joined #ruby
Rodya_ has joined #ruby
grotewold is now known as grotewold[afk]
edwinvdgraaf has joined #ruby
lacuna has quit [Read error: Connection reset by peer]
lawd has joined #ruby
tvon has joined #ruby
snockerton1 has quit [Read error: Connection reset by peer]
lacuna has joined #ruby
snockerton has joined #ruby
<lawd>
hi i can usually do: 'apt-get install ruby-dev' on linux. What do you do for MAC
<nchambers>
<jhass> I think charliesome is running just a seccomp filter with a quite elaborated whitelist (looking at arguments too) ← ah ok
grotewold[afk] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nchambers>
<Ox0dea> nchambers: See also OpenBSD's tame(2) and FreeBSD's capsicum(4). ← thanks thats actually quite helpful
<jhass>
lawd: OS X comes with Ruby
momomomomo has quit [Quit: momomomomo]
<lawd>
hmm do you know how i can set the PATH
<apeiros>
or you use rvm. or brew. or one of the other ruby version managers.
shadoi has quit [Quit: Leaving.]
roxtrongo has joined #ruby
<lawd>
ruby-dev includes ruby doesn't it?
spcmastertim has joined #ruby
momomomomo has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
dimik has quit [Ping timeout: 250 seconds]
DexterLB has quit [Ping timeout: 260 seconds]
EvilDMP has joined #ruby
xfbs has quit []
asteros has quit [Quit: asteros]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JDiPierro has quit [Remote host closed the connection]
<nchambers>
lawd, PATH=$PATH:/new/path
DexterLB has joined #ruby
<havenwood>
lawd: I don't think so.
Wsewolod has joined #ruby
<lawd>
thanks!
<EvilDMP>
Help! I have managed to get my ruby into a muddle ("zsh: /usr/local/bin/jekyll: bad interpreter: /usr/local/opt/ruby/bin/ruby: no such file or directory"). I am on OS X, but I am not an experienced Rubyist and would greatly appreciate some advice on getting it reinstalled correctly
Dood____ has joined #ruby
<EvilDMP>
I use Homebrew
yoongkang has joined #ruby
nkwsy__14 has joined #ruby
<havenwood>
lawd: On OS X there is a default system Ruby (or two, depending on your version) or it's popular to grab a package manager like Homebrew, pkgsrc, MacPorts or Fink - each of which have Ruby packages.
<EvilDMP>
which ruby says: /usr/bin/ruby
devbug has quit [Remote host closed the connection]
<havenwood>
lawd: Or you can always build Ruby yourself on OS X or use a tool like ruby-install or RVM to do it for you.
devbug has joined #ruby
baweaver has joined #ruby
<lawd>
ah i think i'll try rvm thanks!
<apeiros>
EvilDMP: sounds like you messed up your brew installed ruby. uninstall and install again?
baweaver has quit [Remote host closed the connection]
Dood__ has quit [Ping timeout: 245 seconds]
nkwsy___1 has quit [Ping timeout: 260 seconds]
<EvilDMP>
apeiros: the ruby in /usr/bin/ruby is not a brewed version, I think it is the OS X default version
<EvilDMP>
how can I check that it works?
<apeiros>
EvilDMP: and that part sounds like you messed up your brew too
<apeiros>
EvilDMP: well, actually no
baweaver has joined #ruby
<apeiros>
first one says your brew ruby does not exist
<jhass>
it has the option but it's still not a default
B1n4r10 has quit [Ping timeout: 260 seconds]
snockerton has joined #ruby
pleiosaur has quit [Ping timeout: 245 seconds]
senayar_ has joined #ruby
jbrhbr has quit [Quit: Leaving.]
spcmastertim has quit [Quit: Cheers!]
akem has joined #ruby
gigetoo has joined #ruby
senayar has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
diegoaguilar has joined #ruby
krobzaur has quit [Ping timeout: 245 seconds]
kobain has joined #ruby
bluOxigen has quit [Ping timeout: 260 seconds]
gguggi has joined #ruby
zeroDivisible has quit [Quit: WeeChat 1.3]
<EvilDMP>
should I expect gem install jekyll to try to install it into /usr/bin?
colleenmcguckin has quit [Changing host]
colleenmcguckin has joined #ruby
<EvilDMP>
(it does)
bluOxigen has joined #ruby
rubie has joined #ruby
<Radar>
Depends on how you installed your Ruby.
zeroDivisible has joined #ruby
bubbys has quit [Ping timeout: 250 seconds]
malconis has quit [Ping timeout: 250 seconds]
<Radar>
Homebrew, supposedly?
postmodern has joined #ruby
<havenwood>
jhass: aye, I look forward to a RubyGem --env-shebang default!
<Derailed>
Hi! So Ox0dea was explaining 're-opening' classes to me. I have a related question: What if you 're-open' a class but specify a different '< SuperClass'? what happens then?
<Ox0dea>
?try Derailed
<ruboto>
Derailed, Why don't you try it and see for yourself?
<Derailed>
Fair point :-)
karapetyan has quit [Remote host closed the connection]
<Derailed>
I'm reading a large chunk of code and trying to work out why it's doing what it's doing. Trying to get through it quickly but a little experimentation seems necessary
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<EvilDMP>
Radar: botched! it was brewed, now I have removed that and am trying to get things working with the system ruby
<EvilDMP>
not as bad as that time I borrowed a friend's motorbike though
<havenwood>
chruby \o/
DurstBurger has quit [Ping timeout: 260 seconds]
howdoicomputer has joined #ruby
shadoi has quit [Quit: Leaving.]
sondr3 has joined #ruby
malconis has joined #ruby
weijun has quit []
jbrhbr has joined #ruby
dEPy has quit [Quit: (null)]
twilling has quit [Quit: twilling]
ibouvousaime has quit [Read error: Connection reset by peer]
waka has quit [Remote host closed the connection]
Jackneill has joined #ruby
NeverDie has joined #ruby
<apeiros>
Derailed: since this is a special case: also try defining a class with a superclass, then reopen it without any superclass at all.
Guest30355 has quit [Ping timeout: 252 seconds]
shadoi has joined #ruby
asteros has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
sondr3 has quit [Quit: Quit]
s00pcan has quit [Ping timeout: 260 seconds]
<Derailed>
apeiros, thanks for the tip. So now I see that you get a 'superclass mismatch'
<Derailed>
apeiros, and now I have to work out why the code that I'm reading DOESN'T generate one of those :-)
<jhass>
maybe you confuse two classes with the same name in different namespaces as the same class?
uri has quit [Ping timeout: 260 seconds]
<Derailed>
jhass, I think I must be doing something like that.
<Derailed>
What I need is 12-16 hours to just sit down and cram the pickaxe book into my head :-) but that'll have to wait till the weekend
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
shanemcd has quit [Remote host closed the connection]
* Derailed
is a Python developer who is learning Ruby by total immersion :-)
benlieb has quit [Read error: Connection reset by peer]
howdoicomputer has quit [Ping timeout: 250 seconds]
benlieb has joined #ruby
yfeldblum has joined #ruby
imperator has left #ruby ["Leaving"]
s00pcan has joined #ruby
<apeiros>
Derailed: the point is that with `class X < A; end; class X; end` you don't get a mismatch (despite not having specified the same superclass)
xelfer has left #ruby [#ruby]
Unicorn| has quit [Quit: Connection closed for inactivity]
<Derailed>
apeiros, I assume that's just to make adding methods/augmentic classes easier? Like, the second definition does *not* change the superclass, right?
<apeiros>
correct
YP-QMUL-W has quit [Read error: Connection reset by peer]
<apeiros>
but if you reverse the order, it'll fail
twilling has joined #ruby
jscheel has joined #ruby
<jscheel>
Hi all, I’m having trouble with Resolv. On my local machine `Resolv::DNS.open { |dns| dns.getresources 'gmail.com.', Resolv::DNS::Resource::IN::MX }` returns a mailserver record. However, in my vagrant instance, the same line returns nothing.
dopie has quit [Quit: This computer has gone to sleep]
freerobby1 has quit [Ping timeout: 250 seconds]
<jscheel>
running `nslookup -q=mx gmail.com` in the instance returns records
desmondhume has joined #ruby
Vitor has quit [Ping timeout: 245 seconds]
last_staff has quit [Ping timeout: 250 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
B1n4r10 has joined #ruby
<jscheel>
oh, wait, it returns bad info in the instance
<jscheel>
this is a vagrant issue I think
brunto has quit [Ping timeout: 260 seconds]
gusTester has quit [Quit: Leaving.]
desmondhume has quit [Ping timeout: 245 seconds]
Ebok has joined #ruby
ledestin has joined #ruby
Vitor has joined #ruby
hahuang65 has joined #ruby
casadei has joined #ruby
baweaver has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
SCHAAP137 has quit [Quit: Leaving]
snockerton has quit [Quit: Leaving.]
Vitor has quit [Ping timeout: 260 seconds]
Vitor has joined #ruby
colegatron has quit [Ping timeout: 260 seconds]
casadei has quit [Ping timeout: 260 seconds]
gaussblurinc1 has quit [Quit: Leaving.]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jhn has joined #ruby
Authenticator has joined #ruby
lacuna has quit [Read error: Connection reset by peer]
gaussblurinc1 has joined #ruby
cdg has quit [Remote host closed the connection]
lacuna has joined #ruby
vdamewood has quit [Ping timeout: 260 seconds]
yfeldblum has quit [Remote host closed the connection]
Authenticator has quit [Client Quit]
yfeldblum has joined #ruby
Authenticator has joined #ruby
`based_pdev` has quit [Ping timeout: 245 seconds]
Authenticator has quit [Client Quit]
Vitor has quit [Ping timeout: 260 seconds]
nettoweb has quit [Ping timeout: 250 seconds]
Authenticator has joined #ruby
Ilyes512 has joined #ruby
Guest38 has joined #ruby
iateadonut has joined #ruby
vdamewood has joined #ruby
devbug has quit [Read error: Connection reset by peer]
<apeiros>
adaedra: is that a regression? I thought derpy searches core/stdlib for plain methods?
twilling has quit [Quit: twilling]
<Authenticator>
I'm building a gem, using bundler. Is there any way I can get it to install, from a .gem on my internal server, but using the dependencies in vendor/cache? I can get *bundler* to do this, but that's another step for the user...
baweaver has joined #ruby
<Synthead>
apeiros: hm, that example looks really hacky
lacuna has quit [Read error: Connection reset by peer]
<jhass>
rubygems doesn't read vendor/cache and if it exists you have bundler already anway, no?
lxsameer has quit [Quit: Leaving]
<jhass>
*anyway
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
napcae has joined #ruby
Cy-24 has quit [Remote host closed the connection]
<Authenticator>
jhass: I'm including the deps in the gem, so no the user may not have Bundler at that point.
BBird has joined #ruby
DurstBurger has joined #ruby
linc01n has quit [Ping timeout: 260 seconds]
<jhass>
so you imagine rubygems to unpack your gem to some temporary location to check whether some dependencies are hidden into it and then unpacking it again to install it or something?
<jhass>
No, it doesn't do anything like that
<drbrain>
maybe if you `gem install -g`
simplyianm has quit [Remote host closed the connection]
Ruby_Rocks_007 has joined #ruby
linc01n has joined #ruby
<Authenticator>
jhass: I imagine it does not - but yeah that's what I want. Otherwise, what good are vendored dependencies?
<jhass>
rubygems has no concept of vendored dependencies
<jhass>
that's a bundler concept
<Synthead>
apeiros: can I define a method with params?
<apeiros>
yes
djbkd has joined #ruby
InvGhosttt has quit [Ping timeout: 264 seconds]
<Synthead>
apeiros: oooh, I see, you pass the variables in the block
gguggi has quit [Ping timeout: 260 seconds]
<Synthead>
apeiros: there we go, I got it figured out. all nice and dry. thanks a lot!
colegatron has joined #ruby
hakunin has joined #ruby
<apeiros>
all I did was point you at the right page in the manual ;-) but yw
<Authenticator>
jhass: Yeah, I mean that's what I'm discovering... I can see that it's that way because gems came first. Is it not a good idea though? A pass-through to bundler in modern versions of gem, or something...?
<jhass>
It probably isn't
NightMonkey has joined #ruby
<jhass>
I don't see the issue anyways
napcae has quit [Quit: leaving]
<drbrain>
Authenticator: RubyGems can install from a Gemfile with `gem install -g`, so it might work that way
bubbys has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
<jhass>
they gotta fetch you gem from somewhere, why not let them fetch the dependencies there or whereever too
<drbrain>
there may be bugs, though
Ruby_Rocks_007 has quit [Ping timeout: 245 seconds]
<Authenticator>
I think I could fake what I want if I separated the Gemfile. Tell gem that the gem relied only on bundler, then run bundler install --local...
<Authenticator>
drbrain: Looking.
<jhass>
honestly, I feel like you're about to create a huge mess
CloCkWeRX has quit [Ping timeout: 250 seconds]
Jackneill has quit [Ping timeout: 260 seconds]
hobodave has quit [Quit: Computer has gone to sleep.]
Ruby_Rocks_007 has joined #ruby
<jhass>
and that while I'm not even convinced there's really an issue you need to solve
<Ruby_Rocks_007>
hi
<Ruby_Rocks_007>
ruby newbie asking for help on operator precedency:
<Authenticator>
jhass: I imagine you'd be tough to convince.
CloCkWeRX has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
<drbrain>
if you have a directory full of gems you want to install, you can always `gem install --force --local *.gem`
<drbrain>
which may be equivalent?
<drbrain>
I haven't read much scrollback
platzhirsch has joined #ruby
<Ruby_Rocks_007>
does the ‘&&’ operation does have higher priority than ‘if’ the statement modifers?
<jhass>
drbrain: from what I've gathered they want to package a bunch of .gem files into a .gem file and have the outer .gem depend on the gems packaged in the inner .gem's
devbug has quit [Read error: Connection reset by peer]
<Ruby_Rocks_007>
then some one can help elaborate why this doesn’t print...
<drbrain>
oh, yeah, RubyGems doesn't support that
<Ruby_Rocks_007>
a=123;
<Ruby_Rocks_007>
sorryl
<Ruby_Rocks_007>
sorry;
<Ruby_Rocks_007>
a=nil;
<jhass>
?gist Ruby_Rocks_007
<ruboto>
Ruby_Rocks_007, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<jhass>
throw up some code explaining what you mean there please
<Ruby_Rocks_007>
(a=123) && print(‘hello ruby’) if a
devbug has joined #ruby
<Authenticator>
drbrain: jhass: Mostly. Yeah. I know it doesn't. I'm trying to figure out if I should just make it work via some simple work-around or if there's a better way to achieve a simple local install.
<Ruby_Rocks_007>
that is it.
<jhass>
Authenticator: there's most certainly a better way
<Ruby_Rocks_007>
if ‘&&’ does have high pri, then it should print
RegulationD has quit [Remote host closed the connection]
<jhass>
Authenticator: specifics depend on how you distribute your .gem and where the dependencies come from initially
<Ruby_Rocks_007>
but it didn’t — and so ‘if’ statement modifier have the highest pri?
<Authenticator>
jhass: Do you have any idea what it would be for a seamless (non-ruby users trying to install script) UX, with a no-net-connection install
<jhass>
Ruby_Rocks_007: you can see it that way, yes
<drbrain>
Ruby_Rocks_007: modifier `if` has higher priority than `&&`
<Ruby_Rocks_007>
O’Reilly book said that ‘if’ statment modifers have lowest priority.
<Ruby_Rocks_007>
so I got completely lost here — from C/C++/Java background
<Authenticator>
jhass: Thanks. Looking.
<drbrain>
Ruby_Rocks_007: `if condition then … end` and `… if condition` are parsed differently
Rickmasta has joined #ruby
workmad3 has joined #ruby
<drbrain>
so they can have different priorities
<Ruby_Rocks_007>
@drbrian, so how the statement parsed and carried out?
<Ruby_Rocks_007>
(a=123) && print(‘hello ruby’) if a
<Ruby_Rocks_007>
when variable ‘a’ is value nil.
<drbrain>
Ruby sees it as ((a=123) && print(‘hello ruby’)) if a
<jhass>
Ruby_Rocks_007: you observed it correctly already
<Ruby_Rocks_007>
yes, it didn’t print
<drbrain>
but when it parses, it encounters the `a=` first, so `a` becomes a local variable instead of a method call
<drbrain>
and local variables default to `nil`i
<Ruby_Rocks_007>
the left side of ‘if’ should run first — as it is have higher priority,
<drbrain>
this is the tricky part of modifier if
<Ruby_Rocks_007>
and then becomes statement (nil) if a
<drbrain>
`a=` is parsed first, but executed last
<drbrain>
(if at all)
<Ruby_Rocks_007>
the left side:
<Ruby_Rocks_007>
((a=123) && print(‘hello ruby’))
_djbkd has joined #ruby
<Ruby_Rocks_007>
‘should’ be executed first
dhollinger has quit [Quit: WeeChat 1.3]
<Ruby_Rocks_007>
before turns into statement:
<Ruby_Rocks_007>
nil if a
djbkd has quit [Ping timeout: 260 seconds]
<Ruby_Rocks_007>
as ‘if’ has lowest priority
<drbrain>
but modifier-if doesn't work that way
<Ruby_Rocks_007>
just like: 1 + 2*3
<Ruby_Rocks_007>
2*3 carried out first, and turns into: 1+6
SecretAgent has joined #ruby
<drbrain>
you can't run the body of an if when the condition is false
CustosLimen has quit [Quit: CustosLimen]
<drbrain>
comparing `if` to operators isn't comparing like things
<Ruby_Rocks_007>
@drbrain, then the book is at some-what-level inaccurate (for newbies),
<jhass>
Ruby_Rocks_007: either you misinterpreted something in your book or it's misleading or simply wrong. I don't have it so I can't double check, but you need to get over that interpretation, it's wrong
<Ruby_Rocks_007>
the modifiers have —highest— priority.
graydot has joined #ruby
mary5030 has quit [Remote host closed the connection]
_stu_ has quit [Quit: _stu_]
<drbrain>
and modifier-if is extra tricky because ruby allows reciever-less methods and local variables to share the same namespace
g3funk is now known as braidn
<drbrain>
I would say lowest
<Ruby_Rocks_007>
The book ‘The Ruby Programming Language’ by O’Reilly. Page #103
<drbrain>
because && binds the assignment and print expressions together
<drbrain>
precedence is like stickiness
CustosLimen has joined #ruby
<drbrain>
high precedence means more sticky, so && sticks (a=123) and print('hello ruby') together
mooe has quit [Quit: Connection closed for inactivity]
<Ruby_Rocks_007>
@drbrain, so ‘&&’ operator binds first,
<drbrain>
and more tightly than it can stick print('hello ruby') and if together
<Ruby_Rocks_007>
but runs second (to the modifer-if)
<drbrain>
yes
sepp2k1 has quit [Read error: Connection reset by peer]
<Ruby_Rocks_007>
so, what is the difference between binding vs. running, as far as sequence is concerned?
<Ruby_Rocks_007>
for me, it looks like quite the same?
casadei has joined #ruby
<drbrain>
binding and running should be the same
<drbrain>
but parsing and running can have strange results
Nilium has quit [Ping timeout: 245 seconds]
<drbrain>
or, unintuitive if you're new to ruby's syntax quirks
devbug has quit [Read error: Connection reset by peer]
<Ruby_Rocks_007>
that’s why a newbie is here. :)
<Ruby_Rocks_007>
parsing/binding says that ‘&&’ operator have the assignment and print,
<Ruby_Rocks_007>
but running says that modifier-if will run first, is that right?
kirun has quit [Quit: Client exiting]
<drbrain>
yes
shadoi has quit [Quit: Leaving.]
momomomomo has quit [Quit: momomomomo]
<drbrain>
because low-precedence means `if` can grab less on the left and right
<drbrain>
but here `if` grabs all of `((a=123) && print('hello ruby'))`
<drbrain>
because the `&&` makes the expression left of the `if` all one group
<Ruby_Rocks_007>
so, the precedence means the capability to ‘grab’ nearby oprands,
devbug has joined #ruby
<drbrain>
roughly, yes
_stu_ has joined #ruby
calderonroberto has joined #ruby
<Ruby_Rocks_007>
is there a table shows the running capability for ruby, just like the table for precedence?
<drbrain>
the precedence table determines how things run as expressions
<Ruby_Rocks_007>
say, modifier-if is of higher priority than operator ‘&&’ when running sequence is concerned
howdoicomputer has joined #ruby
vikas027 has quit [Ping timeout: 260 seconds]
Sam0163141155 has joined #ruby
<drbrain>
it becomes confusing (in general, for humans) if the parse-time precedence table and runtime precedence tables are different
<drbrain>
I haven't heard of a language designer specifying these separately
Sam0163141155 has quit [Read error: Connection reset by peer]
<Ruby_Rocks_007>
@drbrain, your mentioned the right point
Sam0163141155 has joined #ruby
<Sam0163141155>
If I was to declare a local variable within a class, outside of all methods, would it behave exactly the same as an instance variable?
<Ruby_Rocks_007>
exactly I got confused here
Nilium has joined #ruby
maddmaxx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
duncannz has quit [Ping timeout: 250 seconds]
<jhass>
Sam0163141155: no
<drbrain>
Sam0163141155: it would only be local to that one time you opened the class
Guest38 has quit [Ping timeout: 250 seconds]
<Sam0163141155>
Ah, of course! Brilliant, thanks!
<Ruby_Rocks_007>
case #1, 1+3*2
<drbrain>
>> class A; v = 1; end; class A; p v; end
<ruboto>
drbrain # => undefined local variable or method `v' for A:Class (NameError) ...check link for more (https://eval.in/478654)
<Ruby_Rocks_007>
the 3*2 is parsed first and runs first, and then turns into: 1+6
DurstBurger has quit [Ping timeout: 260 seconds]
millerti has joined #ruby
<jhass>
Ruby_Rocks_007: do you have a rough idea of what an AST is?
<drbrain>
Ruby_Rocks_007: I would say "1 is parsed, then + is parsed, then 3 is parsed, then * is parsed, then 2 is parsed, then an expression is assembled that has the right order-of-operation based on the precedence table"
<Ruby_Rocks_007>
case #2 above is counter-intutive, the ‘&&’ operator is parsed and binded first, but runs second.
<drbrain>
but this is entering the territory of how parsing algorithms work
user083 has joined #ruby
B1n4r10 has quit [Ping timeout: 250 seconds]
Sam0163141155 has quit [Client Quit]
howdoicomputer has quit [Ping timeout: 260 seconds]
<Ruby_Rocks_007>
@jhass, I think I returned AST to CS teacher,
<drbrain>
if you want to know how parsers do their parsing
<Ruby_Rocks_007>
I am a nice student. :)
<jhass>
to me it helps to try to roughly come up with an AST for stuff, visually that is
<jhass>
but we can also ask Ruby for it actually
<drbrain>
for "3*2+1" I would say "3 then * then 2 are parsed, then a sub-expression is assembled, then + and 1 are parsed and the full expression is assembled
<Ruby_Rocks_007>
got it, @drbrain. I’ll check it out shortly.
casadei has quit [Remote host closed the connection]