« Back to channel list

#ruby - 22 November 2017

« Back 1 day Forward 1 day »
[00:00:08] SeepingN: has joined #ruby
[00:00:28] RickHull: sorry I misread, it looks like L6 does *not* define a block
[00:00:39] RickHull: it's easy to misread when your indentation is all over the place :)
[00:01:06] nginxxx: okay thanks
[00:01:13] RickHull: the `end` on L15 -- what block does that close?
[00:01:27] RickHull: L6 does define a block
[00:01:33] RickHull: i keep misreading your code
[00:01:54] RickHull: everything between L6 and L15 should be at the same indent level, with 2 spaces of indent
[00:01:55] rainbowz: has joined #ruby
[00:01:59] weaksauce: why don't you pass it in on the command line too `addresses = ARGV[0]`
[00:02:12] RickHull: (unless an expression is split across multiple lines)
[00:03:05] RickHull: nginxxx: please make (most of) the suggested changes and paste again
[00:03:16] RickHull: even if it doesn't run or behave as expected
[00:03:56] RickHull: in a nutshell: address should be local, not global. assign address before printing it or using it in an expression. fix your indenting
[00:04:00] nginxxx: l6 defines a block it is not wrong... go look on ruby docs.
[00:04:30] RickHull: nginxxx: I appreciate the suggestion, but try to follow my lead here
[00:04:32] nginxxx: and ruby is not like python, its not important how many spaces
[00:04:50] RickHull: nginxxx: it is important if you want people to read your code
[00:05:02] weaksauce: it's important, full stop
[00:05:11] nginxxx: why shoud i drop l3
[00:05:25] RickHull: what is the purpose of L3? what does it accomplish?
[00:05:25] nginxxx: Theres nothing wrong
[00:05:38] nginxxx: I want to write in irb the hostname to resolve
[00:05:40] nginxxx: not in code
[00:06:03] rainbowz: has left #ruby: ("WeeChat 1.4")
[00:06:15] RickHull: ok, fair enough, in irb L3 will display the value of $address
[00:06:30] RickHull: but it would not have a value at that point
[00:06:53] RickHull: if we are to take your pasted code as written
[00:06:53] alveric2: has joined #ruby
[00:07:27] rfoust: has joined #ruby
[00:07:28] RickHull: irb is for playing around -- it will evaluate and print each expression -- but you should not share your code in this form
[00:07:32] RickHull: for others to read
[00:08:41] RickHull: the code you are sharing is full of "noise" and not much signal
[00:08:43] weaksauce: anything over a few lines should be run from a file and not irb...
[00:08:57] RickHull: and it makes it difficult for others to understand
[00:09:05] weaksauce: (a well indented file at that)
[00:09:07] RickHull: and you may not get as much help as you would like
[00:09:38] weaksauce: also, when you run `ruby myscript" it guarantees that you are free from any other variables being set accidentally
[00:10:13] RickHull: yes -- I like to "play around" in irb to get an understanding of the variable types, methods, how to structure things
[00:10:23] RickHull: then I will commit that knowledge to a file
[00:10:40] RickHull: and I can execute that file repeatedly without restarting irb and re-pasting code
[00:10:46] RickHull: or typing it in over-and-over
[00:11:38] postmodern: has joined #ruby
[00:13:07] RickHull: make a small edit to the file, then execute again, etc
[00:13:49] RickHull: If I don't have a good understanding of types, methods, structure, then it is probably too early to commit a lot of code to a file, as later lines will depend on prior lines
[00:14:17] RickHull: and any misconceptions committed to prior lines will make a lot of the later lines incorrect in both concept and execution
[00:15:01] d^sh: has joined #ruby
[00:16:07] milardovich: has joined #ruby
[00:16:43] leitz: Any experienced Ruby coders want to give a high level "You need to work on ..." review? My goal is to focus learning on "This should be my next couple topics" instead of "you need to learn everything first." My best Ruby code is: https://github.com/LeamHall/CT_Character_Generator
[00:17:14] leitz: ACTION just wrapped up this week's MongoDB class in one day.
[00:18:18] RickHull: leitz: I skimmed it the other day -- I am a minimalist, simplest-thing-that-could-possibly-work type
[00:18:44] leitz: ACTION has a note pad ready.
[00:19:05] RickHull: i have a couple minimalist libs / projects -- e.g. https://github.com/rickhull/loremarkov
[00:19:21] RickHull: maybe poke around -- `git clone` or `gem install`
[00:19:51] Psybur: has joined #ruby
[00:19:55] RickHull: e.g. https://github.com/rickhull/device_input
[00:20:19] RickHull: I think they are good examples of well structured, minimalist libs (gems)
[00:22:31] leitz: Cloned both.
[00:22:36] RickHull: if they make 100% sense, great!
[00:22:37] mtkd: has joined #ruby
[00:22:46] RickHull: i'm happy to answer any questions too :)
[00:23:09] RickHull: a good start after `git clone` is `rake -T`
[00:23:09] leitz: Of course, most meetings negate the need for loremarkov. :)
[00:24:21] leitz: simplecov in your .gitignore?
[00:25:01] leitz: Should flog, flay, and roodi be unavailable?
[00:25:23] orbyt_: has joined #ruby
[00:26:36] leitz: Ah, you're setting up for seattlerb tests that I haven't installed gems for.
[00:26:49] leitz: Gimme a sec.
[00:29:14] zautomata: has joined #ruby
[00:32:51] leitz: RickHull, fair to say your first suggestion would be shorter and less complex methods?
[00:34:33] leitz: Career.rb/muster_out is only 40 some lines. :)
[00:37:50] RickHull: leitz: yep, sorry, was afk for a bit
[00:38:17] RickHull: leitz: and yeah, it's nice when the Rakefile still works even if all the dev stuff isn't there
[00:38:36] RickHull: so those are just informative messages that some dev dependencies aren't installed so the rake tasks aren't available
[00:39:08] RickHull: shorter and less complex methods, definitely a good thing. also methods that are testable or test-friendly
[00:39:26] Technodrome: has joined #ruby
[00:40:36] jaequery: has joined #ruby
[00:40:52] leitz: I added those gems and everything worked. roodi complained about an empty Rescue, that was it.
[00:41:13] leitz: I'm running Ruby 2.5.0-p1, by the way.
[00:42:13] JBbanks: has joined #ruby
[00:42:52] RickHull: for loremarkov -- notice the hard stuff is in class methods, where the return value is a function the method arguments
[00:43:00] weaksauce: leitz curious why ruby 1.8 in your ct_character_generator
[00:43:03] leitz: I need to figure out better uses of classes and how to make smaller methods without a bazillion of them running around.
[00:43:04] RickHull: i.e. `def self.foo`
[00:43:21] oetjenj: has joined #ruby
[00:43:22] leitz: weaksauce, I was initially running the OS based Ruby; 1.8.7.
[00:43:22] RickHull: and the instance methods are mostly about giving a nice user interface
[00:43:57] leitz: There was this original idea to use Ruby at work. That got shot down. Probably for the better.
[00:44:29] JBbanks: has joined #ruby
[00:44:42] RickHull: where the return value of a method is strictly (or nearly so) dependent on the input args, you have a very testable method
[00:47:36] leitz: RickHull, why class methods? I get the idea of them but don't really get them.
[00:48:09] RickHull: class methods vs instance method -- class methods have no access to instance variables -- aka ivars -- aka private state
[00:48:29] RickHull: File.open(filename) versus f = File.new(filename); f.open
[00:48:31] weaksauce: leitz the Dir or File classes are a good example of when to use class methods... you don't want to create an object to use it
[00:48:54] leitz: Ah. Cool.
[00:48:59] weaksauce: unless you need some inner state to use the function correctly.
[00:49:11] leitz: ACTION scribbles...
[00:49:50] pilne: has joined #ruby
[00:50:10] RickHull: here's an example of someone else's lib that I refactored to use much less private state: https://github.com/rickhull/simplex/tree/modernize
[00:50:32] RickHull: it's easy for ruby newbies to try to write every piece of functionality as instance methods making heavy use of ivars
[00:50:48] RickHull: but this is very hard to test and make sense of
[00:51:47] RickHull: it's tempting to write methods that are basically just stored procedures that maybe take some args, read some ivar values, update other ivar values, and maybe have a significant return value
[00:52:16] RickHull: and there's nothing exactly "wrong" with this approach
[00:52:31] RickHull: with enough study and tracing, you can figure out what's really going on
[00:52:36] weaksauce: leitz fwiw it looks like muster_out is refactorable to be much shorter
[00:53:22] RickHull: i prefer a different structure and organization that makes the "dataflow" clear
[00:53:29] RickHull: args go in, return values come out
[00:53:39] workmad3: has joined #ruby
[00:54:08] weaksauce: also, eloquent ruby is one of the best programming books i have read hands down
[00:54:13] leitz: weaksauce, I agree. Am reading Booch's "OO Analysis and Design" and getting a better understanding of how to break things down.
[00:54:56] leitz: "Eloquent Ruby" is about eight inches from my clipboard where I make notes when not typing.
[00:55:17] weaksauce: leitz is there a specific reason you are using Hash.new(0) instead of just {}... do you need the default value being set for missing keys?
[00:56:26] milardov_: has joined #ruby
[00:56:32] leitz: weaksauce, there was something I hit a while back and the (0) solved the problem. Not sure what. However, I prefer setting defaults.
[00:56:49] leitz: Came from another book I read. :)
[00:56:54] RickHull: that hash default is a big pitfall IIRC -- rarely useful imho
[00:56:55] leitz: ACTION has lots of books.
[00:57:33] leitz: Yeah, I'm trying to remember what the issue was that it solved.
[00:57:37] weaksauce: usually it's for the case where you have a homogenized set of values that all start at 0 say the weights of a graph edge or something like that but yeah I agree that it's something that I don't use very often
[00:57:38] RickHull: actually, with integers it should be ok
[00:57:49] RickHull: but any mutable value will probably not do what you want
[00:58:14] weaksauce: leitz i would say that it was probably something along the lines of my_hash['missingkey'] += 1
[00:58:21] weaksauce: that's what usually fails me
[00:58:35] RickHull: >> h = Hash.new('str'); h[:bar] << 'baz'; h[:foo]
[00:58:36] ruby[bot]: RickHull: # => "strbaz" (https://eval.in/904775)
[00:59:15] RickHull: there is a single default object -- not a new object at every unset key
[00:59:56] weaksauce: yeah that's bitten me in the ass before
[01:00:00] RickHull: for a new object, you want h = Hash.new { |h, k| h[k] = 'str' }
[01:00:26] RickHull: >> h = Hash.new { |h, k| h[k] = 'str' }; h[:bar] << 'baz'; h[:foo]
[01:00:27] ruby[bot]: RickHull: # => "str" (https://eval.in/904776)
[01:02:39] RickHull: if you don't want to mess with default values and do e.g. accumulation: h[:foo] ||= 0; h[:foo] += 1
[01:02:55] cdg: has joined #ruby
[01:03:13] mn3m: has joined #ruby
[01:03:23] leitz: weaksauce, you're probably right on the 'missingkey' bit. My chat logs aren't clear on it.
[01:04:00] weaksauce: i tend to do that RickHull for most default values
[01:04:05] bougyman: the Hash.new(0) is used all over our code when the hash is comprised of counters.
[01:04:28] leitz: RickHull, I'm not sure symbols were allow as hash keys in 1.8.7. Or maybe I wasn't aware of them.
[01:04:59] weaksauce: the special syntax wasn't there but they were allowed I believe
[01:05:19] weaksauce: >> h = {test: :this, out: :yeah}
[01:05:20] ruby[bot]: weaksauce: # => {:test=>:this, :out=>:yeah} (https://eval.in/904777)
[01:06:46] weaksauce: i take it back no they weren't allowed
[01:07:01] leitz: Yeah, well, they are on the long list of things I need to learn. :)
[01:07:10] weaksauce: oh nevermind i am dumb. they were.
[01:07:19] weaksauce: https://eval.in/904780
[01:08:10] leitz: I think refactoring muster_out will be a fun challenge.
[01:08:12] weaksauce: it's a nice shorthand in newer rubies when the key is a symbol but you were allowed to do h = {:test => :this, :out => :yeah}
[01:08:50] leitz: There are lots of unique things to take care of in that process.
[01:09:56] jaruga: has joined #ruby
[01:11:14] weaksauce: you might want to use sample inside your benefits code
[01:11:36] weaksauce: >> (1..10).to_a.sample(3)
[01:11:37] ruby[bot]: weaksauce: # => [9, 3, 8] (https://eval.in/904781)
[01:11:42] weaksauce: >> (1..10).to_a.sample(1)
[01:11:43] ruby[bot]: weaksauce: # => [4] (https://eval.in/904782)
[01:12:45] RickHull: bougyman: I've been burned so many times by that form, I stopped using it. but it does indeed look good for numeric -- and frozen strings too I'd think
[01:13:16] bougyman: RickHull: how could you get burned by it for counters?
[01:13:49] RickHull: not with counters, well maybe an array of counters
[01:13:57] RickHull: i got burned by mutating
[01:14:03] bougyman: ah, understood.
[01:14:06] bougyman: Yes, only ints.
[01:14:14] bougyman: But for ints I do think it fits the use case perfectly.
[01:14:16] RickHull: almost certainly with arrays, probably hashes, maybe strings
[01:14:23] RickHull: yep -- that's what I was trying to say
[01:14:29] orbyt_: has joined #ruby
[01:14:49] RickHull: i.e. thanks for pointing it out -- I had given up on it :)
[01:15:21] baweaver: >>module Enumerable;def count_by(&block)group_by(&block).transform_values(&:length);end;end;[1,1,2,3,4,5,5,5,6].count_by(&:itself)
[01:15:22] ruby[bot]: baweaver: # => undefined method `transform_values' for {1=>[1, 1], 2=>[2], 3=>[3], 4=>[4], 5=>[5, 5, 5], 6=>[6]}:Ha ...check link for more (https://eval.in/904783)
[01:15:51] baweaver: >>module Enumerable;def count_by(&block)group_by(&block).map{|k,v|[k,v.size]}.to_h;end;end;[1,1,2,3,4,5,5,5,6].count_by(&:itself)
[01:15:52] ruby[bot]: baweaver: # => {1=>2, 2=>1, 3=>1, 4=>1, 5=>3, 6=>1} (https://eval.in/904784)
[01:15:54] kryptoz: has joined #ruby
[01:17:33] orbyt_: has joined #ruby
[01:17:45] joelwallis: has joined #ruby
[01:19:08] dinfuehr: has joined #ruby
[01:19:51] Psybur: has joined #ruby
[01:22:22] leitz: weaksauce, sample like this? https://github.com/LeamHall/CT_Character_Generator/blob/master/lib/Tools/Career.rb#L21
[01:28:45] al2o3-cr: RickHull: i think `PACK_MAP.fetch_values(*DEFINITION.values).join` reads better :)
[01:32:49] RickHull: ooh, I haven't used fetch_values before
[01:33:02] RickHull: when did that show up?
[01:33:33] al2o3-cr: 2.3 i think
[01:34:26] RickHull: what's the best way to write that in a 2.1 compatible way?
[01:34:56] al2o3-cr: leitz: if you ever find yourself use `to_i(16)` use `hex` instead :)
[01:35:05] al2o3-cr: RickHull: your way :P
[01:35:47] RickHull: ha -- not saying it has to be done that way. I like 2.0 compatibility, but I'm thinking about 2.2
[01:36:44] RickHull: could stuff something else in here: https://github.com/rickhull/device_input/blob/master/lib/device_input/compat.rb :)
[01:37:29] leitz: al203-cr, I'll have to look 'hex' up. Of course, now we're using extended hex; 0-9A-Z sans I and O.
[01:37:46] milardovich: has joined #ruby
[01:37:51] al2o3-cr: RickHull: all is good i think :)
[01:38:20] al2o3-cr: >> ["ff".to_i(16), "ff".hex]
[01:38:21] ruby[bot]: al2o3-cr: # => [255, 255] (https://eval.in/904785)
[01:40:24] charliesome: has joined #ruby
[01:43:09] al2o3-cr: for nginxxx if they come bk; https://gist.github.com/gr33n7007h/f310b3920b4b055459747e2320e85868
[01:43:41] al2o3-cr: cos i'm nice like that :p
[01:46:42] uZiel: has joined #ruby
[01:49:33] RickHull: https://github.com/rickhull/mudbug#quick-start
[01:49:40] mim1k: has joined #ruby
[01:49:44] RickHull: I like yours though
[01:51:55] Guest70176: has joined #ruby
[01:52:39] RickHull: this is kinda fun https://github.com/rickhull/mudbug/blob/master/examples/accepts_and_methods.txt
[01:54:44] Barrt: has joined #ruby
[01:55:17] al2o3-cr: interesting to say the least.
[01:56:33] al2o3-cr: bed time me thinks.
[01:59:13] RickHull: good night :)
[01:59:25] fyrril2: has joined #ruby
[01:59:46] leitz: Night! I'm late to bed myself but stuck on a refactor induce test failure. :(
[02:00:50] al2o3-cr: nite ya'll :)
[02:01:47] Jameser: has joined #ruby
[02:02:49] bmurt: has joined #ruby
[02:04:50] d^sh_: has joined #ruby
[02:09:40] Jameser: has joined #ruby
[02:10:49] Barrt: has joined #ruby
[02:12:37] jaequery: has joined #ruby
[02:13:41] Jameser: has joined #ruby
[02:14:26] leitz: Well, that was fun. Refactored off 11 lines of muster_out and found a repeated bug in several tests.
[02:15:23] jaequery: has joined #ruby
[02:15:30] weaksauce: leitz yeah that will do it
[02:19:50] Psybur: has joined #ruby
[02:20:07] hinbody: has joined #ruby
[02:21:42] Barrt: has joined #ruby
[02:22:26] leitz: Okay, time to totter off.
[02:25:52] Zamyatin: has joined #ruby
[02:27:35] milardov_: has joined #ruby
[02:28:43] milardov_: has joined #ruby
[02:29:24] drewmcmillan: has joined #ruby
[02:30:37] cschneid_: has joined #ruby
[02:36:41] zautomata: has joined #ruby
[02:37:55] tenderlove: has joined #ruby
[02:46:00] Jameser: has joined #ruby
[02:49:10] Cohedrin: has joined #ruby
[02:49:16] sucks: has joined #ruby
[02:50:39] gizmore|2: has joined #ruby
[02:53:33] motstgo: has joined #ruby
[02:53:56] workmad3: has joined #ruby
[02:54:02] Guest70176: has joined #ruby
[02:54:10] cdg: has joined #ruby
[02:56:12] nofxx__: has joined #ruby
[02:59:26] oetjenj: has joined #ruby
[02:59:49] elcontrastador: has joined #ruby
[03:00:19] enterprisey: has joined #ruby
[03:00:51] shoogz: has joined #ruby
[03:01:27] shoogz: has joined #ruby
[03:01:56] shoogz: has joined #ruby
[03:02:31] shoogz: has joined #ruby
[03:03:06] shoogz: has joined #ruby
[03:03:39] shoogz: has joined #ruby
[03:04:09] cdg: has joined #ruby
[03:04:25] oetjenj: has joined #ruby
[03:05:11] oetjenj: has joined #ruby
[03:05:21] kryptoz: has joined #ruby
[03:05:57] oetjenj: has joined #ruby
[03:06:48] oetjenj: has joined #ruby
[03:07:30] oetjenj: has joined #ruby
[03:14:10] enko: has joined #ruby
[03:15:29] Cohedrin: has joined #ruby
[03:17:56] guardianx: has joined #ruby
[03:18:30] jackjackdripper: has joined #ruby
[03:18:53] jackjackdripper: has joined #ruby
[03:19:52] Psybur: has joined #ruby
[03:20:10] Barrt: has joined #ruby
[03:20:33] tcopeland: has joined #ruby
[03:25:57] uZiel: has joined #ruby
[03:31:25] epochwolf: has joined #ruby
[03:31:34] Guest90_: has joined #ruby
[03:42:51] milardovich: has joined #ruby
[03:48:17] Cohedrin: has joined #ruby
[03:50:16] mim1k: has joined #ruby
[03:50:26] fyrril: has joined #ruby
[03:51:12] Barrt: has joined #ruby
[03:53:38] jtdoncas: has joined #ruby
[03:57:07] Jameser: has joined #ruby
[03:59:18] ASFT: has joined #ruby
[04:06:01] deadpoet: has joined #ruby
[04:06:37] kryptoz: has joined #ruby
[04:09:12] bwilson: has joined #ruby
[04:18:44] shortdudey123: has joined #ruby
[04:19:54] Psybur: has joined #ruby
[04:20:42] Barrt: has joined #ruby
[04:21:27] ramortegui: has joined #ruby
[04:24:12] milardov_: has joined #ruby
[04:26:32] kies: has joined #ruby
[04:30:31] maum: has joined #ruby
[04:31:52] Guest70176: has joined #ruby
[04:32:50] leeice1: has joined #ruby
[04:38:04] mson: has joined #ruby
[04:44:38] leeice1: has left #ruby: ()
[04:50:13] orbyt_: has joined #ruby
[04:51:33] dhollinger: has joined #ruby
[04:51:40] govg: has joined #ruby
[04:52:45] gix: has joined #ruby
[04:54:13] workmad3: has joined #ruby
[04:58:47] kryptoz: has joined #ruby
[04:59:48] nofxx: has joined #ruby
[05:03:16] Barrt: has joined #ruby
[05:05:31] milardovich: has joined #ruby
[05:05:35] jamesaxl: has joined #ruby
[05:06:54] nicesignal: has joined #ruby
[05:19:49] Psybur: has joined #ruby
[05:19:50] seggy: has joined #ruby
[05:22:46] seggy: has joined #ruby
[05:23:22] Barrt: has joined #ruby
[05:28:21] iamarun: has joined #ruby
[05:29:56] astrobunny: has joined #ruby
[05:31:42] k3rn31_: has joined #ruby
[05:32:02] helpa-bot: has joined #ruby
[05:33:11] Guest70176: has joined #ruby
[05:34:02] helpa: has joined #ruby
[05:38:54] mjolnird: has joined #ruby
[05:39:51] Exhiled: has joined #ruby
[05:42:30] rabajaj: has joined #ruby
[05:43:52] Guest17927: has joined #ruby
[05:48:26] hays: has joined #ruby
[05:48:26] hays: has joined #ruby
[05:49:03] minimalism: has joined #ruby
[05:49:06] hays: i have ruby on a windows machine (rubyinstaller) and when I did gem update --system and gem update, I got an error with did_you_mean gem, saying it needed 2.4.0
[05:49:19] hays: is it safe to just uninstall this gem?
[05:49:35] havenwood: hays: Yes, it's fine to uninstall it. What version are you on?
[05:49:45] hays: 2.3.2 i think it was
[05:50:47] mim1k: has joined #ruby
[05:51:01] hays: 2.3.1p112
[05:53:28] hays: its kinda weird, it seems to know that it can't upgrade it.. yet it tries and fails anyway
[05:54:10] hays: seems like gem update should just leave it at the last version supporting my version of ruby
[05:54:42] michael1: has joined #ruby
[05:56:46] havenwood: hays: that's typically what happens
[05:56:49] Barrt: has joined #ruby
[05:57:05] hays: i guess gem update is a bit risky then
[05:57:25] havenwood: ERROR: Error installing did_you_mean:
[05:57:25] havenwood: did_you_mean requires Ruby version >= 2.4.0.
[05:57:40] havenwood: hays: ^ that's the error you get if you try to update did_you_mean on Ruby 2.3
[05:58:45] havenwood: hays: The version of did_you_mean that you have is the latest version that works with Ruby 2.3.
[05:59:07] havenwood: You don't need to uninstall it just because it can't be updated, but you're free to if you want.
[05:59:10] hays: is there a way to freeze the version of that gem so gem update ignores it
[06:04:52] ramfjord: has joined #ruby
[06:06:15] st4l1n: has joined #ruby
[06:07:00] havenwood: hays: FWIW (little) you can silence warnings: gem update 2>/dev/null
[06:07:15] hays: you done the rubyinstaller 2.4.2 by any chance? I am getting an error on installing MSYS2+MINGW toolchain
[06:07:36] st4l1n: Hey, I'm newish to ruby and wishing to become an absolute expert over the next few years. I've heard a great way to go about this is to request a mentor. Can anyone suggest places for this or other methodoloiges/books for becoming an expert in ruby
[06:08:05] apeiros_: st4l1n: please change your nick
[06:08:15] havenwood: hays: I think it's confusing that did_you_mean gets listed as an updated gem when it doesn't update. And I agree the warning is odd. I'm not sure on the optimal fix but it seems worth looking at.
[06:09:42] marcosstanos: As for my question..
[06:10:39] apeiros: in the topic, there's a book list. there are a couple of free online training places like exercise.io
[06:10:50] Guest70176: has joined #ruby
[06:11:02] apeiros: personally I prefer the way of "just get a project and start working". you can always ask here about advices on your code.
[06:11:05] havenwood: marcosstanos: RubyConf has an official guides and scholars program. That's a great place to find a mentor. You might consider applying for an opportunity scholarship next year.
[06:11:20] cdg: has joined #ruby
[06:12:12] havenwood: marcosstanos: Local meet-ups are a good place to find mentorship. Or if you can find a workplace with mentors that's ideal.
[06:12:17] marcosstanos: What level should I be at to get the most value out of such a programme?
[06:13:21] havenwood: marcosstanos: Most of the scholars this year had about a year experience. Some had none. One had four years.
[06:13:37] baweaver: Also see the book list: https://goo.gl/wpGhoQ
[06:14:53] havenwood: marcosstanos: Here's a site where you can pay for in-depth mentorship: https://www.bloc.io/mentors
[06:15:14] havenwood: marcosstanos: You can certainly find an unpaid mentor, it just takes more searching.
[06:15:38] havenwood: And feel free to ask lots of questions here!
[06:15:42] hays: its weird to be running pacman on a win7 machine. haha
[06:15:57] hays: someone loves arch
[06:17:47] marcosstanos: Fantastic, thanks for the resources
[06:19:39] hays: havenwood: i agree its weird. but i've decided to focus forward and just put 2.4 on here and fix the bugs that happen if any
[06:19:50] Psybur: has joined #ruby
[06:19:58] hays: its a lab anyway
[06:21:04] Nilium: Cue everyone trying to hang hays.
[06:21:34] hays: lol could happen. but rolling back to 2.3 on a single laptop is also not that bad
[06:21:53] hays: and im the one that owns this code so im really just hurting myself if anything happens
[06:22:13] baweaver: Nilium: Now why would we do that?
[06:22:21] Nilium: Well, I meant the lab users.
[06:22:26] Cohedrin: has joined #ruby
[06:22:33] Nilium: #ruby is very friendly.
[06:23:15] Nilium: Which is actually part of the reason I still hang around here, compared to most other language channels.
[06:23:33] i8igmac: has joined #ruby
[06:24:09] SeepingN: has joined #ruby
[06:25:02] baweaver: We try and be at least :)
[06:26:19] hays: ruby community is great. language is great too. I mean I also like Python because its hard to beat numpy+scipy+pandas+matplotlib
[06:26:39] Nilium: ACTION likes Erlang.
[06:26:43] Nilium: Insert cricket sounds here.
[06:27:09] hays: haha i remember a guy in college liking erlang. way before FP was cool
[06:27:21] baweaver: The cool kids use Elixir now
[06:27:22] hays: i got into Scheme myself
[06:27:32] baweaver: Just ask Radar, he's even writing a book for it
[06:27:37] Nilium: ACTION still doesn't really like Elixir's syntax.
[06:27:51] baweaver: Radar: was it still "a" or "multiple" now?
[06:28:03] hays: all the real FP seems to be done in EMCAScript these days. who'd have ever thought that would happen
[06:28:14] Nilium: Let's assume multiple at some point.
[06:28:26] baweaver: I even make a crack about Scheme in my book: Where'd we get the car? I think from something called LISP, such a little Schemer it is. Jokes aside, car is just an example object for us to play with for now.
[06:28:48] baweaver: Under "What If?" - https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/the-truth-will-set-you-free.html
[06:28:49] marcosstanos: wow, Bloc.io is incredibly expensize. Are there any cheaper mentor programmes?
[06:30:14] hays: haha im defragging this hard drive
[06:30:24] hays: windows. funny
[06:30:49] baweaver: Haven't heard of a defrag in years
[06:31:18] hays: this laptop runs win7 because there's some old hardware it needs to connect to
[06:33:27] milardovich: has joined #ruby
[06:35:54] dionysus69: has joined #ruby
[06:38:00] biberu: has joined #ruby
[06:38:53] Technodrome: has joined #ruby
[06:42:06] BioSpider: has joined #ruby
[06:50:24] Barrt: has joined #ruby
[06:54:30] workmad3: has joined #ruby
[06:55:26] baweaver: Oh hey, RickHull is famous now: https://twitter.com/yukihiro_matz/status/933225728518139904
[06:55:56] havenwood: RickHull: congrats!
[06:59:01] RickHull: ha, thanks. the little germ of the idea is a total hack
[06:59:36] RickHull: "let's take the example of 'hello world' as a C string, and see how much .rb we can shove in there"
[07:00:17] RickHull: but I figured out git submodules and how to get stuff building automatically with rake tasks. like just this evening
[07:00:59] RickHull: it might actually be reasonable once it does the same thing with bytecode
[07:04:57] arquebus: has joined #ruby
[07:07:25] charliesome: has joined #ruby
[07:09:15] oetjenj: has joined #ruby
[07:12:48] lexruee: has joined #ruby
[07:14:46] milardov_: has joined #ruby
[07:15:39] peter1: has joined #ruby
[07:15:59] oetjenj: has joined #ruby
[07:17:21] snickers: has joined #ruby
[07:19:49] Psybur: has joined #ruby
[07:21:39] Mortomes|Work: has joined #ruby
[07:22:34] conta: has joined #ruby
[07:26:10] andikr: has joined #ruby
[07:27:23] kickr_: has joined #ruby
[07:28:13] kickr_: has joined #ruby
[07:29:22] kickr: has joined #ruby
[07:31:25] Flonk: has joined #ruby
[07:36:16] Guest70176: has joined #ruby
[07:39:16] Barrt: has joined #ruby
[07:41:00] hightower2: has joined #ruby
[07:50:40] gone_haywire: has joined #ruby
[07:51:13] mim1k: has joined #ruby
[07:52:12] mjolnird: has joined #ruby
[07:56:10] milardovich: has joined #ruby
[07:59:29] Mortomes|Work: has joined #ruby
[08:02:04] tAn: has joined #ruby
[08:03:45] aufi: has joined #ruby
[08:05:02] ramfjord: has joined #ruby
[08:05:08] TomyWork: has joined #ruby
[08:12:19] ruby[bot]: -b AliasSpider!*@*$#ruby-banned
[08:13:18] kapil___: has joined #ruby
[08:14:12] DoubleMalt: has joined #ruby
[08:14:50] cschneid_: has joined #ruby
[08:16:22] waveprop: hays which scheme
[08:18:13] Barrt: has joined #ruby
[08:18:42] reber: has joined #ruby
[08:19:51] Psybur: has joined #ruby
[08:23:19] tao_: has joined #ruby
[08:23:45] guille-moe: has joined #ruby
[08:28:21] claudiuinberlin: has joined #ruby
[08:31:47] faces: has joined #ruby
[08:32:28] mark_66: has joined #ruby
[08:33:54] Technodrome: has joined #ruby
[08:37:31] milardov_: has joined #ruby
[08:37:40] radanisk_: has joined #ruby
[08:38:06] InfinityFye: has joined #ruby
[08:45:07] kapil___: I have two list. In first function I iterate first list and print some code. How should I inject respective values from second list in it?
[08:45:49] Technodrome: has joined #ruby
[08:46:06] tomphp: has joined #ruby
[08:49:16] konsolebox: has joined #ruby
[08:50:03] mim1k: has joined #ruby
[08:52:29] ur5us: has joined #ruby
[08:55:16] Bish: >> ('a'..'z').zip(0..26).to_a
[08:55:18] ruby[bot]: Bish: # => [["a", 0], ["b", 1], ["c", 2], ["d", 3], ["e", 4], ["f", 5], ["g", 6], ["h", 7], ["i", 8], ["j", 9], ...check link for more (https://eval.in/905066)
[08:55:23] Bish: i just learnd that trick :p
[08:55:24] Bish: kapil___:
[08:55:41] Bish: you can zip 2 arrays of same size, and it will be zipped, like a zipper.
[08:55:47] workmad3: has joined #ruby
[08:56:22] jusa: has joined #ruby
[08:56:30] guille-moe: has joined #ruby
[08:56:32] Bish: is that what you want?
[08:56:48] xall: has joined #ruby
[08:57:04] jusa: has left #ruby: ()
[08:57:35] silvermine: has joined #ruby
[08:57:54] Bish: kapil___: otherwise you could do some .each_with_index shenanigans
[08:58:35] Bish: >> ('a'..'z').each_with_index.map { |char,idx| "#{char}#{idx}" }
[08:58:36] ruby[bot]: Bish: # => ["a0", "b1", "c2", "d3", "e4", "f5", "g6", "h7", "i8", "j9", "k10", "l11", "m12", "n13", "o14", "p15 ...check link for more (https://eval.in/905068)
[08:59:54] burgestrand: has joined #ruby
[09:08:56] ur5us: has joined #ruby
[09:10:50] Bish: asm>> ('a'..'z').each_with_index.map { |char,idx| "#{char}#{idx}" }
[09:10:51] ruby[bot]: Bish: I have disassembled your code, the result is at https://eval.in/905085
[09:14:37] cdg: has joined #ruby
[09:16:12] cdg_: has joined #ruby
[09:16:52] mrig: has joined #ruby
[09:17:17] rouge: has joined #ruby
[09:18:28] kapil___: I also want remaining items in the end
[09:18:34] FastJack: has joined #ruby
[09:18:42] milardovich: has joined #ruby
[09:19:01] Bish: kapil___: can you give a short example, i have no clue what remaining items in the end mean
[09:19:04] luminor: has joined #ruby
[09:19:10] Bish: are your 2 arrays not of same size?
[09:19:40] kapil___: ('a'..'z').zip(0..40).to_a
[09:19:53] Bish: >> (1..5).zip(1..3).map(&:itself)
[09:19:54] ruby[bot]: Bish: # => [[1, 1], [2, 2], [3, 3], [4, nil], [5, nil]] (https://eval.in/905088)
[09:20:00] cdg: has joined #ruby
[09:20:00] Psybur: has joined #ruby
[09:20:04] Bish: like this?
[09:20:04] Guest70176: has joined #ruby
[09:20:08] bronson: has joined #ruby
[09:20:16] Bish: >> (1..5).zip(1..3).map(&:compact)
[09:20:17] ruby[bot]: Bish: # => [[1, 1], [2, 2], [3, 3], [4], [5]] (https://eval.in/905089)
[09:20:21] Bish: or like this?
[09:20:25] Bish: >> (1..5).zip(1..3).map(&:compact).flatten
[09:20:26] ruby[bot]: Bish: # => [1, 1, 2, 2, 3, 3, 4, 5] (https://eval.in/905090)
[09:20:26] Bish: or this?
[09:21:02] mrig: Hello :); I am not a regular ruby user but I do use it for jekyll on my static github pages site, I was wondering if any one could help me with a little issue; When I set the site up I found a Gemfile.lock file provided by Github to insure the correct rubygem versions for their servers; I don't seem to be able tofind a more recent version of this file.
[09:21:04] kapil___: Second list is bigger size
[09:21:24] Bish: >> (1..3).zip(1..5).map(&:compact).flatten
[09:21:26] ruby[bot]: Bish: # => [1, 1, 2, 2, 3, 3] (https://eval.in/905091)
[09:21:46] Bish: no, that doesn't seem to work
[09:23:15] kapil___: Can you make a function for it?
[09:25:07] Bish: >> well, it's just a question of order
[09:25:08] ruby[bot]: Bish: # => /tmp/execpad-17d54b6672df/source-17d54b6672df:2: syntax error, unexpected tSTRING_BEG, expecting key ...check link for more (https://eval.in/905095)
[09:25:20] kapil___: mrig: run 'bundle update' to update gems
[09:26:22] kapil___: What (&:compact) means?
[09:28:28] Bish: >> (1..5).zip(1..3).map(&:compact).map(&:reverse).flatten
[09:28:30] ruby[bot]: Bish: # => [1, 1, 2, 2, 3, 3, 4, 5] (https://eval.in/905101)
[09:28:34] mim1k: has joined #ruby
[09:28:45] Bish: this could be what you want, i guess
[09:29:55] Bish: but easier to understand might be
[09:31:07] Bish: >> first = [1,2,3,4,5];second = [1,2,3]; first.each_with_index { |e,idx| [e,second[idx]].compact }.flatten
[09:31:08] ruby[bot]: Bish: # => [1, 2, 3, 4, 5] (https://eval.in/905111)
[09:31:17] kapil___: Thanks Bish
[09:32:17] Bish: >> first = [1,2,3,4,5];second = [1,2,3]; first.each_with_index.map { |e,idx| [e,second[idx]].compact }.flatten
[09:32:18] ruby[bot]: Bish: # => [1, 1, 2, 2, 3, 3, 4, 5] (https://eval.in/905115)
[09:32:36] mim1k_: has joined #ruby
[09:34:18] kapil___: Yes that's I want
[09:35:38] luminor: has joined #ruby
[09:38:55] luminor_: has joined #ruby
[09:40:37] Sylario: has joined #ruby
[09:43:44] Beams: has joined #ruby
[09:43:58] cek: has joined #ruby
[09:44:09] mrig: kapil___, ah, I have just changed distro and have not looked at the ruby instillation as yet; This is required as I have recieved a complaint from github about one of the pacages linked in the gemfile.lock listing, all that is required is the current list from github I think, was wondering if this is still in use, and as such if I could get a pointer to it from here, could be that it is no longer a thing :)
[09:44:35] mrig: heh, sorry spell check not working yet on weechat either :/
[09:45:28] cek: ask weechat about tiananmen square , you'll get wonderful results
[09:47:02] cek: ok, my question: how do you get an intersection of arrays a and b so that you get full b in case a is empty? can't think a solution without a conditional
[09:47:44] dminuoso: cek: &ri Array #-
[09:47:53] dminuoso: &ri Array #- cek
[09:47:53] `derpy: cek: http://ruby-doc.org/core-2.4.1/Array.html, http://ruby-doc.org/core-2.4.1/Array.html#method-i-2D
[09:48:27] mrig: cek huh?
[09:50:42] cek: a & b or a , but so that it actually works
[09:52:06] xall: has joined #ruby
[09:52:10] jaruga: has joined #ruby
[09:55:24] _xall: has joined #ruby
[09:57:18] DoubleMalt: has joined #ruby
[09:57:34] enterprisey: has joined #ruby
[10:00:00] milardov_: has joined #ruby
[10:01:22] cschneid_: has joined #ruby
[10:05:18] ramfjord: has joined #ruby
[10:06:05] cdg: has joined #ruby
[10:19:20] dminuoso: cek: Whats wrong with a conditional?
[10:19:52] Psybur: has joined #ruby
[10:20:08] Serpent7776: has joined #ruby
[10:29:28] gone_haywire: has joined #ruby
[10:30:54] uZiel: has joined #ruby
[10:33:25] tvw: has joined #ruby
[10:34:37] ldnunes: has joined #ruby
[10:37:28] jenrzzz: has joined #ruby
[10:37:29] jenrzzz: has joined #ruby
[10:38:26] workmad3: has joined #ruby
[10:38:38] mrig: has joined #ruby
[10:39:48] GodFather: has joined #ruby
[10:45:37] ccooke: has joined #ruby
[10:47:01] milardovich: has joined #ruby
[10:50:32] xall: has joined #ruby
[10:56:54] s2013: has joined #ruby
[10:59:12] ferr: has joined #ruby
[11:01:44] ferr: has left #ruby: ()
[11:04:55] SirOliver: has joined #ruby
[11:06:47] ShekharReddy: has joined #ruby
[11:13:41] ohcibi: has joined #ruby
[11:15:40] stamina: has joined #ruby
[11:16:07] Kyle: has joined #ruby
[11:19:50] Psybur: has joined #ruby
[11:19:56] purpleunicorn: has joined #ruby
[11:20:53] rikkipitt: has joined #ruby
[11:23:22] yeticry_: has joined #ruby
[11:24:19] SirOliver: has left #ruby: ("Ave")
[11:25:31] hfp_work: has joined #ruby
[11:25:37] lexruee: has joined #ruby
[11:28:14] milardov_: has joined #ruby
[11:28:54] Guest70176: has joined #ruby
[11:29:16] morfin: has joined #ruby
[11:29:26] morfin: has left #ruby: ()
[11:35:04] Mortomes|Work: has joined #ruby
[11:36:21] Technodrome: has joined #ruby
[11:38:00] nobitanobi: has joined #ruby
[11:39:51] zanoni: has joined #ruby
[11:40:19] marr: has joined #ruby
[11:47:37] silvermine: has joined #ruby
[11:48:36] tomphp: has joined #ruby
[12:04:57] zautomata: has joined #ruby
[12:05:33] ramfjord: has joined #ruby
[12:08:11] tacoboy: has joined #ruby
[12:09:34] milardovich: has joined #ruby
[12:16:36] lupine: has joined #ruby
[12:17:58] Guest90927: does anyone have an idea why this doesn't work? https://gist.github.com/sideshowbandana/db1ff1791a6b932be8b3f422037a5561
[12:18:52] Guest90927: the defined function fails with a no method error because $1 isn't set... however the call to gsub outside the function works just fine
[12:19:46] tobiasvl: Guest90927: shouldn't the regex be /\[([A-Z]*[ A-Z_0-9]*)\]
[12:19:48] Psybur: has joined #ruby
[12:19:51] tobiasvl: note the [A-Z]*
[12:20:21] tobiasvl: otherwise you'll just match one letter between A-Z followed by any number of groups of space or alphanumerals
[12:20:43] Guest90927: ah that could be it... but how does the second gsub succeed?
[12:20:46] tobiasvl: I also don't know if the space should be inside those brackets, but you know what you want to match better than me
[12:21:37] cdg: has joined #ruby
[12:22:12] Guest90927: added a comment on the result that I get in IRB
[12:22:34] zenspider: has joined #ruby
[12:22:41] Guest90927: it's almost as if I loose the gsub context when calling from within a function
[12:24:07] im0nde: has joined #ruby
[12:24:40] benjen: has joined #ruby
[12:25:35] tacoboy: has joined #ruby
[12:26:59] burgestrand: Guest90927 if you want to have some more fun, try swapping the order of gsub/doit
[12:28:03] Guest90927: ya... that gets it to work...
[12:28:03] matthewd: Guest90927: $1 looks like a global, but is actually a specially-scoped local.. tbh I'm actually not sure whether that's relevant in this case
[12:28:15] Guest90927: I think because gusb stores the global var and doesn't clear it after?
[12:28:41] Kyle: I've also tried using the '\1' syntax
[12:28:44] Kyle: same result
[12:28:51] matthewd: Yeah, using different strings should confirm that
[12:29:46] burgestrand: kyle__ $1 uses $~, and $~ is not really global (it doesn't leak past the current thread if I remember correctly), it's the last match in the current *scope*
[12:30:15] burgestrand: Oh darn wrong kyle.
[12:30:25] burgestrand: Guest7623 check this out for example https://eval.in/905381
[12:30:28] Guest7623: ah that would make sense as to why Regexp.last_match was also nil when I tried that
[12:30:51] Guest7623: good call matthewd, should have used the yielded match object
[12:30:52] burgestrand: Guest7623 as matthewd mentioned, use the `match`-parameter that you're passed
[12:31:07] lupine: has joined #ruby
[12:31:20] Guest7623: heh... seems to only yield a string though
[12:31:27] Guest7623: not matchdata
[12:32:32] k3rn31: has joined #ruby
[12:32:40] dviola: has joined #ruby
[12:33:01] burgestrand: Ah yeah, you're right, gsub yields a string :(
[12:33:27] matthewd: Oh, it must detect the arity
[12:33:32] matthewd: Add another parameter to your block
[12:35:13] Guest7623: the second argument ends up being nil when I have 2 params
[12:37:50] Guest7623: I'm stumped
[12:38:26] Guest7623: I swear it has something to do with the binding
[12:40:30] kickr: has joined #ruby
[12:42:04] kickr_: has joined #ruby
[12:43:02] Guest7623: ya... it definitely has something to do with where the proc is defined
[12:43:03] tacoboy: has joined #ruby
[12:43:15] burgestrand: Yeah, because the proc inherits its scope
[12:44:03] Guest7623: would it be possible to modify the scope?
[12:45:41] Guest7623: updated the gist... defining the proc within the functions scope totally works
[12:47:37] deadpoet: has joined #ruby
[12:49:51] DoubleMalt: has joined #ruby
[12:50:14] lupine: has joined #ruby
[12:50:54] milardov_: has joined #ruby
[12:54:01] silvermine: has joined #ruby
[12:56:11] vondruch_: has joined #ruby
[12:57:52] Ninja0012: has joined #ruby
[12:59:15] VladGh: has joined #ruby
[13:02:43] Technodrome: has joined #ruby
[13:05:08] ramfjord: has joined #ruby
[13:08:03] Ninja0012: has left #ruby: ()
[13:10:58] dcluna_: has joined #ruby
[13:12:53] milardovich: has joined #ruby
[13:13:20] Jameser: has joined #ruby
[13:17:02] veeti: has joined #ruby
[13:18:34] tacoboy: has joined #ruby
[13:19:52] Psybur: has joined #ruby
[13:23:26] synthroid: has joined #ruby
[13:27:03] kryptoz: has joined #ruby
[13:28:22] gone_haywire: has joined #ruby
[13:31:42] nadir: has joined #ruby
[13:32:13] milardov_: has joined #ruby
[13:35:34] drowze: has joined #ruby
[13:38:27] Guest7623: has joined #ruby
[13:40:40] truenito: has joined #ruby
[13:41:15] uZiel: has joined #ruby
[13:43:50] im0nde: has joined #ruby
[13:45:15] ^mtkd: has joined #ruby
[13:47:42] sentor```: has joined #ruby
[13:50:51] deepredsky: has joined #ruby
[13:52:22] apparition: has joined #ruby
[13:52:25] im0nde_: has joined #ruby
[13:53:06] rfoust: has joined #ruby
[13:54:12] im0nde__: has joined #ruby
[13:58:56] burgestrand: has joined #ruby
[14:02:27] plexigras: has joined #ruby
[14:02:37] deepredsky: has joined #ruby
[14:06:13] Guest7623: has joined #ruby
[14:08:41] vondruch: has joined #ruby
[14:10:06] tomphp: has joined #ruby
[14:10:57] vondruch: has joined #ruby
[14:11:45] iamarun: has joined #ruby
[14:15:11] tomphp_: has joined #ruby
[14:16:05] mtkd: has joined #ruby
[14:16:34] ramortegui: has joined #ruby
[14:18:35] nowhere_man: has joined #ruby
[14:19:01] fredx: has joined #ruby
[14:19:58] Psybur: has joined #ruby
[14:21:42] uZiel: has joined #ruby
[14:23:33] guille-moe: has joined #ruby
[14:24:08] iceden: has joined #ruby
[14:24:12] drowze: has joined #ruby
[14:25:47] safetypin: has joined #ruby
[14:30:21] veeti: has joined #ruby
[14:30:40] shinnya: has joined #ruby
[14:30:47] InfinityFye: has joined #ruby
[14:34:07] vondruch_: has joined #ruby
[14:35:03] TinkerTyper: has joined #ruby
[14:35:13] br0d1n: has joined #ruby
[14:35:23] plexigras: has joined #ruby
[14:38:33] DLSteve: has joined #ruby
[14:39:21] Technodrome: has joined #ruby
[14:41:17] fredx: has joined #ruby
[14:41:27] LebedevRI: has joined #ruby
[14:41:42] Guest70176: has joined #ruby
[14:41:45] polishdub: has joined #ruby
[14:44:20] kryptoz: has joined #ruby
[14:48:47] veeti: has joined #ruby
[14:49:33] larcara: has joined #ruby
[14:53:07] tomphp: has joined #ruby
[14:54:32] silvermine: has joined #ruby
[14:56:37] tomphp: has joined #ruby
[15:00:10] tomphp: has joined #ruby
[15:03:42] kryptoz: has joined #ruby
[15:04:53] uZiel: has joined #ruby
[15:05:02] mson: has joined #ruby
[15:05:06] kryptoz: has joined #ruby
[15:07:05] Bish: can a proc reference itself?
[15:07:10] Bish: no, right?
[15:08:10] c-c: is it an object?
[15:08:32] Bish: i mean, can you in a block, get the reference of a block.
[15:08:59] Bish: >> [1,2,[3]].map { |a| case a;when Array;???;else a+1;end; }
[15:09:01] ruby[bot]: Bish: # => /tmp/execpad-317b2134579b/source-317b2134579b:2: syntax error, unexpected ';' ...check link for more (https://eval.in/905446)
[15:09:01] Bish: kinda like this
[15:09:25] Bish: or will i have to make a proc
[15:10:26] c-c: I don't understand
[15:10:41] Bish: i want to add 1 to every element in there, recusrively
[15:10:47] c-c: in your example. what you test in the case is some object from array, not a proc
[15:10:48] Bish: (i do not really want to do that, it's an example)
[15:11:01] Bish: the proc/block says " add 1"
[15:11:14] Bish: i want it to to it in every array element, if it's an array i want to go deeper
[15:11:29] c-c: I get the temptation to say "forget procs"
[15:11:52] Bish: hows that.. i need procs/methods for that.. if i don't have a reference then what am i calling
[15:12:02] c-c: Bish: so you want to do something for .each, recursively
[15:12:17] Bish: well, and conditionally.
[15:12:44] c-c: you are not calling? .each or .map is calling. Neither is recursive.
[15:13:31] milardovich: has joined #ruby
[15:14:26] c-c: Bish: I think what you want is 1) some method that handles_array_item 2) a walker that walks the array and calls handles_array_item when the item at hand is an array
[15:15:02] Bish: >> myproc = proc{|a| a.each { |x| case x; when Array; x.map(&:myproc); else x+1; end; } };myproc.call [1,2,3]
[15:15:03] ruby[bot]: Bish: # => [1, 2, 3] (https://eval.in/905458)
[15:15:17] iceden: has joined #ruby
[15:15:18] Bish: >> myproc = proc{|a| a.map { |x| case x; when Array; x.map(&:myproc); else x+1; end; } };myproc.call [1,2,3]
[15:15:19] ruby[bot]: Bish: # => [2, 3, 4] (https://eval.in/905459)
[15:15:22] Bish: i want exactly this
[15:15:26] Bish: but not to have myproc.
[15:15:41] Bish: >> myproc = proc{|a| a.each { |x| case x; when Array; x.map(&:myproc); else x+1; end; } };myproc.call [1,2,[3]]
[15:15:42] ruby[bot]: Bish: # => undefined method `myproc' for 3:Fixnum (NoMethodError) ...check link for more (https://eval.in/905460)
[15:15:44] Rapture: has joined #ruby
[15:15:52] c-c: Bish: in your handles_array_item, you can use block arg as: def h_a_item ( array, &blk )
[15:15:55] tomphp: has joined #ruby
[15:16:14] Bish: i know.. but i want it without having a reference
[15:16:15] c-c: then you can do stuff like &blk.call
[15:16:38] c-c: wow, I thought you asked if you can have a reference
[15:16:52] Bish: now, i want a reference from the blcok that i am in
[15:16:57] Bish: i know blcoks dont have references, etc.
[15:17:02] Bish: but would be super cool if you could
[15:17:17] c-c: hehe you could pass in the ref with &blk.call
[15:17:28] c-c: Bish: do you know pry?
[15:17:42] knight33: has joined #ruby
[15:17:46] c-c: get pry now
[15:18:51] c-c: then run pry from "when Array" and other cases. Test to see if you can refer to itself.
[15:19:49] Psybur: has joined #ruby
[15:20:58] safetypin: has joined #ruby
[15:22:26] oleo: has joined #ruby
[15:23:24] Bish: i use pry
[15:23:54] Bish: i don't want the "self" refernece, i want the reference to the block.
[15:24:33] Bish: something like
[15:25:18] Bish: proc{ "i am a block and i can call myself with #{magic_block.call}"}.call
[15:25:23] Bish: being an endless loop of
[15:25:30] Bish: i am a block and i call myself with i am a block..
[15:26:46] dminuoso: Yes you can.
[15:26:53] Bish: dminuoso: how how how
[15:27:40] dminuoso: F = -> () { F.() }
[15:27:43] rippa: has joined #ruby
[15:28:03] Bish: well that's a proc again
[15:28:12] dminuoso: Or without contants it works too.
[15:28:19] dminuoso: oh a block, no dice.
[15:28:27] dminuoso: Why the fear of procs?
[15:28:31] dminuoso: You know what a block really is right?
[15:28:41] Bish: not fear.. i think it's cleaner to read for recursive stuff
[15:28:49] dminuoso: It's just a microoptimized proc.
[15:28:52] Bish: dminuoso: you told me, just 2 days ago
[15:29:04] Bish: but it would be cool to be able to reference the current block as a proc
[15:29:21] Bish: so ruby sees it, implicitly creates a proc with same attributes as the block
[15:29:34] Bish: inside of a block?
[15:29:47] dminuoso: You just need to do this initially.
[15:30:35] Bish: thrilling, what will it be
[15:30:35] dminuoso: OH BOY. RUBY I HATE YOU
[15:30:45] Bish: ACTION waits one sec.
[15:31:06] dminuoso: A = {}; def m(); A[:a] = Proc.new; A[:a].() end; m() { A[:a].() }
[15:31:18] dminuoso: Not sure that this is particularly readable, but hey.
[15:31:35] dminuoso: Im all game when it comes to making nonsense with functions.
[15:31:51] Bish: well, you reference it again..
[15:32:07] Bish: im thinking of a magic variable like $~ which is always there
[15:32:10] dminuoso: Stop using blocks when you want to do shenanigans.
[15:32:23] Bish: that has nothing to do with shenanigans, i am sure this can be useful
[15:32:28] dminuoso: There is no advantage of blocks unless you're writing a core library that cant afford to introduce artificial overhead.
[15:33:12] dminuoso: Bish: If you want something useful, use this: ->(f) { ->(x) { x[x] }[->(x) { f[->(y) { x[x][y] }] }] }
[15:33:17] dminuoso: Lets you do recursion without recursion.
[15:33:55] Bish: well the advantage in this case would be, not to have a proc reference saved somehwere
[15:34:28] Bish: dminuoso: ycombinator? i didn't read it, just guessing
[15:35:04] Bish: you can write it that fast out of your head?
[15:35:05] Bish: crazy mf
[15:36:23] Bish: but that one is actually really readable
[15:36:34] Bish: having seen javascript ones, etc.
[15:36:49] dminuoso: Bish: No its not. :|
[15:37:37] Bish: trying to use it right now
[15:39:12] Bish: how do i break :(
[15:41:25] LebedevRI: has left #ruby: ()
[15:43:05] krawchyk: has joined #ruby
[15:43:09] dminuoso: Bish: In Haskell its as simple as: fix f = let x = f x in x
[15:43:09] larcara: has joined #ruby
[15:43:14] dminuoso: So I dont know about readable.
[15:43:28] cschneid_: has joined #ruby
[15:43:42] nobitanobi: has joined #ruby
[15:44:35] Guest70176: has joined #ruby
[15:45:24] Bish: i hope i can lower my selfworth so much i can learn haskell some day
[15:45:26] tomphp: has joined #ruby
[15:45:31] Bish: so i can finally write good software
[15:48:55] Bish: so far i am not so in on torturing myself
[15:50:34] cek: has joined #ruby
[15:50:45] sepp2k: has joined #ruby
[15:51:47] cek: has left #ruby: ()
[15:57:54] veeti: has joined #ruby
[15:57:59] andikr: has joined #ruby
[16:01:20] Technodrome: has joined #ruby
[16:03:16] Puffball: has joined #ruby
[16:03:18] d10n-work: has joined #ruby
[16:03:25] cschneid_: has joined #ruby
[16:05:32] dminuoso: Bish: https://gist.github.com/dminuoso/da5f38a1162f887f3a4c44f20a65d1c6
[16:05:47] dminuoso: And this is my take in haskell with lambdas.
[16:06:00] dminuoso: (Realized that this is the better equivalent of the earlier mentioned combinator)
[16:06:19] mim1k_: has joined #ruby
[16:06:22] rouge: has joined #ruby
[16:06:23] dminuoso: (The typesystem needs slight encouragement)
[16:06:44] dminuoso: But it's fairly close to (\x -> x x)(\x -> x x) wouldnt you say? :)
[16:08:57] motstgo: has left #ruby: ("WeeChat 1.9")
[16:09:04] mcr1: has joined #ruby
[16:10:02] kapil___: has joined #ruby
[16:17:41] conta: has joined #ruby
[16:18:39] cdg: has joined #ruby
[16:19:48] Psybur: has joined #ruby
[16:24:54] milardov_: has joined #ruby
[16:32:27] silvermine: has joined #ruby
[16:37:18] mim1k: has joined #ruby
[16:40:09] dionysus69: has joined #ruby
[16:43:59] drowze: has joined #ruby
[16:44:07] milardovich: has joined #ruby
[16:45:46] jackjackdripper: has joined #ruby
[16:46:50] ewoud: has joined #ruby
[16:47:44] ewoud: if I want to ship static files in a gem to be used by another gem/script, where would I put them and how would I load them later?
[16:48:41] mtkd: has joined #ruby
[16:48:42] adaedra: I think you can put then anywhere in the gem if you reference them in the gem's files attribute
[16:48:46] synthroid: has joined #ruby
[16:49:17] adaedra: Then you should be able to find it relatively to __dir__
[16:50:19] ewoud: the use case is shipping a bunch of yaml files so I'd have mygem/lib/nodesets.rb and use __dir__ in that nodesets.rb?
[16:50:51] bronson_: has joined #ruby
[16:51:23] ewoud: that sounds like it should work
[16:52:24] dminuoso: So I got a heisenbug somewhere in a native extension. When I now attach valgrind, everything explodes wildly.
[16:53:19] craysiii: hey everyone. trying to implement these data stream endpoints for an api wrapper, but i see that faraday hasn't implemented data streams yet. can anyone recommend an appropriate gem?
[16:54:01] Dimik: has joined #ruby
[16:55:57] ewoud: adaedra: thanks, looks like that's exactly what I was looking for
[16:57:23] cschneid_: has joined #ruby
[16:59:03] Guest70176: has joined #ruby
[17:01:13] veeti: has joined #ruby
[17:01:56] dminuoso: https://gist.github.com/dminuoso/55b579dbbff15095f5dfbc4fe0d35dda
[17:02:04] dminuoso: Thank you ruby.
[17:02:15] dminuoso: This is how useful diagnostics work.
[17:05:38] zautomata: has joined #ruby
[17:06:16] milardov_: has joined #ruby
[17:08:46] rouge: has joined #ruby
[17:10:36] kryptoz: has joined #ruby
[17:14:23] wolfshappen: has joined #ruby
[17:18:11] rikkipitt: has joined #ruby
[17:18:20] mson: has joined #ruby
[17:19:50] Psybur: has joined #ruby
[17:21:17] mtkd: has joined #ruby
[17:25:30] veeti: has joined #ruby
[17:26:55] Guest70176: has joined #ruby
[17:28:38] kickr: has joined #ruby
[17:31:08] mikecmpbll: hmm. it's a shame that 2.4's Enumerable#sum doesn't have any native performance boost for arrays of BigDecimal.
[17:31:53] mikecmpbll: about 8* faster for floats
[17:31:56] mikecmpbll: (than [].reduce :+ )
[17:32:24] synthroid: has joined #ruby
[17:33:33] ewoud: has left #ruby: ()
[17:34:30] ShekharReddy: has joined #ruby
[17:38:04] jamiejackson: has joined #ruby
[17:41:13] Exhiled: has joined #ruby
[17:45:27] rikkipitt: has joined #ruby
[17:47:26] milardovich: has joined #ruby
[17:48:42] Exhiled: has joined #ruby
[17:50:39] synthroid: has joined #ruby
[17:51:28] mtkd: has joined #ruby
[17:52:13] Guest70176: has joined #ruby
[17:53:27] wolfshappen: has joined #ruby
[17:57:22] ldepandis: has joined #ruby
[17:59:16] mtkd: has joined #ruby
[18:00:46] ur5us: has joined #ruby
[18:01:00] Emmanuel_Chanel: has joined #ruby
[18:01:53] ramfjord: has joined #ruby
[18:02:15] eckhardt: has joined #ruby
[18:03:38] uZiel: has joined #ruby
[18:11:17] mcr1: has joined #ruby
[18:15:00] rabajaj: has joined #ruby
[18:17:19] Emmanuel_Chanel: has joined #ruby
[18:20:01] Psybur: has joined #ruby
[18:21:15] cdg: has joined #ruby
[18:21:58] Scorpion: has joined #ruby
[18:22:30] nofxx: has joined #ruby
[18:24:05] RickHull: has joined #ruby
[18:24:19] ltem: has joined #ruby
[18:24:29] veeti: has joined #ruby
[18:26:47] bvcosta: has joined #ruby
[18:27:09] kies: has joined #ruby
[18:27:46] orbyt_: has joined #ruby
[18:29:17] bvcosta_: has joined #ruby
[18:30:50] tlaxkit: has joined #ruby
[18:33:25] [Butch]: has joined #ruby
[18:37:08] Exhiled: has joined #ruby
[18:39:50] weaksauce: so after updating to high sierra I am trying to use capistrano to deploy but the gemfile is complaining about ruby version not being correct. I use chruby and select the correct version but every time it runs it switches to 2.3.3... all my `which bundler` and `which cap` and `which ruby` all point to the correct 2.1.3
[18:39:55] weaksauce: any ideas where to start?
[18:41:23] havenwood: weaksauce: are you using sudo?
[18:42:09] weaksauce: in what sense havenwood
[18:42:12] cdg_: has joined #ruby
[18:42:20] havenwood: weaksauce: in the command you're running to deploy
[18:42:27] weaksauce: the command i am using is `chruby 2.1.3 && be cap production deploy` where be is an alias to bundle exec
[18:42:29] havenwood: weaksauce: ah, I think I misread what you wrote
[18:43:23] havenwood: weaksauce: have you seen cap's wiki on chruby?: https://github.com/capistrano/chruby#readme
[18:43:44] raynold: has joined #ruby
[18:43:55] weaksauce: have yeah. it was all working fine until i upgraded to high sierra
[18:43:56] havenwood: weaksauce: and chruby's wiki on chruby: https://github.com/postmodern/chruby/wiki/Capistrano
[18:43:56] milardovich: has joined #ruby
[18:44:01] havenwood: weaksauce: hrmmm
[18:44:16] weaksauce: i don't get it
[18:44:39] weaksauce: maybe i just blow out the gems and try bundle install?
[18:44:44] weaksauce: reinstall bundler?
[18:45:24] ledestin: has joined #ruby
[18:46:16] milardov_: has joined #ruby
[18:46:20] mfb2: has joined #ruby
[18:46:40] muelleme: has joined #ruby
[18:46:58] weaksauce: i do a `be ruby --version` and it spits out the correct version
[18:48:00] weaksauce: it's something to do with capistrano as just trying to do a `be cap --version` spits out the error
[18:48:58] Puffball: has joined #ruby
[18:52:43] weaksauce: though actually bundler fails with the same message if i try to run a `bundle install` so `bundle exec ruby --version` works but `bundle install` fails
[18:55:26] ramfjord: has joined #ruby
[18:55:37] wolfshappen: has joined #ruby
[18:57:52] urk187: has joined #ruby
[19:05:07] eightlimbed: has joined #ruby
[19:09:00] cahoots: has joined #ruby
[19:09:14] jaruga: has joined #ruby
[19:09:16] selim: has joined #ruby
[19:09:21] cahoots: hi, i want to use mechanize to log in at https://www.fabric.io/login, but mechanize seems unable to find the form. any ideas how to solve this?
[19:11:38] kryptoz: has joined #ruby
[19:12:11] rouge: here is my code
[19:12:12] RickHull: mechanize, wow -- it's been a while since I've heard that library
[19:12:23] rouge: anyone able to explain why its not running
[19:12:47] RickHull: cahoots: there is no HTML form on that page
[19:12:51] rouge: https://pastebin.com/ngP2suRs
[19:12:53] ruby[bot]: Rouge: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/0ee65982e5258fff7db5f8ee80f68257
[19:12:53] ruby[bot]: Rouge: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[19:13:21] RickHull: Rouge: are there any errors?
[19:13:26] rouge: memory error
[19:13:32] rouge: #<Name:0x0000000004c8d828>
[19:13:47] rouge: im just a beginner. trying to work on classes
[19:13:56] RickHull: can you paste the full error?
[19:14:04] rouge: C:\Ruby24-x64\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Rouge/IdeaProjects/FurtherRuby/Object_oriented/testing.rb
[19:14:05] rouge: #<Name:0x0000000004c8d828>
[19:14:05] rouge: Process finished with exit code 0
[19:14:07] RickHull: don't need the full stack trace
[19:14:09] apeiros: Rouge: if you have a local variable named `title`, then doing `title` will no longer call the method with that name
[19:15:19] rouge: as in having title as a method and a variable?
[19:15:23] cahoots: RickHull, when i open up the source code, i see a form with class .sdk-form
[19:15:59] RickHull: interesting, when I view source -- the only form ctrl-f can find is in "platform"
[19:16:00] cahoots: perhaps some js is adding it dynamically and mechanize only picks up on the initial html download?
[19:16:17] cahoots: RickHull, inspect one of the form fields
[19:16:30] cahoots: then in that source code view, you'll see the form
[19:17:32] RickHull: i believe mechanize will just look at the page source, which has no form elements -- not sure
[19:18:32] griffindy: has joined #ruby
[19:19:48] Psybur: has joined #ruby
[19:19:58] RickHull: Rouge: I'm surprised your last line, L30 doesn't have an error
[19:19:59] rfoust: has joined #ruby
[19:20:21] weaksauce: anyone know why bundle would use system default ruby over the ruby that I select from chruby? bundle install uses system ruby bundle exec ruby --version uses the correct one selected by chruby
[19:20:22] rouge: RickHull, yeah i sort of know thats wrong
[19:20:40] rouge: but im getting that memory error
[19:20:45] rouge: regardless of that line
[19:21:07] RickHull: Rouge: I don't see any memory errors
[19:21:20] rouge: what do you get when you run code?
[19:21:33] RickHull: i haven't tried, because it looks like L30 has a simple error
[19:21:42] rouge: deleting line 30
[19:21:46] rouge: gives same error
[19:21:55] RickHull: what error?
[19:22:06] rouge: C:\Ruby24-x64\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Rouge/IdeaProjects/FurtherRuby/Object_oriented/testing.rb
[19:22:06] rouge: #<Name:0x0000000004c1dcd0>
[19:22:07] rouge: Process finished with exit code 0
[19:22:14] RickHull: i still don't see any errors
[19:22:31] RickHull: the 2nd line there is just an inspect string, it looks like
[19:22:40] rouge: gime 2 mins
[19:23:19] rouge: sorry got mixed on a window
[19:23:28] rouge: so the name = Name.new
[19:23:29] RickHull: I'm not sure if your -e is working as expected -- I would just put that code in the .rb file and call ruby.exe script.rb
[19:24:13] eckhardt: has joined #ruby
[19:24:18] rouge: my l30 needs arguments
[19:25:04] cahoots_: has joined #ruby
[19:25:57] rouge: which should be
[19:26:06] rouge: name = Name.new(title, last_name, middle_name, last_name)
[19:27:19] RickHull: probably you would just put string literals in there: Name.new('king', 'john', 'q', 'public')
[19:28:02] haylon: Hey everyone. Has anyone worked with JRuby and Ant tasks? I'm not sure what I would need to do with my Rake task to make it so I can include the Manifest into my JAR file.
[19:28:27] rouge: RickHull, yeah im trying to get from user input
[19:29:22] RickHull: Rouge: you should decide between: create the object with values provided, or else create an empty object and prompt the user
[19:31:14] Winwin: has joined #ruby
[19:31:29] Winwin: https://cryptosrevolution.wixsite.com/beta/
[19:33:06] milardovich: has joined #ruby
[19:34:03] hays: has joined #ruby
[19:34:03] hays: Anyone use ruby-installer? Curious how you upgrade your rubies
[19:34:03] hays: has joined #ruby
[19:34:26] hays: Anyone use ruby-installer? Curious how you upgrade your rubies
[19:34:27] Exhiled: has joined #ruby
[19:34:34] goyox86: has joined #ruby
[19:34:52] hays: it seems like it might be a pretty manual process of installing the new one, reinstalling gems, then deleting the old
[19:34:55] haylon: @hays I usually just run the RubyInstaller for Windows and it took care of the upgrade .
[19:35:00] haylon: are you on Windows or something else?
[19:35:09] hays: oh sorry, mac/homebrew
[19:35:23] haylon: Ah, I use rbenv on MacOS
[19:35:31] haylon: and my Linux machines.
[19:35:35] hays: i use it with chruby to keep 2.2, 2.3, 2.4 all on my system
[19:35:50] hays: ahh rbenv. I'm not experienced with that, since im using chruby
[19:38:42] nadir: has joined #ruby
[19:41:55] kitsunenokenja: has joined #ruby
[19:44:14] RickHull: hays: do you mean ruby-install ?
[19:44:20] Cohedrin: has joined #ruby
[19:44:34] hays: RickHull: yes
[19:44:38] RickHull: generally ruby-install and chruby are used together, or ruby-build and rbenv
[19:44:59] hays: yeah, i am curious if there is a way to upgrade the rubies to the latest minor versions or something similar
[19:45:03] RickHull: to "upgrade" a ruby means to install a newer version. so if you have ruby-2.4.0, you can install ruby-2.4.1
[19:45:10] AlexRussia: has joined #ruby
[19:45:11] weaksauce: I use ruby-install and chruby. usually works just fine other than bundler trying to use the system ruby now
[19:45:19] goyox86_: has joined #ruby
[19:45:19] haylon: So you'd have two versions, the old one and newer one
[19:45:38] hays: ok so people just manage this manually
[19:45:47] RickHull: try ruby-install --latest
[19:45:49] hays: install new ruby, move gems over, delete the old one
[19:46:16] hays: I have 5 rubies I keep going
[19:46:20] RickHull: that's right -- it's meant to be an isolated environment tied to the ruby version
[19:46:32] RickHull: unlike doing say `apt upgrade`
[19:46:58] hays: jruby, ruby 2.2, 2.3, 2.4,rbx
[19:48:06] hays: so its a bit of a maintenance item for me
[19:50:02] knight33: has joined #ruby
[19:50:38] hays: I wonder i gem install < list.txt works
[19:50:44] RickHull: there may be a way to move the gems over, or it would be easily scriptable if not
[19:50:46] RickHull: havenwood: ^
[19:51:15] mtkd: has joined #ruby
[19:51:34] RickHull: hays: in general, I would just develop on one or two ruby versions, and use travis (or similar) to test on other rubies
[19:51:50] havenwood: hays: so the problem with using gems between teeny versions of ruby is actually the gem executable shebangs.
[19:52:11] havenwood: hays: you can get an env-based shebang with the --env-shebang flag.
[19:52:43] havenwood: hays: i do set that flag in my gemrc so i'm able to use gems when i upgrade Ruby to an ABI-compatible version with previously installed gems
[19:52:46] havenwood: hays: gem: "--env-shebang"
[19:52:52] haylon: btw, figured out my problem with my JRuby stuff. I wasn't undersatnding how it was dealing with the XML "translations". Had a do...end in the wrong spot
[19:52:56] havenwood: ^ that in your ~/.gemrc should do the trick
[19:53:37] RickHull: havenwood: just to make it clear, say ruby-2.4.0 is installed with 10 gems; if ruby-2.4.1 is then installed, with the ~/.gemrc env-shebang thing, those 10 gems will be available for 2.4.1 ?
[19:54:47] havenwood: RickHull: yes
[19:55:22] havenwood: RickHull: the fix so that *just happens* has been PRed to RubyGems but last I recall it was awaiting a breaking version bump to go live.
[19:55:39] hays: hmm. that works with chruby?
[19:55:50] havenwood: sec, i'll find the issue
[19:57:31] hays: modern environments are so complex.. i don't really follow how they are setup anymore. its just a bit of magic
[19:58:43] RickHull: in this case, it's not too bad. ruby executables live in some bin/ somewhere, and PATH manipulation finds them. likewise, rubygems stuff has its own filesystem layout, and you just need the right config to point to them
[19:58:53] ur5us: has joined #ruby
[19:59:00] ShekharReddy: has joined #ruby
[19:59:22] weaksauce: RickHull you have any idea why bundler would use the system ruby over the chruby that it should?
[19:59:26] RickHull: a lot of this is hidden from end users by tooling
[20:00:13] RickHull: weaksauce: it could be that bundler is looking for ruby before executing any chruby hooks
[20:00:36] havenwood: weaksauce: make sure bundler is installed with the chruby version of ruby you've selected
[20:00:40] havenwood: weaksauce: gem install bundler
[20:00:48] havenwood: weaksauce: confirm: which bundle
[20:00:52] havenwood: weaksauce: and: gem which bundler
[20:01:19] weaksauce: i get a segfault on the second command gem which bundler havenwood
[20:01:41] weaksauce: the first command looks correct though
[20:01:56] eightlimbed: has joined #ruby
[20:03:13] FrostCandy: has joined #ruby
[20:03:30] weaksauce: where do gems get installed normally?
[20:03:38] weaksauce: i want to just blow out everything and start over
[20:03:56] RickHull: weaksauce: run `gem which` without any chruby hooks
[20:04:00] RickHull: er, `gem env`
[20:04:53] RickHull: that means using your system `gem` -- so either don't run chruby hooks on a new bash session, or find the path and execute it directly
[20:05:15] Rapture: has joined #ruby
[20:05:50] havenwood: weaksauce: no use of sudo involved? take a look at your $PATH env var, is it as expected?
[20:06:28] weaksauce: havenwood no sudo. this is all because i updated to high sierra and everything was working fine before that
[20:09:11] weaksauce: the path does look a bit funky havenwood though I don't see anything inside my .zshenv that would set that other than chruby perhaps?
[20:13:30] eightlimbed: has joined #ruby
[20:14:01] weaksauce: havenwood https://gist.github.com/fiveNinePlusR/6a1bb68dbbb9843c1d73fd764145111e
[20:14:22] milardov_: has joined #ruby
[20:14:23] weaksauce: is it normal to have all those ruby bins in the bath?
[20:16:14] dminuoso: weaksauce: Also there are interesting edge cases where shell hash/caches can force wrong binaries to be executed.
[20:17:01] dminuoso: 21:01 weaksauce | i get a segfault on the second command gem which bundler havenwood
[20:17:03] dminuoso: That sounds like a bug.
[20:17:39] weaksauce: dminuoso yeah, for sure. it's likely the wrong ruby being used against a gem built for a different version of ruby
[20:19:42] cdg: has joined #ruby
[20:19:47] dminuoso: weaksauce: have you used `hash -r` for good measure?
[20:19:50] Psybur: has joined #ruby
[20:25:22] tAn: has joined #ruby
[20:27:08] milardovich: has joined #ruby
[20:27:49] kus_ubuntui686: has joined #ruby
[20:27:57] marr: has joined #ruby
[20:30:14] milardovich: has joined #ruby
[20:32:44] weaksauce: tried it to no avail
[20:35:52] bmurt: has joined #ruby
[20:36:06] weaksauce: this is really frustrating... https://gist.github.com/fiveNinePlusR/2a99a4e414b6ca4a34b97a80fd9145ca
[20:36:27] weaksauce: everything points to 2.1.3 and yet it thinks it is running 2.3.3
[20:36:47] havenwood: weaksauce: gem pristine --all
[20:37:21] weaksauce: the problem with that is that those gems that it is complaining about are the ones from the system ruby
[20:38:34] impermanence: has joined #ruby
[20:43:01] weaksauce: alright. blowing out the ~/.gem folder seems to have fixed something
[20:43:29] truenito: has joined #ruby
[20:48:40] tomphp: has joined #ruby
[20:48:43] veeti: has joined #ruby
[20:53:47] zautomata: has joined #ruby
[20:55:32] TinkerTyper: has joined #ruby
[21:02:14] Mia: has joined #ruby
[21:02:15] Mia: has joined #ruby
[21:05:08] dp: has joined #ruby
[21:06:10] cahoots: has joined #ruby
[21:06:25] dp: Are there any tools that will take a directory of ruby classes/scripts/etc and build some kind of map showing how everything is intertwined so I can trace down the issue that I'm having? Maybe even something to generate html documentation for them?
[21:06:51] milardovich: has joined #ruby
[21:07:47] apeiros: dp: rdoc and yard
[21:08:28] rouge: has joined #ruby
[21:09:53] dp: apeiros: awesome, thanks!
[21:10:12] eckhardt: has joined #ruby
[21:10:30] ap4y: has joined #ruby
[21:11:14] shinnya: has joined #ruby
[21:11:15] veeti: has joined #ruby
[21:17:27] leitz: has joined #ruby
[21:19:48] Psybur: has joined #ruby
[21:21:07] cdg: has joined #ruby
[21:25:42] eightlimbed: has joined #ruby
[21:27:59] Rapture: has joined #ruby
[21:31:18] knight33: has joined #ruby
[21:31:30] oetjenj: has joined #ruby
[21:37:56] veeti: has joined #ruby
[21:39:44] cahoots_: has joined #ruby
[21:40:07] milardovich: has joined #ruby
[21:40:14] houhoulis: has joined #ruby
[21:43:25] carnegie: has joined #ruby
[21:43:36] knight33: has joined #ruby
[21:45:56] rainbowz: has joined #ruby
[21:50:39] Megamosaren: has joined #ruby
[21:50:43] Cohedrin: has joined #ruby
[21:51:14] mikeiniowa: has joined #ruby
[21:51:15] leitz: Design question. Class Character holds data and a few methods. Mixin CharacterTools has all the stuff to modify CharacterData. Presenter is used to format output. Right now Character requires CharacterTools, is it an issue that a bunch of methods are mixed in even though they only get used on initialization?
[21:51:20] mson: has joined #ruby
[21:51:21] lexruee: has joined #ruby
[21:52:18] muelleme: has joined #ruby
[21:52:19] weaksauce: not sure what you are asking leitz
[21:52:28] weaksauce: what's your concern about it?
[21:53:34] leitz: Mostly bloated code. The first version had all the methods directly in Class Character. Wasn't sure if the mixin was as bloated or what.
[21:53:51] leitz: There will be other mixins, trying to figure out how to prepare for them.
[21:54:58] weaksauce: i wouldn't worry too much about bloat at this stage... were you able to refactor that long method from earlier?
[21:55:05] leitz: Wondering if there's a Design Pattern to solve the issue and give me a reason to learn patterns.
[21:55:32] leitz: Removed 11 lines, added sample. The next round of refactor is what has me on this question.
[21:56:18] weaksauce: nice. design is a bit nebulous at times and sometimes there are no great ways to do something only less bad ways
[21:57:22] weaksauce: a factory might be the pattern you are looking for
[21:57:37] weaksauce: if it's only about initialization stuff
[21:57:55] leitz: Yup, most of the data will be set once and then done.
[21:58:11] leitz: But the Character doesn't need to carry all the other stuff.
[21:59:48] leitz: ACTION found a blog post on factory.
[21:59:59] milardovich: has joined #ruby
[22:00:00] weaksauce: internally the mixins don't get added to every object of that class. they get added to the definition of the class and then that's used at runtime.(unless you redefine it on the actual object)
[22:00:28] weaksauce: the factory pattern is used heavily in java and less so in ruby
[22:01:24] tvw: has joined #ruby
[22:01:39] leitz: So the next task should be "trim methods" as opposed to "Figure out factory"?
[22:02:26] weaksauce: i would say so yeah.
[22:02:44] jaruga: has joined #ruby
[22:02:49] leitz: Okay, let me see what I can do. I have the next few days off.
[22:02:59] carnegie: has joined #ruby
[22:04:19] milardovich: has joined #ruby
[22:05:30] helpa: has joined #ruby
[22:06:57] carnegie: has joined #ruby
[22:07:05] weaksauce: leitz design in programming is one of the more contentious issues programmers face off on... in general rubists are for small easily testable methods though. long methods are a code smell.
[22:09:04] RickHull: leitz: FWIW I am not a fan of mixins
[22:09:27] leitz: RickHull, you would be if you read my original code.
[22:09:37] RickHull: link to Character class?
[22:10:02] leitz: https://github.com/LeamHall/CT_Character_Generator/blob/master/lib/Tools/Character.rb
[22:10:37] RickHull: ok, a couple things:
[22:11:09] qu1j0t3: has joined #ruby
[22:11:28] RickHull: 1. don't manipulate load path in code -- if your code file is inside lib/ then you can just: require 'other/stuff'
[22:11:46] qu1j0t3: hello. Is there an alternative rspec helper for REST-ish integration tests, to Airborne?
[22:11:53] RickHull: e.g. within lib/this_file.rb, to require lib/other/stuff.rb -- just require 'other/stuff'
[22:12:10] RickHull: this will fail if lib/ is not in your load path, but you can put it there from the outside, not from the inside
[22:12:14] leitz: Originally code is in bin. Reading yesteryday that it should go in lib
[22:12:26] RickHull: yes, put your class definitions in lib
[22:12:35] RickHull: module and class definitions
[22:12:40] Radar: baweaver: a book on Elixir.
[22:12:46] Radar: Re: [17:27:32] <baweaver> Just ask Radar, he's even writing a book for it
[22:12:55] leitz: This isn't a gem yet, so the load path needs to be explicit, as I understand it.
[22:13:12] RickHull: leitz: if it were a gem, rubygems would do your load path manipulation, yes
[22:13:19] RickHull: but you can do it on your own from the outside
[22:13:21] leitz: RickHull, wait. Does the main program go in lib or bin?
[22:13:22] RickHull: (and should)
[22:13:27] weaksauce: leitz also, generally, the ruby style is to omit () when calling methods without arguments
[22:13:49] RickHull: leitz: the main program, or driver program, should probably go in bin/
[22:14:02] leitz: Ah, okay. Got one right. :)
[22:14:07] RickHull: then you can do: ruby -Ilib bin/driver.rb
[22:14:26] RickHull: the `-I lib` part is your load path manipulation from the outside
[22:14:35] RickHull: (which rubygems does for you)
[22:14:38] leitz: Ah. Cool.
[22:14:54] leitz: Currently all the paths are manipulated inside the files.
[22:15:03] RickHull: so forget about rubygems for now -- just make sure to do `-I lib` when you call irb, pry, or ruby
[22:15:16] RickHull: leitz: yeah, rip that stuff out
[22:15:23] weaksauce: leitz lines 26-31 could follow the pattern of @upp = CharacterTools.generate_upp and make those class methods
[22:15:29] weaksauce: instead of a mixin
[22:15:32] RickHull: and just require 'this/class' or require 'that_class'
[22:15:54] RickHull: next, put your requires at the top, outside of the class
[22:16:25] RickHull: it's ok to do a conditional require inside a method -- but frowned upon
[22:16:47] leitz: Yeah, there's a question on that coming up. Conditional requires.
[22:16:51] leitz: Not today though.
[22:16:57] RickHull: for now, don't do them
[22:17:06] RickHull: they are very rarely justifiable
[22:17:29] RickHull: it's much better to be explicit and straightforward about what your file depends on to work properly
[22:17:50] RickHull: it would be a hack/optimization to abandon this principle
[22:18:05] leitz: weaksauce, which lines 26-31 are you looking at?
[22:18:34] weaksauce: leitz https://github.com/LeamHall/CT_Character_Generator/blob/master/lib/Tools/Character.rb#L26-L31
[22:18:42] leitz: RickHull; there's a large group of careers to use for data, depending on the career the person chooses.
[22:19:49] Psybur: has joined #ruby
[22:19:50] RickHull: sure, I suspect we can make this work in a straightforward way
[22:20:06] RickHull: that said, there a couple more aesthetic things that would be worth fixing sooner rather than later
[22:20:10] nopolitica: has joined #ruby
[22:20:18] leitz: weaksauce, CharacterTools is a mixin, would it still crete "class methods"?
[22:20:46] leitz: RickHull, yup. Working on the first round of refactoring. Long list of fixes. :)
[22:20:49] RickHull: ruby conventions say, for a class like CharacterToolStuffThingie, that the file should be named character_tool_stuff_thingie.rb
[22:21:06] weaksauce: leitz make it a class instead of a module and then make the methods class methods
[22:21:14] RickHull: ruby projects generally never have uppercase letters in filenames
[22:22:25] RickHull: i'm sure it will be annoying to try to change all of this and lots of stuff will break
[22:22:40] RickHull: and right now you are itching to figure out conceptual stuff
[22:22:52] RickHull: but try to consider whether it will be better to fix the aesthetics sooner or later
[22:23:12] leitz: Okay, help me prioritize. 1) Change CharacterTools to a class with class methods. 2) Refactor methods so they are cleaner first. Which is best to start on?
[22:23:26] leitz: Or is there a third or forth option?
[22:23:41] RickHull: I recommend 1. fix aesthetics (load path, requires, filenames)
[22:23:50] RickHull: don't make any functional changes
[22:24:07] RickHull: assuming your tests pass now, you can fix the aesthetics and make sure tests still pass
[22:24:42] RickHull: some tests will need some editing, presumably, as they will require filenames that have changed
[22:24:54] RickHull: and you are probably doing other unnecessary load path manipulation in code
[22:25:11] RickHull: if you execute your tests with a Rake::TestTask -- rake does the load path for you
[22:25:25] RickHull: otherwise, I just execute a single test file like: `ruby -Ilib test/the_file.rb`
[22:25:45] cdg: has joined #ruby
[22:25:48] RickHull: and my test files are written so that they require what they need and execute successfully, barring a test failure
[22:25:59] leitz: Current tests fail one on one but pass under the testsuite
[22:26:06] rikkipitt: has joined #ruby
[22:26:24] RickHull: ok, that's kind of a concern
[22:26:27] leitz: weaksauce, weigh in on priority?
[22:26:43] leitz: RickHull, yup. I think it's back to the load path.
[22:27:06] rouge: has joined #ruby
[22:27:10] RickHull: yeah, I'm looking at https://github.com/LeamHall/CT_Character_Generator/blob/master/test/tc_Army.rb
[22:27:11] weaksauce: first_name_query = db.prepare "SELECT * from humaniti_#{gender}_first ORDER BY RANDOM() LIMIT 1" something like that could be all in one database with a few more columns. like species, and gender that you then limit with a where clause
[22:27:27] RickHull: leitz: what I would do is rip out the load path stuff, and change the requires so they do lowercase
[22:27:42] tomphp: has joined #ruby
[22:27:48] RickHull: then without changing anything else, you can `ruby -Ilib test/tc_Army.rb`
[22:27:51] weaksauce: leitz i'd probably change the lower hanging fruit like RickHull suggested
[22:28:02] RickHull: (and it will fail because it can't require 'army')
[22:28:13] RickHull: then go and rename lib/Army.rb to lib/army.rb
[22:28:29] RickHull: see what fails, rename, rinse, repeat
[22:29:00] leitz: Sounds like a good evening. :) New branch "refactor_muster_out", using a broad definition of "refactor".
[22:29:25] RickHull: hm, where does Army.rb even live?
[22:29:53] leitz: Careers/Archive. I changed the layout and only put a few in the new format.
[22:30:11] RickHull: so you would: require 'careers/archive/army'
[22:30:17] RickHull: and rename Army.rb to army.rb
[22:30:24] RickHull: now some other stuff in lib/ may not be able to find it
[22:30:40] RickHull: but you can use test/tc_Army.rb to drive your changes until that file passes tests
[22:30:46] leitz: Would probably reformat it and move it out of archive. Only the Chargen and Tests need it.
[22:31:00] RickHull: i wouldn't start reorganizing at the same time
[22:31:11] RickHull: just change one set of things at a time. lowercase filenames e.g.
[22:31:48] RickHull: rip out load path stuff, and move requires to the top, and rename files to lowercase
[22:31:50] jackjackdripper: has joined #ruby
[22:32:00] RickHull: all of those can be done at once -- and you are just dealing with requires
[22:32:01] tomphp: has joined #ruby
[22:33:26] leitz: So tc_navy.rb should require tools/character_tools and careers/navy?
[22:33:54] mim1k: has joined #ruby
[22:33:56] leitz: Assuming I use ruby -llib test/tc_navy.rb
[22:34:21] RickHull: yes, presumably
[22:34:35] RickHull: it depends on what classes / methods etc are called by test/tc_navy.rb
[22:34:53] RickHull: at the top of test/tc_navy.rb should be a number of requires according to what test/tc_navy.rb calls
[22:35:41] RickHull: for my test files, I generally have 2 or 3 requires: require 'minitest/autorun; require 'some_class'; require 'maybe/some/other/module'
[22:35:42] leitz: Well, let me go blow things up and see what happens.
[22:36:06] RickHull: sometimes you can have a test_helper.rb or spec_helper.rb
[22:36:25] RickHull: in that case, it doesn't live in lib/ and so the standard `-I lib` won't help you
[22:36:42] RickHull: that's where you require_relative `./spec_helper`
[22:36:53] RickHull: er, `require_relative './spec_helper'`
[22:37:15] RickHull: e.g. from within test/tc_navy.rb assuming test/spec_helper.rb exists
[22:37:35] bilal80: has joined #ruby
[22:38:15] RickHull: i'm not sure if `require_relative 'spec_helper'` works or if `require_relative './spec_helper'` is needed
[22:38:16] milardovich: has joined #ruby
[22:39:27] RickHull: you might think that you could `-I lib -I test` but in my projects at least, the filenames in lib/ and test/ would conflict and require would get confused
[22:40:41] milardovich: has joined #ruby
[22:40:45] mfb2: has joined #ruby
[22:41:20] RickHull: also, it's good to do this work on a branch, if you're comfortable with that
[22:43:04] leitz: Okay, so I'm running "ruby -llib test/tc_navy.rb" and getting a LoadError on line 6, tools/character_tools.
[22:43:45] RickHull: is there a branch or something where I can see the latest code?
[22:43:50] leitz: https://github.com/LeamHall/CT_Character_Generator/blob/refactor_muster_out/test/tc_navy.rb#L6
[22:43:55] leitz: Took me a sec to get there.
[22:44:09] RickHull: nice, this much looks good
[22:44:10] leitz: Running command from parent directory.
[22:44:41] RickHull: oh, it's -I as in Irene
[22:45:00] RickHull: and you would have to be in your project dir, where `cd lib` would succeed
[22:45:22] AlexRussia: has joined #ruby
[22:45:23] leitz: Yup. Totally different error. Lemme go fix it.
[22:45:33] RickHull: require 'tools/character_tools' should succeed
[22:45:40] RickHull: but that file may have its own requires that are failing
[22:45:48] leitz: And you using "Irene" is funny, as the fiction I'm working on has Irene as a major character. :)
[22:45:50] RickHull: (which would make the first require ultimately fail)
[22:45:51] rikkipitt: has joined #ruby
[22:48:47] rikkipitt: has joined #ruby
[22:49:30] leitz: ACTION is busy blowing up stuff and trying to fix it.
[22:51:56] leitz: Cool, update your look at the repo. tc_navy passes.
[22:52:04] leitz: Of course, nothing else does. :P
[22:53:15] RickHull: yep, one step at a time
[22:53:23] RickHull: you've got a lot of files with references to each other
[22:53:35] RickHull: it will probably take 30-90 min to nail all this down
[22:53:39] RickHull: but it will be well worth it
[22:54:27] leitz: Does the test suite's require need the "test/" prefix on the files?
[22:55:15] leitz: Like, require "test/tc_navy"
[22:55:28] leitz: or just require "tc_navy"
[22:55:45] kitsunenokenja: has joined #ruby
[22:56:51] mfb2: has joined #ruby
[22:57:36] leitz: Or -Ilib Itest
[22:57:39] RickHull: generally you aren't requiring test files
[22:57:40] leitz: That works.
[22:57:49] RickHull: generally you execute test files
[22:58:06] RickHull: the one case is what I mentioned earlier, sometimes you have e.g. test/test_helper.rb
[22:58:17] RickHull: which maybe does some general requires and/or defines some helper methods
[22:58:34] RickHull: in that case, use `require_relative` within your test files that need the helper
[22:58:46] RickHull: in general, `-I test` is a bad idea
[22:59:34] RickHull: so if test/tc_navy.rb needs test/test_helper.rb, test/tc_navy.rb can do: require_relative './test_helper'
[22:59:44] leitz: The test suite requires the individual test cases. At least at the moment. https://github.com/LeamHall/CT_Character_Generator/blob/refactor_muster_out/test/ts_ct_character_generator.rb#L32
[23:00:03] JBbanks: has joined #ruby
[23:00:22] leitz: Breaking it up like that let me work on one set of things at a time but still keep testing.
[23:00:29] yokel: has joined #ruby
[23:00:34] ruby[bot]: has joined #ruby
[23:00:35] ChanServ: +o ruby[bot]
[23:01:00] leitz: Ah, require_relative tc_navy
[23:02:03] leitz: ACTION goes to beat up the Nobles.
[23:02:19] mfb2: has joined #ruby
[23:02:37] RickHull: in general, if your file in test/ has tests, you don't want to require it
[23:03:00] leitz: How do you do sets of tests?
[23:03:02] RickHull: you would only want to require a file in test/ if that file contains class/module/method definitions, or possibly some common requires
[23:03:15] char_var[buffer]: has joined #ruby
[23:03:26] RickHull: the basic way: `ruby -Ilib test/*.rb` # should work
[23:03:31] RickHull: or use Rake::TestTask
[23:03:35] RickHull: inside your Rakefile
[23:04:15] RickHull: each file that contains tests should just run on its own, and your test suite consists of running each of these files on their own
[23:04:45] leitz: That's currently what the ts file does, though it sounds incorrectly.
[23:05:16] RickHull: when I say run on its own, I mean execute as passed to ruby, e.g. `ruby -Ilib test/tc_navy.rb`
[23:05:26] thinkpad: has joined #ruby
[23:05:29] RickHull: you would not try to execute test/tc_navy.rb via require
[23:06:18] jackjackdripper1: has joined #ruby
[23:06:50] RickHull: let me say that, what I am describing is the baseline way to run tests -- it may be possible and even desirable to run tests via require or some other structural methodology
[23:07:08] tAn: has joined #ruby
[23:07:09] RickHull: but I think it's better to understand the baseline -- and only go beyond it as necessary. I've never felt a need to
[23:07:49] RickHull: if you understand how things at a baseline level, you will have much better judgment for deciding do things differently
[23:09:47] weaksauce: i do like the baseline method because it removes some complications
[23:10:20] leitz: So, I don't know Rake yet.
[23:10:48] RickHull: I see you have a rakefile
[23:10:54] RickHull: I'd rename it to Rakefile but it really doesn't matter
[23:10:57] weaksauce: rake is basic. just an easy way to call methods from the command line
[23:11:14] leitz: That was to get travis-ci not to choke. More a cut and paste effort.
[23:11:32] leitz: BTW, tc_noble passes tests.
[23:11:48] RickHull: leitz: see https://github.com/rickhull/device_input/blob/master/Rakefile#L1-7
[23:12:57] weaksauce: leitz one method is to just do a Dir.each("pathtotestdir") do |testfile| ruby testfile end or something along those lines to not have to have a file full of tests to run
[23:13:07] knight33: has joined #ruby
[23:13:21] weaksauce: use globs to only get the files that start with test etc.
[23:13:51] RickHull: nah, see Rake::TestTask
[23:13:58] RickHull: just define a pattern
[23:14:02] weaksauce: but the method that RickHull uses is easier
[23:14:07] RickHull: and rake handles the load path stuff for you
[23:14:15] leitz: RickHull, the rake/testtask file isn't there.
[23:14:31] RickHull: you may need the rake gem installed
[23:14:43] RickHull: but I'd expect its available in stdlib with any recent ruby
[23:15:04] leitz: But line 4 would be t.pattern = 'test/tc_*.rb' ?
[23:15:20] RickHull: here are some common patterns:
[23:15:22] leitz: Ah, that references rake, not a directory in your tree.
[23:15:30] RickHull: test/test_*.rb
[23:15:34] RickHull: test/**/*.rb
[23:15:39] larcara: has joined #ruby
[23:15:50] RickHull: test/tc_*.rb is workable, if that's what you want
[23:16:02] RickHull: you can define several Rake::TestTasks with different names
[23:16:05] mjolnird: has joined #ruby
[23:16:10] lupine: has joined #ruby
[23:16:14] RickHull: that execute different suites, defined by pattern
[23:16:33] weaksauce: ** is a recursive glob if you didn't know so it will expand every directory under test and run every .rb file
[23:16:57] RickHull: i tend to put all my test files in a flat dir structure in test/
[23:17:05] RickHull: and i'll put some benchmark stuff in test/bench/
[23:17:21] RickHull: so i'll have Rake::TestTask.new(:test) and Rake::TestTask.new(:bench)
[23:17:44] RickHull: with patterns test/*.rb and test/bench/*.rb
[23:17:59] RickHull: that way, the bench stuff isn't run when I just want tests
[23:18:10] RickHull: if the pattern were test/**/*.rb then the bench stuff would get run
[23:19:37] weaksauce: you can also do something like test/tests/integration/*.rb and test/tests/unit/*.rb and whatever else. if you want to run all the tests just do test/tests/**/*.rb... there is a lot of different options here depending on how big your test suite gets and how granular you want to be.
[23:19:49] Psybur: has joined #ruby
[23:20:20] bilal80: has joined #ruby
[23:21:05] Guest70176: has joined #ruby
[23:21:44] leitz: Okay, moved most of the failing tests into test/archive, added RickHull's stuff to the rakefile, and things work. So far.
[23:21:58] guardianx: has joined #ruby
[23:23:40] weaksauce: progress... commit that and keep going
[23:23:51] weaksauce: you can always rebase later if you want to squash things
[23:24:57] orbyt_: has joined #ruby
[23:25:11] heinrich5991: has joined #ruby
[23:29:47] leitz: ACTION goes to feed the beasts and stretch his legs for a few minutes.
[23:31:39] volty: has joined #ruby
[23:34:57] Algebr: has joined #ruby
[23:35:54] Algebr: I have a OpenSSL::X509 object and when I do .to_s, it gives me the PEM format of the cert, but I want a p12 style format. any quick easy ways?
[23:36:28] rouge: has joined #ruby
[23:36:53] qu1j0t3: has left #ruby: ("WeeChat 0.4.3")
[23:40:02] mtkd: has joined #ruby
[23:42:06] hays: has joined #ruby
[23:42:06] hays: has joined #ruby
[23:42:42] webguynow: has joined #ruby
[23:44:40] kitsunenokenja: has joined #ruby
[23:46:02] Anaasaa: has joined #ruby
[23:48:52] Algebr: oh nvm, figured it out
[23:49:01] milardov_: has joined #ruby
[23:49:50] eckhardt: has joined #ruby
[23:50:45] rwb: has joined #ruby
[23:59:32] leitz: For my next error: https://gist.github.com/LeamHall/a0991d0981a7de764208d93862c9367d