Page 1 of 1
[13:08:21] guymanndude: Hi, I've developed a Ruby gem. I want to specify that it requires Ruby v2.0 or above. I know how to do this in my .gemspec file, however I'm wondering if there is a convention for showing this in the project's README
[13:09:15] guymanndude: like, in my *Install* section, can I just have a bulletpoint or line that says "Requires Ruby 2 or above" ?
[13:12:44] guymanndude: I don't imagine Ruby would remove YAML.safe_load in those later versions...at least I hope not
[13:14:33] guymanndude: so should I bump up the minor version of my gem with this small update dminuoso_ ?
[13:16:37] guymanndude: I tried reading thru this, but it's not clear http://guides.rubygems.org/patterns/#semantic-versioning
[17:10:39] guymanndude: hi folks, I'm wondering if there's an obvious way of solving my problem I haven't thought of: I want to populate a Ruby file with values from a YAML file
[17:11:07] guymanndude: I've loaded the YAML file, know how to access the keys I need...but how to interpolate that into the actual Ruby script?
[17:16:57] guymanndude: yup darix. I can change the state of the file by running it through Ruby, but am unsure as to how to "trigger" the interpolation/reading from the YAML file
[17:22:01] guymanndude: havenwood: so file["key"]["value"] is just giving the path to the exact value I want to interpolate there from the YAML file
[17:23:44] guymanndude: havenwood: it's an example key. in practice, it's our different environments in the YAML file (dev, test, qat, prod)
[17:24:58] guymanndude: you can ignore all that...here's a simpler example: https://paste.ee/p/fOG2h
[17:27:04] guymanndude: matthewd: sure, here's a better link https://paste.ee/p/7uJ4T#U02tvHWFNvWkBU9rCRt1ArLBTLskW7Z6
[17:28:01] guymanndude: havenwood: right, but I want the value from the YAML file to be interpolated into the ruby file
[17:29:46] guymanndude: right...but how do I get some_file.rb to go from the "templated" value to actually have the value from the YAML file interpolated?
[17:31:50] guymanndude: hmm, I've already written one that modifies YAML files like this...guess I have to have it handle Ruby files as well now
[17:32:57] guymanndude: so I've already written a third script that goes out to the internet and populates a YAML file. Then I want to load data from that modified YAML file into another Ruby file
[17:34:25] guymanndude: it's to setup dev environments with credentials stored in a secure site online (think like lastpass/1password etc)
[17:35:42] guymanndude: because for all intents and purposes the Ruby script is just more data/credentials
[17:37:06] guymanndude: how would you rewrite the file from the YAML file, essentially is what I'm asking
[17:41:50] guymanndude: just realized what I'm trying to do is self-modifying code and that this is a whole "Thing"
[17:42:11] guymanndude: ok, will continue my research there...apparently there's a thing called closures, sounds promising
[18:14:55] guymanndude: hi, is there a way to both dump with YAML.dump && append to the same file, in one line?
[18:24:04] guymanndude: Papierkorb: thanks, however that would still necessitate doing two lines to write to my content variable
[18:24:25] guymanndude: is there a way to do this in a oneliner? both dump the YAML to content, as well as a string?
[18:27:01] guymanndude: havenwood: yeah kindof, apparently my "Assignment Branch Condition size for main is too high"
[18:33:33] guymanndude: haha yeah. I think this is the point I step back for a sanity check...code looked cleaner before this
[21:20:12] guymanndude: hi, I'm working on a Thor::Group script but am having trouble writing tests for it; are there any resources explaining how to approach testing a Thor::Group script with RSpec or something similar?
[21:20:43] guymanndude: basically I'm shelling out to an external application and moving and manipulating files
[21:28:39] guymanndude: ok zenspider, thanks. I guess I can create an instance of my script, call it to manipulate the files and check if they've been created and look right
[21:33:37] guymanndude: zenspider: sorry I misunderstood. I'm not sure I follow by "right command string/arrays"
[20:42:39] guymanndude: hi, I've noticed a bug in my code where converting a DateTime UNIX epoch time to a formatted string sets the date to 1970-01-01
[21:07:09] guymanndude: pupsicle: here's how I'm using for ref https://0bin.net/paste/iU2tMR-9C9-GkWAK#tst4Pm2vJ8Wk7usGJv1nDlu4dUHVG+sBgynVTwiHfDu
[21:07:48] guymanndude: pupsicle: how I end up calling it is: Time.epoch_to_date(epoch_date: Time.now)
[21:47:09] guymanndude: essentially ensuring that a date that I pass to epoch_date is never 1970-01-01