<havenwood>
waveprop: #merge! mutates the receiver (the instance of the hash) but #merge doesn't
<RickHull>
hsh1.merge(hsh2) says that hsh2 kv pairs should get applied to hsh1
aviraldg has joined #ruby
M107262[m] has joined #ruby
Hanma[m] has joined #ruby
yana[m] has joined #ruby
lasenna[m] has joined #ruby
torarne has joined #ruby
dtcristo has joined #ruby
watzon has joined #ruby
Orbixx[m] has joined #ruby
haylon has joined #ruby
astronavt[m] has joined #ruby
jonjits[m] has joined #ruby
zalipuha[m] has joined #ruby
Giphy[m] has joined #ruby
velu_aon[m] has joined #ruby
dman[m] has joined #ruby
KevinMGranger has joined #ruby
turt2live has joined #ruby
<RickHull>
and a new hash is returned
<RickHull>
hsh1 is not modified
aagdbl[m] has joined #ruby
kua[m] has joined #ruby
itmerc[m] has joined #ruby
Matt[m]2 has joined #ruby
gokul_mr[m] has joined #ruby
jphase has joined #ruby
<RickHull>
merge is a great way for user vars to override defaults
<RickHull>
set up your class defaults in a constant. reify your config by CONSTANT.merge(user_params).merge(env_vars) # or whatever
<waveprop>
okay, nice. so i can use .merge() to add elements to a hash, and it is better to cobine them into a new hash?
<dminuoso>
waveprop: Yes.
<RickHull>
it's good to be aware of the difference. I add keys to hashes all the time ;)
<dminuoso>
*down the road.
<waveprop>
okay. so, why is it bad to mutate the original hash; isnt it more efficient to not create a new object in memory
<waveprop>
ah okay
JsilverT has quit [Quit: WeeChat 2.0-dev]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
waveprop: There are tradeoffs, and it's often not as much of a win to mutate as you might expect.
<havenwood>
waveprop: A functional style in Ruby can save you many headaches.
<baweaver>
Efficient yes, but if you have 10 functions that may mutate something in an unexpected manner it gets hard to trace. This way you don't have to duplicate everything all the time either
<baweaver>
Take for instance a recent case I had in Javascript
<dminuoso>
waveprop: One of the problems is that Ruby has call-by-sharing behavior. Which means you get an argument, and you just transform that hash to store it in a database. Now what you (and nobody else considered), is that the caller reuses that same hash that was passed to you
<baweaver>
I was using reverse to reverse a list for display. When I called it twice everything was fine, all tests were green
<dminuoso>
Not knowing that you mutated it.
bmurt has joined #ruby
<baweaver>
when I called it once more all of the sudden everything broke and I had no idea why
conta has joined #ruby
<RickHull>
for most newbies, mutation is intuitive, and returning a new object feels inefficient
<RickHull>
but it is best to understand and use immutable behavior first, by default
<RickHull>
and only reach for mutability if needed
<al2o3-cr>
h = {foo: :baz}; {foo: :bar, **h} should be faster (maybe)
<havenwood>
The double splat is nice.
<dminuoso>
I promise that in most cases, performance concerns can safely be ignored. Algorithmic choices are much more relevant, but only address issues if a performance problem exists and has been profiled to that part.
<dminuoso>
asm>> {foo: :bar, **h}
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/894190
<dminuoso>
asm>> h.merge({foo: :bar})
cagomez has joined #ruby
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/894191
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
* dminuoso
is just lazy
<waveprop>
RickHull: okay cool. thanks
<al2o3-cr>
if merge is faster **, i'll plait saw dust.
<dminuoso>
>> {**h, foo: :bar}
<ruby[bot]>
dminuoso: # => undefined local variable or method `h' for main:Object (NameError) ...check link for more (https://eval.in/894197)
<RickHull>
waveprop: if you understand how ruby's load path works, then you don't need weird require statements or require_relative (for many things, anyway)
<dminuoso>
asm>> {**h, foo: :bar}
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/894198
<dminuoso>
Okay *that* is not a wise thing to do.
<dminuoso>
Does anyone know what the `swap` instruction does?
eckhardt has quit [Client Quit]
<dminuoso>
baweaver: Please don't say `swapping`
<RickHull>
it exchanges
<RickHull>
;)
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
it makes the machine grind to a halt while it downloads more ram?
PaulCapestany has quit [Read error: Connection reset by peer]
vee__ has joined #ruby
<SeepingN>
nice
alan_w has joined #ruby
<DWSR>
Hey all, I have an app that is using Passenger standalone that is built in a Docker container based on phusion/baseimage. I'm in the process of building it in ruby-alpine instead to slim the image down. How can I get Passenger to download a binary rather than trying to compile from source?
PaulCapestany has joined #ruby
darkmorph has quit [Ping timeout: 240 seconds]
sucks has joined #ruby
swills has joined #ruby
swills has joined #ruby
swills has quit [Changing host]
swills_ has joined #ruby
<RickHull>
is passenger itself being compiled here?
swills has quit [Remote host closed the connection]
<RickHull>
what component is being compiled? presumably written in C
swills_ has quit [Remote host closed the connection]
def_jam has joined #ruby
eb0t_ has joined #ruby
orbyt_ has joined #ruby
swills has joined #ruby
eblip has quit [Ping timeout: 268 seconds]
eb0t has quit [Ping timeout: 252 seconds]
def_jam is now known as eb0t
swills_ has joined #ruby
swills_ has quit [Client Quit]
cdg_ has joined #ruby
kies has quit [Ping timeout: 250 seconds]
jphase has quit [Remote host closed the connection]
alan_w has quit [Ping timeout: 268 seconds]
cdg has quit [Ping timeout: 268 seconds]
mson has quit [Quit: Connection closed for inactivity]
cdg_ has quit [Ping timeout: 268 seconds]
goyox86 has joined #ruby
vee__ has quit [Ping timeout: 248 seconds]
eblip has joined #ruby
def_jam has joined #ruby
blackmesa1 has quit [Ping timeout: 250 seconds]
eb0t_ has quit [Ping timeout: 268 seconds]
eb0t has quit [Ping timeout: 260 seconds]
lucz has quit [Remote host closed the connection]
def_jam has quit [Read error: Connection reset by peer]
eblip has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 240 seconds]
eblip has joined #ruby
def_jam has joined #ruby
weaksauce has joined #ruby
imode has joined #ruby
ap4y has quit [Quit: WeeChat 1.9.1]
ap4y has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
vee__ has joined #ruby
raatiniemi has quit [Ping timeout: 255 seconds]
gigetoo has joined #ruby
cagomez has quit [Remote host closed the connection]
ramfjord has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
marr has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
troys is now known as troys_
jottr__ has quit [Ping timeout: 246 seconds]
sonne has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
bdnelson has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
vee__ has quit [Ping timeout: 260 seconds]
marxarelli is now known as marxarelli|afk
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<b100s>
hi2all! when i do `puts 'hello'` i send message puts to self object isn't it? but when i do it explicitly `self.puts('hello')` it doesn't work. Why?
enterprisey has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 250 seconds]
<elomatreb>
b100s: Because the latter self might not include the Kernel module, which provides the puts method
ramfjord has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
<elomatreb>
Actually, I'm wrong. puts is a private method on Kernel. The way private method access control works in ruby is that private methods can never be called with an explicit receiver
<RickHull>
the relationship between main, Object, and Kernel has never been clear to me
oetjenj has joined #ruby
<RickHull>
well maybe once and then I forgot again
<elomatreb>
main is just an instance of Object
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
kculpis has quit [Ping timeout: 268 seconds]
oetjenj has joined #ruby
<elomatreb>
As to the reason the methods are not actually defined in Object but rather in an additional module, I suspect something to do with BasicObject?
<RickHull>
apparently puts is a private method on Object as well as Kernel
oetjenj has quit [Client Quit]
jdawgaz has joined #ruby
oetjenj has joined #ruby
alan_w has joined #ruby
oetjenj has quit [Client Quit]
<RickHull>
dminuoso explained it earlier, I think, but it didn't make much sense to me
<DWSR>
RickHull: Passenger is being compiled. It was specified in the Gemfile, but when I tried running it via bundler it tried to download a binary?
ramfjord has quit [Ping timeout: 240 seconds]
<DWSR>
Note: I am the Infrastructure engineer, not a Ruby dev.
<RickHull>
DWSR: dunno, sounds like something very specific to Passenger
<DWSR>
It can integrate with either Apache or Nginx and rack
enterprisey has joined #ruby
<b100s>
elomatreb, RickHull thanks! in well-grounded rubies, second edition, said: `Here, in spite of the lack of a message-sending dot and an explicit receiver for the message, we’re sending the message puts with the argument "Hello." to an object: the default object self. There’s always a self defined when your program is running, although which object is self changes, according to specific rules.`
uZiel has joined #ruby
<elomatreb>
That is entirely true, the only thing that's tripping us up here is that puts is a private method (otherwise you'd be able to do "some_string".puts "asdf", which doesn't really make much sense)
ramfjord has quit [Ping timeout: 268 seconds]
<RickHull>
frankly I don't think the relationship web between main, Object, and Kernel is all that sensible, plus the addition of certain ways that certain private methods suddenly become public
<elomatreb>
Where do methods become public?
<RickHull>
>> puts "calling a non-private method, right?"
<ruby[bot]>
RickHull: # => calling a non-private method, right? ...check link for more (https://eval.in/894218)
Cork has quit [Ping timeout: 246 seconds]
<elomatreb>
No:
<elomatreb>
>> self.puts "test"
<ruby[bot]>
elomatreb: # => private method `puts' called for main:Object ...check link for more (https://eval.in/894219)
<RickHull>
why does omitting self make a private method callable?
<elomatreb>
It's really just that: You cannot have any explicit receiver, self included
<RickHull>
hmmm
ramfjord has joined #ruby
ozcanesen has joined #ruby
<elomatreb>
(The IO#puts method is an exception, because it was redefined as a public instance method on the class)
<RickHull>
and so the only place, normally, you can call without an explicit receiver is inside the class?
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
Yep
<elomatreb>
And in cases where you bend the implicit receiver around, like with instance_eval and friends
<RickHull>
reeks of hack and circumstance IMHO
<RickHull>
where a private method is just kinda like OOP privacy sometimes
<elomatreb>
How would you like access control instead? I think it's a fairly elegant solution
<RickHull>
I would say, no access to private methods from outside the class. you could bypass it with #send or whatever_eval
<RickHull>
but don't hinge on explicit receivership
<RickHull>
that seems circumstantial
jdawgaz has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
<RickHull>
as for puts, I'd rather see it as a method on, say, Kernel, and allow kernel methods to be called from toplevel with or without self
<elomatreb>
That's the overall goal of course, but how would you decide whats internal access and what's external access? You can't do a lot of the static stuff other programming languages do due to the dynamic nature of Ruby
<RickHull>
Object#puts seems odd
Cork has joined #ruby
<RickHull>
so I can understand wanting to hide that away
<elomatreb>
In that case you'd have made Kernel methods special again, not sure if that's a good idea either
<RickHull>
but making #puts a private method? that's goofy
mikecmpbll has quit [Quit: inabit. zz.]
ramfjord has joined #ruby
<RickHull>
the toplevel is special, no getting around it
uZiel has quit [Ping timeout: 240 seconds]
<RickHull>
i think making toplevel friendly to Kernel or something Kernel-like is fine
<RickHull>
Object#puts is just weird
<elomatreb>
Kernel is not special, you can make your own module and include it in the same place as Kernel and your methods will behave the same exact way
apeiros has quit [Remote host closed the connection]
<elomatreb>
You could argue the main-is-self outside of other scopes is special, but I don't see any solution to that except prohibiting calling and defining methods outside of those scopes entirely, which is just inconvenient for one-off scripts
jdawgaz has quit [Client Quit]
<RickHull>
I'd rather have nothing be particular special and call IO.puts (defaults to $stdout) or $stdout.puts
<RickHull>
but if we want naked puts, then there's got to be a better way
jdawgaz has joined #ruby
bmurt has joined #ruby
<RickHull>
def IO.puts; include IO # ?
ramfjord has quit [Ping timeout: 240 seconds]
<RickHull>
there is something to be said for an implied "system" context, where puts seems more like a command than a method call
ramfjord has joined #ruby
<elomatreb>
That's a lot of "special" behavior just to avoid a minor ugliness in a context most people don't really need to worry about (i.e. puts just works)
<RickHull>
i feel the opposite, unsurprisingly :)
<elomatreb>
Pretty useless discussion anyway, because I doubt we could get people to change a major Ruby mechanism just like that
<RickHull>
my version, which I have no idea accomplishes its goals, doesn't have special behavior like main and the funky Kernel/Object partial equivalence or whatever
jdawgaz has quit [Ping timeout: 260 seconds]
rhyselsmore has joined #ruby
<RickHull>
just the base ruby primitives, without compromising consistency. perhaps at a slight penalty, like having to `include IO`
<RickHull>
or `include System`
<RickHull>
hm, i guess that doesn't get you naked methods
<RickHull>
welp, i give up on language UI design
darix has quit [Quit: may the packets be with you...]
ramfjord has quit [Ping timeout: 250 seconds]
Cork has quit [Ping timeout: 250 seconds]
mson has joined #ruby
rfoust has joined #ruby
tekacs has quit [Quit: Disappearing... *poof*]
mim1k has joined #ruby
darix has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
Cork has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
alfiemax has quit [Client Quit]
DWSR has quit [Quit: Page closed]
alfiemax has joined #ruby
guacamole has joined #ruby
orbyt_ has joined #ruby
arescorpio has joined #ruby
gnufied has quit [Quit: Leaving]
alfiemax has quit [Remote host closed the connection]
kculpis has joined #ruby
alfiemax has joined #ruby
def_jam is now known as eb0t
<Guest76467>
Do I need something other than Gemfile to use bunder in a project?
gizmore|2 has joined #ruby
JsilverT has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
gizmore has quit [Ping timeout: 240 seconds]
Dimik has quit [Ping timeout: 250 seconds]
duderonomy has quit [Ping timeout: 248 seconds]
<RickHull>
not that I can think of
<Guest76467>
So, I have a gemfile with the source and gem -entries. I guess I'm done.
d^sh has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
JsilverT has quit [Quit: WeeChat 2.0-dev]
sucks has quit [Remote host closed the connection]
darkmorph has joined #ruby
def_jam has joined #ruby
eb0t_ has joined #ruby
eb0t has quit [Ping timeout: 240 seconds]
eblip has quit [Ping timeout: 250 seconds]
Cork has quit [Ping timeout: 258 seconds]
<RickHull>
depending on what you have to accomplish, sure
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
<Guest76467>
Enabling people, including me, to easily install project deps that I'm planning to share on github
<RickHull>
you probably want to to run `bundle install` and if that looks good, then try `bundle exec $project_thingie`
<RickHull>
but the docs should guide you
Ney has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has joined #ruby
bdnelson has quit [Quit: WeeChat 1.9.1]
GodFather has quit [Ping timeout: 258 seconds]
alfiemax has joined #ruby
Cork has joined #ruby
<baweaver>
fastest way to get going: bundle gem (name)
<baweaver>
If you want to share I'd just make it into a gem
<baweaver>
easier to distribute, version, and manage
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 240 seconds]
dviola has quit [Quit: WeeChat 1.9.1]
bdnelson has joined #ruby
Guest42469_ has quit []
eb0t_ has quit [Read error: Connection reset by peer]
Iacobus has joined #ruby
<Guest76467>
I think its just going to be a github repo for a while. Afaics git clone and bundle install would then be enough to testdrive
alan_w has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
eb0t has joined #ruby
eb0t_ has joined #ruby
alan_w has joined #ruby
JsilverT has joined #ruby
<RickHull>
yep, nothing wrong with that
def_jam has quit [Ping timeout: 268 seconds]
agent_white has joined #ruby
<RickHull>
is it working for you?
agent_white has quit [Quit: brb]
eblip has joined #ruby
def_jam has joined #ruby
eb0t has quit [Ping timeout: 260 seconds]
<Guest76467>
Well, $ bundle exec init.rb - does start it
eb0t_ has quit [Ping timeout: 248 seconds]
agent_white has joined #ruby
cschneid_ has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
<Guest76467>
hey cschneid_
agent_white has quit [Client Quit]
agent_white has joined #ruby
Guest76467 is now known as csmrfx
bfs666 has joined #ruby
bdnelson has quit [Ping timeout: 240 seconds]
sucks has joined #ruby
sucks has quit [Remote host closed the connection]
sucks has joined #ruby
bfs666 has left #ruby ["Leaving"]
Asher has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
sucks has quit [Ping timeout: 240 seconds]
Asher has quit [Client Quit]
krz has joined #ruby
zanoni has quit [Ping timeout: 260 seconds]
alan_w has quit [Quit: WeeChat 1.9.1]
Freshnuts has joined #ruby
jphase has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
gix has quit [Ping timeout: 240 seconds]
krz has quit [Quit: WeeChat 1.7]
vondruch has quit [Ping timeout: 240 seconds]
gix has joined #ruby
uneeb has joined #ruby
howdoi has joined #ruby
uneeb has quit [Remote host closed the connection]
veloutin has quit [Ping timeout: 240 seconds]
veloutin has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
eb0t has joined #ruby
darkmorph has quit [Ping timeout: 258 seconds]
fishcooker has joined #ruby
def_jam has quit [Ping timeout: 268 seconds]
eblip has quit [Ping timeout: 250 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Remote host closed the connection]
jphase_ has joined #ruby
jphase has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
Devalo has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
Devalo has quit [Ping timeout: 240 seconds]
eblip has joined #ruby
Derperpe- has joined #ruby
Derperperd has quit [Excess Flood]
eb0t has quit [Ping timeout: 268 seconds]
oetjenj has joined #ruby
sagax has joined #ruby
nowhereman has quit [Ping timeout: 248 seconds]
ozcanesen has quit [Quit: ozcanesen]
k3rn31 has joined #ruby
def_jam has joined #ruby
eckhardt has joined #ruby
mim1k has joined #ruby
rabajaj has joined #ruby
jphase_ has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 248 seconds]
arescorpio has quit [Quit: Leaving.]
JsilverT has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 250 seconds]
whippythellama has quit [Quit: WeeChat 1.4]
JsilverT has joined #ruby
moei has quit [Quit: Leaving...]
Puffball has joined #ruby
JsilverT_ has joined #ruby
JsilverT has quit [Ping timeout: 268 seconds]
nadir has quit [Quit: Connection closed for inactivity]
oetjenj has quit [Ping timeout: 250 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
ta has quit [Remote host closed the connection]
JsilverT_ has quit [Quit: WeeChat 2.0-dev]
JsilverT has joined #ruby
al2o3-cr has joined #ruby
anisha has joined #ruby
cdg has joined #ruby
cdg has quit [Ping timeout: 250 seconds]
kculpis has quit [Ping timeout: 268 seconds]
wu__ has joined #ruby
michael1 has joined #ruby
michael1 has quit [Ping timeout: 268 seconds]
haraoka has joined #ruby
duderonomy has joined #ruby
reber has joined #ruby
michael1 has joined #ruby
eb0t has joined #ruby
eb0t_ has joined #ruby
def_jam has quit [Ping timeout: 268 seconds]
mson has quit [Quit: Connection closed for inactivity]
eblip has quit [Ping timeout: 250 seconds]
biberu has joined #ruby
dionysus69 has joined #ruby
kapil___ has joined #ruby
charliesome has joined #ruby
lacour has quit [Quit: Leaving]
dionysus69 has quit [Quit: dionysus69]
karapetyan has joined #ruby
dionysus69 has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
thuryn has quit [Remote host closed the connection]
apeiros has joined #ruby
karapetyan has quit [Remote host closed the connection]
apeiros has quit [Ping timeout: 240 seconds]
oleo has quit [Quit: Leaving]
kies has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
cschneid_ has joined #ruby
bkxd has joined #ruby
cschneid_ has quit [Ping timeout: 250 seconds]
ap4y has quit [Quit: WeeChat 1.9.1]
bkxd has quit [Ping timeout: 248 seconds]
troys_ is now known as troys
troys has quit [Quit: Bye]
michael1 has quit [Ping timeout: 268 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alex`` has joined #ruby
conta has joined #ruby
apeiros has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
Haris has joined #ruby
<Haris>
hello all
ramfjord has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
<Haris>
I'm trying to install crowdtilt. in its doc ( https://github.com/Crowdtilt/CrowdtiltOpen/wiki/Setup-Instructions ), its showing a command for bundle install. when I run this command on shell/cli, I get error about it being unknown. Am I doing something wrong ?
<Haris>
I'v installed 1.9.3 as per requirement of this app. this version is set to default. do I need to activate it or something for this command to work ?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Haris>
the rake secret command is also not working
<Haris>
is that related to ruby ?
snickers has joined #ruby
<RickHull>
yep, a couple things:
Dimik has joined #ruby
<RickHull>
1. ruby 1.9.3 is ancient -- you are probably fine with 2.x line and should prefer it
apeiros has joined #ruby
<RickHull>
2. ruby comes packaged with rake
<RickHull>
3. bundler is a separate gem (a ruby package)
<Haris>
ok, so rake is not working. that means ruby install didn't go ok ? and I need to install the bundler pkg/gem first ?
ramfjord has quit [Ping timeout: 268 seconds]
<RickHull>
with rvm, you may need to log in again for rvm to recognize your installed rubies -- not sure
<Haris>
hmm
<RickHull>
confirm your ruby install with `ruby --version`
<Haris>
that was confirmed. my shell/cli was showing 1.9.3 output for ruby --version
<Haris>
..as+ output..
<Haris>
%s/as/in/
<RickHull>
if you have ruby 1.9.3, then you should have rake in your path as well
<RickHull>
what do you have for `which ruby` ?
b100s has quit [Quit: Leaving]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quobo has quit [Quit: Connection closed for inactivity]
<Haris>
hold please
trosa has joined #ruby
<Haris>
on mac, I have its mapped to a username's home folder ----> /Users/username/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
charliesome has joined #ruby
michael1 has joined #ruby
<Haris>
%s/I have its/its/
<RickHull>
is there anything else in that bin/ dir?
<Haris>
this app is old. it snot being maintained anymore
<Haris>
its in its requirement
<Haris>
requirements+
<Haris>
hmm
<RickHull>
sure, i mean -- they wrote that when 1.9.3 was the latest
<Haris>
=)
<RickHull>
lacking a claim that it works on 2.x is not evidence that it doesn't
enterprisey has quit [Remote host closed the connection]
<RickHull>
it will be painful to try to run 1.9.3 stuff
<RickHull>
and you run security risks
<RickHull>
a lot of libs and gems and stuff will be out of date and vulnerable
<RickHull>
and a lot of docs and such won't work for you
claudiuinberlin has joined #ruby
adlerdias has joined #ruby
adlerdias has quit [Remote host closed the connection]
adlerdias has joined #ruby
JsilverT has joined #ruby
Dimik has quit []
adlerdias has quit [Client Quit]
mikecmpbll has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 260 seconds]
InfinityFye has joined #ruby
jphase has joined #ruby
Puffball has quit [Remote host closed the connection]
Mont3 has joined #ruby
zautomata2 has quit [Ping timeout: 240 seconds]
andikr has quit [Ping timeout: 240 seconds]
<Mont3>
o/
aeaeaeae2 has joined #ruby
zautomata2 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Dimik has joined #ruby
jphase has quit [Ping timeout: 246 seconds]
iamarun has joined #ruby
brent__ has quit [Quit: Connection closed for inactivity]
Mont3 has quit [Ping timeout: 268 seconds]
Sina has joined #ruby
miskatonic has joined #ruby
jphase has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Quit: inabit. zz.]
jphase has quit [Ping timeout: 240 seconds]
jphase has joined #ruby
blackmesa1 has joined #ruby
iamarun has quit [Ping timeout: 240 seconds]
ana_ has joined #ruby
aeaeaeae2 has quit [Quit: Lost terminal]
zautomata3 has joined #ruby
Dimik has quit [Remote host closed the connection]
zautomata2 has quit [Ping timeout: 246 seconds]
Burgestrand has joined #ruby
Silthias has joined #ruby
quobo has joined #ruby
Silthias1 has quit [Ping timeout: 252 seconds]
blackmesa1 has quit [Quit: WeeChat 1.9.1]
zautomata4 has joined #ruby
zautomata3 has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
jphase has quit [Ping timeout: 268 seconds]
imode has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
charliesome has quit [Client Quit]
kapil___ has quit [Quit: Connection closed for inactivity]
karapetyan has joined #ruby
mim1k has joined #ruby
mark_66 has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
vondruch has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
<waveprop>
sorry to crosspost but i don't think #rubyonrails will support rack. please guide me in the right direction, i don't understand what i'm doing wrong, http://termbin.com/p9lh
mim1k has quit [Ping timeout: 258 seconds]
wu__ has joined #ruby
<matthewd>
waveprop: What do you expect `use First::Base 'go' do` to do?
r3QuiEm_cL has joined #ruby
zenspider has quit [Ping timeout: 248 seconds]
<waveprop>
matthewd: i expect it to pass the string 'go' as the second parameter to First::Base.initialize, and the block as the second
<waveprop>
matthewd: that was the first thing i tried, and i get unexpected keyword_do_block http://termbin.com/rrc4
zenspider has joined #ruby
<matthewd>
Try adding a comma in the right place ¯\_(ツ)_/¯
ramfjord has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
wu__ has quit [Ping timeout: 268 seconds]
Ayey_ has joined #ruby
mim1k has joined #ruby
<waveprop>
strange. so the last argument before a block doesnt need a comma
<waveprop>
matthewd: thanks very much for your help.
ramfjord has quit [Ping timeout: 248 seconds]
<matthewd>
Right; the block is not a positional parameter
<waveprop>
okay good to know
<waveprop>
can i ask why
<matthewd>
The short answer is that it's just the way the syntax works
<matthewd>
Slightly longer is that blocks are a syntax construct, not a value, so they have their own syntax
<matthewd>
And as they're already distinguished by that syntax, a comma would be redundant
<waveprop>
okay. thanks
marr has joined #ruby
<waveprop>
i would never have figured that out
redhedded1 has joined #ruby
zautomata has joined #ruby
haraoka has quit [Ping timeout: 240 seconds]
zautomata4 has quit [Ping timeout: 250 seconds]
wu__ has joined #ruby
Beams has joined #ruby
Serpent7776 has joined #ruby
cschneid_ has joined #ruby
dhollin has joined #ruby
dhollin3 has quit [Ping timeout: 246 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
r3QuiEm_cL has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iamarun has joined #ruby
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wu__ has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
alfiemax has joined #ruby
karapetyan has joined #ruby
redondos has joined #ruby
karapetyan has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby
cschneid_ has joined #ruby
adlerdias has joined #ruby
kapil___ has joined #ruby
cschneid_ has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
jphase has joined #ruby
Burgestrand has quit [Quit: Closing time!]
jphase has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
troulouliou_div2 has joined #ruby
darkness has joined #ruby
darkness has quit [Client Quit]
jphase has joined #ruby
ferr has joined #ruby
n13z has quit [Ping timeout: 240 seconds]
ldnunes has joined #ruby
n13z has joined #ruby
Silthias1 has joined #ruby
sekmo has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
JsilverT has quit [Ping timeout: 240 seconds]
shaun has joined #ruby
<shaun>
hello room
jphase has quit [Ping timeout: 240 seconds]
zanoni has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
jottr__ has joined #ruby
jphase has joined #ruby
jottr__ has quit [Client Quit]
<apeiros>
hi shaun
<waveprop>
http://termbin.com/tgft => how do i get the block from config.ru " First::Base.post '/hello' do" to execute in the class context of lib/first.rb:Base#call ?
<waveprop>
i'm getting NilClass no method []. i think it's because the @routes structure isnt getting populated with my route definitions in config.ru.
<waveprop>
i think i need to get that inner block to populate @routes at the instance level.. in the class definition. am i wrong?
drptbl has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
cschneid_ has joined #ruby
Hexafox[I] has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 250 seconds]
fishcooker has quit [Quit: Leaving.]
shaun has quit [Quit: Page closed]
drptbl has quit [Quit: See you later!]
GodFather has joined #ruby
selim has quit [Ping timeout: 250 seconds]
jaruga has joined #ruby
jaruga has quit [Remote host closed the connection]
miskatonic has quit [Read error: Connection reset by peer]
Burgestrand has joined #ruby
Psybur has joined #ruby
mim1k_ has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
iamarun has quit [Remote host closed the connection]
snickers has quit [Read error: Connection reset by peer]
blackbaba has joined #ruby
banisterfiend has joined #ruby
thinkpad has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
nadir has joined #ruby
FahmeF has quit [Ping timeout: 260 seconds]
Psybur has quit [Ping timeout: 260 seconds]
yokel has quit [Remote host closed the connection]
thinkpad has joined #ruby
yokel has joined #ruby
blackbaba has quit [Remote host closed the connection]
thinkpad has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 258 seconds]
blackbaba has joined #ruby
thinkpad has joined #ruby
blackbaba has quit [Client Quit]
minimalism has quit [Quit: minimalism]
mim1k has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardov_ has joined #ruby
milardovich has quit [Ping timeout: 250 seconds]
ajaysingh has joined #ruby
ldnunes has quit [Ping timeout: 260 seconds]
uZiel has quit [Ping timeout: 250 seconds]
jphase has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
banisterfiend has joined #ruby
anisha has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 250 seconds]
John___ has joined #ruby
jphase has joined #ruby
VladGh has quit [Remote host closed the connection]
ldnunes has joined #ruby
VladGh has joined #ruby
JsilverT has joined #ruby
jphase has quit [Ping timeout: 250 seconds]
tvw has joined #ruby
jphase has joined #ruby
ldnunes has quit [Ping timeout: 250 seconds]
jphase has quit [Ping timeout: 248 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
jrafanie has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
mim1k has joined #ruby
ldnunes has joined #ruby
truenito has joined #ruby
darkmorph has joined #ruby
ramfjord has joined #ruby
milardovich has joined #ruby
jphase has quit [Ping timeout: 250 seconds]
truenito has quit [Remote host closed the connection]
jphase_ has joined #ruby
milardov_ has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
infernix has quit [Ping timeout: 240 seconds]
blackbaba has joined #ruby
truenito has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
huyderman has quit [Ping timeout: 240 seconds]
quobo has quit [Quit: Connection closed for inactivity]
govg has quit [Ping timeout: 240 seconds]
jphase_ has quit [Ping timeout: 252 seconds]
huyderman has joined #ruby
blackbaba has left #ruby [#ruby]
truenito has quit [Ping timeout: 268 seconds]
konsolebox has joined #ruby
synthroid has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
nowhereman has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather_ has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather_ has quit [Client Quit]
<dminuoso>
matthewd: See, this is why I like my lambdas. No weird confusion about how functions have to be passed compared to values. ;p
<dminuoso>
Functions are values. ;p
GodFather has joined #ruby
GodFather_ has joined #ruby
DWSR has joined #ruby
alex`` has quit [Quit: WeeChat 1.9.1]
<dminuoso>
Also I tried my fiddle hacks to turn procs into lambdas yesterday but gave up after realizing that it might not be as stable as I would like (because there's quite a few structs before the final uint8_t that makes the decision)
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<DWSR>
Hey guys, I'm in the process of trying to compile PassengerAgent on Alpine and getting the following error: https://gist.github.com/DWSR/fd114736451c013e59744e00fcf1f439. Is there a way that I can get more verbose information? I'm trying to figure out what's missing from the system in order to successfully build.
infernix has joined #ruby
jphase has joined #ruby
<dminuoso>
DWSR: How did you "compile PassengerAgent" ? If it's done with gem, you should obtain an mkmf.log
<DWSR>
dminuoso: So Passenger (the gem) needs a helper binary.
<DWSR>
Once you have the Gem, if you try to run `passenger start`, it will try to either download or compile this helper binary.
<dminuoso>
DWSR: I know why I avoid passenger. Puma is simply much less of a hassle. :|
<DWSR>
dminuoso: Yes, I know. :(
<dminuoso>
It just works, without quirky native extensions, weird nginx integration, etc.
<DWSR>
Unfortunately this isn't my call. I'm trying to slim down my images and speed up the build process for the containers.
<DWSR>
At the moment, even with compilation of Passenger, I've still got about a 30% time savings and about a 1.2GB space reduction
<DWSR>
I am pressuring PTB to moving to Puma or Unicorn
<DWSR>
But that may not make it on the priority list, so this work is still valid for the meantime.
alfiemax has joined #ruby
jphase has quit [Ping timeout: 240 seconds]
<dminuoso>
Partido Trabalhista Brasileiro?
<dminuoso>
Powers That Be?
<DWSR>
Powers That Be.
<dminuoso>
;o
<DWSR>
I was originally going to use PHB, but I like him
Rapture has joined #ruby
zapata has quit [Ping timeout: 252 seconds]
<dminuoso>
Polyhydroxybutyrate?
<DWSR>
Pointy Haired Boss.
<DWSR>
dminuoso: Anyway, anything that you can suggest that's more directly relevant to my inquiry?
milardovich has quit []
alfiemax has quit [Remote host closed the connection]
ramfjord has joined #ruby
alex`` has joined #ruby
alfiemax has joined #ruby
govg has joined #ruby
mson has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
<dminuoso>
DWSR: Nothing conclusive.
<dminuoso>
I know how I would debug it, but its unlikely to be helpful.
ajaysingh has quit [Remote host closed the connection]
<dminuoso>
DWSR: Is that the entire output, or is there more? Perhaps a ruby stack trace? Or additional output before that?
<DWSR>
The additional output before is very similar to L1 in that snippet.
<dminuoso>
gist it anyway.
<dminuoso>
I want to see the entirety of it.
<DWSR>
Otherwise, that's the entire output. I'm trying to get more verbose output to start
<dminuoso>
-DHASH_FUN_H="<hash_fun.h>" -c src/cxx_supportlib/Utils/IOUtils.cpp src/cxx_supportlib/Utils/IOUtils.cpp:58:24: fatal error: linux/net.h: No such file or directory
<DWSR>
Hah, that's in the other Dockerfile that I linked.
<DWSR>
(The other one where someone knows what they're doing()
<dminuoso>
DWSR: For future reference, gist entire log outputs. It's not offensive to dump 10 pages of logs, it's much more helpful.
<dminuoso>
(unless you know with absolute certainty that its not relevant)
tcopeland has quit [Quit: tcopeland]
alnewkirk has joined #ruby
JsilverT has quit [Read error: Connection reset by peer]
s3nd1v0g1us has quit [Ping timeout: 246 seconds]
mikecmpb_ has joined #ruby
JsilverT has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
Bish has joined #ruby
<Bish>
how would i get all tributes in "body"
<Bish>
nokogiri that is.
JsilverT has quit [Client Quit]
<dminuoso>
Nokogiri lenses.
<dminuoso>
Its all clear to me.
<dminuoso>
That's what we need.
JsilverT has joined #ruby
<Bish>
xpath is bullshit, so yeah.
<Bish>
still haven't solved that issue
<Bish>
#(Attr:0x8d8768 { name = "xmlns:v", value = "urn:schemas-microsoft-com:vml" }),
<Bish>
#(Attr:0x8d8754 { name = "xmlns:o", value = "urn:schemas-microsoft-com:office:office" })]
<Bish>
having these 2 in my "doc"
<Bish>
fucks everything up
GodFather has joined #ruby
<waveprop>
functions are values?
<tobiasvl>
waveprop: what do you mean?
<Bish>
should be the other way around, values should be function, amiright dminuoso
<waveprop>
tobiasvl: in the scrollback dminuoso said it
<waveprop>
i think he was talking about a specific code, now that i reread what he said
<waveprop>
s/code/bit of code/
<tobiasvl>
aha. well, depends what you think of as a "function" and what a "value" is ;) ruby METHODS are neither functions nor "values" (if you mean first-class objects), but procs are
zanoni has quit [Read error: Connection reset by peer]
konsolebox has quit [Ping timeout: 260 seconds]
John___ has quit [Read error: Connection reset by peer]
<dminuoso>
tobiasvl: methods can directly be obtained
<Bish>
dminuoso: you know how i would get all nodes which are NOT containing something THEIR attributes?
dionysus69 has quit [Ping timeout: 250 seconds]
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 268 seconds]
Haris has left #ruby [#ruby]
<waveprop>
has minitest been removed from stdlib
bkxd has quit [Ping timeout: 248 seconds]
<DWSR>
dminuoso: lol, running tests against my codebase in this new container right now and forgot we needed redis. Was freaking out because errors EVERYWHERE
<ruby[bot]>
Bish: I have disassembled your code, the result is at https://eval.in/894694
<Bish>
so there is no way to check for falsyness except for tenary, !, and if?
cschneid_ has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
reber has quit [Quit: Leaving]
<LyndsySimon>
I'm considering writing a gem to ease CSV parsing in Ruby - if you have a sec, I'd appreciate a quick review of the short README. I'm looking for community input before I decide whether or not writing it is worth my time: https://gitlab.com/lyndsysimon/ideas/blob/master/csv_parser.md
ana_ has quit [Quit: Leaving]
mim1k has quit [Ping timeout: 258 seconds]
<Bish>
LyndsySimon: keep me updated
<Bish>
i hate 'csv'
<Bish>
uhh, thats cool
<LyndsySimon>
Bish: Oh? I've honestly never used it. I came up with this idea after discussing options to reduce code duplication for CSV import scripts in a web app at work.
<Bish>
in your dsl, the order in which "fields" are givin is the same as in the file?
<Bish>
what about headlines in csv?
<LyndsySimon>
I'm kind of on a kick writing DSLs right now, and it seemed like a natural fit. Too much work to justify it for work, but not if others find it useful.
<Bish>
dsl are the sickest shit ever
<LyndsySimon>
Bish: Yes, fields are defined by default in the order they are presented in the file.
synthroid has quit [Remote host closed the connection]
<Bish>
DSLs are always natural fit.. because thats what they do
<Bish>
theyre specific for the domain.. they work for
<LyndsySimon>
Bish: I've not yet thought much about title rows. I may just exclude them, or I may allow you to define fields based upon the titles in the title row.
<LyndsySimon>
Bish: My favorite DSL I've written so far is for defining datatables. It's written on top of ajax-datatables-rails.
<Bish>
field :family_name, from: last_name what does this mean then?
<Bish>
your type also says ":integer"
<Bish>
you should use Integer instead
<Bish>
there is no reason to use the class itself, it's a value/object, too
jarnalyrkar has joined #ruby
mim1k has joined #ruby
<LyndsySimon>
Bish: It's still rough :) I planned to support using it as an object or a keyword, and to allow you to register new types as keywords.
jarnalyrkar has left #ruby [#ruby]
<Bish>
yeah if you're giving a type for integer use
<LyndsySimon>
The "from: last_name" part, I was thinking that the field was named "last_name" in the CSV. Like I said, not fully formed, just trying to illustrate the overall idea.
<Bish>
but i like the idea of having a dsl for getting a result out of a csv
<Bish>
you should add support for bad encoding and stuff
<Bish>
because the things.. fuck me up most in ruby csv
<Bish>
and quoting which isn't correct... detection for it
<LyndsySimon>
Bish: What about the idea of splitting out the process into several steps? i.e., schema definition, row validation, excluding rows, processing rows, etc.
<Bish>
remember a stackoverflow where someone did quote_char:"<utf8snowman>"
<Bish>
LyndsySimon: i think you can split hsoe, but not as detailed as you do
<Bish>
you could put "schema & row validation" together
<Bish>
and exluding and processing
michael1 has quit [Ping timeout: 240 seconds]
<Bish>
kinda like
jarnalyrkar has joined #ruby
<LyndsySimon>
Bish: My general approach is to handle the 80% use case first, and by default. Only schema definition and per-row processing would actually be required.
<LyndsySimon>
Ideally, I'd like most uses of my code to be only a few short, clear, concise lines. Only if things deviate from the norm should there be additional complexity exposed to the dev.
jarnalyrkar has quit [Client Quit]
Burgestrand has quit [Quit: Closing time!]
jarnalyrkar has joined #ruby
<LyndsySimon>
Anyhow, thanks for letting me bounce the idea off you :) I have an inkling I may write the gem this week for fun.
jarnalyrkar has quit [Client Quit]
jarnalyrkar has joined #ruby
jnollette has quit [Quit: All your IRC are belong to ZNC]
orbyt_ has joined #ruby
<Bish>
weird definition of fun you have there
jnollette has joined #ruby
<LyndsySimon>
FWIW I'm not a huge fan of Ruby as a language. I come from a Python background mostly and have branching out into more functional languages, specifically those centered on immutable types. I've discovered that I really like Ruby for writing DSLs though.
<Bish>
reminds of that dude, who writes stellaris mods, which are super sophisticated
<Bish>
"i do actually not play stellaris, i like writing mods, though"
<LyndsySimon>
LOL.
<LyndsySimon>
Yeah, I can see that.
jarnalyrkar has quit [Client Quit]
<Bish>
LyndsySimon: well skip ruby, do haskell :D
<Bish>
or lisp
<Bish>
i've been there
<LyndsySimon>
My problem is time. This gem seems like something I can whip up fairly quickly, and something that won't require a ton of ongoing maintenance.
<Bish>
still am, but i've been there
jarnalyrkar has joined #ruby
jarnalyrkar has quit [Client Quit]
<Bish>
in haskell you can have DSLs compiled to native code, if that's not cool i don't know what is
jarnalyrkar has joined #ruby
<LyndsySimon>
I've dabbled in Haskell. It fits the way I think, but I'm not yet fluent in the syntax. Every time I go back to it, I get to the point where I'm overwhelmed by the terminology that's used - monads, functors, et. al.
<Bish>
same here
<LyndsySimon>
Clojure fits me pretty well too, but I find that every time I get in the flow I have to reach back into Java for something and it breaks my flow.
<Bish>
same here**2
<LyndsySimon>
Plus, Clojure's tooling is *slow*.
<LyndsySimon>
Nim is very, very interesting to me. The only real issue I have with it is that the standard library uses mutable types by default.
aufi_ has quit [Quit: Leaving]
Devalo has joined #ruby
<LyndsySimon>
Oh hey - here's an example of a previous DSL I've written, in use:
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
waveprop has quit [Ping timeout: 248 seconds]
moei has joined #ruby
GodFather has joined #ruby
Silthias has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
Silthias1 has quit [Ping timeout: 250 seconds]
ozcanesen has joined #ruby
truenito has joined #ruby
the_f0ster has quit [Quit: leaving]
ozcanesen has quit [Quit: ozcanesen]
mikecmpbll has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
kies has joined #ruby
alfiemax has joined #ruby
milardovich has joined #ruby
imode has quit [Ping timeout: 258 seconds]
hahuang65 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 250 seconds]
<dminuoso>
apeiros: Haha.
<dminuoso>
apeiros: Yeah, I love how I have gotten tab-separated files from other companies with .csv extension, called "csv" in mails and named "comma separated value using semicolon separators" in specs.
milardovich has quit [Ping timeout: 268 seconds]
<dminuoso>
That has the same quality as that "Chili con carne without meat" sign on a restaurant a few years back.
alfiemax has joined #ruby
Ayey_ has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
eckhardt_ has joined #ruby
milardovich has joined #ruby
orbyt_ has joined #ruby
Ayey_ has quit [Ping timeout: 258 seconds]
raynold has joined #ruby
Rapture has joined #ruby
Silthias1 has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
Silthias has quit [Ping timeout: 250 seconds]
ta has joined #ruby
ta has quit [Remote host closed the connection]
ta has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
ledestin has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
<LyndsySimon>
Can anyone tell me why this fails?
Devalo has joined #ruby
<LyndsySimon>
>> x = Integer; x('1')
<ruby[bot]>
LyndsySimon: # => undefined method `x' for main:Object (NoMethodError) ...check link for more (https://eval.in/894905)
ozcanesen has quit [Quit: ozcanesen]
lucz has quit [Remote host closed the connection]
<dminuoso>
LyndsySimon: methods and local variables occupy different namespaces.
ozcanesen has joined #ruby
<LyndsySimon>
dminuoso: OK... I'm not following.
<dminuoso>
LyndsySimon: so the way ruby works, is whenever ruby sees an assignment to a variable, lexigraphically following code assumes `x` to be a variable, a method otherwise.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
LyndsySimon: However, if you explicitly use (), it will assume you try to use a method instead.
ozcanesen has quit [Client Quit]
<dminuoso>
so it will not use the local variable, but look for a method named x instead.
<LyndsySimon>
>> x '1'
<ruby[bot]>
LyndsySimon: # => undefined method `x' for main:Object (NoMethodError) ...check link for more (https://eval.in/894906)
<LyndsySimon>
There's a lookup table for methods, and another for variables in scope. Right?
<LyndsySimon>
I have a glimmer of understanding, though.
<dminuoso>
LyndsySimon: How advanced is your ruby knowledge?
<dminuoso>
LyndsySimon: ruby maintains a table of local variables, but not exactly a "table of methods"
<LyndsySimon>
LOL.
<dminuoso>
(I just need to know whether I have to say yes or no)
<dminuoso>
this shows the exact behavior.
<LyndsySimon>
I think it's pretty advanced, honestly.
<dminuoso>
methods *always* in absolutely all instances belong to either a class or a module.
lucz has joined #ruby
<dminuoso>
(which themsevles have method tables)
<LyndsySimon>
I haven't thought about it like that, but that makes sense.
<dminuoso>
LyndsySimon: look at that eval.in though. it shows exactly how this works.
Technodrome has joined #ruby
<LyndsySimon>
Yeah, I'm digesting it.
Devalo has quit [Ping timeout: 250 seconds]
<LyndsySimon>
OK, I think I understand the eval.in - the existence of an in-scope variable `x` means that it shadows the method `x`, which is a method. Adding parens skips the lookup in the variable table(s), so it gets the actual object.
<LyndsySimon>
My problem is that I need to assign the Integer - the callable - to a variable, then call it on another object later.
<dminuoso>
LyndsySimon: Exactly.
<dminuoso>
LyndsySimon: If you want to invoke a callable object. you use .() instead.
<dminuoso>
>> a = -> { puts "hi" }; a.()
<LyndsySimon>
`x` does in fact contain the object I want to call, but neither method allows me to actually call it. Is there another way to call it?
<dminuoso>
Or, since .() is just syntax sugar, you can use .call() explicitly
<dminuoso>
.() is basically just short-form of .call()
[Butch] has joined #ruby
* LyndsySimon
laughs
<LyndsySimon>
>> x = Integer; x.('1')
<ruby[bot]>
LyndsySimon: # => undefined method `call' for Integer:Class ...check link for more (https://eval.in/894915)
<dminuoso>
20:25 LyndsySimon | OK, I think I understand the eval.in - the existence of an in-scope variable `x` means that it shadows the method `x`, which is a method. Adding parens skips the lookup in the variable table(s), so it gets the
<dminuoso>
Integer shadows Integer(), but by adding () you tell ruby "dont look for an object Integer, look for a method instead"
<apeiros>
actually, with constants versus methods, there's no shadowing
darkmorph has quit [Ping timeout: 264 seconds]
<apeiros>
ruby requires unambiguous syntax with capitalized methods
<LyndsySimon>
dminuoso: ... but `Integer '`'` works. I assume there is something special in `Integer` that tells it to call `Integer()` if it's being called and not assigned to a variable?
<apeiros>
that is: either pass an argument, or write parens explicitly
<apeiros>
but `Foo` will never invoke a method `Foo()`
<LyndsySimon>
apeiros: Thank you, that part was missing for me
<dminuoso>
greengriminal: The trick is to use a module, prepend, then you can use super
<greengriminal>
ohhh saucy
<dminuoso>
(Or you could use two alias_method, but prepending a module is cleaner)
<dminuoso>
So you do use inheritance, but in a less intuitive way. :)
<cluelessperson_>
hi, is it normal I've to use sudo permission to install a gem on macos?
<dminuoso>
cluelessperson_: That depends. Are you using the macOS supplied ruby?
<SeepingN>
consider not doing that ;)
<Nilium>
You should probably just install gems local to your user
reber has quit [Quit: Leaving]
<cluelessperson_>
dminuoso: I'm on a very fresh install of macos and when I'm trying to install a simple gem I get: "ERROR while executing gem, you don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory"
<dminuoso>
cluelessperson_: Then yes. But you should *really* not use it, it brings 2.0.0 which is extremely old, has plenty of bugs and is on the border of not running modern things.
<dminuoso>
cluelessperson_: Please consider either installing a newer version using ruby-install or chruby.
<Nilium>
Mmm, no, I think Ruby on OS X these days is 2.3 or 2.4
<Nilium>
Oh, 2.3, per that path
<cluelessperson_>
oh I see
<dminuoso>
Nilium: nope
<Nilium>
2.4 would be moving a bit fast for Apple.
<miah>
whereas with chruby, you use ruby-install to handle the installation of ruby, and can have literally every supported version of ruby on your system and use chruby to switch between them
<miah>
if you only need a single version of ruby, brew is probably fine
<havenwood>
cluelessperson_: LIke miah said, brew will limit choices you have. You'll be able to install latest Ruby, JRuby or Rubinius - but it's harder to do exact versions.
<dminuoso>
greengriminal: You got things swapped around.
<dminuoso>
greengriminal: When you prepend, method dispatch will consider prepended modules *before* the class.
<miah>
and fwiw, you can brew install chruby and brew install ruby-install
<havenwood>
cluelessperson_: RVM lets you use a precompiled binary, like brew, but provides more versions. Both ruby-install and ruby-build compile Ruby from source.
<dminuoso>
greengriminal: So in a weird way it acts as if Float is an ancestor of SpecialFloat (in a super hacky way)
<havenwood>
brew install chruby ruby-install
<miah>
so you can _still_ use brew to manage those things, but you'd have to manually invoke ruby-install to install say, 2.4.2 'ruby-install ruby 2.4.2'
vee__ has quit [Ping timeout: 250 seconds]
<cluelessperson_>
havenwood, miah: perfect explications now I get it, thanks for the clarification guys!
xco has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
ap4y has joined #ruby
enterprisey has joined #ruby
<greengriminal>
dminuoso, I ended up using the `alias`
blackwind_123 has joined #ruby
Ayey_ has quit [Ping timeout: 258 seconds]
Toggi3 has quit [Ping timeout: 260 seconds]
<dminuoso>
greengriminal: I recommend you use the prepend method, Let me show you
<dminuoso>
apeiros: In all fairness, I personally believe this is blown out of proportion.
Ayey_ has joined #ruby
<dminuoso>
If double precision is good enough for almost the entirety of physics, simulations, then its good enough for money.
<apeiros>
you're mistaken
michael1 has joined #ruby
<dminuoso>
That isn't to say that I agree that rational or integral representation is better, but I don't think using `double` is that much of an issue for the majority of folks.
<apeiros>
again, you're mistaken
<RickHull>
how can we show that?
<apeiros>
it's the other way round. some few people would be able to use doubles properly for money. the majority will do stupid mistakes which lead to errors.
blackwind_123 has quit [Ping timeout: 250 seconds]
<dminuoso>
apeiros: Care to elaborate further?
<dminuoso>
Perhaps with a concrete example?
<apeiros>
google will produce better examples than what I can come up with from the top of my head
blackwind_123 has joined #ruby
Ayey_ has quit [Ping timeout: 268 seconds]
<RickHull>
i think what tends to happen is multiple layers in a federated app will do various truncations and rounding at different steps
<RickHull>
and things don't reconcile at the end when they're supposed to
<RickHull>
and it costs a million bucks to trace the error
<RickHull>
only sorta kidding on the last point
<RickHull>
integer bucks, mind you
alnewkirk has quit [Ping timeout: 268 seconds]
greengriminal has quit [Quit: Leaving]
yabbes has quit [Quit: lu]
David_H_Smith has quit [Remote host closed the connection]
jarnalyrkar has joined #ruby
<elomatreb>
If you really want to be serious use Complex for your monetary values, obviously
cluelessperson_ has quit [Quit: Page closed]
michael1 has quit [Ping timeout: 250 seconds]
<elomatreb>
That's $5+0i, please
GodFather has quit [Ping timeout: 252 seconds]
imode has quit [Ping timeout: 264 seconds]
RickHull has quit [Ping timeout: 260 seconds]
<apeiros>
elomatreb: for your imaginary amounts of money? :)
<elomatreb>
You never know
xco has joined #ruby
<apeiros>
0+1e9i
<apeiros>
I'm an imaginary billionaire :D
marxarelli is now known as marxarelli|afk
GodFather has joined #ruby
jordanm has quit [Remote host closed the connection]
karapetyan has joined #ruby
darkmorph has joined #ruby
jordanm has joined #ruby
<dminuoso>
Or a very complex billionaire.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
dminuoso: Be rational
<dminuoso>
baweaver: Pff. I have transcended from such verbal attacks.
<jokke>
what would you recommend as fast non-cryptographic hashing algorithm in ruby?
vee__ has quit [Ping timeout: 260 seconds]
shinnya has joined #ruby
<elomatreb>
Well, what do you want to do? Usually there's no good reason not to use the standard "cryptographic" functions
Ayey_ has quit [Ping timeout: 250 seconds]
<jokke>
i want to maintain a cache
<jokke>
see if files have changed
jphase_ has quit [Remote host closed the connection]
<elomatreb>
Git uses SHA1 for exactly that, and it's not a performance problem
<jokke>
for me it is, even with md5
<elomatreb>
Are you sure the performance critical part is actually the hashing, or the waiting on the disk IO?
<jokke>
good point
<jokke>
i will have to check that
<jokke>
ah
<jokke>
no it's something completely different ;)
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest7694>
what am i doing incorrectly to set the instance variable @routes['testing'] from config.ru? http://termbin.com/t01v
<Guest7694>
i think i cant run the instance method post() from within the nested blocks in config.ru but i dont know why. is there a concept i am missing
<dminuoso>
Guest7694: Please use gist at github for future pastes. Syntax highlighting improves readability a lot.
<waveprop>
havenwood: i will. this is just a stripped down subset of my code for debugging purposes
agent_white has quit [Quit: bbl]
jphase has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<waveprop>
i don't understand why i cant call the method from within the nested blocks in config.ru. i have tried many ways
marxarelli|afk is now known as marxarelli
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<waveprop>
i mean, the post method is the one i'm triyng to call as you can see
<waveprop>
thanks for pointing out that incorrect ||=
jphase has quit [Ping timeout: 258 seconds]
David_H_Smith has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
<waveprop>
i think that Rack's "use" command runs each middleware class as an instance but i cant seem to wrap my mind around how to define instance level behavior within the class-level code. do i misunderstand here
Psybur has joined #ruby
charliesome has joined #ruby
<waveprop>
previously, i could write instance-level code within config.ru because i was instantiating the app and then run-ing it. but now that i've moved it into a middleware, i have to nest these blocks which 'punch-in' to the class level code, and i'm finding that i can't do things the same way
<waveprop>
if anyone can suggest something to read which might address my problem, please do
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
David_H_Smith has quit [Remote host closed the connection]
jphase has joined #ruby
David_H_Smith has joined #ruby
<waveprop>
i thought this was a problem with method scope but directly refering to post as a class method doesnt seem to act at instance-level, and the instance variable @routes remains unset
gnufied has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 250 seconds]
charliesome has quit [Ping timeout: 260 seconds]
jphase has quit [Ping timeout: 250 seconds]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
ozcanesen has quit [Quit: ozcanesen]
hahuang65 has joined #ruby
<waveprop>
maybe it's a problem that i'm mutating @routes
troys_ is now known as troys
<waveprop>
but isnt that sort of the point of an instance variable
jphase has joined #ruby
jphase has quit [Read error: Connection reset by peer]
mson has quit [Quit: Connection closed for inactivity]
jphase has joined #ruby
aclark has quit [Remote host closed the connection]
aclark has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
Ayey_ has joined #ruby
lucz has joined #ruby
nofxx has quit [Remote host closed the connection]
<waveprop>
/wc
<waveprop>
/wc
waveprop has quit [Quit: leaving]
Ayey_ has quit [Ping timeout: 268 seconds]
John___ has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
xco_ has joined #ruby
xco has quit [Ping timeout: 260 seconds]
xco_ is now known as xco
nofxx has joined #ruby
David_H_Smith has quit [Remote host closed the connection]
cschneid_ has quit [Remote host closed the connection]