<TheMysticWyvern>
I'm having a slight issue with my Ruby. Whenever I try to run a Ruby file from the command prompt, it wants me to open it in an external program.
jamto11 has quit [Ping timeout: 272 seconds]
<TheMysticWyvern>
I do have Ruby installed.
<shevy>
jtdoncas lol yeah, even goes with one arm too \o - pontiki loves the one-armed variant
<jtdoncas>
haha, I love it
<jtdoncas>
TheMysticWyvern: what are you entering exactly? What OS?
<shevy>
sounds like windows
<TheMysticWyvern>
jtdoncas: I'm doing "cd C:\Ruby" which is where my .rb files are saved to. Then, I type in "methods.rb," and it opens up the prompt to select an external program. I'm using Windows 10 64-bit.
<zenspider>
why is it always windows?
<TheMysticWyvern>
Back when I first installed Ruby, I don't recall it ever doing this.
<jtdoncas>
ehhhhhh, windows :(
<TheMysticWyvern>
But, I took a months' hiatus from it, and now it's all weird.
<BraddPitt>
software dev on windows is a huge pain in the ass
djstorm has joined #ruby
<jtdoncas>
TheMysticWyvern: aren't you supposed to type: "ruby methods.rb"
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BraddPitt>
^
<BraddPitt>
(assuming ruby is in your $PATH variable)
jenrzzz has quit [Ping timeout: 264 seconds]
Alayde has joined #ruby
<TheMysticWyvern>
jtdoncas: ...Yes, yes I am. I can't believe I didn't remember that. I feel a tad foolish now, even though I am new to Ruby.
<zenspider>
and/or somehow associate ".rb" with ruby. ass-backwards if you ask me
<jtdoncas>
:D hehe, nice!
Azure has joined #ruby
<TheMysticWyvern>
jtdoncas: Thanks for the assist, mate.
r_baron has joined #ruby
dfockler has quit [Remote host closed the connection]
<hays>
is that something that can be done with a yield?
<cscheib>
for anyone around while I was complaining about homebrew/boxen/ruby json-1.8.2 on OSX El Capitan public beta... turns out that XCode is at 6.4, but the cli tools are at a higher version... you need the CLI tools (and possibly remove Xcode, that's what I did)
[H]unt3r has quit [Quit: Leaving]
tubuliferous_ has quit [Ping timeout: 252 seconds]
TheNet has quit [Quit: Leaving...]
tjbiddle has joined #ruby
shinnya has quit [Ping timeout: 256 seconds]
bazbing80 has joined #ruby
dgutierrez1287 has quit [Ping timeout: 246 seconds]
dimasg has joined #ruby
maletor_ has joined #ruby
kristofferR has joined #ruby
dr3w has joined #ruby
maletor__ has joined #ruby
<bazbing80>
do you include your compiled .gem in your develop branch? Or do you ignore it? Your gems are stored on rubygems / private server so why also version control them? It would be no worry having them in git as well, what's the best practise?
<toretore>
hays: a thread
baroquebobcat has quit [Quit: baroquebobcat]
braincrash has quit [Quit: bye bye]
<hays>
is it as simple as @cl=TCPClient.connect('127.0.0.1' 502); @slave=cl.with_slave(1) and then have methods that use methods in the slave object?
kies has quit [Ping timeout: 240 seconds]
maletor has quit [Ping timeout: 265 seconds]
oo_ has quit [Remote host closed the connection]
al2o3-cr1 has joined #ruby
oo_ has joined #ruby
maletor_ has quit [Ping timeout: 255 seconds]
dr3w has quit [Ping timeout: 244 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
<hays>
toretore: can I give two threads the same object and it will play nicely?
<toretore>
probably not
al2o3-cr1 has quit [Client Quit]
<hays>
not sure how to deal with that
braincrash has joined #ruby
bronson has quit [Read error: Connection reset by peer]
al2o3-cr has joined #ruby
<hays>
what can i assume is atomic in ruby
bronson has joined #ruby
Kwhy has joined #ruby
cabreraM516 has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has quit [Remote host closed the connection]
<shevy>
bazbing80 after I publish a .gem, I remove it again. There is no point in retaining it because I can rebuild it since I have a .gemspec file; however had, when I publish an updated version, I also push a copy of the .gem to a remote ftp site, just in case anyone else wants to have an older .gem
pawnbox has quit [Remote host closed the connection]
<rehat>
Radar: The Well-Grounded Rubyist
<Radar>
rehat: Yeah read all of it otherwise you will only be partially grounded
<rehat>
lol
tubuliferous_ has joined #ruby
niemcu has joined #ruby
rehat has quit []
misanthro-pyon is now known as pyon
yfeldblum has quit [Ping timeout: 246 seconds]
tubuliferous_ has quit [Ping timeout: 244 seconds]
michael_mbp has quit [Excess Flood]
mistermocha has joined #ruby
niemcu has quit [Ping timeout: 250 seconds]
swgillespie has joined #ruby
krz has joined #ruby
Macaveli has joined #ruby
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
crdpink2 has joined #ruby
michael_mbp has joined #ruby
Muhannad has joined #ruby
bruno- has joined #ruby
crdpink has quit [Ping timeout: 246 seconds]
TomyLobo has quit [Ping timeout: 240 seconds]
last_staff has quit [Ping timeout: 265 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
astrobunny has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
oo_ has quit [Remote host closed the connection]
alayek has joined #ruby
bruno- has quit [Ping timeout: 260 seconds]
noethics has quit [Quit: Leaving]
KnowledgeOwl has quit [Remote host closed the connection]
pawnbox has joined #ruby
<alayek>
hey guys, I am new to Ruby. I was doing some ruby practice from the test-first series, and I am stuck at a problem.
KnowledgeOwl has joined #ruby
astrobunny has joined #ruby
<alayek>
It's to do with a method that takes a key and a value; and sets a dictionary entry based on that.
<alayek>
I tried a lot of different syntax, but could not get it right
KnowledgeOwl has quit [Remote host closed the connection]
<bnagy>
h[k]=v
shoutsid has joined #ruby
KnowledgeOwl has joined #ruby
<alayek>
bnagy: ok, but how do I pass k and v in the function?
CloCkWeRX has quit [Quit: Leaving.]
rdark has joined #ruby
Violentr has joined #ruby
CloCkWeRX has joined #ruby
<pawnbox>
def set_dictionary(k, v)
<alayek>
Here's how I am currently doing it
<alayek>
def add(key, value=nil)
<pawnbox>
h[k] = v
jph98 has joined #ruby
<pawnbox>
end
jph98 has left #ruby [#ruby]
<alayek>
@entries[key] = value
<alayek>
end
<alayek>
Yeah, but the test case provided, is calling the method like this
tjbiddle has joined #ruby
tkuchiki has quit [Remote host closed the connection]
rdark has quit [Client Quit]
<bnagy>
don't paste code in the channel
tkuchiki has joined #ruby
<Obfuscate>
What's the least convoluted way to compact an array which naively represents a multiset e.g. [[1,a],[1,b],[1,c],[2,d],[2,e]] into [[1,[a,b,c]],[2,[d,e]]]?
<hanmac>
Objhm is that multiset-array already sorted?
<hanmac>
i mean Obfuscate
<alayek>
When I run the test cases using rspec, I get failure
subtwo has quit [Quit: (null)]
yfeldblum has joined #ruby
andersh has joined #ruby
pawnbox has joined #ruby
<bnagy>
?guys alayek
<ruboto>
alayek, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
<norc>
How does Ruby decide what encoding is used for strings?
<alayek>
Ok, sorry, umm...English is not my native tongue
<bnagy>
alayek: what error are you getting? (I see your bug, but so should you, from the error)
<Obfuscate>
hanmac: Negative, although efficiency isn't a concern for this.
<hanmac>
alayek: entries is not available, you need attr_reader :entries
<alayek>
I am getting this error when I run rake from terminal
<bnagy>
or you know hanmac could just do your homework for you :)
<norc>
I mean, I have a library that suddenly changes its internal encoding when its called from Rails magic. So Im trying to understand the mechanisms that Ruby uses that could possibly cause this.
<hanmac>
Obfuscate: ok i though i could use chunk, but that didnt work as i wanted
<alayek>
expected: {'fish' => 'aquatic animal'}
<bnagy>
norc: it's a bit weird. There are magic encoding comments.
hotpancakes has quit [Remote host closed the connection]
andersh has quit [Client Quit]
Timba-as has joined #ruby
<apeiros>
bnagy: those only concern literals in code
andersh has joined #ruby
<ljarvis>
alayek: now show us the rest of your code you're hiding
<hanmac>
alayek: @d.add('fish' => 'aquatic animal') need to be changed to @d.add('fish', 'aquatic animal')
gwl_ has joined #ruby
<apeiros>
norc: for input, Encoding.default_external and .default_internal are relevant
stan has joined #ruby
<alayek>
hmm....I figured that; but that's in the test case given in the test-first series I cloned from github
<ljarvis>
sigh
towski_ has joined #ruby
<Obfuscate>
hanmac: The group_by solution works well enough and it's only needed to generate a static table, so I think I'll leave it at that for now. Thanks though.
devoldmx has joined #ruby
<norc>
apeiros: They are both Encoding:UTF-8 at all times. But when called from Rails strings with special characters get encoded with ASCII-8BIT (it does not happen when I call the function with the same data myself)
andersh has quit [Client Quit]
<norc>
Though.. by input I suppose you meant STDIN
gwl_ has left #ruby [#ruby]
andersh has joined #ruby
<apeiros>
norc: any IO, not just stdin.
<apeiros>
and a strings encoding is determined by its .encoding value
<alayek>
Anyway, my question was if the add function is going to be invoked like that : add('a' => 'b'); how should I write the body of add function to get desired output
DeweyD has joined #ruby
<apeiros>
which is set when the string is created. how it is created defines from where ruby takes the initial value.
hotpancakes has joined #ruby
<norc>
apeiros: So if Savon decided to set the encoding of that particular string to ASCII-8BIT, I should take a closer look at Savon?
KnowledgeOwl has quit [Remote host closed the connection]
DeweyD has quit [Client Quit]
<apeiros>
how do you figure that savon "decides"? how do you figure that savon sets the encoding? what's your methodology to determine those things?
solars has joined #ruby
KnowledgeOwl has joined #ruby
<norc>
apeiros: It was just hypothetical.
<norc>
Im trying to understand what I need to look for.
startupality has joined #ruby
<bnagy>
alayek: add doesn't take a key and a value (as you were saying above)
<bnagy>
it takes a hash. So write it as def add hsh and go from there
<bnagy>
hint ri Hash#merge
<alayek>
ohh..cool
<alayek>
Thanks, will try now and let you know
devoldmx has quit [Ping timeout: 244 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sameerynho has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
<norc>
apeiros: You are right. Im just calling encode('utf-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '') on the string before writing it to my log. Not sure whether that is a great idea, but it seems to solve the immediate issue at least.
lxsameer has quit [Ping timeout: 240 seconds]
<apeiros>
norc: is your log supposed to be binary or utf-8?
<norc>
apeiros: utf-8
sinkensabe has joined #ruby
arup_r has joined #ruby
<apeiros>
then use .scrub
roolo has quit [Remote host closed the connection]
<apeiros>
don't explicitly give a source encoding unless you know the string's .encoding is wrong.
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
startupality has quit [Quit: startupality]
alayek has quit [Quit: Page closed]
startupality has joined #ruby
<norc>
apeiros: Since Im getting an ASCII_8BIT string to begin with, isnt that the wrong encoding?
<apeiros>
norc: does the string's .encoding itself already say 'ascii-8bit'?
<norc>
apeiros: If the string contains non-ascii characters yes, otherwise it says utf-8
j4cknewt has joined #ruby
<apeiros>
then why do you provide 'binary' as the second param to .encode?
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
<norc>
apeiros: I suppose in my ignorance I just copy pasted the first snipped I found without looking at it, just to realize it somehow works... :(
<norc>
At least Im honest about being silly.
shoutsid has quit [Ping timeout: 260 seconds]
<apeiros>
norc: the second param of .encode gives the string's current encoding. if not provided, it is taken from string.encoding.
<apeiros>
so unless string.encoding is expected to be wrong, you don't set it.
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
and if you expect it to be wrong, that's something to investigate.
<norc>
Ah I see.
startupality has quit [Quit: startupality]
troulouliou_div2 has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
<apeiros>
and you setting it *always* to binary has a rather bad side effect - it'll remove *everything* which is beyond ascii:
KnowledgeOwl has quit [Remote host closed the connection]
<apeiros>
that's because only 0x00-0x7f in ascii-8bit are mapped to characters. all other bytes are just that - bytes. so it can't be translated to utf-8.
KnowledgeOwl has joined #ruby
lxsameer_ has joined #ruby
<apeiros>
you saying "that string is binary" strips ruby from the information to which characters some valid utf-8 byte sequences map to.
troulouliou_div2 has quit [Remote host closed the connection]
KnowledgeOwl has quit [Remote host closed the connection]
<norc>
apeiros: Oh that is pretty neat. I have always gotten headaches wrapping my head around strings and encoding. I will surely take a look at that. :)
KnowledgeOwl has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
haxrbyte has joined #ruby
youngbaks has quit [Ping timeout: 264 seconds]
k3asd` has joined #ruby
toretore has quit [Quit: This computer has gone to sleep]
lampshades has joined #ruby
Meeh has quit [Read error: Connection reset by peer]
linduxed has quit [Ping timeout: 244 seconds]
KnowledgeOwl has quit [Remote host closed the connection]
Meeh has joined #ruby
niemcu has joined #ruby
KnowledgeOwl has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
coban2k has quit [Remote host closed the connection]
Philipp__ has joined #ruby
KnowledgeOwl has joined #ruby
baweaver has quit [Remote host closed the connection]
linduxed has joined #ruby
krz has quit [Read error: Connection reset by peer]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
Iskarlar has joined #ruby
mistermocha has joined #ruby
<adaedra>
Bonjour
araujo has joined #ruby
skade has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
<ljarvis>
hola
<apeiros>
grüezi
tomphp_ has joined #ruby
<adaedra>
do you expand that to "grueezi"?
pawnbox has quit [Remote host closed the connection]
<apeiros>
s/expand/transliterate/ - if you're a brute who doesn't have an adequate computer, yes :)
haxrbyte has quit [Quit: Leaving...]
apfeluser has joined #ruby
erowlin has joined #ruby
djbkd has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
bruno- has quit [Ping timeout: 265 seconds]
mistermocha has quit [Ping timeout: 246 seconds]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
TheHodge has joined #ruby
<norc>
apeiros: Your "full-length article" points to a funny domain.
<apeiros>
it's a placeholder
pawnbox has joined #ruby
<apeiros>
example.com is the canonical example domain :)
lampshades has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
KnowledgeOwl has quit [Remote host closed the connection]
<norc>
apeiros: Hehe. Well, now that I read your article my problem makes even less sense.
<norc>
Though I think I got a grasp on encoding in Ruby at least.
KnowledgeOwl has joined #ruby
youngbaks has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
<norc>
apeiros: Based on this article I would think that there is no difference between force_encode('utf-8') and encode('utf-8') if the string is already ASCII-8BIT encoded.
yh_ has quit [Ping timeout: 240 seconds]
matti has joined #ruby
<apeiros>
norc: there is. think of 0x80-0xff
<apeiros>
with force-encode if your binary *actually is* utf-8, those will remain
senayar has joined #ruby
<apeiros>
with encode it will tell you that it can't map those values.
KnowledgeOwl has quit [Remote host closed the connection]
<norc>
apeiros: Im getting that exact issue - but with \xC3
<apeiros>
yes, which is part of a sequence
<norc>
oh..
KnowledgeOwl has joined #ruby
workmad3 has joined #ruby
oo_ has joined #ruby
<norc>
apeiros: Can we assume for a second I didn't make that stupid remark?
<norc>
Nice, that explains my behavior!
djbkd has quit [Remote host closed the connection]
_blizzy_ has joined #ruby
Mia has joined #ruby
alex88 has joined #ruby
<adaedra>
RUBY
<rdark>
anyone recommend a gem for working with transferring relatively large files over http(s)?
Axy has quit [Ping timeout: 246 seconds]
<rdark>
or is net::http still the gem de jure?
<adaedra>
it's not a gem, it's stdlib
<rdark>
:)
rushed has quit [Quit: rushed]
<rdark>
apart from it being stdlib
DexterLB has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has quit [Remote host closed the connection]
ta has joined #ruby
KnowledgeOwl has joined #ruby
k3asd` has quit [Ping timeout: 272 seconds]
DexterLB has joined #ruby
platzhirsch has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
Renich has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
senayar has quit [Remote host closed the connection]
conor_ has joined #ruby
joonty has joined #ruby
senayar has joined #ruby
Cust0sLim3n has quit [Ping timeout: 244 seconds]
krz has joined #ruby
<adaedra>
HTTP library is a personal choice I guess, there is no "best one"
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
<rdark>
adaedra: seems that net::http will do what I want to do anyway (streaming in chunks to a stringIO, that I can then stream to s3)
<norc>
apeiros: Oh. Im beginning to get it. This is because this code point uses 2 bytes. What does Ruby try to do when the encoding is set to ascii-8bit and you use encode?
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
cron has joined #ruby
cron is now known as Guest52923
Pupeno has joined #ruby
Renich has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Cust0sLim3n has joined #ruby
Renich has joined #ruby
Cronon has quit [Ping timeout: 255 seconds]
tubuliferous_ has joined #ruby
<yorickpeterse>
morning
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
yh has quit [Ping timeout: 240 seconds]
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tubuliferous_ has quit [Ping timeout: 250 seconds]
tomphp_ has joined #ruby
devbug has quit [Read error: Connection reset by peer]
leafybasil has quit [Ping timeout: 245 seconds]
erowlin has quit [Quit: erowlin]
startupality has joined #ruby
terlar has quit [Quit: WeeChat 1.2]
Renich has quit [Ping timeout: 246 seconds]
<apeiros>
norc: as said, encode maps characters. say "A" is 0x30 in the source encoding and 0x41 in the target encoding, then that means encode from source to target translates 0x30 to 0x41. and "A" will remain "A". same character, different bytes to represent it.
ferhaty has quit []
<apeiros>
norc: but in binary, e.g. 0xC3 is not mapped to a character. if it's not mapped to a character, you can't translate the bytes to keep the character the same (because, as said, there is no character)
KnowledgeOwl has quit [Remote host closed the connection]
<apeiros>
so ruby does the sensible thing and raises. it tells you that there's bytes in the string it can't translate.
<norc>
apeiros: By which mapping fails Ruby to recognize the related character? Is it assuming a binary encoding of ascii?
KnowledgeOwl has joined #ruby
<apeiros>
norc: it assumes nothing. you tell it the source encoding. String#encoding is the value it uses for the source (or the second arg passed to .encode)
dumdedum has joined #ruby
<apeiros>
and ruby does not fail to recognize the character. the encoding *does not specify* a related character.
<norc>
"But as the name insists, its characters in the range of ASCII are considered as ASCII characters"
<apeiros>
ascii-8bit does *not have* characters in the 0x80-0xff range
<norc>
Its all falling together now.
<apeiros>
yes, the range of ascii characters is 0x00-0x7f
<apeiros>
and those it can translate.
<apeiros>
(from ascii to utf-8 even trivially - the bytes are the same there)
<norc>
apeiros: Ah. Im guessing that is why utf-8 is called "downwards compatible" to ASCII?
terlar has joined #ruby
<norc>
Because the bytes for the codepoints are the same for the characters defined by ASCII
KnowledgeOwl has quit [Remote host closed the connection]
KnowledgeOwl has joined #ruby
<norc>
apeiros: So I understand why my force_encode solves this problem. Guess I have to figure out why some library down the stack changes the encoding to ASCII-8BIT when a non-ascii character is encountered - and more to the point why that only happens when Rails calls it.
arup_r has quit [Remote host closed the connection]
<apeiros>
yes @ ascii compatible. many encodings are ascii compatible (but not all! and that's important to know)
<norc>
apeiros: Thank you for taking your time and explaining encoding basics to me.
fedexo has quit [Ping timeout: 244 seconds]
tvw has joined #ruby
casadei has joined #ruby
KnowledgeOwl has quit [Remote host closed the connection]
marr has joined #ruby
dumdedum has quit [Ping timeout: 264 seconds]
KnowledgeOwl has joined #ruby
mist has quit [Quit: oops i need to restart]
<norc>
This makes me wish there was a Ruby debugger that supported reverse debugging.
halcyone3 has quit [Ping timeout: 256 seconds]
halcyone3 has joined #ruby
chipotle has quit [Quit: cheerio]
yeticry has quit [Read error: Connection reset by peer]
casadei has quit [Ping timeout: 260 seconds]
<yorickpeterse>
reverse debugging?
<wnd>
introducing bugs?
bweston92 has joined #ruby
quimrstorres has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
towski_ has quit [Remote host closed the connection]
<[k-_>
im sure that is a cheap operation to perform
<codecodecode123>
maybe You should learn to read because i clearly said [1.1, 1.2 ,1.3 ,1.4 ,1.5], not [1.1, 1.2000000000000002, 1.3, 1.4000000000000001, 1.5]
<[k-_>
the cheapest kinds!
<ljarvis>
...
<ljarvis>
well that's me out
<yorickpeterse>
codecodecode123: you didn't read above did you?
<adaedra>
codecodecode123: you read the explanation on floats right?
<yorickpeterse>
(that's a rhetorical question)
<codecodecode123>
yes, i did
<yorickpeterse>
We explained exactly why that happens
<yorickpeterse>
and what to do about it
<yorickpeterse>
Yet you seemingly ignore that
<yorickpeterse>
I even linked you to a video that explains why this happens
meph has joined #ruby
SilentEcho has joined #ruby
<codecodecode123>
but it is not impossible for me to get [1.1, 1.2 ,1.3 ,1.4 ,1.5]
<adaedra>
Like said above
<[k-_>
did you not show him 1.1 + 0.1 = 1.20000000000000002
<adaedra>
[k-_: I did
<codecodecode123>
i want to get [1.1, 1.2 ,1.3 ,1.4 ,1.5], not [1.1, 1.2000000000000002, 1.3, 1.4000000000000001, 1.5]. period.
<yorickpeterse>
codecodecode123: last time I'm going to say it: read the message we all left
<apeiros>
yorickpeterse: rebuild the log site on every message?
<jhass>
can we have a channel aware of basic html rights please?
<ljarvis>
ruby-html-rights?
<yorickpeterse>
apeiros: log site?
* apeiros
is a ruby-html-left
<[k-_>
so clever, putting your email in plaintext!
<apeiros>
yorickpeterse: that which is currently covered by whitequark's irc log
<yorickpeterse>
why would that have to be rebuilt?
lannonbr has joined #ruby
<apeiros>
because the content is dynamic?
<jhass>
s/is/will be/
sameerynho has joined #ruby
<jhass>
soon™
pawnbox has quit [Ping timeout: 250 seconds]
<yorickpeterse>
apeiros: euh, the ruby-community website exposes logs?
<apeiros>
it will, yes
<yorickpeterse>
If so, either just use irc.whitequark.org instead, or keep it separate
startupality has quit [Quit: startupality]
<shevy>
big apeiros is watching you!
<yorickpeterse>
There's no particular reason for using Rails for a pretty much static website, but that's just my POV
<shevy>
rails all the things
symm- has quit [Ping timeout: 240 seconds]
<yorickpeterse>
which reminds me, I need to restrict access to my S3 bucket
<apeiros>
wrt static part I mostly agree. but I see no point in learning another tool if rails does just fine, even if it's overpowered for what it does.
<[k-_>
ajax all the things
<yorickpeterse>
oh yeah, which I can't do
<yorickpeterse>
because fucking cloudfront
<yorickpeterse>
well, S3 in this case doesn't redirect /foo to /foo/index.html
<yorickpeterse>
meh
rideh has quit [Quit: zap]
<apeiros>
also while most content is static right now, doesn't mean it will always be.
lxsameer_ has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
<yottanami>
jhass, I upgrade my bundler to 1.10.6 but I got error yet
<[k-_>
apeiros: dont worry, we still have all the way to the end of the year!
rideh has joined #ruby
<apeiros>
[k-_: I don't worry :)
<jhass>
yottanami: copy paste the full output then, including invocation and all your inputs
startupality has quit [Read error: Connection reset by peer]
Sumi has joined #ruby
<Sumi>
<Sumi> "/I have an issue with Passegnerruby vs PassegnerDefaultRuby alis list *ruby*"
<Sumi>
"/I am using the passegner 4.0.50 alis list *ruby*"
rideh has joined #ruby
cibs has quit [Ping timeout: 272 seconds]
<Sumi>
Always stayin only one ruby version
<bradland>
Sumi: there's a #passenger channel on Freenode as well. you may get a reply here, but #passenger would be a better bet.
Kallis has joined #ruby
hotpancakes has quit [Remote host closed the connection]
startupality has joined #ruby
<Sumi>
/I have an issue with Passegnerruby vs PassegnerDefaultRuby alis list *ruby* I am using passener 4.0.50 When I use PassegnerDefaultRuby 2 X and then try to load Passegnerruby .. its not loading
startupality has quit [Client Quit]
victortyau has joined #ruby
<Sumi>
Can any one guide me?>
codecodecode123 has quit [Quit: Page closed]
<yorickpeterse>
Sumi: #passenger
atomical has joined #ruby
<Sumi>
yorickpeterse
cibs has joined #ruby
<Sumi>
I tried there but they redirectdd me here
<Sumi>
yorickpeterse: I tried there but they redirectdd me here
<norc>
Sumi: Wonderful, now listen to yorickpeterse and find out what a redirect loop is!
<norc>
;-)
<yorickpeterse>
wtf
<yorickpeterse>
well, nice for the #passenger people to not provide support for their own product
gregf has quit [Quit: WeeChat 1.1.1]
tkuchiki has joined #ruby
Sumi has quit [Quit: Page closed]
rbennacer has quit [Remote host closed the connection]
startupality has joined #ruby
RegulationD has joined #ruby
Feyn has quit [Quit: Leaving]
<yorickpeterse>
"Is this #passenger?" "Yes" "Can I ask a question about Passenger here?" "No, go to #ruby"
mistermocha has joined #ruby
sbhatore has quit [Read error: Connection reset by peer]
Kallis has quit [Read error: Connection reset by peer]
yh_ has joined #ruby
<jhass>
well, there's also the possibility that they pushed for the actual error and not loading means their app just crashes
* jhass
joins #passenger
sdwrage has joined #ruby
startupality has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
Pathfinder has quit [Ping timeout: 245 seconds]
<yorickpeterse>
darix: dunno, never used passenger
<yorickpeterse>
But after their Raptor bullshit I have little interest in using it
melter has joined #ruby
<yorickpeterse>
"hurrhurr we know hello world means fuck all but we're going to benchmark it anyway"
startupality has quit [Client Quit]
superspring has quit [Quit: No Ping reply in 180 seconds.]
dhruvasagar has quit [Ping timeout: 264 seconds]
startupality has joined #ruby
headius has quit [Ping timeout: 244 seconds]
superspring has joined #ruby
mistermocha has quit [Ping timeout: 272 seconds]
dhruvasagar has joined #ruby
hj2007 has joined #ruby
jmignault has joined #ruby
startupality has quit [Read error: Connection reset by peer]
failshell has joined #ruby
startupality has joined #ruby
<darix>
yorickpeterse: well strictly speaking if you just want to measure your own overhead the hello world thingie is ok. most apps will be outperformed by their app server in any case. just lots of people dont understand that.
hotpancakes has joined #ruby
headius has joined #ruby
malconis has joined #ruby
malconis has quit [Remote host closed the connection]
<yorickpeterse>
hello world in every context is completely useless
<yorickpeterse>
especially if you start talking about turbo caching or w/e they called it
<yorickpeterse>
since the response is just a static string
malconis has joined #ruby
gregf has joined #ruby
<yorickpeterse>
Hm, maybe I should add some JIT code in Rbx so it JITs hello world
Cust0sLim3n has joined #ruby
<yorickpeterse>
"Rubinius 2.5.9: we can now JIT hello-world for maximum webscale"
<yorickpeterse>
also fib()
dblessing has joined #ruby
hotpancakes has quit [Ping timeout: 250 seconds]
joelataylor has joined #ruby
yalue has joined #ruby
yottanami has quit [Ping timeout: 240 seconds]
dimasg has joined #ruby
casadei has joined #ruby
mrtg9970 has joined #ruby
skakri has quit [Ping timeout: 246 seconds]
mcgain has quit [Quit: mcgain]
skakri has joined #ruby
<chrisseaton>
yorickpeterse: the new basic-block-versioning approach to JITs would allow you to JIT hello world
<chrisseaton>
(I know you're joking, but it would)
<darix>
yorickpeterse: we could precompute fib :p
DroidBurgundy has joined #ruby
yh_ has quit [Ping timeout: 250 seconds]
gamename has joined #ruby
hotpancakes has joined #ruby
rideh has quit [Quit: zap]
gamename has quit [Remote host closed the connection]
<[k-_>
and store it where?
casadei has quit [Ping timeout: 256 seconds]
gamename has joined #ruby
but3k4 has quit [Read error: Connection reset by peer]
y0da has joined #ruby
yh has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
codecop has quit [Remote host closed the connection]
hashrocket has joined #ruby
allcentury has joined #ruby
startupality has quit [Read error: Connection reset by peer]
bweston92 has joined #ruby
<adaedra>
• jhass joins #passenger
<adaedra>
jhass, searching for all cases of cross-post to report :o
<adaedra>
:p*
govg has quit [Ping timeout: 255 seconds]
failshell has quit [Remote host closed the connection]
devdazed has joined #ruby
mrtg9970 has quit [Read error: Connection reset by peer]
ffledgling has left #ruby [#ruby]
bruno- has joined #ruby
rideh has joined #ruby
sinkensabe has quit [Remote host closed the connection]
JoshL has joined #ruby
ZeeNoodleyGamer has quit [Ping timeout: 246 seconds]
hj2007 has quit [Quit: This computer has gone to sleep]
weemsledeux has joined #ruby
startupality has joined #ruby
havenwood has joined #ruby
jtdoncas has quit [Ping timeout: 250 seconds]
rideh has quit [Client Quit]
RandyT has quit [Ping timeout: 260 seconds]
apt-get_ has joined #ruby
sarkyniin has quit [Ping timeout: 240 seconds]
whippythellama has joined #ruby
rideh has joined #ruby
failshell has joined #ruby
RandyT has joined #ruby
ZeeNoodleyGamer has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
rideh has quit [Client Quit]
rideh has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gamename has quit [Remote host closed the connection]
dopie has quit [Ping timeout: 265 seconds]
gamename has joined #ruby
juanpaucar has joined #ruby
norc has quit [Ping timeout: 246 seconds]
oleksandriuzikov has quit [Quit: Leaving.]
jeremy04 has joined #ruby
pawnbox has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
dimasg has quit [Ping timeout: 255 seconds]
bmurt has joined #ruby
jgpawletko has joined #ruby
tubuliferous_ has joined #ruby
umgrosscol has joined #ruby
paulcsmith has joined #ruby
joonty has quit [Quit: joonty]
silkfox has joined #ruby
yottanami has joined #ruby
startupality has quit [Read error: Connection reset by peer]
joonty has joined #ruby
riotjones has joined #ruby
tubuliferous_ has quit [Ping timeout: 244 seconds]
rideh has quit [Quit: zap]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Chau has joined #ruby
<solars>
anyone here familiar with the oauth2 gem and can help with the basic authenticatio for google apis? :/
<[k-_>
what do you mean by "help"
rideh has joined #ruby
_blizzy_ has joined #ruby
khebbie has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 244 seconds]
machinewar has joined #ruby
centrx has joined #ruby
startupality has joined #ruby
<shevy>
he wants you to write stuff [k-_ !
rbennacer has joined #ruby
rbennacer has quit [Remote host closed the connection]
Ropeney has joined #ruby
rbennacer has joined #ruby
<[k->
don't have no time for that
ndrei has quit [Remote host closed the connection]
_blizzy_ has quit [Read error: Connection reset by peer]
<kitallis>
it seems to be behaving very oddly in terms of file writes
<[k-_>
why dont you try and see for yourself?
mistermocha has joined #ruby
<kitallis>
the index.html file – it tends to be writing things slowly but in bulk
<solars>
[k-_, well I did, that's the reason I'm asking
<[k-_>
thats what the documentation says ¯\_(ツ)_/¯
devoldmx has joined #ruby
jeremy04_ has quit [Remote host closed the connection]
sameerynho has quit [Quit: Leaving]
quimrstorres has quit [Remote host closed the connection]
haylon has joined #ruby
jeremy04 has joined #ruby
<solars>
[k-_, ...
arup_r has quit []
<[k-_>
kitallis: that's due to buffering
mistermocha has quit [Ping timeout: 246 seconds]
einarj has joined #ruby
rideh has quit [Quit: zap]
rideh has joined #ruby
<kitallis>
[k-_, hm, yeah figured
bruno- has quit [Ping timeout: 244 seconds]
charliesome has quit [Quit: zzz]
saddad has joined #ruby
devoldmx has quit [Ping timeout: 252 seconds]
<kitallis>
won't bother with $stdout.sync = true, because it flushes it consistently enough
khebbie has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 272 seconds]
Rutix has joined #ruby
<yorickpeterse>
You can manually call flush whenever needed
pyrotecnix has joined #ruby
Rutix has quit [Changing host]
Rutix has joined #ruby
dudedudeman has quit [Changing host]
dudedudeman has joined #ruby
einarj has quit [Ping timeout: 265 seconds]
andersh has quit [Quit: (null)]
darkf_ has joined #ruby
dgutierrez1287 has joined #ruby
uber has joined #ruby
conor__ has joined #ruby
darkf has quit [Ping timeout: 246 seconds]
scripore has joined #ruby
Juanchito has joined #ruby
sbhatore has quit [Read error: Connection reset by peer]
conor_ has quit [Ping timeout: 245 seconds]
dgutierrez1287 has quit [Ping timeout: 240 seconds]
baroquebobcat has joined #ruby
sbhatore has joined #ruby
christiandsg has joined #ruby
josh2 has joined #ruby
GnuYawk has quit [Ping timeout: 260 seconds]
oo_ has joined #ruby
GnuYawk has joined #ruby
pyon is now known as misanthro-pyon
josh1 has quit [Ping timeout: 250 seconds]
sinkensabe has quit [Remote host closed the connection]
f3ttX] has quit [Quit: Lost terminal]
kies has joined #ruby
Thermatix has joined #ruby
<Thermatix>
hi
<Thermatix>
having wierd ass problem with ruby gems
<Thermatix>
it keeps goin
<Thermatix>
Bundler could not find compatible versions for gem "sprockets"
RegulationD has joined #ruby
<Thermatix>
version is "~> 3.2"
startupality has quit [Quit: startupality]
<Thermatix>
why is gem doing this?
<Thermatix>
well, specificly bundler
<apeiros>
because your gemfile specifies directly or indirectly two incompatible versions of sprockets
<yorickpeterse>
Thermatix: maybe another Gem depends on another version?
conor__ has quit [Remote host closed the connection]
<Thermatix>
hmmm
hashrocket has joined #ruby
<apeiros>
but iirc bundler tells you which gems conflict
<apeiros>
if your bundler does not, update bundler
RobertBirnie has joined #ruby
<Thermatix>
is sprockets-sass needed?
<Thermatix>
becuase that's whats causing the problem
<jhass>
it's needed if you need it
<Thermatix>
what I mean
<Thermatix>
is,
loincloth has quit []
<Thermatix>
sprockets sass is suposed to fix @import and stuff not working in sprockets, but is that working normmaly in sprockets 3 or above
<Thermatix>
for sass
<Thermatix>
ofc
pawnbox has quit [Read error: Connection reset by peer]
<jhass>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<Thermatix>
normally*
<Thermatix>
no
<Thermatix>
sinatra
<Thermatix>
haven't touched rails in a while, truth be told
hashrocket has quit [Client Quit]
<jhass>
still, you'll find people more familiar with sprockets there
khebbie has joined #ruby
<apeiros>
Thermatix.enable_buffering!
<Thermatix>
ah i see what you mean
hashrocket has joined #ruby
<Thermatix>
you meant the channel!
<apeiros>
Thermatix: you can write more than two words in a single message.
dkphenom has quit [Read error: Connection reset by peer]
<Thermatix>
not the gem >_<
<Thermatix>
ok thanks for the suggestion I'll go ask them
yottanami has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
Coldblackice has quit [Ping timeout: 240 seconds]
farn has quit [Read error: Connection reset by peer]
m8 has joined #ruby
startupality has joined #ruby
conor_ has joined #ruby
khebbie has quit [Remote host closed the connection]
auzty has quit [Quit: Leaving]
dionysus69 has joined #ruby
youngbaks has joined #ruby
quimrstorres has joined #ruby
sshuff|gone is now known as sshuff
<Thermatix>
how to log in?
hobodave has joined #ruby
<jhass>
Thermatix: did you read the message? /msg NickServ help
freerobby has joined #ruby
Igor2__ has joined #ruby
tmtwd has joined #ruby
<dudedudeman>
there is a #sinatra channel as well, i have gotten some good help from there, even if it is a little quieter
krz has joined #ruby
<Igor2__>
hi all; I have some C code that used to work with ruby 1.8 but the API has changed with 1.9
<Thermatix>
listchans
hobodave has quit [Read error: Connection reset by peer]
<jhass>
Igor2__: and with 2.0, 2.1 and 2.2. 1.9 is EOL, 2.0 will be soon enough, port it to 2.2 ;)
<Igor2__>
the code wants to use rb_define_global_function to register multiple global functions to a single C function
hobodave has joined #ruby
<Igor2__>
and there is a dispatcher in the C function that figures out the actual function name used in ruby
paulcsmith has quit [Read error: Connection reset by peer]
<Igor2__>
sure, API changes are normal ase stuff evolve
paulcsmith has joined #ruby
<Igor2__>
my problem is that I can't seem to find how to get this function name info with later versions
oo_ has quit [Ping timeout: 255 seconds]
<Igor2__>
(i am indeed trying with 2.2, but I wouldn't be too unhappy if the solution worked with older versions)
<Igor2__>
the old code uses ruby_frame->orig_func (ugly hack)
tjohnson has joined #ruby
pawnbox has quit [Remote host closed the connection]
oo_ has joined #ruby
paulcsmith has quit [Client Quit]
christiandsg has quit [Remote host closed the connection]
hotpancakes has quit [Remote host closed the connection]
coban2k has joined #ruby
paulcsmith has joined #ruby
ndrei has joined #ruby
Thermatix has left #ruby ["Leaving"]
DroidBurgundy has quit []
hashrocket has quit [Read error: Connection reset by peer]
<Igor2__>
all I seem to find is for 1.8
pyrotecnix has quit [Quit: WeeChat 0.4.2]
oo_ has quit [Ping timeout: 240 seconds]
<Igor2__>
(it would have been really cool to have this info in argv[0])
EagleDelta has joined #ruby
kaleido has joined #ruby
astrobunny has joined #ruby
<jhass>
I guess if everything else fails you could write some macro that binds them to individual functions that call your dispatcher with the name as argument
<Igor2__>
can't
<[spoiler]>
Igor2__, if I understood right, you want to access the name of the method that's being called?
<Igor2__>
the thing is dynamic
<Igor2__>
that would require generating C functions runtime
kaleido has left #ruby [#ruby]
<Igor2__>
[spoiler]: exactly
nofxx has quit [Ping timeout: 264 seconds]
juanpaucar has quit [Read error: Connection reset by peer]
pyrotecnix has joined #ruby
jespada has joined #ruby
hotpancakes has joined #ruby
oo_ has joined #ruby
youngbaks has quit [Quit: WeeChat 1.2]
<[spoiler]>
Hmm. Global function is a method defined on Kernel ? (ie, `def a; dostuff; end` without a )?
<Igor2__>
i am not really sure, i'm on the C side of this, not on the ruby side
failshell has quit [Remote host closed the connection]
oo__ has quit [Remote host closed the connection]
<Igor2__>
all I know is that the dispatcher function is registered using rb_define_global_function()
hotpancakes has quit [Ping timeout: 244 seconds]
oo_ has quit [Ping timeout: 252 seconds]
chipotle has joined #ruby
rbennacer has quit [Remote host closed the connection]
failshell has joined #ruby
DoubleMalt has joined #ruby
ValicekB has quit [Ping timeout: 250 seconds]
Thermatix has joined #ruby
jamto11 has joined #ruby
rippa has joined #ruby
<Thermatix>
welp, I asked in #RubyOnRails and managed to kill the conversation
<Thermatix>
dead
<adaedra>
he's dead jim
Burgestrand has joined #ruby
<[spoiler]>
Igor2__: I forgot what rb_define_global_function does, but you can define a `method_missing` method on Object and check in there if the called method name is
freerobby has quit [Quit: Leaving.]
<Thermatix>
as a doornail XD
<[spoiler]>
on the list of method names, or just use alias_method
<Igor2__>
i'm a bit confused now
<Thermatix>
I think rb_define_global_function is a way to define a method on the global name-space
<Igor2__>
I'm in plain C, so I don't have methods or clases there; you mean ruby methods right?
khebbie has joined #ruby
coban2k has quit [Remote host closed the connection]
<Thermatix>
it says rb_define_global_function defines a global function
<[spoiler]>
Igor2__: use rb_define_method
baroquebobcat has quit [Quit: baroquebobcat]
radgeRayden_ has joined #ruby
radgeRayden has quit [Ping timeout: 244 seconds]
<Igor2__>
let's say I switch to rb_define_method and my dispatcher C func is called, what's the name of the function i need to use to get to the method name?
skade has joined #ruby
jamto11 has quit [Ping timeout: 245 seconds]
<[spoiler]>
you define rb_missing which will then dispatch your function
<[spoiler]>
sorry method_missing
<[spoiler]>
lol
misanthro-pyon is now known as grum-pyon
<[spoiler]>
or you can add aliases
Chau has quit [Quit: Leaving]
<[spoiler]>
to a single method, that method would then call the c function, or be the c function
startupality has quit [Quit: startupality]
jamto11 has joined #ruby
ValicekB has joined #ruby
halcyone3 has quit [Quit: WeeChat 1.2]
hotpancakes has joined #ruby
bruno- has joined #ruby
nitrix is now known as HNO3
mistermocha has joined #ruby
juanpaucar has joined #ruby
djstorm has joined #ruby
dr3w has joined #ruby
Muhannad has quit [Ping timeout: 250 seconds]
<Igor2__>
this is going to be more complicated than i thought :/
conor_ has quit [Remote host closed the connection]
<Igor2__>
(i don't have a klass)
jhack has joined #ruby
Blaguvest has joined #ruby
polpak has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
conor_ has joined #ruby
<[spoiler]>
your klass is Object
<[spoiler]>
or you can define the method on Kernel
gregf has quit [Quit: WeeChat 1.1.1]
prestorium has joined #ruby
<Igor2__>
rb_mKernel?
paulcsmith has joined #ruby
<[spoiler]>
which is included by Object (or was when the last time I was writing a C extension)
<adaedra>
sinatra is not very populated, answers can be slow
juanpaucar has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 244 seconds]
<Thermatix>
my response got ignored in rubyonrails and there's 600 people XD
Philipp__ has quit [Read error: Connection reset by peer]
<Thermatix>
any way
<Thermatix>
I don't think It's going to be an issue
<shevy>
nobody does ruby + web anymore
<Thermatix>
any way, thanks for trying at lease :)
<adaedra>
no one likes the matrix
<Thermatix>
lol
<Thermatix>
I did,
<Thermatix>
the first one at any rate, the others were.... ok
icebourg has joined #ruby
andersh has joined #ruby
jbw_ has quit [Remote host closed the connection]
dr3w has quit [Remote host closed the connection]
Cache_Money has joined #ruby
josh3 has joined #ruby
dr3w has joined #ruby
gregf has joined #ruby
juanpaucar has joined #ruby
grum-pyon is now known as pyon-nanon
hobodave has quit [Quit: Computer has gone to sleep.]
josh2 has quit [Ping timeout: 244 seconds]
failshell has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
petersaints has joined #ruby
<[spoiler]>
adaedra: I'm glad I wasn't the only one who read his username wrong
hobodave has joined #ruby
failshell has joined #ruby
<adaedra>
[spoiler]: [spoiler] I didn't.
Vile` has quit [Ping timeout: 252 seconds]
apt-get_ has quit [Quit: Quit]
<[spoiler]>
oh :(
<[spoiler]>
So I am the only one
sarkyniin has joined #ruby
bruno- has quit [Ping timeout: 264 seconds]
ta has quit [Remote host closed the connection]
* [spoiler]
sulks.
<adaedra>
there there.
* adaedra
feeds [spoiler]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
meph has quit [Remote host closed the connection]
rcvalle has joined #ruby
<adaedra>
Snape kills Dumbeldore
<adaedra>
le?
<Igor2__>
i've read it wrong too
startupality has joined #ruby
Vile` has joined #ruby
MudkipFan has joined #ruby
<Igor2__>
ogg, there's no ruby_exec() either
<MudkipFan>
is there a codeschool for comuter security?
<Igor2__>
s/ogg/ohh/
jhack has quit [Remote host closed the connection]
* [spoiler]
omnomnoms
<Igor2__>
i guess porting from 1.8 is not the few minutes task i though it'd be :/
<[spoiler]>
Igor2__: oh, no it definitely won't be :P
startupality has quit [Client Quit]
<[spoiler]>
why are you using ruby_exec() anyway?
eGGsha has joined #ruby
gambl0re has joined #ruby
<Igor2__>
i'm not sure, it's not my code
<Igor2__>
btw, the whole thing is 184 lines of C, this why I had high hopes for an easy update)
roger_rabbit has joined #ruby
<Igor2__>
the idea is that it loads a script, binds some functions to a dispatcher than runs the script
yardenbar has quit [Quit: Leaving]
quimrstorres has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
quimrstorres has joined #ruby
<Igor2__>
(I guess it's clear by now that I have 0 idea about ruby, so I don't know why it does this the way it does - I only know it works with 1.8)
startupality has joined #ruby
<[spoiler]>
the way it works sounds to me like it could work better, to be honest
<Igor2__>
possibly
<Igor2__>
the C project is not OOP, and honestly, I'd like to go for the simplest approach possible
<Igor2__>
it's a multi-language project that tries to provide a common intrface independent of the scripting lagnuage so instead of trying to do the most advanced stuff in each language it goes for a common minimum
<Igor2__>
which is generally function calls in script->c and c->script directions
yh has quit [Read error: Connection reset by peer]
<Igor2__>
(this why it scars me that I need to use methods with ruby)
dionysus69 has quit [Ping timeout: 256 seconds]
<Igor2__>
*scares
<[spoiler]>
anyway I think a replacement for `ruby_exec` cold be rb_eval_string
icebourg has quit []
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rideh has quit [Quit: zap]
icebourg has joined #ruby
<Igor2__>
hmm
<Igor2__>
i am not sure abou that:
tubuliferous_ has quit [Ping timeout: 240 seconds]
<Igor2__>
normally the script (written in whatever language) has a dedicated init part that runs once then the C code calls functions
<Igor2__>
in ruby, the init part is not in any function, it's just there at the end of the script
<Igor2__>
so I need something that runs that part
<[spoiler]>
Can you show the source, or is it proprietary/in house?
ivanskie has joined #ruby
yh has joined #ruby
<[spoiler]>
this is the signature is `VALUE rb_eval_string(const char *str);` so it evaluates a NULL-terminated C string. So, if your script is a string, that should do it
<Igor2__>
it's public
<Igor2__>
svn://repo/hu/gpmi/trunk is the parent project
gregf has quit [Quit: WeeChat 1.1.1]
Meow-J has quit [Quit: Connection closed for inactivity]
<Igor2__>
the script is a file i load with rb_load_file()
tvw has quit []
<Igor2__>
the ruby-specific glue is in trunk/src/modules/ruby
<jhass>
uhm, repo == ?
<Igor2__>
oops, sorry, typo
<Igor2__>
svn://repo.hu/gpmi/trunk
<[spoiler]>
I can't
<[spoiler]>
oh
<adaedra>
.hu
<adaedra>
that's far away
deepu has joined #ruby
<Igor2__>
from where?
andersh has quit [Quit: (null)]
gemgemcli has joined #ruby
<adaedra>
everywhere
<Igor2__>
lol
<Igor2__>
i happen to live in .hu
<Igor2__>
so it's pretty close to me
<adaedra>
:)
scripore has quit [Quit: This computer has gone to sleep]
gemgemcli has quit [Client Quit]
scripore has joined #ruby
jhack has joined #ruby
khebbie has quit [Remote host closed the connection]
<Igor2__>
the svn HEAD version is far ahead already, although the ruby part is broken at the moment
<Igor2__>
anyway the ruby module didn't change any since 0.9.3 so for reference that's good enough
coban2k has joined #ruby
RegulationD has quit []
<Igor2__>
i guess i could run the main part by the eval() trick, but i guess the script context wouldn't persist
<youch>
what is the difference between calling an instance var with `@var` and `self.var`?
<Igor2__>
so i couldn't make further calls into it
<[spoiler]>
youch: self.var uses public access
<jhass>
youch: first accesses the var directly, self.var is a method call
<polpak>
youch: self.var calls a method
<[spoiler]>
and is actually a method; so if you didn't define attr_accessor or attr_reader, it won't work
dfockler has joined #ruby
RegulationD has joined #ruby
startupality has quit [Read error: Connection reset by peer]
<[spoiler]>
Igor2__: hmm where's the ruby script file? I don't see a .rb file in modules/ruby
<youch>
ah ok so the method may or may not return the actual instance var? it could be the var+10 or something like that depending on your method?
<jhass>
youch: to clarify, attr_reader :var just defines a method that looks like this: def var; @var; end
<[spoiler]>
youch: yes, indeed
<youch>
jhass: i see
dfockler has quit [Remote host closed the connection]
<Igor2__>
it's in src/scripts/ruby
<[spoiler]>
oh ok thx
<youch>
thanks guys
<jhass>
?guys youch
<ruboto>
youch, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
<jhass>
;)
<adaedra>
that eye blink is offensive to one-eyed people who can't do that
<Igor2__>
I thank you for spending time on this
<[spoiler]>
?odin
<ruboto>
I don't know anything about odin
Lucky__ has joined #ruby
<youch>
ruboto thanks for the advice, i wasnt even thinking about that
<[spoiler]>
adaedra: I tried
blue_deref has quit [Quit: bbn]
arup_r has joined #ruby
<[spoiler]>
ruboto: ruboto is a bot; jhass prompted it to tell you that
<adaedra>
?ruboto
<ruboto>
I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
<[spoiler]>
I'm sorry I called you an it, ruboto. I
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfockler has joined #ruby
<Igor2__>
lol
pothibo has joined #ruby
<youch>
haha
<[spoiler]>
Igor2__: there's no src dir in here, or I'm blind
<Igor2__>
let me check what's the root of the gz
niemcu has quit [Ping timeout: 240 seconds]
<[spoiler]>
inside the /scripts/ are just example directories
<Igor2__>
0.9.3/scripts/example_ruby/
<[spoiler]>
oh durrr, ok sorry
Timba-as has quit [Quit: Be back later ...]
<Igor2__>
it seems my packagign is slightly broken so src got ripped out
startupality has joined #ruby
Alayde has joined #ruby
<Igor2__>
so the idea is that gpmi'd like to load the script once
<Igor2__>
the "init part" should run then
MudkipFan has quit [Quit: Page closed]
<Igor2__>
and the script (and its context) should stay in memory so later gpmi could call ruby functions
<Igor2__>
ideally there could be multiple script contexts in memory, but the original code fails on this
<Igor2__>
(probably because the hackish way it loads the script)
Pupeno has quit [Quit: Leaving...]
OrbitalKitten has joined #ruby
pietr0 has joined #ruby
pyon-nanon has quit [Ping timeout: 246 seconds]
joonty has quit [Quit: joonty]
gemcli has quit [Ping timeout: 246 seconds]
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
<[spoiler]>
I'm not sure you can have moltiple intepreter instances anyway; ruby has lots of global state
<[spoiler]>
you could use mruby if you wanted something embedded
<[spoiler]>
it has a much, much nicer API
dkphenom has joined #ruby
<Igor2__>
checkign
MatthewsFace has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<jhass>
keep in mind that mruby is dialect of Ruby though
hashrocket has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Lucky__ has joined #ruby
<[spoiler]>
True
<[spoiler]>
But it does support most of Ruby
<Igor2__>
my user base count is 1
darkf_ has quit [Quit: Leaving]
<Igor2__>
so there won't be anything broken if i switch ruby dialects
<[spoiler]>
there's a few things it doesn't support
<[spoiler]>
what springs to mind is `defined?` operator
<[spoiler]>
there's more but meh
freerobby has joined #ruby
conor_ has quit [Remote host closed the connection]
<Igor2__>
it looks promising: has documentation, releases, it's even in debian testing
<[spoiler]>
Igor2__: it might be a bit of extra work, but switching to Ruby might be worth in in the long run
<[spoiler]>
mRUby*
hobodave has quit [Quit: Computer has gone to sleep.]
<[spoiler]>
asdfghjkl; mruby*
higuys has joined #ruby
<Igor2__>
I mostly agree; currently I think it may be even less work
conor_ has joined #ruby
<Igor2__>
I really have no idea about ruby, so the question is whether i learn more about ruby or mruby, starting both from 0
<Igor2__>
if mruby is generally smaller, I guess it's less work to gt it working to my small use case
DoubleMalt has quit [Remote host closed the connection]
gambl0re has quit [Read error: Connection reset by peer]
lannonbr has quit [Quit: WeeChat 1.2]
<[spoiler]>
Well, the APIs are very similar; if you learn either you can easily adapt to the other in terms of the C api
<[spoiler]>
the language is *essentially* the same (both are Ruby, but mruby doesn't support some features because it's designed to work on embedded systems)
troulouliou_div2 has quit [Quit: Leaving]
greenarrow has quit [Quit: 500]
<[spoiler]>
also, with mruby you might need to sometimes tango with the gc arena
<[spoiler]>
in case you generate a lot of objects
troulouliou_div2 has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
paulcsmith has quit [Quit: Be back later ...]
devoldmx has joined #ruby
<[spoiler]>
`int mrb_gc_arena_save(mrb)l and `mrb_gc_arena_restore(mrb, int);` are your friends
troulouliou_div2 has joined #ruby
Channel6 has joined #ruby
pauly_oc has quit [Ping timeout: 245 seconds]
hanmac has quit [Ping timeout: 244 seconds]
scripore has joined #ruby
<Igor2__>
good, thanks for the idea
Oka has joined #ruby
* Igor2__
is saving the irc log
allcentury has quit [Ping timeout: 250 seconds]
<Igor2__>
especially because of the multiple instance support, i think i'll go for mruby first
ndrei has quit [Remote host closed the connection]
<[spoiler]>
any Ruby object generated between these two will be destroyed
<Igor2__>
i see
<[spoiler]>
*unless* there's a live reference to it
failshell has quit [Remote host closed the connection]
<[spoiler]>
(is a reference from a previously generated object)
leat has joined #ruby
senayar has quit []
hobodave has joined #ruby
<Igor2__>
I think the C part won't create dyamic objects (there are no communication through variables or antyhing like that)
linuxboytoo has joined #ruby
<[spoiler]>
That's good then
ylluminarious has joined #ruby
<Igor2__>
s/are/is/
sepp2k has quit [Quit: Leaving.]
Torrieri has quit [Quit: Be back later ...]
pyon-nanon has quit [Ping timeout: 255 seconds]
<shevy>
we need more C gurus in ruby
dcarmich has joined #ruby
farn has joined #ruby
punkerplunk has joined #ruby
<jhass>
shevy: because Ruby is so slow? :P
ndrei has joined #ruby
<Igor2__>
at least the user/developer support is excellent so far
Timba-as has joined #ruby
nofxx has joined #ruby
solars has quit [Ping timeout: 265 seconds]
<[spoiler]>
jhass, shevy: lol
<[spoiler]>
jhass: It's not slow, it just likes to take its time :)
hashrocket has quit [Ping timeout: 250 seconds]
AlexAltea has joined #ruby
<[spoiler]>
Y'know, there's no need to rush things
<jhass>
I know I know
Torrieri has joined #ruby
<[spoiler]>
It has a "take it easy" attitude
<jhass>
I have Crystal for when I need to rush
stan has quit [Ping timeout: 244 seconds]
ta has joined #ruby
<[spoiler]>
Ooh I played with that actually, Crystal is <3
sarkyniin has quit [Quit: Quit]
<jhass>
totally
Torrieri has quit [Client Quit]
khebbie has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maletor has joined #ruby
<[k-_>
Hindley Millner is <3
<punkerplunk>
guys, I need help. Suppose I have an ordered array of numerics and I have this other value and I want to find the index for the nearest number in the array. How would that look?
blackmesa has quit [Ping timeout: 260 seconds]
tomphp_ has quit [Ping timeout: 255 seconds]
ndrei has quit [Remote host closed the connection]
khebbie has quit [Remote host closed the connection]
* [spoiler]
waits for someone to do questionmarkguys
higuys has quit []
<dfockler>
?guys
<[spoiler]>
hahaha
<punkerplunk>
I'm sure there is a regular expression
<lagweezle>
?guis
<ruboto>
I don't know anything about guis
gambl0re has joined #ruby
<dfockler>
punkerplunk: are they numeric strings?
alex88 has quit []
<punkerplunk>
they are ints
<[spoiler]>
punkerplunk: how about array.index number
<jhass>
punkerplunk: mmh, only have a O(3n) algo in mind: map to distance, find minimum, find index in distance map
OrbitalKitten has joined #ruby
<jhass>
[spoiler]: closest
dangerousdave has joined #ruby
<[spoiler]>
what does closest mean
joonty has joined #ruby
<dfockler>
what if it's equal between two numbers?
<apeiros>
O(3n) is still O(n) ;-)
<punkerplunk>
the number I have is not necessary contained in the array
<[spoiler]>
Oh!
<[spoiler]>
Okay i get it
<[k-_>
fiddlesticks
<punkerplunk>
it could be between two numbers, yeah
<jhass>
now that we helped
<jhass>
?guys punkerplunk
<ruboto>
punkerplunk, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
<punkerplunk>
oh right!
<hoelzro>
you could use a binary search to find the index where the number *would* reside, and compare the number at that index, or adjacent indices
<apeiros>
the numbers are ordered - then you can do in O(logn)
<apeiros>
binary search
<dfockler>
^
<apeiros>
even in stdlib/core now
<punkerplunk>
sorry! omg I even went to school in oregon and I forgot my pronoun ediquite!
<Igor2__>
[spoiler]: I'm off now, thanks again for the support. I may be back to ask more questions
ndrei has joined #ruby
hanmac has joined #ruby
<[spoiler]>
Igor2__: good luck with your project! :)
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
dumdedum has quit [Ping timeout: 250 seconds]
Porfa has joined #ruby
<Porfa>
hellos
<havenwood>
Porfa: hi
jpfuentes2 has joined #ruby
<jhass>
dfockler: there's no real such thing as child and parent threads, there's the main thread but that's nothing special beyond being the first one and automatically spawned by the OS
scripore has quit [Quit: This computer has gone to sleep]
jamto11 has quit [Remote host closed the connection]
andersh has joined #ruby
ramfjord has joined #ruby
sargas has joined #ruby
rideh has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kirun has joined #ruby
MasterPiece has joined #ruby
bodgix has quit [Quit: Leaving.]
davedev24 has quit []
alfajor has quit [Quit: Leaving]
millerti has joined #ruby
rdark has quit [Ping timeout: 244 seconds]
chabil has joined #ruby
jamto11 has joined #ruby
msnyon has joined #ruby
startupality has quit [Quit: startupality]
hobodave has quit [Quit: Computer has gone to sleep.]
casadei has joined #ruby
jamto11 has quit [Ping timeout: 272 seconds]
startupality has joined #ruby
Timba-as has quit [Ping timeout: 244 seconds]
jamto11 has joined #ruby
Timba-as has joined #ruby
rideh has quit [Quit: zap]
sshuff|gone is now known as sshuff
rideh has joined #ruby
big|bad|wolf has joined #ruby
lannonbr has quit [Ping timeout: 240 seconds]
conor_ has quit [Remote host closed the connection]
arturhoo has joined #ruby
big|bad|wolf has quit [Max SendQ exceeded]
conor_ has joined #ruby
suchness has quit [Ping timeout: 244 seconds]
<TomyLobo>
as any electrician would tell you, there is no such thing as partially grounded
<TomyLobo>
whoops, i was scrolled up
conor_ has quit [Remote host closed the connection]
rideh has quit [Client Quit]
<eam>
it's good advice regardless
startupality has quit [Quit: startupality]
<TomyLobo>
it was in reply to this: <rehat> Radar: The Well-Grounded Rubyist
<TomyLobo>
<Radar> rehat: Yeah read all of it otherwise you will only be partially grounded
AlexRussia has quit [Ping timeout: 260 seconds]
tubbo has joined #ruby
<tubbo>
is there a method i can override that's basically "method_missing for constants"?
<shevy>
not sure that this can be possible
<tubbo>
like say someone refers to a class called Product, but if that class doesn't exist, I want to replace it with something else
<shevy>
remember, in class Foo Foo is also a constant
<kenichi>
how about Kernel.const_get and rescue a NameError
<shevy>
you could try to rescue the exception
<stoodfarback>
Object.const_missing
<shevy>
ohhh
startupality has joined #ruby
<tubbo>
so here's what i want to do, essentially: I want to have a class, say Product...gonna initially ship that class in MyEngine::Product, but i want a host app to just be able to do class Product < MyEngine::Product to override it
rideh has joined #ruby
<tubbo>
in the controller, it will be referred to as @products = Product.all
<tubbo>
lol sorry forgot this was just #ruby :P
<tubbo>
stoodfarback: thank you
big|bad|wolf has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<bradland>
yeah hanmac, i'm not sure how the new Ruby profiling features handle C extensions
<miah>
i'd imagine you'd have to profile the C code with something else (like gprof) and then ruby-prof your adapter
codecop has quit [Remote host closed the connection]
<hanmac>
miah ... the problem is how to profile my binding, and not profile the library below (so i detect only my bugs) or other libraries where the library below is build against
<miah>
ya
<hanmac>
i never worked with profilers deep enough to work something like that out
<miah>
seems very tricky
pawnbox has quit [Ping timeout: 250 seconds]
codecop has joined #ruby
ndrei has joined #ruby
<Burgestrand>
You can profile Ruby C code quite nicely (and your own bindings), assuming you install debug symbols for the Ruby source and compile your binding with GDB symbols enabled.
<banister>
Burgestrand lol, ltns
<banister>
Burgestrand what u been doing these days
<Burgestrand>
banister: indeed! Been working with Ruby professionally which made it less attractive to sit with Ruby at home. :)
<banister>
Burgestrand me too
<Burgestrand>
Burgestrand: and I don't hang out on IRC during work hours ;)
<banister>
Burgestrand still in sweden?
<Burgestrand>
… nice to mention myself, derp.
<Burgestrand>
banister: Yep, still in Sweden!
amclain has joined #ruby
<banister>
Burgestrand i'm now in netherlands, not sure i mentioned that last time we talked
<Burgestrand>
banister: You got out of your island though didn't you? I recall you had plans.
hololeap has quit [Ping timeout: 250 seconds]
<banister>
yeah
<Burgestrand>
:)
<banister>
living in NL
gamename has quit [Remote host closed the connection]
<Burgestrand>
banister: You miss living in LOTR-land?
gamename has joined #ruby
ndrei has quit [Remote host closed the connection]
<banister>
Burgestrand yes, NL has no mountains or landscape to speak of
<banister>
it's just flat, flat flat
<banister>
exceptionally boring place
Rickmasta has joined #ruby
gamename has quit [Read error: Connection reset by peer]
<Burgestrand>
Haha, yes, tulip land all over the place
ndrei has joined #ruby
scripore has joined #ruby
jbw has quit [Remote host closed the connection]
jbw has joined #ruby
codecop has quit [Remote host closed the connection]
braincra- has joined #ruby
linuxboy_ has joined #ruby
<banister>
Burgestrand i'm going to visit visby in gotland soon
<banister>
have you been there?
braincrash has quit [Ping timeout: 272 seconds]
NeverDie has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Burgestrand>
banister: Cool! You going for the medieval week? I haven't been on the island itself, but I'd like to visit some time, there's lots of places there allegedly named by my ancestors.
<banister>
Burgestrand no, just because of kiki
mistermocha has joined #ruby
<Burgestrand>
banister: Ha, TIL.
<banister>
ha you googled?
<Burgestrand>
banister: professional programmer always googles ;)
AlphaAtom has joined #ruby
jbw has quit [Remote host closed the connection]
<Burgestrand>
banister: apparently medieval week was last week
maletor has quit []
momomomomo has joined #ruby
linuxboytoo has quit [Ping timeout: 272 seconds]
jbw has joined #ruby
<Burgestrand>
banister: once a year the Gotland island has a medieval festival with all kinds of things, tour games, theaters, markets etc.
maletor has joined #ruby
Jackneill has joined #ruby
jbw has quit [Remote host closed the connection]
<banister>
Burgestrand any interesting OSS you're working on or so?
<devn>
is there anything for ruby that I could use to take some existing code, and automatically log /all the things/, results of if statements, method calls, variable values, etc?
JakFrist has joined #ruby
<Burgestrand>
banister: don't think so! looking at elixir at the moment.
ddubs has joined #ruby
<jhass>
devn: seeing_is_believing
tmtwd has quit [Ping timeout: 260 seconds]
bruno- has quit [Ping timeout: 256 seconds]
OrbitalKitten has joined #ruby
<Burgestrand>
unver: for one you could use flat_map!
<banister>
jhass that's more of an interactive thing though isn't it?
<ddubs>
hey guys, before i go reinventing the wheel, I need to create a gem that can work with a 3rd party REST API that provides hypermedia links in the JSON
<unver>
Burgestrand: ooh, nice, that's what I'm talking about
tmtwd has joined #ruby
<ddubs>
is ther ea library that can parse the JSON and create methods that map to those links/actions for me?
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has quit [Remote host closed the connection]
woobywoob has joined #ruby
<jhass>
unver: I'm confused, your .flatten! ensures there are no arrays left, yet you use empty array as default/fallback?
<woobywoob>
hello
<woobywoob>
is there an elegant way to put a parameter in a method if it exists?
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
woobywoob: def foo(param=default) ?
<unver>
jhass: [].flatten returns []
<woobywoob>
such as someMethod(@animal, @car, @chocolate if @chocoloate if isn't blank)
<unver>
jhass: ugh, but not flatten! thanks for the eye
<jhass>
unver: yes, and [].first returns nil, [1].first returns 1, so a.flatten.first || [] confuses me
<Burgestrand>
unver: the return value isn't interesting since you're not using it :)
<woobywoob>
it's different because i have to check if it's blank or not
<jhass>
woobywoob: how is blank defined?
<Burgestrand>
unver: but jhass is correct since you're effectively making sure that you temp.first can never be an array, since you first flatten temp.
<woobywoob>
it's a string
<jhass>
woobywoob: so?
<unver>
jhass: Burgestrand: I see, that is a silly return
<ddubs>
anyone know if there is a gem that can take a REST JSON response and dynamically create "methods" that map the the "link": "whatever" items in the JSON response?
<woobywoob>
i mean i guess i could use nil? rather than blank
AlphaAtom has joined #ruby
<Burgestrand>
ddubs: no personal experience, but perhaps googling for JSON API client, assuming your API is following the JSON API specification?
<woobywoob>
bui just don't know how to go about doing this with multiple parameters
<jhass>
woobywoob: nil isn't a string, so my question remains, how do you define blank?
<haylon>
ddubs: do you have an example of the JSON you're sending, or receiving?
<ddubs>
yea i just dont want to do a whole bunch of manual work and meta programming to achieve it
<ddubs>
:P
AlphaAtom has quit [Max SendQ exceeded]
<ddubs>
so was hoping it had been done
<woobywoob>
blank? is nil, false or ""
<ddubs>
ROAR gem looked promising
<banister>
woobywoob or []
<woobywoob>
yes
<banister>
woobywoob and {}
<ddubs>
but it appears its for generating apis
gambl0re has quit [Read error: Connection reset by peer]
skade has joined #ruby
<devn>
jhass: hmm, im looking to run this across a bunch of code, and hit it from the outside
<ddubs>
haylon: sec
<jhass>
woobywoob: so you're inside Rails/ActiveSupport and want that definition of blank?
<Burgestrand>
pfish: reading your question again perhaps that wasn't what you asked for. What do you want to do?
<ddubs>
haylon: so if you check that json there is a bunch of items with reference links - those are like sub objects that I should be able to retreive by just doing a get
davedev24 has joined #ruby
<haylon>
And you're wanting to go through the Json structure and then if you reach a "link" get that link, and do whatever you need to with it?
<ddubs>
i'm looking for something that can iterate those references and create something like object.endpoint.pools and perform a method against it when I call it
<Burgestrand>
No new array, just in-place modification of old array
momomomomo has quit [Client Quit]
<Burgestrand>
mandarinkin: jhass has been trying to tell you that map! (notice !) is not creating a new array
<miah>
ruby methods with ! tend to do 'in-pace' operations
matcouto has joined #ruby
coban2k has joined #ruby
mistermocha has quit [Remote host closed the connection]
basmoura has quit [Ping timeout: 256 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robbyoconnor has quit [Ping timeout: 255 seconds]
chouhoul_ has joined #ruby
tmtwd has quit [Ping timeout: 244 seconds]
lapide_viridi has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
_blizzy_ has quit [Quit: Leaving]
tmtwd has joined #ruby
yardenbar has quit [Quit: Leaving]
<haylon>
wait, did ruboto just do an IRB function?
jbw has quit [Ping timeout: 244 seconds]
pocketprotector has joined #ruby
bronson has quit [Remote host closed the connection]
jbw has joined #ruby
segy has quit [Ping timeout: 250 seconds]
Trynemjoel has quit [Ping timeout: 245 seconds]
<adaedra>
>> %w{You mean like this?].join(' ')
<ruboto>
adaedra # => /tmp/execpad-92904b3b9b27/source-92904b3b9b27:2: unterminated string meets end of file ...check link for more (https://eval.in/415450)
<adaedra>
erf, if I can't type
<haylon>
that's awesome
vdamewood has joined #ruby
devoldmx has joined #ruby
zendrix has joined #ruby
<adaedra>
useful for demonstrations
dseitz has joined #ruby
<haylon>
totally need one of those in my internal IRC
<adaedra>
you have full ruboto guide on website, see topic
yqt has quit [Ping timeout: 245 seconds]
<adaedra>
?ruboto
<ruboto>
I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
<[spoiler]>
I thought it was a begin...rescue...end block
kaps has joined #ruby
dfockler has quit [Remote host closed the connection]
ascarter has joined #ruby
<unver>
jhass: wow, i did not know that existed, thanks
sdwrage has quit [Quit: This computer has gone to sleep]
segy has joined #ruby
sinkensabe has quit [Ping timeout: 245 seconds]
AlphaAtom has joined #ruby
omegamike has joined #ruby
dmmoody has quit [Remote host closed the connection]
momomomomo has joined #ruby
freerobby has quit [Quit: Leaving.]
troulouliou_div2 has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maletor has quit []
ruby-lang905 has joined #ruby
sdwrage has joined #ruby
dmmoody has joined #ruby
JoshL has quit []
<ruby-lang905>
@rob_ pm me?
MasterPiece has quit [Quit: Leaving]
hobodave has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
chouhoul_ has quit [Remote host closed the connection]
ctalr has joined #ruby
chouhoulis has joined #ruby
freerobby has joined #ruby
sdwrage has quit [Client Quit]
ctalr has quit [Client Quit]
woobywoob has quit [Quit: Page closed]
ctalr has joined #ruby
<havenwood>
If anyone would like a release of RVM sometime soon (for TravisCI or otherwise) any help or feedback on Issues would expedite: https://github.com/rvm/rvm/issues
<shevy>
helping Devuan against the oppression that is systemD \o/
<havenwood>
adaedra: Need RVM working for chruby's test-suite on TravisCI. :P
mistermocha has quit [Read error: Connection reset by peer]
<adaedra>
ahahahah
mistermocha has joined #ruby
<lagweezle>
jhass: The code triage thing ... that's neat! Thanks!
ArchBeOS has joined #ruby
<ArchBeOS>
any bundler guys that can help me figure out my problem?
yfeldblum has joined #ruby
<jhass>
?anybody
<ruboto>
jhass is anybody
<jhass>
right
<jhass>
?anyony
<ruboto>
I don't know anything about anyony
<jhass>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
<adaedra>
?nobody
<ruboto>
apeiros is nobody
* jhass
hides
<ArchBeOS>
lol
<ArchBeOS>
ok, my bad
otisZart has joined #ruby
<adaedra>
:)
<ArchBeOS>
i answered my own damn question.
<adaedra>
:D
<ArchBeOS>
isorry gents
<shevy>
lol
<ArchBeOS>
and ladygents
<adaedra>
That's the IRC effect
<shevy>
am I a mangent?
<jhass>
?guys ArchBeOS
<ruboto>
ArchBeOS, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
<jhass>
;)
<adaedra>
jhass: he said ladygents!
Rutix has quit []
<shevy>
that isn't even a word!
<ArchBeOS>
lies!
<jhass>
shevy: you can be anything you want to be
programmerq has joined #ruby
<shevy>
dunno... mangent looks like a typo of magnet...
<adaedra>
shevy isn't either a word, do we make such a mess about it?
<shevy>
he is creating new words!
<adaedra>
that's called "neologisms" I think
DLSteve has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
pronounce it in french
j4cknewt has joined #ruby
<lagweezle>
ArchBeOS: For those of us playing the home game, what was the problem, and what is the solution? I ask, as I'm still somewhat blindly groping about bundler.
<adaedra>
néologismes?
<shevy>
UTF again :(
<shevy>
cool
<adaedra>
shevy: your IRC client is badly configured
<shevy>
groping bundler... yum
<drbrain>
o_O? UTF-8 is the channel encoding
<ArchBeOS>
How to require a single lib while using Bundler.require. Default had a ton of libs I didnt need, only needed rails, so after Bundler.require :test, :qe I just added require 'rails'
<shevy>
as long as there is no unicode hangman I am safe
<adaedra>
even if you're in another charset yourself, it should at least convert chars, and é is valid ISO-8859-1, so you shouldn't have problems with it
<ArchBeOS>
i am ashamed of myself for not thinking of that
<adaedra>
drbrain: it is, just shevy who wants to live in the past
<shevy>
without the snowman, unicode would be worthless
ndrei has quit [Remote host closed the connection]
<Burgestrand>
ArchBeOS: a typical use-case would also be to do Bundler.setup, and then manually require each thing that you need :)
<adaedra>
Secret message shevy can't read
<shevy>
I can't read that
<Burgestrand>
hm, or even just require "bundler/setup" and then require whatever.
<adaedra>
:D
<ArchBeOS>
Burgestrand: hmm. bundler setup. gotta read up on that, thanks
<ArchBeOS>
thnks everyone
gambl0re has joined #ruby
<adaedra>
shevy: it's true, an encoding system made to have a common encoding and ease communication between all parts of the world is absolutely worthless.
<ArchBeOS>
and i will try to remember gents and ladygents and transitionalgents from here on out (or just say y'all. it's easier)
Vile` has quit [Ping timeout: 245 seconds]
baweaver has joined #ruby
jeremy04 has quit [Remote host closed the connection]
<shevy>
adaedra why didn't ruby use it prior to 1.9.x
Vile` has joined #ruby
<adaedra>
shevy: ask matz
ndrei has joined #ruby
dmmoody has quit []
unver has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<shevy>
:)
<drbrain>
it did, just poorly
<adaedra>
PHP still doesn't support it
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
<shevy>
isn't php7 the one that will save the world?
<adaedra>
And even today, ruby has some failures with unicode
hashrocket has quit [Read error: Connection reset by peer]
<adaedra>
shevy: the only way PHP can stop being a joke is by becoming a completely different language.
mistermocha has quit [Read error: Connection reset by peer]
niemcu has quit [Ping timeout: 246 seconds]
dopie has quit [Quit: This computer has gone to sleep]
AlphaAtom has joined #ruby
baweaver has quit [Remote host closed the connection]
deavid has quit [Quit: No Ping reply in 180 seconds.]
mistermocha has joined #ruby
deavid has joined #ruby
haylon has left #ruby [#ruby]
msnyon has quit [Read error: Connection reset by peer]
gambl0re has quit [Remote host closed the connection]
dopie has joined #ruby
wasamasa has joined #ruby
wasamasa has joined #ruby
OrbitalKitten has quit [Read error: Connection reset by peer]
finisherr has joined #ruby
OrbitalKitten has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gambl0re has joined #ruby
danman has joined #ruby
allcentury has quit [Ping timeout: 264 seconds]
irctc980 has joined #ruby
robbyoconnor has joined #ruby
<irctc980>
hello, im developing a iOS application where i will be needing to be able to make a REST/HTTP request to my Rails App for Stripe payments. How do i go about doing this?
danman has quit [Client Quit]
<jhass>
sounds like an objective C/Swift/whatever question
baweaver has joined #ruby
RegulationD has joined #ruby
roolo_ has quit [Ping timeout: 250 seconds]
<irctc980>
but wont i also need to create rest api?
tvw has joined #ruby
baweaver_ has joined #ruby
Bloop_ has joined #ruby
gambl0re has quit [Remote host closed the connection]
olivierrr has joined #ruby
<irctc980>
like do ruby server side.
<olivierrr>
Hiya
<shevy>
olivierrr !
<shevy>
more french power to reinforce adaedra and Mon_Ouie
<adaedra>
TheMysticWyvern: learning a language can be hard sometimes. Have an issue blocking you you want to discuss?
<Bloop_>
Make sure you read the ruby pragmatic programmer TheMysticWyvern
baweaver has quit [Ping timeout: 260 seconds]
<TheMysticWyvern>
adaedra: Not a specific issue. I have extreme, and I do mean extreme, ADHD, so it's very, very hard for me to sit down and teach myself something. I leave it for a few weeks, come back, and have forgotten everything I've learned, and need to start over from the beginning.
RegulationD has quit [Ping timeout: 250 seconds]
leafybasil has quit [Read error: Connection reset by peer]
fowl has left #ruby [#ruby]
<adaedra>
ah :I
leafybasil has joined #ruby
<TheMysticWyvern>
I've tried PHP, C++, and Ruby, now.
<shevy>
you have come to the best
gambl0re has joined #ruby
ruby-lang905 has quit [Ping timeout: 246 seconds]
olivierrr is now known as olivierrrr
<shevy>
TheMysticWyvern what may be best is to limit to a "small" subset of ruby, and just keep on using that part
<TheMysticWyvern>
I mean, I couldn't even remember how to access the Interactive Ruby Shell. xD
<shevy>
irb !
<TheMysticWyvern>
shevy: A subset?
mistermocha has quit [Read error: Connection reset by peer]
mistermo_ has joined #ruby
<shevy>
or you alias
<shevy>
like "rubyshell" then you won't forget
<shevy>
yes, a subset of the features it has
<TheMysticWyvern>
Well, I did eventually remember "irb" and "irb --simple-prompt," but that's it.
<adaedra>
well
mistermo_ has quit [Remote host closed the connection]
<TheMysticWyvern>
If it helps, I'm attempting to learn Ruby for use in RPG Maker, which involves its own subset, I guess, called RGSS.
<adaedra>
I don't really what to say, this is not a problem I'm used to :|
<shevy>
I think hanmac here was using RPG maker
olivierrrr is now known as olivierrr
mistermocha has joined #ruby
<shevy>
adaedra you forgot a word there :D
jgpawletko has quit [Quit: jgpawletko]
<adaedra>
RPG Maker, now this is somthing I haven't heard in a long time
<adaedra>
shevy: Ah yes, I accidently a word
<adaedra>
thx m8
<TheMysticWyvern>
They're releasing a new version in the near future, with mobile support, and all that. RPG Maker MV.
allcentury has quit [Ping timeout: 256 seconds]
<TheMysticWyvern>
I want to be prepared for its release, with Ruby.
<adaedra>
Let me find it
<Bloop_>
I do have a question. Mostly Ruby specific, but its in rails
<shevy>
cool use case TheMysticWyvern
<shevy>
I came to ruby from php. I got tired of php, choice was between ruby and python. ruby won due to matz being kickass
<TheMysticWyvern>
shevy: Case?
Trynemjoel has quit [Ping timeout: 250 seconds]
<adaedra>
Last time I used RPG maker was in 2006
<shevy>
yeah, that you want to learn a language due to some application, in this case RPG Maker
<TheMysticWyvern>
adaedra: They've been converting older versions to English and throwing it onto the Steam store.
Bloop_ has joined #ruby
<shevy>
I actually never used rpg maker myself, hanmac wanted to do openrmk or so
<adaedra>
Bloop_: go on
irctc980 has quit [Ping timeout: 246 seconds]
<TheMysticWyvern>
shevy: Well, the truth is, I really don't know what else I would use Ruby for. I'd never heard of Ruby until I began using RPG Maker.
<adaedra>
Bloop_: If you don't ask, we can't answer or redirect you :)
gambl0re has quit [Ping timeout: 252 seconds]
Trynemjoel has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
TheMysticWyvern yeah as I said, cool use case
<Bloop_>
So I have a rake task that imports a lot of models. Under 300k lines. But after a while it is really slow. So when running it on a server its slow.
<shevy>
mine was worse, php was so annoying that I had to leave
<shevy>
I tried to re-learn php for drupal (for a job), I still have not decided if I can do so, it kills my brain
<TheMysticWyvern>
shevy: Oh, a use case. I thought you were just saying random words. xD
<shevy>
:(
<Bloop_>
Takes about 45 min to import. Is there something I am missing? Or is this more rails specific?
mistermocha has quit [Remote host closed the connection]
<TheMysticWyvern>
shevy: I used Drupal at the company I used to work for.
<adaedra>
Bloop_: how do you import?
<shevy>
yah I don't understand it, but surprisingly, the head professor of bioinformatics at one university here, uses drupal for internal management of all projects - and he doesn't even know php...; he also uses tcl, strangely enough
<adaedra>
You don't need to know php to use drupal
machinewar has quit []
<TheMysticWyvern>
shevy: The good thing about Drupal is that you don't need to know PHP to use it effectively. There's an overwhelming amount of third-party support for it, including themes and modifications.
<Bloop_>
I am using a CSV Reader, reading it line by line, and committing batch transactions since a single transaction was even slower. In fact it ran out of memory.
<adaedra>
Do you build full objects?
<shevy>
TheMysticWyvern it so scares me... imagine if ruby would be like that
<Bloop_>
I've gotten to the point where I think doing a raw sql query would be my best solution since I am not sure what I am doing wrong. Let me see if I can create a Gist
<TheMysticWyvern>
shevy: Not requiring ultimate knowledge to make use of it?
<shevy>
TheMysticWyvern no, I mean, offer something like drupal
allcentury has joined #ruby
Motoservo has joined #ruby
<TheMysticWyvern>
shevy: How could it? I mean, can Ruby be used for web development?
<shevy>
php has like ... wordpress... drupal ... joomla
sbhatore has quit [Ping timeout: 272 seconds]
<shevy>
yeah
rakm has joined #ruby
<TheMysticWyvern>
Is it more powerful in web development than PHP?
<shevy>
as language, ruby has the better design
f-a has joined #ruby
<shevy>
php has some cool projects. mediawiki... phpBB ...
sbhatore has joined #ruby
<TheMysticWyvern>
My first encounter with PHP was using WoltLab Burning Board. Those are the good old days I miss.
<adaedra>
phabricator
<shevy>
the local technical university is using rails (ruby) for student pages, that was a surprise to me
kirun has quit [Quit: Client exiting]
timanema has joined #ruby
f-a has left #ruby [#ruby]
<adaedra>
it's not because the language is awful that you can't build good things upon it
timanema has quit [Client Quit]
baweaver_ is now known as baweaver
hinbody has quit [Quit: leaving]
<adaedra>
<shevy> as language, ruby has the better design | that's subjective.
bruno- has quit [Ping timeout: 265 seconds]
sinkensabe has joined #ruby
<shevy>
nah
<adaedra>
except if you mean just between ruby and PHP
<shevy>
what is that czech error message in php
gard has quit [Ping timeout: 265 seconds]
<shevy>
PAAMAYIMNEKUDOTAYIM
timanema has joined #ruby
<shevy>
:D
dfockler has joined #ruby
<adaedra>
hebraic
<shevy>
lol
<adaedra>
it's ::
msnyon has joined #ruby
<shevy>
oh right
<shevy>
for some reason I thought it was czech
<TheMysticWyvern>
Well, my next step on this path is learning about object types.
n_blownapart has quit [Remote host closed the connection]
<TheMysticWyvern>
It sounds drier than a desert.
<adaedra>
I hope you success.
rodfersou has quit [Quit: leaving]
<TheMysticWyvern>
Thank you!
<dudedudeman>
shevvvvvvyyyy
<TheMysticWyvern>
The last time I went through this stuff, I thought I was going to die.
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Bloop_>
I am reading a CSV file.
<Bloop_>
Cleaning it up, and creating a model for it.
<Bloop_>
task.rb uses the csv_reader
choke has joined #ruby
momomomomo has quit [Quit: momomomomo]
<Bloop_>
Then it gets saved to a postgre DB
startupality has joined #ruby
mleung has joined #ruby
<Bloop_>
One of my plans is to avoid saving to the DB very much. Since a single model could appear on multiple lines. Let me know if anything doesn't make sense.
momomomomo has joined #ruby
failshell has quit [Remote host closed the connection]
<[spoiler]>
Lmao, for some reason my IRC client pooped when it tried to render that gist
<Bloop_>
Haha. Damn that bad huh :D
cantaberry has joined #ruby
rbennacer has quit [Ping timeout: 250 seconds]
<[spoiler]>
#embeddedhtml5problems
<[spoiler]>
Nah, it is fine now
jenrzzz has joined #ruby
<[spoiler]>
I use Glowing Bear; I'm all ears if anyone knows a better weechat frontend that doesn't look like poo
<adaedra>
weechat
<[spoiler]>
:(
<[spoiler]>
I like terminal apps, but prefer this, tbf
<[spoiler]>
erm
<[spoiler]>
s/this/GUIs
cantaberry has left #ruby [#ruby]
<[spoiler]>
for this type of thing, at least
cantaberry has joined #ruby
<adaedra>
I have a ZNC and alternate between Textual and weechat
cantaberry has quit []
cantaberry has joined #ruby
momomomomo has quit [Quit: momomomomo]
casadei has quit [Remote host closed the connection]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[spoiler]>
adaedra: I am a lazy shit, so I just have a weechat instance running on a VPS, to which I connect through ssh, or frontends haha
blue_deref has quit [Quit: bbn]
sshuff is now known as sshuff|gone
troulouliou_div2 has quit [Quit: Leaving]
<adaedra>
yeah, that what I was doing for a while
<[spoiler]>
Depends on what I am doing on what I'll ue
<jhass>
but having important stuff depend on it.. maybe wait another year ;)
<[spoiler]>
jhass: no, it was just an internal tool, nothing major or for production
_ht has quit [Quit: Konversation terminated!]
<[spoiler]>
they just don't like new languages
<jhass>
meh
<[spoiler]>
correction: they don't like learning new languages
krz has quit [Quit: WeeChat 1.2]
<[spoiler]>
there's only one other developer, and he's a PHP developer (and he doesn't even like PHP)
paulcsmith has quit [Quit: Be back later ...]
malconis has quit [Ping timeout: 252 seconds]
yfeldblum has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<[spoiler]>
They hired me because I had both sysops knowledge and C, and C++ knowledge
decoponio has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
<TheMysticWyvern>
Are there really cutesy terms for people who use specific languages? Pythonista? xD
<adaedra>
yes
disconnekted has quit [Remote host closed the connection]
<TheMysticWyvern>
What's the term for PHP?
nofxx has joined #ruby
deepu has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
deepu has quit [Client Quit]
<Burgestrand>
Masochist.
<jhass>
uhm... junior dev?
<adaedra>
There's none.
<Burgestrand>
:)
<adaedra>
You can't dev in PHP.
<Burgestrand>
PHPist?
<TheMysticWyvern>
PHPhucker?
sinkensabe has joined #ruby
deepu has joined #ruby
<Burgestrand>
I have an ElePHPant but I don't think that's it.
<adaedra>
\/(,° ,)'
ArchBeOS has quit [Quit: Page closed]
hobodave has quit [Quit: Computer has gone to sleep.]
<adaedra>
good night here too
<Burgestrand>
I guess PHPists aren't HIP enough.
<jhass>
that one needs a loot of fantasy
<jhass>
night
hj2007 has joined #ruby
solars has quit [Ping timeout: 260 seconds]
bruno- has joined #ruby
hashrocket has joined #ruby
prestorium has quit [Quit: Konversation terminated!]
crdpink2 has quit [Ping timeout: 246 seconds]
prestorium has joined #ruby
crdpink has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
failshell has joined #ruby
devoldmx has joined #ruby
omegamike has quit [Remote host closed the connection]
<TheMysticWyvern>
Could anyone recommend any books for learning Ruby development? Ones that aren't outdated? Most of them seem to be from pre-2000's, which is... probably outdated?
<TheMysticWyvern>
Er, pre-2010's.
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has quit [Ping timeout: 252 seconds]
prestorium has quit [Client Quit]
kaps has quit [Read error: Connection reset by peer]
kies has quit [Ping timeout: 272 seconds]
lwu has quit [Quit: This computer has gone to sleep]
chabil has quit [Quit: WeeChat 1.2]
lwu has joined #ruby
zendrix has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 255 seconds]
msnyon has joined #ruby
dgutierrez1287 has joined #ruby
zendrix has joined #ruby
ndrei has quit [Ping timeout: 244 seconds]
ndrei has joined #ruby
yfeldblum has joined #ruby
<shevy>
semi-outdated
<shevy>
if you have never read it before, you can give the pickaxe a try
<shevy>
I think the best way to learn may be to store information locally, in a snippet-like fashion, and ask on #ruby for constant improvements to your guide, and keep on writing more and more code
<Burgestrand>
TheMysticWyvern: A lot of them are still quite relevant. Ruby has been good at keeping backwards-compatibility.
Burgestrand has quit [Read error: Connection reset by peer]
sross07 has quit [Read error: Connection reset by peer]
choke has joined #ruby
leafybasil has quit [Read error: Connection reset by peer]
MyMind has joined #ruby
dgutierrez1287 has quit [Ping timeout: 256 seconds]
sdwrage has quit [Ping timeout: 272 seconds]
Trieste has quit [Ping timeout: 245 seconds]
silkfox has quit [Ping timeout: 245 seconds]
<Burgestr_>
TheMysticWyvern: What's your experience with programming? Do you want something to explain concepts like variables, loops, or something more advanced?
ItSANgo has quit [Ping timeout: 245 seconds]
ddv has quit [Ping timeout: 245 seconds]
wldcordeiro has quit [Read error: Connection reset by peer]
wldcordeiro has joined #ruby
dseitz has quit [Read error: Connection reset by peer]
olivierrr has quit [Read error: Connection reset by peer]
whippythellama has quit [Ping timeout: 245 seconds]
avahey has quit [Quit: Connection closed for inactivity]
pocketprotector has quit [Ping timeout: 244 seconds]
keyvan_ has joined #ruby
keyvan_ is now known as keyvan
josh3 has quit [Ping timeout: 240 seconds]
<qubitz>
I was messing around with Enumerable#inject and found a behavior I don't understand, wondered if someone could give some insight. I was doing basically an Enumerable#any? (which is actually what I should use) there I want to return false if any element doesnt meet a condition. This works just fine though I've found that when the array is size 1 I don't get true/false, I get the value of the first element. Can
<qubitz>
t someone explain what is happening here? [2].inject{|p,v| break false if v==2; true}
failshell has quit [Remote host closed the connection]
n_blownapart has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rakm has joined #ruby
crdpink2 has joined #ruby
whippythellama has quit [Quit: WeeChat 1.2]
northfurr has quit [Quit: northfurr]
crdpink has quit [Ping timeout: 246 seconds]
<apeiros>
qubitz: inject without a starting value will start with the first element
<apeiros>
since there's no further element left, your block isn't even invoked
<lagweezle>
Er, what are some good examples of where passing a block of code to a method greatly reduces the amount of code necessary while increasing readaiblity?
roolo has joined #ruby
northfurr has joined #ruby
startupality has quit [Read error: Connection reset by peer]
lotherk has joined #ruby
<nirvdrum>
Does anyone happen to have any insight as to why a TracePoint event won't be emitted for a Fixnum#+ call like "3 + 5", but will for something like "3 + rand"?
<qubitz>
apeiros: i figured that's what it was doing, but wondered if that is really expected? does that assum you're trying to do a sum?
bronson has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
<apeiros>
qubitz: I'm a bit puzzled. yes, it is expected. it is the documented behavior. no assumptions necessary.
startupality has joined #ruby
jackjackdripper has quit [Ping timeout: 245 seconds]
<shevy>
It is set in stone.
<shevy>
"Not a bug - it is a feature."
<apeiros>
you quite correctly said it was the wrong tool for what you used it
<qubitz>
apeiros: i understand its documented that if you dont set a memo the first value is used. im just surprised that the block doesnt execute if there is only one value. is that documented?
MatthewsFace has quit [Ping timeout: 252 seconds]
scottschecter has quit [Quit: Leaving]
jackjackdripper has joined #ruby
roolo has quit [Remote host closed the connection]
roolo has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
qubitz: it follows from the first element being used for the memo and no element remaining to be yielded
<apeiros>
qubitz: what should it yield as v to your block?
[H]unt3r has joined #ruby
<qubitz>
apeiros: ah, well that makes sense
<qubitz>
i'll accept that :)
hj2007 has quit [Quit: This computer has gone to sleep]
bronson has quit [Ping timeout: 252 seconds]
baweaver has quit [Read error: Connection reset by peer]
Guest21711 has joined #ruby
baweaver has joined #ruby
<shevy>
qubitz on his way into the dark secrets of the ruby
<shevy>
will he ever come back... or will the big black void swallow him alive...
gambl0re has joined #ruby
<qubitz>
i think the reason its concerning to me is if you think of inject as reduce, and you expect to run an operation over a bunch of values. its surprising to see the block not execute. what if i had an array of strings and wanted to do a word count across all of them. if i only had one string in the array i would get that string, not a word count
hj2007 has joined #ruby
<qubitz>
lol
northfurr has quit [Quit: northfurr]
tmtwd has quit [Ping timeout: 245 seconds]
Musashi007 has quit [Quit: Musashi007]
mary5030 has quit [Remote host closed the connection]
<qubitz>
though i guess its less concerning if you dont set a memo
<qubitz>
now that I can explain what happened here, I'll let it go :)
hj2007 has quit [Client Quit]
<apeiros>
qubitz: show me how you do a count without an explicit memo and I show you how terrible that code is :-p
<apeiros>
(an explicit +initial memo)
Musashi007 has joined #ruby
icebourg has quit []
Musashi007 has quit [Client Quit]
soviet_jesus has joined #ruby
hj2007 has joined #ruby
<qubitz>
yep point taken, i really just wanted to understand why the block wasnt executing and now i do, if you use the first/only value for the memo, theres nothing else to pass in
dangerousdave has quit [Ping timeout: 260 seconds]
sargas has quit [Quit: Leaving]
SuMo_D has joined #ruby
dopie has joined #ruby
Rixius has joined #ruby
Musashi007 has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
NeverDie has joined #ruby
dimasg has joined #ruby
josh3 has joined #ruby
<soviet_jesus>
So, this may be a uselessly general question but here it goes: I want to get "better" at ruby, but am not all that creative. This makes it hard to think of programs I want to write. A book I'm reading suggests reading the code in the standard library as a way to get better at reading and writing ruby. This seems like a good idea to me but I'm at something of a loss of where to start looking (in terms of classes/files, not "Where'
<soviet_jesus>
recommendations of what class I should try and look at first?
<BraddPitt>
I generally enjoy things using network communications. My first big ruby learning project was an IRC bot Soviet_Jesus
Guest21711 has quit [Quit: WeeChat 1.2]
<BraddPitt>
maybe something that interacts with a well defined api?
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[k- has quit [Quit: -a- IRC for Android 2.1.23]
<soviet_jesus>
Interesting...I'll have to give that some serious thought. Thanks BraddPitt
qubitz has quit [Ping timeout: 250 seconds]
devoldmx has quit [Ping timeout: 255 seconds]
<BraddPitt>
np
<BraddPitt>
just think about something you would want to make - the possibilities are endless
SuMo_D has quit [Remote host closed the connection]
<[spoiler]>
BraddPitt: I didn't read the nick, so I thuoght you wrote a bot called Soviet_Jesus and started to type "That's an odd name for a bot... What did I do?"
mikecmpbll has quit [Quit: i've nodded off.]
symm- has joined #ruby
olivierrr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
northfurr has joined #ruby
<[spoiler]>
The first thing I wrote in Ruby was a chat server (which I ended up writing most of in C, for various reasons)
<graft>
Soviet_Jesus: read the String class, it's a pretty good one. Also Enumerable
<[spoiler]>
2D chat
xaxisx has joined #ruby
<[spoiler]>
It's still used actually, by a few people :/
swgillespie has joined #ruby
MatthewsFace has joined #ruby
<[spoiler]>
It was for my old roleplay group, but most of us grew up and kinda lef tit behind
<shevy>
tit behind?
* [spoiler]
is getting all nostalgic and has fuffy feelings
<shevy>
similar happened to my group too, family kicked in, people had less and less time
<[spoiler]>
tsl. It's 1 am; I can't type even when I'm fully awake
<shevy>
fuffy tit? man your words are off by one today
<shevy>
yeah :)
<shevy>
when I first came to ruby, I thought about writing a mud
<[spoiler]>
oooo
<[spoiler]>
now I wanna play a mud!
<shevy>
Aria here I think also was active in the ancient days about that... FaerieMUD... as Aridrel (but I may misremember)
<soviet_jesus>
haha endless possibilities are kinda the issue I'm having. Though I do like the idea of some kinda of text based DnD kinda thingy. And I'll be sure to give string and enumerable a read. God knows I need to understand enumerable much better
<havenwood>
Soviet_Jesus: +1 Enumerable
<BraddPitt>
the first programs you write are the best
diegoviola has joined #ruby
<soviet_jesus>
Well, string for that matter too
matugm has joined #ruby
matugm has joined #ruby
<BraddPitt>
idk if i would suggest reading class API documentation
<BraddPitt>
thats so fucking boring
<[spoiler]>
Enumerable is one of Roby's nicest featutes, yeah
<BraddPitt>
just reference it when you're lost/when you need it
<[spoiler]>
Okay that's it
<[spoiler]>
I'm going to bed
<[spoiler]>
Good night, folk! Kisses and hugs all around
* [spoiler]
e-besmooches everyone
SCHAAP137 has quit [Remote host closed the connection]
* dfockler
hugs
centrx has joined #ruby
finisherr has quit [Quit: finisherr]
<shevy>
Roby hmm
<dfockler>
Roby!
<shevy>
[spoiler] really is a wild typer at night
northfurr has quit [Quit: northfurr]
<soviet_jesus>
Am I a crazy person or is string located in /1.9.1/rake/ext/string.rb?
Inside has joined #ruby
Inside has joined #ruby
zendrix has quit [Remote host closed the connection]
<soviet_jesus>
Oh, its one of the c files, isn't it?
hostess has quit [Quit: No Ping reply in 180 seconds.]
EllisTAA has joined #ruby
<soviet_jesus>
I have that tab open twice ;)
<dfockler>
Soviet_Jesus: see that little In Files box? That has all the C files for modules
jtdoncas has joined #ruby
momomomomo has joined #ruby
timanema has quit [Ping timeout: 250 seconds]
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
Adran has joined #ruby
Mendenhall has quit [Quit: WeeChat 1.0.1]
<soviet_jesus>
hells yeah, I dont know C lol. alrighty I'm gonna see what I can make.
DLSteve_ has quit [Quit: Leaving]
centrx has joined #ruby
tmtwd has joined #ruby
nicechap has quit [Ping timeout: 272 seconds]
momomomomo has quit [Quit: momomomomo]
bstrrm is now known as busterarm
<soviet_jesus>
alrighty, well I'm gonna go piss myself off till learning happens. Thanks all!
hostess has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
AustinMatherne has quit [Ping timeout: 244 seconds]
omegamike has joined #ruby
blackmesa has quit [Quit: WeeChat 1.2]
advorak has joined #ruby
AustinMatherne has joined #ruby
last_staff has quit [Ping timeout: 244 seconds]
soviet_jesus has quit [Ping timeout: 246 seconds]
djstorm has quit [Ping timeout: 245 seconds]
MyMind has quit [Ping timeout: 264 seconds]
Pisuke has joined #ruby
irb1 has joined #ruby
polpak has quit [Quit: leaving]
ruby-lang321 has joined #ruby
fowl has joined #ruby
<ruby-lang321>
hello
omegamike has quit [Ping timeout: 245 seconds]
<centrx>
?hi
<ruboto>
I don't know anything about hi
B1n4r10 has joined #ruby
symm- has quit [Quit: Leaving...]
<ruby-lang321>
newbie question but what is the difference in a gem when 1) is net-ldap and 2) is net/ldap
<ruby-lang321>
are they the same?
baweaver has quit [Remote host closed the connection]
<shevy>
hmm is it an acceptable practice to subclass from StringIO? I need a logger-object that can temporarily grab all output going to stdout, but also lateron restore to default ruby behaviour again
<centrx>
ruby-lang321, Where do you see that?
<centrx>
shevy, You're a monkey. Patch it
baweaver has joined #ruby
<ruby-lang321>
in examples when i query for ldap in ruby i see there are 2 different require statements
<ruby-lang321>
one is require 'net-ldap' and the other is require 'net/ldap'
<BraddPitt>
the "/" means ldap is a sub-directory of the "net" directory
<BraddPitt>
wherea net-ldap is all one directory
<BraddPitt>
does that make sense?
<ruby-lang321>
i see
baweaver_ has joined #ruby
<ruby-lang321>
so if i do require 'net-ldap' i get the parent and all subdirectories?
nicechap has joined #ruby
<ruby-lang321>
and if i do require 'net/ldap' i get everything under the net/ldap directory
rcvalle has quit [Quit: rcvalle]
<BraddPitt>
yes
<BraddPitt>
well
<BraddPitt>
require 'net-ldap' will only require what is in that parent dir
tmtwd has quit [Quit: Leaving]
<BraddPitt>
but its possible that in that dir, there is a require statement that pulls in all the sub-dirs
<BraddPitt>
(this is a common idion in gems)
<ruby-lang321>
ok got it
<ruby-lang321>
thx
ruby-lang321 has quit [Quit: Page closed]
irb1 has quit [Quit: irb1]
startupality has quit [Quit: startupality]
dr3w has quit [Ping timeout: 246 seconds]
baweaver has quit [Ping timeout: 245 seconds]
lannonbr has quit [Quit: WeeChat 1.2]
senoralastair has joined #ruby
otisZart has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cache_Money has quit [Quit: Cache_Money]
charliesome has joined #ruby
dfockler has quit [Remote host closed the connection]
advorak has quit [Quit: This computer has gone to sleep]
startupality has joined #ruby
casadei has joined #ruby
Musashi007 has quit [Quit: Musashi007]
otisZart has joined #ruby
<senoralastair>
hey folks. can someone help me out? I can't quite work out how to phrase what I'm after, so my google-fu is returning nothing too helpful. What I'm trying to work out is this: How do I access an attr of a class, using a variable. Eg: attrs = [ 'name', 'age' ], and I want to loop through and pull the values for person.name and person.age? (My actual array has about 12 elements, and it's all done within another loop)
Me1 is now known as VeganGreg
<BraddPitt>
senoralastair do you mean retrieve all variables of an object?
<BraddPitt>
or rather, all the values of all the variables of an object?
<senoralastair>
BraddPitt: In this instance I'm just after the values they hold, but it would be good to know both for future use
<Aeyrix>
Is here an appropriate place for Sinatra questions?
<Aeyrix>
It's not directly Sinatra related, but I'm using the framework.
<shevy>
senoralastair you access info from an object by calling a method usually; the method will return however things are stored, which typically means that internally a @instance_variable is used
bigmac has joined #ruby
<BraddPitt>
no sure Aeyrix, but I bet there is a sinatra channel somewhere on freenode
<Aeyrix>
BraddPitt: There is, but I know a lot of people in here. :^)
northfurr has quit [Quit: northfurr]
<Aeyrix>
Fuck it, asking anyway. \o/
<BraddPitt>
huehue
casadei has quit [Ping timeout: 260 seconds]
<shevy>
senoralastair if it follows the common attr-pattern then you could use .send()
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]