<jblack>
Hello! I have a hash that contains strings that are misencoded as ASCII-8BIT, that have an embedded utf8 character in it. I don't control the source of the hash, and it's bombing out on me when I attempt to convert the hash to json, due to an embedded utf8 characters.
brad1 has quit [Ping timeout: 248 seconds]
<apeiros>
jblack: the strings are valid utf-8?
<jblack>
The source object, probably esoteric to many here, is a Chef::Node object. I'm attempting to serialize the node object as json and save it on disk, but some of the node data, particularly the dumped process tree, has that utf8 in it.
schneider has joined #ruby
<jblack>
I believe so, as its coming from the processes data for the node object
<apeiros>
.force_encoding('utf-8') will change the encoding-flag
<jblack>
I can do that on a hash?
<apeiros>
no
lxsameer has joined #ruby
<apeiros>
you'll have to do that on the individual strings
<apeiros>
and if it's the keys, you'll actually even have to create a new hash, since Hash copies string keys.
<jblack>
Meh, so basically, to_hash the obj, and walk the entire hash to force_utf8 every element?
ams__ has quit [Quit: Connection closed for inactivity]
<apeiros>
yupp
<jblack>
Ohhh, yeah, I don't even know if it's key or value.
* jblack
mumbles and random wish for _to_h.close_enough.to_json =)
<apeiros>
those things tend to be great recipes for disasters ;-)
<jblack>
Well, you don't get to "hey, let's save the chef node to the local disk" in a place that has fear of disaster. :P
<jblack>
I think what i might do is just to_hash the thing, and just strip out chunks of the hash that tend to be problematic
schneider has quit [Ping timeout: 256 seconds]
<apeiros>
well, recursively mapping data isn't too difficult either
<jblack>
I wonder if I can get out of it with just a node.attributes.to_s
<jblack>
s/to_s/to_json
schneider has joined #ruby
vovs03 has joined #ruby
schneider has quit [Ping timeout: 256 seconds]
KeyJoo has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 264 seconds]
smithja has joined #ruby
<apeiros>
jblack: just remember that you can't properly do {foo: val.to_json}.to_json
<apeiros>
the json of val will be escaped and hence deserialize as a string
shinnya has joined #ruby
schneider has joined #ruby
vovs03 has quit [Remote host closed the connection]
wontruefree has joined #ruby
cagomez has joined #ruby
schneider has quit [Ping timeout: 268 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
ogres has joined #ruby
cagomez has quit [Ping timeout: 264 seconds]
arooni has quit [Ping timeout: 265 seconds]
schneider has joined #ruby
phenom has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
wontruefree has quit [Quit: bye]
<baweaver>
silly apeiros, then you just need a recursively repeated JSON.parse
* baweaver
is joking, please don't actually do that
schneider has quit [Ping timeout: 264 seconds]
amatas has joined #ruby
<apeiros>
you're not allowed to do that anyway. I've patented recursion.
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has joined #ruby
karapetyan has joined #ruby
arooni has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
schneider has quit [Ping timeout: 265 seconds]
<baweaver>
It's a recurring issue
dviola has quit [Quit: WeeChat 2.1]
lxsameer has joined #ruby
schneider has joined #ruby
Vivekananda has quit [Quit: Leaving]
schneider has quit [Ping timeout: 264 seconds]
lytol has quit [Remote host closed the connection]
schneider has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
<eam>
how can you patent something like recursion? It's easy, first you patent recursion
schneider has quit [Ping timeout: 256 seconds]
amatas has quit [Quit: amatas]
schneider has joined #ruby
<apeiros>
:D
safetypin has joined #ruby
safetypin has quit [Client Quit]
schneider has quit [Ping timeout: 248 seconds]
user03 has joined #ruby
schneider has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
schneider has quit [Ping timeout: 264 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
chat has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
chat_ has quit [Ping timeout: 248 seconds]
schneider has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
gizmore|2 has joined #ruby
lxsameer has joined #ruby
gizmore has quit [Ping timeout: 240 seconds]
roamingdog has quit [Ping timeout: 245 seconds]
schneider has quit [Ping timeout: 265 seconds]
schneider has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
konsolebox has quit [Ping timeout: 255 seconds]
tvw has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
subroot has quit [Read error: Connection reset by peer]
konsolebox has joined #ruby
schneider has joined #ruby
cadillac_ has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
schneider has quit [Ping timeout: 248 seconds]
cadillac_ has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
<ELLIOTTCABLE>
man
<ELLIOTTCABLE>
just remembered #RubyForce
<ELLIOTTCABLE>
manveru: oiya! <3
schneider has joined #ruby
jenrzzz has joined #ruby
nicht has quit [Ping timeout: 256 seconds]
schneider has quit [Ping timeout: 264 seconds]
gizmore|2 has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 256 seconds]
schneider has joined #ruby
beefjoe has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 276 seconds]
chat_ has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
chat has quit [Ping timeout: 240 seconds]
schneider has joined #ruby
chat has joined #ruby
chat_ has quit [Ping timeout: 256 seconds]
schneider has quit [Ping timeout: 264 seconds]
dogweather has quit [Remote host closed the connection]
schneider has joined #ruby
dogweather has joined #ruby
chat_ has joined #ruby
znz_jp has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 245 seconds]
BloopMonster has joined #ruby
nicht has joined #ruby
rodd has quit [Quit: WeeChat 1.4]
chat has quit [Ping timeout: 268 seconds]
znz_jp has joined #ruby
dogweather has quit [Ping timeout: 240 seconds]
schneider has joined #ruby
Map has quit [Ping timeout: 255 seconds]
rodd has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
BlopMonster has joined #ruby
lxsameer has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
dogweather has joined #ruby
schneider has quit [Ping timeout: 245 seconds]
braincrash has quit [Quit: bye bye]
BlopMonster has quit [Ping timeout: 264 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix- has joined #ruby
gix has quit [Disconnected by services]
schneider has joined #ruby
noobineer has joined #ruby
braincrash has joined #ruby
akaiiro has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 245 seconds]
akaiiro has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
Map has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
dogweather has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
schneider has joined #ruby
BloopMonster has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
dogweather has joined #ruby
AJA4350 has quit [Quit: AJA4350]
lbracher has quit [Ping timeout: 240 seconds]
schneider has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 256 seconds]
lbracher has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
schneider has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
schneider has joined #ruby
dogweather has quit [Ping timeout: 248 seconds]
sanscoeur has joined #ruby
amelliaa has joined #ruby
dendazen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
schneider has quit [Ping timeout: 264 seconds]
dogweather has joined #ruby
schneider has joined #ruby
noobineer has quit [Ping timeout: 245 seconds]
kapil___ has joined #ruby
millerti has quit [Ping timeout: 248 seconds]
dogweather has quit [Remote host closed the connection]
dogweather has joined #ruby
schneider has quit [Ping timeout: 264 seconds]
woodruffw has joined #ruby
woodruffw has joined #ruby
cthulchu has joined #ruby
schneider has joined #ruby
lxsameer has joined #ruby
cthulchu has quit [Ping timeout: 264 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has quit [Ping timeout: 240 seconds]
schneider has joined #ruby
jamesaxl has quit [Ping timeout: 256 seconds]
jamesaxl has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
nicht has quit [Ping timeout: 245 seconds]
schneider has quit [Ping timeout: 248 seconds]
Asher has quit [Ping timeout: 256 seconds]
GodFather has quit [Ping timeout: 255 seconds]
schneider has joined #ruby
workmad3 has joined #ruby
donofrio has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
Asher has joined #ruby
SeepingN has joined #ruby
schneider has joined #ruby
schneider has quit [Ping timeout: 248 seconds]
jamesaxl has quit [Quit: WeeChat 2.1]
lightstalker has quit [Ping timeout: 260 seconds]
schneider has joined #ruby
lxsameer has joined #ruby
schneider has quit [Ping timeout: 245 seconds]
schneider has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
schneider has quit [Ping timeout: 260 seconds]
shah^ has quit [Ping timeout: 276 seconds]
shah^ has joined #ruby
shah^ has quit [Max SendQ exceeded]
shah^ has joined #ruby
shah^ has quit [Max SendQ exceeded]
schneider has joined #ruby
shah^ has joined #ruby
shah^ has quit [Max SendQ exceeded]
shah^ has joined #ruby
shah^ has quit [Max SendQ exceeded]
shah^ has joined #ruby
shah^ has quit [Max SendQ exceeded]
marianedinis has joined #ruby
lxsameer has joined #ruby
marianedinis is now known as Elwing
schneider has quit [Ping timeout: 256 seconds]
schneider has joined #ruby
<Elwing>
Hi all, I'm new to Ruby/Rails and that is probably a simple mistake that I'm doing but I cannot figure out what I'm doing wrong. I need to iterate certain information from an object, but the view is giving an error that method id (and probably the others) are not defined for the array x, but in the class that defines the object I've made the accessors and the initialize/instantiation.
<Radar>
Elwing: ?rubyonrails
<Elwing>
yep
<Radar>
?rails
<ruby[bot]>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<Radar>
Elwing: we have a different channel for Rails questions. Could you please move over to that one? I can help you there.
<Elwing>
thanks Radar
BlopMonster has joined #ruby
schneider has quit [Ping timeout: 265 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
BlopMonster has quit [Ping timeout: 248 seconds]
schneider has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bga57 has quit [Quit: Leaving.]
schneider has quit [Ping timeout: 256 seconds]
SeepingN has joined #ruby
<zenspider>
I need to riff off someone who knows rspec... I'm trying to emulate shared_examples and... fuck there is too much magic to wrap my head around.
<zenspider>
As I understand it... `it_behaves_like` can pass in extra args that go into the block for `shared_examlpes`.
<zenspider>
(examples)
sauvin has joined #ruby
<zenspider>
but... I was planning on making shared_examples store off a block that gets passed to Module.new or Class.new (haven't decided) so I have NO CLUE how those args can play into this
schneider has joined #ruby
DarkUnicorn has joined #ruby
Elwing has quit [Ping timeout: 265 seconds]
za1b1tsu has joined #ruby
amelliaa has quit [Quit: -]
schneider has quit [Ping timeout: 256 seconds]
<zenspider>
something like:
<zenspider>
shared = proc { |arg| let(:src) { arg }; it "blah" do expect(src).to eq 42 end }
<zenspider>
but then I was hoping for something like: Class.new(superklass, &shared)
schneider has joined #ruby
<zenspider>
but with shared being passed some arg. I don't think this is feasible
<robin>
I installed bundler and capistrano and they are available with "gem list" however as soon as I move into a capistrano project I have the gems dissapear.
<Radar>
robin: do you have different Ruby versions installed?
<zenspider>
Run `gem -v` both where you installed and inside of the cap project
<Radar>
zenspider: that'll just show the gem version? It's probably an env issue, so wouldn't `gem env` be better?
<robin>
Radar zenspider yea, different versions.
schneider has joined #ruby
<zenspider>
it'll be different. ;)
<robin>
zenspider Radar thanks guys :)
<zenspider>
so, the easy fix, is to just reinstall while inside the cap project
<robin>
zenspider: reinstall?
bga57 has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
<dminuoso>
So zenspider, how has your FP experience been going? =)
<zenspider>
install bundler and cap under the cap project. or just bundler and let it do its thing
schneider has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
<robin>
zenspider: I see, thanks again.
blackmesa has joined #ruby
<zenspider>
man do I utterly dislike rspec. way way way too much magic
<Radar>
patches wel...
* Radar
ducks the table
<zenspider>
hopefully this bypasses that notion entirely
schneider has joined #ruby
<dminuoso>
zenspider: Haha I know what you mean :)
blackmesa has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
TinkerT has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 265 seconds]
<zenspider>
I just got shared_examples and it_behaves_like working... need inclrude_context and a couple other smaller things and I think this is wrapped up? ish
schneider has quit [Ping timeout: 276 seconds]
cyberg has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
<zenspider>
instance_exec was the magic trick I needed. I get to specify the reciever, pass a block, AND pass an arg
TinkerT has joined #ruby
anisha has joined #ruby
cyberg has joined #ruby
schneider has joined #ruby
reber has joined #ruby
schneider has quit [Ping timeout: 276 seconds]
lxsameer has quit [Ping timeout: 264 seconds]
schneider has joined #ruby
roamingdog has joined #ruby
schneider has quit [Ping timeout: 276 seconds]
biberu has joined #ruby
schneider has joined #ruby
schneider has quit [Ping timeout: 276 seconds]
schneider has joined #ruby
dionysus69 has joined #ruby
schneider has quit [Ping timeout: 260 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
<robin>
How can I change the gem version for capistrano?
<dminuoso>
robin: Are you in a bundler project?
<robin>
dminuoso: I'm using ansible and trying to install a gem and everytime there are different versions being assigned to capistrano and outsite of capistrano project
<dminuoso>
robin: Are you on a server?
<dminuoso>
Or your own local machine?
<robin>
dminuoso: server
<robin>
test server
<dminuoso>
Why are you executing capistrano on the remote server?
<dminuoso>
Or using capistrano at all when you have ansible already?
lxsameer has joined #ruby
<robin>
dminuoso: becuase the guy before me setup capistrano and he liked the versioning for laravel.
schneider has joined #ruby
<robin>
dminuoso: now I'm trying to create an aws image with packer and installing capistrano has been a nightmare
<dminuoso>
Wait a second.
sameerynho has joined #ruby
<robin>
dminuoso: yes
<dminuoso>
So your friend was using capistrano locally to do something with laravel?
ogres has quit [Quit: Connection closed for inactivity]
<dminuoso>
Oh you have a laravel project?
<robin>
dminuoso: we use capistrano to deploy laravel.
<dminuoso>
Ah I see
<robin>
dminuoso: when I do whereis gem there are three versions on gem showing.
<dminuoso>
robin: How do you invoke capistrano?
<dminuoso>
robin: One thing Im wondering about, what do you want to use ruby-packer for?
lxsameer has quit [Ping timeout: 240 seconds]
<robin>
dminuoso: I can't invoke it because everytime I install gems with ansible it changes version.
lxsameer has joined #ruby
<dminuoso>
robin: The simplest "drop-in" solution I can think of is to just use bundler.
sysvalve has joined #ruby
<dminuoso>
robin: Or use a local gemset
<dminuoso>
Or stop using capistrano.
schneider has quit [Ping timeout: 264 seconds]
<dminuoso>
Looking at the tasks it *does* have, Im not convinced its worth the hassle
<robin>
dminuoso: I'm working on creating autoscaling with aws. So an image will be created where capistrano and bundler is installed from the beginning so the instance can just fetch from github repo and deploy
<dminuoso>
robin: Is docker an option?
<dminuoso>
robin: Doing this with a ruby-packer wrapped capistrano solution seems mindboggingly crazy
schneider has joined #ruby
<robin>
dminuoso: what is ruby-packer? I'm using packer to pack an aws image
<dminuoso>
Ah I misunderstood what you meant by packer then :)
woodruffw has quit [Ping timeout: 255 seconds]
<robin>
dminuoso: I see :)
woodruffw has joined #ruby
woodruffw has joined #ruby
<robin>
dminuoso: what is setting the gem version in capistrano?
sameerynho has quit [Ping timeout: 255 seconds]
<robin>
dminuoso: the version inside the capistrano project is always different that the version outside
<dminuoso>
robin: Like I said, if you use bundler or gemsets you can fix the immediate issue.
simmaniac has joined #ruby
<robin>
dminuoso: I can't install bundler because it's always installing it with the wrong version of gem.
<robin>
dminuoso: what is gemsets?
lxsameer has quit [Ping timeout: 260 seconds]
_aeris_ has quit [Read error: Connection reset by peer]
schneider has quit [Ping timeout: 255 seconds]
yohji has joined #ruby
<dminuoso>
08:55 robin | dminuoso: I can't install bundler because it's always installing it with the wrong version of gem.
<dminuoso>
What do you mean by that?
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
sysvalve has quit [Ping timeout: 255 seconds]
dogweather has quit [Remote host closed the connection]
_aeris_ has joined #ruby
<robin>
dminuoso: it's such a weird problem. So ansible is configuring an instance. Setting up rvm installing ruby 2.3.1 (which capistrano wants) and then installing gems capistrano and bundler.
<robin>
dminuoso: if I check the version for gem inside of capistrano it is different from when I am in f.e home
<dminuoso>
robin: what do you need ansible for?
<dminuoso>
Just to run capistrano?
schneider has joined #ruby
<robin>
dminuoso: I just want to setup everything before so I can just cap later
<robin>
dminuoso: so I need capistrano to be ready to go.
dogweather has joined #ruby
<dminuoso>
robin: Thats all you use ansible for?
<dminuoso>
robin: Can you share your deploy.rb?
<robin>
dminuoso: ansible is used to configure the image
<robin>
dminuoso: then if autoscaling is needed the image is ready for deployment
schneider has quit [Ping timeout: 240 seconds]
Dabo has quit [Ping timeout: 240 seconds]
schneider has joined #ruby
VladGh_ has quit [Ping timeout: 256 seconds]
Dabo has joined #ruby
dogweather has quit [Ping timeout: 240 seconds]
Nussi has quit [Quit: WeeChat 2.1]
schneider has quit [Ping timeout: 256 seconds]
anisha has quit [Ping timeout: 256 seconds]
Eiam has quit [Ping timeout: 255 seconds]
dogweather has joined #ruby
schneider has joined #ruby
andikr has joined #ruby
mn3m has joined #ruby
schneider has quit [Ping timeout: 256 seconds]
anisha has joined #ruby
conta has joined #ruby
lxsameer has joined #ruby
dogweather has quit [Remote host closed the connection]
dogweather has joined #ruby
schneider has joined #ruby
zmo has quit [Ping timeout: 264 seconds]
<DarkUnicorn>
robin: is the ruby installed by rvm the only ruby on the system? maybe the ruby from rvm and the ruby from the os are interfering
schneider has quit [Ping timeout: 264 seconds]
clemens31 has joined #ruby
<robin>
DarkUnicorn: interesting, that might be right. I solved it by not using the gem module in ansible and just do it with command instead.
jnollette has quit [Remote host closed the connection]
cyberg has quit [Remote host closed the connection]
<robin>
DarkUnicorn: ruby is already installed on the system and then I'm adding rvm and ruby 2.3.1.
jnollette has joined #ruby
<robin>
DarkUnicorn: thanks.
schneider has joined #ruby
schneider has quit [Ping timeout: 256 seconds]
vondruch has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
schneider has joined #ruby
schneider has quit [Client Quit]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Dabo has quit [Remote host closed the connection]
<manveru>
ELLIOTTCABLE: *wave*
Burgestrand has joined #ruby
venmx has joined #ruby
mikecmpbll has joined #ruby
lxsameer has joined #ruby
krandi has joined #ruby
workmad3 has joined #ruby
yohji has quit [Ping timeout: 268 seconds]
andikr has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
deathwishdave has joined #ruby
zyh1a19 has joined #ruby
zyh1a19 has quit [Max SendQ exceeded]
zyh1a19 has joined #ruby
simmaniac is now known as sysvalve
yohji has joined #ruby
Zaab1t has joined #ruby
sanscoeu_ has joined #ruby
dogweather has quit [Remote host closed the connection]
sanscoeur has quit [Ping timeout: 265 seconds]
dogweather has joined #ruby
saTchymoto has joined #ruby
Dabo has joined #ruby
Dabo has joined #ruby
Dabo has quit [Changing host]
jamesaxl has joined #ruby
ShekharReddy has joined #ruby
schleppel has joined #ruby
VladGh has joined #ruby
mn3m has quit [Ping timeout: 256 seconds]
NL3limin4t0r has joined #ruby
mn3m has joined #ruby
alex`` has joined #ruby
chris349 has quit [Ping timeout: 256 seconds]
Beams has joined #ruby
workmad3 has joined #ruby
BlopMonster has joined #ruby
BlopMonster has quit [Ping timeout: 240 seconds]
Beams_ has joined #ruby
sysvalve has quit [Ping timeout: 255 seconds]
Beams has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
sysvalve has joined #ruby
jamesaxl has quit [Ping timeout: 245 seconds]
jamesaxl has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
lucifer-the-sata has joined #ruby
lucifer-the-sata has quit [Client Quit]
beilabs has joined #ruby
zyh1a19 has quit [Ping timeout: 260 seconds]
conta has quit [Quit: conta]
FernandoBasso has joined #ruby
<_aeris_>
hello here !
<_aeris_>
I try to implement certificate pinning with net/http, but have a problem with verify_callback
<_aeris_>
i use a self-signed certificate, so i want to only use pining, and not CA validation, so I verify_mode = VERIFY_NON
<_aeris_>
but in this case, seems the verify_callback is called, but result is discarded, if the key doesn't match and verify_callback = false, connection occurs…
<desnudopenguino>
i'm running into issues with openssl, installed 1.0.2 from packages, and i'm trying to point it to the proper directory for the openssl includes, but for some reason it is defaulting to /usr/include/openssl, which contains LibreSSL files.
<havenwood>
desnudopenguino: When you rebuild Ruby?
<konsolebox>
desnudopenguino: maybe you can't do that. perhaps openssl is explicitly required
<konsolebox>
you do seem to have openssl installed, but maybe it requires a newer version
Guest89529 has quit [Read error: Connection reset by peer]
synthroid has quit []
<desnudopenguino>
konsolebox: i have a newer version of OpenSSL installed locally (1.0.2n) than i do on my FreeBSD box which has no issues (1.0.2k). the issue is that using the notes from https://github.com/rbenv/ruby-build/wiki#missing-openssl
yokel has quit [Ping timeout: 245 seconds]
<desnudopenguino>
it isn't accepting the directory i'm giving it
krandi has quit [Remote host closed the connection]
Nicmavr has joined #ruby
<desnudopenguino>
so it tries to build the same if i have `RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/include/eopenssl/openssl` included in the command or not
Nicmavr is now known as Guest28077
alex`` has joined #ruby
Beams has quit [Quit: .]
yokel has joined #ruby
jottr has joined #ruby
<konsolebox>
desnudopenguino: shouldn't it be /usr/local ?
<konsolebox>
also, why eopenssl?
<desnudopenguino>
konsolebox: just '/usr/local'? eopenssl is what the official OpenSSL pkg is installed as on OpenBSD, (strange licensing things). LibreSSL comes with base in /usr/bin
chouhoulis has joined #ruby
mahlon has quit [Read error: Connection reset by peer]
ged has quit [Read error: Connection reset by peer]
chouhoul_ has joined #ruby
ged has joined #ruby
mahlon has joined #ruby
<konsolebox>
yes just /usr/local as compared to /opt/local in the example, but since you're using eopenssl, i'm not sure if the effect would be the same. maybe you need to hack it with a symlink. not sure.
<desnudopenguino>
ok, so i was misunderstanding the --with-openssl-dir option a bit then
chouhoulis has quit [Ping timeout: 240 seconds]
<desnudopenguino>
i guess i'd want all the eopenssl things in there to link to /usr/local/{include,lib,bin}/openssl then?
<konsolebox>
desnudopenguino: i'd say it's worth a try if it's harmless
psychicist__ has joined #ruby
<desnudopenguino>
yeah, should be pretty harmless.
chat_ has quit [Ping timeout: 264 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
dogweather has joined #ruby
<desnudopenguino>
OpenBSD has some unusual things with their base setup if you want to use gnu tools as well. many needed tools have been rewritten because they have a more premissive license on OpenBSD vs gpl that comes with most *nix software
cagomez has quit [Remote host closed the connection]
<desnudopenguino>
makes my life a living hell on these occasions.
cagomez has joined #ruby
workmad3 has joined #ruby
<desnudopenguino>
konsolebox: building now, will know in the next 10 or so mins if it worked or not
<konsolebox>
ok
workmad3 has quit [Ping timeout: 255 seconds]
cagomez has quit [Ping timeout: 265 seconds]
^mtkd has quit []
BlopMonster has joined #ruby
<desnudopenguino>
well that cut down the errors a little from what i can tell, there are still some there though...
<konsolebox>
desnudopenguino: you can share the output
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
tdy has joined #ruby
amar_ has joined #ruby
dogweather has quit [Ping timeout: 256 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<konsolebox>
it's unusual that a pointer argument is expected, but int is passed.
aupadhye has joined #ruby
mtkd has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
<desnudopenguino>
i have no idea lol.
<desnudopenguino>
the only *error* i'm seeing is `ossl_x509cert.c:372:57: error: invalid type argument of '->' (have 'int')`
<desnudopenguino>
if i'm reading that log correctly (though i'm probably not, which is why i'm asking for help)
dogweather has quit [Ping timeout: 264 seconds]
<eam>
desnudopenguino: the errors I see are: "openssl_missing.h:196:22: error: static declaration of 'EVP_PKEY_get0_RSA' follows non-static declaration"
<eam>
and "openssl_missing.h:221:20: error: conflicting types for 'RSA_get0_key'"
<eam>
lots of type errors
<eam>
that one you linked is just the very last in a whole series, you have like dozens
<eam>
I suspect something is wrong with your openssl development install
<desnudopenguino>
eam: which file are you looking at in my gist?
<eam>
the huge 1400 line chunk
<desnudopenguino>
i have 2 posted, one is older and has tons of errors, the other is newer and has one that i can see
<cthulchu>
I'll just pass __FILE__ or something similar to my function there
aupadhye has joined #ruby
dogweather has joined #ruby
sauvin has quit [Remote host closed the connection]
dogweather has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 245 seconds]
<cthulchu>
another question.
lytol has joined #ruby
<cthulchu>
we have instance variables that are specific to an object/instance
<cthulchu>
and we have local variables that don't have the @ modifier
karapetyan has quit [Remote host closed the connection]
<cthulchu>
a local variable in a class scope can be changed by different instances but will be always available and will never be reset implicitly?
dogweather has joined #ruby
<apeiros>
"a local variable in a class scope can be changed by different instances" no
r29v has quit [Quit: r29v]
<apeiros>
it can't even be accessed
<apeiros>
(unless you use define_method with a block, but I doubt you talk about that)
r29v has joined #ruby
aupadhye has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 276 seconds]
fmcgeough has quit [Quit: fmcgeough]
lunarkitty7 has quit [Ping timeout: 256 seconds]
tdy has quit [Ping timeout: 276 seconds]
<soahccc>
Anyone familiar with curses? I'm not sure where the problem is but for some reason certain characters are broken on ubuntu (via ssh) vs. macOS locally. When I google I find things related to the terminal locale but it's the same for both, in fact if I force it to a non-utf8 it breaks completely. I suspect it to be curses but what should I do here? https://i.imgur.com/tO5AXDw.jpg
dendazen has quit [Ping timeout: 268 seconds]
Zaab1t has quit [Ping timeout: 276 seconds]
<eam>
what absolute jackass made a cop to complain about disabling rubocop?
brad1 has quit [Ping timeout: 256 seconds]
<jrich523>
.... i had to switch back to python today... missing () all over the place now lol
<cthulchu>
okay...
<cthulchu>
let's say I have a class Humans
<apeiros>
eam: lol
<cthulchu>
It has ivars like height, age and stuff
<cthulchu>
but it also has a var like the_coolest_peeps
<cthulchu>
that var is an array of people
<cthulchu>
when an instance becomes cool, I want to push it into that arrray
cadillac_ has quit [Read error: Connection reset by peer]
<cthulchu>
how do I do that?
codymj has joined #ruby
<soahccc>
Oh nvm me, I had to install the cursesw (wide space something) and it works :)
zachk has joined #ruby
zachk has joined #ruby
<cthulchu>
in Java world it would be a public static var
<cthulchu>
I think
<cthulchu>
it's been a while
<apeiros>
cthulchu: you make a class method and you let @the_coolest_peeps be a class ivar.
<cthulchu>
class ivar?
<cthulchu>
weird
<cthulchu>
ivar is instance var
<cthulchu>
class ivar sounds wrong
<cthulchu>
what is a class method?
lunarkitty7 has joined #ruby
<apeiros>
class Person; @coolest_people = []; class << self; attr_reader :coolest_people; end
<apeiros>
cthulchu: yeah, it's not a good idea to reject new ideas on sight
<apeiros>
even less so when you're still learning
<apeiros>
I remember you wanting the technical & precise explanation - well, here it is:
<jrich523>
lol fair statement
<apeiros>
a class method is an instance method on the singleton_class of a class, or any ancestor of said singleton_class.
<apeiros>
nothing without prior knowledge is obvious.
<cthulchu>
well common oop knowledge doesn't help with this
<cthulchu>
maybe I don't know enough of common oop
<apeiros>
"common"?
<cthulchu>
yes. something common for all langs
<apeiros>
yes, JS' prototypical OOP works differently from this :)
<apeiros>
so does whatever you could call PHP's
<apeiros>
there's no such thing as "something common for all langs"
<apeiros>
well, ok, there is: you have to learn them to understand them.
<gizmore>
the basic difference between ruby and other interpreters....... the interpreter does not know a preprocessor.... it just interprets your definitions as code....... "module" changes namespace. "class" adds a constant and so on?
<apeiros>
and: they're all different. that's why they exist :D
<cthulchu>
actually I despise JS's and PHP's OOP
<apeiros>
gizmore: yes, ruby itself doesn't do any preprocessing. you could still write a preprocessor.
<cthulchu>
I think more of Java's
<gizmore>
yeah... ruby is so elegant
<apeiros>
cthulchu: so, what was the "common" again? :)
<cthulchu>
^)
<gizmore>
apeiros: fun php fact: #to_string may not throw exceptions *^-^ (poor php bastards)
<apeiros>
gizmore: may not = must not?
<gizmore>
must not :)
<gizmore>
wtf
<apeiros>
am I terrible for thinking that that makes sense? at least an argument-less to_string
<gizmore>
wjy
<cthulchu>
okay, could you please explain what self is in the class scope?
<cthulchu>
it's not this?
<apeiros>
IMO an #inspect in ruby shouldn't ever raise either
<apeiros>
cthulchu: the class
<gizmore>
apeiros: why would you do those no exception on to_string restrictions...... that's redicule
<apeiros>
but Foo.new.singleton_class still is a subclass of Foo :)
<cthulchu>
no, it's not just an instance of foo
<apeiros>
not just? what else is it then?
dionysus69 has joined #ruby
<cthulchu>
one thing is very-very rarely an instance of one class
<cthulchu>
pretty much never
<cthulchu>
so when you do .class, it shows you the final class
<apeiros>
in ruby, actually, always
<cthulchu>
really?
kevinburke has joined #ruby
<apeiros>
yes. every object is exactly an instance of one specific class.
<cthulchu>
an instance of a class is not an instance of its class superclass or what?
<cthulchu>
so some_foo is not an object?
<cthulchu>
or whatever it's called in Ruby
<apeiros>
it is an object
<apeiros>
it's not an instance of object
<apeiros>
"instance of" does not consider ancestry.
<cthulchu>
hm
<cthulchu>
I see
<cthulchu>
okay
<cthulchu>
now I'm not sure if it's the ruby-only case or if it's me not inderstanding OOP properly
<apeiros>
though I'd like to have a better term for the thing which does consider ancestry. "is a" is… not very distinguished.
cagomez has quit [Ping timeout: 264 seconds]
<apeiros>
well, to my knowledge, no other language defines "instance" differently
<cthulchu>
yeah
<apeiros>
but there are languages which allow objects to be instances of multiple classes at the same time. those usually also have multiple inheritance.
<apeiros>
though afaik the set of languages which have multiple inheritance is bigger than the set of languages which have "instance of multiple classes"
<apeiros>
and I've actually difficulties to remember the name of the one language I've met which does the latter.
<cthulchu>
I don't see the difference
<cthulchu>
multiple inheritance is the same as multiple classes to me
<apeiros>
in other words: "x is an instance of Y" means in about every language "x was created from Y (regardless of Y's ancestry)"
<apeiros>
instantiation != inheritance.
<cthulchu>
having an object of C<B<A, I can access A's public/protected methods
<cthulchu>
well yes
<cthulchu>
but that doesn't say anything
<apeiros>
that's wrong, but ok :)
<cthulchu>
well I don't see another way to create a Y instance
<Demos[m]>
C++ is fun because you can be have two parent instances of the same type
<cthulchu>
without mentioning Y
<apeiros>
MI is `A < X + Y`
<elomatreb>
Opinion: Composition > Inheritance
<Demos[m]>
and afaik they are distinct!
<apeiros>
multiple instantiation would be `foo = (X + Y).new`
<cthulchu>
weird
<cthulchu>
I don't want to know that. yet.
<cthulchu>
hell now I can't unknow that
<apeiros>
elomatreb: yeah, I'm on the same page there.
<Demos[m]>
Inheritance == Composition :D
<cthulchu>
why did you have to show that to me
<cthulchu>
now I will wonder about how it works
<cthulchu>
my life was beautiful before
<elomatreb>
Demos[m]: Well, in a way. I meant composition as in non-hierarchical, e.g. trait-based
<apeiros>
cthulchu: it's only because you haven't yet figured how it works, i.e. you haven't made the step to "oh, it's actually simple" yet ;-)
<cthulchu>
Yeah, that's fine. I'll do it when I actually need it
<cthulchu>
I doubt I will ever need it though
<cthulchu>
I write simple things
<cthulchu>
that barely need oop
karapetyan has joined #ruby
<apeiros>
not quite sure which "doing" you're referring there. but ok :)
<cthulchu>
learning :)
<elomatreb>
You're right though in that if you have complicated inheritance you probably have other, underlying problems
<apeiros>
yeah. true understanding of ruby's object model is rarely needed. but if you know the full object model, it actually becomes easier.
<elomatreb>
Method lookup path is fun
<cthulchu>
it's like that everywhere. knowing lower level makes higher level things seem a lot easier
r29v has quit [Quit: r29v]
jblack has quit [Ping timeout: 256 seconds]
<konsolebox>
tell that to people who are scared of learning C
karapetyan has quit [Ping timeout: 255 seconds]
<elomatreb>
tbf it's legitimate to be scared of C
<baweaver>
More accurately knowing a higher level language unlocks the ability to think in even higher levels of abstraction
<baweaver>
Most people really don't remotely care about the low level implementation, they're not looking there.
jblack has joined #ruby
<elomatreb>
Plus the version of "low level" that C suggests was accurate in the 1970s, today not so much
<nickjj>
when running bundle commands is there a global flag or ENV var you can set to use a custom Gemfile.lock location?
<nickjj>
for clarity, not the Gemfile (or both), but just the Gemfile.lock
sameerynho has quit [Ping timeout: 245 seconds]
dogweather has quit [Ping timeout: 264 seconds]
brad1 has joined #ruby
dogweather has joined #ruby
wontruefree has quit [Quit: bye]
ccooke has quit [Ping timeout: 260 seconds]
cagomez has joined #ruby
dogweath_ has joined #ruby
ccooke has joined #ruby
mtkd has quit []
dogweather has quit [Ping timeout: 248 seconds]
fmcgeough has joined #ruby
r29v has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
mtkd has joined #ruby
<konsolebox>
knowing abstraction is not enough. how about abstraction with balanced optimization.
<konsolebox>
*not impressive
r29v has quit [Client Quit]
claudiuinberlin has joined #ruby
wontruefree has joined #ruby
weaksauce has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
dogweath_ has quit [Remote host closed the connection]
wontruefree has quit [Quit: bye]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
FernandoBasso has quit [Quit: Leaving]
dogweather has joined #ruby
wontruefree has joined #ruby
eckhardt has joined #ruby
Dbugger has quit [Ping timeout: 265 seconds]
clemens31 has quit [Remote host closed the connection]
sphenxes has quit [Quit: Leaving]
psychicist__ has quit [Quit: Lost terminal]
wald0 has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
dionysus69 has joined #ruby
tty has joined #ruby
karapetyan has joined #ruby
icarus has quit [Ping timeout: 245 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
r29v has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
za1b1tsu has quit [Quit: WeeChat 2.1]
cadillac_ has quit [Ping timeout: 260 seconds]
za1b1tsu has joined #ruby
Mike11 has quit [Quit: Leaving.]
dogweather has quit [Remote host closed the connection]
dogweather has joined #ruby
cadillac_ has joined #ruby
Asher has quit [Read error: Connection reset by peer]
Asher has joined #ruby
woodruffw has quit [Quit: And then he took off.]
dionysus69 has quit [Ping timeout: 248 seconds]
blackmesa has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cthulchu>
can we create keys implicitly?
beilabs has quit [Remote host closed the connection]
<ruby[bot]>
cthulchu: # => /tmp/execpad-debc92c80735/source-debc92c80735:2: syntax error, unexpected ';' ...check link for more (https://eval.in/1022132)
<cthulchu>
errr
<cthulchu>
we don't have the ++?
<apeiros>
no
<konsolebox>
apeiros, havenwood: ok point taken. i still a few doubts, but i think the terminology is fine the way it is
<jerryskye>
i wanted to ask if there's a framework faster than roda
<jerryskye>
if anyone has found one please ping me :)
amar has quit [Remote host closed the connection]
user03 has left #ruby ["Leaving"]
wontruefree has quit [Quit: bye]
<havenwood>
jerryskye: ngx_mruby
zautomata has joined #ruby
zautomata has quit [Changing host]
zautomata has joined #ruby
<gizmore>
jerryskye: working on rubygdo :P
<jerryskye>
thanks havenwood, is this a framework or just some ruby extension for nginx?
<zenspider>
meh
<cthulchu>
this is so weird...
<havenwood>
jerryskye: Or h20_mruby or mod_mruby. You write handlers in Ruby via mruby. Is a tuned Roda not fast enough? What's the speed problem you're running into?
<cthulchu>
I have an error that closes my console...
<havenwood>
jerryskye: 274,472 JSON requests per second - pretty fast.
<jerryskye>
havenwood: I was just wondering if there was anything faster. I don't have any issues, I usually do small projects with Roda. Thanks for your help, have a good one ;)
<havenwood>
jerryskye: But... Roda with the same setup is 173,905 JSON requests per second.
<havenwood>
jerryskye: Roda is fast. I'd not worry.
<cthulchu>
my code fails, but I'm not getting the error message
<cthulchu>
instead it does an epic thing
<cthulchu>
I've never seen anything like it
<cthulchu>
it closes the console
<cthulchu>
what is it?
<akaiiro>
cthulchu welcome to the world of segmentation faults (maybe)
<cthulchu>
wow
<cthulchu>
but how do I deal with it?
<cthulchu>
I have no idea how to debug it
<cthulchu>
also my puts don't work at all
jottr has joined #ruby
<cthulchu>
even before it closes
<cthulchu>
weeeird. I may have done something very-very wrong
<akaiiro>
cthulchu neither do I. requires deeper knowledge. but it may be related to the tool you're using to run your program. have you tried to run it online?
<cthulchu>
it's too complex to run it online
<cthulchu>
so yeah, it's probably my context
<cthulchu>
I'll ask my debs who work with the framework
<cthulchu>
*devs
<cthulchu>
on Monday
<cthulchu>
hell this is scary
<cthulchu>
never have I encountered anything close to it. Maybe something below me does it when triggered and I trigger it
<akaiiro>
well, it makes you think. some people say that all our software tools are just glued together with duck tape
jottr has quit [Ping timeout: 248 seconds]
<zenspider>
duct
<cthulchu>
hehe
<cthulchu>
it certainly feels that way
<cthulchu>
guys you should know
<cthulchu>
I'm the new one with Selenium and Ruby
<cthulchu>
you've been around for ages
<cthulchu>
okay, I'll upload the code
<cthulchu>
for general lookup
<zenspider>
printing isn't debugging. either use a real debugger, something like pry, or write tests to prevent regressions from reoccuring
<cthulchu>
how the hell would I know where to trigger pry
<cthulchu>
also pry has real issues with next
<cthulchu>
or continue
<havenwood>
cthulchu: Lines 4-7 should be constants.
<cthulchu>
there's another debugger that can do that
<havenwood>
cthulchu: byebug
<havenwood>
cthulchu: Class variables >.>
<cthulchu>
they're not constants
<zenspider>
semicolons. bad indents. zero blank lines separating anything. ... nope
<cthulchu>
those values are placeholders
<zenspider>
havenwood: if there's no subclass, then cvars are totally fine
<zenspider>
still doesn't make sense... but whatever
<cthulchu>
that's my thought!
<cthulchu>
akaiiro, see?
<cthulchu>
^^^
<cthulchu>
why bad indents though? where?
<havenwood>
zenspider: usually when I see them used the use doesn't make sense
<cthulchu>
in my case it makes sense
<cthulchu>
oh, well
<cthulchu>
actually I just need static
<cthulchu>
I know there's another way of doing them
<cthulchu>
but it seemed overcomplicated
<havenwood>
cthulchu: Use consistent spacing, like on like 22 - spaces after =
<havenwood>
cthulchu: spaces before and after == on line 26
<cthulchu>
right
<cthulchu>
ok ok
<cthulchu>
I'll try to keep an eye on it
<havenwood>
cthulchu: no parens with puts, line 27
<havenwood>
cthulchu: no parens with get_driver, line 29
<cthulchu>
so it seems to fail only when the debug.length != 1
<akaiiro>
cthulchu yep, hard to tell at first sight. you can narrow the offending instruction going step by step with the help of byebug, like zenspider commented
<havenwood>
cthulchu: that's not a matter of Seattle style, it's community consensus to omit parens in those cases
<cthulchu>
I like my parents
<havenwood>
noooo
<zenspider>
it's ALSO seattle style. :P
<havenwood>
cthulchu: stop that
<cthulchu>
why?
<cthulchu>
they make it easier to read
<cthulchu>
it's like using commas in English
<cthulchu>
seattle
<havenwood>
cthulchu: no, it's more like saying "like" over and over, unnecessarily
<cthulchu>
it makes it easier for me to read it.
<zenspider>
this person has been in here for days, asking why ruby isn't more like python left and right (instead of using python), and clearly shows no desire to learn _proper_ ruby. I don't see much reason to invest more time or effort in this. It'll just be push back after pushback and excuse after excuse.
<havenwood>
cthulchu: like, stop - it's like not, like necessary
<zenspider>
haha
<cthulchu>
yeah I got the idea
<havenwood>
cthulchu: no semicolons on line endings, line 55
<cthulchu>
but hey, baby steps
<cthulchu>
I can't become an ideal ruby coder right away
<zenspider>
ESPECIALLY if you don't want to be.
<cthulchu>
I do, but not now
<havenwood>
cthulchu: use interpolation, line 42
<zenspider>
it's not like OUR time is valuable or anything.
<cthulchu>
okay
<cthulchu>
can we stop discussing design that doesn't affect the output?
<cthulchu>
I will get better at it eventually
<havenwood>
cthulchu: headlessCamelCase is *never* a thing in Ruby, line 42
<havenwood>
41*
<zenspider>
I've been moving more towards String#% over interpolation. Not sure why, but I've been liking the shorter string literals
<cthulchu>
I know!
<cthulchu>
hell
<havenwood>
cthulchu: Fix those things, and we'll be happy to discuss things that affect the output.
<akaiiro>
zenspider pass the salt, need some for my salad
<cthulchu>
omg...
<cthulchu>
it doesn't makes much sense to me
<cthulchu>
but okay
amar has joined #ruby
<cthulchu>
I'll waste my time prettyfying it
<cthulchu>
just cuz I don't have a choice
alex`` has quit [Quit: WeeChat 2.1]
<havenwood>
Making code readable is of paramount importance.
<cthulchu>
it is readable
<cthulchu>
you're just being super picky
<zenspider>
once again... asks for feedback. rejects the feedback.
<cthulchu>
I was asking about functional feedback
<zenspider>
I'm done. Welcome to my /fools list
<havenwood>
cthulchu: Don't mutate objects.
<havenwood>
cthulchu: That's my functional feedback.
<cthulchu>
thanks, likewise
<cthulchu>
havenwood, that's not what's causing issues at hand
<havenwood>
cthulchu: ;-)
<cthulchu>
I'll get to it in time
<cthulchu>
hell you're demanding
* havenwood
demands a chariot pulled by cats ...
<cthulchu>
exactly :)
<cthulchu>
I mean, it's totally not much from your perspective
<cthulchu>
but it totally is from mine
<havenwood>
cthulchu: do you mean to have a bang on line 44?
<akaiiro>
I would like one of those chariots too
<havenwood>
oh, not equal
<havenwood>
cthulchu: debug.any?
reber has quit [Remote host closed the connection]
<zenspider>
nah
<cthulchu>
havenwood, what about 44?
<zenspider>
unless debug.empty?
<havenwood>
cthulchu: Use `debug.empty?` and `debug.any?`.
<havenwood>
cthulchu: or what zenspider said
<cthulchu>
why?
<zenspider>
they're not testing for truthiness of content
<cthulchu>
what's wrong with length == 0?
<havenwood>
cthulchu: several reasons, 1) length! could be a method #length!
<havenwood>
cthulchu: 2) a method without an argument is better than a method with an argument
<cthulchu>
I'm not addig methods
<cthulchu>
to foreign classes
<cthulchu>
or objects
<havenwood>
cthulchu: huh?
amar has quit [Ping timeout: 256 seconds]
<cthulchu>
okay, anyway, these are cosmetics
<cthulchu>
and I'm very sure they won't change the output in my context
<havenwood>
cthulchu: it made your code difficult to read. i think you're undervaluing readability
<cthulchu>
okay, I'll work on it
<cthulchu>
right now
<cthulchu>
It's like everything crushes, I need to fix it and you're commenting on the cosmetics
<havenwood>
cthulchu: It may seem silly, but when conventions are followed we can grok code way faster.
<cthulchu>
I can't even start doing cosmetics cuz I can't run the code to test if my cosmetic changes affected the output
<havenwood>
cthulchu: Yeah, that's where tests come in *very* handy.
<cthulchu>
what tests?
<havenwood>
cthulchu: They quickly save you time.
<zenspider>
exactly
<zenspider>
haha
<havenwood>
cthulchu: Minitest ships with Ruby! :-)
jamesaxl has quit [Quit: WeeChat 2.1]
<zenspider>
and yet...
<cthulchu>
I actually work in minitest children
<cthulchu>
but I'm trying not to interfere with it too much
<cthulchu>
in fact, as little as I can
<havenwood>
zenspider: I do think it'd be awesome to make a helper to expose assertions at top level for folk who are learning or trying to remember assertions.
<cthulchu>
cuz I don't quite unserstand it and what I do has little relation to it
<cthulchu>
I don't think your test remarks apply here
<zenspider>
havenwood: for like, poking in irb?
<zenspider>
you'd almost want a separate set entirely that don't raise at all
<zenspider>
(failures raise)
beilabs has joined #ruby
<cthulchu>
oh great
schleppel has quit [Quit: Konversation terminated!]
<havenwood>
zenspider: Yup, just for poking around. The assertions incrementer is the only barrier, it seems. It'd be awesome to be able to `require 'minitest/repl'` or something to expose top level use.
<cthulchu>
so I use iterm2 and it shows a message when the console gets closed
<havenwood>
I'd love to use that teaching folk.
<havenwood>
cthulchu: Have you ever done any Minitest tests?
<havenwood>
cthulchu: You might find that it frees you to have confidence in your code, and refactor liberally.
<zenspider>
havenwood: I guess you'd only have to replace assert to not raise
<cthulchu>
I haven't done any
<havenwood>
zenspider: I don't even mind the raising.
<cthulchu>
I'm trying to inject my tests into existing tests
<havenwood>
cthulchu: You can write new tests, and just run them.
<havenwood>
cthulchu: It's up to you!
<zenspider>
havenwood: yeah. just gets a little messy in something like irb
<cthulchu>
why would I
<cthulchu>
It's a lot of extra work
<zenspider>
good god. havenwood... please stop being a martyr.
<havenwood>
zenspider: It barfs a bit, but I think it's really enlightening for new folk. And trying it at top level gets rid of the boilerplate.
<cthulchu>
I'm an analyst and I want _existing_ QA tests to do analytics testing too
<cthulchu>
and it's easy to do
* havenwood
tries to think of a good martyr thing to say ...
<cthulchu>
Ruby is quite straightforward
<zenspider>
havenwood: haha
<gizmore>
the biggest problem for me in ruby is large codebase with bad code completion support
beilabs has quit [Ping timeout: 248 seconds]
<zenspider>
gizmore: what's your editor of choice?
<cthulchu>
in Ruby itself?
<gizmore>
zenspider: AptanaStudio/Eclipse atm
tjbp has quit [Quit: No Ping reply in 180 seconds.]
<havenwood>
cthulchu: Testing save so much time...
<gizmore>
i love rspec and test driven dev in ruby =)
<cthulchu>
havenwood, okay. I don't know what testing is. Do you have a link that explains it?
tjbp has joined #ruby
<zenspider>
gizmore: can't help you then. There's probably some sort of tagging / jump system, but I wouldn't know it.
<havenwood>
zenspider: I betcha folk would use it despite the exception noise. I use that little shim from time to time just to quickly remember assertion behavior in the repl.
<zenspider>
sorry
skryking has quit [Quit: Leaving]
workmad3 has joined #ruby
<zenspider>
havenwood: I'm poking at it now
<havenwood>
:-D
<zenspider>
I just threw in require "pry"; binding.pry
<zenspider>
you still have to do something like `ruby -rminitest/pry -e 0`... without the bogus -e it hangs
<zenspider>
odd. I guess that means that it doesn't do the -r args UNTIL it has something to eval
<zenspider>
my whole place smells of bacon. it's glorious
<zenspider>
havenwood: hah! I moved it into the Assertions module and did `extend self` then opened up pry inside them module. works great.
<cthulchu>
I think I nailed it
<zenspider>
I've never done `extend self` before. feels perverse
<havenwood>
haha
<cthulchu>
it taught me a lesson
<cthulchu>
I'm gonna do it a proper way now
RougeR has quit [Quit: Leaving]
<cthulchu>
I'll sacrifice a bunch of time to make sure I code in proper Ruby
<cthulchu>
will embrace it
<havenwood>
zenspider: I vote module_function - hrm, no harm from having the included version be private, right?
workmad3 has quit [Ping timeout: 260 seconds]
* havenwood
totally agrees on the perversity of extending self
<havenwood>
cthulchu: it may seem slower, but having tested, readable code saves ages
<havenwood>
cthulchu: it's very worth the ramp up
<cthulchu>
so I'm looking at this test. It has view. The view has methods. Each method does something on the page and returns... errr... self. So the chaining works properly
<zenspider>
I keep forgetting that I have M-x ruby-find-file
wald0 has joined #ruby
<cthulchu>
I inject my analytics funtion inbetween some chain segments where I expect my things to be in the dataLayer
<cthulchu>
and I check them
<cthulchu>
and it works fine
<cthulchu>
until I decided to comment my code with a #
<zenspider>
when you drop entitled and disingenuous, THEN you'll be trying polite
<cthulchu>
my own servers are on Debian
<cthulchu>
am I entitled to something?
<havenwood>
cthulchu: You can't put comments in the middle of method chains. Not on one line, not across lines.
<cthulchu>
errr
<cthulchu>
oh
<cthulchu>
that's interesting
<cthulchu>
that I didn't expect
<zenspider>
havenwood: hrm... binding.pry drops you in whereever you want. but IRB.start is always toplevel... I wonder if there's a way to get into where I want?
<cthulchu>
havenwood, thanks. Is there a reason why?
<havenwood>
zenspider: These days: binding.irb
<zenspider>
havenwood: I suspect trailing periods would work
<Yxhuvud>
I like how I'm like the only one at my work place (~150 people) that is the only one that doesn't use mac. Apparently, they were tupid enough to ask me...
<zenspider>
yeah. :/
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
shouldn't have asked if they didn't want to know the answer
<Yxhuvud>
exactly :)
<havenwood>
cthulchu: yeah, there are reasons - I can explain but it'll take a while
<cthulchu>
I actually don't use mac either
<cthulchu>
havenwood, you can just link. I'm happy to read
<cthulchu>
just don't know what to google for
<Yxhuvud>
I work on mac every other workplace I work at. I wouldn't mind that bind like a decade in teh future
<havenwood>
cthulchu: I mean it's how the Ruby parser works. I don't know that someone has prepared an article for the specific case you're asking about. If they have, I don't know about it. But I don't think you're ready to get into parser details. I'd suggest just accepting it.
<zenspider>
so much bacon. I might have JUST bacon for dinner. glorious. Just not sure how to eat the liquid w/o burning my lips
jenrzzz has joined #ruby
<Yxhuvud>
:D
<cthulchu>
okay
<cthulchu>
never seen it in other languages
<cthulchu>
very surprised
<cthulchu>
and I can't to the partial comments?
<cthulchu>
like /* */
jottr has joined #ruby
<havenwood>
cthulchu: You haven't seen comments interrupt method chaining? Anyhoo.
<cthulchu>
no
<cthulchu>
gonna go test it in js
<havenwood>
cthulchu: You can see what exact grammar rules Ruby is using from parse.y with the --yydebug flag: ruby --yydebug -e "self.; #nope; .to_s"
<zenspider>
havenwood: yeah. trailing periods
<havenwood>
zenspider: tricky!
<zenspider>
leaves it in a hanging state... makes some sense
<havenwood>
cthulchu: I mean: ruby --yydebug -e "self; #nope; .to_s"
<havenwood>
I was reading zenspider's comment while typing. My fingers had a mutiny.
<cthulchu>
okay
<cthulchu>
thanks a lot
<cthulchu>
I'll remember this one
<cthulchu>
and be ready for more surprise
<cthulchu>
I still can break the chaining to comment, but it looks ugly
<cthulchu>
so I won't comment
<havenwood>
cthulchu: You can see often dig in with Ripper or RubyVM::InstructionSequence. But typically folk don't start doing that until they know Ruby.
<cthulchu>
yeah, I'll try it in future
<havenwood>
cthulchu: It's fun.
<cthulchu>
indeed! :)
anime4christ has joined #ruby
k0mpa has quit [Remote host closed the connection]