« Back to channel list

#ruby - 13 February 2019

« Back 1 day Forward 1 day »
[00:02:14] sgen_: has joined #ruby
[00:02:36] jwr_: has left #ruby: ("Leaving")
[00:20:08] AJA4350: has joined #ruby
[00:23:09] ogres: has joined #ruby
[00:30:25] sgen_: has joined #ruby
[00:33:18] akemot: has joined #ruby
[00:38:02] ansraliant: has joined #ruby
[01:13:02] bmurt: has joined #ruby
[01:18:04] cruzo66342: has joined #ruby
[01:22:48] RougeR: has joined #ruby
[01:33:18] code_zombie: has joined #ruby
[01:36:16] Fusl: has joined #ruby
[01:38:39] cruzo66342: has joined #ruby
[01:52:54] aqd: has joined #ruby
[02:02:07] cthulchu: has joined #ruby
[02:04:04] Fusl: has joined #ruby
[02:04:15] Swyper: has joined #ruby
[02:06:08] Renich: has joined #ruby
[02:06:59] aqd: has joined #ruby
[02:07:26] sgen_: has joined #ruby
[02:07:57] nowhere_man: has joined #ruby
[02:15:18] nowhere_man: has joined #ruby
[02:24:41] maryo_: has joined #ruby
[02:24:55] bruul: has joined #ruby
[02:35:52] houhoulis: has joined #ruby
[02:46:59] kapil____: has joined #ruby
[02:48:46] houhoulis: has joined #ruby
[02:49:51] elcontrastador: Any ruby UDP sockets programmers online that want to pair program a fun project for Polycom phone paging via multicast? Polycom has document the signaling and audio format here: https://support.polycom.com/content/dam/polycom-support/products/voice/polycom-uc/other-documents/en/2017/audio-packet-format.pdf
[03:07:38] \void: has joined #ruby
[03:15:04] valadares: has joined #ruby
[03:37:46] akemot: has joined #ruby
[03:48:02] orbyt_: has joined #ruby
[03:49:58] phait0: has joined #ruby
[03:53:34] phait0: has left #ruby: ()
[03:57:20] Tempesta: has joined #ruby
[04:06:53] esrse: has joined #ruby
[04:09:07] braincrash: has joined #ruby
[04:10:21] jcarl43: has joined #ruby
[04:31:28] dellavg__: has joined #ruby
[04:53:48] tdy2: has joined #ruby
[05:01:58] RiPuk: has joined #ruby
[05:03:44] havenwood: has joined #ruby
[05:06:47] akemot: has joined #ruby
[05:51:15] sagax: has joined #ruby
[06:07:35] yitsushi: has joined #ruby
[06:10:24] spacesuitdiver: has joined #ruby
[06:12:08] r29v: has joined #ruby
[06:14:57] conta: has joined #ruby
[06:22:19] akemot: has joined #ruby
[06:22:44] Renich: has joined #ruby
[06:25:27] Renich: has joined #ruby
[06:48:36] segy: has joined #ruby
[07:04:16] aufi: has joined #ruby
[07:14:42] dionysus69: has joined #ruby
[07:19:00] orbyt_: has joined #ruby
[07:36:27] opya: has joined #ruby
[07:39:32] aupadhye: has joined #ruby
[07:39:51] clemens3_: has joined #ruby
[07:46:59] ravenousmoose: has joined #ruby
[07:59:36] opya: has left #ruby: ()
[08:06:36] lytol_: has joined #ruby
[08:18:17] clemens3_: has joined #ruby
[08:23:27] prestorium: has joined #ruby
[08:27:35] BH23: has joined #ruby
[08:38:41] aufi: has joined #ruby
[08:46:51] AJA4350: has joined #ruby
[08:49:49] jmcgnh_: has joined #ruby
[08:55:14] amerlin: has joined #ruby
[09:11:38] status402: has joined #ruby
[09:13:08] mikecmpbll: has joined #ruby
[09:14:41] prestori_: has joined #ruby
[09:16:57] lunarkitty7: has joined #ruby
[09:35:28] status402_: has joined #ruby
[09:38:53] lxsameer: has joined #ruby
[09:38:56] sleetdrop: has joined #ruby
[09:49:41] GodFather_: has joined #ruby
[09:52:42] apparition: has joined #ruby
[09:56:20] tAn: has joined #ruby
[10:01:35] prestorium: has joined #ruby
[10:08:53] prestori_: has joined #ruby
[10:17:14] Bish: has joined #ruby
[10:20:04] aufi: has joined #ruby
[10:30:56] tdy3: has joined #ruby
[10:43:13] ellcs: has joined #ruby
[10:49:09] Puppet`: has joined #ruby
[10:54:22] tuor: has joined #ruby
[10:57:06] blackmesa: has joined #ruby
[11:00:01] prestorium: has joined #ruby
[11:06:10] _whitelogger: has joined #ruby
[11:41:59] v01d4lph4: has joined #ruby
[11:44:47] BH23: has joined #ruby
[12:00:40] markoong: has joined #ruby
[12:06:44] sleetdrop: has joined #ruby
[12:14:48] lucasb: has joined #ruby
[12:20:05] blackmesa1: has joined #ruby
[12:25:03] Nicmavr: has joined #ruby
[12:33:25] ravenousmoose: has joined #ruby
[12:35:31] Sylario: has joined #ruby
[12:51:38] stryek: has joined #ruby
[13:24:02] bmurt: has joined #ruby
[13:25:11] p47r30n: has joined #ruby
[13:33:38] gigetoo: has joined #ruby
[13:48:11] reber: has joined #ruby
[13:49:14] awkwords: has joined #ruby
[13:58:45] v01d4lph4: has joined #ruby
[14:00:29] yokel: has joined #ruby
[14:04:57] segy: has joined #ruby
[14:06:46] mikecmpbll: has joined #ruby
[14:07:08] awkwords: has joined #ruby
[14:08:47] v01d4lph4: has joined #ruby
[14:17:01] clemens3: has joined #ruby
[14:20:27] sgen_: has joined #ruby
[14:30:52] s2013: has joined #ruby
[14:38:49] mkroman: has joined #ruby
[14:50:24] Rapture: has joined #ruby
[14:50:41] KeyJoo: has joined #ruby
[14:55:14] rippa: has joined #ruby
[15:00:07] polishdub: has joined #ruby
[15:06:31] mensvaga: has joined #ruby
[15:06:56] mensvaga: I'm running ubuntu 18.04 . There's a system package, bundler 1.16.1-1 , which is installed.
[15:07:22] mensvaga: When I `gem install bundler`, I get: Successfully installed bundler-2.0.1
[15:07:29] mensvaga: Actually, I ran that as root.
[15:08:05] mensvaga: when I run `bundle --version` as my user, I get: Bundler version 2.0.1
[15:09:05] mensvaga: But when I try and run my script, I get: Bundler could not find compatible versions for gem "bundler": , In Gemfile: bundler (~> 2.0) , Current Bundler version: bundler (1.16.1)
[15:11:53] darix: mensvaga: how does your script call bundler?
[15:11:56] darix: full path maybe?
[15:12:08] mensvaga: require "bundler/setup"
[15:12:56] darix: why not run your script with
[15:13:02] darix: bundle exec yourscript
[15:13:06] mensvaga: That's in the stub console file when you first create the project.
[15:13:11] mensvaga: "bundle exec" ?
[15:13:24] darix: to make sure that you run in a locked down env from the beginning
[15:13:32] mensvaga: OK, bundle exec worked.
[15:14:45] Eindoofus: has joined #ruby
[15:16:50] Eindoofus: anyone else find enumerators annoying when first learning Ruby? i'm reading up on the unending number of enumerator options and functionality, and i'm hating it. not sure whether i should be enjoying this or if i should just power through it
[15:17:05] mensvaga: point to docs.
[15:17:13] mensvaga: which docs you reading?
[15:18:00] Eindoofus: Pragmatic Programming Ruby 4th Edition
[15:18:03] mensvaga: And, it depends. Would you like enjoying learning a spoken language by reading a dictionary, and getting pissed off because of the "number of words" ?
[15:18:26] mensvaga: So, with those books, they turn into part reference, part tutorial
[15:18:33] Inline: has joined #ruby
[15:18:47] mensvaga: When I first started learning this stuff, it was hard to discern the two; mainly because it was difficult to anticipate what was going to be important later
[15:18:47] Eindoofus: it's more like the overwhelming variations in the usage of grammar for the same sentence
[15:19:10] mensvaga: Don't get discouraged by it. All programming languages are like that.
[15:19:23] mensvaga: The book is just presenting the information to you in what the Author thought was a useful way.
[15:20:39] Eindoofus: thanks for the words of wisdom. i'll try to keep that in mind and keep at it
[15:20:42] mensvaga: It seems like what you need to do is get confident in your ability to "just look stuff up" when you need to, and then skip the "boring" parts.
[15:21:19] mensvaga: you're welcome.
[15:23:13] mensvaga: eindoofus: Another thing: You probably already made the leap and didn't realize it.
[15:23:42] mensvaga: Were you sitting there thinking, "Yeah, ANOTHER Iterator. I get it. Ruby has iterators. Oh, what's this? ANOTHER iterator? How many pages...? UGH"
[15:24:15] mensvaga: Yeah, at that point, you know what an iterator is. You know what a data type is, you can lookup up iterators for data types.
[15:24:42] mensvaga: This is when "actual" speed reading applies. Look at the headings, look at the first sentence, and then just breeze through those pages.
[15:25:32] phaul: what is an iterator?
[15:25:51] Eindoofus: it's interesting you mention that. now that i think about it i use such books as a crutch since i lack the confidence to do anything without them. i also don't trust in my ability to skim information and remember that the concept exists.
[15:26:02] mensvaga: What's a diarama?
[15:26:18] phaul: is it something that includes Enumerable or instance of Enumerator
[15:26:41] mensvaga: eindoofus: That comes with experience.
[15:27:29] mensvaga: If you've driven a car, they're pretty much "all the same", except where the shifter is, and how to turn on the headlights, etc.
[15:27:59] mensvaga: You know tire pressure is a concept. You don't need to read and learn the correct tire pressure measurements before you use somebody else's car.
[15:28:52] spacesuitdiver: has joined #ruby
[15:29:07] dviola: has joined #ruby
[15:29:34] mensvaga: If a light comes on, pull over, look up what the warning indicators are in the manual. You probably didn't learn what every damn light in the car does. But, you know how to look it up :)
[15:32:22] SeepingN: has joined #ruby
[15:33:00] phaul: sounds like I'm trolling but I'm geniunely curious how that book defines iterators
[15:35:21] akem: has joined #ruby
[15:36:29] mensvaga: If you're familiar with Tensors, some people define Tensors as "Things that Tensor operations can be done on."
[15:36:48] mensvaga: Which, when you're first learning about them does NOT help you understand what they are.
[15:37:01] mensvaga: But when you know what they are, you're answer is going to be "Things you can do Tensor things with."
[15:37:29] mensvaga: Which makes it hard to figure out if people actually know what they're talking about.
[15:37:51] akemot: has joined #ruby
[15:38:14] conta: has joined #ruby
[15:38:58] phaul: also makes it hard when books come up with concepts on their own, that are not part of a language. Makes ppl familiar with the language confused
[15:39:41] mensvaga: My favorite example of that is indentation style in books. Why do people use the indentation style that's in books? Books need to save whitespace.
[15:40:03] blackmesa1: has joined #ruby
[15:41:37] gnufied: has joined #ruby
[15:41:50] akemot: has joined #ruby
[15:47:13] bruul: has joined #ruby
[15:48:57] s2013: has joined #ruby
[15:52:35] phaul: ah, Kernel#iterator? is an alias to block_given?. I never knew. Altough "mildly depricated".
[15:52:50] phaul: &ri Kernel#iterator?
[15:52:50] mensvaga: deprecated lite
[15:52:51] rubydoc: https://ruby-doc.org/core-2.6/Kernel.html#method-i-iterator-3F
[15:57:24] segy: has joined #ruby
[15:58:41] TheBrayn: https://gist.github.com/mmerfort/86d2a1fd33828d8fad7ccb4a0a504140 how do you think this could be improved?
[15:59:41] phaul: you don't match with the method name on the recursion
[16:00:08] TheBrayn: what do you mean?
[16:00:34] phaul: deep_key_to_string vs deep_string_transform_key, arent those supposed to be the same?
[16:00:45] TheBrayn: I renamed that and forgot to update it
[16:01:27] TheBrayn: and the .to_h inside is redundant
[16:02:17] phaul: how about .tranform_values ?
[16:02:35] TheBrayn: isn't that from rails?
[16:02:56] phaul: no but nm, I forgot that you need to modify the keys too
[16:03:10] TheBrayn: I only transform the keys
[16:03:31] phaul: and recurse on the values that then tranforms them (deeper)
[16:03:44] phaul: but yeah, you need both k, v
[16:06:04] phaul: I'm not sure if it's an improvement but you can tranfer the conditional into the array, [ k.to_s, v.instance_of? Hash ? v... : v ]
[16:06:27] jcarl43: has joined #ruby
[16:07:28] TheBrayn: I think that just makes it harder to read
[16:07:36] phaul: fair enough
[16:13:58] phaul: TheBrayn: are you on >= 2.6 ?
[16:14:25] TheBrayn: I wrote this on 2.5.3 but I'm usually on 2.6
[16:14:35] phaul: then to_h now takes a block, and map can be removed
[16:14:43] phaul: 2.5.3 doesn't have it
[16:15:00] TheBrayn: hmm, yes I'll use that in 2.5.3 code
[16:16:05] phaul: &25>> [1,2,3].to_h { |v| [v, v.odd?] }
[16:16:09] rubydoc: # => wrong element type Integer at 0 (expected array) (TypeError) (https://carc.in/#/r/68lg)
[16:16:25] phaul: &>> [1,2,3].to_h { |v| [v, v.odd?] }
[16:16:26] rubydoc: # => {1=>true, 2=>false, 3=>true} (https://carc.in/#/r/68lh)
[16:18:53] spacesuitdiver: has joined #ruby
[16:21:39] TheBrayn: Thanks for your ideas
[16:21:57] al2o3-cr: just for fun: JSON[h.to_json]
[16:22:46] noark9: has joined #ruby
[16:23:03] jordanm: has joined #ruby
[16:29:36] noark9: has joined #ruby
[16:32:49] conta2: has joined #ruby
[16:33:17] akemot: has joined #ruby
[16:33:36] awkwords_: has joined #ruby
[16:36:08] mensvaga: OK; so, in my "gem directory", when I run: 'gem build SomeGem' , I get a gem.
[16:36:15] mensvaga: Should I be building it with a different command?
[16:36:28] mensvaga: Like, "bundler please_build_this_thing SomeGem" ?
[16:36:40] mensvaga: or is 'gem build SomeGem" good'nuf'
[16:40:08] BH23: has joined #ruby
[16:40:49] uplime: has joined #ruby
[16:41:18] blerrp: mensvaga: are you trying to `bundle install` ?
[16:41:39] blerrp: are you trying to build a gem or use one?
[16:41:43] mensvaga: Build a gem.
[16:42:02] blerrp: what's wrong with gem build
[16:42:09] mensvaga: I thought "bundle install" was when you wanted to fetch the requirements for your gem locally.
[16:42:12] mensvaga: Nothing's wrong
[16:42:20] mensvaga: I want to know if it's the RIGHT thing to do.
[16:42:26] blerrp: i think that's right
[16:42:54] blerrp: you can also read `bundle help`
[16:43:06] blerrp: might find something nifty
[16:43:41] blerrp: better yet https://bundler.io/
[16:44:20] blerrp: https://bundler.io/v2.0/guides/creating_gem.html
[16:45:19] blerrp: If this is your first time running the bundle gem command, you will be asked whether you want to include a the CODE_OF_CONDUCT.md and LICENSE.txt files with your project.
[16:49:30] ravenousmoose: has joined #ruby
[16:50:10] mensvaga: Oh, yeah, so, I've made gems before. Not many
[16:50:16] mensvaga: But each damn time was an adventure.
[16:50:31] mensvaga: And now, I need to write documentation so people can take the adventure with me.
[16:51:16] \void: has joined #ruby
[16:51:22] mensvaga: I'm making it public.
[16:51:42] conta1: has joined #ruby
[16:54:16] bruul: has joined #ruby
[16:54:53] mensvaga: https://gitlab.com/theias/ruby_gem-ias-foodie
[16:55:04] mensvaga: There's a preview. I need to add how to do releases.
[16:55:17] mensvaga: And it's going to be added to a local gem repo, but that will just be a tiny shell script.
[16:56:47] v01d4lph4: has joined #ruby
[16:56:59] phaul: if you want you could make a local rubygems.org
[16:57:15] phaul: then ppl ust gem install from you
[16:57:16] akemot: has joined #ruby
[16:57:57] phaul: that's how publis gems to the ecosystem https://guides.rubygems.org/publishing/
[16:58:23] valadares: has joined #ruby
[16:58:26] phaul: and you can also do this https://guides.rubygems.org/run-your-own-gem-server/
[16:58:57] mensvaga: That is a possibility. However, designing and maintaining a secure infrastructure in that way was out of the scope for the current project.
[16:59:30] mensvaga: Basically, our users can already authenticate to where they need to, and have the appropriate access. So, a tiny shell script which writes things to a directory that's exported by apache was all we needed.
[17:00:02] mensvaga: Yes, if we need to manage lots of these in a different way, we'll do that. We already host our own packages with other packaging systems, and have workflows for them.
[17:01:14] mensvaga: Specifically, I'm concerned with if running "gem install bundler" as root is a "good" thing. I want it to be available to all users
[17:01:40] mensvaga: I don't want the users to have to install much. But, if the user uses "gem install" in their environment, I want it to work.
[17:01:55] phaul: I never install anything to system level, I agree with that
[17:02:21] ravenousmoose: has joined #ruby
[17:02:29] phaul: gem wise that is
[17:02:43] mensvaga: There's a nuance there:
[17:03:05] mensvaga: I want for a user to be able to run bundler without having to install anything. But I want their own environment to overried what's installed system-wide
[17:03:34] mensvaga: So, if running as root doesn't prevent them from installing their OWN version of bundler, than I'm OK with installing it system-wide
[17:08:30] cow[moo]: has joined #ruby
[17:12:02] cthulchu: has joined #ruby
[17:12:23] cthulchu_: has joined #ruby
[17:12:36] dinfuehr: has joined #ruby
[17:13:21] valadares: has joined #ruby
[17:14:05] maryo: has joined #ruby
[17:16:05] v01d4lph4: has joined #ruby
[17:22:57] havenwood: mensvaga: Gem names, files and directories should all be lowercase.
[17:23:13] havenwood: mensvaga: You can have multiple locations in GEM_PATH, one of which can be GEM_HOME.
[17:23:37] havenwood: mensvaga: RubyGems will install to GEM_HOME, but look for gems in all the locations in GEM_PATH.
[17:23:49] orbyt_: has joined #ruby
[17:23:49] akemot: has joined #ruby
[17:24:08] havenwood: mensvaga: File.expand_path(__dir__, 'foodie/foodie.erb')
[17:24:26] awkwords: has joined #ruby
[17:24:36] mensvaga: For the case issue, is there a document with ALL of such standards so I can make sure I adhere to them?
[17:25:28] ngw: has joined #ruby
[17:25:33] havenwood: mensvaga: For gem name: https://guides.rubygems.org/name-your-gem/
[17:25:49] havenwood: mensvaga: File structure: https://guides.rubygems.org/patterns/
[17:26:01] ngw: hello *
[17:26:58] ngw: I'm unsure on how to cleanly have a huge chunk of data in a class. This data is basically static (Elasticsearch index definition) and is basically a normal Hash
[17:26:58] havenwood: mensvaga: You have an issue with you executable location. I the spec you say "exe" but you put it in the "bin" dir.
[17:28:00] ngw: I'm fiddling with the idea of having an external configuration file that I just load, but I'm 'stopped' by the fact that in the end it's just an Hash, and I'd need to save the conf as json/yaml
[17:28:15] mensvaga: havenwood: so, that's interesting. That "spec.bindir" is indeed what was given to me by builder
[17:28:27] havenwood: ngw: You could Marshal it (or another serializer) the Hash and save it as a separate file or put it in at the end of the file with DATA __END__.
[17:28:33] ngw: I'm really very anal right now, but wanted to hear someone elses pov
[17:28:37] mensvaga: I *think* that's there for windows.
[17:29:17] mensvaga: json_file_name = File.expand_path(File.dirname(__FILE__)) + "/somemodule/file.json"
[17:29:34] havenwood: mensvaga: It's a common pattern to use "bin" as your executable dir. The Bundler folk like using "bin" for developer niceties and put executables in "exe". You can do it however you like. I use "bin".
[17:30:19] mensvaga: ngw: data=JSON.parse(File.read(json_file_name))
[17:31:02] mensvaga: havenwood: any idea of how it came to be that 'exe' was chosen for bundler, when I'm running this on Linux?(!)
[17:31:10] havenwood: mensvaga: Pass #expand_path a second argument, and consider __dir__: File.expand_path(__dir__, 'foodie/foodie.erb')
[17:31:22] havenwood: mensvaga: Nothing to do with a .exe extension.
[17:31:33] mensvaga: ah, __dir__ , I will do that.
[17:31:51] havenwood: mensvaga: That's what Bundler chose to name that directory. Most non-Bundler-generated gems use "bin" not "exe". Your choice.
[17:32:10] mensvaga: So, what else can I use to generate gems?
[17:32:14] mensvaga: (that's recommended...)
[17:32:58] havenwood: mensvaga: I do it from scratch. Many folk make their own or use one of the many gems (including Bundler) which will generate a gem layout.
[17:33:26] mensvaga: hehe, yeah, so, what else aside from bundler?
[17:33:38] mensvaga: I mean, of course "from scratch" is an option, but, what year is this?
[17:34:20] havenwood: mensvaga: That way I think about every file and whether I need it and what should go in it. I've thought about generating but I kinda like starting with nothing.
[17:35:23] havenwood: mensvaga: Drop the .rb extension for your executable. You might also want to document the: chmod +x
[17:36:32] havenwood: mensvaga: Bundler's popularity is skewed here, because most people use it for non-generation purposes obviously: https://www.ruby-toolbox.com/categories/gem_creation
[17:36:51] mensvaga: My target audience is people who know that when they create a script that they need to run they should chmod +x .
[17:37:01] havenwood: mensvaga: I do use gem-release, to automate the release process.
[17:37:27] havenwood: https://github.com/svenfuchs/gem-release#readme
[17:37:31] mensvaga: Also, for the purposes of being pretty verbose about it being a .rb, instead of, say, a .sh, I think I'll leave the extension on it.
[17:38:16] mensvaga: The file case thing will be interesting to find out.
[17:38:21] mensvaga: I wanted the module named IAS-Foodie
[17:38:23] havenwood: mensvaga: It's convention to drop extensions from executables.
[17:38:37] mensvaga: and bundler generated the directory structure for me.
[17:39:05] havenwood: mensvaga: that module name corresponds with the gem name ias-foodie and the file structure /lib/ias/foodie.rb
[17:39:23] havenwood: mensvaga: It suggests that IAS is a gem, and this is an IAS plugin.
[17:39:46] havenwood: mensvaga: ias_foodie would be a single gem, corresponding to IASFoodie
[17:40:06] havenwood: mensvaga: Do follow naming conventions or you'll be throwing users for a loop.
[17:40:21] mensvaga: I intend on following the naming conventions.
[17:40:24] mensvaga: I am a cave man.
[17:40:31] mensvaga: Your world frightens and amazes me.
[17:41:08] mensvaga: See, I didn't know about the concept that calling it /lib/ias/foodie.rb would imply that there's a "Plugin for a gem named IAS"
[17:41:21] nowhere_man: has joined #ruby
[17:42:05] havenwood: mensvaga: pry-theme for example is a plugin for the pry gem
[17:43:04] mensvaga: I'm reading the doc here https://guides.rubygems.org/name-your-gem/
[17:43:11] havenwood: mensvaga: or my little gem, digest-sip_hash adds another digest. that's not a plugin, but it's adding a new module to an existing, common digest module from the stdlib.
[17:43:57] havenwood: mensvaga: If you don't set the executable path, "bin" is the default. So I just list my executables: https://github.com/havenwood/digest-sip_hash/blob/master/digest-sip_hash.gemspec#L18
[17:45:07] havenwood: mensvaga: So actually you just need to remove a line to make where you put it work.
[17:46:03] mensvaga: The last 2 statements from you, I either don't have context for
[17:46:19] mensvaga: * I don't understand the bigger picture. Currently thinking about other things.
[17:46:33] mensvaga: So, "bin" is the default executable path for what?
[17:46:38] mensvaga: WHen the gem is installed?
[17:46:54] mensvaga: if I want stuff in bin/ to be "runable" or whatever?
[17:46:58] havenwood: mensvaga: It's the default bindir.
[17:47:08] mensvaga: OK; I'll change that too.
[17:47:18] valadares: has joined #ruby
[17:47:20] havenwood: mensvaga: On this line of your gem, you're changing the default to exe/: https://gitlab.com/theias/ruby_gem-ias-foodie/blob/master/IAS-Foodie.gemspec#L35
[17:47:44] mensvaga: Yes, That's what I said "bundler" did
[17:47:46] havenwood: mensvaga: The line below it would also need to change. I like to just manually list my executables.
[17:47:53] raulp: has joined #ruby
[17:49:34] mensvaga: Yeah, above that they do a `git ls-files` to get a list of things.
[17:49:58] mensvaga: OK, so, bundler is turning out to be non-ideal because of all of the stuff I have to change just to make the stuff usable.
[17:50:20] havenwood: mensvaga: Or you could follow its conventions.
[17:50:29] mensvaga: 'bin' vs exe?
[17:50:51] mensvaga: Shit-loads of 'TODO' in there, making it so a default gem just won't build?
[17:51:01] havenwood: I don't like that convention, but if you create an exe/ dir and put your binary there it'll *just work*.
[17:51:48] mensvaga: Forcing me to put in valid URIs for: spec.homepage ?
[17:52:47] tdy3: has joined #ruby
[17:52:48] KeyJoo: has joined #ruby
[17:52:55] mensvaga: Also, it "forces" you to use git, by using 'git ls-files' in order to generate a file list.
[17:53:12] havenwood: mensvaga: You could see if you like this generator better: https://github.com/svenfuchs/gem-release#gem-bootstrap
[17:58:35] Dbugger: has joined #ruby
[17:59:30] valadares: has joined #ruby
[18:11:25] [Butch]: has joined #ruby
[18:14:34] awkwords: has joined #ruby
[18:24:53] ogres: has joined #ruby
[18:25:42] tdy4: has joined #ruby
[18:27:21] awkwords: has joined #ruby
[18:42:22] mikecmpbll: has joined #ruby
[18:42:48] skryking: has joined #ruby
[18:43:42] AJA4350: has joined #ruby
[18:46:11] valadares: has joined #ruby
[18:51:42] gix: has joined #ruby
[18:55:32] nowhere_man: has joined #ruby
[19:02:32] clemens3: has joined #ruby
[19:05:04] scrptktty: has joined #ruby
[19:07:23] Inline: has joined #ruby
[19:10:59] tdy: has joined #ruby
[19:16:54] agent_white: has joined #ruby
[19:26:08] cthu|: has joined #ruby
[19:28:02] code_zombie: has joined #ruby
[19:28:18] cthulchu_: has joined #ruby
[19:29:12] lxsameer: has joined #ruby
[19:35:04] blackswan: has joined #ruby
[19:35:53] blackswan: i am trying to use rails in Perl. don't ask why, it's not safe for you to know.
[19:37:05] blackswan: it's complaining "Subroutine new redefined at (eval 324) line 518." for some deprecated OpenSSL classes
[19:38:48] blackswan: it's complaining this because it (meaning the Perl Inline::Ruby module) is trying to redefine 'new' for the Ruby class (i think), but it is also finding that the Ruby code it ran has defined a method named 'new'. so it's generating a string to be eval'ed by ruby that contains two different definitions of 'new'
[19:39:08] blackswan: one from the Inline::Perl module, and one from the OpenSSL Ruby classes
[19:39:37] blackswan: except... as far as i can tell, the OpenSSL code doesn't override 'new'.
[19:39:50] KindOna: are you just blabbering without purpose or do you actually have a question
[19:39:56] KindOna: because i'm hoping it's the former
[19:40:16] blackswan: it *does* override 'initialize', and the Inline::Perl isn't seeing that in the list of symbols it thinks got defined when the OpenSSL Ruby code was loaded.
[19:40:30] blackswan: so i have a question, yes.
[19:41:14] blackswan: is there some magic internally in the ruby code i should be looking for that might be taking the fact that this openssl code overrides the 'initialize' method and turning it into something that Inline::Perl is thinking is it overriding the 'new' method?
[19:41:47] blackswan: grepping for 'initialize' and 'new' would be difficult, so i thought i'd ask in the hopes that somebody who knows more about ruby internals would hear my plea and take pity on me
[19:41:59] phaul: classes all override the new method. That's how you get instances of classes
[19:42:10] blackswan: i mean, grepping would be easy finding the lines i'm looking for wouldn't be easy.
[19:42:27] phaul: disclaimer: as far as I understand things.
[19:42:32] blackswan: well, it's not complaining about other classes, just these OpenSSL classes
[19:42:55] blackswan: so something is different and i am trying to understand what it is so i can determine whether it is a problem and make it stop warning me about it.
[19:43:09] blackswan: (whether it is a problem or not. if it's a problem, i want to fix it)
[19:44:35] blackswan: hm. it's trying to define the two 'news' in Perl, not ruby.
[19:46:02] blackswan: it looks at the ruby namespace before and after it evaluates ruby code, and finds new definitions of methods and instance methods, and defines perl counterparts.
[19:46:20] Swyper: has joined #ruby
[19:47:08] blackswan: it's skipping a method named 'new' from ruby if it finds it as a class method but not if it finds it as an instance method.
[19:57:29] v01d4lph4: has joined #ruby
[20:08:20] johnny56_: has joined #ruby
[20:10:34] phaul: ACTION keeps forgetting about #allocate
[20:12:05] r3m: has joined #ruby
[20:13:39] havenwood: phaul: I hardly ever use it. Easy to forget but I guess occasionally handy.
[20:14:12] Inline: has joined #ruby
[20:14:25] r3m: has joined #ruby
[20:16:59] Inline: has joined #ruby
[20:19:13] TitoN-: has joined #ruby
[20:20:58] donofrio: has joined #ruby
[20:22:04] blackswan: it's because Digest::Base, Digest::Class, and Digest::Instance define an instance method named 'new'.
[20:28:51] bmurt: has joined #ruby
[20:30:06] flux__aeon: has joined #ruby
[20:30:31] flux__aeon: good morning. i'm new to rails and am having trouble grabbing a transaction ID returned from a Stripe call
[20:30:41] flux__aeon: https://pastebin.com/2M7zLzp7
[20:31:06] flux__aeon: lines 13 and 14... I am trying to get the charge id but I don't know how to output anything or even check what's int he charge object
[20:32:24] flux__aeon: https://stripe.com/docs/api/charges/create?lang=ruby according to the docs I should receive a response with "id"
[20:34:31] powerbit: has joined #ruby
[20:37:39] tdy1: has joined #ruby
[20:40:59] havenwood: flux__aeon: You put your code after a `return`, so it'll never run.
[20:41:30] [Butch]: has joined #ruby
[20:42:03] havenwood: flips: As a Square engineer, I have to object to the gem you chose. :P
[20:42:44] havenwood: Oops, flux left and my autocomplete failed. Sorry flips.
[20:43:18] havenwood: Anyhoo, put the code before the rescue, and it'll work as expected.
[20:43:42] havenwood: gem install square_connect
[20:52:16] agent_white: has joined #ruby
[20:53:21] Rapture: has joined #ruby
[20:54:38] xco: has joined #ruby
[20:55:16] blackmesa1: has joined #ruby
[20:56:19] DTZUZO: has joined #ruby
[20:56:52] xco: Hi all. I’m getting a PG syntax error on this line with regex and have no idea how to deal with it. Will appreciate some help: https://gist.github.com/xcobar/04d902269107f5b385070bba6d3c4c38
[21:01:19] havenwood: xco: I see `SIMILAR TO` and `regexp_match` in the docs, but no plain `regexp`: https://www.postgresql.org/docs/11/functions-matching.html
[21:01:40] havenwood: xco: This is more of a Postgres question than Ruby or Rails.
[21:04:41] xco: havenwood: oh thank you i’ll read those docs to pick something :)
[21:07:26] al2o3-cr: has joined #ruby
[21:10:10] flux__aeon: has joined #ruby
[21:10:12] flux__aeon: figured it out :)
[21:16:42] sriehl: has joined #ruby
[21:18:44] v01d4lph4: has joined #ruby
[21:19:00] sriehl: has joined #ruby
[21:25:40] reber: has joined #ruby
[21:37:36] havenwood: flux__aeon: Put your code before the `rescue`?
[21:38:05] flux__aeon: I did do that
[21:38:11] bruul: has joined #ruby
[21:38:22] flux__aeon: and i had to use @charge_id = charge["id"]
[21:38:22] havenwood: flux__aeon: 👍🏽
[21:38:44] flux__aeon: so things end after a rescue? that's kind of odd. because i don't want my code to run unless a rescue isn't called
[21:39:24] havenwood: flux__aeon: rescue only happens if an error is raised
[21:39:39] flux__aeon: so code should be able to run after it though right?
[21:39:43] flux__aeon: or rescue should always go at the bottom
[21:40:32] havenwood: flux__aeon: you can ask `charge` what class it is with `charge.class`. it's `charge["id"]` because `charge` is a Hash.
[21:41:01] havenwood: flux__aeon: It can be handy for debugging to use #p to print an inspect an object: p charge
[21:41:14] rprimus: has joined #ruby
[21:41:37] flux__aeon: i thought somewhere else in this person's code they created a customer object
[21:41:42] flux__aeon: and used customer.id
[21:41:50] flux__aeon: customer = Stripe::Customer.retrieve(stripe_data[:customer])
[21:42:06] flux__aeon: either way i got it to work. debugging is kind of a pain
[21:42:07] havenwood: flux__aeon: look at: customer.class
[21:42:17] havenwood: flux__aeon: Pry makes debugging far easier.
[21:42:20] havenwood: ?pry flux__aeon
[21:42:32] havenwood: ACTION pokes ruby[bot] 
[21:42:57] havenwood: flux__aeon: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[21:43:24] havenwood: flux__aeon: binding.pry ftw
[21:43:35] havenwood: flux__aeon: or these days you can binding.irb too
[21:43:58] flux__aeon: i don't know what any of that means. i know almost zero ruby. i only figured that part out because it's the same syntax as python loll
[21:44:14] havenwood: flux__aeon: Do you know python's interactive mode?
[21:44:28] flux__aeon: how do i load an entire rails project into irb?
[21:44:40] flux__aeon: so many moving parts
[21:45:00] havenwood: flux__aeon: Ruby ships with IRB, which is similar. You can jump out to irb from your code by putting a `binding.irb` on the line you want to be at.
[21:45:24] havenwood: flux__aeon: Try adding a `binding.irb` to a line in your code, then run the app.
[21:45:34] flux__aeon: what does that mean
[21:45:43] flux__aeon: add the phrase "binding.irb" and then run foreman start?
[21:45:44] havenwood: flux__aeon: You'll see the app freeze when it gets to that line, then if you check your console you'll see an interactive terminal.
[21:45:49] havenwood: flux__aeon: yup
[21:46:40] havenwood: flux__aeon: To get a fancier interactive terminal, you can add `gem pry-rails` to your Gemfile and run: bundle
[21:46:51] havenwood: flux__aeon: It's well worth getting the hang of.
[21:47:57] havenwood: flux__aeon: I mean: gem 'pry-rails'
[21:49:45] flux__aeon: wow you're so helpful! thank you i appreciate the help
[21:57:01] nowhere_man: has joined #ruby
[21:58:52] AJA4350: has joined #ruby
[22:00:27] skyikot: has joined #ruby
[22:09:47] Puppet`: So I am using pry just like I normally would use IRB, if I made an error in a method I was trying to make in pry is there a way I can go back and edit it or do I have to remake the whole method?
[22:11:20] phaul: edit methodname
[22:11:49] Puppet`: ah, thanks
[22:13:37] orbyt_: has joined #ruby
[22:16:45] lunarkitty7: has joined #ruby
[22:34:25] akemot: has joined #ruby
[22:37:53] cd: has joined #ruby
[22:37:54] arekushi: has joined #ruby
[22:49:05] SeepingN_: has joined #ruby
[22:51:37] Tharbakim: has joined #ruby
[22:53:42] wilbert: has joined #ruby
[22:57:08] tdy1: has joined #ruby
[23:00:31] wilbert: has joined #ruby
[23:09:43] mn3m: has joined #ruby
[23:11:28] ua: has joined #ruby
[23:19:16] Swyper: has joined #ruby
[23:19:32] v01d4lph4: has joined #ruby
[23:29:58] clemens3_: has joined #ruby
[23:33:47] blackmesa1: has joined #ruby
[23:36:08] conta: has joined #ruby
[23:39:30] Swyper: has joined #ruby
[23:44:06] Swyper: has joined #ruby
[23:44:31] blackswan: has joined #ruby
[23:57:22] Inline: has joined #ruby