<zenspider>
that is some really bad ruby code for trolling
<zenspider>
you can really improve it if you just try a bit
milardovich has joined #ruby
pb122-two has quit [Read error: Connection reset by peer]
milardovich has quit [Ping timeout: 268 seconds]
<eightlimbed>
Hello, I'm new to Ruby (and programming in general) and was wondering if someone can look at this method I wrote that removes any duplicate words in a string, and suggest a more efficient way to write it. (Besides .uniq). I'm trying to get better at iterating with blocks instead of using while loops. Here is the gist: https://gist.github.com/eightlimbed/c37387d7dab92b45c7697f573e1d702b
hardest has joined #ruby
ignarps has quit [Read error: Connection reset by peer]
kappa has quit [Remote host closed the connection]
<zenspider>
eightlimbed: and do you want to stick with the datatypes and algorithm you're using?
<zenspider>
hardest: it's xml. I find that hard to believe
<eputnam_>
eightlimbed: you might also look into Array.each
<eightlimbed>
zenspider: i'm open to suggestions
<eputnam_>
which would change the algorithm
<zenspider>
eightlimbed: I'd start with replacing your while loops. look up what a range is and then you can call #each on the range of indicies you want
<zenspider>
eightlimbed: try `ri Range.each` in your terminal for starters
<zenspider>
and the code samples there will get you on your way
Silthias has joined #ruby
<eightlimbed>
eputname_: thanks for the response. something like.. arr.each {|word| #code that checks if |word| == next word, if so it removes it } ?
hardest has quit [Quit: Page closed]
TheTFEF is now known as Nightmare
<zenspider>
awww. hardest... I was just about to prove you wrong
<zenspider>
I'm recompiling nokogiri right now
<eightlimbed>
zenspider: "Nothing known about Range" is what was returned when I typed 'ri Range.each'
<eputnam_>
eightlimbed: i’ll put a comment on the gist
<zenspider>
eightlimbed: cool. that's the first thing to fix... how'd you get your ruby?
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
foul_owl has joined #ruby
<foul_owl>
I installed rbenv, ruby-build, and ruby 2.2.0 via rbenv. I then tried to set the ruby version via: rbenv global 2.2.0, but ruby --version still reports the system version
nanoz has quit [Ping timeout: 240 seconds]
drcode has joined #ruby
MichaelBurge has quit [Remote host closed the connection]
<foul_owl>
Ah nevermind, rbenv wasn't getting init from my shell, sorry about that
boringcp1 has joined #ruby
boringcpg has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
romank has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
romank has joined #ruby
pandaant has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 268 seconds]
SaschaVoid has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
blackmesa has joined #ruby
tildes has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ta_ has quit [Remote host closed the connection]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
SteenJobs has joined #ruby
minimalism has quit [Quit: minimalism]
muelleme has joined #ruby
mathys has joined #ruby
xall has quit [Ping timeout: 246 seconds]
|RicharD| has joined #ruby
romank has quit [Read error: Connection reset by peer]
TomyLobo has joined #ruby
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
muelleme has quit [Ping timeout: 260 seconds]
romank has joined #ruby
<ViolentR>
Can anyone help me ? i have an issue with gem Faraday trying to authenticate with user and password
nobitanobi has joined #ruby
patarr has joined #ruby
<ViolentR>
like so conn.post('api/sessions', user_credentials)
<ViolentR>
i have Basic Authentication is done fore that
blackmesa has quit [Ping timeout: 240 seconds]
<ViolentR>
before that
nobitanobi has quit [Ping timeout: 240 seconds]
romank has quit [Read error: Connection reset by peer]
patarr has quit [Ping timeout: 240 seconds]
arquebus has joined #ruby
arquebus has quit [Max SendQ exceeded]
arquebus has joined #ruby
arquebus has quit [Max SendQ exceeded]
Mon_Ouie has joined #ruby
arquebus has joined #ruby
romank has joined #ruby
oborot_ has joined #ruby
Puffball has quit [Remote host closed the connection]
SteenJobs has quit [Quit: SteenJobs]
romank has quit [Read error: Connection reset by peer]
Puffball has joined #ruby
romank has joined #ruby
oborot_ has quit [Ping timeout: 240 seconds]
jgt3 has joined #ruby
romank has quit [Read error: Connection reset by peer]
aupadhye has joined #ruby
<zenspider>
ViolentR: you probably want the rails channel
romank has joined #ruby
Bilge has joined #ruby
Bilge- has quit [Ping timeout: 255 seconds]
arquebus has quit [Quit: Leaving]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
mathys has quit [Quit: Leaving]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
SloggerKhan has quit [Read error: Connection reset by peer]
<esObe>
hi guys, I'm doing ruby koans and I have a problem with one method
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
dstrunk has quit [Client Quit]
oborot has quit [Ping timeout: 260 seconds]
b0mbnet has quit [Remote host closed the connection]
lxsameer has joined #ruby
joelwallis has quit []
DoubleMalt has joined #ruby
romank has quit [Read error: Connection reset by peer]
ViolentR has joined #ruby
jgt3 has joined #ruby
belmoussaoui has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
romank has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
jgt3 has quit [Ping timeout: 240 seconds]
belmoussaoui has quit [Ping timeout: 245 seconds]
romank has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
SaschaVoid has quit [Ping timeout: 255 seconds]
xall_ has quit [Ping timeout: 240 seconds]
romank has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
romank has quit [Read error: Connection reset by peer]
jrafanie has joined #ruby
romank has joined #ruby
Bilge has quit [Quit: B]
nobitanobi has joined #ruby
Bilge has joined #ruby
nobitanobi has quit [Ping timeout: 240 seconds]
bkxd_ has quit [Ping timeout: 240 seconds]
Qchmqs__ has joined #ruby
jgt3 has joined #ruby
quobo has joined #ruby
Qchmqs__ is now known as Qchmqs
KnownSyntax has quit [Ping timeout: 246 seconds]
|RicharD| has quit [Quit: Sto andando via]
KnownSyntax has joined #ruby
ledestin has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
Guest47514 has joined #ruby
DeeJayh has joined #ruby
leah2 has joined #ruby
ResidentBiscuit has joined #ruby
jgt3 has quit [Read error: Connection reset by peer]
sonOfRa has quit [Changing host]
sonOfRa has joined #ruby
muelleme has joined #ruby
Guest47514 is now known as ceglarek
ResidentBiscuit has quit [Ping timeout: 258 seconds]
Qchmqs__ has joined #ruby
bkxd has joined #ruby
ceglarek has left #ruby ["ERC (IRC client for Emacs 25.1.1)"]
blackmesa has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
SaschaVoid has joined #ruby
Qchmqs has quit [Ping timeout: 240 seconds]
romank has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
romank has joined #ruby
bmurt has joined #ruby
DeeJayh-L has quit [Read error: Connection reset by peer]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
romank has quit [Read error: Connection reset by peer]
DeeJayh has quit [Ping timeout: 260 seconds]
belmoussaoui has quit [Ping timeout: 260 seconds]
belmoussaoui has joined #ruby
romank has joined #ruby
sepp2k has joined #ruby
volty has joined #ruby
aswen has joined #ruby
milardovich has quit []
aswen has quit [Quit: WeeChat 1.6]
romank has quit [Read error: Connection reset by peer]
houhoulis has joined #ruby
bpmedley has joined #ruby
b0mbnet has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has joined #ruby
belmoussaoui has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
romank has joined #ruby
bmurt has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
uZiel has quit [Ping timeout: 255 seconds]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
eightlimbed has joined #ruby
romank has quit [Read error: Connection reset by peer]
vahe has joined #ruby
kitikonti has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ovaltine>
What would be the most idiomatic way to find, given a hash with symbol keys and array of string values, the key that points to an array containing a given string? just select?
npgm has quit [Quit: Connection closed for inactivity]
romank has joined #ruby
doublemalt_ has joined #ruby
nobitanobi has joined #ruby
nobitanobi has quit [Client Quit]
eightlimbed has quit [Ping timeout: 240 seconds]
lordarkmemo has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
SaschaVoid has quit [Quit: die();]
morfin has joined #ruby
<morfin>
hello
<morfin>
i found bunch of patches to compile 2.3.0 with OpenSSL 1.1 but not sure is that right thing to do?
<juancpgo>
Sorry for the stupidity, but is it fair to say that everything in any piece of Ruby code other than operators, string contents and comments is a Ruby identifier?
<Elitas>
pretty much
Fernando-Basso has joined #ruby
<juancpgo>
mm thanks for the quick reply Elitas
BSaboia has quit [Ping timeout: 246 seconds]
t-recx has joined #ruby
eputnam_ has joined #ruby
<leah2>
keywords?
<leah2>
other literals
<leah2>
stuff after __END__
houhoulis has joined #ruby
morfin has quit []
sepp2k has quit [Read error: Connection reset by peer]
<juancpgo>
I think keywords are identifiers, right? At least it says so in the book I'm reading
lordarkmemo has quit [Quit: Leaving.]
romank has quit [Read error: Connection reset by peer]
lordarkmemo has joined #ruby
<leah2>
not sure that would make sense to say
<leah2>
>> class = 6
<ruby[bot]>
leah2: # => /tmp/execpad-21d07d17efc0/source-21d07d17efc0:2: syntax error, unexpected '=' ...check link for more (https://eval.in/802005)
ResidentBiscuit has quit [Remote host closed the connection]
<lupine>
>> local_variable_set("class", 6)
<ruby[bot]>
lupine: # => undefined method `local_variable_set' for main:Object ...check link for more (https://eval.in/802006)
<lupine>
aww
Qchmqs__ has quit [Quit: Konversation terminated!]
DeeJayh has joined #ruby
romank has joined #ruby
<juancpgo>
It says so in the book “The Well Grounded Rubyist", but I can't find another source to confirm that, maybe it's just in this book
PatrikasZvaigzde has quit [Quit: Leaving]
<leah2>
lupine: i guess that works...
nadir has joined #ruby
romank has quit [Read error: Connection reset by peer]
<leah2>
hm
User458764 has joined #ruby
lordarkmemo has quit [Ping timeout: 255 seconds]
<leah2>
>> def class(); "perhaps dblack is right"; end; self.class()
<ruby[bot]>
leah2: # => /tmp/execpad-471647fd25c7/source-471647fd25c7:4:in `rescue in <main>': private method `class' called ...check link for more (https://eval.in/802013)
<lupine>
>> define_method("class") { "oh" } ; class
<ruby[bot]>
lupine: # => /tmp/execpad-96ed57275906/source-96ed57275906:3: syntax error, unexpected modifier_rescue ...check link for more (https://eval.in/802014)
<Papierkorb>
Mh I don't know which channel to relay abuse/spam to on Freenode
<morfin>
#freenode
<leah2>
#devnull has more helpful ops :P
DLSteve has joined #ruby
nullfxn has quit [Client Quit]
al2o3-cr has joined #ruby
Jerdent has quit [Quit: Jerdent]
morfin has quit []
morfin has joined #ruby
bmurt has joined #ruby
muelleme has joined #ruby
dn` has joined #ruby
jamesaxl has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
rkazak has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
milardovich has joined #ruby
MarkBilk has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
aljmo has joined #ruby
moei has joined #ruby
yogg-saron has joined #ruby
DeeJayh has joined #ruby
<MarkBilk>
Hi! I'm trying to use the gem hpricot. I haven't programmed in Ruby for years and that was in Linux. Now I'm stuck in Windows 8.1. My Ruby directory is called Ruby23. irb works. The instructions for hpricot say to install it by: gem install hpricot
<MarkBilk>
I do this in irb and get an error message: NameError: undefined local variable or method `hpricot' for main:Object Help, please.
<zachk>
gem install thegemyouwant from the command prompt
<zachk>
not irb
blackmesa has quit [Ping timeout: 260 seconds]
kitikonti has joined #ruby
<MarkBilk>
Thanks!
<zachk>
you are welcome :D
majuk has quit [Remote host closed the connection]
<MarkBilk>
ERROR: Could not find a valid gem 'hpricot' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
<kappa>
hi. i have some question, it seems canvas.bind('Button', proc{|event| puts 'hi'}, "+") isnt working as expected, i have other callback mapped to Button event but it gets removed when i add this other one despite of using "+"
<kappa>
some idea?
Jerdent has joined #ruby
justinweiss has quit [Quit: Connection closed for inactivity]
User458764 has joined #ruby
aljmo has quit [Ping timeout: 260 seconds]
sepp2k has joined #ruby
minimalism has joined #ruby
<newrubycoder>
anyone here knows a thing or 2 about the .net framework and how to use it with ruby?
Jerdent has quit [Quit: Jerdent]
kegster has quit [Quit: Shiner, TX makes good beer.]
bronson has joined #ruby
nofxxx has quit [Ping timeout: 272 seconds]
<eputnam_>
MarkBilk: i’ve heard of that before, windows specific
aljmo has joined #ruby
<eputnam_>
have you tried installing hpricot from a local gem?
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
xall has quit [Quit: xall]
<MarkBilk>
eputnam_: got it!
<eputnam_>
MarkBilk: dope!
bheesham has quit [Ping timeout: 260 seconds]
aljmo_ has joined #ruby
Guest82871 is now known as Tristan-Speccy
aljmo has quit [Ping timeout: 246 seconds]
Ove_ has left #ruby [#ruby]
<MarkBilk>
eputnam_: When I used the -local or /local option I got the same SSL error. Without the option I got: ERROR: While executing gem ... (Gem::Exception) Unable to find spec for #<Gem::NameTuple hpricot, 0.8.6, x86-mswin32>
aljmo__ has joined #ruby
milardovich has quit [Remote host closed the connection]
aljmo_ has quit [Ping timeout: 268 seconds]
<eputnam_>
MarkBilk: the argument needs to actually be the path to the downloaded gem
<eputnam_>
in case you’re just putting the gem name
ecuanaso has joined #ruby
eightlimbed has joined #ruby
nofxxxx has joined #ruby
KeyJoo has quit [Remote host closed the connection]
<MarkBilk>
eputnam_: Giving complete path. With -local it says: invalid option: -ocal With /local it looks for a gem "/local" and gives the SSL error. With no option it gives: ERROR: While executing gem ... (Gem::Exception)
<MarkBilk>
Unable to find spec for #<Gem::NameTuple hpricot, 0.8.6, x86-mswin32>
<eputnam_>
it’s two hyphens in front of “—local”, sorry my client keeps merging htem
<MarkBilk>
Installing ri documentation for rubygems-update-2.6.12
<MarkBilk>
Parsing documentation for rubygems-update-2.6.12
milardovich has joined #ruby
<MarkBilk>
Thought it was hung, but it completed!
<MarkBilk>
Now for the tricky bit...
jgt has joined #ruby
<MarkBilk>
Unable to find spec for #<Gem::NameTuple hpricot, 0.8.6, x86-mswin32>. gem --version 2.5.1!!!
SteenJobs has quit [Quit: SteenJobs]
<MarkBilk>
Don't tell me I have to reboot the computer!
<eputnam_>
hmmm
dionysus69 has quit [Ping timeout: 240 seconds]
<MarkBilk>
I downloaded and used the update gem because I wouldn't know where to put whatever is in the zipfile.
jenrzzz has quit [Ping timeout: 268 seconds]
<MarkBilk>
I wouldn't mind tossing the Ruby 2.3 and getting a better one if that would help.
DeeJayh has joined #ruby
<eputnam_>
no, i do think that rubygems might be the issue
bernd27 has joined #ruby
<MarkBilk>
But hpricot is 5 or 6 years old and I thought that an older version of rubygems might be better suited to it. But this one can't update itself.
<MarkBilk>
Hey maybe cmd.com has the old version in cache.
<MarkBilk>
how do you do rehash in Windows?
milardovich has quit [Remote host closed the connection]
jackrandom has quit [Ping timeout: 260 seconds]
milardovich has joined #ruby
<eputnam_>
MarkBilk: i’m not sure actually, i haven’t run windows in years
<eputnam_>
this is getting out of my wheelhouse
<MarkBilk>
Seems unlikely that gem would say it successfully updated and then not do it.
milardovich has quit [Ping timeout: 240 seconds]
jaegerca has joined #ruby
<eputnam_>
MarkBilk:
<eputnam_>
that is odd
bheesham has quit [Ping timeout: 240 seconds]
<jaegerca>
So lets say I have a model called Community::House, and I have CRUD setup for it in the admin, the path for a new Community::House is new_admin_community_house_path, but when I try to use it in a form like this [:admin, @house] it tries to create a new_admin_community_house which means I can't use this [:admin, @house] convention for both a new and edit form, anyone have any tricks to deal with this?
<jaegerca>
Oops, the actual path is new_admin_house_path
<jaegerca>
The one it's creating is new_admin_community_house
tristanp has quit [Remote host closed the connection]
tristanp has joined #ruby
<MarkBilk>
eputnam_: gem and gem.cmd were read-only and had same old dates as other files. Trying update again.
tristanp has quit [Ping timeout: 260 seconds]
<MarkBilk>
eputnam_: I can't change the permissions. How do you become superuser in Windows?
<eputnam_>
you can right-click command prompt or powershell and “run as administrator” i think
DeeJayh has quit [Ping timeout: 240 seconds]
<MarkBilk>
right-click just gives me a menu for copy, paste etc
<eputnam_>
MarkBilk: i wish i could help more but i’m not sure
SteenJobs has joined #ruby
<MarkBilk>
got an answer from google
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<eputnam_>
MarkBilk what was it?
jcao219 has quit [Ping timeout: 260 seconds]
<MarkBilk>
hold on, didn't make sense, trying another
bernd9000 has joined #ruby
blackmesa has joined #ruby
eputnam_ has quit [Quit: eputnam_]
bernd27 has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
bheesham has joined #ruby
minimalism has quit [Quit: minimalism]
milardovich has joined #ruby
minimalism has joined #ruby
<MarkBilk>
The control panel says I aleady AM admin.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bheesham has quit [Ping timeout: 240 seconds]
<MarkBilk>
The Ruby23 directory says read-only -- applies only to files within the directory. I unset read-only, but it comes back.
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
milardovich has quit [Remote host closed the connection]
<dcluna>
getting "NoMethodError: undefined method `example_group_instance' for #<Proc:0x00000003dae208>" in an innocent-looking spec. Pry-rescue shows a weird stack trice. Can someone help?
aerth has joined #ruby
patr0clus has quit [Ping timeout: 255 seconds]
aerth has left #ruby [#ruby]
eightlimbed has quit [Ping timeout: 268 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MrSparkle has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
MrSparkle has joined #ruby
milardovich has quit [Ping timeout: 268 seconds]
KnownSyntax has quit [Read error: Connection reset by peer]
<canton7>
thisguy1_, it's something weird to do with Nokogiri::XML::Element. It's as if Element's initialize method isn't virtual, and isn't getting overridden by CraigslistPost's initialize method - the two exist side by side in some weird way, and the runtime gets confused about which to dispatch to. Maybe due to the fact that Nokogiri has native bits to it? I can't find where Element is defined in their source
<canton7>
thisguy1_, (btw, the idiomatic way to write that test would be `raise "Must ..." unless html.is_a?(Nokogiri::XML::Element)`
enterprisey has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
<thisguy1_>
canton7: thanks for the info and tip
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
KnownSyntax has joined #ruby
milardovich has joined #ruby
enterprisey has joined #ruby
BSaboia has quit [Ping timeout: 246 seconds]
BSaboia has joined #ruby
MrSparkle has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
belmoussaoui__ has quit [Ping timeout: 246 seconds]
MrSparkle has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
alveric4 has joined #ruby
patr0clus has joined #ruby
alveric3 has quit [Ping timeout: 260 seconds]
muelleme has quit [Ping timeout: 246 seconds]
morfin has quit []
bheesham has joined #ruby
milardovich has joined #ruby
BSAlb has joined #ruby
bheesham has quit [Ping timeout: 240 seconds]
BSaboia has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
skweek has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
<MarkBilk>
Is there a good tutorial for using nokogiri for HTML? They all seem to be for XML only. (I wanted to use hpricot but the gem won't load in Windows.)
dlitvak has quit [Quit: Connection closed for inactivity]
DeeJayh has joined #ruby
nowhere_man has joined #ruby
BSaboia has joined #ruby
eckhardt has joined #ruby
MrSparkle has quit [Ping timeout: 268 seconds]
thisguy1_ has quit [Remote host closed the connection]
dlitvak has joined #ruby
stupidsenpai has joined #ruby
<stupidsenpai>
Does anyone have any experience with rets?
MrSparkle has joined #ruby
bkxd has joined #ruby
skweek has joined #ruby
t-recx has quit [Quit: t-recx]
BSAlb has joined #ruby
BSaboia has quit [Ping timeout: 268 seconds]
Bhootrk_ has joined #ruby
rgr_ has quit [Ping timeout: 260 seconds]
stupidsenpai has quit [Remote host closed the connection]