<siaw>
hy those — and +++ and @@-1 +1@@. what do they mean?
<ponga>
la la la
bronson has joined #ruby
th3m4ri0 has quit [Ping timeout: 256 seconds]
MartynKeigher has joined #ruby
<wallerdev>
those are part of a diff
<wallerdev>
oh nvm i didnt look
lampd1 has joined #ruby
<wallerdev>
lol
StevenNunez has joined #ruby
th3m4ri0_ has joined #ruby
Sawbones_ has quit [Remote host closed the connection]
th3m4ri0_ has quit [Client Quit]
constantlurking has quit [Ping timeout: 246 seconds]
fivetwentysix has quit [Quit: fivetwentysix]
<wallerdev>
or maybe it is a weird diff format
<wallerdev>
not sure
brlkid has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
<wallerdev>
like its saying the line starting with the minus is the expected, and the line starting with the + was the actual result, and you had one line of each so -1 and +1
<wallerdev>
just a random guess
Aswebb_ has quit []
x77686d has quit [Quit: x77686d]
hasrb has joined #ruby
x77686d has joined #ruby
charliesome has joined #ruby
unreal has joined #ruby
radic has quit [Ping timeout: 245 seconds]
<siaw>
wallerdev: hmmmm ok. i don’t really know that’s why i’m here :)
nateberkopec has joined #ruby
davedev24_ has joined #ruby
ponga has quit [Remote host closed the connection]
radic has joined #ruby
ponga has joined #ruby
AlSquirrel has quit [Quit: This computer has gone to sleep]
davedev2_ has quit [Ping timeout: 256 seconds]
mikecmpbll has quit [Quit: ciao.]
StevenNunez has quit [Quit: Leaving...]
ItSANgo has quit [Quit: Leaving...]
mjuszczak has quit []
lampd1_ has joined #ruby
checkit has quit [Ping timeout: 264 seconds]
lampd1 has quit [Ping timeout: 265 seconds]
vdamewood has joined #ruby
jkline has quit [Quit: jkline]
jherbst has joined #ruby
ponga has quit [Ping timeout: 240 seconds]
gtrak has quit [Ping timeout: 245 seconds]
pwnz0r has joined #ruby
davedev2_ has joined #ruby
kbarry has quit [Ping timeout: 256 seconds]
gregf_ has quit [Ping timeout: 255 seconds]
davedev24_ has quit [Ping timeout: 264 seconds]
ItSANgo has joined #ruby
uptownhr has quit [Quit: uptownhr]
rbennacer has joined #ruby
x77686d has quit [Quit: x77686d]
vdamewood has quit [Quit: Computer has gone to sleep.]
pwnz0r has quit [Ping timeout: 256 seconds]
hmsimha has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
pdoherty has joined #ruby
jkline has joined #ruby
thumpba has joined #ruby
uptownhr has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jaequery>
i dont know which one im supposed to use
<bradland>
which one what? argument to BigDecimal#to_s?
<jaequery>
there is 'engineering notation', 'conventional floating poitn'
<jaequery>
isn't floats something i want to avoid?
zarubin_ has joined #ruby
devdazed has joined #ruby
<bradland>
Float is a datatype
<bradland>
floating point notation is when you write a number like 0.0005
maximski has joined #ruby
ghr has joined #ruby
kiyote23 has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
<bradland>
so, when you’re dealing with numbers, the datatype you use internally should represent the full precision of the number required for your calculations
<jaequery>
so they have, .to_s('5F'), .to_s('+8F'), .to_s('F')
<jaequery>
i just dealing with currency
<jaequery>
which one is right one for this case?
<jaequery>
USD btw
zz_Mongey is now known as Mongey
<bradland>
that’s called a format string
<bradland>
it tells to_s how you want the number formated
<bradland>
how many decimal places do you want?
Joufflu has joined #ruby
blackgoat has quit [Quit: restart]
mjuszczak has quit []
<jaequery>
2
<bradland>
.to_s(‘F’) should do what you want
<jaequery>
that gives me , for 150.50, it returns 150.5
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
<bradland>
you can use BigDecimal.truncate(n) to truncate the decimal places
charliesome has quit [Quit: zzz]
<bradland>
if you end up with large fractional numbers
<jaequery>
but are you sure i should convert to float? im reading thats dangerous
bashusr has quit [Read error: Connection reset by peer]
zarubin_ has quit [Ping timeout: 256 seconds]
<bradland>
you’re not converting to float
<bradland>
to_s returns a string
mjuszczak has joined #ruby
<bradland>
you’re missing something fundamental here
<bradland>
>> BigDecimal.new(“150.5”)
kiyote23 has quit [Ping timeout: 245 seconds]
ghr has quit [Ping timeout: 264 seconds]
<bradland>
do you understand what types are?
blackgoat has joined #ruby
<bradland>
so, say you have a variable, and you store a BigDecimal value in it
<bradland>
my_number = BigDecimal.new(“150.5”)
bashusr has joined #ruby
anaeem1 has joined #ruby
<bradland>
my_number is of the class BigDecimal
<jaequery>
yea i know
<bradland>
ok, so when you call my_number.to_s(‘F’), what happens?
<bradland>
my_number doesn’t change
<jaequery>
so if i want all the instances of BigDecimal in my json hash to be of string, wht's the best way to do this? is there a built-in method or do i need to iterate recursively on my own?
mjuszczak has quit [Client Quit]
Mongey is now known as zz_Mongey
<bradland>
you don’t understand what’s happening
mjuszczak has joined #ruby
centrx has quit [Ping timeout: 240 seconds]
mjuszczak has quit [Max SendQ exceeded]
<bradland>
i can’t take you any further, becase you’re stuck on the idea that my_number is changing when you call to_s on it
<bradland>
and you’re worried about floats
Channel6 has joined #ruby
<bradland>
that means you don’t understand what happens when you call to_s
<jaequery>
i never said that
<jaequery>
i know what you are saying
<bradland>
>> require 'bigdecimal';a = BigDecimal.new("150.5");p a.to_s(‘F’);p a
mjuszczak has joined #ruby
<jaequery>
...
<bradland>
well, eval isn’t working
<jaequery>
dont worry i know what you mean , yea to_s or to_i etc dont do in-line replacements , i knew that a long time ago
Musashi007 has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
bashusr has joined #ruby
<jaequery>
i mjust saying i have a ruby hash, that converted to json hash, but i want all BigDecimals to be a string format, trying to see whats the most optimized / efficient way to do this
scripore has quit [Quit: Leaving]
bashusr has quit [Changing host]
bashusr has joined #ruby
<jaequery>
do i need to createa my own method that iterates each node one at a time? or is there some, ruby/rails conversion method to accomodate?
adriancb has joined #ruby
<bradland>
i don’ t think there’s a rails method for this particular task
<bradland>
i think you’re going to have to iterate the hash and convert them
<jaequery>
for a task this common, im a little surprised, as if im the only one dealing with currency store or something
<bradland>
i’m looking at some code in our codebase
Hijiri has joined #ruby
<jaequery>
id have expected if anything, JSON.generate would perform this behaviour for me
<jaequery>
but it doesnt
<jaequery>
perhas im missing a flag or something?
<bradland>
looks like there is something in Rails 4
gsd has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Spami has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
pdoherty has joined #ruby
<centrx>
porfa, Do you think it is impossible?
bashusr has quit [Read error: Connection reset by peer]
zz_Mongey is now known as Mongey
davasaurous has joined #ruby
<porfa>
haha nothing is impossible! port9999 was just an eexample
bashusr has joined #ruby
<porfa>
but i alredy found anotherway around what i needed, i’ll just route the ports or something, this app is for inside the corp only, not outsite! it’s done :p
bashusr has quit [Read error: Connection reset by peer]
bashusr has joined #ruby
bashusr has quit [Changing host]
bashusr has joined #ruby
centrx has quit [Quit: Science is organized knowledge, wisdom is organized life.]
Megtastique has joined #ruby
pdoherty has quit [Ping timeout: 264 seconds]
bluOxigen has joined #ruby
ghr has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
astrobun_ has joined #ruby
lxsameer has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
jaequery has quit [Max SendQ exceeded]
jaequery has joined #ruby
bashusr has joined #ruby
ghr has quit [Ping timeout: 240 seconds]
kiyote23 has joined #ruby
crdpink2 has quit [Quit: q term]
crdpink2 has joined #ruby
vdamewood has quit [Read error: Connection reset by peer]
crdpink2 has quit [Client Quit]
crdpink has joined #ruby
tectonic has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
<AlexRussia>
I'd update ruby, how to I can install all gems from old version to new?
adriancb has quit [Remote host closed the connection]
bashusr has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
shellfu_afk has quit [Ping timeout: 245 seconds]
sigurding has joined #ruby
Xiti` has quit [Quit: Xiti`]
oo_ has quit [Remote host closed the connection]
bashusr has joined #ruby
Xiti has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
bashusr has joined #ruby
bashusr has quit [Changing host]
bashusr has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
Xiti has quit [Client Quit]
nanoyak has joined #ruby
Xiti has joined #ruby
jordanm has quit [Ping timeout: 256 seconds]
devoldmx has quit [Remote host closed the connection]
maestrojed has joined #ruby
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nanoyak has quit [Client Quit]
jordanm has joined #ruby
jordanm has quit [Changing host]
jordanm has joined #ruby
shellfu_afk has joined #ruby
MartynKeigher has quit [Quit: Leaving]
bashusr has quit [Read error: Connection reset by peer]
bashusr has joined #ruby
bashusr has quit [Changing host]
bashusr has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
bashusr has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
<shevy>
though I think it was not encouraged to do so while live-iterating
<jaequery>
but this gets hard when i am doing recursive nested hash
<shevy>
jaequery you could always write a method and call that to modify your hash
jenrzzz has joined #ruby
arrubin has quit [Quit: Connection closed for inactivity]
nanoyak has quit [Quit: Computer has gone to sleep.]
<shevy>
then in your method you can concern it with the update part; and in your .each part you can simply focus on getting the key you wish to modify
lmickh has quit [Remote host closed the connection]
agrinb has joined #ruby
bronson has joined #ruby
Dopagod has quit [Remote host closed the connection]
tesuji has joined #ruby
n008f4g_ has joined #ruby
<apeiros>
epitron: I don't think I'd consider this a fix ;-)
noop has quit [Ping timeout: 244 seconds]
<epitron>
what's wrong now, your highness?
anarang has quit [Ping timeout: 264 seconds]
bashusr has joined #ruby
<porfa>
can anyone help me out on scrapping the link that belongs to the image of the lady in a chair? www.pouparbem.com/apex/f?p=210:1 ( the url is funky for those who are not familiar with APEX websites) the selecter i have is “imgOferta” but i don’t know how to grab links from href’s or how to select hrefs.. only text’s at the moment...
<porfa>
i don’t know how to use css selectors to ask to an href :(
<porfa>
my scraping has been based on text only
RandyT has quit [Ping timeout: 245 seconds]
shellfu_afk has quit [Ping timeout: 244 seconds]
livathinos has joined #ruby
<TomyWork>
the clean way would be to ask for an API
ghr has quit [Ping timeout: 265 seconds]
Pharaoh2 has joined #ruby
bashusr has joined #ruby
RandyT has joined #ruby
adriancb has joined #ruby
defrang has joined #ruby
ponga has quit [Quit: Leaving...]
<jaequery>
hm, hash_map_values dont seem to do recursive ?
rbrs has quit [Remote host closed the connection]
oo_ has joined #ruby
<apeiros>
jaequery: no, it does not. and that's good.
adriancb has quit [Ping timeout: 255 seconds]
<jaequery>
damn its just that i have a deep nested hash
lampd1_ has joined #ruby
swistak35 has quit [Ping timeout: 240 seconds]
TheNumb has quit [Ping timeout: 264 seconds]
<jaequery>
and im returning it back in JSON, but all the BigDecimals comes back out as strange notation
<jaequery>
im just using JSON.generate
<jaequery>
is there some other JSON generator that auto converts BigDecimals to it's correct readable format?
nanoyak has joined #ruby
<jaequery>
feels like it's a bug in JSON module
lampd1 has quit [Ping timeout: 244 seconds]
<avril14th>
jaequery: now it's a print
<jaequery>
huh?
<avril14th>
if you want to read it, or return float, just do .to_f on them
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 244 seconds]
Soda has joined #ruby
<jaequery>
yea but i have a big json multi-level hash
<jaequery>
i dont wanna go in and individually update the value
nanoyak has quit [Client Quit]
wolf4ood has quit [Quit: (null)]
kl__ has joined #ruby
<jaequery>
its amazing to me that when BigDecimal goes through JSON.generate, the values are retained as BigDecimal as "scientific notation string" in the JSON output
<apeiros>
jaequery: it's not so difficult to write a recursive method yourself
pwnz0r has joined #ruby
einarj has joined #ruby
<apeiros>
jaequery: it's only amazing to you because you don't understand the ramifications
einarj has quit [Remote host closed the connection]
<jaequery>
i tried but i could not figure out how to do inline replacement within the loop
<avril14th>
jaequery: or much better, try to figure out what JSON.generate calls on bigdecimal to print its value and override the method just before printing
einarj has joined #ruby
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
jaequery: bigdecimals are use to retain precision. json floats lose that. so it's generally a bad idea to perform that conversion.
Pharaoh2 has joined #ruby
<jaequery>
its fine inside a hash
<jaequery>
but when it's inside a json output?
LouisRoR has quit [Ping timeout: 245 seconds]
<jaequery>
plus, it is converted to 'string' at that point, as '1ef2323'
<jaequery>
which is useless at the receiver's end
<avril14th>
:)
<apeiros>
jaequery: oh dear
<apeiros>
jaequery: read what I wrote above.
<apeiros>
json floats lose precision. which is pointless at the receiver's end.
<apeiros>
and json offers no other datatype.
<apeiros>
so please, stop bickering about things you don't understand, without at least *trying* to understand the reasons.
<jaequery>
yea i read through that many times
<jaequery>
i been googling all day
<jaequery>
lol
<jaequery>
but i dont know what else to do, all i wanna do is return back total_amount and other currency values back to the user
<apeiros>
seriously, I hate that attitude. "Oh it doesn't do what I expected it to do. Let me complain about it without even *bothering* to understand why it does what it does."
kl__ has quit [Ping timeout: 264 seconds]
bashusr has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
<pwnz0r>
hey guys, ive been working on a very simple problem, and cant seem to figure out why im getting it wrong. any help would be great. refer to the gist to see the problem. https://gist.github.com/mbaptist23/ca49cd40abc227e8a101
arup_r_ has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 255 seconds]
<DefV>
Why not just use Array#index
<DefV>
?
<sevenseacat>
like what is that trying to do
kl__ has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
Xeago has joined #ruby
<pwnz0r>
im using a hash becuase the array may be very large in size
lolmaus has joined #ruby
<pwnz0r>
hashes use order 1 lookup
<pwnz0r>
arrays use order n
<pwnz0r>
im trying to return the index of the value in an array
<DefV>
wow
<DefV>
already micro-optimizing :-)
crdpink has quit [Excess Flood]
<pwnz0r>
just having fun with ruby :P
<pwnz0r>
but failing haha
<DefV>
pwnz0r: I'm sure looping the array is already order n
crdpink has joined #ruby
<sevenseacat>
step 1 of having fun with ruby is writing readable code
<DefV>
so array.index will be faster
<pwnz0r>
o ic when i convert the array to a dict you mean
Morkel has quit [Quit: Morkel]
bashusr has quit [Read error: Connection reset by peer]
<pwnz0r>
good point
Pharaoh2 has joined #ruby
<sevenseacat>
ruby doesnt have "dict"s
x77686d has quit [Quit: x77686d]
<pwnz0r>
the hash excuse me
<pwnz0r>
it seems the problem is with indexing in anyhow. if i index in with the literal "4" i get the correct value, but if i use array[0] which contains "4", i get nil
unshadow has joined #ruby
<pwnz0r>
is there a reason this might happen that i am over looking]
<DefV>
array[0] is probably "4\n", no?
jheg has joined #ruby
<DefV>
do a "p array[0]"
<DefV>
it'll show that
<pwnz0r>
ya it mus tbe
<pwnz0r>
i need to strip off the newline from ARGF it seems
<DefV>
String#chomp 'll do that for you
<sevenseacat>
must be, without trying it
<pwnz0r>
lol im about to try
jheg has quit [Client Quit]
<pwnz0r>
ya works like a charm
<pwnz0r>
it did have a newline
<pwnz0r>
thanks for the help
emmesswhy has quit [Quit: This computer has gone to sleep]
bashusr has joined #ruby
chthon has joined #ruby
sondr3 has joined #ruby
roolo has joined #ruby
<DefV>
pwnz0r: but in the future, try to write more coder-friendly code
<pwnz0r>
like dont chain functions like that?
grn has joined #ruby
<DefV>
you can chain functions but yours is just an unreadable mess :-)
<pwnz0r>
i see what you mean. its not too bad, but ill make it more self documentiing
<DefV>
also, never, ever, call a variable "array"
mikecmpbll has joined #ruby
<grn>
I need to check whether a particular method on a module was called in a test. How can I accomplish that? Let's say that I'm interested in a call like Email.send.
<sevenseacat>
yes, it is too bad
<grn>
I want to accomplish that in minitest, without rr, mocha, rspec, etc.
olivier_bK has joined #ruby
ghr has joined #ruby
Photism has quit [Quit: Leaving]
Xeago has quit [Remote host closed the connection]
jheg has joined #ruby
joshbamboo2 has joined #ruby
<grn>
I tried to redefine the method in a test case by opening the module but I don't know how to record the arguments it received because I cannot access variables in the outside scope.
<apeiros>
grn: well, then you reinvent mocking. the basic way is: in setup: backup = Email.method(:send); def Email.send(*); …record the call…; end -- and in teardown you undo the redef
<apeiros>
see how mocha/rr do it? could use define_method and the captured context.
<pwnz0r>
DefV: right that makes sense it might clash with the array class. thanks for the tips
joonty has joined #ruby
joshbamboo1 has quit [Ping timeout: 256 seconds]
<grn>
apeiros: I realise that but I don't want to pull in dependencies. I've been using rr but it's no longer maintained. I'll take a look at mocha. Thanks!
elfuego has joined #ruby
AFKGeek has joined #ruby
pdoherty has joined #ruby
CustosL1men has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
sevenseacat has quit [Remote host closed the connection]
<DefV>
pwnz0r: it's not that it clashes with the array class, it's the issue that "array" is non-descriptive of the contents of said array
<DefV>
arguments would be a better name
pdoherty has quit [Ping timeout: 256 seconds]
AlSquire has joined #ruby
<pwnz0r>
ya i changed it to inputs.
_5kg has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
bashusr has quit [Read error: Connection reset by peer]
<pwnz0r>
its guess the thing about ruby is that it makes it easy to smash stuff onto one line, which is not a best practive. its not about lines of code its about readability si what the message im getting is. and i agree with you guys
bluenemo has joined #ruby
devoldmx has joined #ruby
<pwnz0r>
i guess*
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pharaoh2 has joined #ruby
ndrei has joined #ruby
elfuego has quit [Quit: elfuego]
wpp has quit [Read error: Connection reset by peer]
francisfish has joined #ruby
arup_r has joined #ruby
Xeago has quit [Remote host closed the connection]
kyb3r_ has quit [Read error: Connection reset by peer]
lampd1_ has quit []
devoldmx has quit [Ping timeout: 252 seconds]
hmsimha has joined #ruby
bashusr has joined #ruby
jlebrech has joined #ruby
<jlebrech>
is there a gem to detect the platform used in an archive?
bluOxigen has quit []
grn has quit []
Pupeno_ has quit [Remote host closed the connection]
<jlebrech>
well heroku do it when you push, so thought someone might have done the same
<apeiros>
jlebrech: github has something open sourced which detects the language of a project
<apeiros>
not sure how the called it. linguist I believe?
<jlebrech>
apeiros: thanks i'll have a look
marr has joined #ruby
dc_ has quit [Remote host closed the connection]
<mikecmpbll>
not sure how an archive has anything to do with a programming language
antgel has quit [Ping timeout: 240 seconds]
<mikecmpbll>
you've confused me ;)
<jlebrech>
mikecmpbll: don't worry i was adding two functions togather
<apeiros>
mikecmpbll: code tarball e.g.
<apeiros>
but yes, I found his description quite vague too
last_staff has joined #ruby
<mikecmpbll>
oh, literally a project in an archive
<mikecmpbll>
gotcha.
antgel has joined #ruby
ferr has joined #ruby
<mikecmpbll>
so, i've noticed some devs use format strings for interpolation more often than regular string interpolation, any reason for this or just style preference?
<mikecmpbll>
i.e. "some %s with %s." % ["string", "interpolation"]
<apeiros>
with the given example I find interpolation better
<apeiros>
but e.g. with `Template = "A very loooooong string template"` + `Template % variables` I like sprintf style as it makes code shorter and more readable.
<mikecmpbll>
it's a good script anyways, i just linked as practical example of the format strings
<mikecmpbll>
don't see owt else wrong with it particularly.
sondr3 has quit [Quit: Ich bin ein sleep.]
dionysus69 has quit [Ping timeout: 264 seconds]
troulouliou_dev has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
Pharaoh2 has quit [Ping timeout: 245 seconds]
rbrs has joined #ruby
<ddv>
using double quotes when not needed, multiple puts statements
agrinb has joined #ruby
<mikecmpbll>
i don't consider either of those problems, but mmk :)
nrcpts has quit [Quit: (null)]
mfaeh has joined #ruby
Pharaoh2 has joined #ruby
psy_ has quit [Read error: No route to host]
dseitz has joined #ruby
<ddv>
mikecmpbll: if !verify should be unless, using lambda { totally not needed there
arup_r_ has joined #ruby
agrinb has quit [Ping timeout: 264 seconds]
<mikecmpbll>
ddv: how is lambda unnecessary?
last_staff has quit [Quit: last_staff]
<mikecmpbll>
and there's semantic arguments for if !something, in this case i think either works linguistically.
arup_r has quit [Ping timeout: 265 seconds]
<elaptics>
I must be missing something, what's the issue with double quotes? Where aren't they needed?
<mikecmpbll>
elaptics: i guess what he's saying is that if you can use a single quote, you should?
mengu__ has quit [Remote host closed the connection]
<elaptics>
I'd argue that you shouldn't use single quotes, only doubles
wolf4ood has joined #ruby
shime has quit [Ping timeout: 245 seconds]
psy_ has joined #ruby
dionysus69 has joined #ruby
conniemj_ has joined #ruby
<ddv>
line 63, 65
<ddv>
elaptics: only use double quotes when you need to do interpolation or when you need to escape single quoets
last_staff has joined #ruby
<elaptics>
ddv: why? why not just always use double quotes then when you later decide you need to interpolate you're not having to change the quote marks to suit. Less incidental change in your vcs diffs
<mikecmpbll>
+1
_5kg has joined #ruby
<ddv>
I dissagree
<elaptics>
we can agree to disagree, but I'm interested in knowing why you disagree
conniemj_ has quit [Ping timeout: 245 seconds]
hmsimha has quit [Ping timeout: 252 seconds]
bal has joined #ruby
rodfersou has joined #ruby
<cHarNe2>
thums up for double-qoutes
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackgoat has quit [Quit: WeeChat 0.3.8]
arup_r has joined #ruby
blackgoat has joined #ruby
<cHarNe2>
https://github.com/styleguide/ruby: Use double-quoted strings. Interpolation and escaped characters will always work without a delimiter change, and ' is a lot more common than " in string literals.
<mikecmpbll>
boom ..
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
<mikecmpbll>
personally, i use a kind of random approach, i'm an anarchist.
nrcpts has joined #ruby
<mikecmpbll>
psh, standards.
<cHarNe2>
mikecmpbll: me to, put "hello world!'
mfaeh has quit [Remote host closed the connection]
<mikecmpbll>
:d
arup_r_ has quit [Ping timeout: 264 seconds]
nrsk has joined #ruby
C1V0 has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kl__ has joined #ruby
Alina-malina has quit [Quit: byebye]
nfk has joined #ruby
pwnz0r has quit [Remote host closed the connection]
troulouliou_dev has quit [Read error: Connection reset by peer]
wpp has joined #ruby
<ddv>
I already knew that was in the style guide, but I disagree with it because you don't need to interpolate most of the time
leafybasil has joined #ruby
<apeiros>
hm
<apeiros>
I wonder whether that's true for my code
<apeiros>
(I have no idea)
Alina-malina has joined #ruby
oo_ has quit [Remote host closed the connection]
g-nom3 has joined #ruby
workmad3 has joined #ruby
troulouliou_dev has joined #ruby
zwer_g is now known as zwer
michael_lee has joined #ruby
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pharaoh2 has joined #ruby
Xeago has quit [Remote host closed the connection]
oo_ has joined #ruby
<mozzarella>
I use ' unless I need interpolation
<apeiros>
I've started to use " regardeless
<mozzarella>
sometimes I even use ' and + or ' and <<, if it fits
DLSteve has joined #ruby
Oberon4278 has joined #ruby
ldnunes has joined #ruby
bal has quit [Ping timeout: 265 seconds]
<ddv>
the style guide used to say the opposite
<mikecmpbll>
i use " when the string is sentence-like, and ' for string tokens and stuff. no idea why :d
<Oberon4278>
So, I'm just learning Ruby, and I've come across the thing where you can chain calls together, i.e. string.length.next.
<mikecmpbll>
puts "Setup completed." if Setting.find_by(name: 'setup_complete')
<mikecmpbll>
for instance :p
<Oberon4278>
It reminds me of what I've seen in a JavaScript library whose name I can't remember, where you can chain together calls in a similar way.
<mikecmpbll>
Oberon4278: underscore perhaps?
sevenseacat has joined #ruby
<Oberon4278>
Are these both the same thing in different languages, or are they different things?
ndrei has quit [Ping timeout: 256 seconds]
<apeiros>
all in all I find " vs ' almost completely irrelevant :)
<mikecmpbll>
Oberon4278: it's just that the method returns `self`
<Oberon4278>
mikecmpbll: No, the JS library is not called underscore, if that's what you meant.
<mikecmpbll>
Oberon4278: okidokes, just a guess.
<Oberon4278>
It's a really common one, I just forget its name.
<apeiros>
Obfuscate: you can chain methods in javascript just fine without the help of a library
<mozzarella>
maybe jquery?
<Oberon4278>
That's the one.
<apeiros>
*Oberon4278
<Oberon4278>
Ah, I thought it was only available in jquery for some reason.
<apeiros>
I think only php managed to not be able to do chaining (php 5 fixed that)
<Oberon4278>
Anyway, this ability, is it the same basic thing in both languages? Or is there some critical difference I should be aware of?
fandi has joined #ruby
<Oberon4278>
Well, C doesn't do it, as far as I know ;)
<apeiros>
Oberon4278: depends on your definition. yes, you can chain in C too.
<ddv>
apeiros: it's very important
yfeldblum has joined #ruby
<Oberon4278>
apeiros: How?
kl__ has quit [Ping timeout: 244 seconds]
<apeiros>
Oberon4278: nested structs, function pointers, …
* apeiros
afk
<Oberon4278>
That's... not really the same thing though. I mean yes, you can do it, but the language doesn't support it natively in that you can't write... crap I can't think today.
<dseitz>
chain through expression evaluation... last(second(first()))
<Oberon4278>
Yes, I suppose you could do that.
kl__ has joined #ruby
<dseitz>
Or you could pass fp's around which there are a few idioms that are nice, and others that are kinda eh
<Oberon4278>
C has function pointers?
<cHarNe2>
Oberon4278: not sure what the anwser you are looking for it, but ruby is an objective language. And threats thing like things you can do things with.
<dseitz>
yeah
<Oberon4278>
I had no idea. That's pretty cool. Then again I shouldn't be surprised, I'm not very good with C.
<cHarNe2>
wtf did i type? that makes no sense, im sorry
<dseitz>
4 am logic!
<mikecmpbll>
i read it twice, made less sense the second time.
sandelius has joined #ruby
sandelius has quit [Client Quit]
<Oberon4278>
cHarNe2: I'm just wondering if the func1.func2.func3 thing is the same as what I'd seen before in JavaScript, and it appears that it is.
<workmad3>
cHarNe2: I'm almost tempted to print that off and study it to master zen!
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r_ has joined #ruby
ferr has quit [Ping timeout: 255 seconds]
<workmad3>
Oberon4278: if what you saw in JS was func1().func2().func3(), then yes
<Oberon4278>
Well, no not exactly, but close enough.
yfeldblum has quit [Ping timeout: 252 seconds]
<workmad3>
Oberon4278: func1.func2.func3 would be a bit different in JS, in that you'd be accessing attributes on the function object... in ruby func1.func2.func3 would call func1, then call func2 on the result of that, and finally call func3 on the result of the func2 call
elaptics is now known as elaptics`away
<Oberon4278>
ahh okay, so it is a bit different
aswen has quit [Ping timeout: 245 seconds]
<Oberon4278>
Ruby's version makes more intuitive sense
agjacome has joined #ruby
giuseppesolinas has joined #ruby
<cHarNe2>
Oberon4278: ruby is magic :)
<dseitz>
In object-oriented languages it's more common to return a value that can be manipulated by passing a message to that, repeating the process... chaining.... the parens are a optional in Ruby which makes it interesting
<workmad3>
ruby's version also makes it much more difficult to have a clean syntax for passing around first-class methods/functions :)
arup_r has quit [Ping timeout: 244 seconds]
<Oberon4278>
I think I picked a bad day for learning Ruby.
elaptics`away is now known as elaptics
<cHarNe2>
it's always a good day to learn ruby :)
<dseitz>
Maybe a good day!
<mikecmpbll>
ruby tuesday ..
<dseitz>
haha
<mikecmpbll>
surely the best day.
<Oberon4278>
Actually, no... I picked a bad set of life habits
<Oberon4278>
and indulged in them repeatedly
<mikecmpbll>
put down the crack pipe.
<Oberon4278>
and then decided, "I'm sick of doing those things, I'm going to be productive. I'll learn Ruby!"
nrcpts has quit [Quit: (null)]
<workmad3>
mikecmpbll: he could have worse life habits... such as coding in PHP
<Oberon4278>
I actually had my first encounter with crack last year!
<mikecmpbll>
:'D
<dseitz>
that one you may keep to yourself in an interview hahaha
<Oberon4278>
A friend of mine called me up and said, "Oberon, I need to move now. Please come help."
<Oberon4278>
So I went to help him move, and when we got to his place he said "You can't come in. I'll bring stuff to the door, you carry it to the car."
<mikecmpbll>
this has taken a curious turn.
<Oberon4278>
Later he explained that his roommate regularly smoked crack.
<Oberon4278>
And was in fact smoking it when we arrived to help him move.
<dseitz>
ah
bal has joined #ruby
<Oberon4278>
Which was why he had to move immediately, and why we couldn't go in when we arrived.
<g-nom3>
hey all, i've been trying to do some rather complicated csv parsing using bash scripts but have finally decided it time to engage a more enriched tool for the job and am now trying to decide between using perl, python, or ruby to achieve this end. before i go into great detail i wonder if someone can show me a ruby example of how i might parse a csv and wrap quotation marks around each field value of the csv so as to present each value a
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dseitz>
Glad you helped. Definitely want to get yourself as far away from something like that.
<Oberon4278>
Indeed.
<kaspergrubbe>
I would also begin smoking crack if I had to parse csv files using bash like g-nom3
<g-nom3>
hahah i've been up for three days trying to sort it and beginning to wonder if i should take it up in order to keep my edge hahah
<Oberon4278>
Dude. No.
<workmad3>
mikecmpbll: you missed 'require "csv"' :P
Afal has joined #ruby
<Oberon4278>
Adderall is cheaper, more widely available, and has much less social stigma attached to it.
<mikecmpbll>
-____-
<g-nom3>
mikecmpbll: thank you so that reads the csv and parses to new file is that correct? but how to wrap each field in ""?
<mikecmpbll>
g-nom3: it reads it in to memory, as an array or whatever.
<cHarNe2>
way better to learn ruby then starting to smoke crack imo
<mikecmpbll>
g-nom3: why do you want to wrap each field with ""?
<workmad3>
mikecmpbll: also, "CSV.foreach("path/to/file") do |csv_row| <process here> end" ;)
<g-nom3>
because each field contains characters i'd imagine would be interpreted as meta
<mikecmpbll>
plenty of ways to skin that particular cat.
Afal has left #ruby [#ruby]
<mikecmpbll>
g-nom3: not sure what you mean.
<workmad3>
g-nom3: mikecmpbll's example loads the CSV file into a ruby construct that lets you read it in
agrinb has joined #ruby
<Oberon4278>
g-nom3: I hate to be That Guy, but at this point might it be helpful to take a step back and explain the larger problem you're trying to solve, rather than this particular facet of it?
<sevenseacat>
never any shame in being That Guy.
<g-nom3>
ok ... sorry forgive me i'm entering new territory here for me. allow me to explain better
<sevenseacat>
or Girl.
<g-nom3>
and Oberon4278 completely fair enough too
<mikecmpbll>
or Transgender or No gender
<mikecmpbll>
whatever they call themselves colloquially.
ponga has joined #ruby
<workmad3>
g-nom3: it doesn't write it out again... if you want to write CSV, you can do 'CSV.open("path/to/output", "wb") do |csv|; csv << ["header 1", "header 2", "header 3"]; csv << ["row", "of", "data"]; ... end'
<sevenseacat>
mikecmpbll: fair point
<Oberon4278>
I'm a trans-spheroid geometer-kin, you cis shitlord!
<dseitz>
Isn't there a :force_quote option for CSV?
<mikecmpbll>
yus.
<dseitz>
so you could just parse and re-write the CSV with that and be done... theory 1
<mikecmpbll>
but if the csv needed quotes to be well formatted in the first place you wouldn't be able to parse it? :)
rdark has joined #ruby
<mikecmpbll>
so it's not really clear what he's tryin to do.
<g-nom3>
thanks workmad3. ruby has nice syntax by the looks. here goes with my explanation of what i'm trying to achieve. give me a sec to write it up and pastebin some data
<Oberon4278>
While he's doing that - does Ruby have native support for Unicode?
mengu has joined #ruby
agrinb has quit [Ping timeout: 240 seconds]
<Oberon4278>
actually, forget I asked that. I'll just look it up when I need it.
Spami has quit [Quit: This computer has gone to sleep]
<dseitz>
default for source is going to be UTF-8
<dseitz>
but that can be changed as well; there is support for a lot of encodings
JBreit has joined #ruby
<mikecmpbll>
it was kinda a mess before 1.9 iirc, but better now.
<kaspergrubbe>
So you might even be able to use it on english :-)
fandi has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
<Oberon4278>
We broke up because I wanted kids and she didn't.
<Oberon4278>
Which, let me tell you, is the worst reason to break up ever.
tkuchiki has joined #ruby
pdoherty has quit [Ping timeout: 256 seconds]
<Oberon4278>
I'm really curious what happened to g-nom3
<shevy>
eh completely understandable. different goals
<shevy>
more understandable than why you use the word danke, too :)
<Oberon4278>
Well, yes, but it's awful to go through it.
<Oberon4278>
It's like... here's this wonderful woman, and we love each other and are perfectly happy together.
<g-nom3>
sorry bout the delay.. cut paste etc... here is an example containing a few lines of the dataset with headers http://pastebin.com/2PcJwQgu there are some encoding issues as it is an excel spreadsheet which i think is using wingding directional arrows. i wish to parse this data into a new csv like so: http://pastebin.com/FzFUxAa6
<Oberon4278>
And the only reason we're breaking up is because, in several years, one of us will probably resent the other because we have | don't have kids.
shime has joined #ruby
rocco88 has joined #ruby
<g-nom3>
so i'm going to have to explain the re-mapping of columns
<Oberon4278>
g-nom3 I'm pretty sure that Ruby can parse Excel files directly
ajaiswal has quit [Quit: Leaving]
<shevy>
g-nom3 did you try with the ruby cvs module yet? you can even use different delimiters rather than |
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<Oberon4278>
if that would help
<g-nom3>
ok cool thats handy to know Oberon4278 thanks
<shevy>
there are indeed gems for excel files too
<shevy>
but that just looks like a .cvs file
<shevy>
with , as delimiter
<wasamasa>
*csv
<g-nom3>
shevy: not yet. this will be my first venture down the ruby path
<shevy>
wasamasa haha
<wasamasa>
the c in csv stands for comma
tkuchiki has quit [Ping timeout: 264 seconds]
timonv^ has quit [Remote host closed the connection]
<wasamasa>
if anything, derivations from that norm should be mentioned
<shevy>
so now we know it does not stand for copy value separated file
Pharaoh2 has joined #ruby
<workmad3>
you can specify the delimiter with the ruby CSV library though, which makes it a passable TSV parser too :)
<g-nom3>
i'm a designer frontend dev cutting my teeth on some real scripting here.. its new territory
Pharaoh2 has quit [Client Quit]
<g-nom3>
shevy i just saved as .csv for ease of pastebin
<shevy>
you just have to think in little baby steps g-nom3
<shevy>
first, get a handle on your file
<shevy>
require 'csv'
<shevy>
data = CSV.read('dataset.csv')
<shevy>
test this right in irb actually
<Oberon4278>
g-nom3: Are you saying that this is your first foray into actual programming? As in, you're learning how to program with this task?
<g-nom3>
this one step of what i need to do but i have some fairly complicated bash scripts to do the rest.. well at least i hope they work at the end of this
giuseppesolinas has joined #ruby
<wasamasa>
g-nom3: good luck, dealing with CSV can be a tiresome task
danjordan has joined #ruby
<wasamasa>
g-nom3: perhaps an import into a database you're familiar with might be a better option
leafybasil has quit []
leafybasil has joined #ruby
<Oberon4278>
Also, I'm still curious what the larger goal is. You've got this Excel spreadsheet, and you need to get the data from there to... what, exactly?
<g-nom3>
Oberon4278: actual programming i guess yea. i work with bash scripting, and some javascript. great with markup and css/sass too but i normally leave the real thinking to experts haha
<shevy>
g-nom3 once you know how to "think" in ruby, it'll be simple
<shevy>
I have to re-learn bash/shell scripting for an exam; I asked the prof if I could use ruby instead, he said no :(
giuseppesolinas has quit [Client Quit]
DLSteve has quit [Read error: Connection reset by peer]
<Oberon4278>
That kinda blows, and is (probably) a good example of why I don't like academic computer learning.
<wasamasa>
g-nom3: source: own experiences with excel data I had to turn into a proper database
<g-nom3>
what i'm trying to do is dynamically create signage based on csv input. this is one small step. the next step is to then expand the rows based on the quantity value, then perform a number of sorts, then batch and output a number of new csv's based on the 'template' value. then data merge with indesign templates
giuseppesolinas has joined #ruby
C1V0 has quit [Ping timeout: 264 seconds]
<Oberon4278>
Okay, so I'm confused on one thing. Is the original source of this data a CSV file, or is the original source an Excel file that you're saving as CSV to make it easier?
<g-nom3>
wasamasa: thats a good point and may be the best strategy perhaps
<wasamasa>
g-nom3: well, not necessarily
L8 has joined #ruby
<Oberon4278>
Because if it's always going to come from Excel, there may be a better way to do it than by saving as a CSV. I mean, maybe not depending on other things, but maybe.
<wasamasa>
g-nom3: as for my case, I'm still iterating over the CSV data, turn it into ruby data, then do the database magic
agjacome has quit [Quit: leaving]
C1V0 has joined #ruby
<wasamasa>
Oberon4278: well, csv is at least structured
giuseppesolinas has quit [Client Quit]
<Oberon4278>
Also... can I pick your brain sometime on merging with InDesign templates?
<Oberon4278>
There's a project I've put on hold that involves doing that. I think. Maybe.
<g-nom3>
i just like csv because i don't do microsoft and at least i can read csv into emacs
<wasamasa>
well, you can
<L8>
I'm hard of understanding the concept of code inside class, that is not in a method (or some scope) like class XXX #do_some_stuff# end
<wasamasa>
then emacs locks up on the long lines :P
<g-nom3>
absolutely oberon
<L8>
when does the code executed?
<L8>
is it executes once?
<wasamasa>
it's kind of a shame, I always view it outside emacs
<g-nom3>
wasamasa: never happened for me yet
<Oberon4278>
g-nom3: Well, I'm still on the "Ruby has a gem to handle spreadsheets" thing.
<g-nom3>
anyone familiar with bash too? i'll share some of the later code so as to fill in more of the picture
<wasamasa>
g-nom3: consider yourself lucky then
<Oberon4278>
Although given the paucity of documentation here, I think maybe going the CSV route may be better: https://rubygems.org/gems/spreadsheet
<wasamasa>
g-nom3: maybe your csv doesn't have long lines or something like that
<g-nom3>
wasamasa: yea typically only work with < 20k
lkba_ has joined #ruby
<workmad3>
L8: it's executed when the file is loaded
<wasamasa>
g-nom3: I'd generally discourage from doing anything complicated with shell scripting
<L8>
so what's the point of it
<wasamasa>
g-nom3: and instead write ruby
lkba has quit [Ping timeout: 255 seconds]
<L8>
seems easier not to wrap the code in any class
<wasamasa>
g-nom3: or whatever else you're familiar with
Pharaoh2 has joined #ruby
<g-nom3>
wasamasa: absolutely but i've failed to put the time into actually learning to program :-(
<workmad3>
L8: it's executed in the context of the class
<g-nom3>
that changes from this point forth however
<workmad3>
L8: i.e. 'self' inside there is the class
<L8>
gotcha
<workmad3>
L8: which means you can do things like call class methods directly
<workmad3>
L8: you know... ones like 'attr_accessor' ;)
<Oberon4278>
g-nom3: It's well worth the time and effort, assuming this project has a flexible timeline.
DLSteve has joined #ruby
<g-nom3>
Oberon4278: without doubt. unfortunately i have a matter of days to make something work ... print deadlines and all .
<Oberon4278>
Ahh, I see.
claudiuinberlin has quit [Read error: Connection reset by peer]
claudiuinberlin has joined #ruby
<Oberon4278>
I was assuming that you're getting this sort of thing regularly
n1lo has joined #ruby
postmodern has quit [Quit: Leaving]
last_staff has joined #ruby
<g-nom3>
Oberon4278: yes i do but always different spreadsheets, formats, data, etc. i'd love to be able to get some scripts working so that i can provide the customer with the proper template to use in order to prevent having to perform too much custom manipulation
<g-nom3>
rather than just work with what they provide
<Oberon4278>
that makes sense
<workmad3>
g-nom3: I'd love to have customers that would use something like that... :P
nrsk has quit [Ping timeout: 252 seconds]
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jimms has joined #ruby
fantazo has joined #ruby
<Oberon4278>
So, just a thought - you could eventually build up a set of sanity checks that you can run a new spreadsheet through, and then make it available to your customers via web interface
<Oberon4278>
via a web*
<shevy>
g-nom3 yes, that task is simple; don't worry, just keep on continuing with ruby there, you'll write better and better code the more you write and re-use these scripts
greenbagels has quit [Read error: Connection reset by peer]
lkba has joined #ruby
giuseppesolinas has joined #ruby
phutchins has joined #ruby
<shevy>
g-nom3 ruby is a good glue language
<Oberon4278>
and then tell them, hey, I can turn around your work a lot faster if you upload your spreadsheet to this place and it comes back all green
<g-nom3>
workmad3: i firmly believe its all about training them. you have to prove the value however. that can be difficult at times
Pharaoh2 has joined #ruby
<Oberon4278>
it's fine if it doesn't, I can and will do it, but just be aware that it'll take longer, bla bla bla
<g-nom3>
Oberon4278: that will be the next phase i think. incorporate it into the website. makes total sense.
nfk has quit [Quit: yawn]
<Oberon4278>
yeah
decoponio has joined #ruby
<Oberon4278>
you're making me nostalgic for the time I worked at a printing company
<g-nom3>
shevy: i'm glad to hear it. i liked what i saw with perl, but i always here horror stories too
claudiuinberlin has quit [Quit: Leaving.]
<g-nom3>
ruby is at least very readable from what i've seen
<ddv>
depends on the person
<g-nom3>
and i use a lot of gems anyway: compass, sass etc
lkba_ has quit [Ping timeout: 252 seconds]
<Oberon4278>
I know a guy who once dropped acid and then sat down and programmed in Perl for about six hours straight.
<Oberon4278>
When he woke up the next day the code worked perfectly, but he was never able to figure out how or why.
<g-nom3>
Oberon4278: did he also write perl? hahah
gfawcettpq1 has joined #ruby
tvw has joined #ruby
<ddv>
what do perl and ruby have in common?
<Oberon4278>
Yeah he'd been writing Perl professionally for a good long while.
ndrei has joined #ruby
<Oberon4278>
ddv: They're both Turing-equivalent languages.
<shevy>
g-nom3 ruby and perl are very similar in philosophy; for the most part though, ruby is cleaner and shorter than perl. and its OOP model is also more elegant
<ddv>
both were developed by relgious zealots :/
<workmad3>
Oberon4278: I know an awesome study that found out that perl is as easy to code in (for newcomers) as a completely randomly generated programming language :D
phutchins has quit [Client Quit]
<shevy>
only part where perl can be shorter is like when you use lots of // and <> and whatnot
<Oberon4278>
They're both descended from C.
SOLDIERz has joined #ruby
<g-nom3>
Oberon4278: well i'm not sure i should try that.. haha.. no matter how tempting it sounds
* Oberon4278
tries to think of other true but unhelpful responses.
<g-nom3>
hahaha
<workmad3>
ruby takes a lot less from C than other 'C-style' languages
<Oberon4278>
But it's not a descendant of Lisp or COBOL or M.
<Oberon4278>
Actually wait... I don't know about COBOL.
<workmad3>
it's more a descendent of smalltalk
<Oberon4278>
Isn't Smalltalk a Lisp?
<workmad3>
in terms of syntax style, anyway
<workmad3>
no
<g-nom3>
i like lisp
<g-nom3>
but thats another story
<Oberon4278>
Huh, I always thought it was. TIL.
<g-nom3>
ok.. i'm convinced now.. ruby is for me. first steps?
<Oberon4278>
Oh, I'm thinking of Scheme.
<Oberon4278>
g-nom3: Do you have it installed?
<workmad3>
I met someone the other day who worked on LISP machines though... and on simula (the first OO language)
<g-nom3>
yes indeed
<ddv>
you can make big money with COBOL
<shevy>
man
<shevy>
quit living in the past
<workmad3>
ddv: sure... if you have a decade of experience with it :)
<Oberon4278>
You can also make big money with M.
<kl__>
M?
<shevy>
what is M
MasterPiece has joined #ruby
<Oberon4278>
It's a programming language widely used in medical database software, including (and especially) Cache, the primary product of InterSystems.
<ddv>
nobody uses Oberon4278
<ddv>
+it
<Oberon4278>
I think it's called M because it was invented at Mass General Hospital.
<Oberon4278>
Umm.... that's not true. I personally know a lot of people who use it, albeit in a more modern form.
<ddv>
and why do hospitals invent programming languages, don't they have better things to do
<workmad3>
ok... so RMS is made up entirely of programming languages... TIL
<Oberon4278>
It was invented way back in 1966.
<g-nom3>
ddv: that made me chuckle! :-)
phutchins has joined #ruby
<Oberon4278>
Anyway, if you're good at it, hospitals will hire you to do things, and since millions of dollars are on the line (and occasionally people's lives) they pay well.
<ddv>
g-nom3: hehe
<shevy>
ddv nobody uses Oberon4278? is that an operating system?
rocco88 has quit [Read error: Connection reset by peer]
<ddv>
no wonder it took that long for universal healthcare in the US
qba73 has joined #ruby
<Oberon4278>
What country do you live in, ddv?
<shevy>
they should use ruby
<ddv>
Oberon4278: Why?
<Oberon4278>
So I can tell you that your nation's health care system uses a product that is based on a database that uses M ;)
ChoiKyuSang has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
<arup_r_>
shevy: shevy: :)
<Oberon4278>
Disclosure: Until last October I worked for a very large, multinational vendor of a medical database product that was based, way back when, on M. Nearly every nation on earth has a substantial portion of their health care industry built on their products.
<Oberon4278>
Sweden's *entire* health care network uses it.
<ddv>
Oberon4278: Netherlands
<Oberon4278>
Ohhh, I don't know about them.
<workmad3>
hehe
agrinb has joined #ruby
<sevenseacat>
lol
Xeago has joined #ruby
<Oberon4278>
Looks like NICTIZ uses Ensemble, so yes, you do.
<arup_r_>
sevenseacat: has "lol"problem.. hehehehe
<Oberon4278>
Which means every time you go to the doctor, ddv, a substantial portion of your health care records are being accessed by code that was, sometime in the dim and distant past, written by someone who worked at Mass General Hospital, and / or the US Veterans Affairs ;)
<ddv>
Oberon4278: I wouldn't be surprised if the NSA can access my healthcare records
<shevy>
arup_r_ it's an aussie lolcat after all
<arup_r_>
hehehe
<Oberon4278>
I certainly hope they can't, ddv. We do a pretty damn good of providing secure encryption options for our customers. Well.. "our" in the past tense :'(
<ddv>
Oberon4278: well Google, Facebook, Apple and Microsoft said the same thing
ponga has quit [Read error: No route to host]
panga has joined #ruby
agrinb has quit [Ping timeout: 264 seconds]
<Oberon4278>
Yes, but consider what those companies have in common
<Oberon4278>
They're all US-based companies, with servers on US soil
<workmad3>
Oberon4278: do you know if your secure encryption options are based on NIST recommendations for curves or random-number generators?
<Oberon4278>
and they store your data here in the US
<workmad3>
(if you're not sure, chances are they are)
Lap64 has quit [Quit: Leaving]
<Oberon4278>
workmad3: They are
<workmad3>
Oberon4278: then they're likely backdoored by the NSA :P
ChoiKyuSang has joined #ruby
<ddv>
Oberon4278: this is why you shouldn't host anything in the US
<Oberon4278>
workmad3: This is not my area of expertise, but okay :P
<Oberon4278>
ddv: I agree. But your nation's health care services are in the Netherlands, and your data (I would hope) is hosted in their own servers, which they secure themselves.
davedev2_ has quit [Remote host closed the connection]
<ddv>
Oberon4278: what point are you trying to make here?
<Oberon4278>
So as long as the encryption protocols themselves are not backdoored by the NSA, then it's safe.
<Oberon4278>
That your healthcare data is not necessarily accessible to the NSA?
nuck has quit [Quit: Computer has gone to sleep.]
<workmad3>
Oberon4278: that was basically the main thrust of the snowden leaks (and it was suspected for a longer time beforehand) - the leaks revealed that the NSA put a lot of effort into getting NIST to select a specific set of curve values and choose a specific RNG recommendation through secret selection mechanisms
<Oberon4278>
Ahh. I didn't know that.
<workmad3>
Oberon4278: and then the NSA paid companies like RSA to use those recommendations and keep it a secret that they were paid to do so...
<ddv>
well I don't really care, and the NSA doesn't care either (probably) but still it's pretty ridiculous
<workmad3>
Oberon4278: a backdoored curve or backdoored RNG == a backdoored encryption algorithm
<Oberon4278>
Well... what I can tell you is that the people in charge of providing data security for our (past tense :'( ) customers include PhDs in computer science and mathematics from MIT.
* Oberon4278
nods.
<workmad3>
Oberon4278: the security of them is built on the assumption that they have decent randomness and that certain tasks are 'hard' :)
<ddv>
Oberon4278: so you are actually okay with all of this?
<Oberon4278>
But if the backdoor is now known, they would have changed their recommendation. Which doesn't help in the past, and doesn't defend against potential future backdoors, but still. They're good at their job :)
<Oberon4278>
ddv: I'm confused about what you're asking if I'm okay with.
<ddv>
Oberon4278: Your government spying on everyone without precedent
<Oberon4278>
No, not at all.
<workmad3>
Oberon4278: the end-result of the snowden leaks is basically that NIST have lost all credibility in security matters amongst professional paranoids :)
<Oberon4278>
But I sort of view the US government as a force of nature. It doesn't make sense to get mad at a hurricane or snowstorm - they just happen, and I deal with the realities of the situation without wasting emotion or ethical judgment on the cause.
<ddv>
I see like sticking your head into the sand
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<workmad3>
yeah... the important thing isn't to get mad at the US government... it's to shore up your walls now that you know there were cleverly plastered-over holes in them :)
<Oberon4278>
I dislike the connotation in the analogy, but sure.
panga has quit [Remote host closed the connection]
<Oberon4278>
I mean, what do you want me to do?
govg has quit [Ping timeout: 256 seconds]
<workmad3>
(I have absolutely no way to influence the US government at all... getting mad at them is fruitless...)
<ddv>
Oberon4278: You voted republican?
ponga has joined #ruby
ferr has quit [Ping timeout: 265 seconds]
<Oberon4278>
I'm not sure why you would assume that, and how I vote is not your business, but as it happens no.
<ddv>
it is my business
<ddv>
the NSA needs to know
<Oberon4278>
No, it's really not.
<workmad3>
ddv: just because the leaks occured under a democratic government doesn't mean that they started under one... both parties are probably equally culpable :)
<workmad3>
err... that was poorly phrased, but I think you get my point at least :)
<Oberon4278>
One's voting is (in the US) considered to be a private matter.
<ddv>
Oberon4278: so you do value privacy
Pharaoh2 has joined #ruby
<Oberon4278>
e.e
<Oberon4278>
Yes, of course I do.
<Oberon4278>
And I donate money to the EFF every month.
<ddv>
workmad3: me u understand
C1V0 has quit []
<Oberon4278>
To be honest, I find this examination of my character offputting and presumptuous.
<workmad3>
Oberon4278: welcome to the latest installment of 'politics on IRC' - the topic that's guaranteed to come across in the most god-awful fashion in a text-only medium :)
iamjarvo has joined #ruby
<Oberon4278>
I should be more careful about avoiding the subject :)
<workmad3>
Oberon4278: heh :) tbh, yes :P
davedev24_ has joined #ruby
<workmad3>
Oberon4278: if a topic contains the potential to offend you, it's up to you to not engage in it :P
ponga has quit [Ping timeout: 256 seconds]
<Oberon4278>
ddv: We probably agree on most matters related to the US government, regardless of whether I show the proper amount of outrage when discussing the realities of encryption.
<ddv>
Oberon4278: it's people like you that don't give a shit about anything that is the problem
<Oberon4278>
Well, I wasn't aware that I was going to come under personal scrutiny just for talking about encryption.
<ddv>
Oberon4278: :)
<Oberon4278>
See? He assumes I don't care. I have no idea why he would draw that conclusion, but now suddenly I'm at fault for the world's ills.
<workmad3>
Oberon4278: blame the US government... the snowden leaks turned encryption into a political subject ;)
<ddv>
also I forgot that I was in #ruby
<workmad3>
Oberon4278: and if you don't blame them... ddv will come after you! ;)
<Oberon4278>
tbh, encryption has been a political subject for a long time before Snowden came onto the scene
<Oberon4278>
ddv: Are you familiar with the EFF? i.e. Electronic Frontier Foundation?
<workmad3>
Oberon4278: I know... I'm being somewhat facetious to lighten the mood :P
maximski has quit []
<Oberon4278>
I appreciate it!
banister has joined #ruby
<workmad3>
Oberon4278: if you want screwed up though - the UK government (tory party) wants to put in place a law that makes it illegal to use services that they can't snoop on...
rbrs has quit [Quit: rbrs]
<Oberon4278>
How many seats does the Tory party have?
<Oberon4278>
(out of how many total)
<workmad3>
they're currently the in-power government
<Oberon4278>
Well that's marvelous.
<workmad3>
(although it's a coalition with the lib-dems atm)
<workmad3>
the plans for this would be after the election this year
max96at|off is now known as max96at
<workmad3>
so here's hoping they don't get into power again! although the current runner up is UKIP
<workmad3>
I really should start looking for a different country to live in...
<Oberon4278>
ddv: In case you're not - the EFF regularly fights legal battles, and organizes social activity, to protect privacy and digital rights in the US. And, as I said earlier, I have an automatic monthly donation set up for them. So I am, in fact, doing something about it.
<Oberon4278>
I recommend Sweden, workmad3
nateberkopec has quit [Quit: Leaving...]
<ddv>
Oberon4278: wait a minute, that same Sweden that wanted to extradite Assange due to a BS reason
fandi has joined #ruby
nateberkopec has joined #ruby
<ddv>
sorry workmad3 but you know it's true
ponga has joined #ruby
<workmad3>
ddv: heh :)
<Oberon4278>
ddv: But a big problem with American politics (and this is really my main political axe) is that political campaigns are so expensive that politicians must spend the majority of their time raising funds for their next election. This causes money to be the primary force in Washington, rather than the good of the people.
<ddv>
Sweden was pressurized by US gov to extradite Assange
<ddv>
pressured?
<Oberon4278>
Pressured.
<workmad3>
ddv: yeah... not pressurized :)
<ddv>
haha
<ddv>
anyways
<Oberon4278>
So the most important issue in US politics is campaign finance reform.
<Oberon4278>
As it impacts every other political issue at the most basic level.
elfuego has joined #ruby
<apeiros>
too bad they just recently made it worse
<Oberon4278>
pressurized is a state - i.e. a container can be pressurized or depressurized
<apeiros>
by increasing the amount a single person can donate
<Oberon4278>
oh god that's horrible
<Oberon4278>
how much is it now?
<apeiros>
no idea
<Oberon4278>
fuck
<ddv>
Oberon4278: I know
<Oberon4278>
Now I have to write to what's her name and give her more money.
<apeiros>
I decided I find US politics too terrible to bear, so I mostly stopped following it.
<Oberon4278>
All I ask, apeiros, is that any time US politics comes up, you give campaign finance reform a plug.
<Oberon4278>
Because it is absolutely the #1 killer of everything good right now.
rdark has quit [Ping timeout: 264 seconds]
sheepman has quit [Read error: No route to host]
JBreit has quit [Ping timeout: 264 seconds]
CustosL1men has quit [Ping timeout: 244 seconds]
Stoge88 has joined #ruby
rdark has joined #ruby
elfuego has quit [Client Quit]
ferr has joined #ruby
zwer has quit [Ping timeout: 250 seconds]
St_Marx has quit [Ping timeout: 250 seconds]
St1gma has quit [Ping timeout: 250 seconds]
zwer has joined #ruby
speakingcode has quit [Read error: Connection reset by peer]
Fusl has quit [Ping timeout: 250 seconds]
sheepman has joined #ruby
<jheg>
does an array method exist that allows you to get the index number of an element?
<workmad3>
jheg: index
jlebrech has quit [Remote host closed the connection]
<tobiasvl>
note that index gives you the first index, in case of multiple identical values
<apeiros>
surprise!
speakingcode has joined #ruby
yfeldblum has joined #ruby
<jheg>
I seem to be missing something as this returns an error …
Stoge88 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
funkpuppet has quit [Quit: funkpuppet]
xrlabs has joined #ruby
nateberkopec has quit [Quit: Leaving...]
commmmodo has joined #ruby
jack_rabbit has quit [Ping timeout: 255 seconds]
DLSteve has quit [Read error: Connection reset by peer]
bluenemo has quit [Remote host closed the connection]
Pharaoh2 has joined #ruby
DLSteve has joined #ruby
martinrame has joined #ruby
codecop has quit [Read error: Connection reset by peer]
<martinrame>
hi, I'm trying to upgrade redmine from svn, but I'm getting some Ruby errors while "bundle update" on Ubuntu 12.04. Can you take a look? http://pastebin.com/CFFmMCxP
zarubin has quit [Read error: Connection reset by peer]
paulfm has joined #ruby
commmmodo has quit [Ping timeout: 264 seconds]
CustosL1men has quit [Ping timeout: 265 seconds]
codecop has joined #ruby
pico-pete has quit [Read error: Connection reset by peer]
pico-pete has joined #ruby
qpls_ has quit [Ping timeout: 240 seconds]
xlii has quit [Ping timeout: 245 seconds]
clauswitt has quit [Ping timeout: 245 seconds]
antgel has quit [Ping timeout: 264 seconds]
cHarNe2 has quit [Ping timeout: 245 seconds]
paulfm has quit [Read error: Connection reset by peer]
joonty has quit [Quit: joonty]
paulfm has joined #ruby
lsmola has quit [Ping timeout: 264 seconds]
spacemud has quit [Ping timeout: 256 seconds]
krz has quit [Quit: WeeChat 1.0.1]
pipework has quit [Ping timeout: 256 seconds]
antgel has joined #ruby
apurcell has joined #ruby
tkuchiki has quit [Remote host closed the connection]
cHarNe2 has joined #ruby
tkuchiki has joined #ruby
shazaum has quit [Ping timeout: 264 seconds]
<apeiros>
martinrame: might be sufficient to explicitly install mysql-2.8.1 manually
<apeiros>
i.e., gem install mysql -v 2.8.1 -- --with-mysql-config=/usr/bin/mysql_config
WillAmes has joined #ruby
jack_rabbit has joined #ruby
soulcake has quit [Ping timeout: 276 seconds]
tkuchiki_ has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
spacemud has joined #ruby
clauswitt has joined #ruby
xlii has joined #ruby
apurcell has quit [Ping timeout: 264 seconds]
commmmodo has joined #ruby
qpls has joined #ruby
elfuego has joined #ruby
<martinrame>
apeiros: I was able to install mysql 2.8.1 using "sudo gem install ... ", I cant using only "gem install.." (without sudo), but then I got the same error.
Akuma has quit [Quit: So long sukkas!]
<apeiros>
martinrame: huh? installing 2.9.1 worked without sudo but 2.8.1 only with sudo? that sounds odd…
<apeiros>
you should usually not mix sudo/non-sudo installs
<martinrame>
apeiros: typo, 2.8.1 in both cases.
<apeiros>
martinrame: I think your pastebin is not a typo…
<apeiros>
and there you succeed to install 2.9.1 without sudo
<martinrame>
apeiros: mmm, let me check
suy|BNC is now known as disperso
Flcn has joined #ruby
<martinrame>
apeiros: can you help me uninstall ruby and bunldes, then reinstall it again?
heftig has quit [Remote host closed the connection]
soulcake has joined #ruby
<apeiros>
not really having that much time, sorry.
delianides has joined #ruby
bradland has joined #ruby
<apeiros>
generally it should just be `gem uninstall GEMNAME`, with sudo if you installed it with sudo
heftig has joined #ruby
<martinrame>
apeiros: I found I have two rubies. One in /usr/bin and another installed by rvm.
<apeiros>
martinrame: preferably don't touch the /usr/bin ruby and gems
n1lo has quit [Ping timeout: 264 seconds]
<martinrame>
apeiros: but it's 1.8.7
dblessing has joined #ruby
lsmola has joined #ruby
<apeiros>
that's why you use the rvm ruby. and there you install stuff too.
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<martinrame>
apeiros: ok, so everything will be without sudo from now on.
<apeiros>
yes, with rvm ruby, don't use sudo
nateberkopec has joined #ruby
bradland has quit [Client Quit]
terlar has quit [Ping timeout: 255 seconds]
DadoCe has quit [Remote host closed the connection]
tkuchiki_ has quit [Remote host closed the connection]
tier has joined #ruby
adriancb has quit [Remote host closed the connection]
<puppeh>
anybody knows where I can find the definition of the AND operator in ruby's source? ("&&")
ki0 has joined #ruby
kl__ has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<bradland>
puppeh: not sure where it is in the source, but AND operator and the && operator are probably different pieces of code
jerematic has joined #ruby
ferr has quit [Ping timeout: 252 seconds]
chthon has quit [Ping timeout: 256 seconds]
charliesome has quit [Quit: zzz]
tkuchiki has quit [Ping timeout: 244 seconds]
soulcake has joined #ruby
giuseppesolinas has joined #ruby
khem_ has left #ruby [#ruby]
agrinb has joined #ruby
<shevy>
puppeh keyword_and
anaeem1 has joined #ruby
jack_rabbit has quit [Ping timeout: 255 seconds]
<shevy>
%token <val>
<shevy>
%*/
<shevy>
parse.y
evanjs has joined #ruby
<shevy>
%token tANDOP"&&"
anaeem1 has quit [Remote host closed the connection]
lolmaus has quit [Remote host closed the connection]
<shevy>
this is the main function:
<shevy>
static int parser_yylex(struct parser_params *parser)
diegoviola has joined #ruby
last_staff has quit [Quit: last_staff]
JDiPierro has joined #ruby
govg has joined #ruby
<shevy>
that function has like almost 1300 lines
<shevy>
:)
lolmaus has joined #ruby
<martinrame>
apeiros: Looks like I can't install 2.8.1 but 2.9.1 installs successfully?, is there a way to fix this?
agrinb has quit [Ping timeout: 244 seconds]
AlexRussia has joined #ruby
AlexRussia has quit [Changing host]
AlexRussia has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
arup_r has quit [Remote host closed the connection]
sambao21 has joined #ruby
cantonic has joined #ruby
n1lo has joined #ruby
DaniG2k has quit [Ping timeout: 265 seconds]
DaniG2k has joined #ruby
robbyoconnor has quit [Ping timeout: 264 seconds]
terlar has joined #ruby
jherbst has joined #ruby
zemlya has joined #ruby
hmsimha has quit [Ping timeout: 252 seconds]
<bradland>
martinrame: it’s likely that whatever build errors are occurring for you with 2.8.1 were fixed by a release after 2.8.1.
giuseppesolinas has joined #ruby
livingstn has joined #ruby
<bradland>
it may be possible to backport the fix to the prior release, but you’d have to drill down to the exact error, identify the fix in the newer version, then backporti t.
<martinrame>
bradland: I have successfully installed 2.9.1, but "bundle update" keeps giving me the error related to 2.8.1, is there a way to force bundle update to use 2.9.1?
joonty has joined #ruby
<bradland>
it depends on why 2.8.1 is being selected
<martinrame>
bradland: wait, I changed 2.8.1 to 2.9.1 in the Gemfile and it's building.
TomyWork has quit [Ping timeout: 264 seconds]
<bradland>
in your database.yaml, change the adapter to mysql2 intead of mysql
nrsk has joined #ruby
<bradland>
mysql2 is a newer mysql adapter gem, and should be compatible with Redmine, because they’re specifying it in the Gemfile
<bradland>
it’s faster too
rdark has quit [Quit: leaving]
giuseppesolinas has joined #ruby
rdark has joined #ruby
Xeago has quit [Ping timeout: 265 seconds]
tvw has quit [Read error: Connection reset by peer]
<bradland>
see the code on lines 43 through 73? that code looks for your database.yml file and tries to intelligently select a mysql adapter most appropriate for your database.yml configuration and ruby interpreter. it sniffs around to see if you’re running mri or jruby.
<bradland>
newer versions of Redmine don’t even include the mysql gem for MRI. how old is your Redmine install?
<workmad3>
bradland: ok, think about it... you check out and run 'bundle install', that generates a Gemfile.lock for your current setup
<aep>
might be what i want, thanks
<martinrame>
bradland: Redmine runs through passenger from apache. And now I'm getting an error saying it uses /usr/bin/ruby1.8
<bradland>
workmad3: ah, yeah. i see
<workmad3>
bradland: then you pull down an update, which has new versions in the Gemfile... but they don't release a new Gemfile.lock... ;)
<martinrame>
bradland: how can I tell it should use ruby 2.2.0 installed by rvm ?
<bradland>
where is your passenger config loaded?
<martinrame>
bradland: I don't know...
<bradland>
well, that’s a problem lol
<bradland>
did you install passenger?
<workmad3>
bradland: btw, I don't particularly agree with them doing that... but I can see why they say to do it :)
josephndenton has joined #ruby
max96at is now known as max96at|off
<bradland>
yeah, we check in our gemfile lock so that we know what the hell is going to be in the environment
<bradland>
:)
<bradland>
martinrame: what version of passenger?
<martinrame>
bradland: no, this initially was a bundled virtual machine. Then I installed the svn version and keep updating it since a couple of years.
<bradland>
i can help you find the config
<martinrame>
bradland: this is the first time I get those errors.
paulfm has quit [Remote host closed the connection]
<bradland>
no problem, we can find it
<workmad3>
bradland: yeah... and for most projects that's fine... for redmine, they couldn't do that without including a bunch of stuff most people won't need in the Gemfile (and have an entire section on then customising the Gemfile...)
MasterPiece has joined #ruby
jimms has quit [Read error: No route to host]
bluOxigen has joined #ruby
paulfm has joined #ruby
<bradland>
martinrame: run this in a shell: gem list | grep passenger
fmcgeough has joined #ruby
<martinrame>
bradland: empty
Vile` has quit [Ping timeout: 240 seconds]
<bradland>
iiiiiinteresting
<martinrame>
bradland: aparently passenger is running from the root version of ruby, not from the rvm one.
<workmad3>
^^ I was about to mention that
commmmodo has quit [Quit: commmmodo]
paulfm has quit [Read error: Connection reset by peer]
<bradland>
yeah, you can specify that through a passenger config directive: PassengerRuby
<workmad3>
martinrame: I'd suggest installing passenger into your RVM ruby, recompiling the apache module using that version and configure it again
<bradland>
but we need to find the location of the passenger config
DaniG2k has quit [Ping timeout: 255 seconds]
<bradland>
oh, was RVM installed after passenger?
<bradland>
sry, i’m late to this party. seems this has been going on for a while.
paulfm has joined #ruby
<martinrame>
bradland: yeah, rvm was installed after.
<bradland>
yeah, you’re going to need to do what martinrame suggests
<workmad3>
bradland: even if it wasn't, I wouldn't trust a passenger compiled against 1.8 to be particularly sane running with ruby 1.9 or 2.x :)
jimms has joined #ruby
<ddv>
I would run from 2.2.x
<bradland>
i assumed that passenger was installed after RVM
<martinrame>
bradland: yeah, rvm was installed after.
<workmad3>
ddv: I'm getting there with my stuff :)
bronson has joined #ruby
<ddv>
noice
revw has joined #ruby
<martinrame>
I found it: /etc/apache2/mods-enabled/passenger.conf
kaichanvong has joined #ruby
MasterPiece has quit [Client Quit]
<martinrame>
...and of course it points to ruby 1.8
<bradland>
yep, needs to be rebuilt
MasterPiece has joined #ruby
<martinrame>
bradland: look: o
DLSteve has quit [Read error: Connection reset by peer]
<workmad3>
martinrame: as I said... install newest passenger into your RVM ruby (whatever version it is), recompile the apache module for passenger and then update the config in that file to whatever that says :)
<martinrame>
workmad3: should I "gem install passenger"?
DLSteve has joined #ruby
nrsk has joined #ruby
chthon has quit [Quit: Ex-Chat]
iamjarvo has joined #ruby
devdazed has joined #ruby
chthon has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
mrmargolis has joined #ruby
athan has joined #ruby
enebo has joined #ruby
adriancb has joined #ruby
iamjarvo has joined #ruby
fantazo has quit [Quit: Verlassend]
krz has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
pdoherty has joined #ruby
JDiPierro has quit [Remote host closed the connection]
lobsterminator has joined #ruby
_maes_ has joined #ruby
bronson has joined #ruby
jmcharnes has joined #ruby
MasterPiece has quit [Ping timeout: 264 seconds]
Vile` has joined #ruby
paulfm has quit [Read error: Connection reset by peer]
iamjarvo has quit [Client Quit]
adriancb has quit [Remote host closed the connection]
adriancb has joined #ruby
zwer has quit [Read error: Connection reset by peer]
jusmyth has joined #ruby
MasterPiece has joined #ruby
max96at|off is now known as max96at
ishikawa has joined #ruby
RandyT has quit [Ping timeout: 252 seconds]
jusmyth has left #ruby [#ruby]
zwer has joined #ruby
lolmaus has quit [Remote host closed the connection]
paulfm has joined #ruby
RandyT has joined #ruby
lolmaus has joined #ruby
Fusl has joined #ruby
it0a has joined #ruby
red_horned_rihno has joined #ruby
St_Marx has joined #ruby
adriancb has quit [Ping timeout: 264 seconds]
adriancb has joined #ruby
shazaum has joined #ruby
<bradland>
martinrame: yes, you’ll need to `gem install passenger`
<aep>
any idea how to make this giant switch case prettier with some dsl? http://npaste.de/p/JX
beef-wellington has joined #ruby
zwer_s has joined #ruby
<martinrame>
bradland: installed, now I'm trying to figure out where is mod_passenger.c
shazaum has joined #ruby
shazaum has quit [Changing host]
<martinrame>
bradland: I've changed passener.conf pointing to the new gem and to ruby 2.2.0, and restarted apache. The result was the shared library wasn't loaded.
<jhass>
aep: no, you show too little (and not even valid code)
oleo has joined #ruby
<shevy>
aep does ruby have switch?
anaeem1 has joined #ruby
tus has joined #ruby
shellfu_afk has joined #ruby
<bradland>
martinrame: this is bizzare. did the `gem install passenger` and `passenger-install-apache2-module` execute cleanly? no errors?
shellfu_afk is now known as shellfu
<martinrame>
bradland: removing --snippet from passenger-install... will help.
<martinrame>
bradland: I need apache-dev headers
DaniG2k has joined #ruby
<bradland>
ok, so you haven’t run `passenger-install-apache2-module` yet?
DadoCe has quit [Ping timeout: 244 seconds]
<bradland>
sorry, i see. when you said you’d run it, you meant you’d run the snippet command.
<martinrame>
bradland: I did, but adding --snippet
<martinrame>
bradland: now I'm running it
Porpado has joined #ruby
Porpado has quit [Client Quit]
Porpado has joined #ruby
<waxjar>
aep looks like you want a Hash
zwer_s has quit [Remote host closed the connection]
zwer_s has joined #ruby
n008f4g_ has quit [Ping timeout: 255 seconds]
hornairs has quit [Quit: hornairs]
evanjs has quit [Remote host closed the connection]
apurcell has joined #ruby
<aep>
waxjar: yes, but prettier
<aep>
like, i want to hide the hash syntax behind a dsl
<waxjar>
what do you gain?
<aep>
readable code
<kaspergrubbe>
obfuscation
zB0hs has joined #ruby
<jhass>
an item in your DSL collection book
<jhass>
don't you have one of those?
<gregf_>
aep: use a hash
<aep>
basically all i want is "class A; my_thing A {}; end;" to evaluate to "class A; @my_thing[A] = {}; end; " i guess
iamninja has joined #ruby
* jhass
slowly backs off
<waxjar>
aep, what are you actually trying to do? the pseudo-code doesn't make sense to me.
<gregf_>
something like: class Foo; KEYS = {foo: 1, bar: 2, baz: 3,}; def get_key(key); KEYS[key.to_sym] || KEYS[:foo];end;end;f = Foo.new; %w{nil bar}.each { |val| p f.get_key(val) }
ddd has quit [Quit: reboot time]
apurcell has quit [Ping timeout: 255 seconds]
sevenseacat has quit [Ping timeout: 264 seconds]
<jhass>
aep: usually it helps if you just stop making stuff up and show your real code
<aep>
nah that's way too big :D i can make the pastebin thing valid code if that helps
<bradland>
code’s too bit for the internets
<aep>
a bit more context would be: it's a mapping from a model like class with accessors to a string based hash
zwer_s is now known as zwer
<jhass>
point is that the "making stuff up" process is usually loosing the important information, especially if you're unclear about what you actually want to achieve
Macaveli has quit [Ping timeout: 264 seconds]
<aep>
like, one user of the class would expect Car.color_for("steering wheel") or something, and someone has to write the logic behind that
<gregf_>
aep: whats your problem statement? you can surely paste some valid code rather than make us figure it all out?
<aep>
yeah sure
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
snath has quit [Ping timeout: 264 seconds]
hamakn has quit [Remote host closed the connection]
<martinrame>
bradland: Installed mod_passenger and got a new error, turns out I needed to change the mysql adapter to mysql2, then restarted apache and IT RUNS!!!!. Thank you for all your help.
<bradland>
“turns out I needed to change the mysql adapter to mysql2” that sounds familiar :)
<bradland>
glad to hear it worked out
govg has quit [Ping timeout: 264 seconds]
jefus has quit [Ping timeout: 245 seconds]
<martinrame>
bradland: too fast :(
<bradland>
hahaha, sorry laugh :)
<martinrame>
bradland: At least I can browse some Redmine pages.
<martinrame>
bradland: but using rvm is not a big deal.
<bradland>
right
<bradland>
you’ll need to reinstall passenger again
rbennacer has joined #ruby
rbennacer has quit [Remote host closed the connection]
<bradland>
`gem install passenger` to install the gem, then `passenger-install-apache2-module` to install the module, then `passenger-install-apache2-module —snippet` to get the config
spider-mario has joined #ruby
ndrei has joined #ruby
<martinrame>
bradland: ok, thanks for the tip
mjuszczak has joined #ruby
rbennacer has joined #ruby
<rfish2>
for some reason r18n.esl.generic.account is not showing hello and is showing a different value
<rfish2>
how come r18n.esl.generic.account is not setting?
<ecstaticpessimst>
workmad3: Alright fair enough, but I swear Ive called a function from pry which had binding.pry inside of it and then it stopped at the breakpoint
jaequery has joined #ruby
<ecstaticpessimst>
is there another way I could stop at the breakpoint?
micah has joined #ruby
soulcake has quit [Quit: Quack.]
byprdct has joined #ruby
<micah>
is there a more 'ruby' preferred way of doing this: if ( e.response.code == 500 or e.response.code == 422 )… ?
bal has quit [Quit: bal]
bal has joined #ruby
<apeiros>
I suspect that code is broken anyway due to `or`'s precedence
jaequery has quit [Client Quit]
<rfish2>
any can help me with simple ruby problem?
<apeiros>
rfish2: funny. you'll not get around looking at the source of those methods then
nuck has joined #ruby
n80 has left #ruby [#ruby]
<rfish2>
I'm using some i18n library to load the values
n80 has joined #ruby
bMalum has joined #ruby
<rfish2>
but now I have to load custom values from an external source and replace them
<bradland>
rfish2: i have installed the r18n-core gem to try and test out some of this code, but i don’t know how to use this library.
bMalum has quit [Remote host closed the connection]
iamjarvo has joined #ruby
<bradland>
can you gist some basic code to stub this out?
noop has quit [Ping timeout: 255 seconds]
aclearma_ has joined #ruby
<micah>
scpike: so if ( e.response.code == 500 || e.response.code == 422 )… i was hoping to avoid the repetition of the e.response code, but I confess the [500, 422].include?(e.response.code) way I do not like
<bradland>
as in, how is the variable r18n initialized?
kapil__ has quit [Quit: Connection closed for inactivity]
xMopxShell has joined #ruby
dfinninger has joined #ruby
<rfish2>
module R18n
<rfish2>
# Useful aliases. Set I18n object before use them:
<rfish2>
# R18n.set('en')
<rfish2>
#
<rfish2>
#
<rfish2>
# t.ok #=> "OK"
<rfish2>
# l Time.now, :human #=> "now"
<rfish2>
# r18n.locale.code #=> "en"
<rfish2>
module Helpers
<rfish2>
# Get current I18n object.
<rfish2>
def r18n
<rfish2>
R18n.get
<rfish2>
end
<rfish2>
alias i18n r18n
<bradland>
rfish2: please do not paste to the channel
<scpike>
micah: depends on context, but I wouldn't do the "include" trick for just two options. You could make a "request_failed?" function, and you can also use case statements to check two values at once like `when 500, 422`
aclearman037 has quit [Ping timeout: 256 seconds]
elfuego_ has joined #ruby
DaniG2k has joined #ruby
Gue______ has joined #ruby
Stoge88 has joined #ruby
wpp has quit []
rbennacer has quit [Remote host closed the connection]
<scpike>
micah: you've got some other syntax / indentation errors but the case statement looks good to me. I recommend trying out rubocop (https://github.com/bbatsov/rubocop) and just doing what it suggests until you have good reasons not to.
russt has joined #ruby
stunder has joined #ruby
arup_r_ has joined #ruby
<micah>
scpike: hm, i think emacs is making those indentations not right... but what is the syntax error there?
yfeldblum has joined #ruby
* micah
checks out rubocop
Olipro has joined #ruby
DaniG2k has quit [Ping timeout: 244 seconds]
astrobun_ has quit [Remote host closed the connection]
arrubin has joined #ruby
DaniG2k has joined #ruby
klmlfl has joined #ruby
hornairs has joined #ruby
<bradland>
rfish2: i don’t see anything on this gem’s homepage that would indicate you can assign values as you have suggested
hamakn has joined #ruby
<bradland>
`r18n.esl.generic.account = “Hello”` doesn’t appear to be valid usage of this API
<scpike>
micah: I don't see where response is defined, but probably I just don't know the context. I think you're on the right path.
gr33n7007h has joined #ruby
shellfu is now known as shellfu_drives
yfeldblum has quit [Ping timeout: 244 seconds]
Spami has quit [Ping timeout: 264 seconds]
rocco88 has joined #ruby
<rfish2>
damn
<bradland>
rfish2: you define your translations in yaml files, rather than explicitly setting them in your code
<bradland>
so my question would be, why do you need to assign the value like that, rather than setting it in the yml file
livathin_ has joined #ruby
DrShoggoth has joined #ruby
<rocco88>
Hi guys, to find memory leaks of an Rails App rbtrace is still the best choice?
snath has joined #ruby
<rfish2>
because I need to substitute arbitrary translations from settings based on the session
<rfish2>
they have default translations
<rfish2>
and then the user puts in his own
<workmad3>
rfish2: if that's in rails then no... the default I18n backend can't be used like that
<workmad3>
rfish2: I'd suggest taking a look at something like globalize3
ta has quit [Remote host closed the connection]
livathinos has quit [Ping timeout: 264 seconds]
<workmad3>
rfish2: even if all you do with it is take a look at how they implement an I18n backend and create your own ;)
livathin_ has quit [Ping timeout: 244 seconds]
jordanm has joined #ruby
<bhaak>
isn't there a DB backend for I18n?
pandaant has quit [Remote host closed the connection]
PanzerModern has joined #ruby
kenneth has joined #ruby
<workmad3>
bhaak: there may be... not sure if it can provide per-user translations either though :)
<workmad3>
but it's worth investigating
red_horned_rihno has quit [Ping timeout: 252 seconds]
einarj has quit [Read error: Connection reset by peer]
<rfish2>
how does pp r18n.esl.generic.account
<bradland>
rocco88: there’s rbtrace, but i think if your leak is in C code, you’ll have to use valgrind
<bhaak>
I think this should be possible, if you configure the default translation as a fallback translation
einarj has joined #ruby
<rfish2>
how come I can't override that in some way?
icebourg has joined #ruby
mikepack_ has joined #ruby
giuseppesolinas has joined #ruby
<bhaak>
rfish2: you can. I once did override it so it threw an exception when encountering an unknown translation but that would be monkey patching in its internal parts. better would be using the framework's backend mechanism to use a different storage provider
ta has joined #ruby
Pumukel has joined #ruby
DadoCe has joined #ruby
<bradland>
rocco88: rbtrace looks like it’s more useful for identifying tracing back to what is the offending caller once you’ve identified the portion of your code that is bloating your memory usage.
tectonic has quit []
<rfish2>
so there is no easy way of doing this?
<bhaak>
ah, there it is
<bhaak>
rfish2: look into I18n::Backend::ActiveRecord
<bradland>
rocco88: what version of ruby are you running? newer versions have a very different GC, so the strategies/tools for profiling memory usage are different.
<GaryOak_>
yeah any is pretty cool! didn't know about that
anaeem1 has joined #ruby
conniemj__ has joined #ruby
<nateberkopec>
using Enumerable to its full extent was a major level-up for me as a rubyist
AlexRussia has quit [Ping timeout: 256 seconds]
<GaryOak_>
it's one of the main data objects people interact with, that and hashes, so I guess it's good to get acquainted
noop has joined #ruby
DadoCe has quit [Ping timeout: 244 seconds]
<ericwood>
ruby is all about dem hashes yep yep
kenneth has joined #ruby
<nateberkopec>
ruby is all about them primitives
<ericwood>
and I HIGHLY recommend reading through the enumerable docs and getting an idea for what it offers
_maes_ has joined #ruby
kaspertidemann has quit []
livathinos has joined #ruby
conniemj_ has quit [Ping timeout: 264 seconds]
JDiPierro has quit [Remote host closed the connection]
pengin_ has joined #ruby
kl__ has quit [Ping timeout: 240 seconds]
mleung has joined #ruby
pdoherty has joined #ruby
mleung has quit [Client Quit]
leafybasil has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
mikecmpbll has quit [Ping timeout: 244 seconds]
checkit has joined #ruby
mleung has joined #ruby
hvxgr has quit [Quit: leaving]
Senjai`work has joined #ruby
Senjai`work has joined #ruby
Senjai`work has quit [Changing host]
kl__ has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
jimms has joined #ruby
davidhq has joined #ruby
rkalfane has joined #ruby
rbennacer has quit [Remote host closed the connection]
unreal has joined #ruby
ghr has quit [Ping timeout: 256 seconds]
govg has quit [Ping timeout: 264 seconds]
terlar has quit [Ping timeout: 255 seconds]
AlexRussia has joined #ruby
<BLuEGoD>
how do I exit the app after raising a rollback exception? something like rescue => e\ raise ActiveRecord::Rollback\ exit 1\ end #exit 1 is unreacheable I understand?
<kaspergrubbe>
hello
mikepack_ has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
msgodf has quit [Remote host closed the connection]
beef-wellington has quit [Ping timeout: 245 seconds]
geggam has quit [Remote host closed the connection]
anaeem1 has quit [Remote host closed the connection]
ecstaticpessimst has quit [Ping timeout: 245 seconds]
hornairs has joined #ruby
gsd has quit [Ping timeout: 245 seconds]
Rollabunna has quit [Remote host closed the connection]
treehug88 has quit []
Rollabunna has joined #ruby
ecstaticpessimst has joined #ruby
athan has quit [Ping timeout: 244 seconds]
apurcell has joined #ruby
athan has joined #ruby
beef-wellington has joined #ruby
rbennacer has joined #ruby
einarj has quit [Remote host closed the connection]
geggam has joined #ruby
uxp has joined #ruby
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
mikepack_ has quit [Read error: Connection timed out]
gsd has joined #ruby
mikepack has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
cocotton has joined #ruby
francisfish has quit [Remote host closed the connection]
DivineEntity has quit [Ping timeout: 255 seconds]
francisfish has joined #ruby
DivineEntity has joined #ruby
chthon has quit [Ping timeout: 264 seconds]
JDiPierro has joined #ruby
yfeldblum has joined #ruby
gr33n7007h has quit [Ping timeout: 265 seconds]
livathinos has quit []
treehug88 has joined #ruby
LouisRoR has quit [Ping timeout: 252 seconds]
louism2wash has joined #ruby
<louism2wash>
hey guys, is a 'class method' inside a module referred to as a 'module method?'
francisfish has quit [Ping timeout: 244 seconds]
roolo has quit [Remote host closed the connection]
browndawg has joined #ruby
roolo has joined #ruby
kl__ has quit [Ping timeout: 244 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
claudiuinberlin has quit [Quit: Leaving.]
gr33n7007h has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 244 seconds]
<GaryOak_>
louism2wash: it's just a method
sambao21 has joined #ruby
sambao21 has quit [Client Quit]
buttholecactus is now known as speakingcode-wor
wallerdev has joined #ruby
kaspertidemann has joined #ruby
roolo has quit [Ping timeout: 265 seconds]
nuck has quit [Quit: Computer has gone to sleep.]
<jhass>
louism2wash: the best ruby term is singleton method, which are methods that exist on an objects singleton class
<GaryOak_>
it also depends how you use the module, whether it's included in a class or not
evanjs has joined #ruby
zB0hs has quit [Read error: Connection reset by peer]
kl__ has joined #ruby
mrmargolis has quit [Remote host closed the connection]
<scpike>
I want to run a raw sql query against a postgres DB (e.g. `select 1 as x, 'foo' as y`) and iterate over the results. I tried using ActiveRecord::Base.connection, but there's no typecasting so all the values are strings. Is there a good library to run raw postgres sql and get strings / floats / ints based on what was in the query?
<jhass>
scpike: try Sequel
cocotton_ has joined #ruby
diegoviola has quit [Ping timeout: 245 seconds]
cocotton has quit [Read error: Connection reset by peer]
cocotton has joined #ruby
ptrrr has joined #ruby
<scpike>
jhass: nice! Sequel did the right thing
ecstaticpessimst has quit [Ping timeout: 256 seconds]
diegovio1 has joined #ruby
hamakn has joined #ruby
mikepack_ has joined #ruby
diegovio1 is now known as diegoviola
x1337807x has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
BillSussman has joined #ruby
bronson has joined #ruby
lukaszk1 has joined #ruby
claymore has joined #ruby
jkline has joined #ruby
hamakn has quit [Ping timeout: 244 seconds]
jimms has quit [Read error: Connection reset by peer]
klmlfl has quit [Remote host closed the connection]
Zai00 has quit [Quit: Zai00]
TheNumb has joined #ruby
x1337807x has quit [Ping timeout: 265 seconds]
uxp has joined #ruby
<bradland>
komanda31: what is your operating system?
<bradland>
or rather, under what operating system do you wish to run this application?
<komanda31>
bradland: osx
<komanda31>
brew installed
Pharaoh2 has joined #ruby
<bradland>
you have xcode installed?
<bradland>
i presume, since you brew already
uptownhr has joined #ruby
<komanda31>
y, including command line stuff
Pharaoh2 has quit [Max SendQ exceeded]
<bradland>
ok, you won’t want to use the system ruby
<bradland>
i’d recommend a ruby manager
<bradland>
there are three mainstream ones: chruby, RVM, and rbenv
Pharaoh2 has joined #ruby
<bradland>
personally, I use RVM
x1337807x has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
<bradland>
a ruby manager makes it much easier to install and isolate separate ruby versions to their own environment
<bradland>
even if you only need one version of ruby, they make life much easier
<komanda31>
uhu
AlexRussia has quit [Ping timeout: 256 seconds]
uxp has quit [Client Quit]
lolmaus has joined #ruby
<rastro>
day 2 of trying to setup rbenv. right now, running 'ruby -v' runs the system ruby (old) rather than the ~/.rbenv one, even though 'which ruby' shows the path prefers the rbenv ones. Any ideas?
uxp has joined #ruby
nyaa has joined #ruby
<ericwood>
just use chruby with a .ruby-version file in the dirs that matter
anaeem1_ has joined #ruby
shime has quit [Ping timeout: 244 seconds]
thisirs has quit [Remote host closed the connection]
thisirs has joined #ruby
<komanda31>
wait it takes multiple days just to setup a coding enviorment in ruby?
<bradland>
no offenst to rastro, but everone i’ve helped had some kind of environment issue
<rastro>
komanda31: trying to setup everything to make about 3 line code change to kibana. following about three different READMEs to get everything installed, etc.
<shvelo>
I just use system-wide Ruby distribution, couldn't care less about all the version managers
thisirs has quit [Client Quit]
Urocyon is now known as sfiggins
<shvelo>
installation*
<bradland>
on servers, I recommend system-wide
sdrew has joined #ruby
<rastro>
system ruby is older than what kibana developers recommend, and they point you down the rbenv hole.
Megtastique has quit []
<bradland>
install to one of the standard locations (/opt, /usr/local)
<bradland>
system-wide ruby is not the same as distribution package installed ruby
kirun has joined #ruby
<rastro>
bradland: no offense taken; i'd love it to be an env issue. PATH seems right, so... ?
michael_lee has quit [Quit: Ex-Chat]
<shvelo>
btw ruby-build is so weird, why can't it fetch recipes from an online source.
mjuszczak has quit []
<shvelo>
ubuntu includes ruby-build but it's useless since it doesn't have 2.0.0
ndrei has joined #ruby
<komanda31>
from what i briefly read ruby is a great tool to create DSL's right? that seems intresting & worth learning about, any great tutorials on that? other parts where ruby shines & i should learn it additionally to php/python/c
<ericwood>
I kinda prefer just using ruby-install over ruby-build
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ruby
conniemj__ has quit [Quit: (null)]
thumpba has joined #ruby
elaptics is now known as elaptics`away
odin22 has quit [Ping timeout: 256 seconds]
<rastro>
kibana wants ruby-build, which seems to be installed now (rbenv has an 'install' option, finally).
mikepack_ has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
<elfuego>
I’m a newbie to ruby. Can someone tell me a tool that be used to debug a ruby script.
djbkd has joined #ruby
<j416>
hmm
ta has quit [Ping timeout: 265 seconds]
<j416>
elfuego: keyboard
B1n4r10 has joined #ruby
thisirs has joined #ruby
<elfuego>
j416: can you elaborate on this tool
<j416>
sure um
<j416>
it's like a board
<j416>
it has a lot of buttons, most of them have letters printed on them
n80 has quit [Quit: n80]
<bradland>
elfuego: have a look at the pry gem
<j416>
you press the buttons to produce input to make the computer do what you want
<j416>
hah same sentence pattern on the same second
<ericwood>
inserting binding.pry into my code for breakpoints changed the way I debug drastically
<j416>
yeah
<j416>
I use binding.pry all the time
djbkd has quit [Remote host closed the connection]
<rastro>
bradland: so if 'which ruby' says '~/.rbenv/shims/ruby' and ~/.rbenv/versions only contains 1.9.3, and 'ruby -v' returns 'ruby 1.8.7', does that give you any ideas?
<bradland>
rastro: sry, on a phone call, but i’ll try to circle back
AlSquire has quit [Quit: This computer has gone to sleep]
leafybasil has quit [Ping timeout: 265 seconds]
cphrmky has joined #ruby
evanjs has quit [Remote host closed the connection]
anaeem1_ has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
conniemj__ has quit [Quit: (null)]
evanjs has joined #ruby
metadave_ has joined #ruby
x1337807x has joined #ruby
hornairs has quit [Quit: hornairs]
apeiros has joined #ruby
sargas has quit [Quit: Leaving]
baweaver has quit [Remote host closed the connection]
conniemj__ has joined #ruby
chrishough has joined #ruby
metadave has quit [Read error: Connection reset by peer]
ta has quit [Ping timeout: 264 seconds]
kl__ has quit [Ping timeout: 265 seconds]
Trieste has quit [Ping timeout: 265 seconds]
anaeem1 has joined #ruby
<bradland>
rastro: are you working on a server, or your dev environment?
<rastro>
bradland: it's a vagrant centos box.
studiotate has quit [Quit: Computer has gone to sleep.]
wolf4ood has quit [Quit: (null)]
lmickh has joined #ruby
cocotton has quit [Read error: Connection reset by peer]
<rastro>
bradland: hopefully using it to build kibana.
<bradland>
rastro: ok, and is this the only ruby app that will run on the VM?
cocotton has joined #ruby
<bradland>
because, in my experience, you can drop a whole pile of this shit on the floor and just use ruby-build directyl to install to /usr/local, and save your future self a lot of headache
<rastro>
as far as i know
<bradland>
ruby switchers in server environments have always been a huge pain in my ass
djbkd has joined #ruby
<bradland>
ok, i would *strongly* recommend ditching rbenv entirely, and working with ruby-build, which is what rbenv uses to build rubies
BillSussman has quit [Read error: Connection reset by peer]
<rastro>
installing in . directories seems like a total hack, but...
<bradland>
make sure you have all your distro package dependencies installed
anaeem1 has quit [Remote host closed the connection]
<bradland>
build-tools, readline, mysql and dev headers, and use something like `ruby-build 2.2.0 /usr/local`
<rastro>
bradland: is there a doc you can point me to for this?
anaeem1 has joined #ruby
<bradland>
rastro: not in totality
<bradland>
that’s the conundrum of system administration
<bradland>
there are a hundred ways to skin a cat
^wald0 has joined #ruby
s1ck has joined #ruby
<bradland>
i can only share what works for me. there are other opinions, and I certainly acknowledge their validity, but the best guidance I can provide is relative to what I know works for me.
<rastro>
bradland: i'm more than willing to skin it your way!
<rastro>
any skinned cat in a storm.
<bradland>
hahaha :)
<bradland>
the reason installing to /usr/local works so well is because most distros treat that as a standard installation location
<s1ck>
Hi! I think I have a problem. It's a customer of mine. He wants me to link sensor output values like temperature to data from his production planning database
fpoytk has quit [Remote host closed the connection]
<s1ck>
but that database is ingres
<s1ck>
and not very popular/common
<bradland>
so it’s on the PATH and LD_LIBRARY_PATH
<rastro>
bradland: do i need to remove rbenv first?
<bradland>
yep
<bradland>
drop that ~/.rbenv dir and remove the shim from your profile
cocotton has quit [Ping timeout: 245 seconds]
<s1ck>
so is there any chance i can get to the data? there is some kind of active record adapter for ingres but it doesnt seem maintained
<rastro>
bradland: ok, i'll go do that and try the ruby-build command from earlier.
sambao21 has joined #ruby
<bradland>
then create a VM snapshot so you can rollback and try again when this breaks because something is missing, haha
baweaver has joined #ruby
x77686d has quit [Quit: x77686d]
BillSussman has joined #ruby
klmlfl has joined #ruby
_maes_ has quit [Ping timeout: 245 seconds]
<bradland>
komanda31: have you started down the path toward a working ruby dev environment yet?
{xenomorph} is now known as xenomorph
anaeem1 has quit [Ping timeout: 245 seconds]
Trieste has joined #ruby
tubuliferous has joined #ruby
bronson has quit [Remote host closed the connection]
<rastro>
bradland: sorry, where does ruby-build come from?
<elfuego>
can someone shed some light on this piece of code ${__UUID()} i’m not sure what its doing exactly. I know this is little information but...
<bradland>
Moter8: Ok, so, a couple of things. The error in that screenshot is missing a line number, which is going to make it hard to debug, but that’ snot a Ruby issue; it looks like a problem with the editor you’re using.
<wallerdev>
! methods are dumb haha
<Moter8>
hm, it explicitely tells me to use .downcase!
Tricon has quit [Ping timeout: 255 seconds]
<Moter8>
bradland, it's codecademy's.
<Moter8>
That's why I wanted to use a local IDE
<wallerdev>
maybe it was telling you to use downcase but was trying to yell at you in the process
reinaldob has quit [Remote host closed the connection]
<bradland>
I’d skip the IDE and maybe use a regular text editor and run your files in a shell
<bradland>
What OS are you on?
<Moter8>
Windows.
<bradland>
Rubymine is fantastic, but it’s HUGE. You’ll spend as much time figuring it out as you will learning Ruby.
Deele has joined #ruby
<wallerdev>
IDEs tend to not be too useful for dynamically typed languages
jheg has joined #ruby
<wallerdev>
they're better for static typed languages like C or C#
<Moter8>
>>make sure to include !, else ruby will create a copy of the variable and modify that one instead of the original string
chrishough has quit [Read error: Connection reset by peer]
conniemj__ has quit [Client Quit]
rpag has joined #ruby
<wallerdev>
yeah i used sublime when im stuck with windows
aswen has joined #ruby
komanda31 is now known as Komanda
<wallerdev>
windows command line is awful though, i could see someone using an IDE just to avoid that haha
<wallerdev>
literally the worst commandline in existance and hasnt been updated since windows 98 :(
chrishough has joined #ruby
<bradland>
VirtualBox to the rescue!
vdamewood has joined #ruby
<wallerdev>
lol
sambao21 has quit [Quit: Computer has gone to sleep.]
swistak35 has joined #ruby
<wallerdev>
windows commandline is so bad that the programs written for it check the size of your terminal window and manually cut off lines and wrap them at whatever the current size of your window is. which means you can only select things in a rectangular pattern and if you resize things to read them they just stay cut off :(
towski_ has joined #ruby
baweaver has joined #ruby
reinaldob has quit [Ping timeout: 244 seconds]
<Moter8>
gotta restart to get into arch though
<Moter8>
ugh, and the vm wont work
<bradland>
you dual boot arch?
evanjs has quit [Remote host closed the connection]
<Moter8>
yes/used to
uptownhr has joined #ruby
<bradland>
so why won’t VM work?
io_syl has joined #ruby
<Moter8>
xome X11 crap :/
<Moter8>
(too offtopic for here)
<bradland>
ok, so here’s my crazy work around for dev VMs on Windows
x77686d has joined #ruby
jobewan has quit [Quit: Leaving]
<bradland>
install server version of ubuntu
<bradland>
install dropbox client under your user
t0rc has joined #ruby
mloveless has joined #ruby
<bradland>
put all your dev files inside dropbox, and they’ll appear on your VM without you having to fight with SCP, ntp, etc
<Moter8>
syncthing*
<Moter8>
:D
<bradland>
whatever floats your boat
<bradland>
when i have to work on windows, i do my editing under windows, and run the VM strickly as a command line
<bradland>
and shell in with putty
<Cat_1>
dropbox?
sambao21 has joined #ruby
<Cat_1>
why not just configure SSH on your VM and use an SCP client like one of the Putty ones?
<bradland>
why not just not use windows at all?
t0rc has left #ruby [#ruby]
duncannz has quit [Read error: Connection reset by peer]
ta has joined #ruby
uptownhr has quit [Client Quit]
<bradland>
*I’m* fine using SCP. some of the people for whom I’ve set up that Dropbox based scenario are not.
<bradland>
but i still needed them to be able to run some ruby scripts at a command line
uptownhr has joined #ruby
iamjarvo has joined #ruby
<bradland>
it’s actually kind of an amazingly cool setup
<bradland>
we run a shared VM on the network in the office, and the relevant users have a putty shortcut on their desktop
<bradland>
i write ruby scripts and put them on the path in the VM
bronson has quit [Remote host closed the connection]
josephnd1nton has joined #ruby
<bradland>
users drop the files they need in to Dropbox, then use the putty link to log in and run the utilities i write
noop has quit [Ping timeout: 264 seconds]
livingstn has quit []
noop has joined #ruby
uptownhr has quit [Client Quit]
ta has quit [Ping timeout: 245 seconds]
kbarry has quit [Read error: Connection reset by peer]
thisirs has quit [Remote host closed the connection]
hrs has joined #ruby
hephaestus_rg has joined #ruby
<scpike>
bradland: that's a cool setup - we do something similar. How do you handle scripts with different gem dependencies? We're using one giant Gemfile with everything "require: false".
yfeldblum has joined #ruby
<bradland>
scpike: fortunately, i haven’t run in to any gem dep conflicts. it’s mostly for munging/extracting data from files we receive from third-parties, so it’s almost entirely core and stdlib stuff.
<bradland>
like text reports from accounting systems that we want reformatted to something that can be imported to excel
jmcharnes has joined #ruby
<bradland>
in 1999, they would have been perl scripts :)
baweaver has quit [Remote host closed the connection]
Megtastique has joined #ruby
ecstaticpessimst has quit [Ping timeout: 256 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
<epitron>
ugh.. recursive mapping for hashes is so ugly
<epitron>
i need a new language abstraction for this
<epitron>
like, when you're transforming a hash, you probably don't ever want to change the keys... BUT, you may need to KNOW ABOUT which key the value is associated with
pengin_ has quit [Remote host closed the connection]
<epitron>
BUT maybe you DO want to change the keys sometimes
<epitron>
so not only is the block argument ambiguous, but so is the return value
pengin has joined #ruby
aef has quit [Read error: Connection reset by peer]
<epitron>
argument could be value, could be key,value, could be key, return value could be the value, could be the key, could be key,value
rpag has quit [Quit: Leaving]
nyaa has quit [Ping timeout: 245 seconds]
conniemj has joined #ruby
<bradland>
jgt: have a look at the return values of the block for each element
sambao21 has quit [Quit: Computer has gone to sleep.]
baweaver has quit [Remote host closed the connection]
<jgt>
I shouldn’t code late at night
<epitron>
you know what.. i need to actually figure out the situations in which map recursively needs to be used. it's been so long since i started writing this method, that i've totally forgotten why i ever needed it :)
defrang has joined #ruby
ChoiKyuSang has quit [Ping timeout: 245 seconds]
DadoCe has quit [Ping timeout: 264 seconds]
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
<rastro>
bradland: ruby -v reports 1.9.3p551. Now I can move on to step 3! Thanks for your help!
<bradland>
booya! glad that worked for you.
sambao21 has joined #ruby
jespada has quit [Ping timeout: 244 seconds]
paulfm has quit [Quit: Zzzzz...]
pengin has quit [Ping timeout: 264 seconds]
freerobby has joined #ruby
PumpkinPants has joined #ruby
metadave_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oqiwejr is now known as bitflipping
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblu_ has joined #ruby
msmith_ has quit [Remote host closed the connection]
msmith_ has joined #ruby
emmesswhy has quit [Quit: This computer has gone to sleep]
<bradland>
well, i have Parallels, and it runs Desktop Ubuntu just fine, but I never use it.
<Moter8>
well, until yesterday I had 2 monitor and I could enable 2 monitor for the vm and everything worked...
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hvxgr has quit [Quit: leaving]
hvxgr has joined #ruby
Porpado has quit [Quit: Porpado]
davidbug has joined #ruby
allcentury has joined #ruby
Porpado has joined #ruby
<bitflipping>
anyone have experience with Fiddle::WINDOWS returning false under msys2 in 64-bit windows?
ecstaticpessimst has joined #ruby
hrs has joined #ruby
stunder has quit [Quit: Leaving]
decoponio has quit [Quit: Leaving...]
geggam has quit [Ping timeout: 252 seconds]
paulfm has joined #ruby
rbrs has quit [Quit: rbrs]
mleung has quit [Quit: mleung]
bluOxigen has quit [Ping timeout: 245 seconds]
jespada has joined #ruby
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
lesnik_ has joined #ruby
<lesnik_>
Hi guys
<jhass>
hi
<apeiros>
hi guy(?)
<epitron>
sup
<jhass>
sdown
emmesswhy has joined #ruby
<Senjai`work>
jhass: nope.jpg
Senjai`work is now known as Senjai
paulfm has quit [Ping timeout: 264 seconds]
emmesswhy has quit [Client Quit]
<jhass>
yessir.png
amdbcg has joined #ruby
<amdbcg>
hello
<jhass>
hi
bronson has joined #ruby
djbkd has joined #ruby
gfawcettpq1 has quit [Ping timeout: 244 seconds]
certainty has quit [Ping timeout: 240 seconds]
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roger_rabbit has quit [Ping timeout: 255 seconds]
martinrame has quit [Quit: leaving]
nanoyak has joined #ruby
<amdbcg>
I've got a "now what?" issue - I'm just gonna provide details for a bit - helps to map these things out.
<amdbcg>
I'd like to create a ruby on rails solution, but the host only allows for php, so the next best thing is a ruby generator for scaffolding the php.
bronson has quit [Ping timeout: 240 seconds]
bitflipping has left #ruby [#ruby]
<lesnik_>
I have a simple script which print some shapes on the screen. Let's say I have a function called draw_something() and it does the job. Now my taks is to write tests for it. The problem is this function doesn't return anything, it just prints some chars. I don't know how can I test what this function prints. Any ideas?
x77686d_ has joined #ruby
<apeiros>
amdbcg: change the host. or just rent a VM.
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x77686d has quit [Ping timeout: 244 seconds]
x77686d_ is now known as x77686d
<gizmore>
lesnik_: do screenshots :P
<apeiros>
you can have one for 5$/month
<lesnik_>
gizmore: :D
<amdbcg>
apeiros: that's an easy solution yes... I've considered that, but I'm kindof hellbent on getting a form completed by the end of the week.
robpike has joined #ruby
<amdbcg>
I'm taking in a CSV file created from an excel spreadsheet that has all the column names for the db, all the labels, and successfully generated an HTML form from that CSV file using ruby
Morkel has quit [Quit: Morkel]
<amdbcg>
(dropdowns, radio buttons, the whole shebang)
<robpike>
RubyJews of New York represent!
<jhass>
lesnik_: sounds like it does via normal printing to stdout? you can do something like $stdout = StringIO.new and then examine the things it has written
<amdbcg>
I'm using a naming convention of table_columnName for the db, so the cells all get to the right tables, SQL generated and parsed.
<amdbcg>
Ideally I'd like it to go form -> form.php -> db
<amdbcg>
but it could also go ruby -> create_tables() -> db
spyderma_ has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
<lesnik_>
jhass: thanks, that's a good start
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
<amdbcg>
I guess I'll just post in #php for the rest of this - that's what I'm needing mostly.
<amdbcg>
how does one connect to a mysql database in ruby?
spyderman4g63 has quit [Ping timeout: 240 seconds]
n80 has joined #ruby
ecstaticpessimst has quit [Ping timeout: 244 seconds]
uptownhr has joined #ruby
mengu has quit [Remote host closed the connection]
<bradland>
and now i have to go say seven hail mary’s, just for using those in the same sentence
maximski has quit [Max SendQ exceeded]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
maximski has joined #ruby
ghr has joined #ruby
maximski has quit [Max SendQ exceeded]
uptownhr has joined #ruby
sambao21 has joined #ruby
borkdude has joined #ruby
uptownhr has quit [Client Quit]
maximski has joined #ruby
BillSussman has quit [Quit: Leaving]
tallgirltaadaa_ has joined #ruby
tallgirltaadaa_ has quit [Client Quit]
twisted` has joined #ruby
twisted` has left #ruby [#ruby]
phutchins has quit [Ping timeout: 244 seconds]
<lesnik_>
jhass: when i create an instance of io = StringIO, and then my tested function uses print "Something", will io be updated somehow?
<jhass>
if you assign it to $stdout, yes
<jhass>
did you check StringIO's docs?
maximski has quit [Client Quit]
ghr has quit [Ping timeout: 245 seconds]
freezey has joined #ruby
<jhass>
btw you can restore $stdout afterwards (and should asap) with $stdout = STDOUT
havenwood has quit []
giuseppesolinas has joined #ruby
conniemj has quit [Quit: (null)]
<jhass>
so best write a nice wrapper, like def capture_stdout; $stdout = StringIO.new; yield; output = $stdout.string; $stdout = STDOUT; output; end;
<freezey>
if you are doing a count like (1..50).each do |n| puts "10.11.3.#{n}" end and you want the number in section 3 to go up everytime 50 hits and loop back through
<freezey>
how would you go about doing that?
cocotton_ has joined #ruby
tchebb has quit [Read error: Connection reset by peer]
B1n4r10 has joined #ruby
tchebb has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
giuseppesolinas has quit [Client Quit]
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ghostlines has joined #ruby
drizz has quit [Remote host closed the connection]
ghostlines has quit [Max SendQ exceeded]
ghostlines has joined #ruby
<lesnik_>
jhass: thanks for your great help
hmsimha has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
conniemj has joined #ruby
postmodern has joined #ruby
cocotton has quit [Ping timeout: 244 seconds]
<allcentury>
hi all - I have a method that needs to dynamically generate a obj via a string. Here's an example: name = "Person", │ beauby_
<allcentury>
│ | API::name.new(params) -- how can I do that?y
<allcentury>
whoops
<allcentury>
hi all - I have a method that needs to dynamically generate a obj via a string. Here's an example: name = "Person", API::name.new(params) -- how can I do that?
baweaver has joined #ruby
<jhass>
allcentury: use Object#public_send
<jhass>
and please don't call methods with :: :)
<allcentury>
jhass: any reason to use that over const_get ?
<jhass>
oh, you want to fetch the constant
<allcentury>
it should look like API::Person.new at the end
<jhass>
misunderstood you there
<jhass>
so, yeah, you know the solution already, just const_get
sdrew has joined #ruby
conniemj_ has joined #ruby
<allcentury>
ok cool
<apeiros>
funny, looks similar to what I do ATM
conniemj_ has quit [Read error: Connection reset by peer]
conniemj_ has joined #ruby
Tricon has joined #ruby
<waxjar>
\o/ netsplits
uptownhr has joined #ruby
<shvelo>
and I shall split this net in the name of Cthulhu
drizz has joined #ruby
* shvelo
bangs his stick on the ground
kostitas has joined #ruby
pengin has joined #ruby
ta has joined #ruby
n80 has quit [Quit: n80]
camilasan has quit [Remote host closed the connection]
hrs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest37905 has joined #ruby
cocotton has quit [Ping timeout: 244 seconds]
rpag has joined #ruby
kalz has joined #ruby
Porpado has joined #ruby
nanoyak has joined #ruby
sleepee has quit [Max SendQ exceeded]
elfuego has joined #ruby
ValicekB has joined #ruby
sleepee has joined #ruby
codecop has quit [Remote host closed the connection]
avahey91 has joined #ruby
ghr has quit [Ping timeout: 264 seconds]
Heero has joined #ruby
djbkd has joined #ruby
ggherdov has joined #ruby
zorak_ has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
whichoneami is now known as djbender
BLuEGoD has joined #ruby
michaeldeol has joined #ruby
bronson has joined #ruby
mikepack has joined #ruby
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
MissionCritical has joined #ruby
paulfm has quit [Quit: Goodbye]
josephndenton has joined #ruby
djbkd has quit [Ping timeout: 255 seconds]
porfa has joined #ruby
hrs has joined #ruby
Olipro has joined #ruby
Dwarf has joined #ruby
powersurge has joined #ruby
kl__ has joined #ruby
keelerm has joined #ruby
mloveless has quit [Remote host closed the connection]
djbkd has joined #ruby
hrs has quit [Client Quit]
leafybasil has joined #ruby
jheg has joined #ruby
metadave has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aef has joined #ruby
freezey has joined #ruby
rpag has quit [Quit: Leaving]
Quintasan has joined #ruby
evanjs has joined #ruby
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skj3gg has joined #ruby
<skyjumper>
quiet in here today
<diegoviola>
we need more rubinius drama
<Dreamer3>
a way to make ruby stop outputing by GC envs each time i run it?
<Dreamer3>
2.1.5
<Dreamer3>
or maybe that's a flog "feature"?
<skyjumper>
question regarding "casting" to boolean (!!expression) - someone on a forum said they'd "fire on the stop" any dev caught doing that
<skyjumper>
er.. "fire on the spot"
<skyjumper>
why is that such a high crime?
<apeiros>
they didn't give a reason?
<Dreamer3>
rofl
<Dreamer3>
i do that for nil
<Dreamer3>
to get false
<powersurge>
anyone in here ever use the swagger-docs gem in conjunction with swagger-ui_rails?
<Dreamer3>
fastest way to turn value nil into boolean i thought
<skyjumper>
yeah, i can see it being convenient in edge cases
<apeiros>
Dreamer3: since ! has become a method, I'd doubt that
russt has joined #ruby
<skyjumper>
just want to know why it should be punishable by death
<powersurge>
I'm having an issue where both the docs as well as the live api are using the base_path config option from the initializer and as a result I cannot get them both to work
<powersurge>
only one or the other... very frustrating
<apeiros>
I use ternary now if I don't want to leak internal state
<skyjumper>
is there a betterw ay?
<apeiros>
makes me a little sad
<apeiros>
skyjumper: if they didn't give a reason on why it is bad, they're probably dogmatic zealots.
<skyjumper>
apeiros: aha, that's what i suspected
<apeiros>
and in that case, it doesn't really matter. either work elsewhere or follow orders without asking.
<powersurge>
to be fair it is an incidental feature and there's probably a cleaner way
<powersurge>
not really fireable though
<apeiros>
and the "fire on the spot" part actually pushes the chances for that quite high.
<skyjumper>
apeiros: or it's just internet hyperbole
<skyjumper>
still, ternary is the better way?
<powersurge>
nah people don't exagerate on the internet
<powersurge>
don't be silly
<apeiros>
if you want to avoid methods being called.
elfuego has quit [Quit: elfuego]
<apeiros>
but: define "better".
<apeiros>
varying mileages, yadda yadda…
<skyjumper>
that's why i asked. what's the real violation?
<apeiros>
remember that all values in ruby have truthiness. you only need something like !! or ? true : false if you want to avoid leaking internals.
phutchins has joined #ruby
<apeiros>
cf. String#=~. it returns nil/Int
<skyjumper>
and !! looks a lot cleaner, seems like it should be the ideal choice
mloveless has joined #ruby
<apeiros>
but I've seen people arguing to even leak internals. that again is something which I consider a bad choice.
<skyjumper>
arguing for leaking internals?
Killerkeksdose has joined #ruby
mjuszczak has joined #ruby
agrinb has joined #ruby
<apeiros>
yes
<apeiros>
as in "don't convert to boolean, just return the value, it's truthy already"
<skyjumper>
seems dangerous
<apeiros>
I agree.
<apeiros>
people tend to see what a method does, not read its docs.
<apeiros>
and then they rely on that behavior
<apeiros>
and with mutable values, there's even more at stake.
mjuszczak has quit [Client Quit]
yvemath has joined #ruby
Porpado has left #ruby [#ruby]
daynaskully has quit [Quit: quit]
agrinb has quit [Ping timeout: 245 seconds]
fandi has joined #ruby
_Andres has quit [Quit: jazz]
<epitron>
a good rule of thumb: always return the answer or nil, unless the method ends in a ?, in which case, always return true/false
momomomomo has joined #ruby
<apeiros>
the inverse is usually true too: if your method returns true/false, it should have a name ending in ?. if it doesn't, it shouldn't.
* apeiros
off, gn8
momomomomo has quit [Client Quit]
apeiros has joined #ruby
ecstaticpessimst has joined #ruby
miah has joined #ruby
fandi has quit [Ping timeout: 264 seconds]
JDiPierro has joined #ruby
bronson has quit [Remote host closed the connection]
shazaum has joined #ruby
charliesome has joined #ruby
freerobby has joined #ruby
freerobby has quit [Client Quit]
jerematic has joined #ruby
<Dreamer3>
hmmm
<Dreamer3>
so why is rbenv adding -w now
JDiPierro has quit [Remote host closed the connection]
<Dreamer3>
that seems to add a bunch of GC info i don't need
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
jerematic has quit [Remote host closed the connection]
bronson has joined #ruby
devoldmx_ has joined #ruby
<bradland>
rbenv adds -w?
iamjarvo has joined #ruby
baweaver has joined #ruby
powersurge has quit [Quit: WeeChat 0.4.3]
<bradland>
Dreamer3: are you sure rbenv is adding -w?
jerematic has joined #ruby
<Dreamer3>
it's in my shims
<bradland>
ugh, that sucks
<bradland>
maybe they’re doing that to punish people who use warn() lol
iamjarvo has quit [Client Quit]
IrishGringo has joined #ruby
poetazus has joined #ruby
sambao21 has joined #ruby
echevemaster has joined #ruby
commmmodo has joined #ruby
bl4ckdu5t has joined #ruby
bl4ckdu5t is now known as Guest54271
ghr has joined #ruby
n80 has joined #ruby
mary5030 has joined #ruby
odin22 has joined #ruby
pdoherty has quit [Remote host closed the connection]
<Dreamer3>
.rbenv/versions/2.1.5/bin/flog
<Dreamer3>
what builds these?
yfeldblum has joined #ruby
omnipotent1 has joined #ruby
<omnipotent1>
I'm trying to set and array and then print it
<omnipotent1>
set :var ['test']; puts var.inspect
DadoCe has joined #ruby
ghr has quit [Ping timeout: 252 seconds]
baweaver has quit [Remote host closed the connection]
jerematic has quit [Remote host closed the connection]
Musashi007 has quit [Client Quit]
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
kl__ has quit [Ping timeout: 256 seconds]
amdbcg has joined #ruby
charliesome has quit [Quit: zzz]
n80 has quit [Quit: n80]
<unstable>
I'm iterating over some json in ruby, and then it writes to a file. How can I make sure it always writes in an alphabetical way? eg, in python I can do sort_keys=True in json.dumps
escapement has quit [Read error: Connection reset by peer]
<bradland>
yeah, i’m pretty sure wallerdev is right. set :symbol foo adds methods.
rkornmeyer has quit [Read error: Connection reset by peer]
iRockZ has quit [Remote host closed the connection]
<omnipotent1>
ok, thanks guys
culturelabs has quit [Read error: Connection reset by peer]
dukedave has quit [Read error: Connection reset by peer]
KnownSyntax has quit [Read error: Connection reset by peer]
happyface has quit [Remote host closed the connection]
Vile` has joined #ruby
Akuma has joined #ruby
veduardo has joined #ruby
<wallerdev>
unstable: i dont think there's anything built in for that
TheNet has joined #ruby
Zai00 has joined #ruby
Musashi007 has joined #ruby
fandi has quit [Excess Flood]
Zai00 has quit [Client Quit]
fandi has joined #ruby
zorak_ has quit [Read error: Connection reset by peer]
zorak8 has joined #ruby
<terrellt>
unstable: I expect you'll have to sort your hash and then print that.
freezey has quit []
<unstable>
terrellt: What is a good way to sort my hash?
<g-nom3>
ruby nooby here... what is the correct way to parse a csv containing headers on first row ["column 1 has spaces", "column 2 has spaces", "column 3 has spaces"] into a new csv where "column 1 has spaces" is now named "index", "column 2 has spaces" is now named "owner", and "column 3 has spaces" is now named "location"?
<g-nom3>
thanks guys. i'm working my way through that doc... just taking a while to sink in i guess
chrishough has joined #ruby
davasaurous has quit [Ping timeout: 244 seconds]
studiotate has joined #ruby
<bradland>
also, it’s not real clear there, but try passing a second argument to open CSV.open(filepath, headers: true) { |row| p row }
odin22 has quit [Read error: Connection reset by peer]
CrazyM4n_ has joined #ruby
veduardo has quit [Quit: WeeChat 0.4.2]
<bradland>
when {headers: true} is passed in, each row will be a hash instead of an array
<g-nom3>
thanks bradland. i did manage to get that far thankfully. hey because i'm a noob i'm gonna have some silly questions.. like this.. what is the p row you have in that block there
<bradland>
with the header as the key
veduardo has joined #ruby
CrazyM4n has joined #ruby
<bradland>
p is the same as calling `puts my_obj.inspect`
veduardo has quit [Client Quit]
<g-nom3>
ah ok thanks
veduardo has joined #ruby
sdrew has joined #ruby
veduardo has quit [Client Quit]
jheg has quit [Quit: jheg]
veduardo has joined #ruby
<workmad3>
bradland: it also returns the object... which makes it very useful for adding into things inline (puts just returns nil) :)
<workmad3>
e.g. 'some_method(arg1, p(arg2), arg3)' <-- see what arg2 is without adding an extra line
veduardo has quit [Client Quit]
sambao21 has quit [Quit: Computer has gone to sleep.]
<bradland>
nice
<bradland>
never thought to use it in the arg list
veduardo has joined #ruby
<bradland>
that’ll be a handy one for debugging the slop i write all the time lol
Soda has joined #ruby
veduardo has quit [Client Quit]
baweaver has quit [Remote host closed the connection]