havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.1, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
sgen_ has joined #ruby
jwr_ has left #ruby ["Leaving"]
nchambers is now known as uplime
AJA4350 has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
ogres has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
\void is now known as root
root is now known as \void
ansraliant has quit [Read error: Connection reset by peer]
sgen_ has quit [Remote host closed the connection]
sgen_ has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
ansraliant has joined #ruby
marius has quit [Quit: x]
AJA4350 has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 246 seconds]
cruzo66342 has quit [Remote host closed the connection]
cthulchu has quit [Ping timeout: 258 seconds]
bmurt has joined #ruby
cruzo66342 has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
RougeR has joined #ruby
sgen_ has quit [Ping timeout: 250 seconds]
code_zombie has joined #ruby
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
cruzo66342 has quit [Remote host closed the connection]
cruzo66342 has joined #ruby
code_zombie has quit [Ping timeout: 250 seconds]
markoong has quit [Ping timeout: 272 seconds]
aqd has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
aqd has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
r29v has quit [Quit: r29v]
cthulchu has joined #ruby
Fusl has quit [Remote host closed the connection]
aqd has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Fusl has joined #ruby
Swyper has joined #ruby
renich has joined #ruby
aqd has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
sgen_ has joined #ruby
nowhere_man has joined #ruby
nowhere_man has quit [Remote host closed the connection]
cruzo66342 has quit []
nowhere_man has joined #ruby
Swyper has quit [Remote host closed the connection]
maryo_ has joined #ruby
bruul has joined #ruby
maryo has quit [Ping timeout: 268 seconds]
houhoulis has joined #ruby
houhoulis has quit [Ping timeout: 245 seconds]
kapil____ has joined #ruby
houhoulis has joined #ruby
<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
RougeR has quit [Ping timeout: 245 seconds]
\void has joined #ruby
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
gix has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
phait0 has joined #ruby
phait0 has left #ruby [#ruby]
Tempesta has quit [Quit: AdiIRC is updating to v3.4 Beta Build (2019/02/12 UTC) 64 Bit]
Tempesta has joined #ruby
braincrash has quit [Quit: bye bye]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esrse has joined #ruby
bruul has quit [Ping timeout: 264 seconds]
braincrash has joined #ruby
jcarl43 has joined #ruby
maryo_ has quit [Ping timeout: 250 seconds]
dellavg__ has joined #ruby
lytol_ has quit [Remote host closed the connection]
tdy2 has joined #ruby
houhoulis has quit [Remote host closed the connection]
sgen_ has quit [Ping timeout: 250 seconds]
tdy1 has quit [Ping timeout: 258 seconds]
RiPuk has joined #ruby
havenwood has quit [Quit: ZNC 1.7.2 - https://znc.in]
havenwood has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
skyikot has quit [Ping timeout: 256 seconds]
ogres has quit [Quit: Connection closed for inactivity]
sagax has quit [Ping timeout: 246 seconds]
sagax has joined #ruby
dellavg__ has quit [Ping timeout: 250 seconds]
efertone has quit [Quit: Bye o/]
segy has quit [Ping timeout: 246 seconds]
yitsushi has joined #ruby
spacesuitdiver has joined #ruby
r29v has joined #ruby
r29v has quit [Client Quit]
conta has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
renich has quit [Remote host closed the connection]
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
renich has joined #ruby
renich has quit [Remote host closed the connection]
renich has joined #ruby
segy has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Quit: Leaving]
aufi has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
orbyt_ has joined #ruby
aufi has quit [Ping timeout: 268 seconds]
opya has joined #ruby
aupadhye has joined #ruby
clemens3_ has joined #ruby
ravenousmoose has joined #ruby
clemens3_ has quit [Ping timeout: 268 seconds]
opya has left #ruby [#ruby]
lytol_ has joined #ruby
esrse has quit [Ping timeout: 246 seconds]
clemens3_ has joined #ruby
cd has quit [Quit: cd]
cthulchu has quit [Ping timeout: 240 seconds]
prestorium has joined #ruby
BH23 has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
aufi has joined #ruby
desnudopenguino has quit [Ping timeout: 272 seconds]
nowhere_man has quit [Ping timeout: 259 seconds]
agent_white has quit [Quit: night]
AJA4350 has joined #ruby
jmcgnh has quit [Ping timeout: 268 seconds]
jmcgnh_ has joined #ruby
amerlin has joined #ruby
ansraliant has quit [Quit: My planet needs me]
status402 has joined #ruby
mikecmpbll has joined #ruby
prestori_ has joined #ruby
prestorium has quit [Ping timeout: 244 seconds]
aufi has quit [Ping timeout: 258 seconds]
lunarkitty7 has joined #ruby
_ikke__ is now known as _ikke_
jmcgnh_ is now known as jmcgnh
status402_ has joined #ruby
status402 has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
sleetdrop has joined #ruby
prestori_ has quit [Quit: prestori_]
GodFather_ has quit [Read error: Connection reset by peer]
GodFather_ has joined #ruby
apparition has joined #ruby
postmodern has quit [Quit: Leaving]
ta_ has quit [Ping timeout: 268 seconds]
ta_ has joined #ruby
prestorium has joined #ruby
clemens3_ has quit [Remote host closed the connection]
prestori_ has joined #ruby
prestorium has quit [Ping timeout: 245 seconds]
Bish has joined #ruby
aufi has joined #ruby
BH23 has quit [Ping timeout: 246 seconds]
tdy3 has joined #ruby
tdy2 has quit [Ping timeout: 268 seconds]
ellcs has joined #ruby
Puppet_ has quit [Remote host closed the connection]
Puppet_ has joined #ruby
Tuor has joined #ruby
blackmesa has joined #ruby
prestori_ has quit [Quit: prestori_]
prestorium has joined #ruby
_whitelogger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 259 seconds]
yitsushi is now known as efertone
v01d4lph4 has joined #ruby
BH23 has joined #ruby
sleetdrop has quit [Ping timeout: 250 seconds]
markoong has joined #ruby
sleetdrop has joined #ruby
gnufied has quit [Remote host closed the connection]
lucasb has joined #ruby
blackmesa1 has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
ravenousmoose is now known as ravenousmoose[aw
ravenousmoose[aw has quit [Quit: Taking a quick nap...ZZzzz]
Tuor has quit [Quit: Konversation terminated!]
ravenousmoose has joined #ruby
sylario has joined #ruby
tdy3 has quit [Ping timeout: 245 seconds]
stryek has joined #ruby
blackmesa1 has quit [Remote host closed the connection]
bmurt has joined #ruby
p47r30n has joined #ruby
gigetoo has joined #ruby
p47r30n has quit [Read error: Connection reset by peer]
reber has joined #ruby
awkwords has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
yokel has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
apparition has quit [Quit: Bye]
yokel has joined #ruby
segy has quit [Ping timeout: 245 seconds]
segy has joined #ruby
mikecmpbll has quit [Ping timeout: 257 seconds]
awkwords has quit [Quit: sleepy time]
mikecmpbll has joined #ruby
awkwords has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
v01d4lph4 has quit [Ping timeout: 250 seconds]
clemens3 has joined #ruby
sgen_ has joined #ruby
s2013 has joined #ruby
mkroman has quit [Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number]
mkroman has joined #ruby
Rapture has joined #ruby
KeyJoo has joined #ruby
rippa has joined #ruby
conta has quit [Ping timeout: 246 seconds]
polishdub has joined #ruby
Bish has quit [Quit: leaving]
BH23 has quit [Ping timeout: 250 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
mensvaga has joined #ruby
<mensvaga> I'm running ubuntu 18.04 . There's a system package, bundler 1.16.1-1 , which is installed.
<mensvaga> When I `gem install bundler`, I get: Successfully installed bundler-2.0.1
<mensvaga> Actually, I ran that as root.
<mensvaga> anyway
reber has quit [Remote host closed the connection]
<mensvaga> when I run `bundle --version` as my user, I get: Bundler version 2.0.1
<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)
<darix> mensvaga: how does your script call bundler?
<darix> full path maybe?
<mensvaga> require "bundler/setup"
<mensvaga> That's it.
<darix> uhm
<darix> why not run your script with
<darix> bundle exec yourscript
<mensvaga> That's in the stub console file when you first create the project.
<mensvaga> "bundle exec" ?
<mensvaga> oh
<darix> to make sure that you run in a locked down env from the beginning
<mensvaga> OK, bundle exec worked.
eindoofus has joined #ruby
<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
<mensvaga> point to docs.
<mensvaga> err
<mensvaga> which docs you reading?
<eindoofus> Pragmatic Programming Ruby 4th Edition
<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" ?
<mensvaga> So, with those books, they turn into part reference, part tutorial
Inline has joined #ruby
<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
<eindoofus> it's more like the overwhelming variations in the usage of grammar for the same sentence
<mensvaga> Don't get discouraged by it. All programming languages are like that.
<mensvaga> The book is just presenting the information to you in what the Author thought was a useful way.
jordanm has quit [Ping timeout: 250 seconds]
<eindoofus> thanks for the words of wisdom. i'll try to keep that in mind and keep at it
<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.
<mensvaga> you're welcome.
<mensvaga> eindoofus: Another thing: You probably already made the leap and didn't realize it.
<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"
<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.
<mensvaga> This is when "actual" speed reading applies. Look at the headings, look at the first sentence, and then just breeze through those pages.
<phaul> what is an iterator?
<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.
<mensvaga> What's a diarama?
<phaul> is it something that includes Enumerable or instance of Enumerator
<mensvaga> eindoofus: That comes with experience.
<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.
<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.
spacesuitdiver has joined #ruby
dviola has joined #ruby
<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 :)
powerbit has quit [Remote host closed the connection]
SeepingN has joined #ruby
<phaul> sounds like I'm trolling but I'm geniunely curious how that book defines iterators
akem__ has quit [Remote host closed the connection]
akem has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mensvaga> If you're familiar with Tensors, some people define Tensors as "Things that Tensor operations can be done on."
<mensvaga> Which, when you're first learning about them does NOT help you understand what they are.
<mensvaga> But when you know what they are, you're answer is going to be "Things you can do Tensor things with."
<mensvaga> Which makes it hard to figure out if people actually know what they're talking about.
akem__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
conta has joined #ruby
<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
<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.
blackmesa1 has joined #ruby
akem__ has quit [Remote host closed the connection]
gnufied has joined #ruby
akem__ has joined #ruby
uplime has quit [Ping timeout: 250 seconds]
bruul has joined #ruby
s2013 has joined #ruby
<phaul> ah, Kernel#iterator? is an alias to block_given?. I never knew. Altough "mildly depricated".
segy has quit [Ping timeout: 250 seconds]
<phaul> &ri Kernel#iterator?
<mensvaga> deprecated lite
status402_ has quit [Quit: status402_]
segy has joined #ruby
<TheBrayn> https://gist.github.com/mmerfort/86d2a1fd33828d8fad7ccb4a0a504140 how do you think this could be improved?
amerlin has quit [Quit: leaving]
<phaul> you don't match with the method name on the recursion
<TheBrayn> what do you mean?
<phaul> deep_key_to_string vs deep_string_transform_key, arent those supposed to be the same?
<TheBrayn> oh right
<TheBrayn> I renamed that and forgot to update it
<TheBrayn> and the .to_h inside is redundant
<TheBrayn> updated it
<phaul> how about .tranform_values ?
<TheBrayn> isn't that from rails?
<phaul> no but nm, I forgot that you need to modify the keys too
<TheBrayn> I only transform the keys
<phaul> and recurse on the values that then tranforms them (deeper)
<phaul> but yeah, you need both k, v
<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 ]
jcarl43 has joined #ruby
<TheBrayn> I think that just makes it harder to read
<phaul> fair enough
<phaul> TheBrayn: are you on >= 2.6 ?
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
<TheBrayn> I wrote this on 2.5.3 but I'm usually on 2.6
<phaul> then to_h now takes a block, and map can be removed
<phaul> 2.5.3 doesn't have it
<TheBrayn> hmm, yes I'll use that in 2.5.3 code
<phaul> &25>> [1,2,3].to_h { |v| [v, v.odd?] }
<rubydoc> # => wrong element type Integer at 0 (expected array) (TypeError) (https://carc.in/#/r/68lg)
<phaul> &>> [1,2,3].to_h { |v| [v, v.odd?] }
<rubydoc> # => {1=>true, 2=>false, 3=>true} (https://carc.in/#/r/68lh)
spacesuitdiver has joined #ruby
clemens3 has quit [Ping timeout: 257 seconds]
<TheBrayn> Thanks for your ideas
<phaul> yw
<al2o3-cr> just for fun: JSON[h.to_json]
noark9 has joined #ruby
<phaul> :) cool
jordanm has joined #ruby
bruul has quit [Ping timeout: 258 seconds]
noark9 has quit [Max SendQ exceeded]
noark9 has joined #ruby
conta2 has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
awkwords_ has joined #ruby
awkwords has quit [Ping timeout: 259 seconds]
<mensvaga> OK; so, in my "gem directory", when I run: 'gem build SomeGem' , I get a gem.
<mensvaga> Should I be building it with a different command?
<mensvaga> Like, "bundler please_build_this_thing SomeGem" ?
<mensvaga> or is 'gem build SomeGem" good'nuf'
conta2 has quit [Ping timeout: 250 seconds]
aufi has quit [Ping timeout: 268 seconds]
BH23 has joined #ruby
uplime has joined #ruby
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
<blerrp> mensvaga: are you trying to `bundle install` ?
<blerrp> are you trying to build a gem or use one?
<mensvaga> Build a gem.
<blerrp> what's wrong with gem build
<mensvaga> I thought "bundle install" was when you wanted to fetch the requirements for your gem locally.
<mensvaga> Nothing's wrong
<mensvaga> I want to know if it's the RIGHT thing to do.
<blerrp> i think that's right
<blerrp> you can also read `bundle help`
<blerrp> might find something nifty
<blerrp> better yet https://bundler.io/
<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.
<blerrp> rofl
<blerrp> :(
awkwords_ has quit [Ping timeout: 250 seconds]
ravenousmoose has joined #ruby
<mensvaga> Oh, yeah, so, I've made gems before. Not many
<mensvaga> But each damn time was an adventure.
<mensvaga> And now, I need to write documentation so people can take the adventure with me.
valadares has quit [Ping timeout: 240 seconds]
\void has joined #ruby
<mensvaga> I'm making it public.
conta1 has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
bruul has joined #ruby
<mensvaga> There's a preview. I need to add how to do releases.
<mensvaga> And it's going to be added to a local gem repo, but that will just be a tiny shell script.
conta1 has quit [Ping timeout: 272 seconds]
v01d4lph4 has joined #ruby
akem__ has quit [Remote host closed the connection]
<phaul> if you want you could make a local rubygems.org
<phaul> then ppl ust gem install from you
akem__ has joined #ruby
<phaul> just*
<phaul> that's how publis gems to the ecosystem https://guides.rubygems.org/publishing/
valadares has joined #ruby
<mensvaga> That is a possibility. However, designing and maintaining a secure infrastructure in that way was out of the scope for the current project.
BH23 has quit [Ping timeout: 250 seconds]
<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.
<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.
ellcs has quit [Ping timeout: 250 seconds]
v01d4lph4 has quit [Remote host closed the connection]
<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
<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.
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
<phaul> I never install anything to system level, I agree with that
ravenousmoose has joined #ruby
<phaul> gem wise that is
<mensvaga> There's a nuance there:
<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
<mensvaga> *override
<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
cow[moo] has joined #ruby
valadares has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 272 seconds]
cthulchu has joined #ruby
cthulchu_ has joined #ruby
dinfuehr has joined #ruby
valadares has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
maryo has joined #ruby
v01d4lph4 has joined #ruby
v01d4lph4 has quit [Ping timeout: 246 seconds]
<havenwood> mensvaga: Gem names, files and directories should all be lowercase.
<havenwood> mensvaga: You can have multiple locations in GEM_PATH, one of which can be GEM_HOME.
akem__ has quit [Remote host closed the connection]
<havenwood> mensvaga: RubyGems will install to GEM_HOME, but look for gems in all the locations in GEM_PATH.
orbyt_ has joined #ruby
akem__ has joined #ruby
<havenwood> mensvaga: File.expand_path(__dir__, 'foodie/foodie.erb')
awkwords has joined #ruby
<mensvaga> For the case issue, is there a document with ALL of such standards so I can make sure I adhere to them?
ngw has joined #ruby
<havenwood> mensvaga: For gem name: https://guides.rubygems.org/name-your-gem/
<havenwood> mensvaga: File structure: https://guides.rubygems.org/patterns/
<ngw> hello *
<havenwood> ngw: hi
<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
<havenwood> mensvaga: You have an issue with you executable location. I the spec you say "exe" but you put it in the "bin" dir.
<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
<mensvaga> havenwood: so, that's interesting. That "spec.bindir" is indeed what was given to me by builder
<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__.
<ngw> I'm really very anal right now, but wanted to hear someone elses pov
<mensvaga> I *think* that's there for windows.
<mensvaga> ngw:
<mensvaga> json_file_name = File.expand_path(File.dirname(__FILE__)) + "/somemodule/file.json"
aupadhye has quit [Quit: Leaving]
<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".
orbyt_ has quit [Ping timeout: 246 seconds]
<mensvaga> ngw: data=JSON.parse(File.read(json_file_name))
mikecmpbll has quit [Quit: inabit. zz.]
<mensvaga> havenwood: any idea of how it came to be that 'exe' was chosen for bundler, when I'm running this on Linux?(!)
<havenwood> mensvaga: Pass #expand_path a second argument, and consider __dir__: File.expand_path(__dir__, 'foodie/foodie.erb')
<havenwood> mensvaga: Nothing to do with a .exe extension.
<mensvaga> ah, __dir__ , I will do that.
<havenwood> mensvaga: That's what Bundler chose to name that directory. Most non-Bundler-generated gems use "bin" not "exe". Your choice.
<mensvaga> So, what else can I use to generate gems?
<mensvaga> (that's recommended...)
<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.
<mensvaga> hehe, yeah, so, what else aside from bundler?
<mensvaga> I mean, of course "from scratch" is an option, but, what year is this?
<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.
<havenwood> mensvaga: Drop the .rb extension for your executable. You might also want to document the: chmod +x
<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
<mensvaga> My target audience is people who know that when they create a script that they need to run they should chmod +x .
<havenwood> mensvaga: I do use gem-release, to automate the release process.
<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.
awkwords has quit [Quit: sleepy time]
<mensvaga> The file case thing will be interesting to find out.
<mensvaga> I wanted the module named IAS-Foodie
<havenwood> mensvaga: It's convention to drop extensions from executables.
<mensvaga> and bundler generated the directory structure for me.
<havenwood> mensvaga: that module name corresponds with the gem name ias-foodie and the file structure /lib/ias/foodie.rb
<havenwood> mensvaga: It suggests that IAS is a gem, and this is an IAS plugin.
<havenwood> mensvaga: ias_foodie would be a single gem, corresponding to IASFoodie
<havenwood> mensvaga: Do follow naming conventions or you'll be throwing users for a loop.
<mensvaga> I intend on following the naming conventions.
<mensvaga> I am a cave man.
<mensvaga> Your world frightens and amazes me.
<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"
nowhere_man has joined #ruby
<havenwood> mensvaga: pry-theme for example is a plugin for the pry gem
<mensvaga> I'm reading the doc here https://guides.rubygems.org/name-your-gem/
<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.
<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
<havenwood> mensvaga: So actually you just need to remove a line to make where you put it work.
ravenousmoose is now known as ravenousmoose[aw
<mensvaga> The last 2 statements from you, I either don't have context for
<mensvaga> * I don't understand the bigger picture. Currently thinking about other things.
valadares has quit [Ping timeout: 257 seconds]
<mensvaga> So, "bin" is the default executable path for what?
<mensvaga> WHen the gem is installed?
<mensvaga> if I want stuff in bin/ to be "runable" or whatever?
<havenwood> mensvaga: It's the default bindir.
<mensvaga> OK; I'll change that too.
valadares has joined #ruby
<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
<mensvaga> Yes, That's what I said "bundler" did
<havenwood> mensvaga: The line below it would also need to change. I like to just manually list my executables.
raulp has joined #ruby
noark9 has quit [Quit: noark9]
<mensvaga> Yeah, above that they do a `git ls-files` to get a list of things.
<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.
<havenwood> mensvaga: Or you could follow its conventions.
<mensvaga> 'bin' vs exe?
ngw has quit [Quit: WeeChat 2.3]
<mensvaga> Shit-loads of 'TODO' in there, making it so a default gem just won't build?
KeyJoo has quit [Quit: KeyJoo]
<havenwood> I don't like that convention, but if you create an exe/ dir and put your binary there it'll *just work*.
<mensvaga> Forcing me to put in valid URIs for: spec.homepage ?
tdy3 has joined #ruby
KeyJoo has joined #ruby
<mensvaga> Also, it "forces" you to use git, by using 'git ls-files' in order to generate a file list.
<havenwood> mensvaga: You could see if you like this generator better: https://github.com/svenfuchs/gem-release#gem-bootstrap
eindoofus has quit [Remote host closed the connection]
ravenousmoose[aw is now known as ravenousmoose
lxsameer has quit [Ping timeout: 268 seconds]
nowhere_man has quit [Ping timeout: 258 seconds]
Dbugger has joined #ruby
valadares has quit [Remote host closed the connection]
valadares has joined #ruby
prestorium has quit [Quit: prestorium]
[Butch] has joined #ruby
awkwords has joined #ruby
awkwords has quit [Client Quit]
ogres has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
tdy4 has joined #ruby
ravenousmoose is now known as ravenousmoose[aw
awkwords has joined #ruby
tdy3 has quit [Ping timeout: 244 seconds]
ravenousmoose[aw is now known as ravenousmoose
mikecmpbll has joined #ruby
skryking has joined #ruby
AJA4350 has joined #ruby
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
KeyJoo has quit [Ping timeout: 245 seconds]
gix has joined #ruby
blackmesa1 has quit [Ping timeout: 250 seconds]
nowhere_man has joined #ruby
clemens3 has joined #ruby
scrptktty has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
tdy has joined #ruby
tdy4 has quit [Ping timeout: 250 seconds]
agent_white has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
cthulchu_ has quit [Remote host closed the connection]
code_zombie has joined #ruby
cthulchu_ has joined #ruby
cthulchu has quit [Ping timeout: 258 seconds]
lxsameer has joined #ruby
nowhere_man has quit [Ping timeout: 258 seconds]
dviola has quit [Quit: WeeChat 2.3]
blackswan has joined #ruby
<blackswan> i am trying to use rails in Perl. don't ask why, it's not safe for you to know.
<KindOna> @_@
<blackswan> it's complaining "Subroutine new redefined at (eval 324) line 518." for some deprecated OpenSSL classes
<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'
<blackswan> one from the Inline::Perl module, and one from the OpenSSL Ruby classes
<blackswan> except... as far as i can tell, the OpenSSL code doesn't override 'new'.
<KindOna> are you just blabbering without purpose or do you actually have a question
<KindOna> because i'm hoping it's the former
<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.
<blackswan> so i have a question, yes.
<KindOna> :(\
<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?
conta has quit [Quit: conta]
<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
<phaul> classes all override the new method. That's how you get instances of classes
<blackswan> i mean, grepping would be easy finding the lines i'm looking for wouldn't be easy.
<phaul> disclaimer: as far as I understand things.
<blackswan> well, it's not complaining about other classes, just these OpenSSL classes
<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.
<blackswan> (whether it is a problem or not. if it's a problem, i want to fix it)
<blackswan> hm. it's trying to define the two 'news' in Perl, not ruby.
<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.
Swyper has joined #ruby
<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.
Swyper has quit [Remote host closed the connection]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
johnny56_ has quit [Ping timeout: 272 seconds]
v01d4lph4 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56_ has joined #ruby
* phaul keeps forgetting about #allocate
r3m has quit [Quit: WeeChat 2.4-dev]
r3m has joined #ruby
r3m has quit [Client Quit]
Inline has quit [Read error: Connection reset by peer]
<havenwood> phaul: I hardly ever use it. Easy to forget but I guess occasionally handy.
Inline has joined #ruby
r3m has joined #ruby
Inline has quit [Read error: Connection reset by peer]
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
Inline has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
millerti has quit [Read error: Connection reset by peer]
TitoN- has joined #ruby
donofrio has joined #ruby
<blackswan> it's because Digest::Base, Digest::Class, and Digest::Instance define an instance method named 'new'.
bmurt has joined #ruby
flux__aeon has joined #ruby
<flux__aeon> good morning. i'm new to rails and am having trouble grabbing a transaction ID returned from a Stripe call
<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
<flux__aeon> https://stripe.com/docs/api/charges/create?lang=ruby according to the docs I should receive a response with "id"
powerbit has joined #ruby
Rapture has quit [Ping timeout: 250 seconds]
lunarkitty7 has quit [Ping timeout: 258 seconds]
tdy1 has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
<havenwood> flux__aeon: You put your code after a `return`, so it'll never run.
flux__aeon has quit [Read error: Connection reset by peer]
[Butch] has joined #ruby
<havenwood> flips: As a Square engineer, I have to object to the gem you chose. :P
<havenwood> Oops, flux left and my autocomplete failed. Sorry flips.
<havenwood> Anyhoo, put the code before the rescue, and it'll work as expected.
v01d4lph4 has quit [Remote host closed the connection]
<havenwood> gem install square_connect
agent_white has quit [Quit: brb]
agent_white has joined #ruby
Rapture has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
xco has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
blackmesa1 has joined #ruby
DTZUZO has joined #ruby
bruul has quit [Ping timeout: 250 seconds]
<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
<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
<havenwood> xco: This is more of a Postgres question than Ruby or Rails.
<havenwood> ?crosspost
al2o3-cr has quit [Quit: WeeChat 2.3]
<xco> havenwood: oh thank you i’ll read those docs to pick something :)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
al2o3-cr has joined #ruby
flux__aeon has joined #ruby
<flux__aeon> figured it out :)
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
sriehl has quit [Remote host closed the connection]
sriehl has joined #ruby
sriehl has quit [Client Quit]
v01d4lph4 has joined #ruby
sriehl has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
v01d4lph4 has quit [Ping timeout: 252 seconds]
tdy1 has quit [Ping timeout: 258 seconds]
reber has joined #ruby
blackmesa1 has quit [Ping timeout: 258 seconds]
<havenwood> flux__aeon: Put your code before the `rescue`?
<flux__aeon> I did do that
bruul has joined #ruby
<flux__aeon> and i had to use @charge_id = charge["id"]
<havenwood> flux__aeon: 👍🏽
<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
rprimus has quit [Ping timeout: 244 seconds]
<havenwood> flux__aeon: rescue only happens if an error is raised
<flux__aeon> so code should be able to run after it though right?
<flux__aeon> or rescue should always go at the bottom
<havenwood> flux__aeon: you can ask `charge` what class it is with `charge.class`. it's `charge["id"]` because `charge` is a Hash.
<havenwood> flux__aeon: It can be handy for debugging to use #p to print an inspect an object: p charge
rprimus has joined #ruby
<flux__aeon> i thought somewhere else in this person's code they created a customer object
<flux__aeon> and used customer.id
<flux__aeon> customer = Stripe::Customer.retrieve(stripe_data[:customer])
<flux__aeon> either way i got it to work. debugging is kind of a pain
<havenwood> flux__aeon: look at: customer.class
<havenwood> flux__aeon: Pry makes debugging far easier.
<havenwood> ?pry flux__aeon
* havenwood pokes ruby[bot]
<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
<havenwood> flux__aeon: binding.pry ftw
sgen_ has quit [Ping timeout: 268 seconds]
<havenwood> flux__aeon: or these days you can binding.irb too
renich has quit [Ping timeout: 272 seconds]
<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
<havenwood> flux__aeon: Do you know python's interactive mode?
<flux__aeon> yes
<flux__aeon> how do i load an entire rails project into irb?
<flux__aeon> so many moving parts
<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.
<havenwood> flux__aeon: Try adding a `binding.irb` to a line in your code, then run the app.
<flux__aeon> what does that mean
<flux__aeon> add the phrase "binding.irb" and then run foreman start?
<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.
<havenwood> flux__aeon: yup
<havenwood> flux__aeon: To get a fancier interactive terminal, you can add `gem pry-rails` to your Gemfile and run: bundle
<havenwood> flux__aeon: It's well worth getting the hang of.
<havenwood> flux__aeon: I mean: gem 'pry-rails'
<flux__aeon> wow you're so helpful! thank you i appreciate the help
reber has quit [Remote host closed the connection]
nowhere_man has joined #ruby
AJA4350 has joined #ruby
skyikot has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
skryking has quit [Quit: Leaving]
jcalla has quit [Remote host closed the connection]
<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?
<phaul> edit methodname
<Puppet_> ah, thanks
<phaul> np
orbyt_ has joined #ruby
xco has quit [Quit: xco]
lunarkitty7 has joined #ruby
bruul has quit [Quit: WeeChat 2.3]
Dbugger has quit [Ping timeout: 268 seconds]
polishdub has quit [Remote host closed the connection]
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
cd has joined #ruby
arekushi has joined #ruby
Tharbakim has quit [Quit: Something has gone terribly wrong. Send help.]
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
Tharbakim has joined #ruby
wilbert has joined #ruby
tdy1 has joined #ruby
wilbert has quit [Quit: wilbert]
skyikot has quit [Ping timeout: 256 seconds]
wilbert has joined #ruby
flux__aeon has quit [Quit: Textual IRC Client: www.textualapp.com]
blackswan has quit [Quit: Leaving.]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua has quit [Ping timeout: 240 seconds]
mn3m has joined #ruby
ua has joined #ruby
spacesuitdiver has quit [Ping timeout: 258 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
v01d4lph4 has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
v01d4lph4 has quit [Ping timeout: 250 seconds]
akosednar has quit [Ping timeout: 244 seconds]
clemens3 has quit [Ping timeout: 250 seconds]
clemens3_ has joined #ruby
blackmesa1 has joined #ruby
conta has joined #ruby
Swyper has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
Cthulu201 has quit [Ping timeout: 268 seconds]
conta has quit [Ping timeout: 245 seconds]
lxsameer has quit [Ping timeout: 258 seconds]
scrptktty has quit [Quit: Connection closed for inactivity]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
blackswan has joined #ruby
elcontrastador has quit [Quit: Textual IRC Client: www.textualapp.com]
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby