<dminuoso>
frankiee_: so apparently you cant do .deep_fetch(:key, 0)
edwinvdg_ has quit [Read error: Connection reset by peer]
asal2107 has quit [Ping timeout: 240 seconds]
edwinvdgraaf has joined #ruby
millerti has joined #ruby
<frankiee_>
dminuoso: something else must be wrong, i can't even .deep_fetch(:key)
dionysus69 has quit [Ping timeout: 264 seconds]
Burgestrand has joined #ruby
craigp has quit [Ping timeout: 264 seconds]
qiukun has quit [Quit: qiukun]
andrewvos has quit [Quit: WeeChat 0.4.2]
tcrypt has quit [Read error: Connection reset by peer]
[k- has joined #ruby
pawnbox_ has joined #ruby
tcrypt_ has joined #ruby
mim1k|wo1k is now known as mim1k|work
salut has quit [Quit: salut]
<fbt>
I have another scoping question. I have a method for ::String that renders strings as erb templates. In said erb templates I use local variables that were set in the scope the method is used. Why does this even work?
<fbt>
Shouldn't the method not have access to these local variables?
Hyuk has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
<apeiros>
fbt: can you provide a working minimal example?
<fbt>
I can't get my head around how scopes work in Ruby
tcrypt_ has quit [Ping timeout: 272 seconds]
<apeiros>
hm, weird.
askhat has left #ruby [#ruby]
submitnine has quit [Read error: Connection reset by peer]
<fbt>
It shouldn't even work, right?
<apeiros>
I have a suspicion
[]\[] has quit [Ping timeout: 244 seconds]
bhrgunatha has joined #ruby
<apeiros>
yupp
<apeiros>
ERB#result defaults to using TOPLEVEL_BINDING
<fbt>
Ah.
<fbt>
Well that is insecure as all shit
<apeiros>
so while the method does NOT have direct access to the local variables, it has indirect access to this very special scope through that constant.
monoprotic has quit [Ping timeout: 276 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
<apeiros>
you can always pass in a specific binding
monoprotic has joined #ruby
tcrypt has joined #ruby
Sembei has joined #ruby
<fbt>
Yeah. Or put my config into a module and work through that
nadir has joined #ruby
dionysus69 has joined #ruby
Guest94926 has quit [Ping timeout: 272 seconds]
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
symm- has quit [Ping timeout: 240 seconds]
MyMind has quit [Ping timeout: 276 seconds]
bhrgunatha has quit [Client Quit]
craigp has joined #ruby
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
nuck has joined #ruby
johnmilton has quit [Remote host closed the connection]
claudiuinberlin has quit [Remote host closed the connection]
<Bish>
well, i can also build a neural network that magicially can do that, but is as unlikely
<dminuoso>
elomatreb: I think such a library is quite horrible.
anisha has joined #ruby
<elomatreb>
dminuoso: Mh? Why is that?
<dminuoso>
elomatreb: The problem is that people don't understand encoding. Spoonfeeding them with something like that allows them to completely avoid the issue, and have no fucking clue what they are working with..
blackmes1 has quit [Ping timeout: 240 seconds]
<apeiros>
while I agree with dminuoso's concern, I prefer to blame the people over blaming the tools.
<dminuoso>
apeiros: Absolutely.
<elomatreb>
dminuoso: Agreed in principle, but even someone who understands encoding sometimes gets handed garbled data
<apeiros>
but I've seen tons of horrible solutions to encoding issues
<apeiros>
and if those solutions are replaced with ftfy, I think it's already an improvement
<dminuoso>
apeiros: I would replace those persons.
<dminuoso>
But hey.
<dminuoso>
:p
<apeiros>
sure
<apeiros>
but we can't :)
<elomatreb>
Putting a library like this one in your app and just passing all data through it is probably a bad idea, yeah
<elomatreb>
But I see nothing wrong with it to fix stored data
<dminuoso>
apeiros: Like the guy who came in here asking "hey if you cant oauth2 and want to safely store passwords for a third website on your server, how would you solve the problem" - I told him "by firing you"
<apeiros>
yes, I've seen that. was a bit harsh.
<apeiros>
sometimes you get handed problems where all solutions are bad
<elomatreb>
Do we now pride ourselves on giving out non-solutions?
<apeiros>
we maintain login+pw in the session in our app because we're not allowed to use a technical user in exchange, but are required to synchronize data with it and are not allowed to query logindata again. it's a horrible solution, but I don't see another one. I did my duty by advising against it.
johnmilton has joined #ruby
johnmilton has quit [Read error: Connection reset by peer]
<elomatreb>
What is the person asking about the passwords going to do? Go to their boss and say "Well, those people in IRC told me it was a bad idea, let's not do it"
<dminuoso>
elomatreb: Just asking the question is proof that he has no clue about the subject. Being tasked to then implement a solution to "safely/encryptographicallytilityfully/properly" solve security issues cannot yield any useful results.
johnmilton has joined #ruby
<elomatreb>
dminuoso: I agree completely, but being rude is not going to help
<apeiros>
and the case yesterday seemed somewhat similar. no influence on the login mechanism for those 3rd party apps. so all you can do is communicate the risks to your users and provide a technically awful solution.
<apeiros>
i.e. all you can do is reduce the risk, but not eliminate it.
<dminuoso>
apeiros: Last time someone here wanted to implement such an idiotic solution, I sent back a risk analysis, depicting that a potential attack could cost the company millions with various attack vectors described, and ensured someone from management heard about it. The issue was never pursued again.
<apeiros>
what would you have done if management said "ok, thanks for the assessment, we'll still do it"?
<dminuoso>
apeiros: It's a communication issue mostly.
gnufied has joined #ruby
<elomatreb>
In the end, we probably didn't stop them implementing their password storing thingy
<dminuoso>
apeiros: Then I would have told then "Im not a security expert to sufficiently provide a thorough solution"
<dminuoso>
apeiros: And told them to hire security specialists to solve the problem.
<apeiros>
"do a best effort"
Snowy has quit [Remote host closed the connection]
gnufied has quit [Max SendQ exceeded]
gnufied has joined #ruby
<dminuoso>
apeiros: It's like when you splice optical cables. You don't ask your janitor whether "he can do a best effort" - you hire trained technicians who know about the equipment and procedures, otherwise you just get junk.
fmcgeough has joined #ruby
<elomatreb>
"<apeiros> [...] I prefer to blame the people over blaming the tools." -- Why? We can fix the tools, I doubt we can fix people
edwinvdgraaf has quit [Ping timeout: 272 seconds]
ode_to_code has quit [Quit: ode_to_code]
<apeiros>
s/fix people/educate people/
Immune has joined #ruby
glcx has joined #ruby
jayeola has quit [Ping timeout: 272 seconds]
<apeiros>
and the assumption is that the tool works correctly
<dminuoso>
apeiros: Maybe I just have a bit of an idealistic perspective and the freedom to excercie a thick head at times in my company
<apeiros>
of course, if the tool is broken, I will blame the tool. but that was not the point of discussion.
tyang has joined #ruby
<elomatreb>
What would be more work? Educating everyone who uses Tool X or designing X to not require (as much) education?
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<elomatreb>
I'm mainly a designer, so I'm probably a bit biased here
<dminuoso>
What do you design?
kristofferR has joined #ruby
<elomatreb>
Mainly for websites, although I have done some mobile UI stuff in the past
<apeiros>
elomatreb: problem is we're talking about programmers. they build more tools based on their ignorance. it's a snowballing problem.
<apeiros>
I don't care when leaves do stupid things
roger_rabbit has joined #ruby
<apeiros>
I do care when nodes do stupid things
<apeiros>
because from nodes, stupid things propagate and grow.
<elomatreb>
I hadn't thought of that. You mean like the influental people in programming spreading bad influence?
bruce_lee has quit [Ping timeout: 264 seconds]
<apeiros>
and programmers are nodes. their stupidity is multiplied (through users of their programs) and passed down (code inheritance, teaching bad techniques, etc.)
synthroid has joined #ruby
bruce_lee has joined #ruby
<dminuoso>
elomatreb: And contrary to popular belief encoding is a relatively simplistic issue, it just requires people to figure out what your input is and what your output needs to be.
<dminuoso>
elomatreb: Which means effort.
<apeiros>
it's a "spend an hour" issue.
<apeiros>
and the caused issues of not spending that hour is magnitudes more than an hour.
<dminuoso>
Granted, things get a bit interesting once you add collation into the mix.
<elomatreb>
I agree somewhat, although the religious defenders of ISO8859 in my country make it interesting
<apeiros>
yes, especially in languages like ruby which lack native support.
<apeiros>
but luckily, collation is a much much less important problem than encoding.
<apeiros>
elomatreb: I assume those people also hate emoji, so that's not a vector to convince them? :D
AlexRussia has joined #ruby
jayeola has joined #ruby
<apeiros>
nb: there's nothing wrong with iso8859, as long as all your data fits in it and the use of it is properly documented (also nb: the use of utf-8 should also be properly documented)
<elomatreb>
apeiros: It's one of the very few things that sometimes convince those people to switch their database encoding
rondon1124 has joined #ruby
<apeiros>
elomatreb: and then they use mysql with 4byte utf-8 😂
* elomatreb
looks at github angrily
<rondon1124>
what widget toolkit do you use with ruby ?
<rondon1124>
to make GUI apps ?
kvsari has joined #ruby
<rondon1124>
Tk ?
ocbtec has quit [Quit: leaving]
<apeiros>
*don't use
glcx has quit [Read error: Connection reset by peer]
glcx_ has joined #ruby
<dminuoso>
apeiros: The really hateful thing about mysql in the whole story is collation actually. I was super annoyed and confused, when I got the strangest unique constraint violation errors - it took me hours to figure out that by default mysql has collation enabled..
tcrypt has quit [Ping timeout: 264 seconds]
<dminuoso>
That was the last time I agreed to help out with a MySQL problem for the other department.
d10n-work has joined #ruby
<apeiros>
well, that part makes sense IMO. it's the same as if you define a column to be case insensitive and then wonder why unique constraint triggers on 'hi' vs. 'HI'
<apeiros>
unless I misunderstand the issue :)
<apeiros>
(long time no mysql - pg in private, and *sadface* oracle & mssql at work)
edwinvdgraaf has joined #ruby
<dminuoso>
apeiros: Well, as a software developer, to me "H" is not the same as "h"
<dminuoso>
And "ä" is not the same as "a"
Burgestrand has joined #ruby
<dminuoso>
I look at them and see codepoints.
<dminuoso>
Not some humanized meaning.
<apeiros>
dminuoso: sure. but it is equivalent if you say "compare case insensitive". even as a software developer. or even: especially as a software developer.
glcx has joined #ruby
glcx has joined #ruby
glcx has quit [Changing host]
glcx_ has quit [Read error: Connection reset by peer]
<apeiros>
again, blame the people, not the tools :D
<apeiros>
if they should have used binary comparison, they should have configured it that way.
Burgestrand has quit [Client Quit]
<apeiros>
ok, partially can blame the tool maybe (bad default)
gingray has quit [Ping timeout: 264 seconds]
<dminuoso>
apeiros: Indeed. I dont have a problem with the feature itself, just the fact that it's enabled by default.
<apeiros>
oracle is also fancy that way in that you can only enable it globally. it's fun if one app needing it breaks all other apps (which need it off)
<dminuoso>
Solution simple: buy more oracle.
Burgestrand has joined #ruby
<dminuoso>
If you are rich to buy one oracle to begin with, you can buy multiple.
<dminuoso>
That's their business concept.
symm- has joined #ruby
pwnd_nsfw has joined #ruby
Burgestrand has quit [Client Quit]
pwnd_nsfw` has quit [Ping timeout: 272 seconds]
tcrypt has joined #ruby
asal2107 has joined #ruby
Snowy has joined #ruby
nankyokusei has joined #ruby
craigp has quit [Quit: WeeChat 1.5]
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
aries_liuxueyang has joined #ruby
brendan- has joined #ruby
olblak_ has joined #ruby
olblak_ has quit [Client Quit]
Burgestrand has joined #ruby
claudiuinberlin has joined #ruby
nankyokusei has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
Macaveli has joined #ruby
Macaveli has quit [Client Quit]
<rondon1124>
is fxruby ok to use to make GUI apps ?
sdwrage has quit [Ping timeout: 276 seconds]
claudiuinberlin has quit [Ping timeout: 240 seconds]
<dminuoso>
rondon1124: From all the frameworks Ive seen, none is really "ok" - they are all "meh" :(
Hyuk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Hyuk has joined #ruby
<rondon1124>
ok dminuoso thanks
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dminuoso>
rondon1124: But then again I used to work in a Qt heavy project, so Im really spoiled in terms of UI development.
<rondon1124>
dminuoso: how is qt ?
<rondon1124>
i mean with ruby ?
<rondon1124>
are there any tutorials ?
<dminuoso>
rondon1124: Do you really want to know how our Ruby code interacted with Qt?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Pumukel has quit [Ping timeout: 276 seconds]
tcrypt has joined #ruby
<BytesAndCoffee>
http://i.imgur.com/XuZYvxh.png ruby on left, python on right, anyone able to give me a clue as to why the ruby code is throwing an error?
<BytesAndCoffee>
still sorting out syntactic differences
<BytesAndCoffee>
can you not have lambdas in an array?
LastWhisper____ has joined #ruby
pawnbox has quit [Remote host closed the connection]
djbkd_ has quit [Ping timeout: 264 seconds]
millerti has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
malconis has joined #ruby
<elomatreb>
BytesAndCoffee: Please gist your code, screenshots aren't very nice to work with (gist.github.com)
malconis has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 240 seconds]
dminuoso has quit [Quit: leaving]
malconis has joined #ruby
dviola has joined #ruby
<apeiros>
BytesAndCoffee: []() is invalid in ruby.
<frankiee_>
elomatreb: Trying to fetch `product_group`, the rest are fine
<apeiros>
and then the same for switch(5). that requires a method named switch. you can do switch.call(5), switch[5] or switch.(5)
<BytesAndCoffee>
so i can't make a lambda that has an array of lambdas and index the correct inner lambda and calls it?
<BytesAndCoffee>
damn
<frankiee_>
elomatreb: As you can see because of the whole key value thing in the JSON it is required to use deep_locate instead of deep_fetch which everything else uses
<apeiros>
BytesAndCoffee: that's an amazing conclusion after what I said
<apeiros>
it's completely wrong and the opposite of what I said, so I really wonder how you come to that.
<BytesAndCoffee>
apeiros: look at the python code
<apeiros>
what for?
dionysus69 has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
<apeiros>
python syntax is different, news at eleven?
<BytesAndCoffee>
its a lambda with a list of two lambdas, the outer lambda indexes the list, and calls the proper inner lambda
<BytesAndCoffee>
i can't do that in ruby?
<apeiros>
I just told you how.
ichkv has joined #ruby
<BytesAndCoffee>
1 sec
<apeiros>
"do it like X" - "oh, so I can't do that" - amazing.
charliesome has joined #ruby
<BytesAndCoffee>
oh
ChiefAlexander has joined #ruby
brendan- has joined #ruby
<BytesAndCoffee>
lambdas require .call
<BytesAndCoffee>
:/
<apeiros>
yes. because they're *objects*, not *methods* (or functions)
<BytesAndCoffee>
sorry, waiting for coffee to kick in
djbkd has quit [Ping timeout: 264 seconds]
<BytesAndCoffee>
so functions aren't first-class objects?
<apeiros>
there are no functions
tcrypt has quit [Ping timeout: 240 seconds]
harai has joined #ruby
<apeiros>
there are methods only. and no, as per common use of "first class", those aren't
<elomatreb>
Are you sure your hash in that app looks like the one in your reduced example?
* elomatreb
is afk for a few minutes, I'll be back though
Rodya_ has quit [Remote host closed the connection]
govg has quit [Quit: leaving]
<frankiee_>
elomatreb: The initial JSON retrieved with rest-client should be identical, however in the main gist the hash has been prettified (ie. so I can write `product_group` instead of `productGroup`)
nankyokusei has quit [Ping timeout: 272 seconds]
_sfiguser has joined #ruby
SteenJobs has joined #ruby
fredlinhares1 has joined #ruby
tristanp has joined #ruby
crameth has quit [Read error: Connection reset by peer]
erlingur has quit [Read error: Connection reset by peer]
djbkd has quit [Ping timeout: 264 seconds]
crameth has joined #ruby
djbkd has joined #ruby
kalleklovn has joined #ruby
maddmaxx has joined #ruby
jayeola has joined #ruby
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
DaniG2k has joined #ruby
geezus has quit [Remote host closed the connection]
codelogix has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
tcrypt has quit [Ping timeout: 264 seconds]
redpants has quit [Ping timeout: 240 seconds]
Pumukel has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
codelogix has quit [Ping timeout: 264 seconds]
tk__ has quit [Quit: ばいばい]
ruby_ has joined #ruby
Snickers has joined #ruby
Guest56703 is now known as rprimus
johnny56 has joined #ruby
<elomatreb>
frankiee_: Mh, could you maybe print and gist the hash as it is passed in that method?
fullofcaffeine has quit [Remote host closed the connection]
djbkd_ has joined #ruby
<kalleklovn>
why dont you use python its much better
fullofcaffeine has joined #ruby
aganov has quit [Quit: Leaving]
tcrypt has joined #ruby
teclator has joined #ruby
chouhoulis has joined #ruby
AlexRussia has quit [Ping timeout: 264 seconds]
tyang has joined #ruby
djbkd has quit [Ping timeout: 276 seconds]
gchristensen has joined #ruby
prawnzy has joined #ruby
DaniG2k has quit [Quit: leaving]
bsrd has joined #ruby
<gchristensen>
Hi, (warning: ruby 1.9.2 ... I know) in the code `table_count = fetch_table_list.count rescue -1` is this rescue creating an implicit begin around fetch_table_list.count?
<elomatreb>
gchristensen: Basically, yes
lempa has joined #ruby
fullofcaffeine has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 244 seconds]
<gchristensen>
is there a name for this syntax so I can go look it up? I wasn't finding it
<apeiros>
inline rescue
<apeiros>
and it should not be used
<ciawal>
you'll often see if/unless used in this fashion though
* gchristensen
googles, finds "Don't Inline-Rescue in Ruby" at the same time (!!!)
<elomatreb>
These statements in general are called modifiers
<apeiros>
since you can't specify which exception to rescue, it'll just rescue all
mark_66 has quit [Remote host closed the connection]
<elomatreb>
imightbestupid12: It's basically all preference. All of the options can do what you need
<elomatreb>
rvm has a bit of a bad reputation for being bloated and hooking in weird places, but it works
<imightbestupid12>
what if you don't know what you need but like the comfort of knowing everything is there when you will need it?
<LyndsySimon>
imightbestupid12: professionals use the correct tool for the job. I'm doing Ruby right now because I joined a team that's been doing Ruby. It's a lot easier for me to come up to speed with Ruby than to have six others come up to speed on Python.
not_underground has joined #ruby
<BytesAndCoffee>
LyndsySimon: thank you for actually being reasonable
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
<LyndsySimon>
BytesAndCoffee: NP :) Feel free to msg me if you're stuck with something and want help from a Pythonist's perspective. I'm always on IRC, and msgs will ping my phone.
<elomatreb>
imightbestupid12: My recommendation (purely based off personal preference) is chruby combined with ruby-install
<LyndsySimon>
imightbestupid12: I misunderstood your question :) I use rvm, but I've been using Ruby for three days.
<kalleklovn>
python features multiple layers of integrated hierarcies over multiple domains, thats works globally, what does puppet have to show for that?
<kalleklovn>
*ruby have
<BytesAndCoffee>
LyndsySimon: ooh, what do you use for IRC->phone relay?
<imightbestupid12>
every time i ran rvm i always got the error rvm is not an object.... i don't understand why or how but that's why i don't like rvm
erlingur has joined #ruby
<LyndsySimon>
BytesAndCoffee: IRCCloud. It's subscription-based, but worth it IMO.
<elomatreb>
imightbestupid12: Just to be clear: What do you expect RVM to do?
<imightbestupid12>
manage ruby versions?
<LyndsySimon>
imightbestupid12: I failed to set it up properly the first time I did it, and still don't understand the installer flags - but it works well once configured.
james1 is now known as jtperreault
Pumukel has joined #ruby
<LyndsySimon>
rvm also allows you to manage "gemsets", which is nice. (semi-)isolated environments for different projects.
<elomatreb>
Gemsets aren't really useful anymore, at least since Bundler came around
Rajamaa has joined #ruby
<elomatreb>
imightbestupid12: A good question to ask would be on what OS you are
<imightbestupid12>
ubuntu
not_underground has quit [Ping timeout: 264 seconds]
<the_drow>
How do I get the last element of a LazyEnumerator?
<the_drow>
It LazyEnumerator.#last doesn't exist
polishdub has joined #ruby
Pumukel has quit [Ping timeout: 244 seconds]
supergeek has joined #ruby
djbkd has quit [Ping timeout: 264 seconds]
tcrypt has quit [Ping timeout: 264 seconds]
supergeek has quit [Client Quit]
erlingur has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby
troulouliou_div2 has joined #ruby
bsrd has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
s2013 has joined #ruby
rikkipitt has joined #ruby
tcrypt has joined #ruby
dminuoso has joined #ruby
cidic has joined #ruby
Pumukel has joined #ruby
<cidic>
I am not a ruby dev. I have a repo of a small ruby project that has a single page. I just need the html/css/js of that rendered page
<cidic>
anyone willing to help me?
antgel has quit [Ping timeout: 264 seconds]
<elomatreb>
cidic: Do you want to scrape the page? I don't think I understand what you want to do
<cidic>
elomatreb: I just need the front end stuff for that page,
<cidic>
the rendered html/css/js
<elomatreb>
If it's a static page, you could just use your browser to save the page
antgel has joined #ruby
<cidic>
elomatreb: I don’t have a local ruby env setup to run the server
<elomatreb>
Most browsers have Ctrl+S to bound to save
jaguarmagenta has quit [Ping timeout: 264 seconds]
<elomatreb>
ah, ok. Is it a complex environment?
<cidic>
I don’t think so, I just don’t do ruby and didn’t want to have to figure out how to set it up on osx just to render this single page
mesamoo has quit [Quit: Konversation terminated!]
AlexRussia has joined #ruby
mesamoo has joined #ruby
alibby1 has joined #ruby
<elomatreb>
Installing Ruby isn't really that complex. Do you have Homebrew installed?
<cidic>
I have ruby I don’t have appache or whatever web server env you need for ruby
BTRE has quit [Ping timeout: 244 seconds]
BTRE has joined #ruby
<flying>
hi guys how can I run from shell the script directly?
<flying>
in bash I have for example : bash -c ...mycommands
<flying>
instead to create a ruby file and call them from GO I 'd like to put the ruby code directly in the pipeline
<flying>
with bash I done that using bash -c ......
<flying>
with ruby?
<elomatreb>
You can just pipe to ruby I think
<dminuoso>
Im really unclear what you are trying to do here.
bsrd has joined #ruby
<flying>
I need to use ruby code in a pipeline in GO
djbkd has quit [Ping timeout: 264 seconds]
<flying>
GOCD
Oclair_ has joined #ruby
mtkd has quit [Ping timeout: 244 seconds]
<dminuoso>
flying: Ah. ruby -e "stuff"
<flying>
oh :) thanks man
<flying>
let's try
tdy has quit [Ping timeout: 244 seconds]
tcrypt has quit [Ping timeout: 264 seconds]
Oclair has quit [Ping timeout: 276 seconds]
ta_ has quit [Remote host closed the connection]
zacstewart has quit [Ping timeout: 264 seconds]
mtkd has joined #ruby
rikkipitt has quit [Quit: Leaving...]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tcrypt has joined #ruby
BTRE has quit [Read error: Connection reset by peer]
jaruga___ has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd_ has quit [Ping timeout: 264 seconds]
jaruga____ has quit [Read error: Connection reset by peer]
shinnya has joined #ruby
djbkd has joined #ruby
<flying>
yes it works but I have an issue
<flying>
ruby -e TEST="test"; puts TEST
<flying>
doesn't work
<flying>
what's wrong?
BTRE has joined #ruby
Devalo has joined #ruby
<elomatreb>
flying: You probably have to quote your code. ruby -e 'TEST="test"; puts TEST'
<eam>
on the command line you're writing in two languages simultaneously: first shell, then perl
<eam>
er then ruby
<mikecmpbll>
:O
<eam>
innocent mistake I sweat
<eam>
swear
<eam>
man
<eam>
am I having a stroke?
tdy has joined #ruby
* mikecmpbll
chants ban ban ban
<flying>
from shell works from GO ruby is not interpreted
<elomatreb>
Ruby, Perl, Shell, what's the difference anyway
<eam>
just let me finish my coffee officer I'll be fine I swear
<mikecmpbll>
:D
<dminuoso>
eam: jealousy.
<dminuoso>
err elomatreb .
<elomatreb>
mh?
<flying>
ruby -e 'TEST="test"; puts TEST' it prints TEST="test"; puts TEST
<eam>
this series of mistakes is hilarious
<mikecmpbll>
everybody take a break.
<mikecmpbll>
flying : not on my shell.
m1911 has joined #ruby
Guest38 has joined #ruby
<eam>
flying: in go, you may be writing in either two or three languages depending on what go function you're invoking
theRoUS has joined #ruby
<flying>
[go] Start to execute task: <exec command="/usr/bin/ruby" >
<flying>
<arg>'puts 2+2'</arg>
<flying>
<arg>-e</arg>
<flying>
</exec>.
AlexJakeGreen has joined #ruby
<flying>
I'm using GOCD the continuos integration tool
<eam>
don't quote the puts 2+2 there
<eam>
those quotes are for the shell, which you don't seem to have in your GOCD example
<eam>
(a guess, because your structure has tokenized args)
<flying>
without quotes the same : <arg>puts 2+2</arg>
codelogix has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
symm- has quit [Ping timeout: 272 seconds]
<eam>
you'll have to consult your GOCD docs to figure out what command it is running, then
tyang has quit [Ping timeout: 264 seconds]
<eam>
probably an issue with that particular representation in that config
meatchicken has joined #ruby
<flying>
it's very basic config
chouhoulis has quit [Remote host closed the connection]
SteenJobs has quit [Quit: SteenJobs]
djbkd has quit [Ping timeout: 272 seconds]
<eam>
flying: yes, but it's not working and discovering what's wrong isn't a basic question -- because no one here knows this particular xml format or GOCD tool I suspect
chouhoulis has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
djbkd has joined #ruby
pawnbox has quit [Remote host closed the connection]
Cohedrin has joined #ruby
codelogix has quit [Ping timeout: 264 seconds]
Pumukel has quit [Ping timeout: 244 seconds]
exchgr has joined #ruby
nettoweb has joined #ruby
crameth has quit [Read error: Connection reset by peer]
bsrd has quit [Read error: Connection reset by peer]
<imightbestupid12>
i did try rbenv rehash before
<imightbestupid12>
it didn't fix anything
djbkd has joined #ruby
not_underground has joined #ruby
synthroid has joined #ruby
tcrypt has joined #ruby
<havenwood>
imightbestupid12: i guess go back through the rbenv installation instructions and make sure everything checks out. take a look at your $PATH and see if it's like rbenv wants it to be.
Ananthu has joined #ruby
eljimador has quit [Read error: Connection reset by peer]
tvw has quit [Remote host closed the connection]
synne has joined #ruby
not_underground has quit [Ping timeout: 264 seconds]
<havenwood>
imightbestupid12: If you tire of rbenv you can always make the final transformation of Ruby switchers and switch to chruby: https://github.com/postmodern/chruby#readme
eljimador has joined #ruby
the_drow has quit [Read error: Connection reset by peer]
Silthias has quit [Ping timeout: 272 seconds]
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
atmosx_ is now known as atmosx
rakm has joined #ruby
chris2 has joined #ruby
jaguarmagenta has joined #ruby
truenito has quit [Ping timeout: 276 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wldcordeiro has quit [Ping timeout: 276 seconds]
pwnd_nsfw` has joined #ruby
Cohedrin has joined #ruby
the_drow has joined #ruby
hahuang62 has joined #ruby
tyang has quit [Ping timeout: 264 seconds]
elifoster has joined #ruby
tyang has joined #ruby
jaguarmagenta has quit [Ping timeout: 264 seconds]
jcao219 has quit [Ping timeout: 264 seconds]
pwnd_nsfw has quit [Ping timeout: 272 seconds]
weaksauce has joined #ruby
Guest76436 has joined #ruby
banisterfiend has joined #ruby
hutch34 has joined #ruby
<Guest76436>
Hello ! I would like to know an idiomatic way to add a quantity to a value in a hash if the key already exists or set the value to the quantity for an unexisting key?
<imightbestupid12>
when i tried installing chruby i got command not found
the_drow has quit [Read error: Connection reset by peer]
<imightbestupid12>
smoking weed
<imightbestupid12>
?
<imightbestupid12>
sorry wrong tab
rakm has joined #ruby
miqlas-H is now known as Haiku_communist
<ineb>
lese ich spter
<ineb>
fc.
<ineb>
wrong channel
Haiku_communist is now known as miqlas-H
the_drow_ has quit [Read error: Connection reset by peer]
the_drow has joined #ruby
blackmes1 has quit [Ping timeout: 244 seconds]
ramfjord has joined #ruby
imightbestupid12 has quit [Ping timeout: 240 seconds]
a7d7p has joined #ruby
phaza has quit [Ping timeout: 244 seconds]
ta_ has quit [Remote host closed the connection]
rcvalle has joined #ruby
tdy1 has quit [Ping timeout: 264 seconds]
chadwtaylor has joined #ruby
phaza has joined #ruby
JeanCarloMachado has joined #ruby
phaza has quit [Remote host closed the connection]
phaza has joined #ruby
Ropeney has joined #ruby
s2013 has quit [Ping timeout: 244 seconds]
getxsick has joined #ruby
the_drow_ has joined #ruby
yuung has joined #ruby
the_drow has quit [Disconnected by services]
tcrypt has quit [Ping timeout: 264 seconds]
<yuung>
how can i specify gem install flags in my Gemfile? i need the equivalent of `gem install thrift -- --with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\"`. is it even possible?
<yuung>
getxsick, why is :mode an attr_reader but you have def mode=?
Immune has joined #ruby
<yuung>
havenwood i believe that was meant for getxsick? ;)
<havenwood>
yuung: i'm all sorts of confused - sorry about that
<yuung>
np
<getxsick>
havenwood: sure, i just didn't have time to configure my VIm for Ruby
marxarelli has joined #ruby
<getxsick>
yuung: why not? i get getter from the attr_reader, and add setter via mode=
<yuung>
getxsick use attr_accessor
Golden_ has joined #ruby
tvw has joined #ruby
<getxsick>
yuung: for what reason? to override it in next line?
<getxsick>
anyway, any tests regarding @mode works fine, i just have a problem with @last
the_drow has quit [Read error: Connection reset by peer]
<yuung>
getxsick attr_accessor gives you getters and setters, also mode= is not ebeing called when you do @mode =
<getxsick>
when i add @last=0 in initialize() then the test pass but i don't know what prevents to fail without this line
<getxsick>
yuung: ah, so it's not being called...here we got the answer
<getxsick>
why? how to call it inside a class?
saneax is now known as saneax-_-|AFK
_rubik has joined #ruby
<yuung>
getxsick, the problem begins with setting two values in one setter method
<_rubik>
Hey guys, quick question. I
pragmaticus has joined #ruby
[Butch] has joined #ruby
the_drow has joined #ruby
<_rubik>
I'm 1 hour into Ruby, how would I concatinate a vector and a string when printing
<getxsick>
yuung: why? this is just a method and this is a reason to have a setter instead of public attributes
<getxsick>
so i don't thing attr_accessor is needed as i want to have my own version of setter
claudiuinberlin has joined #ruby
<yuung>
getxsick i know - you shouldnt have your own version of a setter, rather write a different method that does what you want to do and leave setters to doing one thing for one variable
Snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has joined #ruby
ldnunes has quit [Client Quit]
<havenwood>
getxsick: kinda weird to talk about "better choice" in the abstract like that... is green a better choice than blue? what are you talking about?
Dimik has joined #ruby
<apeiros>
getxsick: you can. you just do it wrong.
Pumukel has quit []
<getxsick>
apeiros: any hints then?
<havenwood>
getxsick: you should probably not pay much attention to your own impressions until you've learned the languages in question
bluOxigen has quit [Ping timeout: 244 seconds]
Puffball has quit [Remote host closed the connection]
<apeiros>
`assert_raises StandardError { f }` is `assert_raises(StandardError { f })`
<apeiros>
i.e. the block binds to StandardError
<apeiros>
(and I somehow crashed my chat client)
pokalyis has joined #ruby
<getxsick>
havenwood: i simply just see to much Perl here and it means there is no "there is only one way to do it" rule which is a costs consuming in maintainance and bug fixing as the code is not as readable as the Python
askhat has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Yonk has quit [Ping timeout: 272 seconds]
Yonk has joined #ruby
<puppet699>
Hi all, can someone help? https://github.com/theforeman/foreman/blob/develop/app/models/host/managed.rb#L416 I know 0 about ruby but i managed to find out this line is outputting some parameters that are being outputted as strings such as 'true' or 'false', i want to make some quick and dirty change to substitute those with true or false (basicall without the quotes) so that they are parsed as booleans, i tried gsub but gives me an
VeryBewitching has quit [Quit: Konversation terminated!]
beauby has joined #ruby
znz_jp has quit [Ping timeout: 272 seconds]
cdg has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxx has joined #ruby
workmad3 has joined #ruby
znz_jp has joined #ruby
tcrypt has quit [Ping timeout: 264 seconds]
Lumio has quit [Quit: ...]
Gasher has joined #ruby
moshee has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
marxarelli|afk is now known as marxarelli
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
synthroid has quit []
Nahra has quit [Remote host closed the connection]
Nahra has joined #ruby
tcrypt has joined #ruby
Guest76436 has quit [Remote host closed the connection]
<getxsick>
i thought i can tight it with the ?: operator
<baweaver>
no
<baweaver>
operands.none?
<getxsick>
btw. why shall i use || instead of or in condition statements?
<baweaver>
operands.none? { |op| op < 0 || !op.is_a?(Integer) }
a7d7p has joined #ruby
<baweaver>
different precedence
<havenwood>
getxsick: in modern Ruby you can use 1.negative? as well
<havenwood>
getxsick: `or` is for flow control
<puppet699>
Hi all, can someone help? https://github.com/theforeman/foreman/blob/develop/app/models/host/managed.rb#L416 I know 0 about ruby but i managed to find out this line is outputting some parameters that are being outputted as strings such as 'true' or 'false', i want to make some quick and dirty change to substitute those with true or false (basicall without the quotes) so that they are parsed as booleans, i tried gsub but gives me an
<matthewd>
.all? seems likely to read better IMO
<dminuoso>
getxsick: keyword_or and keyword_and have different precendence - these precedence rules match control flow semantics
danmcguire has quit [Ping timeout: 252 seconds]
<dminuoso>
getxsick: so they are en-par with things like "if" or "unless"
bsrd has joined #ruby
<dminuoso>
getxsick: (they do the same though, but they usually require you to use unnecessary parens when used for non-control flow)
<dminuoso>
likewise trying to use && for control flow will also require you to use unnecessary parens.
tcrypt has quit [Ping timeout: 264 seconds]
Ropeney has quit [Remote host closed the connection]
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dminuoso>
ISO 31-11
spectra has joined #ruby
<dminuoso>
havenwood: luckily we have an international body defining standards and such
johnmccabe has joined #ruby
<dminuoso>
Which is probably not well accepted in the USA, but well accepted in 95% of the other population on the planet.
aries_liuxueyang has joined #ruby
ixti has quit [Quit: WeeChat 1.5]
<dminuoso>
getxsick: I think is_a?(Integer) is the better choice, because .integer? will just NoMethodError for strange things that dont have that method.
compro has quit [Ping timeout: 272 seconds]
<getxsick>
dminuoso: hmmm this actually pretty nice argument
<havenwood>
on the other hand, it's defined on Numeric
<havenwood>
are non-Numeric things in the list?
Guest54 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
We are so bike shedding this.
<havenwood>
green with pink trim!
<getxsick>
ok, time for bed. thx for your time guys
<dminuoso>
20 minutes of #ruby professionalism at its best. :-)
getxsick has quit [Quit: leaving]
beauby has joined #ruby
johnmccabe has quit [Ping timeout: 264 seconds]
stamina has quit [Ping timeout: 264 seconds]
not_underground has joined #ruby
Zamyatin has joined #ruby
Ananthu has quit [Quit: Connection closed for inactivity]
tcrypt has quit [Ping timeout: 264 seconds]
eljimador has quit [Ping timeout: 244 seconds]
eljimmy has quit [Ping timeout: 276 seconds]
not_underground has quit [Ping timeout: 272 seconds]
jhack has joined #ruby
cpfeilschifter[m has joined #ruby
last_staff has quit [Quit: last_staff]
matp_ has joined #ruby
bsrd has quit [Quit: WeeChat 1.5]
Gasher has quit [Quit: Leaving]
jcao219 has joined #ruby
mtkd has quit [Ping timeout: 244 seconds]
a7d7p has quit [Read error: Connection reset by peer]
a7d7p has joined #ruby
eljimmy has joined #ruby
Puffball has joined #ruby
matp has quit [Ping timeout: 244 seconds]
JeanCarloMachado has quit [Ping timeout: 272 seconds]
matp_ is now known as matp
tcrypt has joined #ruby
fladson[m] has joined #ruby
mtkd has joined #ruby
elifoster has quit [Quit: food and class]
ldnunes has quit [Quit: Leaving]
danmcguire has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
griff has joined #ruby
_rubik has quit [Ping timeout: 272 seconds]
jackjackdripper has joined #ruby
johnmccabe has joined #ruby
johnmccabe has quit [Client Quit]
dminuoso has quit [Ping timeout: 272 seconds]
jaguarmagenta has joined #ruby
_sfiguser has quit [Ping timeout: 272 seconds]
<veloutin>
Is there a way to make something like this work? "%{foo} %{bar}" % Hash.new{|h, key| key}
<veloutin>
I want to be able to handle missing format keys
chadwtaylor has quit [Remote host closed the connection]
ndrst has joined #ruby
ndrst is now known as Guest66898
Devalo has quit [Ping timeout: 244 seconds]
codelogix has quit [Ping timeout: 244 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rakm has joined #ruby
failshell has joined #ruby
cyphase has quit [Ping timeout: 240 seconds]
Puffball has joined #ruby
Puffball_ has quit [Ping timeout: 272 seconds]
yuung_ has joined #ruby
yuung has quit [Read error: Connection reset by peer]
sdothum has joined #ruby
codelogix has joined #ruby
failshell has quit [Ping timeout: 244 seconds]
abernstein has joined #ruby
cyphase has joined #ruby
shum has quit [Ping timeout: 244 seconds]
<abernstein>
I’m trying to use ruby for the first time, getting “ERROR: While executing gem ... (Errno::EINVAL) Invalid argument” when i try to “gem install” anything
<abernstein>
baweaver: nothing relevant, i don’t think
<abernstein>
Warning: Putting non-prefixed coreutils in your path can cause gmp builds to fail.
<abernstein>
Warning: You have unlinked kegs in your Cellar
<abernstein>
(numpy)
<baweaver>
Hm.
Devalo has quit [Ping timeout: 244 seconds]
<baweaver>
and you did the source steps?
<zotherstupidguy>
squidbits i'm not sure but they do share the same name and domain area; and shoes was nver completed as far as i can remmber, _why dissappeared!
<baweaver>
what shell are you using?
<_sfiguser>
darix, i need full screen web apps
<_sfiguser>
then
<squidbits>
zotherstupidguy: Yeah, I got super excited about shoes, but it never really worked. Good to see someone working on a fork, I'll check that out.
<baweaver>
abernstein: what does chruby return?
ixti has joined #ruby
<abernstein>
I did the source steps, and then also tried the changes in the latest comment on that post
<abernstein>
using bash
<abernstein>
ruby-2.3.1
symm- has quit [Ping timeout: 244 seconds]
<baweaver>
and ruby -v still doesn't work
zrts has joined #ruby
<abernstein>
ruby -v is now showing 2.0.0p648
NTrash_ has quit [Quit: Konversation terminated!]
failshell has quit [Ping timeout: 244 seconds]
<abernstein>
“which ruby" still /usr/bin/ruby
NTrash has joined #ruby
<baweaver>
and you put the lines in .bashrc?
<havenwood>
abernstein: there should be a `*` in front of `ruby-2.3.1` if you've selected it - try: chruby 2.3
<baweaver>
and sourced it with: . ~/.bashrc
zrts has left #ruby [#ruby]
Jakey3 has joined #ruby
<abernstein>
havenwood that seems to have done the trick
jcomito has quit [Ping timeout: 264 seconds]
tcrypt has joined #ruby
marxarelli is now known as marxarelli|afk
<meatchicken>
Is there a difference between module A; class B; end; end; and class A::B; end;
<matthewd>
meatchicken: A couple, yes
<meatchicken>
alright
<meatchicken>
thanks
<matthewd>
meatchicken: Most obviously, if A isn't defined yet, one will create it, and the other will give you an error
<matthewd>
meatchicken: But also if you reference C inside the class, in one case it will look for A::B::C, A::C, ::C in order; in the other, only A::B::C, ::C
<abernstein>
thanks baweaver havenwood
despai has quit [Quit: This computer has gone to sleep]
JeanCarloMachado has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
GodFather has joined #ruby
whathappens has joined #ruby
Rajamaa has quit [Quit: Konversation terminated!]
symm- has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
chadwtaylor has quit [Ping timeout: 264 seconds]
chadwtaylor has joined #ruby
not_underground has joined #ruby
hutch34 has quit [Ping timeout: 272 seconds]
not_underground has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
pwnd_nsfw` has joined #ruby
johnmccabe has joined #ruby
chadwtaylor has quit []
pwnd_nsfw has quit [Ping timeout: 272 seconds]
abernstein has quit [Ping timeout: 264 seconds]
marxarelli|afk is now known as marxarelli
RegulationD has joined #ruby
hashrocket has quit [Quit: Connection closed for inactivity]
whathappens has quit [Read error: Connection reset by peer]
saneax-_-|AFK is now known as saneax
tcrypt has quit [Ping timeout: 272 seconds]
whathappens has joined #ruby
yfeldblum has joined #ruby
jaguarmagenta has joined #ruby
RegulationD has quit [Ping timeout: 264 seconds]
AndrewIsHere has quit []
yfeldblum has quit [Remote host closed the connection]