QpQ4 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<KrzaQ>
(it wasn't, but I'm curious)
<elomatreb>
#{} is ruby code, unless you do formatting yourself it doesn't do anything special
haylon has quit [Ping timeout: 240 seconds]
<elomatreb>
I.e. you can put any Ruby expression in there and it will insert the .to_s of that value into the String
vincent_ has quit [Remote host closed the connection]
vincent_ has joined #ruby
<KrzaQ>
okay, so it basically puts eval(code).to_s in place of #{code}?
<KrzaQ>
^ might be pseudocode
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
<elomatreb>
In effect, yeah. It doesn't do a detour with eval but it works like that
<baweaver>
eval isn't used there
<baweaver>
it just calls to_s on it
<baweaver>
Hunter1: where's hunter2?
<elomatreb>
Forgot their password
<KrzaQ>
I meant it conceptually
vincent_ has quit [Remote host closed the connection]
maxexcloo1234 has joined #ruby
vincent_ has joined #ruby
<Hunter1>
He's been deprecated
<KrzaQ>
It does execute the code, at least for me
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
<elomatreb>
Try `"this is a String with interpolation: #{puts 'I was executed!'}"`
<elomatreb>
(I'd present a demo but eval.in is broken again)
<maxexcloo1234>
Hi, I'm having some trouble with mapping arrays, it's probably a very quick fix, if anyone could have a look at https://pastebin.com/jfunYp8n it would be greatly appreciated. Basically, I'm trying to map a nested array and it's not working properly, happy to explain in more detail if anyone can help
<elomatreb>
Damn, I thought I could earn money with this
<bithon>
elomatreb: "Internal Server Error" seems like it's a meme, pretty evident to me.
agent_white has quit [Quit: bai]
<havenwood>
bithon: 500
ascarter has quit [Client Quit]
ddffg has joined #ruby
spectrum has joined #ruby
dreamthese has quit [Quit: WeeChat 1.4]
<BloodSkin>
what are some reasons i should learn ruby
<bithon>
It's a meme language. That should be a reason enough for you BloodSkin
<BloodSkin>
what does that even mean
<bithon>
nvm
AlexRussia has joined #ruby
TomyWork has joined #ruby
<BloodSkin>
anyone who doesnt have their head up their ass got an answer?
<bithon>
If I was an OP I'd ban you this instant, you worm
<elomatreb>
havenwood: I'm detecting some trolling here
<havenwood>
BloodSkin: Please don't be rude.
<elomatreb>
BloodSkin: Fun scripting language with a very usable standard library
nicesignal has joined #ruby
<elomatreb>
havenwood: I was talking more about bithon
<havenwood>
bithon: Please don't be rude.
<bithon>
I was merely making I joke elomatreb.
ascarter has joined #ruby
<BloodSkin>
is there anything that sets it apart from other languages?
<bithon>
I wasn't being rude havenwood. The gent here was being condiscending
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BloodSkin>
or that makes it easier to achieve a certain goal
<BloodSkin>
or something it excels at
<BloodSkin>
idk how to ask what im thinking
uZiel has quit [Remote host closed the connection]
<dminuoso>
BloodSkin: It excels at giving you the tools to be stupid and lazy.
<dminuoso>
It also has a pretty awesome logo.
<havenwood>
BloodSkin: Ruby is designed to make programmers happy.
<dminuoso>
havenwood: So is porn.
<elomatreb>
Ruby's syntax is fairly unique, and the standard library is probably one of the best I've worked with
<BloodSkin>
ok so its for advanced programmers to just have fun with?
<dminuoso>
No.
<dminuoso>
Though I wish it was.
Silthias1 has joined #ruby
<dminuoso>
The best thing about Ruby is that you have ObjectSpace, send, Fiddle and Module#prepend.
Silthias has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
<BloodSkin>
ok i am someone who has a tiny bit of scripting experience
<BloodSkin>
i dont know any language inside and out
<BloodSkin>
i guess what im asking is what would be a reason to make ruby the first lang i really dive into
xall has joined #ruby
<havenwood>
BloodSkin: It's a general purpose programming language that's used for all sorts of things. Beyond web it's often used for text processing and system administration. Though it's also used for all sorts of stuff from modeling fighter jet hardware and software to supercomputers (which surprised even Matz) or telephony like Adhearsion, etc.
<havenwood>
BloodSkin: It's a multi-paradigm language that will give you plenty of room to dive in deeply.
<BloodSkin>
hmm
<BloodSkin>
thanks for the info
aupadhye has joined #ruby
<havenwood>
BloodSkin: If you want something simpler with a single paradigm consider a functional language like Elixir or Clojure.
<dminuoso>
Never not clojure.
<dminuoso>
It's still downright amazing that LISP is so vibrant and alive.
<BloodSkin>
ultimately i am looking for somthing diverse
<BloodSkin>
i dont have any specific goal
<havenwood>
BloodSkin: Then Ruby is a great option.
<BloodSkin>
i see a lot of peopl really praise it
<BloodSkin>
so thats why i figured id come ask
<dminuoso>
I dont.
<BloodSkin>
people*
<dminuoso>
I am great people.
<BloodSkin>
my E key is on its way out the door
<herwin>
your ky?
<BloodSkin>
i dont think ive ever actually bought a keyboard to be honest
<BloodSkin>
they just show up
<dminuoso>
I think the legal term is "theft"
<BloodSkin>
people used to give me their old computers
<BloodSkin>
they seem to think that just because i can google something im a computer genius
bithon has quit [Quit: Page closed]
<BloodSkin>
which im sure everyone in this channel has experienced
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
johnmccabe has joined #ruby
ascarter has quit [Ping timeout: 246 seconds]
andikr has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
hlmjr has joined #ruby
Kug3lis has joined #ruby
Kug3lis has quit [Client Quit]
psychicist__ has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
andikr has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
stamina has joined #ruby
rohitpaulk has joined #ruby
astrobunny has quit [Ping timeout: 255 seconds]
ltem has joined #ruby
ur5us has joined #ruby
HoierM has joined #ruby
Rodya_ has joined #ruby
ayonkhan has joined #ruby
AlexRussia has joined #ruby
nadir has joined #ruby
cschneid_ has joined #ruby
ldnunes has joined #ruby
ur5us has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 240 seconds]
xall has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
uZiel has quit [Remote host closed the connection]
sepp2k has joined #ruby
ldnunes has quit [Ping timeout: 260 seconds]
<dminuoso>
Do you folks ever do type checks?
<dminuoso>
Or .responds_to? checks?
<adam12>
respond_to is better than is_a, for sure.
<dminuoso>
adam12: Why?
<dminuoso>
I mean not everything is duck typy
<adam12>
dminuoso: duck typing.
hs366 has joined #ruby
<dminuoso>
adam12: That is just giving that recommendation a name, but not a reason why it's better.
<adam12>
dminuoso: I guess on your own code, it doesn't really matter, but for libraries, why should you dictate what is passed
<adam12>
as long as the contract for what is passed is satisfied.
hfp_work has quit [Ping timeout: 240 seconds]
<dminuoso>
adam12: Well let's think in terms of C++ inheritance. When I have a library package_delivery, and a class DeliveryTruck with a method "load", it stands to reason I have an abstract class Package that users can derive from and modify.
<dminuoso>
adam12: Just because a class has "size", it doesn't mean it will return what my DeliveryTruck expects.
<dminuoso>
adam12: If my DeliveryTruck does a package.size and expects an array of dimensions, then merely responding to is not enough, it wants to know whether the class follows an interface.
<dminuoso>
Whether invariants are held.
<dminuoso>
I mean technically deriving from Package does not make that guarantee either, but if a user intentionally overrides size to return back stuff that's just the dev shooting his own foot.
hfp_work has joined #ruby
<matthewd>
I do (often spelled as case/when), when there are multiple types the value could be, and I want to handle each of them
apparition has quit [Quit: Bye]
<matthewd>
I don't do it to attempt to implement strict typing though. If I don't have a specific need to distinguish which of several valid arguments you gave me, IMO ruby style is to just trust the caller, and leave you with whatever NoMethodError eventually arises otherwise
<dminuoso>
matthewd: Do you ever check against modules or base classes? Or do your checks imply that you expect those types directly?
<elomatreb>
That size example is a nasty one
ldnunes has joined #ruby
<dminuoso>
elomatreb: Granted, the proper method would in reality rather be named "dimensions".
gnufied has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
<matthewd>
There are, for example, places in Rails that'll handle an instance of any subclass of AR::Base one way, and other types another
<dminuoso>
matthewd: Could you name any such example from the top off your head?
<matthewd>
A simple abstract example is where we'd call .id on an AR record, and otherwise assume we have the "raw" string/integer/whatever directly
<matthewd>
A complex concrete example of type-distinguishing is in processing the RHS of where(foo: x)
<dminuoso>
matthewd: Oh yeah that last example makes immediate sense.
<dminuoso>
For the first, is that when you care about generic equality?
<matthewd>
No... two records with the same [class and] PK are equal, but they're not equal *to* their PK. I don't know that the first actually occurs anywhere specific in itself... it's more a simplification of what #where does.
synthroid has joined #ruby
<matthewd>
Looking at the 7 places in rails/rails we raise a TypeError: one is a re-raise, one is explicitly disallowing one type, and the others are all `case when A; ..; when B; ..; else raise TypeError; end`
Mortomes|Work has quit [Ping timeout: 260 seconds]
__Yiota has joined #ruby
<matthewd>
(just because that's easy to search for; clearly not exhaustive)
ineb has joined #ruby
<ineb>
hello, quick question: how to? system("echo", "foobar", ">>", "/tmp/test")
<ineb>
this approach does not work
mjuszczak has joined #ruby
__Yiota has quit [Client Quit]
mjuszczak has quit [Max SendQ exceeded]
<matthewd>
ineb: That doesn't work because the multiple-argument form bypasses the shell, and the shell is what does the >> redirect
<matthewd>
ineb: You can either run it through a shell, or read the output and add it to the file yourself
<ineb>
i see, makes sense
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ineb>
like system("sh -c 'echo foobar >> /tmp/test'"
<ineb>
system("sh -c 'echo foobar >> /tmp/test'")
konsolebox has quit [Max SendQ exceeded]
konsolebox has joined #ruby
<dminuoso>
matthewd: That's interesting. Ill take a look at those cases later.
<matthewd>
ineb: Well, system("sh", "-c", "echo foobar >> /tmp/test"), or you can just system("echo foobar >> /tmp/test")
ecuanaso has joined #ruby
johnmccabe_ has joined #ruby
<matthewd>
ineb: If you need to approximate the safety of separated parameters while building a string that a shell will parse, you may be interested in Shellwords from stdlib
mjuszczak has joined #ruby
johnmccabe has quit [Ping timeout: 240 seconds]
warrshrike has joined #ruby
<warrshrike>
hey
<warrshrike>
I have an error
andikr has quit [Remote host closed the connection]
<dminuoso>
Really
<warrshrike>
consider this: Base = '/state/partition1/APPSEC/APKMirror/' GL = "/state/partition1/home/17100148/paper93/artifact/binary"
<warrshrike>
and this if !(File.exist?("#{Base}#{appname}/#{appname}.yml")) puts "File doesnt exist!" File.open("#{Base}#{appname}/#{appname}.yml", "w") do |file| file.write(YAML::dump(cflArray(appname))) end end
<dminuoso>
warrshrike: ?gist
<dminuoso>
warrshrike: !gist
<dminuoso>
!gist warrshrike
<dminuoso>
?gist warrshrike
<ruby[bot]>
warrshrike: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<dminuoso>
There we go.
<warrshrike>
finally these errors /state/partition1/home/17100148/Malware/DroidInfer_Wrapper.rb:28:in `initialize': No such file or directory @ rb_sysopen - /state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ (Errno::ENOENT) /1Password_-_Password_Manager_6.5.BETA-9_ .yml
<dminuoso>
Yeah no.
<dminuoso>
Gist.
<warrshrike>
okay sorry brothers
<warrshrike>
i will remake a gist
<dminuoso>
warrshrike: please name your file with an .rb extension so it gets syntax highlighting
haylon has quit [Remote host closed the connection]
haylon has joined #ruby
joonty has joined #ruby
<cjohnson>
Using guard/guard-rspec, when I make a file change on the guest machine (vbox) guard inspects and tests, however when I make the change on my host via NFS share, it doens't pick it up
<cjohnson>
Does anybody know a straight forward way to get it to watch nfs? Do I have to use polling mode? And if so, how do I configure that?
jrafanie has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Burgestrand has joined #ruby
cbyrda has quit [Quit: leaving]
haylon has quit [Ping timeout: 246 seconds]
<cjohnson>
Nevermind found an article on exactly this issue
jrafanie_ has joined #ruby
<cjohnson>
-p passed to guard tells it to use polling mode
<pupsicle>
plujon: ActiveSupport also has a method called "constantize" if you happen to be depending on it.
cadillac_ has quit [Ping timeout: 260 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pupsicle>
It adds method to String object I should say.
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Remote host closed the connection]
<plujon>
Integer.name.constantize == Object.const_get(Integer.name) # good to know
username_ has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
bkxd_ has quit [Ping timeout: 255 seconds]
hobodave has joined #ruby
pazzaz has joined #ruby
__Yiota has joined #ruby
apollo274 has joined #ruby
firstdayonthejob has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
firstdayonthejob has quit [Client Quit]
patarr has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
synthroid has quit [Remote host closed the connection]
mim1k has joined #ruby
ecuanaso has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
ltem has joined #ruby
synthroid has joined #ruby
roshanavand has quit [Remote host closed the connection]
cdg_ has joined #ruby
cdg has quit [Read error: Connection reset by peer]
cdg has joined #ruby
__Yiota has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kies has quit [Ping timeout: 258 seconds]
cdg_ has quit [Ping timeout: 268 seconds]
lxsameer has quit [Quit: WeeChat 1.7]
amclain has joined #ruby
xzhao has quit [Remote host closed the connection]
xzhao has joined #ruby
nitric has joined #ruby
Kug3lis_ is now known as Kug3lis_off
joonty has quit [Quit: This computer has gone to sleep]
Kug3lis has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kobain has quit [Ping timeout: 255 seconds]
AlexRussia has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
dc4 has joined #ruby
apollo274 has quit [Ping timeout: 255 seconds]
gothicsouth has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
anisha__ has quit [Quit: This computer has gone to sleep]
nullset68 has joined #ruby
__Yiota has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Remote host closed the connection]
[Butch] has joined #ruby
AlexRussia has joined #ruby
dcluna has quit [Read error: No route to host]
catphish has quit [Quit: Leaving]
nullset68 has quit [Client Quit]
cadillac_ has joined #ruby
dcluna has joined #ruby
Kerea has joined #ruby
Rodya_ has joined #ruby
nesoi has joined #ruby
bvcosta has joined #ruby
<bvcosta>
hey
<bvcosta>
I'm using JRuby+Puma
<bvcosta>
+RabbitMQ
<bvcosta>
I'm starting a new connection on the startup of the application
<bvcosta>
and I need to close the connection on the shutdown
<bvcosta>
do you guys know any shutdown hook to use for this use case?
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
chouhoulis has quit [Remote host closed the connection]
ascarter has joined #ruby
chouhoulis has joined #ruby
ledestin has joined #ruby
<adam12>
bvcosta: can you use at_exit ?
<bvcosta>
where should I use it? I did try it, but I'm not sure if I'm using it at the right place
<adam12>
bvcosta: It should be effective in any file that's evaluated.
ledestin has quit [Ping timeout: 255 seconds]
nanoz has joined #ruby
nanoz has joined #ruby
nanoz has quit [Changing host]
dc4 has quit [Ping timeout: 240 seconds]
nesoi has quit [Quit: Leaving.]
aufi has quit [Quit: Leaving]
<bvcosta>
trying now on boot.rb
ldnunes has quit [Quit: Leaving]
<bvcosta>
yes, I think it will work
<bvcosta>
thanks
duderonomy has quit [Ping timeout: 246 seconds]
bruce_lee has quit [Read error: Connection reset by peer]
bvcosta has quit []
uZiel has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
gusrub has joined #ruby
psychicist__ has joined #ruby
renchan has quit [Quit: Leaving...]
nanoz has quit [Read error: Connection reset by peer]
kies has joined #ruby
shinnya has joined #ruby
tubuliferous has joined #ruby
GinoMan2440 has joined #ruby
GinoMan2440 has quit [Remote host closed the connection]
GinoMan2440 has joined #ruby
GinoMan has quit [Ping timeout: 260 seconds]
antgel has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
meshsmith has quit [Read error: Connection reset by peer]
railswebdev has joined #ruby
haylon has quit [Remote host closed the connection]
centrx has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 258 seconds]
uZiel has quit [Ping timeout: 248 seconds]
Guest69 has joined #ruby
mikecmpbll has joined #ruby
SeepingN has joined #ruby
marxarelli has joined #ruby
synthroi_ has joined #ruby
Kerea has quit [Ping timeout: 258 seconds]
meshsmith has joined #ruby
JoshS has quit [Quit: Leaving]
synthroid has quit [Ping timeout: 268 seconds]
aenialis has joined #ruby
rohitpaulk has joined #ruby
haylon has joined #ruby
uZiel has joined #ruby
__Yiota has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
mwlang has quit [Quit: mwlang]
__Yiota has quit [Ping timeout: 240 seconds]
jrafanie_ has joined #ruby
duderonomy has joined #ruby
mwlang has joined #ruby
jrafanie has quit [Ping timeout: 255 seconds]
Kerea has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
bkxd_ has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 255 seconds]
uZiel has quit [Ping timeout: 248 seconds]
aenialis has quit [Read error: Connection reset by peer]
dc4 has joined #ruby
ecuanaso has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
cadillac__ has joined #ruby
ldnunes has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
ma0 has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
thisguy123 has joined #ruby
cyphase has quit [Quit: cyphase.com]
Bock has quit [Read error: Connection reset by peer]
Dimik has joined #ruby
A124 has quit [Quit: '']
Silthias has joined #ruby
tubuliferous has quit [Ping timeout: 246 seconds]
Kug3lis has joined #ruby
gnufied has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
Silthias1 has joined #ruby
GinoMan2440 has quit [Remote host closed the connection]
ujjain has quit [Ping timeout: 255 seconds]
GinoMan2440 has joined #ruby
Silthias has quit [Ping timeout: 246 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andrzejk_ has joined #ruby
cyphase has joined #ruby
elifoster has joined #ruby
skweek has quit [Ping timeout: 255 seconds]
Silthias1 has quit [Ping timeout: 258 seconds]
eckhardt has joined #ruby
xall has joined #ruby
ascarter has joined #ruby
A124 has joined #ruby
johnny56_ has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
__Yiota has quit [Ping timeout: 240 seconds]
gusrub_ has joined #ruby
gusrub has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
cdg_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gusrub_ has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 255 seconds]
quobo has quit [Quit: Connection closed for inactivity]
xall has quit [Quit: xall]
nankyokusei has joined #ruby
saschavoid has joined #ruby
AndBobsYourUncle has joined #ruby
ecuanaso has joined #ruby
cdg has joined #ruby
nowhereman_ has quit [Quit: Konversation terminated!]
nowhereman_ has joined #ruby
weaksauce has joined #ruby
DoubleMalt has joined #ruby
kobain has joined #ruby
cdg_ has quit [Ping timeout: 246 seconds]
Kerea has quit [Ping timeout: 255 seconds]
nesoi has joined #ruby
Silthias has joined #ruby
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
mjuszczak has joined #ruby
gusrub has joined #ruby
postmodern has joined #ruby
DoubleMalt has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Joufflu has joined #ruby
cadillac__ has quit [Ping timeout: 268 seconds]
<Joufflu>
any ruby developers from Los Angeles
<Zarthus>
just ask your question
<Zarthus>
if you're recruiting, this is not the right channel to do it in
<Joufflu>
I'd like to know where other ruby developers meetup so I can code with them
<Joufflu>
I am a ruby developer not a recruiter
<Zarthus>
have you tried meetup.com
<Joufflu>
yeah
nankyokusei has quit [Remote host closed the connection]
pupsicle has quit [Quit: pupsicle]
<havenwood>
Joufflu: Join us at Ruby in Hollywood every Wednesday in Silver Lake.
<havenwood>
(Maybe we should change the name to Ruby in Silver Lake.)
nofxxxx has quit [Ping timeout: 255 seconds]
SeepingN has quit [Read error: Connection reset by peer]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Joufflu>
@havenwood, awesome ! is that the Lamill Coffee shop one?
SeepingN has joined #ruby
<havenwood>
Joufflu: Yup!
<Joufflu>
Sweet!
gusrub has quit [Remote host closed the connection]
pupsicle has joined #ruby
DoubleMalt has joined #ruby
<meshsmith>
is there a Ruby installer/compilier I can download or do I need to hunker down and learn to command line?
Kerea has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeepingN>
one cannot get far in Ruby land without using the command line
<havenwood>
meshsmith: What OS are you on?
<SeepingN>
unless you have others to do all the lifting for you and all you do is program
<SeepingN>
(don't say windows, don't say windows)
<meshsmith>
windows 7
<bougyman>
I dunno.
<SeepingN>
DOH!
<bougyman>
I know some rubymine people who have never seen the command line.
<SeepingN>
frightening
<havenwood>
meshsmith: If you ever upgrade to Windows 10 there's a very nice Windows Subsystem for Linux for developers that works great with Ruby.
<havenwood>
meshsmith: There's currently a WindowsInstaller and DevKit for windows but I believe it's shy on maintenance while RubyInstaller2 is being worked on.
<meshsmith>
Ill take that as a "get up off your ass and get gud"
<havenwood>
meshsmith: Or there's a Ruby package for Chocolatey if you want to use a command line package manager.
<meshsmith>
Fair. Its looks better coming from not-github to be honest. I will take a look and hopefully it works out. Thanks.
<havenwood>
meshsmith: If you want to try a Ruby version switcher to get at different Ruby VMs or versions on Windows there's uru: https://bitbucket.org/jonforums/uru
<havenwood>
meshsmith: If you're going to stay on Windows 7 instead of using some sort of Linux, via WSL or VM or whatev, consider using a package manager for Windows: https://chocolatey.org/
<havenwood>
meshsmith: If you run into install trouble we might be able to help. Happy coding!
<meshsmith>
Its my first time handling this sort of thing, I'd rahter know what to do about this before I start messing with a virtual machine.
<meshsmith>
I already see myself doing something similar with node.js, but you gotta start somewhere...
<havenwood>
meshsmith: I'd still suggest upgrading to Win 10 Creative Update so you can just start with bash.
<havenwood>
Bash on Windows.
<havenwood>
WSL.
<havenwood>
meshsmith: Unless you're already fluent in PowerShell, you'll probably have a better time on bash.
andrzejk_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<havenwood>
Then you can just follow tutorials and not worry about library compatibility or Windows quirks like no fork.
<meshsmith>
In neither actually, not to overwhelm myself and hope to get to a state everyone seems to prefer in a not-windows environment.
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
In bundler, is there a way to do pessimistic versioning for major.minor but say "include beta releases"? I currently have: gem "sexp_processor", "~> 4.10.0b1" but would rather specify "~> 4.10"
Rodya_ has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
reacquaint has joined #ruby
mtkd has quit [Ping timeout: 268 seconds]
gheegh has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.8]
<matthewd>
thatsnotjack: That's because 1.1.pre is < 1.1; 1.2.pre would match
mtkd has joined #ruby
<thatsnotjack>
Ah right, my mistake!
arup_r has joined #ruby
<matthewd>
zenspider: "~> 4.10.x" will do what you want, IIRC
reacquaint has quit []
reacquaint has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
ldnunes has quit [Quit: Leaving]
<Xyvir>
Not that anyone cares, I found the answer to my Dashing question I asked yesterday, there is a certain tag you have to add to the HTML file of the widget so that Batman won't strip out the HTML
dmtd has quit [Quit: Connection closed for inactivity]
<Xyvir>
By default Batman strips all HTML out of data it is binding to. If you want to get around this, simply pass in the raw filter.
<matthewd>
cjohnson: If you're going code-reading, it'll be worth knowing that it used to work differently: post(:create, params: x) might also invoke a method def post(foo, options) -- where options is a hash
<cjohnson>
ah yes yield
<matthewd>
i.e., it's "actually" post(:create, { params: x }), with the braces elided
<cjohnson>
is that magic specific to method calls?
<pupsicle>
it's not magic
<cjohnson>
or did foo: 'a' imply braces anywhere?
pupsicle has quit [Quit: Leaving]
<matthewd>
Mostly method calls. I know it's also true in an array literal... but you can't do `v = a: 1`, for example
<cjohnson>
got it
<cjohnson>
IMO that's absolutely magic then :P
<cjohnson>
if it knows it's in a method call and you can use special alternate syntax to get the same thing, that's magic
<cjohnson>
thanks for clarifying
<havenwood>
Now a days we have keyword args.
<havenwood>
Nowadays*
<matthewd>
havenwood: Yeah, we started there.. I was just filling in backstory because so much existing code still uses the old form
<SeepingN>
now (a daze)
<havenwood>
nowadæges
<havenwood>
matthewd: Aye, and the Hash form is still in wide use so you've got to know it.
<cjohnson>
matthewd: Ok so how about this:
<cjohnson>
post(:create, params: x, other: bar)
<cjohnson>
does that become one hash? or two hashes
<matthewd>
cjohnson: One
<cjohnson>
and then how do you know what it's going to become? You have to know which ruby version you are targeting?
<matthewd>
Anything that looks like hash key-value pairs, at the end of the method argument list, will always become a positional parameter, in that position, containing a hash
<cjohnson>
very strange
<matthewd>
It'll do whichever thing the called method's signature wants
<cjohnson>
got it ok that makes more sense then
<cjohnson>
so does it actually match the keywords against the signature to see if it's keyword form or hash form?
<cjohnson>
like if I had def foo(a, b: nil, c: nil) and called foo('a', b: 5, d: 5) it would turn that into a hash since there's no c?
dc4 has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
<matthewd>
No, that's an error
<matthewd>
(for a start, there'd be nowhere for the hash to go)
<cjohnson>
Oh true
<matthewd>
But even with foo(a, hash_maybe=nil, b: nil, c: nil), you'll get an error for foo('a', b: 5, d: 5)
<matthewd>
(I just checked -- I didn't know)
<cjohnson>
because it found b and then assumed it was keyword?
<cjohnson>
Or how does it know it's an error and shouldn't become a hash
<cjohnson>
foo('a', x: 5, y: 5) for example I'm guessing wouldn't error since there's no ambiguous possibly-keyword
<matthewd>
Nothing to do with the names: the called method has kwargs, so if the last parameter in the call is a hash, it'll get unpacked as kwargs
<matthewd>
So yes, that will still error
<zenspider>
cjohnson: don't guess. put it in a file and try it out
<zenspider>
this is all really cheap and easy to figure out
<cjohnson>
Well I wasn't sure if this required a specific version of ruby to observe
<cjohnson>
so testing locally with faulty assumptions would just confuse further
ltem has quit [Quit: Leaving]
<cjohnson>
and, we are already here talking after all, and irb won't explain the things matthewd just explained to me :)
<matthewd>
No, this is all true for any modern version (2.0 for kwargs, 2.1 for optional kwargs, I think?)
<cjohnson>
Yeah that sounds right
graft has joined #ruby
username_ has quit [Read error: Connection reset by peer]
<matthewd>
cjohnson: So the only way to do foo('a', x: 5, y: 5) would actually be foo('a', { x: 5, y: 5 }, {}), AFAICS
biberu has quit []
username_ has joined #ruby
dc4 has joined #ruby
<matthewd>
Which would make this a good point to emphasise that this is an edge case I've not yet encountered in practice :)
roshanavand has joined #ruby
<cjohnson>
got it. seems like you wouldn't ever want to intentionally do that
<cjohnson>
I was more just curious about when you might accidentally invoke hash instead of kwargs
<cjohnson>
thanks for clarifying
mjuszczak has quit []
graft has quit [Ping timeout: 246 seconds]
<matthewd>
No worries!
psychicist__ has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mjuszczak has joined #ruby
gheegh has quit [Ping timeout: 268 seconds]
graft has joined #ruby
sonOfRa has quit [Remote host closed the connection]
meshsmith has quit [Read error: Connection reset by peer]
AKPWD has quit [Read error: Connection reset by peer]
<baweaver>
matthewd: yeah, it's 2.1 for optionals
elifoster has quit [Ping timeout: 240 seconds]
jinie_ has joined #ruby
AKPWD has joined #ruby
AKPWD has quit [Read error: Connection reset by peer]
TomyLobo has quit [Ping timeout: 258 seconds]
AKPWD has joined #ruby
Fysicus has joined #ruby
FysiWRK has joined #ruby
Fysicus has quit [Client Quit]
FysiWRK has quit [Client Quit]
Fysicus has joined #ruby
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
creshiem has joined #ruby
Kerea has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Ping timeout: 268 seconds]
chouhoulis has quit [Ping timeout: 258 seconds]
saschavoid has quit [Quit: leaving]
creshiem has quit [Quit: WeeChat 1.8]
<zenspider>
matthewd: hrm... turns out that "~> 4.10including_betas" is considered "illformed"
haylon has quit []
centrx has quit []
dc4 has quit [Ping timeout: 240 seconds]
<zenspider>
ah. it's the underscore
<zenspider>
"~> 4.10including-betas0"
Qommand0r has quit [Quit: WeeChat 1.8]
KeyJoo has quit [Ping timeout: 260 seconds]
PresidentBiscuit has joined #ruby
marxarelli|afk is now known as marxarelli
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
gizmore|2 has quit [Ping timeout: 240 seconds]
bvcosta has joined #ruby
ddffg has quit [Ping timeout: 240 seconds]
polishdub has quit [Quit: Leaving]
mjuszczak has quit []
patarr has quit [Ping timeout: 240 seconds]
eightlimbed has joined #ruby
gusrub has quit [Remote host closed the connection]
<eightlimbed>
i'm trying to get a string "[5, 8, 11]" to an array, [5, 8, 11]. i used .scan(/\d/).map(&:to_i) and it returned [5, 8, 1, 1]. is there a simpler way?
<eightlimbed>
\d++ worked - nevermind - sorry, i'm new to regex
<apeiros>
depending on what it is, you might also want JSON/YAML
Antiarc has quit [Ping timeout: 246 seconds]
Antiarc has joined #ruby
<eightlimbed>
oh, cool. thanks apeiros!
<ule>
hey guys.. after passing {orderBy: '"company_id"', equalTo: 7} via parameter to my method, it's being converted to: {:orderBy=>"\"company_id\"", :equalTo=>7}
jjunior_ has quit [Quit: Connection closed for inactivity]
<SeepingN>
much happiness after discovering Sublime Text _UI_ themes
<ule>
how can I avoid this convertion?
<darix>
eightlimbed: keep using regexp. it is much easier to shoot yourself in the foot with them. ;)
<SeepingN>
lol
<SeepingN>
what conversion are you talking about. you wanted company_id with double quotes around it, so that's what you got
<SeepingN>
if you don't, then remove the single quotes around it all
<apeiros>
ule: '"' == "\""
<thatsnotjack>
ule: Those look like the same hash to me, with no conversion occuring. Those are just two different ways of representing it
<SeepingN>
^
<apeiros>
eightlimbed: also are you a spider or an octopus?
<thatsnotjack>
Or pregnant?
<ule>
apeiros: thatsnotjack
<ule>
thank you
<apeiros>
saywhat? :D
<eightlimbed>
i'm an ashtanga yogi :)
hobodave has quit [Ping timeout: 260 seconds]
dc4 has joined #ruby
SeepingN has quit [Ping timeout: 240 seconds]
muelleme has joined #ruby
ziyangtian has joined #ruby
ziyangtian has quit [Remote host closed the connection]
eightlimbed has quit [Ping timeout: 240 seconds]
muelleme has quit [Ping timeout: 255 seconds]
reacquaint has quit [Remote host closed the connection]
kgzm has joined #ruby
lel has quit [K-Lined]
cschneid_ has quit [Remote host closed the connection]
al2o3-cr has quit [Ping timeout: 240 seconds]
poloych has quit [Remote host closed the connection]
Kerea has joined #ruby
Rutix has quit [Ping timeout: 260 seconds]
Rutix has joined #ruby
Rutix has joined #ruby
Rutix has quit [Changing host]
quobo has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
nankyokusei has joined #ruby
gothicsouth has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
Joufflu has joined #ruby
t-recx has quit [Quit: t-recx]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
agent_white has joined #ruby
xenops has quit [Ping timeout: 240 seconds]
cdg_ has joined #ruby
<zenspider>
yay! I think it all works! boo! I think my contract with codeclimate might be over as a result.