havenwood changed the topic of #ruby to: Rules & more: http://ruby-community.com || Ruby 2.2.3; 2.1.7; 2.0.0-p647: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
cwong_on_irc1 has quit [Quit: Leaving.]
DiCablo has joined #ruby
blackmesa has quit [Quit: WeeChat 1.3]
n_blownapart has quit []
d34th4ck3r has joined #ruby
duckpuppy has joined #ruby
Rollabunna has joined #ruby
diego1 has joined #ruby
northfurr has quit [Quit: northfurr]
uber has quit [Ping timeout: 268 seconds]
vipaca has joined #ruby
hxegon_ has quit [Ping timeout: 265 seconds]
jessemcgilallen has joined #ruby
northfurr has joined #ruby
diegoviola has quit [Ping timeout: 265 seconds]
Musashi007 has quit [Quit: Musashi007]
Rollabunna has quit [Ping timeout: 265 seconds]
rbennacer has joined #ruby
finisherr has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
SweetSoulBro has joined #ruby
<SweetSoulBro> Hey
<SweetSoulBro> Does anyone know ruby here?
spider-mario has quit [Remote host closed the connection]
<shevy> SweetSoulBro hey man how do you do
DEA7TH has quit [Quit: DEA7TH]
<SweetSoulBro> I'm frustrated. Can someone take a look at some code I'm doing and tell me 1. What I'm doing wrong and 2. How to do what I want to do?
mwlang has joined #ruby
pullcheezy has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
rgtk has quit [Remote host closed the connection]
<mwlang> what exactly does ASLDotNetHandler do for SOAP4R?
startupality has quit [Quit: startupality]
<shevy> SweetSoulBro the best you can do is put code onto a pastie like gist.github and link to #ruby so that someone can look at the code, ideally also write in that pastie what does not work exactly
<Radar> SweetSoulBro: There are some people who know Ruby here.
<ruboto> SweetSoulBro, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/6cb12e5896652ee17bee
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<SweetSoulBro> Bam.
<SweetSoulBro> >github
<SweetSoulBro> aaaaaa
<SweetSoulBro> ok
<Radar> The indentation needs fixing there.
<Radar> It's a bit outta whack.
<SweetSoulBro> Yeah, my indents are all fucked up.
Musashi007 has joined #ruby
akem has quit [Ping timeout: 240 seconds]
<SweetSoulBro> The def get_wattage keeps throwing errors
<SweetSoulBro> I figgure it's cause i can't do that the way I want to do it
<shevy> you initialize the @variables in different scope
<SweetSoulBro> Ah.
<SweetSoulBro> :/
<shevy> so @foo on top, will be different than def initialize; @foo
<shevy> even though they have the same name
<SweetSoulBro> Ah. Gotcha. So how exactly do I pass that subtraction to the actual @heat variable?
<shevy> SweetSoulBro I sometimes bundle @ivars that have to be initialized into a method I call reset
rgtk has joined #ruby
pullcheezy has quit [Client Quit]
sasi has quit [Ping timeout: 246 seconds]
<shevy> hard to see what is going on with that indent :D
<SweetSoulBro> aaaaa
riceandbeans has quit [Remote host closed the connection]
<SweetSoulBro> Alright, so what I'm trying to do is, when the wattage is recieved, heat is subtracted from the @heat variable
<shevy> so you assign to @heat the value of get_heat
<SweetSoulBro> Yes.
<shevy> seems as if the values that you assign will be random
<shevy> 15, 18 etc...
<SweetSoulBro> No, the values aren't random, the way they're chosen is.
eminencehc has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jessemcgilallen has quit [Quit: jessemcgilallen]
Mia has quit [Read error: Connection timed out]
al2o3-cr has quit [Quit: WeeChat 1.3]
uber has joined #ruby
<shevy> hmm
<SweetSoulBro> Yeah..
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
<shevy> you don't always decrease @heat
<SweetSoulBro> yeahhhh..
<SweetSoulBro> Only if a certain wattage is picked.
blue_deref has joined #ruby
<shevy> by the way you can also shorten the code
<shevy> @heat = @heat - 5
<shevy> @heat -= 5
<shevy> what error do you say is thrown?
baweaver has quit [Remote host closed the connection]
<SweetSoulBro> Nomethoderror
devoldmx has joined #ruby
<SweetSoulBro> undefined method "-"
rgtk has quit [Ping timeout: 260 seconds]
<shevy> if you assign @heat to 100, after @heat = get_heat, does it work then?
SCHAAP137 has quit [Quit: Leaving]
<shevy> - should work
<SweetSoulBro> Wait
<SweetSoulBro> what?
al2o3-cr has joined #ruby
eminencehc has joined #ruby
ibouvousaime has joined #ruby
rgtk has joined #ruby
chipotle has quit [Quit: cheerio]
Jardayn has quit [Read error: Connection reset by peer]
stardiviner has joined #ruby
<shevy> >> "abc" - "c"
<ruboto> shevy # => undefined method `-' for "abc":String (NoMethodError) ...check link for more (https://eval.in/459764)
<shevy> aha
<shevy> >> 5 - 4
<ruboto> shevy # => 1 (https://eval.in/459765)
bricker has quit [Ping timeout: 246 seconds]
<shevy> you probably have a string somewhere there rather than an integer
Jardayn has joined #ruby
baweaver has joined #ruby
mag42c has quit [Quit: mag42c]
<SweetSoulBro> ?
<SweetSoulBro> Where, in the get_heat?
asianMike has joined #ruby
devoldmx has quit [Ping timeout: 265 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
craysiii has quit [Quit: Leaving.]
<shevy> nah, get_heat will return only numbers
<shevy> I don't know how you get to that undefined method part, but evidently you can not have a number as it would work otherwise, ^^^ see what ruboto returned
x-light has quit [Ping timeout: 250 seconds]
Nahra has quit [Ping timeout: 250 seconds]
<shevy> look at the line where it occurs, the ruby parser should tell you which line it is
Nahra` has joined #ruby
mic_e has quit [Ping timeout: 250 seconds]
daed has quit [Ping timeout: 250 seconds]
miah has quit [Ping timeout: 250 seconds]
<SweetSoulBro> C:/users/ORIGIAN/Dropbox/gunbot/plasmahandgunclass.rb:61:in `get_wattage': undef ined method `-' for nil:NilClass (NoMethodError)
<SweetSoulBro> That's the error I get.
<shevy> aha
sankaber has joined #ruby
<shevy> so you have a nil object
<shevy> but all those @size = nil into def initialize
rgtk has quit [Ping timeout: 260 seconds]
mic_e has joined #ruby
<shevy> and ensure that @heat has a proper value or whatever variables are used on line 61
n008f4g_ has quit [Ping timeout: 272 seconds]
daed has joined #ruby
miah has joined #ruby
diego1 has quit [Changing host]
diego1 has joined #ruby
<SweetSoulBro> I did.
<SweetSoulBro> Heat has a varible of 0
<shevy> ok so if @heat would be 0, then any - 5 number deduction would work, so it would be -5 then
<SweetSoulBro> Yes
<SweetSoulBro> But it isn't.
kriskropd_ has joined #ruby
<SweetSoulBro> I think it's saying the - is undefined.
<SweetSoulBro> which..is even odder.
<shevy> you have some nil object there
rgtk has joined #ruby
keen____________ has joined #ruby
<SweetSoulBro> In wattage?
<SweetSoulBro> Wattage is nil
<shevy> I don't know where you have it
<shevy> to be honest, your code is not the cleanest right now ;)
eminencehc has quit [Remote host closed the connection]
<shevy> can you try to redo the class, but add variables only step-by-step?
aspiers has joined #ruby
keen___________ has quit [Ping timeout: 244 seconds]
<shevy> like start with @heat and ensure that it works; you can use pp to inspect; require 'pp' at the top
__main__ has quit [Remote host closed the connection]
<SweetSoulBro> What?
<SweetSoulBro> I know it works.
<SweetSoulBro> It works when it picks one that doesn't subtract from heat
<SweetSoulBro> I tested that
sankaber has quit [Ping timeout: 272 seconds]
<shevy> ah
atomical has joined #ruby
<shevy> you use get_wattage
__main__ has joined #ruby
<shevy> but get_wattage can return either a String or a Number right?
<shevy> hmm and perhaps nil too
<SweetSoulBro> It should return a string
<SweetSoulBro> What I'm trying to do
<SweetSoulBro> is after it returns that string
<shevy> ok so you are sure that it should return a string
<shevy> but there are cases where it will not
<SweetSoulBro> execute that math problem.
<shevy> for instance, you use: @heat = @heat - 6
rbennacer has quit [Remote host closed the connection]
<shevy> and if @heat is a number, it will return that number
rshetty has joined #ruby
<shevy> and in the line above, you use: "15 kW(1d8)"
<baweaver> -=
<shevy> so it will return a String
tkuchiki has joined #ruby
<SweetSoulBro> Yes
nizmow has quit [Ping timeout: 256 seconds]
dfockler has quit [Ping timeout: 244 seconds]
rgtk has quit [Ping timeout: 260 seconds]
beauby has joined #ruby
<shevy> ruby will return the last statement of a method if you omit return keyword
<SweetSoulBro> ...huh
<SweetSoulBro> SO it's upside down?
chipotle has joined #ruby
<shevy> well
<shevy> take those two lines here:
<shevy> "35 kW(2d8)"
<shevy> @heat = @heat - 6
<shevy> simply switch them
<shevy> @heat = @heat - 6
<shevy> "35 kW(2d8)"
<SweetSoulBro> ..ok
<shevy> everywhere you use them and it should work, or at the least be consistent with the rest of your if/else clauses
<SweetSoulBro> Mmhm
sepp2k1 has quit [Read error: Connection reset by peer]
<SweetSoulBro> Nope.
<SweetSoulBro> still crashed.
sankaber has joined #ruby
rshetty has quit [Ping timeout: 240 seconds]
senayar has joined #ruby
senayar has joined #ruby
tkuchiki has quit [Remote host closed the connection]
arooni has joined #ruby
diego1 is now known as diegoviola
sankaber has quit [Client Quit]
yfeldblum has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: i've nodded off.]
<shevy> I pasted the results from running it e. g. 8 times or so at the end
pu22l3r has joined #ruby
aspiers has quit [Ping timeout: 268 seconds]
Fire-Dragon-DoL has joined #ruby
<shevy> no crashes that I can see (ignore the first time evaluation, I forgot to use "" there)
<SweetSoulBro> Huh
<SweetSoulBro> I tried it and it faled.
nizmow has joined #ruby
vipaca has quit [Quit: Textual IRC Client: www.textualapp.com]
NeverDie has quit [Quit: http://radiux.io/ -> Manhattan Project]
pu22l3r_ has quit [Ping timeout: 240 seconds]
<shevy> try to save the code on that gist into a new .rb file and run it
<shevy> (with the lower part)
<shevy> erm
<shevy> (without the lower part)
chipotle has quit [Quit: cheerio]
rshetty has joined #ruby
ss_much has quit [Quit: Connection closed for inactivity]
Timba-as has quit [Quit: Be back later ...]
Timba-as has joined #ruby
Tombk has joined #ruby
l_tonz has joined #ruby
Timba-as has quit [Read error: Connection reset by peer]
maletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<SweetSoulBro> One sec
beauby has quit [Ping timeout: 240 seconds]
favadi has joined #ruby
to_json has quit [Quit: Leaving.]
Pathfinder has quit [Ping timeout: 260 seconds]
NeverDie has joined #ruby
mjuszczak has quit []
favadi has quit [Client Quit]
<SweetSoulBro> It didn't crash
<SweetSoulBro> So
<SweetSoulBro> I think I got it
mloy has joined #ruby
baweaver has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
<SweetSoulBro> Thanks
<shevy> \o/
<SweetSoulBro> One down
chipotle has joined #ruby
<SweetSoulBro> 5 more to go
<SweetSoulBro> Thanks
SweetSoulBro has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
baroquebobcat has quit [Quit: baroquebobcat]
pu22l3r has quit [Remote host closed the connection]
sanjayu has joined #ruby
hxegon has joined #ruby
rgtk has joined #ruby
aspiers has joined #ruby
rshetty has joined #ruby
towski_ has quit [Remote host closed the connection]
bubbys has quit [Ping timeout: 244 seconds]
rgtk has quit [Read error: No route to host]
<i8igmac> i found a issue with inserting a backslash into mysql.
<i8igmac> how do i say this, double sanitize backslash
rgtk has joined #ruby
<i8igmac> ruby => \\ => \
deject3d_ has quit [Quit: Computer has gone to sleep.]
<i8igmac> mysql \\=> \
bubbys has joined #ruby
<i8igmac> so, in my ruby block i have to do something like '\\\\'
bruno- has joined #ruby
<i8igmac> ruby will sanitize \\\\ => \\
ekinmur has joined #ruby
<i8igmac> then mysql will see \\ =>\
rshetty has quit [Remote host closed the connection]
<i8igmac> are there any cleaner solutions?
bruno- is now known as Guest79214
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
jeffreylevesque has joined #ruby
<jeffreylevesque> anyone here use rubocop?
akem has joined #ruby
allcentury has quit [Ping timeout: 272 seconds]
northfurr has quit [Quit: northfurr]
rgtk has quit [Read error: No route to host]
yfeldblum has joined #ruby
<jeffreylevesque> I want to disable "C: Use the new Ruby 1.9 hash syntax.", since I'm using rubocop to validate my `Puppetfile` - https://travis-ci.org/jeff1evesque/machine-learning/builds/87809815#L1253-L1256
rgtk has joined #ruby
Motoservo has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
pu22l3r has joined #ruby
Motoservo has quit [Client Quit]
rgtk has joined #ruby
allomov has joined #ruby
Guest79214 has quit [Ping timeout: 250 seconds]
pu22l3r has quit [Client Quit]
bb010g has joined #ruby
DiCablo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgtk has quit [Read error: No route to host]
zenguy_pc has quit [Ping timeout: 252 seconds]
rgtk has joined #ruby
northfurr has joined #ruby
jcoe has quit [Read error: Connection reset by peer]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
SweetSoulBro has joined #ruby
<SweetSoulBro> It broke again
<SweetSoulBro> :/
allomov has quit [Ping timeout: 260 seconds]
rgtk has quit [Read error: No route to host]
adm001mi has joined #ruby
<adm001mi> hey all... is the place where I can ask about RVM and gem?
rgtk has joined #ruby
Thomas-0725 has joined #ruby
Thomas-0725 has quit [Client Quit]
<bnagy> adm001mi: yes, but RVM has its own channel as well which might be better, depending
_djbkd has quit [Remote host closed the connection]
<adm001mi> I'm trying to install Diaspora and several dependecies are in the ruby libraries
rgtk has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
finisherr has quit [Quit: finisherr]
<adm001mi> I currently have issues with a possible corrupted rails-4.2.4.gem, bundler
reaVer has quit [Remote host closed the connection]
rgtk has quit [Read error: Connection reset by peer]
hxegon has quit [Ping timeout: 250 seconds]
<SweetSoulBro> Alright
rgtk has joined #ruby
marr has quit [Ping timeout: 240 seconds]
<SweetSoulBro> This thing
_djbkd has joined #ruby
_djbkd has quit [Read error: Connection reset by peer]
<SweetSoulBro> IT's saying the - is not defined :/
_djbkd has joined #ruby
hxegon has joined #ruby
reaVer has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
x-light has joined #ruby
Musashi007 has quit [Quit: Musashi007]
rgtk has joined #ruby
Coldblackice has quit [Read error: Connection reset by peer]
northfurr has quit [Quit: northfurr]
diegoviola has quit [Read error: Connection reset by peer]
<havenwood> adm001mi: Did you see that last line?: Your bundle is not up to date, run the command "bundle install"
rgtk has quit [Read error: Connection reset by peer]
<havenwood> adm001mi: It seems you have a dated version of Bundler.
<havenwood> adm001mi: gem update bundler
rodfersou has quit [Quit: leaving]
rgtk has joined #ruby
pdoherty has quit [Ping timeout: 264 seconds]
<havenwood> SweetSoulBro: Show the code and full error?
<adm001mi> havenwood: should I run it with sudo or not?
northfurr has joined #ruby
<havenwood> adm001mi: not
<adm001mi> kk
<SweetSoulBro> it's the same error I had just five minutes ago that shevy fixed
<havenwood> adm001mi: gem update bundler && bundle install
<SweetSoulBro> different code
mag42c has joined #ruby
<SweetSoulBro> I'm trying to replicate what he did
<SweetSoulBro> but it's not working
<SweetSoulBro> :/
<havenwood> SweetSoulBro: You can update gists.
<SweetSoulBro> C:/users/ORIGIAN/Dropbox/gunbot/plasmasmgclass. method `-' for nil:NilClass (NoMethodError)
rgtk has quit [Read error: No route to host]
<SweetSoulBro> what?
zenguy_pc has joined #ruby
<havenwood> >> nil - 42
<ruboto> havenwood # => undefined method `-' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/459856)
rgtk has joined #ruby
<adm001mi> this is how I did it... http://paste.debian.net/318777
TheNet has joined #ruby
reaVer has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
<SweetSoulBro> nevermind
<SweetSoulBro> I figgured it out
<SweetSoulBro> thanks
<adm001mi> np
<bnagy> i8igmac: '\\\\' is not "sanitized" to \\, that's just how you create two literal backslashes
Musashi007 has joined #ruby
<bnagy> '\\\\'.bytesize
rgtk has joined #ruby
<bnagy> d'oh
<bnagy> >> '\\\\'.bytesize
<ruboto> bnagy # => 2 (https://eval.in/459857)
<bnagy> coffee
reaVer has joined #ruby
<adm001mi> when I run gem install bundler without sudo I get: Fetching: thread_safe-0.3.5.gem (100%)
<adm001mi> ERROR: While executing gem ... (Errno::EACCES)
<adm001mi> Permission denied @ dir_s_mkdir - /var/lib/gems
Jardayn has quit [Quit: Leaving]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
jonee has joined #ruby
SweetSoulBro has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
chipotle has quit [Quit: cheerio]
<i8igmac> i found Mysql_escape, witch cleaned things up a bit
<i8igmac> ruby insert to mysql one backslash => \\\\\\
<havenwood> adm001mi: What do you get for? rvm current
<i8igmac> mysql.escape_string("\\") <= now clean
rgtk has quit [Read error: Connection reset by peer]
<adm001mi> Havenwood: just a sec
rgtk has joined #ruby
<adm001mi> havenwood: ruby-2.1.5
<bnagy> i8igmac: if you think that's cleaner :)
<havenwood> adm001mi: And for?: gem which bundler
<i8igmac> ,-)
rgtk has quit [Read error: No route to host]
<bnagy> >> "\\" == '\\' && '\\' == "\x5c"
<ruboto> bnagy # => true (https://eval.in/459861)
<bnagy> all roads lead to 92
rgtk has joined #ruby
favadi has joined #ruby
Thomas-0725 has joined #ruby
akem has quit [Quit: Bye]
<havenwood> adm001mi: gem install bundler
bruce_lee2 has joined #ruby
<bnagy> with escape_string you're calling a method to convert one byte to two, instead of just writing two bytes into the string in the first place
rgtk has quit [Read error: No route to host]
swgillespie has joined #ruby
<i8igmac> x="\\"
<i8igmac> con.query("UPDATE `compress`.`hash` SET `sub` = '#{Mysql.escape_string(x)}' WHERE `hash`.`ID` =1; ")
<i8igmac> or
<i8igmac> x="\\\\\\"
<i8igmac> con.query("UPDATE `compress`.`hash` SET `sub` = '#{Mysql.escape_string(x)}' WHERE `hash`.`ID` =1; ")
rgtk has joined #ruby
dc_ has joined #ruby
<i8igmac> con.query("UPDATE `compress`.`hash` SET `sub` = '#{x}' WHERE `hash`.`ID` =1; ")
<i8igmac> con.query("UPDATE `compress`.`hash` SET `sub` = '\\\\\\' WHERE `hash`.`ID` =1; ")
kirun has quit [Quit: Client exiting]
eminencehc has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
bruce_lee has quit [Ping timeout: 240 seconds]
secret has joined #ruby
Musashi007 has quit [Quit: Musashi007]
rgtk has quit [Read error: No route to host]
rgtk_ has joined #ruby
<adm001mi> havenwood: /var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler.rb
rgtk_ has quit [Read error: No route to host]
DiCablo has joined #ruby
rgtk has joined #ruby
mag42c has left #ruby [#ruby]
rgtk has quit [Read error: No route to host]
<havenwood> adm001mi: echo $rvm_path
rgtk has joined #ruby
<havenwood> adm001mi: Is it in your home directory?
NeverDie_ has joined #ruby
Thomas-0725 has quit [Quit: Textual IRC Client: www.textualapp.com]
<adm001mi> havenwoord: $rvm_path =
rgtk has quit [Read error: Connection reset by peer]
NeverDie has quit [Ping timeout: 250 seconds]
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgtk has joined #ruby
northfurr has quit [Quit: northfurr]
napcae has left #ruby [#ruby]
rgtk has quit [Read error: No route to host]
rgtk_ has joined #ruby
<adm001mi> havenwood: yes in ~/.rvm
davedev2_ has quit [Remote host closed the connection]
<havenwood> adm001mi: And you did a?: gem install bundler
rgtk_ has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgtk has joined #ruby
Musashi007 has joined #ruby
northfurr has joined #ruby
dikaio has joined #ruby
zenguy_pc has quit [Ping timeout: 256 seconds]
Rickmasta has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
justbleed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shinenelson has quit [Quit: Connection closed for inactivity]
Thomas-0725 has joined #ruby
<havenwood> adm001mi: If not, do that, and recheck: gem which bundler
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
<adm001mi> gem install bundler results in: Fetching: bundler-1.10.6.gem (100%)
<adm001mi> ERROR: While executing gem ... (Gem::FilePermissionError)
<adm001mi> You don't have write permissions for the /var/lib/gems/2.1.0 directory.
<havenwood> adm001mi: echo $GEM_HOME
dikaio has quit [Ping timeout: 244 seconds]
<adm001mi> nothing...
rgtk has quit [Read error: No route to host]
<adm001mi> gem which bundler: /var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler.rb
rgtk has joined #ruby
<havenwood> adm001mi: How about?: gem env gempath
<havenwood> adm001mi: Just to sanity check?: which ruby
<havenwood> adm001mi: which gem
tkuchiki has joined #ruby
<adm001mi> gem env gempath: /home/adm001mi/.gem/ruby/2.1.0:/var/lib/gems/2.1.0:/usr/share/rubygems-integration/2.1.0:/usr/share/rubygems-integration/2.1:/usr/share/rubygems-integration/all
rgtk has quit [Read error: No route to host]
<adm001mi> which ruby: /usr/bin/ruby
ironcame1 is now known as ironcamel
<adm001mi> which gem: /usr/bin/gem
rgtk has joined #ruby
eminencehc has quit [Remote host closed the connection]
eminencehc has joined #ruby
Laaw has quit [Max SendQ exceeded]
<havenwood> adm001mi: Ah, so you have a Ruby selected with RVM but it looks like /usr/bin/ is ahead of RVM in your PATH.
rgtk has quit [Read error: No route to host]
<havenwood> adm001mi: echo $PATH
rgtk has joined #ruby
_djbkd has quit [Remote host closed the connection]
Laaw has joined #ruby
rgtk has quit [Read error: No route to host]
_djbkd has joined #ruby
<havenwood> adm001mi: If it was as RVM wanted it it would start with something like: "/home/adm001mi/.gem/ruby/2.1.5/bin:/home/adm001mi/.rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/bin:..."
Thomas-0725 has quit [Quit: Textual IRC Client: www.textualapp.com]
rgtk has joined #ruby
<adm001mi> havenwood: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/adm001mi/.rvm/bin
eminencehc has quit [Remote host closed the connection]
<adm001mi> [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" >> ~/.bashrc is what I apparently use...
senayar has quit []
eminencehc has joined #ruby
rgtk has quit [Read error: No route to host]
<TheNet> stack overflow is down :o
bryanray has joined #ruby
rgtk has joined #ruby
<havenwood> adm001mi: Let's go to RVM to get it working. It's shell at this point.
<havenwood> adm001mi: The #rvm channel I mean.
<adm001mi> havenwood: aight, thx so far
zenguy_pc has joined #ruby
<havenwood> adm001mi: np
RobertBirnie has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
mikeharris22 has joined #ruby
_djbkd has quit [Ping timeout: 265 seconds]
swgillespie is now known as swgillespie[GT]
rgtk has quit [Read error: Connection reset by peer]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
northfurr has quit [Quit: northfurr]
rgtk has joined #ruby
northfurr has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JDiPierro has joined #ruby
RobertBirnie has quit [Client Quit]
bruno- has joined #ruby
juanpablo__ has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
Rinzlit has joined #ruby
rgtk has joined #ruby
arescorpio has joined #ruby
ibouvousaime has quit [Ping timeout: 252 seconds]
mikeharris22 has quit [Ping timeout: 260 seconds]
rgtk has quit [Read error: Connection reset by peer]
finisherr has joined #ruby
Musashi007 has quit [Quit: Musashi007]
Rinzlit_ has quit [Ping timeout: 246 seconds]
rgtk has joined #ruby
maletor has joined #ruby
leat has joined #ruby
Rollabunna has joined #ruby
kies^ has joined #ruby
northfurr has quit [Client Quit]
l_tonz has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
Coldblackice has joined #ruby
duckpuppy has joined #ruby
rgtk has joined #ruby
juanpablo__ has quit [Ping timeout: 265 seconds]
bruno- has quit [Ping timeout: 265 seconds]
sidearmsplit has joined #ruby
allcentury has joined #ruby
rgtk has quit [Read error: No route to host]
sanjayu has quit [Ping timeout: 256 seconds]
rgtk has joined #ruby
<sidearmsplit> Hello ! can anyone point me to docs on what Foo.new({->var}) would do? I’m mainly curious about what the curly braces inside the new method and -> do with var
<sidearmsplit> I can’t find anything about it in the Class docs
roxtrongo has joined #ruby
tmtwd has joined #ruby
rgtk has quit [Read error: No route to host]
Rollabunna has quit [Ping timeout: 260 seconds]
rgtk has joined #ruby
aspiers has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Ping timeout: 252 seconds]
rgtk has quit [Read error: No route to host]
shadoi has quit [Quit: Leaving.]
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
bruce_lee2 has quit [Changing host]
bruce_lee2 has joined #ruby
Musashi007 has joined #ruby
pdoherty has joined #ruby
pdoherty has quit [Read error: Connection reset by peer]
rgtk has quit [Read error: No route to host]
ESpiney has joined #ruby
rgtk has joined #ruby
JDiPierro has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
tenzan has joined #ruby
rgtk has joined #ruby
chipotle has joined #ruby
tenzan has quit [Client Quit]
pdoherty has joined #ruby
tenzan has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
devoldmx has joined #ruby
rgtk has quit [Read error: No route to host]
bryanray has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
northfurr has joined #ruby
rehat has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
NeverDie_ is now known as NeverDie
devoldmx has quit [Ping timeout: 240 seconds]
rgtk has quit [Read error: No route to host]
duckpuppy has joined #ruby
rgtk has joined #ruby
_djbkd has joined #ruby
sankaber has joined #ruby
s00pcan has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
SenpaiSilver has joined #ruby
<shevy> sidearmsplit isn't that a lambda?
rgtk has joined #ruby
<shevy> I don't like the -> so I don't really know what the code is doing; the {} makes it a hash right?
hxegon has quit [Ping timeout: 240 seconds]
<bnagy> how is that not a syntax error?
<al2o3-cr> it is
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
_djbkd has quit [Ping timeout: 246 seconds]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
ramfjord has quit [Quit: leaving]
asianMike has quit [Remote host closed the connection]
cwong_on_irc has joined #ruby
rgtk has quit [Read error: No route to host]
cwong_on_irc has quit [Max SendQ exceeded]
rgtk has joined #ruby
dc_ has quit []
cwong_on_irc has joined #ruby
DiCablo has quit [Quit: Textual IRC Client: www.textualapp.com]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
Cyther has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
rshetty has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
duckpuppy has quit [Ping timeout: 265 seconds]
bryanray has joined #ruby
devbug has joined #ruby
rgtk has quit [Read error: No route to host]
saddad has joined #ruby
rgtk has joined #ruby
tjbiddle has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
favadi has joined #ruby
rgtk has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hxegon has joined #ruby
leafybasil has quit [Remote host closed the connection]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rshetty has quit [Read error: Connection reset by peer]
rgtk has quit [Ping timeout: 260 seconds]
Oatmeal has quit [Ping timeout: 265 seconds]
rshetty has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has quit [Quit: Musashi007]
rshetty has quit [Remote host closed the connection]
rgtk has joined #ruby
jpfuentes2 has quit [Quit: Textual IRC Client: www.textualapp.com]
deception1 has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
jpfuentes2 has joined #ruby
mloy has quit [Ping timeout: 260 seconds]
rgtk has quit [Read error: No route to host]
crdpink2 has joined #ruby
rgtk has joined #ruby
jonee has quit [Ping timeout: 260 seconds]
crdpink has quit [Ping timeout: 246 seconds]
_blizzy_ has joined #ruby
_blizzy_ has quit [Max SendQ exceeded]
Oatmeal has joined #ruby
_blizzy_ has joined #ruby
northfurr has quit [Quit: northfurr]
baweaver has joined #ruby
A124 has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk_ has joined #ruby
sidearmsplit has quit [Quit: sidearmsplit]
`tim` has joined #ruby
Musashi007 has joined #ruby
eminencehc has quit [Remote host closed the connection]
towski_ has joined #ruby
Tombk has left #ruby [#ruby]
A124 has joined #ruby
bruno- has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
schaary has quit [Ping timeout: 264 seconds]
golgaroth has quit [Read error: Connection reset by peer]
lancetw has quit [Read error: Connection reset by peer]
n1ftyn8_ has quit [Read error: Connection reset by peer]
jxf has quit [Read error: Connection reset by peer]
mostlybadfly has quit [Ping timeout: 268 seconds]
joaomdmoura has quit [Ping timeout: 268 seconds]
jevs has quit [Ping timeout: 268 seconds]
knowtheory has quit [Read error: Connection reset by peer]
juanpablo__ has joined #ruby
djbender has quit [Read error: Connection reset by peer]
halfdan has quit [Read error: Connection reset by peer]
cbetta has quit [Read error: Connection reset by peer]
cardoni has quit [Read error: Connection reset by peer]
EmeraldExplorer has quit [Read error: Connection reset by peer]
holsee_ has quit [Read error: Connection reset by peer]
benlakey has quit [Read error: Connection reset by peer]
Heero has quit [Read error: Connection reset by peer]
ckrailo has quit [Read error: Connection reset by peer]
AdamMeghji has quit [Read error: Connection reset by peer]
frode15243 has quit [Read error: Connection reset by peer]
bryancp has quit [Read error: Connection reset by peer]
amitchellbullard has quit [Read error: Connection reset by peer]
jeregrine has quit [Read error: Connection reset by peer]
bcavileer has quit [Read error: Connection reset by peer]
deimos has quit [Read error: Connection reset by peer]
jabreity_ has quit [Read error: Connection reset by peer]
shelling__ has quit [Read error: Connection reset by peer]
apipkin has quit [Read error: Connection reset by peer]
dukedave has quit [Read error: Connection reset by peer]
mroth has quit [Read error: Connection reset by peer]
akitada has quit [Read error: Connection reset by peer]
zemmihates has quit [Read error: Connection reset by peer]
colstrom has quit [Read error: Connection reset by peer]
charles81 has quit [Read error: Connection reset by peer]
prosodyvVC has quit [Read error: Connection reset by peer]
Iacobus has quit [Read error: Connection reset by peer]
boxrick1 has quit [Read error: Connection reset by peer]
jmcc has quit [Read error: Connection reset by peer]
bove has quit [Read error: Connection reset by peer]
im0b has quit [Read error: Connection reset by peer]
jpinnix______ has quit [Read error: Connection reset by peer]
nyandoge has quit [Read error: Connection reset by peer]
rgtk_ has quit [Ping timeout: 260 seconds]
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
greenbigfrog has quit [Quit: The server of my BNC just shutdown or got killed!!!]
glowcoil has quit [Ping timeout: 268 seconds]
Musashi007 has quit [Client Quit]
hxegon_ has joined #ruby
kalzz has quit [Ping timeout: 240 seconds]
cardoni has joined #ruby
djbender has joined #ruby
n1ftyn8_ has joined #ruby
schaary has joined #ruby
bryancp has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
kalz has quit [Ping timeout: 250 seconds]
lancetw has joined #ruby
benlakey has joined #ruby
charles81 has joined #ruby
nyandoge has joined #ruby
AdamMeghji has joined #ruby
ckrailo has joined #ruby
amitchellbullard has joined #ruby
jabreity_ has joined #ruby
shelling__ has joined #ruby
towski_ has quit [Remote host closed the connection]
bcavileer has joined #ruby
cbetta has joined #ruby
jeregrine has joined #ruby
zenguy_pc has quit [Ping timeout: 260 seconds]
akitada has joined #ruby
juanpablo__ has quit [Ping timeout: 260 seconds]
deimos has joined #ruby
greenbigfrog has joined #ruby
bruno- has quit [Ping timeout: 268 seconds]
boxrick1 has joined #ruby
im0b has joined #ruby
`tim` has quit [Quit: Textual IRC Client: www.textualapp.com]
hxegon has quit [Ping timeout: 244 seconds]
halfdan has joined #ruby
jonee has joined #ruby
apipkin has joined #ruby
jevs has joined #ruby
jpinnix______ has joined #ruby
EmeraldExplorer has joined #ruby
RegulationD has joined #ruby
colstrom has joined #ruby
Iacobus has joined #ruby
mroth has joined #ruby
prosodyvVC has joined #ruby
jmcc has joined #ruby
bove has joined #ruby
sankaber has quit [Remote host closed the connection]
Heero has joined #ruby
joaomdmoura has joined #ruby
sankaber has joined #ruby
kalzz has joined #ruby
rgtk has joined #ruby
zemmihates has joined #ruby
dukedave has joined #ruby
Anthony_ has joined #ruby
holsee_ has joined #ruby
knowtheory has joined #ruby
golgaroth has joined #ruby
frode15243 has joined #ruby
mostlybadfly has joined #ruby
jxf has joined #ruby
_blizzy_ has quit [Disconnected by services]
Anthony_ is now known as _blizzy_
<shevy> sidearmsplit faded away ... another webchatter bites the dust
specialblend has joined #ruby
RegulationD has quit [Ping timeout: 264 seconds]
Motoservo has joined #ruby
rgtk_ has joined #ruby
glowcoil has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
l_tonz has joined #ruby
vdamewood has joined #ruby
duncannz has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
rgtk_ has quit [Read error: No route to host]
rgtk has joined #ruby
zenguy_pc has joined #ruby
solocshaw has quit [Ping timeout: 272 seconds]
<jeffreylevesque> anyone here use ruby linting?
Musashi007 has joined #ruby
dopie has joined #ruby
l_tonz has quit [Ping timeout: 272 seconds]
kalz has joined #ruby
yfeldblum has quit [Remote host closed the connection]
bryanray has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allcentury has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby
TheNet has quit [Remote host closed the connection]
c355E3B has quit [Quit: Connection closed for inactivity]
rgtk has quit [Ping timeout: 260 seconds]
TheNet has joined #ruby
dorei has quit []
mallu has joined #ruby
solenoids has quit [Ping timeout: 256 seconds]
<mallu> I have simple values ["a", "c", "f']. How do I sort it?
l_tonz has joined #ruby
pathrocl_ has quit [Remote host closed the connection]
tlaxkit has quit [Quit: ¡Hasta luego!]
keen___________0 has joined #ruby
jaequery has joined #ruby
<Radar> mallu: what did you try?
FungalRaincloud has joined #ruby
jordanm has quit [Read error: Connection reset by peer]
freerobby has quit [Quit: Leaving.]
mwlang has quit [Quit: mwlang]
keen____________ has quit [Ping timeout: 255 seconds]
bryanray has joined #ruby
Musashi007 has quit [Quit: Musashi007]
x-light has quit [Ping timeout: 255 seconds]
linduxed has quit [Ping timeout: 255 seconds]
TheNet has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
roxtrongo has quit [Remote host closed the connection]
jonee has quit [Ping timeout: 265 seconds]
roxtrongo has joined #ruby
juanpablo__ has quit [Ping timeout: 264 seconds]
duckpuppy has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
solenoids has joined #ruby
hightower2 has joined #ruby
<hightower2> Hey, I run an irb session with IRB.start_no_setup. Before or after that, I would like to define a function which should be accessible from the IRB shell directly (without prefixing with module or class name). How would I do that?
rakm has joined #ruby
rakm has quit [Client Quit]
<hightower2> Oh I see, it is executing in 'main', so I just def the function before calling start
TheNet has joined #ruby
Feyn has joined #ruby
duckpuppy has quit [Ping timeout: 264 seconds]
cmoney has joined #ruby
bryanray has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bryanray has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
<jaequery> if i have an object, Something.name, how can i call it this way, Something.call(some_variable) , where some_variable is "name"
<Radar> jaequery: Something.send(some_variable)
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonee has joined #ruby
mwlang has joined #ruby
jcdenton has joined #ruby
tjbiddle has quit [Ping timeout: 240 seconds]
l_tonz has quit [Remote host closed the connection]
tjbiddle has joined #ruby
<mallu> Radar: for sorting I tried this File.open("/stack_names.json", "w") do |f|
<mallu> f.write(stack_names.sort)
<mallu> end
darkf has joined #ruby
<Radar> mallu: We don't know what stack_names.json is.
<mallu> but I am getting undefined method `sort' for #<String:0x000000013c94b0> (NoMethodError)
<mallu> stack_names.json I want to create that file
asianMike has joined #ruby
linduxed has joined #ruby
<jcdenton> stack_names is of type string ? which doesn't have a sort method?
<mallu> I want to sort stack_names array and wrote that to /stack_names.json
gener1c_ has joined #ruby
<jcdenton> it seem slike interpreter is telling you that stack_names is of type string
<jcdenton> so error must before that line
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
tenzan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gener1c has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mallu> stack_name is a json !
<mallu> so I need to sort it
braincrash has quit [Quit: bye bye]
bruno- has joined #ruby
sdothum has joined #ruby
Rollabunna has joined #ruby
benlieb has joined #ruby
jc036821 has joined #ruby
jc036821 has quit [Client Quit]
bruno- has quit [Ping timeout: 252 seconds]
RobertBirnie has joined #ruby
RobertBirnie has quit [Remote host closed the connection]
braincrash has joined #ruby
Alina-malina has quit [Ping timeout: 252 seconds]
d34th4ck3r has quit [Quit: zzz]
RegulationD has joined #ruby
Rollabunna has quit [Ping timeout: 244 seconds]
mallu has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
tkuchiki has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 246 seconds]
bryancp has quit [Ping timeout: 240 seconds]
Guest93971 has quit [Ping timeout: 240 seconds]
TheNet_ has joined #ruby
Guest93971 has joined #ruby
bryancp has joined #ruby
bb010g has quit [Ping timeout: 240 seconds]
im0b has quit [Ping timeout: 240 seconds]
dopieee has joined #ruby
tjbiddle has quit [Ping timeout: 264 seconds]
hxegon has joined #ruby
blackgoat has joined #ruby
hxegon_ has quit [Ping timeout: 250 seconds]
darkf has quit [Ping timeout: 240 seconds]
TheNet has quit [Ping timeout: 240 seconds]
bb010g has joined #ruby
gix has quit [Ping timeout: 255 seconds]
im0b has joined #ruby
dopie has quit [Ping timeout: 260 seconds]
blackgoat has quit [Client Quit]
SShrike has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
blackgoat has joined #ruby
darkf_ has joined #ruby
<hightower2> How would I convert all values in hash from Symbol to String?
h99h9h88 has joined #ruby
sdothum has joined #ruby
devoldmx has joined #ruby
gix has joined #ruby
blackgoat has quit [Client Quit]
<al2o3-cr> hightower2: hash.map { |k, v| hash[k] = v.to_s }
bluOxigen has joined #ruby
<hightower2> Oh, right, I was thinking if there was a way that does not involve setting hash[k] in each pass, but that will work, thanks
swgillespie[GT] has quit [Quit: Textual IRC Client: www.textualapp.com]
h99h9h88 has quit [Remote host closed the connection]
EllisTAA has left #ruby [#ruby]
blueOxigen has quit [Ping timeout: 252 seconds]
yeticry has quit [Ping timeout: 250 seconds]
terminalrecluse has joined #ruby
FungalRaincloud has quit [Quit: Leaving.]
tjbiddle has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
yeticry has joined #ruby
darkf_ is now known as darkf
dikaio has joined #ruby
<baweaver> hightower2: hash.map { |k,v| [k,v.to_s] }.to_h
linduxed has quit [Ping timeout: 264 seconds]
eminencehc has joined #ruby
swgillespie has joined #ruby
<bnagy> >> h1 = {a: :b}; h2 = Hash.new {|h,k| h1[k].to_s}; h2[:a]
<ruboto> bnagy # => "b" (https://eval.in/459873)
<baweaver> >> class Hash;def map_vals; self.map{|k,v|[k,yield(v)]}.to_h end end; {a: 1, b: 2}.map_vals { |v| v * 2 }
<ruboto> baweaver # => {:a=>2, :b=>4} (https://eval.in/459874)
eminencehc has quit [Remote host closed the connection]
saddad has quit [Quit: WeeChat 1.4-dev]
CVTJNII has joined #ruby
freerobby has quit [Quit: Leaving.]
saddad has joined #ruby
linduxed has joined #ruby
i8igmac has quit [Ping timeout: 264 seconds]
duncannz has quit [Ping timeout: 256 seconds]
djbkd has quit [Quit: Leaving...]
joufflu has joined #ruby
graffix has joined #ruby
Feyn has quit [Read error: Connection reset by peer]
l_tonz has joined #ruby
vdamewood has quit [Quit: Life beckons.]
solocshaw has joined #ruby
saddad has quit [Quit: WeeChat 1.4-dev]
cmoney has quit [Remote host closed the connection]
specialblend has quit [Quit: specialblend]
devbug_ has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Feyn has joined #ruby
<graffix> greetings
tenzan has joined #ruby
<blubjr> hi graffix
shinenelson has joined #ruby
<graffix> I am trying to setup the code here https://github.com/jeroenr/awection, I’m just trying to get it working locally in a vagrant vm, I have the server running, listening at port 4000, and I have the app running listening at port 3000
<graffix> but when I try to connect to the app I get an error
devbug has quit [Ping timeout: 272 seconds]
<graffix> undefined method `websocket_endpoint' for AuctionEngine::App:Class
<graffix> I know absolutely nothing about ruby
<graffix> I googled the error, but I can’t find anything relevant
bryanray has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leafybasil has joined #ruby
arescorpio has quit [Quit: Leaving.]
<graffix> it’s running on sinatra, with thin webserver
<graffix> I see it’s giving me a method undefined error, but I’m not sure why it would be undefined, I pullled the code from github and followed all the instructions to get it running
allcentury has joined #ruby
leafybasil has quit [Ping timeout: 250 seconds]
moeabdol1 has joined #ruby
<finisherr> If you call a bare method in a ruby program, what is the receiver of the method?
djbkd has joined #ruby
sdfgsdfg has joined #ruby
bruno- has joined #ruby
nemo_ has joined #ruby
zenguy_pc has quit [Ping timeout: 240 seconds]
bruno- has quit [Ping timeout: 260 seconds]
astrobunny has joined #ruby
manuelmesson has joined #ruby
RegulationD has joined #ruby
<graffix> heck I don’t knwo, kind of why I was asking
tkuchiki has joined #ruby
d34th4ck3r has joined #ruby
shinnya has quit [Ping timeout: 264 seconds]
PaulCapestany has quit [Quit: .]
RegulationD has quit [Ping timeout: 265 seconds]
tkuchiki has quit [Ping timeout: 256 seconds]
PaulCapestany has joined #ruby
hxegon has quit [Ping timeout: 240 seconds]
Puffball has quit [Remote host closed the connection]
astrobunny has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has joined #ruby
Puffball has joined #ruby
devbug_ has quit [Read error: Connection reset by peer]
ryanlntn has joined #ruby
devbug has joined #ruby
davedev24 has joined #ruby
tkuchiki has joined #ruby
nemo_ has quit [Remote host closed the connection]
ryanlntn has left #ruby [#ruby]
patdohere has joined #ruby
l_tonz has quit [Remote host closed the connection]
<graffix> what would this denote inside of a erb template <%= websocket_endpoint %>?
jcdenton has quit [Ping timeout: 252 seconds]
juanpablo__ has quit [Ping timeout: 264 seconds]
manuelmesson has quit [Remote host closed the connection]
asianMike has quit [Remote host closed the connection]
jcdenton has joined #ruby
davedev24 has quit [Ping timeout: 246 seconds]
jcdenton has left #ruby [#ruby]
l_tonz has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
<havenwood> finisherr: self
djbkd has quit [Remote host closed the connection]
nemo_ has joined #ruby
<havenwood> finisherr: which is "main" at top level
<havenwood> >> self
<ruboto> havenwood # => main (https://eval.in/459879)
vondruch has joined #ruby
patdohere has quit [Read error: Connection reset by peer]
vondruch has quit [Client Quit]
vondruch has joined #ruby
PaulCape_ has joined #ruby
patdohere has joined #ruby
astrobunny has joined #ruby
joufflu has quit [Read error: Connection reset by peer]
ICantCook has quit [Quit: bye]
PaulCapestany has quit [Ping timeout: 240 seconds]
_blizzy_ has quit [Quit: Leaving]
<finisherr> thanks
yes`r has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
hxegon has joined #ruby
yeticry has joined #ruby
duckpuppy has joined #ruby
favadi has joined #ruby
djbkd has joined #ruby
<havenwood> finisherr: No prob, `main` is a bit of a strange thing: https://banisterfiend.wordpress.com/tag/main/
allomov has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
dfinninger has joined #ruby
jaequery has quit [Quit: Textual IRC Client: www.textualapp.com]
devoldmx has joined #ruby
d34th4ck3r has quit [Quit: zzz]
skinux has quit [Quit: Leaving]
zenguy_pc has quit [Ping timeout: 265 seconds]
d34th4ck3r has joined #ruby
huwjass has joined #ruby
chipotle has quit [Quit: cheerio]
Fire-Dragon-DoL has quit []
Mia has quit [Read error: Connection reset by peer]
hughjasss has quit [Ping timeout: 255 seconds]
mistermocha has quit [Remote host closed the connection]
<havenwood> >> class << self; remove_method :inspect end; self
<ruboto> havenwood # => #<Object:0x40696e38> (https://eval.in/459896)
aspiers has joined #ruby
hmsimha_ has joined #ruby
PaulCapestany has joined #ruby
SOLDIERz has joined #ruby
leafybasil has joined #ruby
naftilos76 has joined #ruby
pepperbreath has left #ruby [#ruby]
EasyCo has joined #ruby
PaulCape_ has quit [Ping timeout: 252 seconds]
zenguy_pc has joined #ruby
dfinninger has quit [Remote host closed the connection]
leafybasil has quit [Ping timeout: 240 seconds]
ESpiney has quit [Quit: Leaving]
djbkd has quit [Remote host closed the connection]
hxegon has quit [Ping timeout: 259 seconds]
chipotle has joined #ruby
TheNet_ has quit [Remote host closed the connection]
Rollabunna has joined #ruby
jonee has quit [Ping timeout: 250 seconds]
tlarevo has joined #ruby
arup_r has quit [Quit: Leaving]
arup_r has joined #ruby
Rollabunna has quit [Ping timeout: 265 seconds]
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
arup_r has quit [Client Quit]
tmtwd has quit [Ping timeout: 250 seconds]
allomov has quit [Remote host closed the connection]
<graffix> ah, it was silly, just needed to set that local
p1k has joined #ruby
<p1k> are name = Class.new {<blk>} and class <name> end
<p1k> supposed to be different?
maletor has joined #ruby
linduxed has quit [Ping timeout: 256 seconds]
<p1k> constants seem to behave quite differently when defined within an anonymous block
l_tonz has quit [Remote host closed the connection]
amclain has quit [Quit: Leaving]
jonee has joined #ruby
Iacobus has quit [Ping timeout: 246 seconds]
hxegon has joined #ruby
PaulCape_ has joined #ruby
Iacobus has joined #ruby
PaulCapestany has quit [Ping timeout: 264 seconds]
CloCkWeRX has quit [Ping timeout: 244 seconds]
kp666 has joined #ruby
aganov has joined #ruby
linduxed has joined #ruby
hxegon has quit [Ping timeout: 250 seconds]
hxegon has joined #ruby
tlarevo has quit [Read error: Connection reset by peer]
Coldblackice has quit [Ping timeout: 268 seconds]
poguez_ has quit [Quit: Connection closed for inactivity]
tlarevo has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tjbiddle has quit [Ping timeout: 260 seconds]
deception1 has quit [Ping timeout: 256 seconds]
i8igmac has joined #ruby
tlarevo has quit [Read error: Connection reset by peer]
tlarevo has joined #ruby
Motoservo has quit [Quit: Shhh. I'm trying to get some sleep here.]
phillips1012 has joined #ruby
trautwein has joined #ruby
h99h9h88 has joined #ruby
tagrudev has joined #ruby
solenoids has quit [Ping timeout: 240 seconds]
adm001mi has quit [Quit: Leaving]
CloCkWeRX has joined #ruby
minimalism has joined #ruby
htmldrum has quit [Ping timeout: 256 seconds]
SCHAAP137 has joined #ruby
Macaveli has joined #ruby
tlarevo has quit [Read error: Connection reset by peer]
tlarevo has joined #ruby
Macaveli has quit [Ping timeout: 265 seconds]
last_staff has joined #ruby
h99h9h88 has quit [Remote host closed the connection]
h99h9h88 has joined #ruby
dikaio has quit [Ping timeout: 264 seconds]
User458764 has joined #ruby
stardiviner has quit [Ping timeout: 256 seconds]
norc has joined #ruby
mistermocha has joined #ruby
<norc> >> p 1 {}
<ruboto> norc # => /tmp/execpad-38625e912eba/source-38625e912eba:2: syntax error, unexpected '{', expecting keyword_end ...check link for more (https://eval.in/459909)
<norc> Why is that not recognized as a block?
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
<norc> Is that because it is parsed as (p(1)) {} ?
h99h9h88 has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 240 seconds]
yes`r has quit [Ping timeout: 260 seconds]
<apeiros> norc: no, as p(1 {})
<apeiros> and 1 doesn't take a block.
* apeiros afk
manuelmesson has joined #ruby
PaulCape_ has quit [Quit: .]
PaulCapestany has joined #ruby
platzhirsch has joined #ruby
SylarRuby has joined #ruby
tvw has joined #ruby
ahegyi has joined #ruby
deception1 has joined #ruby
ruurd has joined #ruby
charliesome has joined #ruby
jimms has joined #ruby
roxtrongo has quit [Remote host closed the connection]
rgtk has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
Musashi007 has joined #ruby
charliesome has quit [Client Quit]
bruno- has joined #ruby
ruurd has quit [Ping timeout: 244 seconds]
platzhirsch has quit [Ping timeout: 260 seconds]
towski_ has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
maletor has quit [Quit: Computer has gone to sleep.]
manuelmesson has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
bruno- has quit [Ping timeout: 256 seconds]
User458764 has quit [Quit: Textual IRC Client: www.textualapp.com]
RegulationD has joined #ruby
towski_ has quit [Ping timeout: 265 seconds]
Xzanron has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
juanpablo__ has quit [Ping timeout: 260 seconds]
EmeraldExplorer has quit [Quit: Connection closed for inactivity]
timonv has joined #ruby
VeryBewitching has quit [Quit: Konversation terminated!]
d34th4ck3r has quit [Quit: zzz]
ruurd has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
yes`r has joined #ruby
ruurd has quit [Ping timeout: 246 seconds]
User458764 has joined #ruby
dionysus69 has joined #ruby
<norc> apeiros: Ah that makes sense.
krz has joined #ruby
i8igmac has quit [Ping timeout: 255 seconds]
i8igmac has joined #ruby
PaulCape_ has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
howdoi has joined #ruby
PaulCapestany has quit [Ping timeout: 260 seconds]
nemo_ has quit [Remote host closed the connection]
kies^ has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
blue_deref has quit [Quit: bbn]
moeabdol1 has quit [Ping timeout: 252 seconds]
nemo_ has joined #ruby
codecop has joined #ruby
duckpuppy has joined #ruby
kies^ has joined #ruby
Guest37565 has quit [Ping timeout: 240 seconds]
hightower2 has quit [Ping timeout: 268 seconds]
d34th4ck3r has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rehat has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
bMalum has joined #ruby
sanjayu has joined #ruby
tlarevo has quit [Ping timeout: 268 seconds]
allomov has joined #ruby
quazimodo has quit [Ping timeout: 240 seconds]
tlarevo has joined #ruby
kies^ has quit [Remote host closed the connection]
kimegede has joined #ruby
tlarevo_ has joined #ruby
tlarevo has quit [Read error: Connection reset by peer]
arooni has quit [Ping timeout: 246 seconds]
tlarevo_ has quit [Ping timeout: 250 seconds]
htmldrum has joined #ruby
tlarevo has joined #ruby
karapetyan has joined #ruby
shinnya has joined #ruby
<naftilos76> Is there a way to force strings that rails retrieves from the db to utf8 in order to avoid issues with non-english chars in a global scale? I tried in /config/application.rb to add the line config.encoding = "utf-8" but it did not make any difference. The only solution that works iss to use string.force_encoding(Encoding::UTF_8) . Does anybody have anything else to suggest?
benlieb has quit [Quit: benlieb]
tlarevo has quit [Ping timeout: 246 seconds]
devbug has quit [Read error: Connection reset by peer]
tlarevo has joined #ruby
michae has left #ruby ["WeeChat 1.1.1"]
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has quit [Ping timeout: 240 seconds]
nemo_ has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
Asher has joined #ruby
TomyWork has joined #ruby
arooni has joined #ruby
SCHAAP137 has joined #ruby
<blubjr> how do i check if a predicate returns true for every element in a sequence
DoubleMalt has joined #ruby
<blubjr> like every in lisp
kimegede has quit [Quit: Leaving...]
dikaio has joined #ruby
roxtrongo has joined #ruby
<djellemah> blubjr: Array#all?
Musashi007 has quit [Quit: Musashi007]
<norc> naftilos76: I recommend you try asking in #rubyonrails since I suspect this to be ActiveRecord specific.
<blubjr> yes thank you
l_tonz has joined #ruby
Rollabunna has joined #ruby
moeabdol1 has joined #ruby
bruno- has joined #ruby
nfk|laptop has joined #ruby
baweaver has quit [Remote host closed the connection]
dionysus69 has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
aufi has joined #ruby
zenguy_pc has joined #ruby
stan has joined #ruby
Rollabunna has quit [Ping timeout: 265 seconds]
l_tonz has quit [Ping timeout: 260 seconds]
bruno- has quit [Ping timeout: 265 seconds]
leafybasil has joined #ruby
purplexed- has quit [Ping timeout: 264 seconds]
Timba-as has joined #ruby
al2o3-cr has joined #ruby
leafybasil has quit [Ping timeout: 250 seconds]
nemo_ has joined #ruby
allomov has quit [Remote host closed the connection]
chipotle has quit [Ping timeout: 244 seconds]
kobain has quit [Ping timeout: 252 seconds]
karapetyan has quit [Remote host closed the connection]
platzhirsch has joined #ruby
karapetyan has joined #ruby
ahegyi has quit [Ping timeout: 246 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
Rollabunna has joined #ruby
nhhagen has joined #ruby
stardiviner has joined #ruby
Voker57 has joined #ruby
hxegon has quit [Ping timeout: 244 seconds]
matcouto has joined #ruby
Olipro- has joined #ruby
Olipro- is now known as Guest23333
al2o3-cr has quit [Ping timeout: 256 seconds]
al2o3-cr has joined #ruby
agit0 has joined #ruby
charliesome has joined #ruby
everbot has joined #ruby
solars has joined #ruby
Rollabunna has quit [Remote host closed the connection]
Rollabunna has joined #ruby
charliesome has quit [Client Quit]
arooni has quit [Ping timeout: 246 seconds]
DoubleMalt has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
aspiers has quit [Ping timeout: 252 seconds]
patdohere has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
stamina has joined #ruby
Rollabunna has quit [Ping timeout: 264 seconds]
timonv has quit [Ping timeout: 240 seconds]
p1k has quit [Quit: Leaving]
chipotle has joined #ruby
johnny56 has quit [Quit: WeeChat 1.4-dev]
Pathfinder has joined #ruby
johnny56 has joined #ruby
yfeldblum has joined #ruby
Ulfalizer has quit [Read error: No route to host]
hughjasss has joined #ruby
joonty has joined #ruby
marr has joined #ruby
User458764 has joined #ruby
senayar has joined #ruby
huwjass has quit [Ping timeout: 252 seconds]
arup_r has joined #ruby
Musashi007 has joined #ruby
techsethi has joined #ruby
ocx has joined #ruby
<ocx> hello, how can i receive an argument/parameter from a websocket request?
jimms has quit [Remote host closed the connection]
finisherr has quit [Quit: finisherr]
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
jimms has joined #ruby
finisherr has joined #ruby
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
Cyther has joined #ruby
arup_r has quit [Max SendQ exceeded]
<ocx> anyopne?
<apeiros> ocx: I don't even know where to start at how much context you left out
arup_r has joined #ruby
<ocx> apeiros: i am sending from javascript a websocket request with some data, want to read that data in sinatra
devoldmx has quit [Remote host closed the connection]
<apeiros> then you probably want to ask your question in #sinatra
ocx has left #ruby [#ruby]
juanpablo__ has joined #ruby
rbowlby has quit []
tlarevo has quit [Ping timeout: 265 seconds]
bruce_lee2 is now known as bruce_lee
mikecmpbll has joined #ruby
tenzan has quit [Quit: Textual IRC Client: www.textualapp.com]
kimegede has joined #ruby
finisherr has quit [Quit: finisherr]
juanpablo__ has quit [Ping timeout: 246 seconds]
tlarevo has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
musou has quit [Quit: Connection closed for inactivity]
patchedmonkey has joined #ruby
patchedmonkey has quit [Remote host closed the connection]
leat has quit [Remote host closed the connection]
leat has joined #ruby
nemo_ has quit [Remote host closed the connection]
startupality has joined #ruby
patchedmonkey has joined #ruby
rgtk has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
Hounddog has joined #ruby
jas02 has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
cwong_on_irc has quit [Quit: Leaving.]
Gi0 has quit [Quit: None]
RegulationD has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
Pathfinder has quit [Ping timeout: 250 seconds]
stamina has quit [Ping timeout: 264 seconds]
leat has quit [Remote host closed the connection]
leat has joined #ruby
DoubleMalt has joined #ruby
gregf_ has quit [Quit: Lost terminal]
shinenelson has quit [Quit: Connection closed for inactivity]
RegulationD has quit [Ping timeout: 250 seconds]
DEA7TH has joined #ruby
shredding has joined #ruby
Cyther has quit [Quit: Leaving]
quazimodo has joined #ruby
shinenelson has joined #ruby
bMalum_ has joined #ruby
dANO- has joined #ruby
bMalum has quit [Ping timeout: 268 seconds]
bMalum_ is now known as bMalum
jimms has quit []
krz has quit [Ping timeout: 250 seconds]
senayar has quit [Read error: Connection reset by peer]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
senayar has quit [Client Quit]
Luming has quit [Remote host closed the connection]
mark2 has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
nemo_ has joined #ruby
krz has joined #ruby
jonee has quit [Ping timeout: 265 seconds]
faces has quit []
dikaio has quit [Quit: ........]
astrobunny has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
gregf_ has joined #ruby
vigintas has joined #ruby
sphex_ has joined #ruby
leafybasil has joined #ruby
sphex has quit [Read error: Connection reset by peer]
Nahra` has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
darkf_ has joined #ruby
Puck7744 has joined #ruby
atmosx has quit [Read error: Connection reset by peer]
Timba-as has quit [Quit: Lingo: www.lingoirc.com]
leafybasil has quit [Remote host closed the connection]
crdpink2 has quit [Excess Flood]
sfr^ has quit [Ping timeout: 246 seconds]
jaxxstorm has quit [Ping timeout: 246 seconds]
atmosx has joined #ruby
crdpink2 has joined #ruby
universa1 has quit [Ping timeout: 246 seconds]
DanKnox^ has quit [Ping timeout: 246 seconds]
jaxxstorm has joined #ruby
darkf has quit [Ping timeout: 246 seconds]
cbetta has quit [Ping timeout: 246 seconds]
torpig has quit [Ping timeout: 246 seconds]
linc01n_ has quit [Ping timeout: 246 seconds]
PhilK has quit [Ping timeout: 246 seconds]
kerunaru has joined #ruby
Puck6633 has quit [Ping timeout: 246 seconds]
platzhirsch has quit [Ping timeout: 240 seconds]
cbetta has joined #ruby
PhilK has joined #ruby
sfr^ has joined #ruby
torpig has joined #ruby
DanKnox[away] has joined #ruby
universa1 has joined #ruby
linc01n has joined #ruby
last_staff has quit [Quit: last_staff]
arup_r has quit [Quit: Leaving]
rgtk has joined #ruby
platzhirsch has joined #ruby
patchedmonkey has quit [Quit: Textual IRC Client: www.textualapp.com]
sanguisdex has quit [Quit: Leaving.]
Nahra has joined #ruby
Rollabunna has joined #ruby
Feyn has quit [Quit: Leaving]
darkf_ is now known as darkf
devoldmx has joined #ruby
duckpuppy has quit [Ping timeout: 268 seconds]
zenguy_pc has quit [Ping timeout: 250 seconds]
Platini has joined #ruby
devoldmx has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
sepp2k has joined #ruby
silverdust has left #ruby [#ruby]
rodfersou has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
pandaant has joined #ruby
zenguy_pc has joined #ruby
spider-mario has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
catphish has joined #ruby
dionysus69 has joined #ruby
User458764 has quit [Ping timeout: 255 seconds]
krz has quit [Quit: WeeChat 1.2]
bruno- has joined #ruby
haxrbyte_ has quit [Read error: Connection reset by peer]
jonee has joined #ruby
haxrbyte has joined #ruby
Rickmasta has joined #ruby
nhhagen has quit [Remote host closed the connection]
timonv has joined #ruby
platzhirsch has left #ruby [#ruby]
bruno- has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Remote host closed the connection]
hughjasss has quit [Ping timeout: 255 seconds]
rgtk has quit [Remote host closed the connection]
minimalism has quit [Quit: leaving]
techsethi has quit [Quit: techsethi]
Guest34849 has joined #ruby
Guest34849 is now known as pard
<pard> greetin's
<blubjr> hi pard
DEA7TH has quit [Quit: DEA7TH]
<pard> :)
c355E3B has joined #ruby
techsethi has joined #ruby
minimalism has joined #ruby
DEA7TH has joined #ruby
ldnunes has joined #ruby
<apeiros> pard: you do know that replacing "g" with "'" is not really english?
<pard> does "require"ng a module pollute the scope it was imported in?
<apeiros> you can't require modules. require is file based.
DEA7TH has quit [Client Quit]
<apeiros> and the required file can add stuff wherever it wants, so yes, it can pollute existing scopes.
<pard> thanks
codecop has quit [Remote host closed the connection]
<pard> are there any measures that can be taken so it won't happen?
<pard> ok , accept my apologies; i will use the correct spelling
<apeiros> no sensible ones IMO
niemcu has joined #ruby
<apeiros> you can freeze a module. that'll prevent adding anything to it.
<pard> thanks a lot
<pard> so with every require a potential pollution entails
Coraline has quit [Ping timeout: 255 seconds]
haxrbyte_ has joined #ruby
hmsimha_ has quit [Ping timeout: 265 seconds]
chrislotix has joined #ruby
Alina-malina has joined #ruby
<pard> i have another thing to ask; is this a correct piece of code: class L; include module; def l() 12 end end end
bruno- has joined #ruby
<pard> ?
<pard> i mean, is "modul" an obj actually?
vigintas has quit [Ping timeout: 268 seconds]
<apeiros> it's a local variable or method. since you opened a new lvar scope (class) and didn't assign to module, it can only be a method. so if the L.module exists and returns a Module, the code can work.
<apeiros> otherwise it's a NoMethodError
haxrbyte has quit [Ping timeout: 256 seconds]
<apeiros> or in case of L.module not returning a Module, it's a TypeError
vigintas has joined #ruby
vigintas has quit [Remote host closed the connection]
vigintas has joined #ruby
petersaints has quit [Quit: I'll be back!]
<pard> thanks a lot
<pard> i doubt if so much knowledge has been gaind through mere experience :)
x-light has joined #ruby
platzhirsch has joined #ruby
Skruff has joined #ruby
Skruff has left #ruby [#ruby]
marr has quit [Ping timeout: 250 seconds]
hiyosi has joined #ruby
but3k4 has joined #ruby
trautwein has quit [Ping timeout: 265 seconds]
rgtk has joined #ruby
nemo_ has quit [Remote host closed the connection]
trautwein has joined #ruby
juanpablo__ has joined #ruby
mistermocha has joined #ruby
pard has quit [Quit: Leaving]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
quazimodo has joined #ruby
dionysus69 has joined #ruby
rgtk has quit [Remote host closed the connection]
moty66_ has quit [Read error: Connection reset by peer]
leafybasil has joined #ruby
pathrocle has joined #ruby
juanpablo__ has quit [Ping timeout: 256 seconds]
trautwein has quit [Ping timeout: 255 seconds]
lxsameer has quit [Ping timeout: 244 seconds]
trautwein has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Changing host]
mistermocha has quit [Ping timeout: 246 seconds]
nemo_ has joined #ruby
duckpuppy has joined #ruby
kay_ has joined #ruby
Igorshp has joined #ruby
x-light has quit [Ping timeout: 264 seconds]
rgtk has joined #ruby
trautwei_ has joined #ruby
trautwein has quit [Ping timeout: 240 seconds]
nhhagen has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
SylarRuby has quit [Remote host closed the connection]
gregoriokusowski has joined #ruby
aevitas has joined #ruby
Musashi007 has quit [Quit: Musashi007]
arthurix_ has quit [Read error: Connection reset by peer]
arthurix has joined #ruby
dionysus69 has quit [Quit: dionysus69]
Luming has joined #ruby
arup_r has joined #ruby
trautwein has joined #ruby
K1MOS has joined #ruby
dionysus69 has joined #ruby
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
ibouvousaime has joined #ruby
nemo__ has joined #ruby
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
trautwei_ has quit [Ping timeout: 250 seconds]
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
nemo_ has quit [Ping timeout: 252 seconds]
moeabdol1 has quit [Ping timeout: 246 seconds]
workmad3 has quit [Quit: leaving]
BadRobot has quit [Ping timeout: 246 seconds]
beast has joined #ruby
arup_r has quit [Max SendQ exceeded]
Rickmasta has joined #ruby
arup_r has joined #ruby
arup_r has quit [Max SendQ exceeded]
allomov has joined #ruby
allomov_ has joined #ruby
allomov has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
arup_r has joined #ruby
arup_r has quit [Max SendQ exceeded]
arup_r has joined #ruby
skinux has joined #ruby
chipotle has quit [Quit: cheerio]
<skinux> part
skinux has left #ruby [#ruby]
jeffreylevesque_ has joined #ruby
jeffreylevesque has quit [Ping timeout: 240 seconds]
darkf_ has joined #ruby
RegulationD has quit [Ping timeout: 246 seconds]
arup_r has quit [Client Quit]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
senayar has quit [Read error: Connection reset by peer]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
darkf has quit [Ping timeout: 240 seconds]
fbidu has joined #ruby
nemo_ has joined #ruby
rgtk has quit [Remote host closed the connection]
jeffreylevesque_ has quit [Ping timeout: 246 seconds]
nemo__ has quit [Ping timeout: 255 seconds]
beauby has joined #ruby
jonee has quit [Ping timeout: 240 seconds]
startupality has quit [Quit: startupality]
dionysus69 has quit [Quit: dionysus69]
n has joined #ruby
n is now known as Guest68442
Guest68442 is now known as pard
moeabdol1 has joined #ruby
pard has left #ruby [#ruby]
pard has joined #ruby
<pard> salutes
<pard> is there any site describing the ayout of the outpt Ripper produces?
<pard> *l
charliesome has joined #ruby
<pard> i'm baffled by all "nil" things it emits
sgambino has joined #ruby
kay_ has left #ruby [#ruby]
but3k4 has quit [Read error: Connection reset by peer]
nhhagen has quit [Remote host closed the connection]
y0da has joined #ruby
bMalum has quit [Read error: Connection reset by peer]
nhhagen has joined #ruby
nhhagen has quit [Remote host closed the connection]
nhhagen has joined #ruby
syath has joined #ruby
arup_r has joined #ruby
senayar has quit [Remote host closed the connection]
but3k4 has joined #ruby
favadi has joined #ruby
bMalum has joined #ruby
y0da has quit [Read error: Connection reset by peer]
cornerma1 has joined #ruby
senayar has joined #ruby
catonearth has joined #ruby
kikia has joined #ruby
JDiPierro has joined #ruby
cornerman has quit [Ping timeout: 268 seconds]
cornerma1 is now known as cornerman
<yorickpeterse> pard: don't bother using Ripper, it's terrible
<yorickpeterse> pard: use https://github.com/whitequark/parser instead
<yorickpeterse> it actually works across all implementations, and does so nicely
prestorium has joined #ruby
pepperbreath1 has joined #ruby
pepperbreath1 has left #ruby [#ruby]
tulak has joined #ruby
kikia has quit [Ping timeout: 244 seconds]
ErhardtMundt has joined #ruby
marr has joined #ruby
wlanboy has quit [Ping timeout: 250 seconds]
catonearth has quit [Quit: Leaving]
lostduck has left #ruby [#ruby]
<pard> yorickpeterse, thanks
sdothum has joined #ruby
<pard> yorickpeterse, i can't help wondering still, what all the trailng "nil" in its produced arrays mean :\
DEA7TH has joined #ruby
juanpablo__ has joined #ruby
VeinMelted has joined #ruby
VeinMelted has quit [Remote host closed the connection]
VeinMelted has joined #ruby
pcw888 has joined #ruby
wlanboy has joined #ruby
wlanboy has joined #ruby
d34th4ck3r has quit [Quit: zzz]
<yorickpeterse> Those are just placeholders for nodes that are optional
<pard> thanks
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TvL2386 has joined #ruby
fbidu has quit [Ping timeout: 240 seconds]
Icey has quit [Remote host closed the connection]
<pard> wait -- the creators list says you are its dev!
<pard> i'm honor'd
juanpablo__ has quit [Ping timeout: 240 seconds]
jonee has joined #ruby
<pard> yorickpeterse, may i ask you a few things through private messagng?
<pard> or is it cool to ask it on the channel?
<darix> pard: ask in channel
<pard> thanks
<pard> i reckon making a Parser calls for huge expertise
northfurr has joined #ruby
Azure has quit [Read error: Connection reset by peer]
JDiPierro has quit [Remote host closed the connection]
dionysus69 has joined #ruby
<pard> i want to ask where have you acquird such expertise from
<pard> thanks
spider-mario has quit [Ping timeout: 240 seconds]
Icey has joined #ruby
nemo__ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
<pard> (it is more of a Parser question, which is the reason i thought i should ask it off-channel)
nemo_ has quit [Ping timeout: 256 seconds]
devoldmx has joined #ruby
aevitas has quit [Remote host closed the connection]
darkf_ is now known as darkf
Azure has joined #ruby
zenguy_pc has quit [Ping timeout: 246 seconds]
arup_r has quit [Quit: Leaving]
VeinMelted has quit [Ping timeout: 255 seconds]
techsethi has quit [Quit: techsethi]
Pumukel has joined #ruby
agm has joined #ruby
agm has left #ruby ["Leaving"]
yfeldblum has quit [Ping timeout: 240 seconds]
Quandl has joined #ruby
devoldmx has quit [Ping timeout: 256 seconds]
<chrislotix> I've got a question: Why do i get rb:12 undefined method 'chomp' for nil:NilClass(No method error)? Even when i explicitly printed that object's class it said its "File" What gives? Gist: https://gist.github.com/chrislotix/f90a50c41d0b0030e41f
Quandl is now known as Yiota
krz has joined #ruby
allomov_ has quit [Remote host closed the connection]
AlexRussia has joined #ruby
DEA7TH has quit [Quit: DEA7TH]
<mblagden> chrislotix: what did you identify as a file? "f" or the result of "f.gets" ?
<mblagden> because you call chomp on the result of "f.gets"...
<chrislotix> i just double checked and called it on f
charliesome has quit [Read error: Connection reset by peer]
jinie has quit [Ping timeout: 268 seconds]
<chrislotix> now i checked it on f.gets and it's indeed Nil, how come?
tlarevo has quit [Remote host closed the connection]
pard has quit [Quit: Leaving]
tlarevo has joined #ruby
jinie has joined #ruby
skweek has quit [Ping timeout: 246 seconds]
<chrislotix> My ruby -v is 2.1.5
htmldrum has quit [Ping timeout: 265 seconds]
nemo_ has joined #ruby
charliesome has joined #ruby
<mblagden> check out the possibilities for when gets will return nil: ruby-doc.org/core-2.2.3/IO.html
<gregf_> charliesome: you need to check for eof?
uber has quit [Remote host closed the connection]
<gregf_> that file handle returns null somewhere down the line. like so, current_file = open("foo.txt");while ( !current_file.eof); p current_file.gets.chomp;end
skweek has joined #ruby
hindenbug has joined #ruby
synthroid has joined #ruby
pcw888 has quit [Quit: Leaving.]
hindenbug has quit [Remote host closed the connection]
<gregf_> charliesome: to get your error, try this: current_file = open("foo.txt");while (1 ); p current_file.gets.chomp;en
<gregf_> s/$/d/ ;)
chipotle has joined #ruby
<gregf_> er, well s/charliesome/chrislotix/g; :|
rodfersou has quit [Read error: No route to host]
bruno- has quit [Ping timeout: 265 seconds]
nemo__ has quit [Ping timeout: 240 seconds]
tlarevo has quit [Ping timeout: 246 seconds]
rodfersou has joined #ruby
<chrislotix> gregf_: i figured :) I'm gonna try it now
zenguy_pc has joined #ruby
<gregf_> chrislotix: that was for you. the filehandle returns a null when it reaches eof. dont you feel thats how it needs to be? you surely dont expect the file to grow magically ;)
mary5030 has joined #ruby
<chrislotix> I took it from LRTHW, interesting that it doesn't mention that
K1MOS has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gregf_> chrislotix: how sure are you that the file has 3 lines? it should be just 2. but anyways, you get the idea
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
inteq has quit [Remote host closed the connection]
northfurr has quit [Quit: northfurr]
northfurr has joined #ruby
s00pcan has joined #ruby
<gregf_> chrislotix: https://gist.github.com/anonymous/4ab7572a24e7829120d1 <== thats what i got. so your file is'nt proper :/
bMalum has quit [Read error: Connection reset by peer]
<gregf_> oh wait, you said ruby version matters. i've run it on 1.8 and it works ;)
shredding has quit [Ping timeout: 272 seconds]
ErhardtMundt has quit [Quit: Page closed]
bMalum has joined #ruby
quazimod1 has joined #ruby
mjuszczak has joined #ruby
<chrislotix> you're correct, i screwed up majorly somewhere
ESpiney has joined #ruby
<gregf_> chrislotix: i'm telling you the truth. you;ve messed up the file test.txt
quazimodo has quit [Ping timeout: 250 seconds]
duckpuppy has joined #ruby
northfurr has quit [Quit: northfurr]
<gregf_> oh well, now that i know you;re trolling :|
<chrislotix> huh?
haxrbyte_ has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
<apeiros> misread?
<chrislotix> I found the culprit in my original code, it was ";" after the current_line
tkuchiki has quit [Remote host closed the connection]
<chrislotix> i removed it and it works fine i compared both my code and the site version side by side, i included the wrong one in the gist
aevitas has joined #ruby
Zackio has quit [Remote host closed the connection]
neanias has left #ruby ["Textual IRC Client: www.textualapp.com"]
<chrislotix> thanks for your help but i don't understand where you get the "trolling" part from, i was genuinly confused
edenc has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<gregf_> chrislotix: just trying to pull yer leg ;)
<apeiros> chrislotix: me neither. I think gregf_ just misread.
<apeiros> aha, or that
<apeiros> gregf_: please don't use "troll" to pull a leg. it's something which can easily get out of hand.
<norc> So I have a library that interfaces with some really flakey piece of hardware (random timeouts, sometimes commands get mangled up a bit). I managed to catch all the cases and throw an exception in the correct places.
allomov has joined #ruby
nemo_ has quit [Remote host closed the connection]
<gregf_> apeiros: noted lol
northfurr has joined #ruby
<norc> So whenever I have my program run with this library, random parts always throw exceptions. Is this a good use case to retry key sending these commands 2-3 times on these expected exceptions?
northfurr has quit [Client Quit]
duckpuppy has quit [Ping timeout: 240 seconds]
Zackio has joined #ruby
<norc> As in begin; tries ||= 3; rescue FooError; retry unless (tries -= 1).zero?; end
nhhagen has quit [Read error: Connection reset by peer]
nhhagen_ has joined #ruby
<apeiros> norc: sounds like you don't have much other choice. what you can try is to split up the full task you have to do into as atomic parts as possible. so you have smaller portions of code to retry.
edenc has joined #ruby
mary5030 has quit [Remote host closed the connection]
codecop has joined #ruby
mary5030 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
aevitas has quit [Ping timeout: 240 seconds]
nhhagen_ has quit [Remote host closed the connection]
nhhagen has joined #ruby
sdothum has joined #ruby
mary5030 has quit [Ping timeout: 246 seconds]
nhhagen_ has joined #ruby
<norc> apeiros: I have Connection#execute, which basically takes a command, wraps it inside a protocol and transmits it. So it is a small singular point of entry that I can use here
tk__ has joined #ruby
edenc has quit [Quit: ZNC - 1.6.0 - http://znc.in]
edenc has joined #ruby
nhhagen has quit [Ping timeout: 252 seconds]
edenc has quit [Client Quit]
Guest53 has joined #ruby
atomical has joined #ruby
JDiPierro has joined #ruby
sanjayu has quit [Ping timeout: 268 seconds]
aevitas has joined #ruby
htmldrum has joined #ruby
favadi has joined #ruby
civil_ has joined #ruby
JDiPierro has quit [Remote host closed the connection]
Voker57 has quit [Ping timeout: 246 seconds]
solocshaw has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
DEA7TH has joined #ruby
dionysus69 has joined #ruby
mistermocha has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nhhagen has joined #ruby
sankaber has joined #ruby
nhhagen_ has quit [Ping timeout: 252 seconds]
northfurr has joined #ruby
tagrudev has quit [Remote host closed the connection]
skweek has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
dfinninger has joined #ruby
k3asd` has joined #ruby
InternetFriend has joined #ruby
RegulationD has joined #ruby
terminalrecluse has joined #ruby
Mon_Ouie has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dfinninger has quit [Ping timeout: 250 seconds]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nhhagen has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 265 seconds]
northfurr has quit [Quit: northfurr]
quazimod1 has quit [Ping timeout: 265 seconds]
bruno- has joined #ruby
Pumukel has quit [Ping timeout: 250 seconds]
jordanm has joined #ruby
northfurr has joined #ruby
weihan has joined #ruby
mjuszczak has quit []
bruno- has quit [Ping timeout: 255 seconds]
haxrbyte has quit [Ping timeout: 272 seconds]
mjuszczak has joined #ruby
skweek has quit [Ping timeout: 260 seconds]
pwnd_nsfw has quit [Ping timeout: 240 seconds]
nertzy has joined #ruby
Thomas-0725 has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mag42c has joined #ruby
weihan has quit [Max SendQ exceeded]
slawrence00 has joined #ruby
slawrence00 has quit [Client Quit]
weihan has joined #ruby
JDiPierro has joined #ruby
whippythellama has joined #ruby
Thomas-0725 has quit [Client Quit]
InternetFriend has joined #ruby
allcentury has quit [Ping timeout: 268 seconds]
krz has quit [Read error: Connection reset by peer]
pcw888 has joined #ruby
krz has joined #ruby
chipotle has quit [Quit: cheerio]
`tim` has joined #ruby
kp666 has quit [Read error: Connection reset by peer]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
karapetyan has quit [Remote host closed the connection]
duckpuppy has joined #ruby
_blizzy_ has joined #ruby
karapetyan has joined #ruby
kp666 has joined #ruby
Thomas-0725 has joined #ruby
lavros has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
`tim` is now known as sandals
gizmore has joined #ruby
sankaber has quit [Ping timeout: 260 seconds]
baweaver has joined #ruby
pwnd_nsfw has joined #ruby
malconis has joined #ruby
malconis has quit [Remote host closed the connection]
dfinninger has joined #ruby
mikeharris22 has joined #ruby
malconis has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
mikeharris22 has quit [Remote host closed the connection]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mikeharris22 has joined #ruby
__chris has joined #ruby
karapetyan has quit [Remote host closed the connection]
bruno- has joined #ruby
karapetyan has joined #ruby
voltagex has joined #ruby
rwilcox has joined #ruby
<voltagex> any ideas why bundle install would silently fail in Docker? https://github.com/voltagex/wheelmap/blob/master/Dockerfile
lxsameer has quit [Remote host closed the connection]
kobain has joined #ruby
sankaber has joined #ruby
allcentury has joined #ruby
karapetyan has quit [Ping timeout: 244 seconds]
allomov has quit [Remote host closed the connection]
<i8igmac> are there any cuda gpu enabled ruby modules that are working
rwilcox has quit [Client Quit]
Coraline has joined #ruby
SShrike has quit [Ping timeout: 240 seconds]
Guest27470 has joined #ruby
mary5030 has joined #ruby
juanpablo__ has joined #ruby
hrs has joined #ruby
cdg has joined #ruby
<darix> i8igmac: what do you actually want to do
mary5030 has quit [Remote host closed the connection]
Igorshp has quit [Ping timeout: 246 seconds]
<i8igmac> its just a idea.
<i8igmac> of course
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
<i8igmac> using your gpu as a cpu to process a ruby script... amplified speeds
<yorickpeterse> Except you can't just run arbitrary code on a GPU
<yorickpeterse> It's not like it's a regular x86 processor
<i8igmac> i may not know what im talking about, but there are tools out there that use the gpu to process large ammounts of hash's
<i8igmac> a google search shows that people are trying to utilize cuda libs with ruby
Igorshp has joined #ruby
Guest27470 has quit [Quit: Leaving]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jobewan has joined #ruby
juanpablo__ has quit [Ping timeout: 265 seconds]
charliesome has joined #ruby
<i8igmac> benchmark cpu... precomputed hash's (1200 per second)
<i8igmac> benchmark GPU... precomputed hash's (15000 per second)
charliesome has quit [Client Quit]
<yorickpeterse> ....yeah you have no idea what you're talking about, no offence
<i8igmac> true,
<yorickpeterse> The operations typically performed on a GPU are very much tailored towards what a GPU can do
<yorickpeterse> You can't just pick Google Chrome and run it on a GPU as is
<i8igmac> true
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
k3asd` has quit [Ping timeout: 272 seconds]
cwong_on_irc has joined #ruby
<i8igmac> yorickpeterse: https://code.google.com/p/pyrit/
DiCablo has joined #ruby
<i8igmac> should take a quick look, i have tested this tool for a long time now.
ruurd has joined #ruby
<yorickpeterse> and?
<i8igmac> again its just for the idea.
<yorickpeterse> what part of "...very much tailored towards what a GPU can do" wasn't clear?
<yorickpeterse> I know what GPUs can/are used for
seitensei has joined #ruby
seitensei has quit [Changing host]
seitensei has joined #ruby
<catphish> what would be the neatest way to add a new newline to each string in an array, then join them together? ie ["a", "b"] => "a\nb\n"
dmitch has joined #ruby
<canton7> catphish, .map{...}.join('')
<yorickpeterse> catphish: ["a", "b"].join("\n")
<yorickpeterse> or ["a", "b"].join("\n") + "\n"
<catphish> yorickpeterse: that's lovely, but doesn't give the right value
<canton7> catphish, why don't you explain what's different about it?
tkuchiki has joined #ruby
Meow-J has quit [Quit: Connection closed for inactivity]
<yorickpeterse> >> %w{a b}.join("\n") + "\n"
<ruboto> yorickpeterse # => "a\nb\n" (https://eval.in/460198)
jobewan has quit [Ping timeout: 255 seconds]
<i8igmac> "this Ruby bindings have provided first bridging step towards Ruby GPU computing."
<catphish> so it comes down to .map{}.join or inject(""){}
arup_r has quit [Read error: Connection reset by peer]
naftilos76 has quit [Ping timeout: 252 seconds]
<canton7> ... or the thing that yorickpeterse just demonstrated
<darix> i8igmac: what kind of computing you want to do?
northfurr has quit [Quit: northfurr]
f3arl3ss has joined #ruby
<i8igmac> i guess, generate hash's
<i8igmac> quicker
<catphish> canton7: it sure is elegant, but it doesn't deal with the trailing newline properly, specifically an empty array would result in a non-empty string
<canton7> have you tried simply using a faster language than ruby?
<i8igmac> that would make sense lol
<canton7> catphish, right, that's the sort of explanation other people need
northfurr has joined #ruby
<canton7> catphish, map.join then
tkuchiki has quit [Remote host closed the connection]
<canton7> i8igmac, you'll likely get a few hundred to a few thousand times speedup by going to something which compiles or jits (from experience with this sort of thing)
<canton7> i8igmac, or write a ruby extension in C if you need ruby interop still
djbkd has joined #ruby
jessemcgilallen has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
hrs has quit [Quit: Textual IRC Client: www.textualapp.com]
InternetFriend has joined #ruby
dhollinger has joined #ruby
haxrbyte has joined #ruby
cwong_on_irc has quit [Quit: Leaving.]
umgrosscol has joined #ruby
aevitas has quit [Remote host closed the connection]
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aevitas has joined #ruby
tkuchiki has joined #ruby
senayar has quit [Remote host closed the connection]
RegulationD has joined #ruby
dopieee has quit [Ping timeout: 240 seconds]
<shevy> all bow to C, the master
senayar has joined #ruby
al2o3-cr has quit [Ping timeout: 252 seconds]
<darix> shevy: you mean assembler
pcw888 has quit [Quit: Leaving.]
uber has joined #ruby
pcw888 has joined #ruby
pcw888 has left #ruby [#ruby]
arup_r has joined #ruby
devoldmx has joined #ruby
allomov has joined #ruby
jobewan has joined #ruby
zenguy_pc has quit [Ping timeout: 255 seconds]
Thomas-0725 has quit [Quit: Textual IRC Client: www.textualapp.com]
<shevy> C won the battle
<norc> darix: There really is not a difference.
hs366 has joined #ruby
<shevy> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html and java won the battle against C!
aevitas has quit [Ping timeout: 246 seconds]
<norc> shevy.
<norc> I have done it again.
<norc> Actual ruby code if you can believe it.
arthurix has quit [Read error: Connection reset by peer]
elusiveother has joined #ruby
arthurix has joined #ruby
djstorm has joined #ruby
<shevy> I am too sceptical
<shevy> you are one of the anonymous webchatsters
zeroDivisible has joined #ruby
<norc> You mean because I only use pastie and not my github gists with a picture and linked instagram with facebook?
devoldmx has quit [Ping timeout: 268 seconds]
yes`r has quit [Ping timeout: 252 seconds]
<shevy> because you have no face and name :)
tkuchiki has quit [Remote host closed the connection]
<norc> But I do.
DiCablo has quit [Ping timeout: 268 seconds]
<shevy> yeah, somewhere outside IRC!
<norc> shevy: If my face was inside IRC my name would be Skynet. Would you prefer that?
Igorshp has quit [Remote host closed the connection]
<shevy> oh if it were up to me, I'd revert to good old IRC of the 1990s era
allcentury has quit [Read error: Connection reset by peer]
wprice has joined #ruby
Puck7744 is now known as Puck6633
DiCablo has joined #ruby
tkuchiki has joined #ruby
allcentury has joined #ruby
odigity has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
Ox0dea has joined #ruby
diegoaguilar has joined #ruby
dANO- has quit []
jessemcgilallen has quit [Quit: jessemcgilallen]
zenguy_pc has joined #ruby
northfurr has quit [Quit: northfurr]
Motoservo has joined #ruby
inteq has joined #ruby
leat has quit [Remote host closed the connection]
leat1 has joined #ruby
dopamean_ has quit [Ping timeout: 268 seconds]
rbennace_ has joined #ruby
f3arl3ss has quit [Read error: No route to host]
<catphish> is is possible to make extra initializers in ruby? ie class methods that can create an instance and have access to instance variables?
<Ox0dea> norc: No difference between C and Assembly, you say?
juanpablo__ has joined #ruby
axl_ has joined #ruby
davedev24 has joined #ruby
<Ox0dea> catphish: `initialize': already initialized class (TypeError)
gizmore has quit [Ping timeout: 250 seconds]
<Ox0dea> You won't be able to simply delegate to #initialize, if that's what you hoped to do.
<apeiros> catphish: the common way is to have a normalized initialize and multiple class methods which normalize input to what initialize expects
tvw has quit [Ping timeout: 256 seconds]
momomomomo has joined #ruby
<catphish> apeiros: thanks, someone here suggested a normalized initialize that optionally accepts a block and executes it
bruno- has joined #ruby
dionysus69 has joined #ruby
Igorshp has joined #ruby
<norc> Ox0dea: Well the differences are small at least.
<apeiros> and no, you can't have multiple initializers. but initialize isn't really anything special. Class#new is essentially `def new(*args, &block); obj = allocate; obj.send(:initialize, *args, &block); obj; end`
<norc> But that is just a personal opinion, and nothing I want to argue about.
<Ox0dea> norc: I'm not sure I follow.
nemo_ has joined #ruby
tvw has joined #ruby
davedev2_ has joined #ruby
davedev24 has quit [Read error: Connection reset by peer]
<Ox0dea> This is going to be great: https://www.twitchinstalls.com/
<catphish> apeiros: that makes a lot of sense, perhaps the alternative is to make pairs of methods, ie a repacement for both new, and initialize together
dionysus69 has quit [Remote host closed the connection]
<apeiros> catphish: I dislike that option.
<apeiros> I far prefer normalized initialize.
<catphish> so a custom "self.new_from_string" which calls #new then
<apeiros> right
<catphish> #initialize_from_string
<apeiros> though I usually omit the "new_" part.
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby
<apeiros> def self.from_string(str); …convert str…; new(…); end
dionysus69 has joined #ruby
TvL2386 has quit [Remote host closed the connection]
<catphish> but you think a unified initialize is neater?
northfurr has joined #ruby
<apeiros> as said, yes
<Ox0dea> It's scarcely an opinion.
sankaber has quit [Remote host closed the connection]
mikeharr_ has joined #ruby
<catphish> you're right, "convert(str)" was the step i was missing, i could make a hash which initialize can then use to populate the object
dorei has joined #ruby
sankaber has joined #ruby
<catphish> so initialize (and hence new) always accept a hash, which things like from_string can make for it
p0wn3d__ has joined #ruby
<catphish> thanks for helping me think :)
dmitch has joined #ruby
<shevy> we train thinking here
zotherstupidguy has quit [Quit: WeeChat 1.3]
<apeiros> Ox0dea: what's it if not an opinion? :)
<Ox0dea> apeiros: Objectively sane.
bruno- has quit [Ping timeout: 260 seconds]
mikeharris22 has quit [Ping timeout: 240 seconds]
nertzy has quit [Quit: This computer has gone to sleep]
akem has joined #ruby
arup_r has quit [Ping timeout: 255 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
jas02_ has joined #ruby
<shevy> that's just your opinion!!!
zotherstupidguy has joined #ruby
<shevy> Object.sane
gregf_ has quit [Read error: No route to host]
<norc> Ox0dea: Large parts of C can be mapped into machine code directly (OTCC demonstrates this, albeit with only a limited subset of C)
jas02 has quit [Ping timeout: 256 seconds]
jas02_ is now known as jas02
davedev24 has joined #ruby
<ddv> opinions are like....
gizmore has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Motoservo has quit [Quit: Shhh. I'm trying to get some sleep here.]
haxrbyte_ has joined #ruby
<Ox0dea> norc: mov is Turing-complete; what's your point?
kp666 has quit [Quit: Leaving]
<norc> As I said, I didn't want to argue.
everbot has quit [Ping timeout: 240 seconds]
<Ox0dea> We'll still be friends when the dust settles.
davedev2_ has quit [Ping timeout: 246 seconds]
beast has quit [Quit: Leaving]
<pipework> Ox0dea: Hey, what was that neat thing that was like &proc?
<Ox0dea> norc: Explicitly manipulating a stack with `goto` really is an entirely different experience to having your locals appear on the stack as you enter and leave functions.
dopamean_ has joined #ruby
stevednd has quit [Remote host closed the connection]
newdan has joined #ruby
<Ox0dea> pipework: Hm? `&proc` is already a thing, but I don't know that it has any kin.
<pipework> Ox0dea: I must be doing something unexpected.
<pipework> I guess calling &proc twice in a method body doesn't do what I expect.
haxrbyte has quit [Ping timeout: 268 seconds]
<Ox0dea> pipework: Seems fine? https://eval.in/460225
kimegede has quit [Quit: Linkinus - http://linkinus.com]
<norc> Ox0dea: setjmp ?
arthurix has quit [Read error: Connection reset by peer]
arthurix has joined #ruby
<Ox0dea> norc: We reap what we sow.
<norc> :)
gregf_ has joined #ruby
<shevy> crops!
SylarRuby has joined #ruby
<Ox0dea> &crop
arup_r has joined #ruby
eminencehc has joined #ruby
sphex_ has quit [Ping timeout: 240 seconds]
Meow-J has joined #ruby
n008f4g_ has joined #ruby
DiCablo has quit [Quit: Textual IRC Client: www.textualapp.com]
sphex has joined #ruby
favadi has joined #ruby
trautwein has quit [Ping timeout: 240 seconds]
favadi has quit [Client Quit]
<yorickpeterse> Any OS X users here? If so, does the following spit out your user/group IDs?: socket = UNIXServer.new('/tmp/test.sock'); socket.getsockopt(Socket::SOL_SOCKET, Socket::SO_PEERCRED).unpack('iii')[1..-1]
elusiveother has quit [Quit: Leaving]
trautwein has joined #ruby
bMalum_ has joined #ruby
<gizmore> get 'foo' => "bar" # what is this? a lambda?
<ddv> yorickpeterse: NameError: uninitialized constant UNIXServer
<yorickpeterse> errr
<yorickpeterse> add require 'socket'
<yorickpeterse> derp
bMalum has quit [Ping timeout: 240 seconds]
bMalum_ is now known as bMalum
<ddv> yorickpeterse: NameError: uninitialized constant Socket::SO_PEERCRED
<yorickpeterse> Ah, so that's not defined on OS X
<yorickpeterse> Sweet, thanks
<ddv> :)
l_tonz has joined #ruby
mistermocha has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Z00t has joined #ruby
<Ox0dea> gizmore: That's invoking the #get method with the Hash {'foo' => "bar"} as an argument.
mordocai has joined #ruby
l_tonz has quit [Remote host closed the connection]
<Ox0dea> You can stick an "implicit" Hash (one without curly brackets) at the end of a method invocation.
<gizmore> Ox0dea: aaahhh... thx
<Ox0dea> gizmore: Sure thing.
Z00t has quit [Remote host closed the connection]
<gizmore> how dare they to not use symbols as key!!!
bMalum has quit [Ping timeout: 255 seconds]
dnomyar has joined #ruby
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Client Quit]
aevitas has joined #ruby
nemo__ has joined #ruby
kerunaru has quit [Quit: Textual IRC Client: www.textualapp.com]
zotherstupidguy has quit [Quit: WeeChat 1.3]
slawrence00 has joined #ruby
bMalum has joined #ruby
Pumukel has joined #ruby
Pumukel has quit [Client Quit]
<norc> Resolv.getname() consistently takes slightly over 5s to obtain a hostname for a given address for me on a particular machine.
Guest53 has joined #ruby
<norc> Any hints at where I should be looking at? Its not the nameserver, as dig takes less than 50ms to query the NS.
musou has joined #ruby
<dorei> norc: maybe strace could give you more info
jonee has quit [Read error: No route to host]
nemo_ has quit [Ping timeout: 256 seconds]
dopie has joined #ruby
rodfersou has quit [Quit: leaving]
<norc> dorei: Gah, looks like dtruss does not print out in real time.
rbennace_ has quit [Remote host closed the connection]
* norc hates OSX again.
urbanmonk has joined #ruby
rbennacer has joined #ruby
aevitas has quit [Ping timeout: 268 seconds]
mag42c has quit [Ping timeout: 264 seconds]
<capin> norc: i know the feeling
davedev2_ has joined #ruby
<norc> Oh well. Figured out how to work it, and the bug disappeared.
<norc> Love this.
allcentury has quit [Quit: WeeChat 1.2]
mag42c has joined #ruby
momomomomo has quit [Quit: momomomomo]
* capin wishes OSX would allow hypervisor access to the kernel in OS X because qemu still doesn't support KVM :'(
tulak has quit [Ping timeout: 272 seconds]
lkba has joined #ruby
eminencehc has quit [Remote host closed the connection]
hxegon has joined #ruby
davedev24 has quit [Ping timeout: 246 seconds]
Erik_Underline has joined #ruby
eminencehc has joined #ruby
<Erik_Underline> Hello people!
jokke has quit [Ping timeout: 240 seconds]
<norc> dorei: Weird. Looks like its actually in the network
Rinzlit_ has joined #ruby
Mia has joined #ruby
<catphish> capin: i still don't really understand what KVM is :(
elusiveother has joined #ruby
aganov has quit [Remote host closed the connection]
<catphish> is it just a unified API to intel and AMD's virtualization layers?
sphex_ has joined #ruby
eikood has quit [Ping timeout: 244 seconds]
shredding has joined #ruby
chipotle has joined #ruby
Rinzlit has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
momomomomo has joined #ruby
mikeharr_ has quit [Remote host closed the connection]
skullcrasher has quit [Ping timeout: 272 seconds]
sphex has quit [Ping timeout: 268 seconds]
<hxegon> hey Erik_Underline, hows it goin
bMalum_ has joined #ruby
mikeharris22 has joined #ruby
bMalum has quit [Ping timeout: 244 seconds]
bMalum_ is now known as bMalum
k3asd` has joined #ruby
allomov has quit [Remote host closed the connection]
eikood has joined #ruby
roxtrongo has quit [Write error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
bruno- has joined #ruby
karapetyan has joined #ruby
roxtrongo has joined #ruby
CVTJNII has quit [Ping timeout: 250 seconds]
skullcrasher has joined #ruby
CVTJNII has joined #ruby
<Erik_Underline> hxegon: it's going good :D
jokke has joined #ruby
<Erik_Underline> hxegon: learning ternary atm
naftilos76 has joined #ruby
Igorshp has quit [Remote host closed the connection]
tulak has joined #ruby
allomov has joined #ruby
<hxegon> >> true ? 'teraries are the best!' : 'what are ternaries?' # Erik_Underline
<ruboto> hxegon # => "teraries are the best!" (https://eval.in/460258)
eikood has quit [Ping timeout: 264 seconds]
fedexo has joined #ruby
<slash_nick> terrarium?
Xzanron has quit [Read error: Connection reset by peer]
<Erik_Underline> ternary conditional expression, the syntax is like this: boolean ? Do this if true: Do this if false
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rcvalle has joined #ruby
<hxegon> damn my fingers
<hxegon> not used to this keyboard yet
i8igmac has quit [Ping timeout: 244 seconds]
arup_r has quit [Ping timeout: 268 seconds]
<slash_nick> hxegon: i just like playing with words... no big deal :)
<hxegon> slash_nick: FORGIVE ME SENPAI
northfurr has quit [Quit: northfurr]
<slash_nick> hxegon: no problem kouhei
deception1 has quit [Quit: Leaving.]
bluOxigen has quit [Ping timeout: 240 seconds]
jas02 has quit [Ping timeout: 256 seconds]
i8igmac has joined #ruby
<Ox0dea> >> ternary expressions are fine but ruboto is going to tell us if @we_should_nest_them
<ruboto> Ox0dea # => nil (https://eval.in/460262)
eikood has joined #ruby
northfurr has joined #ruby
<gregf_> uh
<gregf_> >> foo bar
<ruboto> gregf_ # => undefined local variable or method `bar' for main:Object (NameError) ...check link for more (https://eval.in/460263)
<Ox0dea> Pleb.
<gregf_> ah man
shinnya has quit [Ping timeout: 256 seconds]
<gregf_> ignore me
<gregf_> >> foo bar if @yay
<ruboto> gregf_ # => nil (https://eval.in/460264)
<hxegon> I seriously don't understand how people live without blocks. Is this a phase?
mjuszczak has quit []
<Ox0dea> hxegon: Welcome to the end of your search for your favorite language.
<pipework> I don't always use blocks in my interfaces because it's sometimes hard for other people to get what's going on.
<pipework> casuals. meh
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tkuchiki has quit [Remote host closed the connection]
tw1sted has quit [Remote host closed the connection]
cwong_on_irc has joined #ruby
dellavg_ has joined #ruby
Gi0 has joined #ruby
codecop has quit [Remote host closed the connection]
norc has quit [Ping timeout: 246 seconds]
kohgpat has joined #ruby
Guest53 has joined #ruby
stamina has joined #ruby
weihan has quit [Ping timeout: 244 seconds]
tulak has quit [Remote host closed the connection]
tw1sted has joined #ruby
hxegon_ has joined #ruby
terminalrecluse has joined #ruby
<capin> catphish: see my earlier post ;) it allows hypervisor access to the kernel so a VM runs at near native speed :D
rikkipitt has joined #ruby
tk__ has quit [Quit: ばいばい]
northfurr has quit [Quit: northfurr]
<Erik_Underline> What's the most awesome thing you've ever done in Ruby?
colegatron has joined #ruby
Igorshp has joined #ruby
<colegatron> hello, a newbie question; in the sentence "config.vm.define :whatever do |server|" what is :whatever? a method? a function?
hxegon has quit [Ping timeout: 255 seconds]
<Erik_Underline> :whatever is a symbol
<capin> what he said ^
terminalrecluse has quit [Client Quit]
<Erik_Underline> Everything after : is a "symbol" in ruby
<colegatron> aha
<capin> Erik_Underline: is it fair to say a "symbol is a data structure?
<catphish> capin: it's not really clear to me what it actually does though, seems to provide access to certain memory locations, and presumably also a way to access calls to change ring
arup_r has joined #ruby
<catphish> just realised this is #ruby :) im a little offtopic :)
valkyrka has joined #ruby
<Erik_Underline> capin: I don't really know what that would imply
mary5030 has quit [Ping timeout: 250 seconds]
<colegatron> but I understand ":whatever" is an object as well, isn't?
krz has quit [Quit: WeeChat 1.2]
eminencehc has quit [Remote host closed the connection]
<hxegon_> colegatron: in that case I think its used like an option to config.vm.define
<hxegon_> colegatron: but yes, a symbol is an object
<Erik_Underline> capin: data structures are hashes and arrays, so no, it wouldn't be.
<colegatron> hxegon_, oh. it makes sense
<colegatron> hxegon_, I need, inside the 'define' block, to get in a variable, the string representation of the "whatever" option/symbol
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
<slash_nick> DeBot: g
eminencehc has joined #ruby
<hxegon_> colegatron: you will also see these used as hash keys because they are more memory efficient to use than strings, + other reasons someone should enumerate
<capin> catphish: i think the take away is you can't use KVM in OS X (which really hurts the speed of the VM) almost to the point that it's not worth using
mjuszczak has joined #ruby
urbanmonk has quit [Quit: urbanmonk]
<hxegon_> capin: are you trying to use vagrant?
<colegatron> hxegon_, in this particular case is the name of the vagrant vm, but I need that name "whatever" into a variable
<Ox0dea> slash_nick: Well done.
<hxegon_> capin: got confused sorry
<catphish> capin: doesn't OS X have its own virtualization API? virtualbox support os x afaik, i assume it doesn't rely on soft emulation
<hxegon_> colegatron: whats the :whatever in this case? have a bit of experience with vagrant
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<catphish> not being able to use qemu could be annoying though
<colegatron> whatever is the name of the vm you are defining in the config.vm.define block.
lavros has quit [Quit: leaving]
Motoservo has joined #ruby
<colegatron> I need to take the name (whatever) to avoid repeat the text "whatever" all over the place inside the definition.
<catphish> i'll have to write my own hypervisor one day :)
<colegatron> I mean : tmpName = letSayGetOption(0).from.define
Lucky__ has joined #ruby
<capin> catphish: apple said they were going to expose the hypervisor in a recent version of OS X (don't remember off the top of my head) but i think the qemu devs still haven't written in support for KVM yet, and I'm not a fan of using vbox FWIW
<hxegon_> colegatron: you could define the name outside the scope of the block and use it that way, but there is probably a better solution
<catphish> capin: it won't be kvm, since kvm is specifically a linux module
<hxegon_> capin: why not, out of curiosity? (I use vbox w/ vagrant on OS X)
<catphish> capin: but i'd hope qemu would support apple's API at some point
<colegatron> hxegon_, I define lots of VM's in the same vagrantfile. and I do not want to work out of the scope if it is possible
<capin> catphish: ME TOO!
<catphish> i use vbox for desktop VMs, always seems convenient
<hxegon_> colegatron: ahh, I see. I only use one at a time.
<catphish> i use kvm/qemu on the server side
<Ox0dea> colegatron: You want access to :whatever from within the #define block?
<colegatron> to the _string_representation_ not the object
<colegatron> I need it to use in the scripts I use for provisioning and other deploys that are fired once the vm is up
<Ox0dea> >> [:foo.to_s, "#{:foo}"] # colegatron
<ruboto> Ox0dea # => ["foo", "foo"] (https://eval.in/460271)
maletor has joined #ruby
<colegatron> Ox0dea, what?
bricker has joined #ruby
<colegatron> sorry, my ruby knowledge is nil.
<Ox0dea> colegatron: Are you not creating these VMs dynamically in some sort of loop?
stamina has quit [Ping timeout: 268 seconds]
<colegatron> Ox0dea, not at this moment, so no.
eminencehc has quit [Remote host closed the connection]
<colegatron> Ox0dea, next iteration/feature will be inside a loop
<Ox0dea> colegatron: Then something like `config.vm.define(foo = :whatever) { ... }` will suffice.
<Ox0dea> You'll have access to `foo` within the block.
<capin> catphish: maybe we should go bug the qemu devs over at their irc server :P ..."hey man when yall going to get hypervisor support for OSX" :P
<colegatron> Ox0dea, OOOhhh nice
<colegatron> I'm going to play
<Ox0dea> Yay! <3
eminencehc has joined #ruby
_blizzy_ has quit [Quit: Leaving]
f3arl3ss has joined #ruby
f3arl3ss has quit [Read error: Connection reset by peer]
<colegatron> Ox0dea, Aside the global variable this construction is correct, right? config.vm.define( $cI = :worker_swfdev, autostart: false ) do |server|
<Ox0dea> colegatron: It is.
mikeharris22 has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
devoldmx has joined #ruby
marr has quit [Ping timeout: 240 seconds]
Motoservo has quit [Read error: Connection reset by peer]
towski_ has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
mikeharris22 has joined #ruby
cirenyc has joined #ruby
purplexed- has joined #ruby
purplexed- has joined #ruby
hmsimha_ has joined #ruby
Motoservo has joined #ruby
<colegatron> Ox0dea, great, it works. I've replaced the global var for a local one and it's almost ready to be converted in a loop to deploy servers :)
devoldmx has quit [Ping timeout: 244 seconds]
<Ox0dea> colegatron: Huzzah!
umgrosscol has quit [Remote host closed the connection]
ruurd has quit [Quit: ZZZzzz…]
zenguy_pc has quit [Ping timeout: 268 seconds]
amclain has joined #ruby
freerobby has quit [Quit: Leaving.]
mrtomme has quit [Ping timeout: 260 seconds]
mikeharris22 has quit [Ping timeout: 246 seconds]
startupality has joined #ruby
ruurd has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
senayar has quit []
mrtomme has joined #ruby
TomyWork has quit [Ping timeout: 260 seconds]
catphish has left #ruby ["Leaving"]
mary5030 has joined #ruby
lsmola has quit [Ping timeout: 244 seconds]
mjuszczak has quit []
roxtrongo has quit [Remote host closed the connection]
<colegatron> Ox0dea, as far as I understand the vm.server block on the following code (https://paste.debian.net/318887) should work even if for each vm I defined in the vagrant file
RegulationD has quit [Remote host closed the connection]
<colegatron> I mean if I change what the vm.server block does for each vm
Motoservo has quit [Read error: Connection reset by peer]
cirenyc has quit [Quit: Linkinus - http://linkinus.com]
chipotle has quit [Quit: cheerio]
aufi has quit [Quit: Konversation terminated!]
<Ox0dea> colegatron: When you run that in a loop such that cIname gets a different value each time, you mean?
willardg has joined #ruby
startupality has quit [Quit: startupality]
bMalum_ has joined #ruby
zenguy_pc has joined #ruby
bMalum has quit [Ping timeout: 256 seconds]
chipotle has joined #ruby
bMalum_ is now known as bMalum
hxegon_ is now known as hxegon
roxtrongo has joined #ruby
<Ox0dea> hxegon: It's going to be a shitstorm until everybody goes to bed, and it'll be done five minutes later.
<colegatron> Ox0dea, yes, and if finally I put all inside a loop, the server.vm.provision would change aswell doing different things depending on a cI attribute
<Ox0dea> As an aside, I had "hxegon_" in my message line and it lost its highlighting when you changed nicks; I didn't know that would happen.
dfockler has joined #ruby
startupality has joined #ruby
htmldrum has quit [Ping timeout: 244 seconds]
devoldmx has joined #ruby
dopamean_ has quit [Ping timeout: 256 seconds]
<colegatron> but I understand, being the server.vm.provision inside the same .define block, will not have side effect or strange behaviors because ruby
Motoservo has joined #ruby
willardg has left #ruby ["Textual IRC Client: www.textualapp.com"]
<colegatron> but I do not know about ruby scopes and so
<Ox0dea> colegatron: Your `server` variable is local to the #define block.
<colegatron> aha. tnx! :)
<colegatron> now I continue messing with salt. thank you very much for your help
colegatron has quit [Quit: Leaving]
mikeharris22 has joined #ruby
<hxegon> >> [[1], [2]].map(&:map) { |i| foo } # Is there a way to do this?
<ruboto> hxegon # => /tmp/execpad-2bfbd9ef5ebf/source-2bfbd9ef5ebf:2: both block arg and actual block given (https://eval.in/460293)
Jardayn has joined #ruby
colegatron has joined #ruby
skweek has joined #ruby
momomomomo has quit [Quit: momomomomo]
bMalum has quit [Quit: bMalum]
<hxegon> .map.map doesn't seem too work...
crowell has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
bMalum has joined #ruby
<hxegon> nvm
<Ox0dea> hxegon: You can't provide arguments to #to-proc'd Symbols. :<
uri_ has joined #ruby
crowell has joined #ruby
crowell has quit [Changing host]
crowell has joined #ruby
<Ox0dea> >> ['10001', '101010'].map { |s| s.to_i(2) }
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruboto> Ox0dea # => [17, 42] (https://eval.in/460297)
dikaio has joined #ruby
<Ox0dea> It'd be nice if we could say `%w[10001 101010].map(&:to_i(2))`, I agree.
nertzy has joined #ruby
<hxegon> Ox0dea: yeah. nested do/end blocks it is :\
mikeharris22 has quit [Ping timeout: 260 seconds]
dellavg_ has quit [Ping timeout: 260 seconds]
<Ox0dea> Probably don't actually use that, though.
pwnd_nsfw has quit [Ping timeout: 240 seconds]
<hxegon> Ox0dea: yeah, thats..... hmm
<Ox0dea> It's neat, but best to leave it at that.
<Erik_Underline> In a method for JS(function is the proper term), Python etc, if you don't specify what to return, it'll return undefined etc but Ruby methods will return the result of the last evaluated expression, why is that?
trautwein has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandals has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Erik_Underline> I get why ruby does it, but why not the other languages?
<Ox0dea> Erik_Underline: It's just another way in which they're inferior.
<Ox0dea> Even LOLCODE returns the last evaluated expression.
mh_laakso has joined #ruby
roxtrongo has quit [Remote host closed the connection]
<Ox0dea> Erik_Underline: In all seriousness, it's because Ruby was designed for programmer happiness; precious few other languages bother to take that into account.
gizmore has quit [Read error: Connection reset by peer]
nemo__ has quit [Ping timeout: 252 seconds]
<hxegon> Erik_Underline: having to put in return statements everywhere is a given in any non-imperitave program
<Erik_Underline> Is there any advantage to it?
shinnya has joined #ruby
<Ox0dea> hxegon: Huh? All of the languages recently mentioned are imperative.
nemo_ has joined #ruby
nemo_ has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
nemo_ has joined #ruby
<hxegon> Ox0dea: sorry, trying to express a not completely formed idea, give me a minute. Erik_Underline disregard what I just said
<Ox0dea> Erik_Underline: You have to use an explicit `return` if you want to return early (before the end of the method), and some argue that consistency must always be striven for.
Motoservo has quit [Read error: Connection reset by peer]
<Ox0dea> But Ruby methods are often "properties", and `return` looks awkward in that context.
mallu has joined #ruby
gizmore has joined #ruby
<Erik_Underline> What do you mean with that ruby methods are 'properties'?
bMalum has quit [Quit: bMalum]
mjuszczak has joined #ruby
leafybas_ has joined #ruby
snockerton has joined #ruby
<slash_nick> Erik_Underline: class Sloth; def herbivore; return true; end; end
<mallu> I see mthod 'grep'. Is there anything similar to "grep -v". Ie; exclude the pattern?
jpfuentes2 has joined #ruby
<Erik_Underline> Btw, what if there's no return written in a method, but you don't want the value of the last evaluated expression anyhow, what do you do then?
<Ox0dea> Erik_Underline: You make `nil` the last evaluated expression.
Motoservo has joined #ruby
ghoti has quit [Ping timeout: 268 seconds]
<Ox0dea> mallu: Yes, #grep_v was added in 2.3.
skweek has quit [Ping timeout: 256 seconds]
EvilCorp_IT_Tech has joined #ruby
dellavg_ has joined #ruby
uri_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<mallu> Ox0dea: Any other way to do it? I am not using 2.3 yet
unreal_ has quit [Ping timeout: 240 seconds]
leafybasil has quit [Ping timeout: 256 seconds]
<Ox0dea> mallu: Until this Christmas, you'll have to say something like `foo.reject { |obj| pattern === obj }`.
<Ox0dea> #grep uses the case equality operator (#===).
leafybas_ has quit [Ping timeout: 252 seconds]
pwnd_nsfw has joined #ruby
<Ox0dea> mallu: I suspect you're only using it in its capacity as a regular expression matcher?
rbennacer has quit [Remote host closed the connection]
<mallu> yes
NeverDie has quit [Quit: http://radiux.io/ -> Manhattan Project]
<Ox0dea> mallu: #select and Regexp#!~, then.
<mallu> ok... thanks
<Ox0dea> >> %w[foo bar baz].select { |s| /a/ !~ s }
<ruboto> Ox0dea # => ["foo"] (https://eval.in/460301)
<Ox0dea> Sure thing.
<newdan> Erik_Underline: explicit returns have advantages, namely that you can never 'accidentally' return something from a function that you didn't intend to. In Ruby you can write a method that's meant for side effects but that accidentally returns something and if the stars align someone else in your org will start relying on it and that will be awkward and bad. But in general I like implicit returns
shinobi_ has joined #ruby
SylarRuby has quit [Remote host closed the connection]
hmsimha_ has quit [Ping timeout: 265 seconds]
unreal has joined #ruby
fibbel has joined #ruby
synthroid has quit [Remote host closed the connection]
tulak has joined #ruby
<mallu> Ox0dea: how do you do multiple pattern?
<Ox0dea> mallu: Regexp.union should suffice.
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<Ox0dea> Or just chain your invocations of #!~ with ||.
<mallu> ok
rbennacer has joined #ruby
pocketprotector- has joined #ruby
Lingo_ has joined #ruby
Lingo_ has quit [Remote host closed the connection]
Lingo_ has joined #ruby
FernandoBasso has joined #ruby
Lingo_ has quit [Remote host closed the connection]
Lingo_ has joined #ruby
Lingo_ has quit [Remote host closed the connection]
shinobi_ has quit [Quit: Leaving...]
Motoservo has quit [Read error: Connection reset by peer]
<Ox0dea> hxegon: Did you end up using Uberscore, then? :P
<hxegon> suprised ruboto doesn't scrape youtube video titles
<Ox0dea> Some fellow a while back took quite a liking to it and made it his own: https://github.com/shockone/uberscore
<hxegon> Ox0dea: no, decided to just nest do blocks and not be clever
<Ox0dea> Yeah, fair enough.
jilya has quit [Quit: Leaving]
eminencehc has joined #ruby
zeroDivisible has quit [Ping timeout: 260 seconds]
sgambino has joined #ruby
shinenelson has quit [Quit: Connection closed for inactivity]
mikeharris22 has joined #ruby
_djbkd has joined #ruby
Meow-J has quit [Quit: Connection closed for inactivity]
rbennace_ has joined #ruby
Motoservo has joined #ruby
darkf has quit [Quit: Leaving]
<hxegon> Following my distaste for variable assignment, is there a simple way to do this?
rbennacer has quit [Ping timeout: 255 seconds]
<hxegon> JSON.generate foo.map do |bar| ...
seitensei has quit [Remote host closed the connection]
<Ox0dea> hxegon: Well, if you're mapping with an explicit block, you simply must give a name to the block local.
<Ox0dea> It sounds like you want Uberscore. :P
Igorshp has quit [Remote host closed the connection]
anisha has joined #ruby
<hxegon> Ox0dea: It sounds like I do.
tigarcia has joined #ruby
platzhirsch has quit [Remote host closed the connection]
mikeharris22 has quit [Ping timeout: 244 seconds]
<hxegon> Ox0dea: thanks, still getting my mind around differences between lamdas procs and blocks
Motoservo has quit [Read error: Connection reset by peer]
fibbel has quit [Quit: fibbel]
eminencehc has quit [Remote host closed the connection]
fibbel has joined #ruby
symm- has joined #ruby
multiscan has joined #ruby
bMalum has joined #ruby
jottr has joined #ruby
mistermocha has joined #ruby
seitensei has joined #ruby
seitensei has joined #ruby
babblebre has joined #ruby
eminencehc has joined #ruby
Igorshp has joined #ruby
<Ox0dea> hxegon: A lambda is just a Proc with argument checking and different (read: sane) return semantics.
arthurix_ has joined #ruby
Motoservo has joined #ruby
<Ox0dea> Blocks are syntax for passing one (and, alas, only one) Proc to a method.
mark2 has quit [Remote host closed the connection]
snockerton has quit [Quit: Leaving.]
<hxegon> Ox0dea: what do you mean by argument checking?
<Ox0dea> hxegon: You can pass any number of arguments to a Proc and it won't complain.
multiscan has quit [Client Quit]
<mallu> can someone please tell me how do you sort this? https://dpaste.de/YCDU
deception1 has joined #ruby
jottr has quit [Quit: WeeChat 1.3]
<gregf_> >> ->(a,b){ puts a + b }.call(1,2)
<ruboto> gregf_ # => 3 ...check link for more (https://eval.in/460306)
<Ox0dea> hxegon: https://eval.in/460305
<gregf_> >> ->(a,b){ puts a + b }.call()
<ruboto> gregf_ # => wrong number of arguments (0 for 2) (ArgumentError) ...check link for more (https://eval.in/460307)
<hxegon> Ox0dea: ahh, whereas a lamda will give you an argument error when appropriate right?
<gregf_> hxegon: ^^
<gregf_> >> proc { |a,b| puts a + b }.call()
<ruboto> gregf_ # => undefined method `+' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/460308)
<Ox0dea> gregf_: You're being noisy. :<
arthurix has quit [Ping timeout: 260 seconds]
<hxegon> what is this -> BS
<Ox0dea> hxegon: -> is another way to create a lambda.
<Ox0dea> -> x, y {} == lambda { |x, y| }
armyriad has quit [Ping timeout: 265 seconds]
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hxegon> oh yeah! the other way is kind of cumbersome
<Ox0dea> I agree.
mistermocha has quit [Ping timeout: 240 seconds]
<Ox0dea> Lambdae are better than Procs, and we get a sexy syntax for them to boot.
<mallu> how do you sort this json file? ["a", "c", "f", "b", "d"]
aevitas has joined #ruby
<gregf_> hxegon: its what Ox0dea said. lambda need the args, in a proc they aren;t mandatory. sorry about that Ox0dea . i know interrupting is annoying :|
Igorshp has quit [Remote host closed the connection]
<Ox0dea> gregf_: No, you weren't interrupting; you were just making ruboto spew.
armyriad has joined #ruby
<gregf_> sorry ruboto ;)
snockerton has joined #ruby
<hxegon> are lambdas and procs interchangable with procs? can I just start spamming lambdas everywhere?
<Ox0dea> mallu: That's an Array.
Alayde has joined #ruby
Motoservo has quit [Read error: Connection reset by peer]
<hxegon> that first sentance lol
<Ox0dea> hxegon: ...
Alayde has left #ruby [#ruby]
umgrosscol has joined #ruby
<hxegon> Ox0dea: at least I'm honest
<Ox0dea> We've just discussed the primary difference.
mikecmpbll has quit [Ping timeout: 260 seconds]
<hxegon> Ox0dea: alright alright, I'll stop with the stupid questions :P
timonv has quit [Ping timeout: 264 seconds]
mois3x has joined #ruby
<gregf_> mallu: require "json"; p JSON.parse(%{["a", "c", "f", "b", "d"]}) <== like that?
<gregf_> hxegon: you need to be careful with Ox0dea. you could get lost ;)
<Ox0dea> hxegon: https://eval.in/460309
<Ox0dea> There's the difference in return semantics.
max1 has joined #ruby
c355E3B has quit [Quit: Connection closed for inactivity]
techsethi has joined #ruby
max1 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
arup_r has quit [Read error: Connection reset by peer]
fedexo has quit [Ping timeout: 246 seconds]
<Ox0dea> `return` in a Proc will return from the surrounding method, whereas it's more like `yield` in a lambda.
aevitas has quit [Ping timeout: 264 seconds]
codecop has joined #ruby
marr has joined #ruby
techsethi has quit [Client Quit]
RegulationD has joined #ruby
<hxegon> >> foo = Proc.new { |i| i +1 }; [1, 2].map(&foo)
<ruboto> hxegon # => [2, 3] (https://eval.in/460310)
<hxegon> ...
nertzy has quit [Quit: This computer has gone to sleep]
nemo_ has quit [Remote host closed the connection]
The_Phoenix has joined #ruby
jackjackdripper has joined #ruby
sudiptamondal has joined #ruby
sudiptamondal has quit [Max SendQ exceeded]
<Ox0dea> hxegon: #map expects a block and you gave it one.
<hxegon> Ox0dea: so did you but it returned a single value, is that because it's inside a function?
<hxegon> Ox0dea: or is it not a block in that case?
GORDON6 has joined #ruby
<GORDON6> is this rub & rails ?
<GORDON6> ruby & rails
<Ox0dea> ?rails GORDON6
<ruboto> GORDON6, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
bMalum has quit [Quit: bMalum]
<Ox0dea> hxegon: I'm not sure I understand the question.
<Ox0dea> Your example demonstrates that `&` can be used to treat a Proc like a block, not the difference in return semantics between Procs and lambdae.
<GORDON6> so Ruby is different than RubyOnRails
<GORDON6> guys i m old school i just installed mirc
willardg has joined #ruby
<GORDON6> i am amazed to see people are studying in here
Motoservo has joined #ruby
<hxegon> GORDON6: rails is a framework for ruby
tigarcia has quit [Remote host closed the connection]
<eam> wow, I didn't realize return doesn't return from a proc. I suppose that's to allow stuff like
<eam> >> send def foo; 5.times { |i| puts i; return } end
<ruboto> eam # => 0 ...check link for more (https://eval.in/460311)
RegulationD has quit [Ping timeout: 272 seconds]
<eam> makes sense now that it's pointed out
<hxegon> Ox0dea: I'm going to do some research on this and get back to you
<Ox0dea> hxegon: Sounds good.
hightower2 has joined #ruby
bMalum has joined #ruby
joonty has quit [Quit: joonty]
sandals has joined #ruby
naftilos76 has quit [Ping timeout: 250 seconds]
ghoti has joined #ruby
BSaboia has joined #ruby
tigarcia has joined #ruby
willardg has quit [Client Quit]
dellavg_ has quit [Ping timeout: 260 seconds]
rakm has joined #ruby
zotherstupidguy has joined #ruby
barhum2013 has quit [Quit: barhum2013]
shredding has quit [Ping timeout: 246 seconds]
barhum2013 has joined #ruby
<hxegon> Ox0dea: ahh, the implicit return in the proc confused me. I get it now. I was didn't think there would be a difference between proc { |i| return i+1} and proc { |i| i+1 }
Motoservo has quit [Ping timeout: 250 seconds]
ghoti has quit [Ping timeout: 272 seconds]
tw1sted has quit [Changing host]
tw1sted has joined #ruby
Musashi007 has joined #ruby
umgrosscol has quit [Remote host closed the connection]
<hxegon> Ox0dea: I now realize that is exactly what you were saying... I'll go in the corner now
<Ox0dea> hxegon: Be never ashamed of your own edification.
stan has quit [Ping timeout: 260 seconds]
Motoservo has joined #ruby
<dorei> how can i remove these silly "\xC2", "\xA0" from a string?
<Ox0dea> dorei: How'd they get there?
<dorei> nbsp :p
<dorei> i remembered
wldcordeiro has quit [Ping timeout: 268 seconds]
<dorei> [[:space:]]
k3asd` has quit [Ping timeout: 272 seconds]
<hxegon> lol: "I was didn't think there would be..." - hxegon 2015
skweek has joined #ruby
<Ox0dea> > Has anyone ever been far as decided even go want to do look more like?
<eam> string.bytes.select {|c| c < 0x80}.map(&:chr).join
akem has quit [Ping timeout: 252 seconds]
<hxegon> Sometimes I can't belive english is my first lang >.<
<dorei> >> 0x80.chr
<ruboto> dorei # => "\x80" (https://eval.in/460314)
ruurd has quit [Quit: ZZZzzz…]
mikecmpbll has joined #ruby
<eam> >> 2**7 == 0x80
<ruboto> eam # => true (https://eval.in/460315)
fantazo has joined #ruby
platzhirsch has joined #ruby
<dorei> oh, 7bit ascii then
<Ox0dea> dorei: Elseways called "ASCII".
rbennace_ has quit [Remote host closed the connection]
<eam> I guess this is a better way:
<eam> >> "abc☃".gsub(/[^[:ascii:]]/, '')
<ruboto> eam # => "abc" (https://eval.in/460316)
Lorn has quit [Changing host]
Lorn has joined #ruby
barhum2013 has quit [Quit: barhum2013]
Motoservo has quit [Read error: Connection reset by peer]
leafybasil has joined #ruby
<dorei> unicode snowman <3
dellavg_ has joined #ruby
RegulationD has joined #ruby
<Ox0dea> >> "abc☃".encode('646', undef: :replace)
<ruboto> Ox0dea # => "abc?" (https://eval.in/460317)
sepp2k has quit [Quit: Leaving.]
tlarevo has joined #ruby
<eam> all depends on whether your byte string is a valid encoding or not
asianMike has joined #ruby
bMalum has quit [Quit: bMalum]
VeryBewitching has joined #ruby
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
GORDON6 has left #ruby [#ruby]
jonee has joined #ruby
mjuszczak has quit []
Guest53 has joined #ruby
Motoservo has joined #ruby
vbatts|w1 has joined #ruby
kobain has quit [Read error: Connection reset by peer]
mikeharris22 has joined #ruby
tlarevo has left #ruby [#ruby]
shadoi has joined #ruby
Igorshp has joined #ruby
vbatts|w1 has quit [Client Quit]
kobain has joined #ruby
mikeharris22 has quit [Remote host closed the connection]
mikeharris22 has joined #ruby
joneshf-laptop has quit [Ping timeout: 244 seconds]
stevednd has joined #ruby
EllisTAA has joined #ruby
nemo_ has joined #ruby
hs366 has quit [Quit: Leaving]
tvw has quit [Ping timeout: 256 seconds]
<EllisTAA> is it not possible to get the name of the group on line 13 from line 28?? https://gist.github.com/anonymous/328798e25b3217dfb06f#file-sixdegreesofbacon-rb-L13-L28
<EllisTAA> bc when i get the results i’m getting [{:group=>"Kamron Hauck"}, {:group=>"Helga Runolfsdottir"}, {:group=>"Mrs. Ford Grimes"}]
zotherstupidguy has quit [Quit: WeeChat 1.3]
zotherstupidguy has joined #ruby
DEA7TH has quit [Quit: DEA7TH]
bricker has quit [Ping timeout: 272 seconds]
seitensei has quit [Remote host closed the connection]
FungalRaincloud has joined #ruby
mrtomme has quit [Ping timeout: 260 seconds]
mrtomme has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bruce_lee has quit [Read error: Connection reset by peer]
sdothum has joined #ruby
SCHAAP137 has joined #ruby
bMalum has joined #ruby
deception1 has quit [Read error: Connection reset by peer]
Motoservo has quit [Ping timeout: 252 seconds]
deception1 has joined #ruby
hxegon has quit [Ping timeout: 265 seconds]
Motoservo has joined #ruby
mary5030 has quit [Ping timeout: 265 seconds]
snockerton has quit [Quit: Leaving.]
mistermocha has joined #ruby
NeverDie has joined #ruby
druonysus has joined #ruby
TDJACR has quit [Quit: ZNC - http://znc.in]
mois3x has quit [Quit: mois3x]
gregf_ has quit [Read error: No route to host]
snockerton has joined #ruby
valkyrka has quit [Quit: valkyrka]
elusiveother has quit [Quit: Look at me still talking when there's science to do!]
al2o3-cr has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
rikkipitt has quit [Remote host closed the connection]
bricker has joined #ruby
zenguy_pc has quit [Ping timeout: 252 seconds]
aevitas has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
mikeharris22 has quit [Remote host closed the connection]
hxegon has joined #ruby
purplexed- has quit [Quit: Leaving]
gregf_ has joined #ruby
diegoviola has joined #ruby
PaulCape_ has quit [Quit: .]
mikeharris22 has joined #ruby
PaulCapestany has joined #ruby
aevitas has quit [Ping timeout: 255 seconds]
TheNet has joined #ruby
dnomyar has quit [Ping timeout: 272 seconds]
wldcordeiro has joined #ruby
beauby has quit [Ping timeout: 264 seconds]
mikeharris22 has quit [Ping timeout: 240 seconds]
mary5030 has joined #ruby
Motoservo has quit [Read error: Connection reset by peer]
hiyosi has joined #ruby
solars has quit [Quit: WeeChat 0.4.2]
klingeldraht has joined #ruby
Motoservo has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eminence_ has joined #ruby
eminencehc has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
karapetyan has quit [Remote host closed the connection]
TDJACR has joined #ruby
dnomyar has joined #ruby
Mia has quit [Read error: Connection reset by peer]
niemcu has quit [Ping timeout: 246 seconds]
jonathanwallace has joined #ruby
<jonathanwallace> atlrug
<jonathanwallace> doh
last_staff has joined #ruby
<TheNet> can someone tell me which line here they think is better? https://gist.github.com/net/b2ba645d05899d25f7aa
craysiii has joined #ruby
Motoservo has quit [Read error: Connection reset by peer]
mikeharris22 has joined #ruby
<TheNet> with the second line you avoid creating the string if it's not going to be used, but then you have to write 'if DEBUG' after every debug message, which isn't very DRY
<Ox0dea> TheNet: Seems you know all you need to make the right decision.
<eam> use a gettext module for i18n and then the former isn't any more expensive :)
ibouvousaime has quit [Ping timeout: 240 seconds]
Musashi007 has quit [Quit: Musashi007]
Motoservo has joined #ruby
<Ox0dea> Or just freeze it. :P
ibouvousaime has joined #ruby
EmeraldExplorer has joined #ruby
Erik_Underline has quit [Ping timeout: 246 seconds]
fschuindt has joined #ruby
<Ox0dea> TheNet: https://eval.in/460334
allomov has quit [Remote host closed the connection]
<fschuindt> Folks, how can I mix two arrays in a given position? Like: https://gist.github.com/fschuindt/eb74744e6b7921d2fff6
<Ox0dea> What's one more gonna hurt?
ItSANgo has quit [Quit: Leaving...]
<Ox0dea> fschuindt: #insert
<Ox0dea> >> foo = [1, 2, 3]; foo.insert(1, 4, 5)
<ruboto> Ox0dea # => [1, 4, 5, 2, 3] (https://eval.in/460335)
DiCablo has joined #ruby
<fschuindt> Ox0dea: thank you!
<Ox0dea> fschuindt: Sure thing.
<Ox0dea> I trust you know about splatting?
<fschuindt> nope
<Ox0dea> fschuindt: Ah, well, you'll want to say `people.insert(2, *new_people)`.
synthroid has joined #ruby
<fschuindt> yes
<Ox0dea> Without the * to "spread" the array into separate arguments, you'd insert an Array instead of its components.
arup_r has joined #ruby
<al2o3-cr> too slow :(
roxtrongo has joined #ruby
_blizzy_ has joined #ruby
Icey has quit [Remote host closed the connection]
nemo_ has quit [Ping timeout: 265 seconds]
<TheNet> Ox0dea: not quite sure what that's telling me
<Ox0dea> TheNet: It's telling you how many occurrences of that one String are alive in the system.
Motoservo_ has joined #ruby
Motoservo has quit [Read error: Connection reset by peer]
Motoservo_ is now known as Motoservo
<mh_laakso> Does anyone have an opinion on Ruby in Canada re: jobs?
<mh_laakso> I know Shopify uses it for their code base
<fschuindt> Ox0dea: thank you again man, It workend :)
<fschuindt> worked*
<Ox0dea> fschuindt: Happy to help.
DEA7TH has joined #ruby
<Ox0dea> TheNet: I realize you probably can't freeze your debug strings by dint of their being dynamic, but look what happens if you can: https://eval.in/460347
TheNet has quit [Read error: Connection reset by peer]
<Ox0dea> Fine.
<diegoviola> I refuse to join #rubyonrails, the last time I been there they asked me to STFU
cdg has quit [Remote host closed the connection]
<diegoviola> I won't join there ever again
<Ox0dea> diegoviola: Are you going to refuse to join #ruby if somebody here advises you similarly?
TheNet has joined #ruby
<diegoviola> Ox0dea: yes, I don't want to be in a toxic community
<eam> just allow Log.debug to take a symbol
Motoservo has quit [Read error: Connection reset by peer]
<eam> Log.debug :"my error message here"
<Ox0dea> TheNet is worried about an object being created at all.
<TheNet> ^
<shevy> objectitis - fear of objects
<Ox0dea> TheNet: And that's laudable, but having to tack `if DEBUG` on the end is largely just noise.
<eam> well it won't be created per call, right?
<eam> that's kinda the point of a symbol
roxtrongo has quit []
<shevy> diegoviola good that the communities are different!
<TheNet> eam it's a log message so it'll probably be different each time
DEA7TH has quit [Quit: DEA7TH]
<eam> ah. Make your logger method take sprintf style args?
<eam> have *it* do the dynamic bits
<Ox0dea> Yep, that'd be the best approach.
arup_ has joined #ruby
<Ox0dea> Freeze the format strings, of course.
<TheNet> could I use a block?
riceandbeans has joined #ruby
<eam> Ox0dea: btw, I bet ObjectSpace lies about how many actual copies of the strings it makes
andikr has quit [Remote host closed the connection]
<TheNet> Log.debug { "this #{var} string" }
arup_ has quit [Read error: Connection reset by peer]
<Ox0dea> eam: What makes you say so?
<Ox0dea> TheNet: You could, but why?
<riceandbeans> anyone know of if there's a better looking major mode in emacs for ruby than the stock one?
<riceandbeans> I mean, it works fine, I was just hoping for a LITLE more color
<TheNet> Ox0dea: it seems pretty simple, just curly braces instead of parenthesis
dikaio has joined #ruby
arup_r has quit [Ping timeout: 255 seconds]
<Ox0dea> Are you trolling...?
<Ox0dea> >> ObjectSpace.each_object(String).select { |s| s == 'foo' }.map(&:object_id).uniq.size # eam
<ruboto> Ox0dea # => 774 (https://eval.in/460350)
<riceandbeans> Ox0dea: do you mean me?
arup_r has joined #ruby
<Ox0dea> riceandbeans: Of course not.
bMalum has quit [Quit: bMalum]
karapetyan has joined #ruby
kohgpat has quit [Quit: leaving]
<Ox0dea> >> ObjectSpace.each_object(String).select { |s| s == 'not so common string' }.map(&:object_id).uniq.size # eam
<ruboto> Ox0dea # => 776 (https://eval.in/460351)
<Ox0dea> Wow.
decoponio has quit [Quit: Leaving...]
<havenwood> riceandbeans: One of these days I'm going to figure out how to exit out of emacs!
<danneu> ruby just needs to absorb uberscor
<shevy> diegoviola you may wish to learn these languages for more career options: http://www.popularmechanics.com/space/a17991/voyager-1-voyager-2-retiring-engineer/
FungalRaincloud has quit [Quit: Leaving.]
<Ox0dea> danneu: <3
<eam> Ox0dea: well, the loop is creating it
<eam> Ox0dea: you'd have to inspect from outside ruby
Motoservo has joined #ruby
<danneu> the more i watch these ad-hoc filter/select/map examples
<riceandbeans> havenwood: Control+x then Control+C
<riceandbeans> err, c
<TheNet> Yeah I think passing a block into Log.debug is the best choice for me
<eam> Ox0dea: actually I only see 3 copies, so hey
<eam> close
<diegoviola> shevy: I don't care about these languages
<havenwood> riceandbeans: -UUU:----F1 *scratch*
<havenwood> riceandbeans: The plot thickens...
chipotle has quit [Quit: cheerio]
<TheNet> then in Log.debug I can do something like "message = yield if DEBUG"
<eam> TheNet: def debugf(fmt, *args); sprintf fmt, *args; end; Log.debugf "my %s is %s!", "whale", "purple"
<riceandbeans> havenwood: in emacs, unlike where vi(m) with everything being relation to ed and piped through ed, most all commands are based off the alt, shift, and control keys
<riceandbeans> ed commands and essentially piped through ed
syath has quit [Quit: WeeChat 1.2]
asianMike has quit [Remote host closed the connection]
finisherr has joined #ruby
<riceandbeans> havenwood: so there's notations like C-a or M-x (M is Meta which is alt), or S-whatever, in reference to key combos
<shevy> diegoviola haha yeah me neither
pandaant has quit [Remote host closed the connection]
<havenwood> riceandbeans: I'm *mostly* just kidding (I sometimes get stuck in emacs).
__chris has quit [Ping timeout: 244 seconds]
<TheNet> eam: isn't a block better
Motoservo has quit [Read error: Connection reset by peer]
<riceandbeans> oh
<eam> is it Ok to create a new Proc?
<riceandbeans> sorry
<Ox0dea> TheNet: Aye, you were worried about object allocation, no?
<eam> if you're worried about creating strings, I imagine you're also worried about creating blocks
umgrosscol has joined #ruby
Motoservo has joined #ruby
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<riceandbeans> havenwood: I'm not hating on vim, I just ended up trying out emacs a couple years back and growing to like it better than vim, they're both fine by me but I'm more fluent in emacs and I feel more comfortable in it
<riceandbeans> :P use what you like best and makes you happy
beauby has joined #ruby
<eam> and by the way, we're quickly approaching the "perhaps ruby isn't the right language for this kind of optimization" :)
<TheNet> eam: I'm more worried about string interpolation
<eam> TheNet: I recommend benchmarking the various options, given the particulars of your use case (which we really don't know0
bjhaid has joined #ruby
<bjhaid> hi
<eam> make sure your assumptions about cost are correct
tjohnson has joined #ruby
<TheNet> alright, thanks
TheNet has quit [Remote host closed the connection]
Guest53 has joined #ruby
<bjhaid> how does one create a gemspec.rz file, more importantly whats the easiest way to read the gemspec file
fantazo has quit [Ping timeout: 265 seconds]
TheNet has joined #ruby
<eam> from a discussion about why Array#[] can't necessarily give parse-time errors about x["oops"]: ObjectSpace.each_object(Array).to_a.sample.instance_eval { def [](*x); "loooooool what is going on"; end }
momomomomo has joined #ruby
dopamean_ has joined #ruby
<havenwood> riceandbeans: I usually vim and only dabble in emacs from time to time playing with Xiki. I've recently got re-interested after looking at the alchemist package for elixir but haven't had time to explore!
Motoservo has quit [Read error: Connection reset by peer]
DoubleMalt has quit [Remote host closed the connection]
agit0 has joined #ruby
linocisco has joined #ruby
<riceandbeans> elixir? you do erlang?
Motoservo has joined #ruby
dasher00 has quit [Remote host closed the connection]
Motoservo has quit [Client Quit]
beauby has quit [Ping timeout: 264 seconds]
<Ox0dea> bjhaid: A gemspec.rz file is Zlib.deflate(Marshal.dump(foo)), where foo is an instance of Gem::Specification.
platzhirsch has left #ruby [#ruby]
<bjhaid> Ox0dea: I know
<bjhaid> I was asking how to create it
<bjhaid> but I think I have found my answer
<Ox0dea> bjhaid: The process is invertible.
agit0 has quit [Ping timeout: 260 seconds]
<bjhaid> Ox0dea: the process is invertible but getting the specification from the gemspec is where I have been stucked
<bjhaid> I would go with `gem specification some_gem.gem` for now
_djbkd has quit [Remote host closed the connection]
<Ox0dea> bjhaid: Gem.latest_spec_for(foo)
maletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bjhaid> Ox0dea: can foo be a raw gem? like file on disk
linocisco has quit [Ping timeout: 256 seconds]
<Ox0dea> bjhaid: No.
<bjhaid> so what I want is for a file on disk
tref has joined #ruby
bMalum has joined #ruby
purplexed- has joined #ruby
<tref> Hey guys, I’ve got an interesting question and altough this pertains to ruby with a persistence layer I think this is the best place to ask.
<Ox0dea> bjhaid: Are you sure this is what you need to do?
aevitas has joined #ruby
diego3 has joined #ruby
<tref> Im creating a url shortening service and trying to generate the shortest possible url safe url
<bjhaid> yes, so I have a rubygems mirror and I want to create spec files for local gems
diego3 has quit [Changing host]
diego3 has joined #ruby
diegoviola is now known as Guest9660
diego3 is now known as diegoviola
<Ox0dea> bjhaid: .gemspecs, or .gemspec.rzs?
<tref> Im planning to use SecureRandom.urlsafe_base64 but I need to ensure that each ‘shortened’ url is unique
<bjhaid> .gemspec.rz
<eam> tref: why not just have an incrementing serial walking through whatever encoding you're using?
<bjhaid> to use in generating the specs file for the rubygems mirror
baroquebobcat has quit [Quit: baroquebobcat]
<tref> I was thinking of doing it serially
bb010g has joined #ruby
<tref> I guess there’s no reason that I cant
<Ox0dea> bjhaid: But these local gems do have gemspecs, yes?
dmitch has joined #ruby
<bjhaid> yes
<bjhaid> they have gemspecs
<eam> if you need parallelism, just apportion out regions of the serialized space to each parallel entity
<eam> aka thread 1 gets to generate odd and thread 2 gets to generate even
<tref> eam: what im a little unsure of is how I would go about finding out what the ‘next’ entry would be serially
<eam> (use any modulous for any level of parallelism)
Guest9660 has quit [Ping timeout: 265 seconds]
<eam> lous? what's wrong with me
EllisTAA has quit [Quit: EllisTAA]
<tubbo> no-time toulouse
<eam> tref: well, you have a set of valid characters, right? for simplicity's sake let's say that's "a".."z"
dfockler has quit [Ping timeout: 250 seconds]
<bjhaid> Ox0dea: I don't know how to create the Gem::Specification from the gemspec, that was my initial question
<tref> yeah it would be A-Z, a-z, 0-9, “-” and “_”
<tref> sem: A-Z, a-z, 0-9, “-” and “_” (sorry forgot the name)
aevitas has quit [Ping timeout: 252 seconds]
<eam> so you need f(x) where x is your integer sequence and f(x) is the position encoded in your sequence
<eam> "a".."z" is base 26
<djellemah> bjhaid: Have you seen gem help generate_index ?
<eam> so it's pretty easy to write f
The_Phoenix has quit [Read error: Connection reset by peer]
bryanray has joined #ruby
<bjhaid> nope
Musashi007 has joined #ruby
<eam> A-Za-Z0-9-_ is just a larger base
<bjhaid> would have a peek
EvilCorp_IT_Tech has quit [Ping timeout: 260 seconds]
jackjackdripper has quit [Quit: Leaving.]
<eam> f(1) -> "a"
jackjackdripper has joined #ruby
<eam> f(26) -> z, f(27) -> "aa
<eam> or w/e
bryanray has quit [Read error: Connection reset by peer]
TheNet has quit [Remote host closed the connection]
akem has joined #ruby
TheNet has joined #ruby
<Ox0dea> >> 'z'.next
<bjhaid> Ox0dea: thanks, that's what I have been thinking of how to implement
<ruboto> Ox0dea # => "aa" (https://eval.in/460353)
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby
<Ox0dea> bjhaid: djellemah, mind.
<eam> tref: btw, you can use .
<bjhaid> djellemah: thanks, that's what I have been thinking of implementing
<bjhaid> my bad
<bjhaid> Ox0dea: thanks to you too
<tref> eam: thanks, good to know
<eam> tref: maybe look up y64 encoding
<tref> eam: y64?
<eam> y64!
DiCablo has quit [Quit: Textual IRC Client: www.textualapp.com]
momomomomo has quit [Ping timeout: 250 seconds]
blue_deref has joined #ruby
<eam> url safe base64
bjhaid has quit [Quit: Page closed]
jessemcgilallen has joined #ruby
<eam> urlsafe_base64 isn't as compact
TheNet has quit [Remote host closed the connection]
mois3x has joined #ruby
<eam> I don't know why they used = as pad instead of .
<eam> or -
momomomomo has joined #ruby
asianMike has joined #ruby
<eam> yeah if you're just gonna base64 encode you'll lose some to the padding but then you can just do the 32bit value of your int
rbennacer has joined #ruby
<tref> eam: the problem is that I dont necessarily need to encode and decode since Im storing these values in a DB with reference to the original url
tulak has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
tulak has joined #ruby
jxl180 has joined #ruby
<eam> well right now you're encoding from random, right?
<eam> I'm saying, if you encode from a sequence
bigkevmcd has quit [Quit: Outta here...]
<eam> same process -- except you won't have a very expensive uniqueness check
uri_ has joined #ruby
<eam> the benefit of not encoding and just enumerating the character base is more compactness
<eam> (maximal)
<eam> eg your first encoded url could be short.url/a
<tref> eam: Exactly I’m just unsure how to do encode from a sequence :_
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Hounddog has quit [Remote host closed the connection]
quazimodo has joined #ruby
poguez_ has joined #ruby
nettoweb has joined #ruby
purplexed- has quit [Quit: Leaving]
<atmosx> hello ppl
<jxl180> Hey guys, simple question. If I'm extracting hash values from an array, to be used in a table, is there an easier way to do this? https://gist.github.com/anonymous/a47c89e1c42369c0bc2c
<eam> tref: well, do you know how to convert number bases?
<atmosx> by default Pony.mail uses sendmail?
<tref> eam: I dont
sdothum has joined #ruby
pullphinger has joined #ruby
<finisherr> Is there simple way of passing in some sort of hash path to a method so the hash inside the method can use it to access the value at that path?
beauby has joined #ruby
rikkipitt has joined #ruby
FernandoBasso has quit [Quit: Leaving]
TheNet has joined #ruby
jonee has quit [Read error: Connection reset by peer]
<eam> tref: if you look up how, and apply those principals to convert to base 55 you'll have what you need (I'm happy to help but, not sure I want to write the thing for you)
devbug has joined #ruby
<eam> is it base55? no, it'd be base64, right?
<eam> I think you can do base65 without padding
<eam> anyway, it doesn't really matter what characters you decide to map your sequence onto
<havenwood> jxl180: See #map: @server.datacenter_options.map do |dc|; [dc[:name], dc[:longName]]; end
<Ox0dea> jxl180: @server.datacenter_options.map { |dc| dc.values_at :name, :longName }
<eam> >> [*"a".."z",*"A".."Z",*"0".."9","-","_","."].size
<jxl180> havenwood: Thanks, I'll give that a shot!
<ruboto> eam # => 65 (https://eval.in/460354)
karapetyan has quit [Remote host closed the connection]
<tref> eam: I had something like that [*'0'..'9', *'a'..'z', *'A'..'Z', "_", "."].sort! {|a,b| a <=> b}
diegoviola has quit [Ping timeout: 255 seconds]
_djbkd has joined #ruby
<jxl180> Ox0dea: Thanks!
<eam> tref: ok, so f(0) == "." right?
<tref> yeah
<eam> this is easy up to f(64), then at f(65) you need "0."
<tref> eam: yes
<eam> you can figure out the value in each place with div / mod 65
<eam> or powers of 65
jxl180 has quit [Quit: ChatZilla 0.9.92 [Firefox 41.0.2/20151015125802]]
dellavg_ has quit [Ping timeout: 260 seconds]
<eam> and the integer you have for each place (like [1, 0] in the above example for f(65)) you'd find with [*'0'..'9', *'a'..'z', *'A'..'Z', "_", "."].sort! {|a,b| a <=> b}[x]
helpa has quit [Remote host closed the connection]
<eam> [*'0'..'9', *'a'..'z', *'A'..'Z', "_", "."].sort! {|a,b| a <=> b}[1] == "0" and [0] == "."
<eam> right?
helpa has joined #ruby
freerobby has joined #ruby
<tref> yes
snow2222 has joined #ruby
<tref> eam: with your example it would be 64 I believe
<snow2222> hey, I'm trying to use mechanize to log into a microsoft (NTLM) authentication pop-up that goes through the browser (i.e "Authentication Required" popup) and I can't seem to get it right
<snow2222> I've tried things I found from stackoverflow
nertzy has joined #ruby
<snow2222> I've even tried curl and postman, nothing seems to help
<shevy> what did you try, can you link
TheNet has quit [Remote host closed the connection]
<snow2222> tried this, got the same error in the comment
Coldblackice has joined #ruby
beauby has quit [Ping timeout: 240 seconds]
TheNet has joined #ruby
<snow2222> when I try and find the authentication pop -up, i cant even find it on the DOM
<tref> eam: so in order to get the next value of say a http://short.url/A9 I could pop the last value (which is 9) and find its index in the charset ([*'0'..'9', *'a'..'z', *'A'..'Z', "_", "."]) and increment it
<eam> is there a nice syntax to swap two methods without three alias_method invocations?
stamina has joined #ruby
TheNet has quit [Remote host closed the connection]
<eam> tref: yes. more generally you probably just want to write an integer to base65, and base65 to integer method
momomomomo has quit [Ping timeout: 250 seconds]
jamesaxl|2 has joined #ruby
x-light has joined #ruby
<tref> eam: hmm ok what might that look like and I’ll stop bothering you and take a swing at it :) You’ve been extremely helpful
<eam> tref: so, say I have f(12345)
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tref> eam: where would the value 1234 come from?
<eam> I'm just making it up
momomomomo has joined #ruby
<eam> it's an integer that I want to convert to this base65 sequence
<tref> eam: ok
<eam> >> 12345.to_s(65)
Channel6 has joined #ruby
<ruboto> eam # => invalid radix 65 (ArgumentError) ...check link for more (https://eval.in/460363)
BTRE has quit [Ping timeout: 252 seconds]
<eam> so unfortunately, ruby doesn't define large bases (because there's no agreemnt on what symbols to use, I presume)
<eam> but we've defined it, via that big [] above
<tref> hmm
<eam> so I need to know the 0..64 value of each digit, right?
FungalRaincloud has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
<tref> eam: yes
<eam> 12345 / 65**3 is zero, so I have no digit in the 3rd place
TheNet has joined #ruby
<eam> 12345 / 65**2 is 2, so I have that_mapping_above[2] in the 2nd place, right?
beauby has joined #ruby
synthroid has quit [Remote host closed the connection]
<eam> and then 12345 % 65**2 is 3895, which is what I have left over for the 1 and 0th place, right?
<eam> (sorry I'm being terrible with my off by one)
<eam> so 3895 / 65**1 = 59
<tref> yes I follow
<eam> so I have [2, 59]
dellavg_ has joined #ruby
<eam> if I'm doing this right, which I'm not sure I am
<eam> then map [2, 59].map { |digit| that_mapping_above[digit] }.join ""
<eam> which should be the string representation
snow2222 has quit [Ping timeout: 246 seconds]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has quit [Quit: Leaving.]
<eam> going the other way, you need to map the single characters to the digit between 0..64, and then multiply by 65**(whatever place you're in)
Yzguy has joined #ruby
<tref> 2X
<eam> so this would be "1v" I think?
<eam> for 12345
<tref> yeah 1v
FungalRaincloud has quit [Ping timeout: 272 seconds]
<tref> eam: sorry forgot to sort it
<eam> yeah make sure you have a stable ordering :)
<tref> im using that_mapping_above = [*'0'..'9', *'a'..'z', *'A'..'Z', "_", "."].sort!{|a,b| a <=> b}
hxegon_ has joined #ruby
<eam> throw - in as well
rodfersou has joined #ruby
akem has quit [Quit: Bye]
EmeraldExplorer has left #ruby [#ruby]
agit0 has joined #ruby
<tref> sure
everbot has joined #ruby
<tref> that will give me 65
chrislotix has quit [Read error: Connection reset by peer]
<eam> I think 65 characters is your max for url safe
<tref> yeah
<eam> base64 uses one character for pad
maletor has joined #ruby
<tref> I have to refresh my knowledge of base64 encoding
hxegon has quit [Ping timeout: 240 seconds]
<eam> what you're doing here isn't base64 btw
nettoweb has joined #ruby
<Ox0dea> It's called positional numbering.
lemondom has joined #ruby
<lemondom> so I used rbenv, now I try out rvm
<lemondom> ha, I am so excited already
<lemondom> I let it install right now
<lemondom> I heard rvm can compile to binary or something like that and is faster then?
fschuindt has quit [Read error: Connection reset by peer]
<lemondom> *the stuff run on it I mean
<Ox0dea> >> 'a9'.next # tref
<ruboto> Ox0dea # => "b0" (https://eval.in/460366)
<Ox0dea> Is that not in line with your desired results?
<eam> it's gonna do the wrong thing because the bases differ
<lemondom> honestly, I find gem/bundler faster than npm (nodejs world), I know, I know, node ecosystem got more and smaller packages, but still
<lemondom> running bundle install feels so simple
TheNet has quit [Remote host closed the connection]
BTRE has joined #ruby
<eam> ruby's String#next I think iterates through lowercase alnum only
<tref> eam: you’re right
<eam> you're basically building the same thing for a new character mapping
<shevy> >> "Ö".encoding.to_s
<ruboto> shevy # => "UTF-8" (https://eval.in/460367)
Guest53 has joined #ruby
<eam> String#next is super weird, depending on the contents of the string
podman has joined #ruby
<Ox0dea> tref: Do you know how to convert to and from hexadecimal in your head?
purplexed- has joined #ruby
purplexed- has joined #ruby
<Ox0dea> Or on paper or whatever.
<tref> Ox0dea: ha - no
Gi0 has quit [Quit: None]
<tref> Ox0dea: could probably learn real quick
<Ox0dea> tref: Well, you should learn how to do that, and then extrapolate from 16 to 65, or indeed any n.
_djbkd has quit [Remote host closed the connection]
<lemondom> utf-8 codepoint is hex
<lemondom> ehh
<lemondom> unicode code point
dellavg_ has quit [Ping timeout: 260 seconds]
mloy has joined #ruby
<Ox0dea> tref: ∀ n ∈ ℝ: 10ₙ = n₁₀
<Ox0dea> Except, technically, n = {0, 1}, which saddens me.
<tref> Ox0dea: That’s a little beyond my knowledge
<tref> Ox0dea: not sure if you caught the beginning of this but were trying to make this url safe
<Ox0dea> tref: "10 in base n == n in base 10 for all n".
<Ox0dea> tref: So you choose a URL-safe "alphabet".
<Ox0dea> The alphabet for hexadecimal is "0123456789abcdef".
<tref> right which we defined as [*'0'..'9', *'a'..'z', *'A'..'Z', "_", ".","-"]
<Ox0dea> tref: Now learn how to convert to and from hexadecimal, and then use your alphabet instead.
<finisherr> I figured it out
<finisherr> i’m passing in an array looping through each item and grabing the value of the original hash until the array is empty, which leaves me with the value I want
yfeldblum has quit [Ping timeout: 240 seconds]
<Ox0dea> tref: Mind, hexadecimal is just another system of positional notation, so you're already good to go if you grok how decimal works.
mistermocha has joined #ruby
<hxegon_> If you assign a lambda to a variable, is it still an anonymous function?
baroquebobcat has joined #ruby
bigmac_ has joined #ruby
n_blownapart has joined #ruby
hxegon_ is now known as hxegon
<Ox0dea> hxegon_: Its name is still detached from its essence, which can't be said for methods.
momomomomo has quit [Ping timeout: 240 seconds]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> You can't get hold of a method without knowing its name.
n_blownapart has quit [Client Quit]
<hxegon> Ox0dea: makes sense
mingle has joined #ruby
hxegon has quit [Quit: leaving]
zenguy_pc has quit [Ping timeout: 268 seconds]
i8igmac has quit [Ping timeout: 264 seconds]
aevitas has joined #ruby
mingle has left #ruby [#ruby]
<shevy> what about methods without a name
blackmesa has joined #ruby
<Ox0dea> shevy: Could you provide an example?
mistermocha has quit [Ping timeout: 265 seconds]
<Ox0dea> (See what I did there?)
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
davedev2_ has quit [Ping timeout: 246 seconds]
_djbkd has joined #ruby
davedev24 has joined #ruby
sdothum has joined #ruby
gusTester has joined #ruby
rikkipitt has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
gix has quit [Quit: Client exiting]
dellavg_ has joined #ruby
kadoppe has quit [Ping timeout: 252 seconds]
duckpuppy has quit [Ping timeout: 255 seconds]
momomomomo has joined #ruby
aevitas has quit [Ping timeout: 272 seconds]
kadoppe has joined #ruby
freerobby has joined #ruby
EllisTAA has joined #ruby
<tref> Ox0dea: what was wrong with the way we were doing it
spider-mario has joined #ruby
gix has joined #ruby
ta has quit [Ping timeout: 256 seconds]
<Ox0dea> tref: You were missing the forest.
Musashi007 has quit [Quit: Musashi007]
<Ox0dea> Understanding how to convert to and from any base is something every programmer should.
axl_ has quit [Quit: axl_]
ldnunes has quit [Quit: Leaving]
prestorium has quit [Quit: Leaving]
colegatron has quit [Ping timeout: 255 seconds]
zenguy_pc has joined #ruby
Jackneill has joined #ruby
hippyphysicist has joined #ruby
davedev24 has quit [Ping timeout: 246 seconds]
troulouliou_dev has joined #ruby
<Ox0dea> tref: Would you like a fish? :/
G186 has joined #ruby
Motoservo has joined #ruby
<eam> let's be honest, fishing is an extremely unproductive use of my time
<slash_nick> Ox0dea: do you have any 3's
<eam> but if it's fishing for compliments I'm gonna do it anyway
x-light has quit [Ping timeout: 244 seconds]
<Ox0dea> tref: Please do take some time to understand how this works. https://eval.in/460371
diegoviola has joined #ruby
hippyphysicist has quit [Client Quit]
hippyphysicist has joined #ruby
ruurd has joined #ruby
beauby has quit [Ping timeout: 264 seconds]
jamesaxl|2 is now known as jamesaxl
lemondom has quit [Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805]]
Motoservo has left #ruby [#ruby]
eminence_ has quit [Ping timeout: 250 seconds]
davedev24 has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest53 has joined #ruby
<tref> Ox0dea: No, sorry I’m vega
<tref> vegan* lol
<shevy> Ox0dea ->
civil_ has quit [Ping timeout: 265 seconds]
SylarRuby has joined #ruby
<Ox0dea> shevy: That's not a valid method name in Ruby.
aspiers has joined #ruby
rbennacer has quit []
<shevy> you can .call it
hippyphysicist has quit [Quit: Leaving]
<Ox0dea> That makes it a method?
blt has joined #ruby
<shevy> one without a name
<Ox0dea> You don't usually troll...
<shevy> You do usually troll...
hxegon has joined #ruby
umgrosscol has quit [Quit: End of Line]
<havenwood> Happy Frejya's Day!
jackjackdripper has quit [Ping timeout: 268 seconds]
<shevy> here is a free living method http://ruby-doc.org/core-2.2.0/UnboundMethod.html
Motoservo has joined #ruby
<shevy> WITHOUT A NAME!!!
<shevy> who is frejya
Musashi007 has joined #ruby
blt has left #ruby [#ruby]
bMalum has quit [Quit: bMalum]
<shevy> and that name is a very strange one for the USA
<Ox0dea> shevy: UnboundMethod instances have names, they're just not bound.
colegatron has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> can I unbound a method from -> ?
rbennacer has joined #ruby
<Ox0dea> shevy: "Unbound" is an adjective, not a verb.
<Ox0dea> UnboundMethod doesn't have a constructor, so no, you cannot create one from a lambda.
codecop has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
<shevy> but a lambda is an object
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Motoservo has quit [Read error: Connection reset by peer]
hippyphysicist has joined #ruby
hippyphysicist has quit [Client Quit]
zotherstupidguy has quit [Quit: WeeChat 1.3]
babblebre has quit [Quit: Connection closed for inactivity]
Motoservo has joined #ruby
radgeRayden has joined #ruby
<tref> Ox0dea: going through your example. Excuse my ignorance but I’m having a hard time finding any information on the syntax you used: `while (number /= charset_size) > 0`
zotherstupidguy has joined #ruby
<tref> Ox0dea: what’s that /= doing?
<Ox0dea> tref: Division.
<Ox0dea> >> x = 10; x /= 5; x
<ruboto> Ox0dea # => 2 (https://eval.in/460380)
arthurix has joined #ruby
joncol has joined #ruby
joneshf-laptop has joined #ruby
eminencehc has joined #ruby
hahuang65 has joined #ruby
<tref> Ox0dea: so assignment with division
<joncol> Hi people, how can I verify that a block that I pass to a method is indeed called, using RSpec syntax?
<Ox0dea> tref: Yes, it's called "compound assignment" in most of the literature.
leafybasil has quit [Read error: Connection reset by peer]
<Ox0dea> You can do it with all of the mathematical operators.
momomomomo has quit [Quit: momomomomo]
<tref> Ox0dea: thanks, never seen that and didnt know how to referene it
<Ox0dea> tref: Sure thing.
leafybasil has joined #ruby
zotherstupidguy has quit [Client Quit]
eminencehc has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
gizmore has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<dorei> joncol: create a local variable, have that block change that local variable and then expect that it's in fact changed
arthurix_ has quit [Ping timeout: 250 seconds]
<joncol> No nicer way of doing it?
<dorei> no idea, maybe ppl at #rspec could help you more
<joncol> dorei: just found it I think: expect(x).to yield_control
to_json has joined #ruby
to_json has quit [Changing host]
to_json has joined #ruby
to_json has quit [Client Quit]
devoldmx has quit [Remote host closed the connection]
duckpuppy has joined #ruby
FernandoBasso has joined #ruby
gusTester has left #ruby [#ruby]
PlasmaStar has quit [Ping timeout: 246 seconds]
bruno- has joined #ruby
Motoservo has quit [Read error: Connection reset by peer]
itgold has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
Eiam_ has joined #ruby
Gi0 has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
EllisTAA has quit [Quit: EllisTAA]
<itgold> hello
<itgold> I'm getting Error: undefined method `pubDate' for #<RSS::RDF::Item:0x77913237>\n Exception: NoMethodError\n
<Eiam_> Any suggestions on how to handle centralizing env settings to one place so that Sinatra, Rake, Pry and Rack can all read from the same place ?
<itgold> how do I check that my item variable has property pubDate?
<Eiam_> itgold: ask it
Musashi007 has joined #ruby
<itgold> why it is expecting pubDate to be method?
blackmesa has joined #ruby
<Eiam_> itgold: respond_to?
<itgold> but when I try to do item.pubDate it is throwing that error
DEA7TH has joined #ruby
<Eiam_> itgold: your error says that there is no method pubDate
PlasmaStar has joined #ruby
<itgold> yeah, I actually expect pubDate to be a field, not method
beauby has joined #ruby
<Guest53> Looks like it's niether.
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest53 is now known as Jerrod
<itgold> so this is just nil right?
hahuang65 has quit [Read error: Connection reset by peer]
<Eiam_> no..
JDiPierro has quit [Remote host closed the connection]
<itgold> undefined?
hahuang65 has joined #ruby
<itgold> or something like that
<Eiam_> right
<itgold> ok, good
<Eiam_> (nil is defined)
Motoservo has joined #ruby
<itgold> can I dynamically add a property item.pubDate to my instance "item"?
blackmesa has quit [Ping timeout: 265 seconds]
<itgold> like "item.pubDate = nil" or something like that?
<Jerrod> Not like that.
<Eiam_> it would only be for that instance, not all of them
<itgold> how do I do this?
<Eiam_> you'd need to open up the class and patch it
<shevy> itgold use "def"
Motoservo has quit [Client Quit]
rbennacer has quit [Remote host closed the connection]
ruurd has quit [Quit: ZZZzzz…]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anisha has quit [Quit: Leaving]
<itgold> the item's class ?
rbennacer has joined #ruby
<Eiam_> itgold: what are you really trying to do because the question has shifted slightly
<Eiam_> do you want to add a new attribute or method to all instances and future instances of a class?
mag42c has quit [Quit: mag42c]
<Eiam_> basically, extend the class definition
<Eiam_> or are you just trying to add a value into a specific instance of a specific object
arup_r has quit [Quit: Leaving]
<itgold> I'm playing around with the logstash plugin that is pulling data from RSS feed and populates Elasticsearch index. For one of the feeds I have there is no property that it expects and it is pubDate. I'm trying to patch RSS plugin source code so if there is no pubDate property it just needs to ignore it
<Eiam_> open up the class and add a method for pubDate that returns whatever you expect/want
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rbennacer has quit [Ping timeout: 246 seconds]
<itgold> aha, let me check if I have this class
trosborn has joined #ruby
<Eiam_> effectively making it a runtime patch
<Eiam_> you don't need the class source code
<Eiam_> just literally define it in your code
blackmesa has joined #ruby
bruno- has quit [Ping timeout: 260 seconds]
<Eiam_> class Blah def pubDate :noValue end end
<itgold> not sure I understand how to do it
swgillespie has joined #ruby
to_json has joined #ruby
to_json has joined #ruby
aspiers has quit [Ping timeout: 250 seconds]
<itgold> I have a variable called "item"
<itgold> my understanding is I need to add pubDate to this instance somehow
<Jerrod> add it to the class.
joncol has quit [Quit: leaving]
<Eiam_> class Item def pubDate :value end end
swgillespie has quit [Read error: Connection reset by peer]
<itgold> ah
<Eiam_> variable isn't relevant, its the class of what it is
<Eiam_> itgold: when you create a class.. re "defining" the class just adds into the class definition
<Eiam_> (if one already exists)
swgillespie has joined #ruby
finisherr has quit [Ping timeout: 246 seconds]
<itgold> interesting
SylarRuby has quit []
<itgold> let me give it a try
G186 has quit [Quit: Textual IRC Client: www.textualapp.com]
<itgold> feed.items.each do |item|
<Eiam_> so "class Test def hi puts "hello" end end" "class Test def hello puts "hi" end end" x = Test.new will give you x.hi and x.hello
mordocai has quit [Read error: Connection reset by peer]
<Eiam_> only need to define it once; not in a loop
dmitch has quit [Ping timeout: 240 seconds]
<Jerrod> itgold, do you understand the relationship between Classes and Instances?
<itgold> Jerrod: I think I do :)
rbennacer has joined #ruby
postmodern has joined #ruby
<Jerrod> The class is a blue print object in which an instance is created from, if you want to add a property to an instance, add it to the class and it each new instance will be created with the new property.
naftilos76 has joined #ruby
<Eiam_> itgold: do your monkeypatch at load
al2o3-cr has quit [Ping timeout: 252 seconds]
<itgold> yes
<Eiam_> itgold: whats item.class say
hahuang65 has quit [Ping timeout: 240 seconds]
<itgold> let me check
ss_much has joined #ruby
p0wn3d__ has quit [Ping timeout: 260 seconds]
ESpiney has quit [Quit: Leaving]
ehth77 has joined #ruby
jackjackdripper has joined #ruby
momomomomo has joined #ruby
newdan has quit [Ping timeout: 250 seconds]
al2o3-cr has joined #ruby
solocshaw has quit [Ping timeout: 246 seconds]
<itgold> :item=>RSS::Rss::Channel::Item
tigarcia has quit [Remote host closed the connection]
<itgold> I do need to have RSS::Rss::Channel::Item class in order to patch it, right?
EllisTAA has joined #ruby
lemondom has joined #ruby
x-light has joined #ruby
quazimodo has quit [Ping timeout: 255 seconds]
<lemondom> Can/do I have to upgrade gem itself? I installed a ruby version - is gem current then?
rikkipitt has joined #ruby
finisherr has joined #ruby
<shevy> what is the new gem version
<shevy> latest one should be 2.4.8
<itgold> '''
<lemondom> 2.4.8
<lemondom> yes
<lemondom> current stable ruby
<lemondom> I use rvm
<shevy> \o/
gix has quit [Quit: Client exiting]
sandals has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lemondom> to install bundler globally, I just run gem install?
<itgold> here is how I get list of items: feed = RSS::Parser.parse(body) feed.items.each do |item|
<lemondom> no need for a -g switch, right?
beauby has quit [Ping timeout: 260 seconds]
<havenwood> lemondom: Just: gem install bundler
xantik has joined #ruby
<Eiam_> sounds like a module
<itgold> I was hoping to add pubDate to every item object instance if it doesn't exists
<lemondom> cool
<lemondom> I love bundler
<lemondom> I love Gemfiles and bundler
<lemondom> I just run bundler install and I am done
<lemondom> hurra
<djellemah> itgold: does item[:pubDate] or item['pubDate'] do something useful?
<havenwood> lemondom: RubyGems even supports creating/updating a Gemfile.lock from your Gemfile: gem install -g
<itgold> no, I assume this is just suppose to be a property. This is how it is getting used: event["published"] = item.pubDate
<lemondom> havenwood: so it replaces bundler now?
<havenwood> lemondom: Then to be in the context of the bundle just set: export RUBYGEMS_GEMDEPS=-
<lemondom> what does gem install -g? globally install ?
allomov has joined #ruby
<djellemah> itgold: there are no properties in ruby, only methods.
<itgold> oh
<itgold> that is what I was missing
<itgold> so item.pubDate is a getter or something?
<lemondom> havenwood: so I don't need bundle anymore?
gix has joined #ruby
rbennacer has quit [Remote host closed the connection]
swgillespie has quit [Remote host closed the connection]
rbennacer has joined #ruby
<itgold> can I dynamically add a new method pubDate to every item that has no such method?
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam_> djellemah: mmm I don't know that statement is correct?
arthurix_ has joined #ruby
yfeldblum has joined #ruby
<Eiam_> djellemah: objects have properties /attributes
<Eiam_> djellemah: and methods are how you access them
dellavg_ has quit [Ping timeout: 260 seconds]
<djellemah> Eiam_: you mean instance variables?
<itgold> Eiam: maybe he meant that when you access a property you do this trough method?
jessemcgilallen has quit [Quit: jessemcgilallen]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yzguy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam_> djellemah: class Test def initialize @test = "hi" end end Test has an attribute, @test
swgillespie has joined #ruby
<Eiam_> @test is not a method
<djellemah> Eiam: not accessible from the outside.
<Eiam_> djellemah: if you define an accessor it is
Musashi007 has quit [Quit: Musashi007]
<Eiam_> attr_reader :color
eminencehc has joined #ruby
<itgold> unless (item.pubDate rescue nil).nil?
<Eiam_> err, attr_reader :test
<djellemah> Eiam: attr_reader defines the method for you.
<itgold> this is how I check if pubDate exists
<djellemah> itgold: item.pubDate if item.respond_to? :pubDate is probably the easiest
<itgold> but can I then add it to this particular instance?
arthurix has quit [Ping timeout: 240 seconds]
<Eiam_> djellemah: right, it defines a method.. to an attribute/property/.. instance variable =0
<Eiam_> djellemah: thats not what hes trying to do. he knows pubDate doesn't exist. he wants to make it exist and do something
<djellemah> do what?
<itgold> right!
jessemcgilallen has joined #ruby
diegoviola has quit [Ping timeout: 246 seconds]
<itgold> just access it
<itgold> event["published"] = item.pubDate
<itgold> like that
<djellemah> So it it doesn't exist, nil is fine, right?
<Eiam_> itgold: and what should pubDate return
rbennacer has quit [Ping timeout: 264 seconds]
<itgold> I want it to return empty something
<Eiam_> nil to indicate state is bad but w/e
cdg has joined #ruby
Gi0 has quit [Quit: None]
<itgold> empty string would work
<Eiam_> so is that
rakm has joined #ruby
<djellemah> event["published"] = item.pubDate rescue nil will work, although the rescue is somewhat overkill
<Eiam_> djellemah: that forces every instance to evaluate
<itgold> oh, cool!
<Eiam_> djellemah: you don't like monkeypatch as a solution?
<itgold> I think this is exactly what I need
<itgold> thank you guys!
<Eiam_> rescue nil is required in every place some other code decides to access the non existent attribute
rbennacer has joined #ruby
lxsameer has quit [Quit: Leaving]
DoubleMalt has joined #ruby
<djellemah> it seems to solve itgold's problem without a need to understand classes / instances / monkeypatching
diego3 has joined #ruby
diego3 has quit [Changing host]
diego3 has joined #ruby
<Eiam_> ugh
<djellemah> Eiam: have you seen dotenv? https://github.com/bkeepers/dotenv
<Eiam_> here
<Eiam_> itgold: all RSS::Rss::Channel::Item classes will return :default_pub_date when accessed now
rbennacer has quit [Ping timeout: 268 seconds]
<itgold> cool!
mois3x has quit [Quit: mois3x]
<itgold> but do I have to modify Item's class for this?
<Eiam_> (you cannot SET a value, but atleast now your string comes from a known place)
<Eiam_> itgold: which is what the example is doing on lines 23-27
<Eiam_> yes. thats correct.
solocshaw has joined #ruby
n008f4g_ has quit [Quit: leaving]
<Eiam_> the difference is, if LATER you need to access pubDate again, you have to start rescuing there too. and rescue for every access seems like an odd expense to pay but
* Eiam_ shrugs
<itgold> got it. And this way I don't have to use "rescue"
<Eiam_> djellemah: I was reading through it, seemed like a possible solution
<itgold> thank you, Eiam_
dellavg_ has joined #ruby
<Eiam_> djellemah: I figure I'm not the first person to have this question so I was wondering what peole were d oing
<Eiam_> itgold: thats correct that you do not. It's all trade offs. djellemah solution does some things, not others. mine has its own trade offs.
<Eiam_> using nil or empty strings or arrays to indicate state is "usually" a poor practice, because that state couuld be set ANYWHERE
<djellemah> Eiam: Somebody I know likes dotenv. I haven't really used it.
hahuang65 has joined #ruby
bruno- has joined #ruby
mikeharris22 has quit [Remote host closed the connection]
x-light has quit [Ping timeout: 250 seconds]
<Eiam_> djellemah: thanks.. so far it was the closest to what I was after.. scattered stuff in config.ru, sinatra.app and all my model/init.rb files so trying to centralize it in some places
devbug has quit [Read error: Connection reset by peer]
<Eiam_> Rake defines a DB, but so does Models/init.rb
Sceko has joined #ruby
<Eiam_> and so does config.ru =0
devbug has joined #ruby
<Eiam_> (all entry points into points of development or production!)
rikkipitt has quit [Remote host closed the connection]
minimalism has quit [Ping timeout: 255 seconds]
quazimodo has joined #ruby
Jerrod has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bMalum has joined #ruby
rikkipitt has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
bMalum has quit [Client Quit]
hxegon has quit [Ping timeout: 264 seconds]
tigarcia has joined #ruby
devoldmx has joined #ruby
A124 has quit [Quit: '']
rikkipitt has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 240 seconds]
willardg has joined #ruby
diegoaguilar has quit [Quit: Leaving]
diegoaguilar has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
tref has quit [Quit: tref]
uri_ has quit [Ping timeout: 250 seconds]
moeabdol1 has quit [Ping timeout: 246 seconds]
nfk|laptop has quit [Quit: yawn]
devoldmx has quit [Ping timeout: 246 seconds]
momomomomo_ has joined #ruby
Musashi007 has joined #ruby
dnomyar has quit [Ping timeout: 250 seconds]
skweek has quit [Quit: Leaving]
bruno- has quit [Ping timeout: 272 seconds]
momomomomo has quit [Ping timeout: 255 seconds]
momomomomo_ is now known as momomomomo
cdg has quit [Remote host closed the connection]
A124 has joined #ruby
jackjackdripper has quit [Ping timeout: 264 seconds]
roxtrongo has joined #ruby
htmldrum has joined #ruby
<Ox0dea> itgold: Still about?
lemondom_ has joined #ruby
lemondom_ has quit [Client Quit]
NeverDie has quit [Ping timeout: 268 seconds]
<itgold> so far ended up using rescue
<Ox0dea> 18>> require 'rss'; RSS::Rss::Channel::Item.instance_methods.grep /Date/
<ruboto> Ox0dea # => (https://eval.in/460401)
<Ox0dea> itgold: Well, that was a weird error, but the RSS standard library has had this #pubDate method on Item since 1.8, so your error must be in another castle.
patdohere has joined #ruby
sdfgsdfg has quit [Read error: Connection reset by peer]
<itgold> I see
bruno- has joined #ruby
lemondom has quit [Ping timeout: 240 seconds]
EllisTAA has quit [Quit: EllisTAA]
<Ox0dea> ~ $ chruby-exec 1.8 -- ruby -r rss -e 'p RSS::Rss::Channel::Item.instance_methods.grep /Date/'
<Ox0dea> ["pubDate", "pubDate="]
<Ox0dea> It's weird seeing method names returned as Strings, but there they are.
<Ox0dea> itgold: Can you think of any other dependencies you're using that might've mucked about in Item to remove that method?
<Eiam_> Ox0dea: hah, like some jerk monnkey patchin the class? =)
<Ox0dea> Eiam_: Just so. :P
_djbkd has quit [Remote host closed the connection]
<Eiam_> =)
<Ox0dea> Monkey-deletion is completely uncalled for, though.
<itgold> this is not my code, it is an rss plugin for logstash
NeverDie has joined #ruby
<itgold> this is the class that I'm patching
lemondom has joined #ruby
<lemondom> hi
<lemondom> can I instruct bundler to install one particular package not in vendor directory but in system directory?
_djbkd has joined #ruby
NeverDie has quit [Max SendQ exceeded]
Randroid has joined #ruby
NeverDie has joined #ruby
Randroid has quit [Client Quit]
zenguy_pc has quit [Ping timeout: 240 seconds]
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
Musashi007 has quit [Quit: Musashi007]
karapetyan has joined #ruby
tigarcia has quit [Remote host closed the connection]
stannard_ has quit [Remote host closed the connection]
trosborn has quit [Quit: trosborn]
<Ox0dea> itgold: How did you determine that you had an RSS::Rss::Channel::Item?
diego3 is now known as diegoviola
asianMike has quit [Remote host closed the connection]
<Ox0dea> When you were asked about its class, you said ":item=>RSS::Rss::Channel::Item", but how did you obtain that output?
Jackneill has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 252 seconds]
<itgold> @logger.info("#####################", :item => item.class)
<itgold> this is what I use to output an item.class
OrbitalKitten has joined #ruby
patdohere has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djstorm has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
symm- has joined #ruby
<itgold> {:timestamp=>"2015-10-30T22:13:01.871000+0000", :message=>"#####################", :item=>RSS::Rss::Channel::Item, :level=>:info, :file=>"logstash/inputs/rss.rb", :line=>"49", :method=>"run"}
<itgold> this is the output
allomov has quit [Remote host closed the connection]
inteq has quit [Remote host closed the connection]
<Ox0dea> Well, shit.
<Ox0dea> itgold: And if you log `item.respond_to?(:pubDate)`, you get `false`?
bMalum has joined #ruby
<itgold> let me try it
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tref has joined #ruby
<itgold> @logger.info("#####################", :item => item.respond_to?(:pubDate))
<itgold> {:timestamp=>"2015-10-30T22:17:18.621000+0000", :message=>"#####################", :item=>true, :level=>:info, :file=>"logstash/inputs/rss.rb", :line=>"49", :method=>"run"}
<itgold> it says - true
zenguy_pc has joined #ruby
htmldrum has quit [Ping timeout: 240 seconds]
diegoaguilar has joined #ruby
mikeharris22 has joined #ruby
<Ox0dea> itgold: Then you were mistaken in your conclusion that you were invoking #pubDate on an instance of RSS::Rss::Channel::Item.
DoubleMalt has quit [Remote host closed the connection]
TheNet has joined #ruby
<Ox0dea> itgold: Oh, you'll want to remove Eiam's patch and try again.
<itgold> how can we confirm that?
<itgold> I didn't do Eiam's patch
<Ox0dea> Then it's confirmed.
shun_ has joined #ruby
<itgold> but :item => item.class prints out :item=>RSS::Rss::Channel::Item
<hahuang65> when building a gem, is it possible to specify the output name?
<itgold> what does respond_to do?
mikeharris22 has quit [Remote host closed the connection]
mikeharris22 has joined #ruby
<shevy> itgold whether your object responds to the given method
<Ox0dea> hahuang65: Name your gemspec appropriately?
freerobby has quit [Quit: Leaving.]
<hahuang65> Ox0dea: what do you mean?
<Ox0dea> hahuang65: How are you building your gem?
<itgold> why respond_to(:pubDate) returns true but item.pubDate throws an exception?
<Ox0dea> > undefined method `pubDate' for #<RSS::RDF::Item:0x77913237>
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> itgold: That was the error you originally mentioned.
jericon has joined #ruby
<hahuang65> so I'm building it like `gem build my-gem.gemspec` and it outputs as `my-gem-0.0.1.gem` where I want to name it `my-gem.gem` without the version
<Ox0dea> itgold: Do you have an RSS:RDF::Item, or do you have an RSS::Rss::Channel::Item?
<itgold> ah, maybe. So this is another type of class?
<jericon> Is there any Ruby function that would give a result similar to mysql's "to_days" function (Days since year 0).
<Ox0dea> hahuang65: Why?
<Ox0dea> jericon: From what kind of input?
<shevy> hahuang65 interesting. you can get rid of the version suffix if you assign .version = ''
<shevy> but a trailing - will be kept :\
<hahuang65> Ox0dea: this is going in a Dockerfile and I don't want to change the version number in the Dockerfile each time we upgrade.
duncannz has joined #ruby
dfockler has joined #ruby
<hahuang65> shevy: hmmm that might be okay...
<itgold> let me check it again
duncannz has quit [Max SendQ exceeded]
minimalism has joined #ruby
<itgold> I'm seen :item=>RSS::Rss::Channel::Item
duncannz has joined #ruby
<jericon> Ox0dea: a dateTime. I'm working on a script to do some management in mysql with partitions. the partitions are done by to_days(now()) basically.
Lucky__ has joined #ruby
<shevy> hahuang65 you may possibly be the first one with such a request, you can file an issue request for being able to omit the "-version" suffix, or perhaps when .version = '' was set to empty specifically; issue requests can go to: https://github.com/rubygems/rubygems/issues
<Ox0dea> jericon: An instance of Ruby's DateTime, or?
<jericon> Ox0dea: yes.
<jericon> I can select that value from MySQL and store that in a ruby variable, but I was wondering if there was a function in ruby that would give me the same thing.
allomov has joined #ruby
<itgold> but an error says: Error: undefined method `pubDate=' for #<RSS::RDF::Item:0x4468f24f>\n Exception: NoMethodError\n Stack: /opt/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-input-rss-0.1.4/lib/logstash/inputs/rss.rb:56
lemondom has quit [Ping timeout: 244 seconds]
<itgold> why can't I do this to avoid this error: item.pubDate = item.pubDate rescue nil ?
lemondom has joined #ruby
<itgold> I want to initialize actually item.pubDate because it is used somewhere else down the chain
<itgold> instead of doing event["published"] = item.pubDate recover nil
<hahuang65> shevy: thanks :)
DiCablo has joined #ruby
<itgold> probably I should do Eiam's solution to make it right
gregoriokusowski has quit [Quit: gregoriokusowski]
<Ox0dea> itgold: You should determine why you have an RSS::RDF::Item even though your log says you have an RSS::Rss::Channel::Item.
karapetyan has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
karapetyan has joined #ruby
shun_ has quit []
htmldrum has joined #ruby
stamina has quit [Ping timeout: 264 seconds]
TheNet has quit [Remote host closed the connection]
Musashi007 has joined #ruby
<Ox0dea> >> require 'date'; (DateTime.now - DateTime.new(0)).to_i
<ruboto> Ox0dea # => 736268 (https://eval.in/460402)
<Ox0dea> jericon: ^
<jericon> Ox0dea: perfect, thanks
<Ox0dea> jericon: Sure thing.
<jericon> It seems to be 2 days off of what MySQL is giving me, but I should be able to fiddle with it to see if I can't make it right.
<jericon> MySQL gives 736266
karapetyan has quit [Ping timeout: 250 seconds]
<Ox0dea> Lovely.
<jericon> and this is why I told my devs to use the format 'yyyymmdd' instead of this "days from beginning of time" thing. :(
<Ox0dea> Alas, MySQL is probably right. Or maybe they're just using a different calendar.
<Ox0dea> !xkcd 1179 @ jericon
<itgold> Ox0dea: what might be the reason for that?
<Ox0dea> itgold: You've got a much better vantage point for answering that question than I do.
rikkipitt has joined #ruby
sphex has joined #ruby
theery has joined #ruby
seitensei has joined #ruby
ta has joined #ruby
sphex_ has quit [Ping timeout: 240 seconds]
allomov has quit [Remote host closed the connection]
dfinninger has quit [Remote host closed the connection]
mallu has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
_djbkd has quit [Remote host closed the connection]
_blizzy_ has quit [Ping timeout: 256 seconds]
<itgold> got it, thank you Ox0dea
<dorei> iso 8601 is cultural imperialism xD
Musashi007 has quit [Quit: Musashi007]
sankaber has joined #ruby
<Ox0dea> dorei: Imposed upon whom by whom?
<Ox0dea> itgold: Did you get it sorted, then?
<dorei> the way one writes a date is locale based
<itgold> looks like in some cases I'm seen item=>RSS::RDF::Item
<Ox0dea> >> require 'date'; 2015 * 365 + 2015.times.count { |y| DateTime.new(y).leap? } + Time.now.yday # jericon
<ruboto> Ox0dea # => 736279 (https://eval.in/460404)
<Ox0dea> They're both wrong. :P
<Ox0dea> Something to do with the switch to Julian, I'm sure.
Musashi007 has joined #ruby
<Ox0dea> *Gregorian
<jericon> Probably. I'll probably just use the first example you gave and add a -2 until I can figure out a better way to get it. Or just select it out of MySQL and use that value.
<itgold> so it is just the matter of instance type that is getting used. I'm getting both types from different sources
craysiii has quit [Remote host closed the connection]
htmldrum has quit [Ping timeout: 265 seconds]
A124 has quit [Quit: '']
<itgold> and the problem is only with this class: RSS::RDF::Item
lemondom_ has joined #ruby
A124 has joined #ruby
<Eiam> yeah, those types are different because your objects are different
<Eiam> gotta run
mary5030 has quit [Remote host closed the connection]
<itgold> Ox0dea: :item => item.respond_to?(:pubDate) resolves to false in case of this is RSS::RDF::Item
lemondom has quit [Ping timeout: 244 seconds]
mary5030 has joined #ruby
<itgold> another mystery solved :)
<Ox0dea> itgold: Aye, that has well been established. :P
asianMike has joined #ruby
<Ox0dea> momomomomo: Perturbations?
_djbkd has joined #ruby
<momomomomo> Ox0dea: when thinking about mysql, yes
trosborn has joined #ruby
<itgold> how do I check if my instance if of type RSS::RDF::Item ?
jamesaxl has quit [Ping timeout: 246 seconds]
<itgold> how do I check if my instance is of type RSS::RDF::Item ?
<momomomomo> paste it again, maybe it'll work
<itgold> it almost helped :)
<lemondom_> hi
<lemondom_> can I instruct bundler to install one particular package not in vendor directory but in system directory?
<lemondom_> ---
<jhass> lemondom_: no, --path is all or nothing
<lemondom_> damn
<lemondom_> any trick?
<jhass> no, why is it important?
_djbkd has quit [Remote host closed the connection]
<momomomomo> >> module MyModule; class MyClass; end; end; a = MyModule::MyClass.new; puts a.class == MyModule::MyClass
<ruboto> momomomomo # => true ...check link for more (https://eval.in/460405)
<momomomomo> itgold: ^
_djbkd has joined #ruby
mary5030 has quit [Ping timeout: 252 seconds]
juanpablo__ has quit [Quit: (null)]
<jhass> itgold: I'd rather go for is_a? or a case/when
<momomomomo> : >> module MyModule; class MyClass; end; end; a = MyModule::MyClass.new; puts a.is_a? MyModule::MyClass
<momomomomo> :|
<momomomomo> >> module MyModule; class MyClass; end; end; a = MyModule::MyClass.new; puts a.is_a? MyModule::MyClass
<ruboto> momomomomo # => true ...check link for more (https://eval.in/460406)
_djbkd has quit [Client Quit]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shadoi has quit [Quit: Leaving.]
<jhass> itgold: though continung to duck type (respond_to?) on the method you want to call might be even better
jason^ has quit [Ping timeout: 256 seconds]
rikkipitt has quit [Remote host closed the connection]
mary5030 has joined #ruby
<jhass> lemondom_: so? your actual problem is a secret?
dfinninger has joined #ruby
mary5030 has quit [Remote host closed the connection]
<itgold> thank you, guys
mary5030 has joined #ruby
quazimodo has joined #ruby
benlieb has joined #ruby
jobewan has quit [Quit: Leaving]
podman has quit [Quit: Connection closed for inactivity]
<itgold> item.pubDate = item.pubDate rescue ""
quazimodo has quit [Ping timeout: 265 seconds]
<shevy> wat
<shevy> how do you come up with this
<jhass> itgold: please don't
<itgold> this thing throws an error :(
<jhass> forget modifier rescue is even a thing. now
<itgold> oh no :(
<jhass> itgold: good, it's a bad idea anyhow
<itgold> Error: undefined method `pubDate=' for #<RSS::RDF::Item:0x11212ba5>
nettoweb has joined #ruby
<itgold> I just want to initialize item.pubDate if it doesn't exists with the default value
<jhass> the class you got doesn't allow that
<itgold> oh
<itgold> so I have to define my own class?
bruno- has quit [Ping timeout: 256 seconds]
<jhass> I didn't read backlog, so I have no idea what you're doing
bruno- has joined #ruby
<zenspider> what? I... what?
<shevy> hah
_blizzy_ has joined #ruby
<zenspider> itgold: per your original question: checking types is generally a code smell
<itgold> I'm trying to monkeypatch an RSS plugin for logstash that throws an error if there is no field pubDate declared in a specific feed
momomomomo has quit [Quit: momomomomo]
<itgold> yeah, I know. I just want to patch damn thing
<zenspider> sounds like a mistake to me... but raise "blah" unless item.pubDate.is_a? Whatever
<zenspider> or even raise "blah" unless item.pubDate (assumes nil returned when not set)
ibouvousaime has quit [Ping timeout: 260 seconds]
<itgold> how do I do this?
<jhass> I think they want to swallow rather than raise
<jhass> itgold: what's the original line raising an error?
<itgold> yes, shallow would work better
baroquebobcat has quit [Quit: baroquebobcat]
<jhass> itgold: what should happen instead?
dfockler has quit [Quit: Leaving]
<itgold> right here line 74
trosborn has quit [Quit: trosborn]
bruno- has quit [Ping timeout: 255 seconds]
<itgold> I just want to pass in an empty value into the response
<jhass> mmh, wth is Element here anyway https://github.com/ruby/ruby/blob/trunk/lib/rss/1.0.rb#L377
<fibbel> itgold perhaps adding a Contract would be a simple solution https://github.com/egonSchiele/contracts.ruby/blob/master/TUTORIAL.md
<jhass> fibbel: seems random and overkill
riotjone_ has joined #ruby
<Ox0dea> itgold: It seems the author of that Logstash plugin just didn't account for the fact that RSS::Parser.parse(foo).feed_type == 'rss', even if `foo` was actually an RDF feed.
<itgold> yeah, I'd like to avoid introducing additional libraries
ibouvousaime has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
<itgold> maybe
<itgold> so Ruby is a dynamic language, can I do this default value initialization?
TheNet has joined #ruby
<itgold> on the instance level
riotjon__ has quit [Ping timeout: 246 seconds]
<Ox0dea> itgold: `def item.pubDate; :whatever; end`, and may the fates have mercy on your foot.
<jhass> that's a horrible suggestion
<Ox0dea> It's what the customer wants.
<zenspider> "how do I do this" ?
finisherr has quit [Quit: finisherr]
<itgold> even horrible would work for me, guys :)
wldcordeiro has quit [Ping timeout: 272 seconds]
<jhass> well, pretty sure they want to keep the data if present
naftilos76 has quit [Remote host closed the connection]
<Ox0dea> Oh, I forgot that part.
<jhass> looks like a method_missing hook, meh
<Ox0dea> itgold: Are you sure you don't want to figure out why you're getting RSS::RDF::Items where you're expecting RSS::Rss::Channel::Items?
<jhass> the rss stdlib is horrible, who did ever accept that in?
<zenspider> standards were lower 15 years ago :)
<zenspider> I would love to see a revamping of stdlib
<itgold> Ox0dea: I think I've figured out. This method just accept both types. And it breaks on RSS::RDF::Items
<jhass> Item or Items?
<jhass> both exist
<Ox0dea> Lovely.
<itgold> Items is a list of item variables
<fibbel> itgold: so the issue is line 74 errors if the datasource doesn’t have pubDate?
<itgold> yes, if item.pubDate is undefined
<fibbel> and you can’t fork that code and submit a patch with a “.try(:pubDate) || Time.now” ?
<fibbel> or whatever the time should be
<fibbel> * er pubDate
<jhass> fibbel: you checked activesupport is loaded?
<Ox0dea> itgold: That branch of the `case` statement wouldn't be executed if `feed.feed_type` weren't returning "rss" when it probably shouldn't.
<fibbel> ah jhass yes spoiled by rails
<fibbel> so this is ruby only?
<itgold> I think this is ruby only
firstdayonthejob has quit [Ping timeout: 240 seconds]
devoldmx has joined #ruby
<jhass> itgold: okay, no method_missing magic after all, RSS09::Item and RSS20::Item alias date to pubDate, however RDF does define date too
<jhass> itgold: so item.date instead of item.pubDate should work
<itgold> and I'm looking at Ruby code second time in my life, so I'm just noob, sorry
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dellavg_ has quit [Ping timeout: 260 seconds]
tref has quit [Quit: tref]
<itgold> jhass, interesting, I can give it a try. But I believe it might depend on a specific rss feed that I'm working with. Some of them has pubDate some not
mary5030 has quit [Remote host closed the connection]
alfie_max15 has joined #ruby
<jhass> yeah, I just explained why and that I think all of them have data and that pubDate is the same as date for all that have pubDate
mary5030 has joined #ruby
<jhass> s/data/date/
<fibbel> itgold: curious does the rss feed validate? https://validator.w3.org/feed/
rcvalle has quit [Quit: rcvalle]
<itgold> Congratulations! [Valid RSS] This is a valid RSS feed.
<fibbel> k
alfie_max15 has left #ruby [#ruby]
<jhass> fibbel: there's no method_missing magic, so it's dependent on what class RSS::Parser.parse returns, not the data directly
<itgold> and it looks like Ox0dea's solution worked!
<jhass> itgold: please, please try my solution and prefer it
<jhass> if it works
pwnd_nfsw has joined #ruby
<itgold> :)
<jhass> if not I have another better one still
noodle has quit [Ping timeout: 240 seconds]
<itgold> if item.class == RSS::RDF::Item def item.pubDate; "" end def item.author; "" end end
<jhass> itgold: yes, that's actually really horrible
<itgold> :))
jefus has left #ruby ["Leaving"]
<zenspider> why?!?
<itgold> what do you want me to do with it?
<zenspider> you'd rather have no date at all... wtf
pwnd_nsfw has quit [Ping timeout: 240 seconds]
dopie has quit [Quit: Leaving]
<jhass> itgold: throw it away, go back to the version on github
<jhass> itgold: replace item.pubDate with item.date
akkad has quit [Excess Flood]
<itgold> author also breaks the same way
akkad has joined #ruby
mary5030 has quit [Ping timeout: 252 seconds]
<itgold> let me try date
<jhass> itgold: replace item.author with item.respond_to?(:author) ? item.author : "" then
noodle has joined #ruby
shazaum_ has joined #ruby
TheNet_ has joined #ruby
<itgold> jhass, I don't like that
I has joined #ruby
I has quit [Remote host closed the connection]
<jhass> itgold: now I'm thrilled on hearing your arguments against using the author if available
tref has joined #ruby
SenpaiSilver has quit [Quit: Leaving]
<zenspider> this has flipped my bozo bit.
to_json has quit [Quit: Leaving.]
<zenspider> non-bozo \ bozo
<zenspider> non-bozo / bozo
<itgold> I want to modify an original object, if I just pass in pubDate and author in this particular case to an event it is trowing an error somewhere else down the invocation chain
TheNet has quit [Ping timeout: 264 seconds]
<jhass> ?!
<jhass> easy
<jhass> two invocations
Channel6 has quit [Quit: Leaving]
<jhass> there's no passing along of item anywhere
<itgold> it is throwing an error from another class, looks like somebody else is holding a reference
Musashi007 has joined #ruby
<jhass> as said, item is not passed anywhere, neither is feed
TheNet has joined #ruby
<jhass> from everything you've shown at least
Musashi007 has quit [Client Quit]
TheNet_ has quit [Read error: Connection reset by peer]
purplexed- has quit [Ping timeout: 240 seconds]
<itgold> yes, you are right
<itgold> maybe it is parsing an input source somewhere else
htmldrum has joined #ruby
patdohere has joined #ruby
pwnd_nfsw has quit [Ping timeout: 246 seconds]
towski_ has quit [Remote host closed the connection]
<TheNet> eam: hey thanks for the benchmark suggestion earlier regarding debug logging! I ran a benchmark and found that passing a block into the debug method was faster than both sprintf, and no block (except of course when debug was enabled where the standard, no block no sprintf method ruled supreme).
<zenspider> TheNet: may I see?
<itgold> yeah, it is still failing even if I modify original object
<itgold> Plugin: <LogStash::Inputs::Rss interval=>1800, url=>\"http://www.checkpoint.com/defense/advisories/public/smartdefense_atomz.xml\", tags=>[\"rss\"], type=>\"checkpoint\", debug=>false, codec=><LogStash::Codecs::Plain charset=>\"UTF-8\">>\n Error: value <Sat, 7 Mar 2015 0:30:37 UTC> of tag <pubDate> is not available.\n Exception: RSS::NotAvailableValueError\n Stack: /opt/logstash-1.5.4/vendor/jruby/lib/ruby/1.9/rss/0.9.rb:107:in `pubD
whippythellama has quit [Quit: WeeChat 1.3]
<zenspider> all of the items in that feed have pubDate entries
<jhass> itgold: post the full output to gist.github.com
htmldrum has quit [Ping timeout: 246 seconds]
<jhass> itgold: you're lucky that your client truncated the message
bigmac_ has quit [Ping timeout: 240 seconds]
<zenspider> and that datetime parses w/ Time.parse
DEA7TH has quit [Quit: DEA7TH]
cajone has left #ruby [#ruby]
Yiota has quit [Ping timeout: 260 seconds]
arthurix has joined #ruby
patdohere has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zenspider> ah. it isn't rfc 2822 compliant
cwong_on_irc has quit [Quit: Leaving.]
<zenspider> >> require "time"; p Time.rfc822 "Sat, 7 Mar 2015 0:30:37 UTC"
<ruboto> zenspider # => not RFC 2822 compliant date: "Sat, 7 Mar 2015 0:30:37 UTC" (ArgumentError) ...check link for more (https://eval.in/460427)
<itgold> here is it
dfinninger has quit [Remote host closed the connection]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arthurix_ has quit [Ping timeout: 250 seconds]
slawrence00 has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
theery has quit [Remote host closed the connection]
PaulCape_ has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
cajone has joined #ruby
pwnd_nfsw has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
FernandoBasso has quit [Quit: WeeChat 1.3]
PaulCapestany has quit [Ping timeout: 264 seconds]