atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BraddPitt>
is there a better way of checking? Like maybe intersection of arrays
<BraddPitt>
wait nvm
finisherr has quit [Quit: finisherr]
<shevy>
the only way of real testing is if you run via Benchmarks
freerobby has joined #ruby
frozen3 has joined #ruby
<BraddPitt>
right
cluelesscoder has joined #ruby
dorei has quit []
stevednd has joined #ruby
devdazed has joined #ruby
Rickmasta has quit [Ping timeout: 272 seconds]
freerobby has quit [Quit: Leaving.]
<cluelesscoder>
so I'm running into this certificate issue (described at http://stackoverflow.com/a/10430331) and one of the recommendations is to do `gem update --system` - but that gives me the same security issue!
<cluelesscoder>
how can I find the relevant Gemfile and change it from https to http?
<cluelesscoder>
I'm trying the find utility and coming up empty
jenrzzz has joined #ruby
Rickmasta has joined #ruby
freerobby has joined #ruby
houhoulis has joined #ruby
Feyn has quit [Quit: Leaving]
bmurt has quit []
yayfoxes has quit [Quit: WeeChat 1.1.1]
<cluelesscoder>
my understanding is that Gemfiles are typically at project roots, but is there a systemwide Gemfile?
sdwrage has joined #ruby
sdwrage has quit [Remote host closed the connection]
<Aeyrix>
what
<Aeyrix>
no
<Aeyrix>
what
rbowlby has quit [Remote host closed the connection]
rubie has quit [Remote host closed the connection]
gz_rain has joined #ruby
<BraddPitt>
Gemfiles are per-project/repo
<BraddPitt>
wherever you are running `bundle install` from, that is where your gemfile woudl be
<cluelesscoder>
ok
mistermocha has joined #ruby
<cluelesscoder>
I know hardly anything about ruby, but if I type gem list and I have a bunch of "local gems" - is there necessarily a Gemfile for these?
jhack has quit [Remote host closed the connection]
<Aeyrix>
I think you're misunderstanding what a Gemfile does.
frozen3 has quit [Remote host closed the connection]
<Aeyrix>
A Gemfile is, for lack of a better definition, a list of gems that the application (that you've written in Ruby) requires to run.
<shevy>
cluelesscoder usually a Gemfile came through bundler-based projects, the .gemspec file predated Gemfile files
iamninja has quit [Read error: Connection reset by peer]
<slani>
hello, is there any easy way to check if number 7 in all doc has value 0 , if true then remove 7 from all doc in docs http://paste.ubuntu.com/12122432/
casadei has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
<baweaver>
what have you tried?
crowell has quit [Remote host closed the connection]
crowell has joined #ruby
iloverubynoob has joined #ruby
<baweaver>
and I have a sneaking feeling you're doing something really off to get to this format of datastructure
<baweaver>
back up, what exactly are you trying to do?
Musashi007 has quit [Quit: Musashi007]
bronson has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<baweaver>
and better yet, what code is producing this and what is the input?
dopamean_ has quit [Ping timeout: 265 seconds]
tkuchiki has joined #ruby
<baweaver>
slani: ^^^
skydiver has quit [Quit: WeeChat 1.3]
Guest32 has joined #ruby
hotpancakes has quit [Ping timeout: 255 seconds]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<slani>
baweaver: I need to geat average for doc1, doc2, but if user has 0 vaule on all docs it should not be included in average for any doc
<baweaver>
you didn't see all of that
<baweaver>
What is an example input for your program, and what is the program that generates this datastructure you provided?
<slani>
this is reads from database
<slani>
doc1
<slani>
doc2
SolarSailor has joined #ruby
<slani>
and I put them into hash
wprice has quit [Quit: wprice]
<baweaver>
what code are you using to do this?
bronson has quit [Ping timeout: 244 seconds]
ta has joined #ruby
<slani>
baweaver: I didn't wrrite code for readint from database
User458764 has joined #ruby
<baweaver>
Do you have the code though?
kies has quit [Ping timeout: 252 seconds]
<baweaver>
you do realize how incredibly vague this all is
<slani>
baweaver: yes I know
<slani>
but I can't do any thing abouth this
<baweaver>
what have you tried so far.
<slani>
I just need average
Pupp3tm4st3r has quit [Remote host closed the connection]
<baweaver>
no
<baweaver>
what have you tried
lsmola has joined #ruby
charliesome has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
<slani>
I know how to slove this problem, but code will be very ugly.
renderful has joined #ruby
<baweaver>
then show me
jeadr has quit [Remote host closed the connection]
hs366 has joined #ruby
<baweaver>
ugly code can be improved upon
<baweaver>
no code does neither of us any good
ta has quit [Remote host closed the connection]
SolarSailor has quit [Quit: My Turing machine has gone to sleep. ZZZzzz…]
<slani>
baweaver: I didn't write it yet. but ugly approach is to iterate more times and save stuf in new hashs
<baweaver>
then do that, and show me
jeadr has joined #ruby
<slani>
baweaver: ok. it will take some time
cheniel has joined #ruby
cheniel has quit [Client Quit]
howdoi has joined #ruby
renderful has quit [Ping timeout: 246 seconds]
iloverubynoob has quit [Remote host closed the connection]
JoshGlzBrk has joined #ruby
rubie has joined #ruby
devoldmx has joined #ruby
kies has joined #ruby
duderonomy has quit []
<certainty>
moin guys
pawnbox has quit [Read error: Connection reset by peer]
pawnbox_ has joined #ruby
Pupp3tm4st3r has joined #ruby
AlexRussia_ has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
<Oka>
o/
devoldmx has quit [Ping timeout: 256 seconds]
_blizzy_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
arup_r has joined #ruby
wprice has joined #ruby
wprice has quit [Client Quit]
Musashi007 has joined #ruby
sheperson has quit [Quit: sheperson]
Macaveli has joined #ruby
oo_ has quit [Remote host closed the connection]
psy_ has joined #ruby
TomyLobo has quit [Ping timeout: 260 seconds]
_blizzy_ has quit [Read error: Connection reset by peer]
Pupp3tm4_ has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
kp666 has joined #ruby
oo_ has joined #ruby
_blizzy_ has joined #ruby
amclain has quit [Quit: Leaving]
Pupp3tm4st3r has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
havenwood has quit [Ping timeout: 260 seconds]
rehat has quit [Read error: Connection reset by peer]
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
mistermocha has joined #ruby
Synthbread has joined #ruby
ta has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
CloCkWeRX has joined #ruby
oo_ has quit [Remote host closed the connection]
iloverubynoob has joined #ruby
ta has quit [Ping timeout: 246 seconds]
grvgr has quit [Quit: grvgr]
mutuma has joined #ruby
Musashi007 has quit [Quit: Musashi007]
baweaver has quit [Remote host closed the connection]
oo_ has joined #ruby
mutuma is now known as Pathfinder
Pupp3tm4_ has quit [Remote host closed the connection]
klaas has quit [Remote host closed the connection]
<slani>
why I get error Array can't be coerced into Fixnum
blueOxigen has joined #ruby
eGGshke is now known as eGGsha
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sevenseacat>
slani: because date.values is an array
<sevenseacat>
and you're trying to add it to 0
<sevenseacat>
nuh-uh
<slani>
sevenseacat: if i puts date.values I get numbers 0.20652173913043478
<sevenseacat>
what does the "s" stand for in puts ?
<sevenseacat>
(hint: string)
<sevenseacat>
so it will convert your array into a string
<slani>
sevenseacat: thanks
<apeiros>
slani: puts is inadequate to inspect objects
zeroDivisible has quit [Ping timeout: 265 seconds]
<apeiros>
slani: either use `p obj` or `puts obj.inspect`
hotpancakes has quit [Ping timeout: 250 seconds]
<bnagy>
slani: doesn't matter if it's numbers or strings, that's irrelevant
<bnagy>
you can't add arrays of anything to a number
Musashi007 has quit [Quit: Musashi007]
<bnagy>
date.values is always going to be an array
<slani>
ok then I can do val[0] or how can I get number directly from date.values
bluOxigen has quit [Ping timeout: 265 seconds]
<bnagy>
about 20 ways, I guess
Violentr has joined #ruby
<Neon>
Please have a look at https://gist.github.com/Neosublimation/55c68ee7d62155a2f56d (15 lines), where I'm trying to describe what I want to do. Any ideas how I can achieve that? I've tried using IRB::Irb, but it always runs into code that is missing some methods.
<slani>
bnagy: the best way
<bnagy>
if you don't know how to do that you need to go back to basics
<shay->
hi, I want to listen on a unix domain socket. I can make it working using UNIXServer.open, but this creates a new socket file. How can I resue a already existing socket file?
oo_ has joined #ruby
<sevenseacat>
XF: so the first line of the error message references calling downcase on nil, on line 315 of lib/requests.rb
<sevenseacat>
XF: so why is something nil that you're calling downcase on?
<XF>
ok wait
<bnagy>
shay-: I don't think you can
skade has joined #ruby
<Ox0dea>
shay-: UNIXSocket.new, no?
[k- has joined #ruby
<bnagy>
at least not easily. Creating the sock is part of listening. You can _connect_ to an existing now
<bnagy>
*one
<XF>
sevenseacat the line on 315 is if a.downcase == ip.downcase
<bnagy>
maybe you can do fd tricks *shrug*
<sevenseacat>
XF: so either a or ip is nil
<bnagy>
but at the libc level sockfiles aren't supposed to exist when you bind, I think
_metamp has joined #ruby
terlar has joined #ruby
_metamp has quit [Client Quit]
Oka has quit [Read error: Connection reset by peer]
rubie has quit [Ping timeout: 265 seconds]
ruby-lang022 has joined #ruby
ishahnaz has joined #ruby
<ruby-lang022>
hi guys
Ilyes512 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
amystephen has joined #ruby
nux443 has joined #ruby
devbug has quit [Read error: Connection reset by peer]
<corpsicle>
im trying to execute a script like "scl enable ruby193 *absolute_path_to_script* *argument_to_script*" but i get "/etc/scl/prefixes/" added to the script path. what am i doing wrong?
tommek has left #ruby [#ruby]
c0m0 has joined #ruby
anisha has joined #ruby
<Ox0dea>
Using scl?
<corpsicle>
why is that bad?
<ruby-lang022>
I want to place my ruby vaiable @id in ftp.getbinaryfile. how can I place it in <% ftp.getbinaryfile("file."+"<%= @id %>"+".dynamicScanreport") %>
Pupp3tm4st3r has quit [Remote host closed the connection]
workmad3 has joined #ruby
thermatix has joined #ruby
Ilyes512 has joined #ruby
<[k->
you mean file.686445780?
<[k->
"file.#{@id}" would do the trick
<Ox0dea>
As would "file.#@id", but don't tell anybody.
<corpsicle>
so how do i force SCL to see my absolute path as absolute?
<Neon>
Oh so this is a Module to be included again. Why?
Iskarlar has joined #ruby
<ruby-lang022>
it is not working. Actually i am getting the file through ftp server. I am having files like file.1.dynamicscanreport, file.2.dynamicscanreport ... etc here 1,2,3, ... are ids. so i want to place dynamically with @id
<[k->
`forbiddebn access to file`
<[k->
corpsicle maybe try a leading slash?
BloodyHistory has joined #ruby
BloodyHi_ has joined #ruby
<[k->
ruby-lang022: that sounds like it's working?
r0x0rZ has joined #ruby
<Ox0dea>
Neon: The documentation does say that method should exist, but it doesn't.
<Ox0dea>
Why not
<Ox0dea>
just use IRB::Irb.new?
duncannz has joined #ruby
<[k->
Ox0dea have you tried it on your local irb?
<Ox0dea>
The most recent suggestion?
BloodyHistory has quit [Client Quit]
BloodyHi_ has quit [Client Quit]
<Neon>
Ox0dea, my problem is that I can't find the right way of using IRB::Irb. I'll upload the snippet I've come up with so far.
senayar has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
paradoja has joined #ruby
<[k->
yes, if your most recent suggestion is the one im thinking about
Pupp3tm4st3r has joined #ruby
<[k->
ruby-lang022: do you want to insert the id into the string or get it out of the filename
<[k->
what do you mean by place dynamically
DoubleMalt has joined #ruby
Salehi has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
<sevenseacat>
I see no problem of doing one level like that
<Ox0dea>
That ain't no nested hash.
fgo has quit [Ping timeout: 250 seconds]
timonv has quit [Read error: Connection reset by peer]
<sevenseacat>
what slani wants to do isn't a nested hash either
bumbar_ has joined #ruby
<sevenseacat>
wait, i fooked it up
<sevenseacat>
I blame 4pm
<slani>
If I understand it is better to avoid this
* sevenseacat
goes back into hole
<sevenseacat>
s/hole/punching Draper in the face/
<Ox0dea>
slani: It's fine if you know what you're doing, but that's almost tautological.
workmad3 has joined #ruby
<Ox0dea>
Generally, if your thing can be of arbitrary depth, something has already gone wrong.
<sevenseacat>
aye.
Macaveli has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby
Macaveli has joined #ruby
ferhaty has quit []
dopamean_ has joined #ruby
<Neon>
Tell this a file system developer.
oo_ has joined #ruby
sheldonh has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sheldonh>
on linux, when i set ENV["HOME"]="scrubbed", i still see the original value of HOME in /proc/PID/environ. does mutation of ENV affect the process's environment? is /proc/PID/environ just a copy of the env that was given to the exec syscall?
jeanlinux has quit [Remote host closed the connection]
<Ox0dea>
Where will you be when you will be where you will be when you will be where you will be when the recursion hits?
hotpancakes has quit [Ping timeout: 245 seconds]
jeanlinux has joined #ruby
ahmetkapikiran has joined #ruby
<c0m0>
sheldonh: because the environ file is populated when the process begin created
bronson has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
<sheldonh>
c0m0: okay cool. so /proc/PID/environ is not a view into the current environment; it's a copy of the env argument to the exec syscall. yes?
<Ox0dea>
I'm not sure that's right.
yardenbar has quit [Ping timeout: 240 seconds]
<sheldonh>
the proc(5) manpage is inconclusive
<Ox0dea>
At least, /proc/PID/cmdline is "dynamic".
<sheldonh>
Ox0dea: yes, that's what confused me
<c0m0>
environ isn't dinamic
AlxAltea has quit [Ping timeout: 252 seconds]
<sheldonh>
Ox0dea: fire up this process: ruby -e 'ENV["HOME"] = "scrubbed"; puts $$; sleep'
Salehi has quit [Remote host closed the connection]
<sheldonh>
Ox0dea: then take the pid printed and do: tr '\0' '\n' /proc/PID/environ | grep HOME
<XF>
sevenseacat there?
<sevenseacat>
yep
<Ox0dea>
sheldonh: Aye, it hasn't changed.
<XF>
sevenseacat if i give you my ssh details can you fix erros please?
<sevenseacat>
hell no.
<XF>
:/
Violentr has quit [Ping timeout: 246 seconds]
<XF>
im just getting one error
<adaedra>
XF: never give your ssh access to strangers,
<XF>
idk how to fix
<adaedra>
s/,/./
<sevenseacat>
right, and I've helped you determine exactly whats causing it
<sevenseacat>
now you need to fix it
<XF>
idk where the ip is missing
<sevenseacat>
neither do we, because you havent shown any code.
<sevenseacat>
we haven't even established if its the ip thats missing.
sdwrage has quit [Quit: This computer has gone to sleep]
<Ox0dea>
sheldonh: Mucking with **argv in C does change the value in /proc/PID/cmdline, but I can't test the same in Ruby.
tno has joined #ruby
<Ox0dea>
ARGV's elements are frozen strings and thawing them causes the interpreter to segfault.
<XF>
seven can i give the github source code of the scripts
bronson has quit [Ping timeout: 272 seconds]
<XF>
sevenseacat can i give the github source code of the scripts
kr3ssh has joined #ruby
<sevenseacat>
sure. if someone wants to trawl the whole project to fix your problem for you, is a whole different question though.
* wasamasa
just learned about syscall() in ruby
zeroDivisible has joined #ruby
<wasamasa>
is it possible to use the syscalls requiring pointers to structs as arguments though?
<sevenseacat>
XF: you're verging on the 'hire someone to fix my problem' solution
<ruby-lang022>
@<Ox0dea>, @<[k-> it is working fine with local textfile like test.1.txt but when i try to connect to ftp server to get file -- I'm getting error "invalid byte sequence in UTF-8"
<XF>
:/
Soda has joined #ruby
<XF>
i thought u are trusted
<wasamasa>
I've tried using gettimeofday with a variable containing an empty string and promptly got a segfault
<Ox0dea>
ruby-lang022: Thousands of people have had your problem.
<sevenseacat>
XF: you have not shown any kind of competency at fixing your own problem
<Ox0dea>
They have left a trail of knowledge in their wake.
TheHodge has joined #ruby
<sheldonh>
Ox0dea: yeah, i don't care about cmdline. i'm trying to protect some environment variables (used to configure a configuration service client) from accidental exposure in programs that dump ENV in their exception handlers. stupid, but common
<sevenseacat>
ergo we can determine you are not a programmer and should hire someone who is
<Ox0dea>
sheldonh: /proc/PID/environ is dynamic.
<Neon>
All people whose nicknames end with 'cat' are officially trusted.
<ruby-lang022>
and i was confused it is working fine when i directly given that filename
<Ox0dea>
Using the "third argument" (char **environ) to main(), I can modify its values.
<sheldonh>
Ox0dea: how have you tested that claim?
<Ox0dea>
sheldonh: See above.
<XF>
sevenseacat i got bot scripts from github idk how to use but tried and i am at end
<XF>
just 1 error to solve and whole done
<sevenseacat>
uh huh.
oo_ has quit [Remote host closed the connection]
<sheldonh>
Ox0dea: ah. so you're saying the kernel supports it, but ruby doesn't bother
<Ox0dea>
That does seem to be the case, yes.
<c0m0>
Ox0dea: but if you change a variable when your process is up && running, the change to env variable isn't show in environ file
<Neon>
wasamasa, don't you think you're doing it wrong? :S
<XF>
sevenseacat :/
<r0x0rZ>
hi i'm just starting out with Ruby. I was wondering how can I read documentation in terminal emulator? (something like pydoc in python)
<wasamasa>
Neon: oh, sure
<sevenseacat>
r0x0rZ: you probably want ri
<Ox0dea>
c0m0: Perhaps not from Ruby, but a very simple C program will demonstrate that it is indeed possible.
<wasamasa>
Neon: not like I'd get a segfault for no reason :v
<r0x0rZ>
sevenseacat: oh yeah that's it. thanks
oo_ has joined #ruby
<c0m0>
show me C code
<sevenseacat>
lol
Guest32 is now known as leverky
<sevenseacat>
show me teh codez
<rmrrn>
lol
<XF>
what should i do?
<sevenseacat>
XF: hire someone to fix your script.
devoldmx has joined #ruby
<XF>
sevenseacat where can i find?
<Neon>
wasamasa, I mean if you operate on that layer you shouldn't be using Ruby probably. Although I must say I'm curious about the pointer thing. :P
<wasamasa>
Neon: I'm currently preparing a talk for my operating systems class about syscalls and wanted to show something different from C for a change
yardenbar has joined #ruby
<Neon>
wasamasa, have you tried using malloc and getting the pointer value and passing that?
<XF>
sevenseacat where then?
sideshowcoder has joined #ruby
<sevenseacat>
XF: please stop pestering me, or I'll mute you.
conor_ has joined #ruby
<XF>
srry
riotjones has joined #ruby
<wasamasa>
Neon: I've heard a similiar argument against FFI, citing that most don't support structs or pointers to them, rendering a good amount of libraries useless
DoubleMalt has quit [Ping timeout: 264 seconds]
<wasamasa>
Neon: that person then argued for the module approach
AndroUser has joined #ruby
eGGsha is now known as eGGshke
DoubleMalt has joined #ruby
<sheldonh>
c0m0, Ox0dea thanks for helping me work through it
<Ox0dea>
Sure thing.
devoldmx has quit [Ping timeout: 256 seconds]
bright_day has joined #ruby
rdark has joined #ruby
banister has joined #ruby
<livcd>
in theory if i would be looking to reimplement an authentication system like Devise where should i start first ?
paradoja has quit [Ping timeout: 240 seconds]
<c0m0>
Maybe you can find the way to change the environ file, but I'm doing some test with a simple c program like this http://hastebin.com/gitefujune.tex
Pathfinder has quit [Ping timeout: 272 seconds]
<c0m0>
gcc -o sleep sleep.c -g
mutuma has joined #ruby
<c0m0>
and now, gdb -q ./sleep
<c0m0>
Reading symbols from /home/c0m0/programmin/C/sleep...(no debugging symbols found)...done
<Ox0dea>
Environment variable names cannot contain '=', so that little program should be sufficiently demonstrative.
<c0m0>
sorry that was the wrong output, Reading symbols from /home/c0m0/programmin/C/sleep...done.
<Neon>
wasamasa, oh I'm not against FFI in general. It just appeared to me as if you were to kind of reinventing the wheel with syscalls, but if you're doing it for a class it's probably pretty cool (although maybe, depending on the people you're teaching, it might more confuse them).
<wasamasa>
Neon: haha, no
<c0m0>
And i put a breakpoint in line 8
jgt1 has joined #ruby
<wasamasa>
Neon: this isn't for any serious programming, just to fill up 45 minutes of standing in front of my bored classmates
<Neon>
Do you know of a way to use eval with partial statements? Like eval 'a.each do |i|'; eval 'puts i'; eval 'end'; so the last one actually executes the code?
<Ox0dea>
Neon: Isn't that why you're using IRB?
<Neon>
Ox0dea, exactly.
roolo has quit [Ping timeout: 252 seconds]
jbw has joined #ruby
<Neon>
I've got to a point where it kind of works, but I'm not sure if it's stable. It's not documented well and IRB appears to be a singleton-like thing as relevant references are stored in the global IRB object.
sdwrage has quit [Quit: This computer has gone to sleep]
<corpsicle>
[k-: sorry for late answer, yea i have absolute path already, thats not helping. its wierd though, if i run from commandline it helps to put "" around the path. but when executing from pyton subprocess that doesnt seem to help
chipotle has quit [Read error: Connection reset by peer]
<Ox0dea>
Neon: Aye, I think banister would've made pry piggy-back on IRB if it were sensible to do so.
<Neon>
And now I'm looking for a cooler alternative, before I go the dirty path. I found out that eval accepts a Binding, which is kind of a context that can hold variables etc. so I can carry a state over from one eval to another, but my statements may not be complete at the time of evaluation.
<Ox0dea>
Neon: In that case, you might consider wrapping them in begin blocks and rescuing Exception until the code doesn't raise.
<Ox0dea>
That's a little crazy, though.
Karpah has joined #ruby
sameerynho has joined #ruby
[k- has quit [Ping timeout: 260 seconds]
<Neon>
Yeah, I thought of that as well, but that path is probably not much cleaner. Also if a part contains both a partial that ends the previous statement and starts a new one it will raise an Error as well, although the first statement is complete already.
DoubleMalt has quit [Ping timeout: 255 seconds]
davedev24 has quit [Remote host closed the connection]
dumdedum has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
<Ox0dea>
Well, how would IRB help with that?
sevenseacat has quit [Ping timeout: 245 seconds]
Pupp3tm4st3r has joined #ruby
axsuul has quit [Ping timeout: 256 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
If you complete a statement and begin a new one on the same line, the "completed" value gets discarded.
charliesome has joined #ruby
DoubleMalt has joined #ruby
<Neon>
Ox0dea, hm, right, it waits until the second one is complete as well before execution
<Ox0dea>
Neon: No, it'll execute the first, but the value won't be accessible.
chipotle has joined #ruby
DoubleMalt has quit [Max SendQ exceeded]
lxsameer_ has quit [Ping timeout: 244 seconds]
<Ox0dea>
Of course, any stateful effects will have been performed.
<Neon>
Ox0dea, I don't care about return values.
DoubleMalt has joined #ruby
<Neon>
So that's not an issue.
<Ox0dea>
Neon: I suppose now's as good a time as any to ask you what you're trying to do.
<Neon>
Maybe there's a sytax checker?
<Ox0dea>
There are several.
<Neon>
So I can make a string buffer and append my partial statements until the syntax checker says "Yup, here you go"
fgo has joined #ruby
<Ox0dea>
Neon: ruby has a -c flag for checking syntax.
marr has joined #ruby
<Neon>
Ox0dea, so that would mean I'd start a new ruby process for each check. :S
<Ox0dea>
I admit, it's not the best option.
jamesaxl|2 has quit [Remote host closed the connection]
<Ox0dea>
Neon: whitequark/parser or seattlerb/ruby_parser would obviate the need to shell out.
<Ox0dea>
Then again, SyntaxError can be rescued. :)
nux443 has quit [Ping timeout: 240 seconds]
chipotle has quit [Read error: Connection reset by peer]
Karpah is now known as sevenseacat
dumdedum has quit [Ping timeout: 265 seconds]
<Neon>
I just wonder why there's no easy access to the native syntax checker.
stan has joined #ruby
fgo has quit [Ping timeout: 264 seconds]
jeanlinux has quit [Remote host closed the connection]
ferhaty has joined #ruby
suchness has joined #ruby
jeanlinux has joined #ruby
<Ox0dea>
Neon: It essentially works by asking Bison whether anything went wrong.
<Neon>
Maybe I'll simply go for the SyntaxError-rescue-approach.
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
ljarvis: if you're not on the latest version, yes
<yorickpeterse>
but you can just `gem update --system` IIRC
<Neon>
My test is basically: bnd = TOPLEVEL_BINDING.clone; x = 5; eval 'puts x', bnd; and I want it to puts nil.
<Neon>
Ox0dea: and it puts 5.
<ljarvis>
yorickpeterse: if it requires SRV validation wouldn't it only affect if you were using an untrusted source? (or someone change rubygems.org SRV)
<Ox0dea>
Neon: I'm afraid I don't follow.
<yorickpeterse>
ljarvis: not sure
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Neon>
Ox0dea: Well, I'd expect x to not be defined in the context I pass to eval.
<Neon>
So puts nil was wrong, it should raise a not defined error.
<Ox0dea>
Oh, right. You're trying to be very tricksy.
<Neon>
Probably clone does only a flat clone and copies references.
<Neon>
I thought about making a subprocess and sending it to eternal sleep, then getting it's Binding somehow.
paradoja has quit [Remote host closed the connection]
<ljarvis>
yorickpeterse: yeah me either, vague post is vague
DEac- has quit [Ping timeout: 252 seconds]
<Ox0dea>
Neon: You could use a BEGIN block to grab as empty a Binding as is feasible?
<ljarvis>
looking at the commit tells me i'll be fine without upgrading unless i'm using a custom source
DEac- has joined #ruby
astrobun_ has quit [Remote host closed the connection]
codecop has joined #ruby
eminencehc has joined #ruby
codecop_ has joined #ruby
oo_ has quit [Remote host closed the connection]
<Neon>
Ox0dea: I don't know about BEGIN-blocks.
<adaedra>
Ox0dea: the doc plugin is open-source, yes
<Neon>
I just know =BEGIN and =END can be used to make ugly multi-line comments.
oo_ has joined #ruby
<Ox0dea>
Neon: BEGIN { foo } will execute before anything else, more or less.
jeadr has quit [Remote host closed the connection]
<r0x0rZ>
what could be a reason for not having syntax highlighting in Pry? I installed it via `gem install pry` and my user shell is ZSH with a theme (could that be aconflict?)
leverky has quit [Ping timeout: 265 seconds]
<Neon>
Ox0dea: Okay, but I don't think that'd solve the problem. binding.clone doesn't seem to make a proper clone but rather create a new set of the same reference as modifying it's origin will affect the clone as well.
<Neon>
references*
sgambino has joined #ruby
jeadr has joined #ruby
<Ox0dea>
Neon: Ah, yeah, I derped there.
<Neon>
Hm, i could try using a subprocess and IPC.
eminencehc has quit [Ping timeout: 245 seconds]
<Ox0dea>
I was going to suggest that you probably just want to drive an external process a while back.
ReK2 has joined #ruby
ReK2 has joined #ruby
<Ox0dea>
It seemed inappropriate given how close you seemed to have gotten with IRB.
rek2gnulinux has quit [Ping timeout: 244 seconds]
chipotle has quit [Ping timeout: 246 seconds]
<Neon>
Ox0dea: I don't like the IRB solution. It's not meant to be used like that (thus may hold some surprises) and it comes with the whole formatting and prompt overhead.
<Neon>
I'd use that if nothing else worked.
<Ox0dea>
Neon: And it remains the case that you're interested only in side effects?
DEac- has quit [Ping timeout: 265 seconds]
DEac- has joined #ruby
<Neon>
Ox0dea: Not completely, but if there are statements chained with semicolons I want to have only the last output and I think eval will give that to me.
Pupp3tm4st3r has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
Pupp3tm4_ has joined #ruby
<Ox0dea>
Neon: Open3 + irb is arguably the "right" way to do it, but shoveling into a buffer until it doesn't constitute a SyntaxError isn't as terrible as it might seem for such purposes.
eGGsha is now known as eGGshke
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
fgo has joined #ruby
tvw has quit []
<Neon>
Ox0dea: So you think I should rather run IRB in the subprocess?
Synthbread has quit [Quit: Leaving]
ascarter has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
<Ox0dea>
It's an option.
ferhaty has quit []
ascarter has joined #ruby
benlovell has quit [Ping timeout: 240 seconds]
Shidash has quit [Ping timeout: 246 seconds]
mistermocha has joined #ruby
wookiehangover has quit [Ping timeout: 246 seconds]
robbyoconnor has quit [Excess Flood]
Pupp3tm4_ has quit [Remote host closed the connection]
hahuang65 has quit [Read error: Connection reset by peer]
<maasha>
or rather, the chmod syntax is convoluted big time
<workmad3>
adaedra: :D
devoldmx has joined #ruby
<workmad3>
adaedra: you missed the other error too ;)
ferhaty has joined #ruby
<adaedra>
indeed
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<workmad3>
adaedra: still... it's pretty nice that you can actually specify bit-masks as bit-masks, rather than having to store them converted into some other representation
r0x0rZ has quit [Remote host closed the connection]
<adaedra>
indeed
<workmad3>
I'll need to remember that if I'm ever doing bit-masking again
fgo has joined #ruby
qiukun has joined #ruby
devoldmx has quit [Ping timeout: 244 seconds]
ahmetkapikiran has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
krisquigley has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roolo has joined #ruby
yfeldblum has joined #ruby
fgo_ has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
yfeldblu_ has joined #ruby
whiteline has joined #ruby
roolo has quit [Ping timeout: 256 seconds]
Iskarlar has joined #ruby
krz has quit [Quit: WeeChat 1.2]
<maasha>
anisha: hm, a file with -rw-r--r-- == 644 permissions and .mode & 0777 returns 420?
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sameerynho has quit [Ping timeout: 246 seconds]
eGGsha is now known as eGGshke
Pupp3tm4st3r has joined #ruby
tmtwd has quit [Ping timeout: 244 seconds]
renderful has quit [Ping timeout: 240 seconds]
conor_ has quit [Remote host closed the connection]
conor_ has joined #ruby
roolo has quit [Ping timeout: 240 seconds]
devoldmx has joined #ruby
pawnbox has quit [Remote host closed the connection]
Tempesta has joined #ruby
leafybasil has joined #ruby
conor_ has quit [Client Quit]
krisquigley has joined #ruby
dstarh has joined #ruby
<shevy>
yeah
Cust0sLim3n has joined #ruby
linuxboytoo has joined #ruby
devoldmx has quit [Ping timeout: 245 seconds]
R1ck has joined #ruby
lannonbr has joined #ruby
<R1ck>
hi. when running rake db:migratie, I get a lot of warnings like "rake.rb:24: warning: already initialized constant Rake::VERSION" and eventually "rake aborted! SystemStackError: stack level too deep" - whats the cause of this?
chinmay_dd has joined #ruby
eGGshke is now known as eGGsha
<apeiros>
R1ck: the two are unrelated. one means that you redefine a constant, the other that you do something recursively and have too many recursions.
<apeiros>
(though, of course, the recursion could include the code which redefines the constant - so they could be related in that way)
nuttermb has quit [Ping timeout: 244 seconds]
<R1ck>
well.. one thing at a time.. I have an app in the directory "app" - how can I test if this app runs at all?
atomical has joined #ruby
<apeiros>
well, rails channel is #rubyonrails
benlovell has quit [Ping timeout: 246 seconds]
<R1ck>
oh, thanks
CloCkWeRX has quit [Ping timeout: 256 seconds]
<R1ck>
it looks like there are two rake gems, one installed at /usr/local/lib/ruby/... and one in the application directory vendor/bundle
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
rubie has joined #ruby
thermatix has joined #ruby
banister has joined #ruby
jeremy04 has joined #ruby
tvw has quit []
sanguisdex has quit [Quit: Leaving.]
nuttermb has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
sdwrage has joined #ruby
rbennacer has joined #ruby
Pwnna has left #ruby ["Leaving"]
thermatix has quit [Ping timeout: 246 seconds]
sanguisdex has joined #ruby
pawnbox has joined #ruby
jeremy04 has quit [Ping timeout: 264 seconds]
CloCkWeRX has joined #ruby
havenwood has joined #ruby
terlar has joined #ruby
bmurt has joined #ruby
ItSANgo__ has quit [Quit: Leaving...]
rbennacer has quit [Remote host closed the connection]
rbennacer has joined #ruby
jtdoncas has joined #ruby
victortyau has joined #ruby
<shevy>
does a typical .json file have a trailing \n? I just generated a .json via ruby ...
<[k->
yes
<[k->
like all files
<Psi-Jack>
Not needed.
BLuEGoD has quit [Quit: oh cruel destiny]
Cust0sLim3n has quit [Ping timeout: 245 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
dgutierrez1287 has quit [Remote host closed the connection]
jtdoncas has quit [Ping timeout: 245 seconds]
sarkyniin has joined #ruby
Pupp3tm4st3r has joined #ruby
hotpancakes has joined #ruby
sdfgsdfg has quit [Remote host closed the connection]
krz has joined #ruby
jgt1 has joined #ruby
Torrieri has joined #ruby
Torrieri has joined #ruby
sepp2k has joined #ruby
unver has joined #ruby
chicken_wangs has left #ruby ["Leaving"]
northfurr has joined #ruby
joonty has joined #ruby
bnizzle has joined #ruby
gamename has quit [Remote host closed the connection]
hotpancakes has quit [Ping timeout: 244 seconds]
gamename has joined #ruby
ItSANgo has joined #ruby
mistermocha has joined #ruby
jgt1 has quit [Ping timeout: 256 seconds]
tonios57 has joined #ruby
dhjondoh has joined #ruby
Cust0sLim3n has joined #ruby
gamename has quit [Ping timeout: 252 seconds]
<ljarvis>
bleh, i need some kind of Hash#verified_merge
malconis has joined #ruby
dhjondoh has quit [Client Quit]
<[k->
verified_merge?
<ljarvis>
safe_merge might be a better name, although less obvious
Coldblackice has quit [Ping timeout: 264 seconds]
M-mistake has joined #ruby
M-prosodyContext has joined #ruby
<[k->
safe_merge?
<[k->
merge already provides ways to address conflicts?
dblessing has joined #ruby
stamina has quit [Ping timeout: 255 seconds]
<jhass>
neither seems obvious :P
mistermocha has quit [Ping timeout: 256 seconds]
<[k->
^
hinbody has joined #ruby
DroidBurgundy has joined #ruby
<ljarvis>
heh, having "verified" in the name means the keys are known/verified.. thus more obvious than "safe"
whippythellama has joined #ruby
kedare has joined #ruby
freerobby has joined #ruby
<ljarvis>
but yes it was just an example
<jhass>
I have no idea what a "verified key" would be
dhjondoh has joined #ruby
rbennacer has quit [Remote host closed the connection]
<[k->
has_only_these_keys
<ljarvis>
and key that is verified? seriously? :|
<ljarvis>
a*
<[k->
WHAT IS A KEY THAT IS VERIFIED GODDAMNIT
dhjondoh has quit [Client Quit]
dstarh has joined #ruby
<[k->
that seems like an awful move on my paet
<[k->
sorrry
dhjondoh has joined #ruby
* jhass
puts [k- in a pink room
<tobiasvl>
ljarvis: what functionality are you looking for?
<ljarvis>
tobiasvl: I spotted a bug where keys are not being overwritten, so for a.merge(b) i'd prefer to verify that keys in b exist in a (hence looking for a better method name)
<ljarvis>
(not replace)
<XF>
anyone here knows about znc?
<ljarvis>
?anyone XF
<ruboto>
XF, Just ask your question, if anyone has or can, they will respond.
<ljarvis>
XF: that's not Ruby related (if you're talking about the irc bouncer)
<ljarvis>
please take non Ruby discussion to #ruby-offtopic or look for the znc channel
knrz has joined #ruby
dhjondoh has quit [Client Quit]
<[k->
b.keys & a.keys == b.keys.size?
<ljarvis>
wat
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<[k->
your first description was completely off
<ljarvis>
I know how to write the code anyway, I was just making a comment
fgo_ has joined #ruby
eGGsha is now known as eGGshke
eGGshke is now known as eGGsha
<[k->
we dont need a verified_merge if merge does its job properly
<jhass>
mmh, if Hash#update weren't an alias already...
<ljarvis>
...
<ljarvis>
[k-: please stop
<ljarvis>
jhass: right
eGGsha is now known as eGGshke
jeremy04 has joined #ruby
juanpaucar has joined #ruby
Ropeney has joined #ruby
<ljarvis>
a.fetch(key) && b[key] = value is fair enough
lannonbr has quit [Ping timeout: 246 seconds]
<ljarvis>
er other way around
pawnbox has quit [Remote host closed the connection]
bronson has joined #ruby
<jhass>
a[key] = value if a.has_key? key ?
Ropeney has quit [Client Quit]
<ljarvis>
yeah works well enough
jerius has joined #ruby
kitfox has joined #ruby
<[k->
so, you want to merge keys that are only present in the original hash
<[k->
people in production ;-; i dont get you
Salehi has quit [Quit: Leaving]
* ljarvis
redefines Hash#update and waits to get fired
socialjackie has joined #ruby
CloCkWeRX has quit [Ping timeout: 265 seconds]
<jhass>
in rails: a.merge(b.slice(*a.keys))
eGGshke is now known as eGGsha
bronson has quit [Ping timeout: 246 seconds]
<ljarvis>
yep
Lucky__ has quit [Ping timeout: 272 seconds]
<ljarvis>
to be honest, i just added a spec and forgot about it, but it's worth considering where else it might have caught me
Torrieri has quit [Quit: Be back later ...]
timonv has joined #ruby
<[k->
a.keys.zip(b.values_at(*a.keys)) maybe?
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<[k->
oh god im horrible
banister has quit [Ping timeout: 246 seconds]
nettoweb has joined #ruby
kies has quit [Ping timeout: 246 seconds]
amystephen has joined #ruby
<[k->
might as well use select, which is more expressive, but its O(n)
<dman777_alter>
is there a way to detect between json object and json string?
<EllisTAA>
what’s the name of the off topic ruby channel?
<shevy>
#python
xhosae has quit [Remote host closed the connection]
rbennacer has quit [Remote host closed the connection]
<adaedra>
?ot EllisTAA
<ruboto>
EllisTAA, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
towski_ has joined #ruby
<shevy>
dman777_alter isn't a json string just a '' string in ruby?
Torrieri has joined #ruby
amclain has joined #ruby
centrx has joined #ruby
<[k->
if JSON.parse gives you some sort of reasonable looking thing, it is a JSON String
<adaedra>
dman777_alter: a JSON string is a string, of class String. Decoded, it can be anything.
roolo has joined #ruby
<[k->
huehuehue
<dman777_alter>
ya
<dman777_alter>
thanks
fedexo has quit [Ping timeout: 244 seconds]
r0x0rZ has joined #ruby
Soda has quit [Remote host closed the connection]
dimasg has quit [Ping timeout: 265 seconds]
djhal3 has joined #ruby
sdothum has joined #ruby
fibbel has joined #ruby
ruby-lang373 has joined #ruby
chinmay_dd has joined #ruby
flegercovateam has left #ruby [#ruby]
roolo has quit [Ping timeout: 245 seconds]
hoov has quit [Quit: Leaving]
malconis has quit [Ping timeout: 260 seconds]
chinmay_dd has quit [Read error: Connection reset by peer]
joonty has quit [Quit: joonty]
hanmac has quit [Ping timeout: 244 seconds]
Iskarlar has quit [Ping timeout: 256 seconds]
juanpaucar has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
momomomomo has quit [Ping timeout: 244 seconds]
saddad has joined #ruby
RobertBirnie has joined #ruby
northfurr has quit [Quit: northfurr]
araujo has quit [Quit: Leaving]
timonv has quit [Ping timeout: 250 seconds]
krisquigley has quit [Remote host closed the connection]
nux443 has joined #ruby
chinmay_dd has joined #ruby
momomomomo has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
ruby-lang373 has quit [Ping timeout: 246 seconds]
jpfuentes2 has joined #ruby
<dman777_alter>
man... I have body = { 'template' => attributes }.to_json but when I puts body it's a string {"template":"{\"content\": \"aaa\", \"type\": \"adx_running\", \"name\": \"n2\", \"user\": \"Admin Test\"}"}
jeadr has quit [Remote host closed the connection]
malconis has quit [Remote host closed the connection]
<shevy>
dman777_alter you can use JSON# related activities such as JSON.parse() ruby-doc.org/stdlib-2.0.0/libdoc/json/rdoc/JSON.html
malconis has joined #ruby
<shevy>
btw why did they not use yaml?
<dman777_alter>
the recieving server of the json is complaining (undefined method `each_pair' for #<String:0x007f54d246cb10>) so I'm not sure why it's not converting it to a ruby hash
<[k->
you dont transmit yml over the internets
<[k->
Hash#to_json -> String
<[k->
JSON.parse -> Hash
<[k->
this is how it works
skade has joined #ruby
<shevy>
we even transmit xml over the internets! and cats
<[k->
JSON is natively represented as a Hash in Ruby
<dman777_alter>
it will convert {"template":{"name":"foo,"content":"apple","user":"Admin Test"}} to a hash with no issues. but not {"template":"{\"content\": \"aaa\".....
<[k->
you have to unescape the string first
zekriad has joined #ruby
<dman777_alter>
ah...ok.
<dman777_alter>
both were using body = { 'template' => attributes }.to_json
bricker has joined #ruby
Oka has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<[k->
note: "{\"content is a string, not a hash
sinkensabe has joined #ruby
<shevy>
:)
lannonbr has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<dman777_alter>
but {"template":{"name":"foo,"content":"apple","user":"Admin Test"}} is a string also, correct? since it also came from body = { 'template' => attributes }.to_json
<ivanskie>
interesting, now some of the cells are nil, i tried doing the Time.strp.... || " ".. but realized that wont negate the fact that Time still tries to parse a nil column..
techsethi has quit [Client Quit]
c0m0 has quit [Ping timeout: 246 seconds]
<ivanskie>
i'm trying to parse a csv file full of cdr, call detail record..
<ivanskie>
i can't really pass an empty string to Time either can I/
mary5030 has quit [Remote host closed the connection]
<ivanskie>
documentation where are thou
<[k->
false && (not parsed); false || (parsed)
riotjones has joined #ruby
<jhass>
meh
fgo has joined #ruby
mary5030 has joined #ruby
<jhass>
time = Time.strptime(...) unless time.empty?
ledestin has joined #ruby
Timba-as has quit [Quit: Be back later ...]
<ivanskie>
oh
axsuul has joined #ruby
<ivanskie>
nein
eminencehc has quit [Remote host closed the connection]
<ivanskie>
oh wait
<ivanskie>
i see what u
hs366 has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 255 seconds]
pietr0 has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
terlar has quit [Ping timeout: 260 seconds]
<ivanskie>
still nein
<shevy>
hehe
<ivanskie>
wait
eminencehc has joined #ruby
<shevy>
why do you mix english and german
<[k->
true && (parsed); true || (not parsed)
<shevy>
this will totally verwirren jhass
<ivanskie>
bah
<jhass>
meh
<ivanskie>
i don't actually speak german lol
<jhass>
don't && / || for control flow
<ivanskie>
just like to say nein sometimes
<adaedra>
nein, nein, nein, nein, NEIN!
Violentr has quit [Ping timeout: 246 seconds]
<[k->
if unless else and or
rbennacer has joined #ruby
<jhass>
and don't and/or at all :P
<[k->
adaedra is Hitlerv2
riotjones has quit [Ping timeout: 252 seconds]
<adaedra>
not funny
hotpancakes has quit [Remote host closed the connection]
<jhass>
yeah, crossed the line there
<[k->
sorry
<shevy>
can we kick him!
<jhass>
no you can't
XF has quit [Ping timeout: 244 seconds]
skade has quit [Read error: No route to host]
bootstrappm has joined #ruby
<bootstrappm>
morning
foureight84_____ has quit [Ping timeout: 245 seconds]
<shevy>
hi bootstrapper
Guest50 has joined #ruby
sdwrage has joined #ruby
Guest50 is now known as dmitch
tkuchiki has quit [Remote host closed the connection]
devdazed has quit [Quit: Computer has gone to sleep.]
<dorei>
#b ?
<jhass>
shortcut for .force_encoding('ASCII-8bit') basically
user1138_ has quit [Ping timeout: 255 seconds]
dopie has quit [Quit: This computer has gone to sleep]
<dorei>
thanx :)
chinmay_dd_ has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
ndrei has quit [Ping timeout: 250 seconds]
chinmay_dd_ is now known as chinmay_dd
sdwrage has joined #ruby
unver has joined #ruby
stan has quit [Ping timeout: 244 seconds]
_djbkd has joined #ruby
hotpancakes has joined #ruby
hinbody has quit [Read error: Connection reset by peer]
eminencehc has quit [Remote host closed the connection]
rideh has joined #ruby
ips|malc has joined #ruby
radgeRayden_ has joined #ruby
millerti has joined #ruby
jhack has joined #ruby
hinbody has joined #ruby
Cust0sLim3n has quit [Ping timeout: 250 seconds]
codecop has joined #ruby
radgeRayden has quit [Ping timeout: 255 seconds]
eminencehc has joined #ruby
ht__ has joined #ruby
lodgenbd has joined #ruby
bricker has quit [Ping timeout: 245 seconds]
Cust0sLim3n has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
northfurr has joined #ruby
krisquigley has joined #ruby
<Norrin>
When people say that ruby is dynamically typed.... they just mean that there's no type safety until runtime right?
<Norrin>
but a scripting language only ever checks anything at runtime.... so how can ruby ever be statically typed?
<Norrin>
or any scripting language for that matter
<shevy>
cool
<shevy>
didn't know about .b()
arup_r has joined #ruby
jonee has joined #ruby
<shevy>
Norrin don't think that the term types is a good one. what exactly is a "type" in ruby?
jgt1 has quit [Ping timeout: 244 seconds]
bricker has joined #ruby
zeroDivisible has quit [Ping timeout: 250 seconds]
<Norrin>
in ruby, pretty synonomous with 'Class'
jhack has quit [Remote host closed the connection]
<Norrin>
i don't wan to be pedantic though. a type in a fully OO language is a collection of methods and properties
<Norrin>
want*
jackjackdripper has joined #ruby
<Norrin>
so without being pedantic, how can any scripting language be considered anything other than dynamically typed?
northfurr has quit [Client Quit]
puppeh_ has joined #ruby
jeanlinu_ has quit [Remote host closed the connection]
<Norrin>
meh never mind. i'm thinking of dynamic linking
krisquigley has quit [Ping timeout: 265 seconds]
juanpaucar has quit [Remote host closed the connection]
<puppeh_>
`URI('file:///foo/bar').to_s # => "file:/foo/bar"` <-- isn't this wrong? shouldn't it print "file:///foo/bar"?
gamename has joined #ruby
yfeldblum has joined #ruby
jeanlinux has joined #ruby
nuttermb has quit [Ping timeout: 246 seconds]
gamename has quit [Remote host closed the connection]
<Norrin>
wow roubyconf is cheap
<Norrin>
rubyconf*
axsuul has quit [Ping timeout: 246 seconds]
<shevy>
well the compiled languages require the extra information
skade has joined #ruby
<shevy>
like how much to allocate
radgeRayden_ has quit [Ping timeout: 265 seconds]
gamename has joined #ruby
gamename has quit [Remote host closed the connection]
blueOxigen has joined #ruby
jackjackdripper has quit [Client Quit]
gamename has joined #ruby
cornerma1 has joined #ruby
radgeRayden has joined #ruby
benlieb has quit [Quit: benlieb]
jackjackdripper has joined #ruby
Pupp3tm4st3r has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
krisquigley has joined #ruby
<tubbo>
Norrin: it's all about syntax
DoubleMalt has quit [Remote host closed the connection]
<tubbo>
nothing much to do with how it's actually implemented
<Norrin>
i see
<tubbo>
strongly-typed languages aren't faster because the compiler/interpreter/et. al. "knows" what type it is beforehand and can allocate enough RAM for that
mistermocha has joined #ruby
<tubbo>
the way code is parsed, the compiler would already know that information by inferring it through how the var is used throughout the codebase
<Norrin>
funny to me, one article seemed to think ruby becoming more statically typed would improve code reuseability
The_Phoenix has quit [Read error: Connection reset by peer]
<tubbo>
the argument for strong typing is readability and compile-time error catching
freerobby has joined #ruby
<tubbo>
you tried to pass nil into a String attribute? error.
<tubbo>
you tried to pass a String into an Integer attr? error.
<tubbo>
this, for better or worse, does not happen with RUby
<tubbo>
Ruby*
cornerman has quit [Ping timeout: 256 seconds]
jimms has quit [Remote host closed the connection]
cornerma1 is now known as cornerman
banister has joined #ruby
nscheurich has joined #ruby
<nscheurich>
exit
nscheurich has quit [Client Quit]
djhal3 has quit []
<Norrin>
actually i guess it could. you can require types on parameters and ensure more safety, causing errors that would be caught earlier on in development
<Norrin>
i've always found ruby very hard to read. not sure its due to types though
<atmosx>
hm, come to think of it, better save the output to a file.
techsethi has quit [Quit: techsethi]
shadoi has quit [Quit: Leaving.]
dopie has joined #ruby
skade has joined #ruby
casadei has joined #ruby
hotpancakes has quit [Remote host closed the connection]
chohe has joined #ruby
Novice201y has joined #ruby
<chohe>
in general are there any major differences between different -p's i.e p647 or are you generally safe to upgrade to the latest patch level?
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roolo has joined #ruby
Soda has joined #ruby
<Novice201y>
Hello. I did "rbenv install 2.2.2" (from https://gorails.com/setup/ubuntu/15.04 ), but it just printed "Installing ruby-2.2.2" and for few minutes nothing more. How to solve this?
__enrique has joined #ruby
erts has quit [Quit: erts]
hinbody_ has joined #ruby
ishahnaz has quit []
<atmosx>
Novice201y: you buy a new computer? :-P it's probably compiling
<atmosx>
please check the processes running on your system (e.g. ps auwx)
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SenpaiSilver has quit [Read error: Connection reset by peer]
valeri_ufo has quit [Read error: Connection reset by peer]
Tempesta has quit [Read error: Connection reset by peer]
nickjj has quit [Read error: Connection reset by peer]
ChoiKyuSang is now known as Tempesta
nickjj_ has joined #ruby
valeri_ufo has joined #ruby
baweaver has joined #ruby
modern has quit [Ping timeout: 246 seconds]
<Novice201y>
atmosx: top says that make takes about 0,3 of CPU
<shevy>
ivanskie this runs .to_hash
<shevy>
ivanskie so it depends on whether the elements in your collection do respond to .to_hash
modern has joined #ruby
linduxed has quit [Ping timeout: 246 seconds]
<ivanskie>
k gonna try something different.. I don't have headers in my csv.. so that code won't work, since nothing to hash
<Norrin>
shevy, that doesn't change what others do
<Norrin>
that's why what the lang allows is so critical
sarkyniin has quit [Remote host closed the connection]
dstarh has quit [Ping timeout: 246 seconds]
tonios57 has quit [Ping timeout: 246 seconds]
armyriad has quit [Ping timeout: 246 seconds]
Guest42660 has quit [Ping timeout: 246 seconds]
sarkyniin has joined #ruby
<shevy>
Norrin in other languages people write code that is hard to read too
sarkyniin has quit [Remote host closed the connection]
<Norrin>
same thing with the auto agruments like $0 and etc. $_ and stuff. there's more isoteric ones... i actually know what those two mean. but perl and ruby have gone that route to dislike of many
<chohe>
havenwood: that is much appreciated but doesn't really answer my question of whether or not I should be concerned when upgrading between patch versions :)
<shevy>
and when you restrict freedom, you also enforce the restriction onto other people
<Norrin>
even swift has some stuff like that though
armyriad has joined #ruby
<Norrin>
auto agruments that give no hint as to what they mean
<alankis>
Hello everyone
<shevy>
the $ variables were a lot inherited from perl
sarkyniin has joined #ruby
<shevy>
matz said that he didn't overly like them
<Norrin>
shevy, the rules of a language can greatly enhance readability
<havenwood>
chohe: For Ruby 2.0?
kirun has joined #ruby
<chohe>
yup we were using RVM which was installing 643 i believe
<Norrin>
convention plays a major part also
<shevy>
Norrin you still find lots of alternatives in python too
<chohe>
and i just upgraded to 647 because of an ASCII error issue when using grunt
<havenwood>
chohe: Yeah, all the 2.0s are compatible.
<havenwood>
chohe: Then semantic versioning after that.
<Norrin>
but anyway, yes you can write crap code in any language. but lang syntax and convention play a huge part in how easy it is to read the language on average
fullofcaffeine has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
<havenwood>
shevy: I'm just slowly trying to get you accustomed to ruby-install until you accidentally use it without realizing.
rubie has joined #ruby
<shevy>
but I don't need it
<havenwood>
shevy: You'd just add the -j8 to your make step. :P
<shevy>
I can have versioned appdirs for all programs thanks to gobolinux
<anon_>
whats the difference between running a ruby script like this: "bundle exec ruby myRubyScript.rb" and "ruby myRubyScript.rb" ?
youch has quit [Ping timeout: 255 seconds]
<shevy>
what is the -j8, is that a multiprocessor thingy?
<Norrin>
my parens statement wasnt about possibilities. simply put, the parens are easy to run. its got nothing to do with whether there's a choice or not
<Norrin>
easy to read*
<havenwood>
anon_: Bundler is a gem that lets you run your_ruby_script.rb in the "context of your Bundle."
<shevy>
easy to run :)
wprice has joined #ruby
malconis has quit [Ping timeout: 265 seconds]
platzhirsch has quit [Ping timeout: 246 seconds]
<shevy>
Norrin I for instance use parens in def: statements, but I don't want them to be mandatory all the time for non-def statements
<havenwood>
anon_: If resolves dependencies for gems listed in your Gemfile file and creates a Gemfile.lock file with resolved versions locked in.
<shevy>
cat.jump_to :tree
<shevy>
cat.jump_to(:tree)
<shevy>
thanks I prefer the non-paren variant there
<havenwood>
anon_: By default it will install gems to your $GEM_HOME but you can set a path that it remembers to "vendor" your gems separately than your regular gems.
<anon_>
havenwood, so if i have requireers in my file it will gem install them
<havenwood>
anon_: When you prefix `bundle exec` you're using the gem versions from the Bundle .
<havenwood>
(Gemfile.lock)
<Norrin>
i really prefer it with parens, because without them, if :tree was some variable instead, you can't tell that its an argument
<anon_>
havenwood, oh so bundle already has a bundle of gems
<shevy>
I can easily tell that it is an argument
kith has quit [Ping timeout: 246 seconds]
<shevy>
and :tree is a symbol always
<Norrin>
i know. that's why i said if it was a variable identifier instead
<Norrin>
it can get confusing
<havenwood>
anon_: Modern RubyGems can resolve dependencies from the Gemfile and create the Gemfile.lock so you practically don't need Bundler except for Rails, which hardcodes to it.
<shevy>
I see that you know symbols :)
<havenwood>
anon_: That said, Bundler is very widely used.
jimms has joined #ruby
<havenwood>
anon_: It's good to learn how it works.
skade has quit [Ping timeout: 260 seconds]
paulcsmith has joined #ruby
juanpaucar has joined #ruby
luckyruby has quit [Quit: Leaving...]
youch has joined #ruby
rdark has quit [Quit: leaving]
<havenwood>
anon_: Try installing Bundler (`gem install bundler`), creating a Gemfile (that ^ link), creating a Gemfile.lock (`bundle install`) and then running a Ruby command in the context of the Bundle (`bundle exec <command>`).
einarj has joined #ruby
_djbkd has joined #ruby
JohnBat26 has joined #ruby
ramfjord has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
Timba-as has joined #ruby
r0x0rZ has joined #ruby
youch has quit [Ping timeout: 265 seconds]
benlieb has joined #ruby
skade has joined #ruby
neilnorthrop has joined #ruby
amystephen has joined #ruby
dgutierrez1287 has joined #ruby
banister has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 246 seconds]
jgt1 has joined #ruby
crazydiamond has joined #ruby
platzhirsch has joined #ruby
jonee has quit [Quit: ChatZilla 0.9.92 [Firefox 40.0/20150807094952]]
ndrei has quit [Ping timeout: 264 seconds]
youngbaks has joined #ruby
ndrei has joined #ruby
Guest50 has joined #ruby
rikkipitt has joined #ruby
suchness has quit [Remote host closed the connection]
dgutierrez1287 has quit [Ping timeout: 265 seconds]
hotpancakes has joined #ruby
jgt1 has quit [Ping timeout: 240 seconds]
jiada has quit [Quit: Connection closed for inactivity]
baweaver has quit [Remote host closed the connection]
akash89 has joined #ruby
anon__ has joined #ruby
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dman777_alter>
shevy: it's used as so.... params.merge(JSON.parse(request.body.read)) with def params_with_user(params={}) params.merge({ 'user' => current_user.try(:display_name) }) end
<ivanskie>
k now to figure out why table_print doesn't like my array
<dman777_alter>
jhass: with the puts statment before and after
bigbadbear has quit [Ping timeout: 260 seconds]
<shevy>
gavit no idea but you can simplify that
<shevy>
File.read() directly for instance
<jhass>
dman777_alter: given it's called params ... is it actually an ActionController::Parameters ?
<toretore>
gavit: what is the input?
<shevy>
and apply the .gsub only when you really need it, the regex engine is not very light weight compared to other parts
<gavit>
shevy: it's only a 72K file I'm reading
lannonbr has quit [Quit: WeeChat 1.2]
einarj has quit [Read error: Connection reset by peer]
<pipework>
diegoviola: Have it vend advice for people who want to make vending machines in ruby.
<pipework>
It'd be fantastically circular. Points for self-deprecating vending machine advice.
bruno- has quit [Read error: Connection reset by peer]
failshell has joined #ruby
rbennacer has quit [Remote host closed the connection]
einarj_ has quit [Ping timeout: 246 seconds]
r0x0rZ has quit [Remote host closed the connection]
ne1l has joined #ruby
<camm>
Hello everyone, I'm just learning about ruby and rails. I have a question: when I use $bundle I install the gems that are described in my Gemfile, but what is the difference using $bundle install? Is the same or not?
ne1l is now known as Guest31298
<diegoviola>
pipework: not sure I get what you mean
<pipework>
camm: I'm not sure what you mean. Are you asking about the difference between `bundle` and `bundle install`?
<pipework>
If so, it's nothing. They're equivalent.
hydrozen has joined #ruby
Guest31298 is now known as nei1
<camm>
pipework: Yes, thats my question exactly.
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
perhaps bundle without a command defaults to 'install'
cabreraM516 has joined #ruby
cabreraM516 has quit [Client Quit]
<shevy>
or it shows the help menu
<shevy>
let's see
AlexRussia_ has quit [Read error: Connection reset by peer]
<pipework>
shevy: It defaults to install
<shevy>
hmm "bundle" without command tries to do something "Could not locate Gemfile or .bundle/ directory"
* pipework
would rather it show help, but whatevskies
einarj has joined #ruby
<shevy>
and that is the same I get via "bundle install" \o/
nei1 has left #ruby [#ruby]
r0x0rZ has joined #ruby
<shevy>
yeah, "gem" alone shows help
<jhass>
camm: install is the default subcommand of bundle
<diegoviola>
pipework: I'm not really looking for advice about how to write one
bruno- has joined #ruby
<pipework>
diegoviola: So?
lordkryss has joined #ruby
hotpancakes has joined #ruby
<camm>
Thanks guys.
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
benlovell has quit [Ping timeout: 256 seconds]
<pipework>
You offered an unsolicited idea to a public channel, I offered an unsolicited idea on the public channel. Free exchange of ideas has been reached.
<jhass>
?guys camm
<ruboto>
camm, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<diegoviola>
pipework: ok
JakFrist has joined #ruby
ivanskie has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alankis has quit [Quit: Page closed]
hobodave has quit [Quit: Computer has gone to sleep.]
northfurr has joined #ruby
mwlang has quit [Quit: mwlang]
JakFrist has joined #ruby
<gavit>
toretore: I'm assuming I should replace t with my file?
<toretore>
yes
renderful has quit [Ping timeout: 255 seconds]
<gavit>
the regex seems to work on rubular though
<toretore>
fuck the regex
<gavit>
hahahaa
skade has quit [Ping timeout: 245 seconds]
<ivanskie>
i don't even know how to ask google this. but i tried. uh, if my csv file does not have files.. and i want to end up with an array of hashes with my own headers (csv has over 120 columns, i'm only using like 5...). how would one do that? i have an idea.. but i think its an ugly one
<gavit>
lemme check if I have nokogiri, cause I get a blank output
clarkenciel has joined #ruby
Guest50 has joined #ruby
kies has joined #ruby
<toretore>
ivanskie: 1) create array 2) iterate through csv entries 3) take the fields you're interested in and stick them in a hash and then in the array
<jhass>
ivanskie: imo just assign a bunch of constants with the indexes, START_DATE = 9; END_DATE = 10; row[START_DATE]; row[END_DATE]
<ivanskie>
hm
n3il has joined #ruby
n3il has quit [Remote host closed the connection]
<Ox0dea>
ivanskie: Consider #values_at as well.
djbkd has quit [Remote host closed the connection]
hobodave has joined #ruby
hinbody has joined #ruby
andywojo has quit [Ping timeout: 260 seconds]
icarus has quit [Ping timeout: 272 seconds]
rodfersou has quit [Quit: leaving]
djbkd has joined #ruby
jamesaxl has joined #ruby
rodfersou has joined #ruby
n3il has joined #ruby
n3il has quit [Read error: Connection reset by peer]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
leafybasil has quit [Remote host closed the connection]
phutchins has quit [Ping timeout: 250 seconds]
leafybasil has joined #ruby
hinbody_ has quit [Ping timeout: 264 seconds]
araujo has joined #ruby
nuttermb has quit [Ping timeout: 255 seconds]
iateadonut1 has joined #ruby
jimms has quit [Remote host closed the connection]
n3il has joined #ruby
nfk has joined #ruby
leafybasil has quit [Ping timeout: 246 seconds]
n3il has quit [Client Quit]
iateadonut has quit [Ping timeout: 246 seconds]
ne1l has joined #ruby
benlovell has joined #ruby
kt2 has quit [Read error: Connection reset by peer]
baroquebobcat has quit [Quit: baroquebobcat]
kt2 has joined #ruby
hackeron has joined #ruby
valetudo has quit [Read error: Connection reset by peer]
hackeron_ has quit [Ping timeout: 272 seconds]
Dreamer3 has quit [Quit: Leaving...]
Dreamer3 has joined #ruby
SenpaiSilver_ has quit [Quit: Leaving]
skade has joined #ruby
SenpaiSilver has joined #ruby
kadoppe has quit [Ping timeout: 245 seconds]
northfurr has quit [Quit: northfurr]
eminencehc has quit [Remote host closed the connection]
icarus has joined #ruby
josh4 has quit [Ping timeout: 265 seconds]
kadoppe has joined #ruby
atomical has joined #ruby
devdazed has joined #ruby
einarj has quit [Ping timeout: 240 seconds]
einarj has joined #ruby
mleung has quit [Quit: mleung]
baweaver has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<gavit>
toretore: disceting this oneline of yours :P
yqt has joined #ruby
joonty has joined #ruby
<gavit>
I think your oneliner assumes listingaddress is a part of listingname, but I think they ae both on the same level
yfeldblum has quit [Ping timeout: 246 seconds]
<ivanskie>
uhm so back to csv to array of hashes.... i couldn't really wrap my head around how to do what u guys suggested.. but this is basically what I'd like to end up with: https://gist.github.com/i5okie/92e813eb10ccb40bd3fa
baweaver has quit [Remote host closed the connection]
<jhass>
?guys ivanskie
<ruboto>
ivanskie, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
benlieb has joined #ruby
northfurr has joined #ruby
axsuul has joined #ruby
<ivanskie>
csv has no headers, so i made my own hash with symbol values. so how would you end up with something like that?
<ivanskie>
oops :S
powersurge has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
<powersurge>
in delayed_job is there a way to get the id of a job just after enqueuing it? having a bear of a time working out how to do it
<ivanskie>
oh i think i have an idea (about the hash thing)
<saddad>
if that's your file you need to use require_relative
hotpancakes has joined #ruby
<jhass>
Lingo: use require_relative or better yet add the directory euler-help.rb lives in to the $LOAD_PATH
<Lingo>
but euler-help is in the same dir as this file, does that matter?
<jhass>
Lingo: protip: gist supports syntax highlighting and multiple files
baweaver has quit [Remote host closed the connection]
<saddad>
require_relative gets files that aren't in your $LOAD_PATH
<Lingo>
oh, got it
<Lingo>
and will do next time
<Lingo>
thanks guys!
<jhass>
?guys Lingo
<ruboto>
Lingo, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<gavit>
toretore: solved!
Rutix has quit []
casadei has quit [Remote host closed the connection]
<Lingo>
Uh ok. Where i'm from you can use the term "guys" to refer to a group of people, not really a gender-related thing
<gavit>
now, I have a string "De naam '.*' heeft (\d+) vermeldingen. <- should I do this with regex?
<Lingo>
but sure, thank you both!
shinnya has joined #ruby
<pipework>
saddad: It also doesn't even check the $LOAD_PATH
<pipework>
so it can be beneficial for startup time and whatnot
rikkipitt has joined #ruby
<Lingo>
guys
chouhoul_ has quit [Remote host closed the connection]
Lingo has quit [Quit: (null)]
chouhoulis has joined #ruby
<ashleyhindle>
Ruby is pretty nice
<shevy>
\o/
<ashleyhindle>
Though map(&:downcase) looks odd
<shevy>
you can write .map {|e| e.downcase }
<ashleyhindle>
I might stick to that with my own stuff for now :D
puppeh_ has quit [Quit: Leaving...]
<shevy>
nah you will use the shorter variant quickly
<shevy>
because it's shorter :D
<shevy>
it's slower though so perhaps you should indeed use the longer variant
<ashleyhindle>
It looks really weird, though I suppose I'll get used to it eventually
<shevy>
yeah the & disturbs me too
<Ox0dea>
ashleyhindle: It only "looks weird" because you don't yet understand its component parts.
<Ox0dea>
Symbols are useful for denoting "static strings" like method names, and & is "to/from Proc".
EllisTAA has joined #ruby
kirun has quit [Quit: Client exiting]
northfurr has quit [Quit: northfurr]
radgeRayden has joined #ruby
<ashleyhindle>
I get symbols but not "to/from Proc"
devdazed has quit [Quit: Computer has gone to sleep.]
<Ox0dea>
shevy: Needs more benchmark/ips.
<shevy>
.map(&:one) versus .map {|x| x.one }
<shevy>
.map(&:one) is slower
frozen3 has quit []
<bradland>
i think it's because of the call to Symbol#to_proc
radgeRayden has quit [Ping timeout: 246 seconds]
gerep has joined #ruby
ivanskie has joined #ruby
shmilan has joined #ruby
rikkipitt has quit [Remote host closed the connection]
<bradland>
Ox0dea's suggestion to use benchmark/ips is a good one though, because you may just be seing overhead artifacts
devdazed has joined #ruby
<bradland>
which is another way of saying, you must construct additional pylons
<gerep>
Hi all. I have the 1.9.3 version installed and upgrade to 2.0.0 using "yum upgrate ruby", the upgrade was OK but when I try to run bundle it says: "-bash: /usr/bin/bundle: No such file or directory" and I need to restart the machine for it to work, any ideas?
* imperator
can't remember how to do inline search & replace
jbw_ has quit [Ping timeout: 260 seconds]
<weaksauce>
gerep consider using a proper ruby manager and bundler
<weaksauce>
look at ruby-install and chruby gerep
<imperator>
ivanskie, i'd just use powershell ;)
decoponyo has quit [Quit: Leaving...]
<bradland>
gerep: you'll probably have better luck in the RedHat channel for that one, since it sounds like a dist concern
<gerep>
weaksauce, no doubt it is a good idea but I can't use that right now :(
<gerep>
bradland, good point
<gerep>
Thank you all! :D
mleung has joined #ruby
<bradland>
the error you've received indicates that bundler is not installed
<ivanskie>
yeah already doing that. just had a thought of maybe writing it in ruby, and make it look better (backup script, with better progress representation than whats available)
<bradland>
yep
<shevy>
bundler is normally a standalone .gem
ledestin has joined #ruby
<gerep>
bradland, but why it works when I restart?
<ivanskie>
and better error handling... right now i can't really automate my ps script cause if it errors out or doesnt finish. it just sits there in an open window.
<gerep>
Oh!!! Forgot to say, I have also updated rubygem-bundler
<shevy>
the homepage at rubygems.org is at https://rubygems.org/gems/bundler - you can also download the gem on the right hand side, then install it
<imperator>
ivanskie, use sys-proctable :)
<bradland>
gerep: does it actually work when you restart? when does it stop working again?
<ivanskie>
but if it succeeds it emails me.
<shevy>
imperator are you still using ruby on windows by the way?
benlieb has joined #ruby
<imperator>
shevy, i use ruby on all platforms
jeadr has quit [Remote host closed the connection]
<gerep>
bradland, yes it does work, it doesn't work when I finish the upgrade
hinbody has quit [Quit: leaving]
<shevy>
so yum fails
<imperator>
ruby -ne "s/Hello/Goodbye/g" temp.txt - doesn't seem to like that
<shevy>
yum is even written in ruby these days I think
<Ox0dea>
shevy: It seems Symbol#to_proc is only faster for "built-in" methods.
devdazed has quit [Quit: Computer has gone to sleep.]
bumbar_ has quit [Ping timeout: 246 seconds]
<shevy>
Ox0dea heisenspeed!
<shevy>
sometimes faster sometimes not!
jeadr has joined #ruby
<Ox0dea>
Blame BASIC_OP_UNREDEFINED_P().
mleung has quit [Client Quit]
<shevy>
I don't dare to dig into the internals like you do :D
<Ox0dea>
It checks whether a "core" method hasn't been redefined and so can be optimized.
<shevy>
I see you will be having a word with nobu again
baroquebobcat has joined #ruby
<Ox0dea>
I don't know how to optimize arbitrary methods to Ruby bytecode.
michael_mbp has quit [Excess Flood]
<ivanskie>
would be nice to have this on windows http://backup.github.io/backup/v4/ without having to pay some company $$$$$$$$$$$$$ for some gui based bs
<Ox0dea>
(I don't think anybody does?)
devdazed has joined #ruby
devdazed has quit [Client Quit]
<bradland>
gerep: so, you finish the upgrade, restart, and it works again?
programmerq has quit [Read error: Connection reset by peer]
<gerep>
bradland, yes hahaha
<gerep>
bradland, weird, isn't it?!
tmtwd has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby
michael_mbp has quit [Excess Flood]
<bradland>
you said it works when you restart. so, presumably, it'd have to stop working again at some point, right?
rubie has joined #ruby
<bradland>
when does it stop working again?
lannonbr has joined #ruby
mleung has joined #ruby
tmtwd has joined #ruby
<shevy>
can't you run "yum" in a verbose manner gerep?
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gerep>
bradland, I can't tell you when it stop working but I'm going to try that again and see if I can find something
<bradland>
gerep: the situation you're describing presents a paradox. i think you've missed a critical part of your description that would allow us to understand your problem
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<gerep>
bradland, I made a test that worked but I'll check it again. I have installed rubygem-bundler first and then ruby
<gerep>
bradland, I'll do the process again and make sure that's the reason
<gerep>
bradland, does it sound possible? hahah
baroquebobcat_ has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
northfurr has quit [Quit: northfurr]
frem has joined #ruby
<ashleyhindle>
Is there a well written, up to date, smallish ruby library/app that you've used recently that I could study?
dgutierrez1287 has joined #ruby
[gmi] has joined #ruby
mistermocha has joined #ruby
baroquebobcat has quit [Ping timeout: 244 seconds]
baroquebobcat_ is now known as baroquebobcat
<shevy>
gerep make sure to check "gem env" output too, and try to find out how many ruby versions + have, and how many install paths you use for your local .gem files (when you download a .gem, it is stored locally too in a directory)
clarkenciel has quit [Ping timeout: 265 seconds]
<gerep>
shevy, ok
Averna has joined #ruby
benlieb has quit [Quit: benlieb]
snockerton has joined #ruby
<snockerton>
begin
<dfockler>
ashleyhindle: frappuchino is interesting, and it's up to date ish
dojobo has quit [Ping timeout: 246 seconds]
<ashleyhindle>
Thanks dfockler I'll look
dgutierrez1287 has quit [Ping timeout: 244 seconds]
<dfockler>
I think it's actually spelled frappuccino
dotix has joined #ruby
dotix has joined #ruby
skade has quit [Ping timeout: 245 seconds]
baweaver has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 246 seconds]
jacaballero has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kies has quit [Ping timeout: 244 seconds]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
einarj has quit [Ping timeout: 250 seconds]
einarj_ has joined #ruby
icarus has quit [Ping timeout: 256 seconds]
bruno- has quit [Quit: Lost terminal]
northfurr has joined #ruby
benlieb has joined #ruby
bruno- has joined #ruby
TheNet has joined #ruby
rfizzle has joined #ruby
ishahnaz has quit []
hotpancakes has quit [Remote host closed the connection]
<eam>
spelled "starbucks intends to vigorously defend our trademarks"
msnyon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dojobo has joined #ruby
jenrzzz has joined #ruby
benlieb has quit [Quit: benlieb]
Motoservo has joined #ruby
sheldonh has joined #ruby
unver has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
skade has joined #ruby
<sheldonh>
i'm struggling to get my docs to hyperlink class and method names on rubydoc.info, which i understand uses yard. yard says its compatible with rdoc, but i seem to have to wrap class and method names in braces to get them linked, which then breaks linking in rdoc
rehat has joined #ruby
jackjackdripper has joined #ruby
rideh has joined #ruby
bmurt has quit []
josh4 has joined #ruby
rodfersou has quit [Quit: leaving]
benlovell has joined #ruby
yeticry_ has quit [Ping timeout: 244 seconds]
gerep has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 246 seconds]
jamo_ has quit [Ping timeout: 246 seconds]
benlieb has joined #ruby
mary5030 has quit [Remote host closed the connection]
yeticry has joined #ruby
jamo_ has joined #ruby
[gmi] has quit [Quit: Leaving]
dotix has quit [Quit: Leaving]
mary5030 has joined #ruby
tenderlove has joined #ruby
northfurr has quit [Quit: northfurr]
chinmay_dd has quit [Quit: See ya!]
benlovell has quit [Ping timeout: 260 seconds]
codecop has quit [Remote host closed the connection]
renderful has joined #ruby
josh4 has quit [Read error: Connection reset by peer]
gamename has quit [Remote host closed the connection]
mary5030 has quit [Ping timeout: 260 seconds]
<snockerton>
any tips for finding a missing 'end' ?
<Ox0dea>
snockerton: gg=G
<pipework>
snockerton: align your code and then read it.
<snockerton>
in a huge nested structure
<snockerton>
-_-
<pipework>
Reading is fundamental.
<Ox0dea>
snockerton: Install Vim, open the file, gg=G, look for the first sign of wonkiness.
rideh has quit [Quit: zap]
DroidBurgundy has quit []
finisherr has joined #ruby
<Ox0dea>
Perhaps there's some Vim as a Service you could use to avoid having to install it.
devdazed has joined #ruby
northfurr has joined #ruby
bhorn1 is now known as bhorn1|away
renderfu_ has quit [Ping timeout: 250 seconds]
<snockerton>
i'm morally opposed to installing vim
<pipework>
Not everyone can have good taste.
<toretore>
cast him into the fire
<pipework>
snockerton: Align your code and then read it. Use whatever you want.
<eam>
Ox0dea: M-x viper-mode
<Ox0dea>
Needs more VimL.
<Ox0dea>
(Not really, obviously.)
<snockerton>
i would expect rubucop to do this for me
rideh has joined #ruby
ldnunes has quit [Quit: Leaving]
<snockerton>
but it prefers to complain about more useful issues like column length...
<pipework>
snockerton: I'd expect it to do my job for me so I can retire early.
<Ox0dea>
> My tools are to blame.
<pipework>
I got what I paid for though. :(
devdazed has quit [Client Quit]
<snockerton>
pipework: i don't deny being lazy
<pipework>
Ox0dea: I don't know what you're talking, I just use ( in lisp and then automatically close all ) so I don't have to type them.
<Ox0dea>
pipework: To clarify, I was castigating VimL, not Lisp.
<pipework>
snockerton: Whale, it's also a funny thing to suggest if you think about how to actually get that to work.
<shevy>
(stop(making(fun(of(lisp(already
<pipework>
Ox0dea: Was just a lul about not wanting to put closing stuff where it belongs.
<Ox0dea>
))))))
<Ox0dea>
snockerton: Do you know how to auto-align your entire file?
bap1313 has joined #ruby
iloverubynoob has joined #ruby
jimms has quit [Remote host closed the connection]
<snockerton>
atom has auto-indent
<Ox0dea>
Do you know how to invoke it?
socialjackie has quit [Read error: Connection reset by peer]
<Ox0dea>
pipework: Do you use electric-indent-mode?
abdoudjanifresh has joined #ruby
<pipework>
Ox0dea: I don't know what that is.
<Ox0dea>
But you use Emacs?
<pipework>
What made you think I use emacs?
<snockerton>
yea i click on "Auto Indent"
<Ox0dea>
pipework: Shit, I conflated you with eam, it seems.
<pipework>
snockerton: the presence of the word 'click' is telling.
<snockerton>
pipework: because all ass holes use emacs
<pipework>
snockerton: Anyways, fix your code!
<pipework>
Stop screwing up!
<snockerton>
lol
casadei_ has quit [Remote host closed the connection]
<pipework>
There are other perfectly good directions you can choose from.
<snockerton>
there i just created a key binding for auto-indent
binaryplease has joined #ruby
<Ox0dea>
So fookin' h4xx0r, mate.
<snockerton>
i know right
rideh has quit [Quit: zap]
skade has quit [Ping timeout: 272 seconds]
<Ox0dea>
In any case, it should become quite obvious where you're missing an `end` after you've aligned your code.
<snockerton>
i just want to live up to the folks in #ruby
<Ox0dea>
A method definition will go on much longer than it ought to, or something along those lines.
rideh has joined #ruby
<Ox0dea>
snockerton: We're considering sacrificing you to the red god.
blackmesa has joined #ruby
cndiv has joined #ruby
bronson has joined #ruby
<sheldonh>
sometimes i get "expecting keyword_end" because i opened with do but closed with a brace. fun times
<snockerton>
sry, already done in #rubyonrails
<cndiv>
Hey all, is there a great Ruby "cheat sheet / basic defintions" PDF that you all know about? Something for me to stare at, tacked to my wall?
<sheldonh>
cndiv: also, well worth becoming familiar with the documentation for String, Numeric, Array, Hash and Enumerable. they will take you far
<cndiv>
Ox0dea: I've seen that, it's great! What about the same idea, but reduced to something designed for printing out on a wall?
<Ox0dea>
cndiv: A loving hand + wkhtmltopdf, I suppose.
<cndiv>
I benefit from having a stereotype poster to stare at in early stages.
JoshL has quit []
<sheldonh>
cndiv: i meant Integer, not Numeric
<cndiv>
Ox0dea: That might be it.
<cndiv>
sheldonh: note taken, thank you.
icarus has joined #ruby
solars has joined #ruby
<cndiv>
I'll give those a try, thank you all.
<dorei>
is there some gem that would help me convert \r\n to \n, remove/collapse whitespaces/nbsp, remove html entities, etc from strings? too lazy to reinvent the wheel
baweaver has joined #ruby
<sheldonh>
so it looks like i have to choose between rdoc and yard. meh
<snockerton>
finally found it, was because I had a blah.each do |x| if stuff
<Ox0dea>
dorei: require 'cgi'
chichou has quit [Ping timeout: 252 seconds]
<dorei>
really? cgi is what i'm looking for? :O
<dorei>
let me check :)
<Ox0dea>
dorei: Well, it's got lots of relevant convenience methods.
<shevy>
Ox0dea do you use Go? they had a new release
<Ox0dea>
1.6, you mean?
<miah>
1.5
<shevy>
dorei yeah CGI.... hmmm.. escape_html or something
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
cndiv has quit [Quit: Quit]
<miah>
says "The compiler and runtime are now written entirely in Go (with a little assembler). C is no longer involved in the implementation, and so the C compiler that was once necessary for building the distribution is gone. "
Limix has joined #ruby
<miah>
anyways. this is OT =)
Oka has quit [Remote host closed the connection]
<shevy>
Ox0dea quit living in the future man!
<shevy>
everything is old news now to him :(
jerius has quit [Quit: /quit]
<sheldonh>
Ox0dea: the reason i suggest Integer is that it has methods that are useful for control flow and a few useful predicates
iamninja has quit [Read error: Connection reset by peer]
<baweaver>
I still think it's funny that XBox tried to get XBox One to be called 'The One' and we all contributed to getting it redubbed the XBone
iamninja has joined #ruby
KnownSyntax has quit [Ping timeout: 255 seconds]
lwu_ has quit [Quit: This computer has gone to sleep]
iloverubynoob has quit [Remote host closed the connection]
havenwood has joined #ruby
bootstrappm has left #ruby [#ruby]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sepp2k has quit [Quit: Leaving.]
mistermocha has joined #ruby
kr3ssh has joined #ruby
KnownSyntax has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flegercovateam has quit [Quit: Leaving.]
<cschneid_>
when does ruby parse regexp literals? I have a `if RUBY_VERSION newer than 1.9 then use fancy regexp, otherwise use boring`. But ruby 1.8 still attempts to parse the fancy one at boot (and fails & errors)
<jhass>
time to drop 1.8 support \o/
<baweaver>
+1 ^
<baweaver>
1.8 is a massive security hole
<baweaver>
deprecated long ago
whiteline has quit [Remote host closed the connection]
<Aria>
Are there open CVEs against it?
<cschneid_>
yeah, I'm aware. but I need to do this. I'm more curious about the parse-time of regex literals
<cschneid_>
if condition then /abc/ else /xyz/ end
<cschneid_>
no matter the condition, both seem to be parsed?
<baweaver>
you need to upgrade
<jhass>
Aria: iirc some minor ones, yes. Basically it's also affected by the last couple of things fixed in the last security releases for 1.9 iirc
ckinniburgh has quit [Quit: Leaving]
chichou has joined #ruby
<baweaver>
2.2.3 just came out, trying to mitigate against ancient bugs is ill-advised
<baweaver>
that should be your priority
chichou has quit [Client Quit]
<sheldonh>
cschneid_: i wouldn't be surprised if ruby performed some syntax checking of regular expressiong while loading a source file
mistermocha has quit [Ping timeout: 252 seconds]
<jhass>
cschneid_: you could probably workaround with Regexp.new, but please just upgrade instead
<sheldonh>
cschneid_: put the regular expression in each of two files and require the right one based on ruby version
<cschneid_>
yeah, not my code. Writing a plugin to a customer who I don't have any control over.
lwu_ has joined #ruby
<cschneid_>
regexp.new is probably the easiest workaround, but you're right that it's annoying to work around ancient rubies.
<sheldonh>
cschneid_: in a constant in a module in each of two files, obviously :)
icharlie has quit [Remote host closed the connection]
greenride has joined #ruby
arturhoo has quit [Quit: arturhoo]
<zenspider>
cschneid: (least tab completable nick here) ... it'll parse regardless of your RUBY_VERSION trap (has to be able to parse to find the end of the conditional). You can stringify both regexps, pop them in DATA, or separate files. I prefer stringify myself
freerobby has quit [Quit: Leaving.]
<Ox0dea>
zenspider: Your client doesn't prioritize recent speakers for completion?
victortyau has quit [Quit: Leaving]
platzhirsch has joined #ruby
<pipework>
Haha, just you wait until I /nick to |work for a long while.
last_staff has quit [Ping timeout: 265 seconds]
bogn has joined #ruby
lwu_ has quit [Ping timeout: 250 seconds]
qhartman has quit [Quit: Ex-Chat]
sheldonh has quit [Quit: oh well]
chohe has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Quit: Leaving...]
<zenspider>
don't think so... also "csch" is hella-awkward on dvorak.
<zenspider>
tho, doesn't look much better on qwerty
<zenspider>
at least it is two handed there
jenrzzz has quit [Ping timeout: 240 seconds]
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<platzhirsch>
what is a nice generic name for some webserver instances
<cschneid_>
zenspider: sorry my name offends your IRC :) I ended up doing the multi-file require since it least interferes with the 99% case of newer rubies.
sepp2k has joined #ruby
<cschneid_>
was just surprising that it did regex literal verification at parse time, not run time.
EllisTAA has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
Schmidt has quit [Ping timeout: 260 seconds]
rbennacer has quit [Remote host closed the connection]
einarj has quit [Read error: Connection reset by peer]
jbw has quit [Ping timeout: 240 seconds]
einarj has joined #ruby
djbkd has joined #ruby
decaff has quit [Quit: Leaving...]
dgutierrez1287 has joined #ruby
Log1x has joined #ruby
patrick99e99 has joined #ruby
<patrick99e99>
Hey there ruby friends.. I am trying to spy in a test that sleep gets called, and I can't seem to make my test pass: expect(Kernel).to have_received(:sleep) ................ Unless I actually do Kernel.sleep in my real code
<patrick99e99>
Why is calling "sleep" not delegating to Kernel?
jackjackdripper has quit [Ping timeout: 246 seconds]
jbw has joined #ruby
finisherr has quit [Quit: finisherr]
<baweaver>
expect(subject).to receive(:sleep)
dgutierrez1287 has quit [Ping timeout: 255 seconds]
jackjackdripper has joined #ruby
icarus has joined #ruby
ivanskie has joined #ruby
<drbrain>
fun fact: you can also def subject.sleep; end and prevent sleeping in your tests
benlieb has joined #ruby
<patrick99e99>
yeah expect(subject).to receive(:sleep) does not work...............
<patrick99e99>
but I think def subject.sleep will... Ill try that
binaryplease has quit [Quit: WeeChat 1.2]
iloverubynoob has quit [Ping timeout: 260 seconds]
blackjid has quit [Max SendQ exceeded]
jiada has joined #ruby
Cronon has joined #ruby
blackjid has joined #ruby
jbw has quit [Ping timeout: 255 seconds]
omegahm_ has joined #ruby
charliesome has joined #ruby
jzigmund_ has joined #ruby
bronson has joined #ruby
omegahm has quit [Ping timeout: 244 seconds]
omegahm_ is now known as omegahm
jzigmund has quit [Ping timeout: 244 seconds]
_Cronon_ has quit [Ping timeout: 244 seconds]
<zenspider>
patrick99e99: does that seem like a valuable test to you?
<zenspider>
patrick99e99: you can also test a subclass that defines its own override of sleep that does nothing
GeissT has joined #ruby
r0x0rZ has joined #ruby
<pontiki>
if i'm the subject, that test definitely fails
platzhirsch has quit [Ping timeout: 256 seconds]
bronson has quit [Ping timeout: 245 seconds]
bogn has quit [Remote host closed the connection]
jacaballero has joined #ruby
Nykalt is now known as AlexAltea
<zenspider>
pontiki: hah
diegoviola has joined #ruby
r0x0rZ has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 244 seconds]
renderful has quit [Remote host closed the connection]
noname has quit [Quit: WeeChat 1.0.1]
snockerton has quit [Quit: Leaving.]
TheRealHansonE has quit [Quit: TheRealHansonE]
kt2 has quit [Read error: Connection reset by peer]
einarj has quit [Ping timeout: 256 seconds]
kt2 has joined #ruby
einarj has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fedexo has joined #ruby
jbw has joined #ruby
phutchins has joined #ruby
rideh has quit [Quit: zap]
benlieb has quit [Quit: benlieb]
leafybasil has joined #ruby
tmtwd has quit [Ping timeout: 250 seconds]
IceyEC has joined #ruby
mary5030 has joined #ruby
matled has quit [Remote host closed the connection]
matled has joined #ruby
jgt1 has joined #ruby
dopamean_ has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
Motoservo has quit [Read error: Connection reset by peer]
EllisTAA has quit [Quit: EllisTAA]
rehat has quit [Remote host closed the connection]
rubie has quit [Remote host closed the connection]
dfockler has quit [Remote host closed the connection]
mleung has quit [Quit: mleung]
binaryplease has joined #ruby
akurilin2 has quit [Quit: WeeChat 1.2]
dimasg has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
Motoservo has joined #ruby
M0ni has joined #ruby
chichou has quit [Remote host closed the connection]
chichou has joined #ruby
hotpancakes has quit [Remote host closed the connection]
blackmesa has joined #ruby
mistermocha has joined #ruby
symm- has quit [Quit: Leaving...]
dimasg has quit [Ping timeout: 255 seconds]
Musashi007 has quit [Quit: Musashi007]
pen_ has joined #ruby
<ivanskie>
ook i think i need a reminder.. lol uuh how do u do a wildcard of string? in my ruby i'm iterating through list of files, i need to skip all starting with .* ... without listing everything manually this doesnt work https://github.com/i5okie/CDR/blob/master/app#L18
<ivanskie>
:(
IceyEC has quit [Quit: iceyec]
<ivanskie>
Im trying to scan my memory for all those codeschool and teamtreehouse lessons i watched now. argh
josh4 has joined #ruby
ICantCook has joined #ruby
pen_ is now known as pen
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]