leitz

Activity Graph

Page 1 of 14 | Next »

2018-12-11

[13:29:14] leitz: has joined #ruby
[13:29:25] leitz: has left #ruby: ()

2018-12-07

[15:43:08] leitz: has joined #ruby
[23:35:54] leitz: Remote host closed the connection

2018-12-05

[11:14:21] leitz: has joined #ruby
[22:27:19] leitz: Quit: Leaving

2018-12-04

[10:40:06] leitz: has joined #ruby
[18:07:10] leitz: Remote host closed the connection

2018-12-01

[13:53:25] leitz: has joined #ruby
[15:04:36] leitz: Anyone familiar with Sinatra? The json file just spews out a single string of everything. https://gist.github.com/LeamHall/9cdce5e3e01ac6a3b88504fc2d4577df
[15:08:09] leitz: phaul, ah. So I need to fix that.
[15:15:39] leitz: phaul, my goal is to make a link for each key, Still trying to figure it out.
[15:17:20] leitz: Ah, the return is just the last evaluated item.
[15:23:03] leitz: Fixed. https://gist.github.com/LeamHall/4505dd8b86747ee7ea8d0d149712d4ba
[15:23:33] leitz: phaul, I tend to code in a very basic style. Suits me better, mostly due to my lower skills.
[15:28:06] leitz: phaul, Ruby is the most fun language I know.
[17:03:21] leitz: Quit: Leaving

2018-11-29

[15:49:54] leitz: has joined #ruby
[15:57:06] leitz: Not trying to start a flame war, just building my 2019 learning plan. Are there things that Cucumber does that RSPEC 3 does not?
[16:16:49] leitz: jhass, thanks! I'm trying to build more tests, to include "is my DB up?" and things like that.
[16:17:17] leitz: Learning more RSPEC is high on my "to do" list but I was not sure if I needed to add Cucumber.
[16:18:05] leitz: I support the environment, having automated tests helps. :)
[23:02:23] leitz: Quit: Leaving

2018-11-28

[17:41:57] leitz: has joined #ruby
[22:02:37] leitz: Quit: Leaving

2018-11-23

[00:50:09] leitz: Quit: Leaving
[18:01:39] leitz: has joined #ruby
[20:38:46] leitz: Quit: Leaving

2018-11-22

[21:37:09] leitz: has joined #ruby

2018-11-20

[15:57:56] leitz: has joined #ruby
[16:40:07] leitz: Quit: Leaving

2018-11-17

[23:19:48] leitz: has joined #ruby
[23:40:19] leitz: Quit: Leaving

2018-11-15

[13:32:36] leitz: has joined #ruby
[14:19:55] leitz: Quit: Leaving

2018-11-11

[00:37:15] leitz: has joined #ruby
[01:47:33] leitz: Quit: Leaving

2018-11-10

[14:17:30] leitz: has joined #ruby
[21:49:07] leitz: Quit: Leaving

2018-11-09

[13:15:22] leitz: has joined #ruby
[15:54:44] leitz: Tohm3, most of the Ruby I've done in version 2.x and greater seems to work okay, though newer versions add stuff.
[15:55:28] leitz: If you're just trying to learn, does the OS come with a version of Rails and Ruby? They will be old, and if you try to install gems and use github repositories you'll have issues.
[15:55:48] leitz: But if you can just start with the basics, it's pretty fun. Well, Ruby is. Not sure about Rails.
[16:14:50] leitz: Tohm3, it sort of depends. The issue isn't Ruby, exactly, but trying to mix your sources.
[16:15:30] leitz: It took me a while to like Ruby (and to put up with some of the gruff here) but once I got into it I was hooked. I've only moved away because I'm on a new career that isn't Ruby based.
[16:15:55] leitz: Have you looked at Rack and Sinatra? Or Hanami?
[16:16:01] leitz: Might be an easier learn.
[16:35:29] leitz: havenwood, i couldn't remember that one. Jeremy impresses me, though that doesn't take much.
[16:45:12] leitz: Ruby was the first language I really wanted to read the reference documents on.
[21:41:40] leitz: Quit: Leaving

2018-11-08

[00:32:34] leitz: Quit: Leaving

2018-11-07

[21:14:41] leitz: has joined #ruby

2018-11-06

[08:19:42] leitz: has joined #ruby
[09:58:47] leitz: Quit: Leaving

2018-11-04

[11:10:44] leitz: has joined #ruby
[12:26:45] leitz: Quit: Leaving

2018-10-30

[10:24:04] leitz: has joined #ruby
[19:42:48] leitz: Quit: Leaving

2018-10-28

[22:40:05] leitz: has joined #ruby

2018-10-24

[10:21:59] leitz: has joined #ruby
[11:04:52] leitz: Quit: Leaving
[22:05:57] leitz: has joined #ruby
[23:56:29] leitz: Quit: Leaving

2018-10-23

[21:25:57] leitz: has joined #ruby
[22:47:28] leitz: Remote host closed the connection
[23:14:18] leitz: has joined #ruby
[23:32:32] leitz: Quit: Leaving

2018-10-19

[09:04:24] leitz: has joined #ruby
[10:38:05] leitz: Quit: Leaving

2018-10-08

[19:41:44] leitz: has joined #ruby
[21:20:41] leitz: Quit: Leaving

2018-10-04

[16:46:37] leitz: has joined #ruby
[19:49:16] leitz: Quit: Leaving

2018-09-15

[11:01:52] leitz: has joined #ruby
[11:18:03] leitz: apg, I missed it, so we're good. :)
[11:23:54] leitz: What makes you decide "class" versus "OpenStruct"?
[12:01:29] leitz: apeiros, for me that may be an eternity. I've been trying to learn to code for a while. ;)
[12:02:17] leitz: In this case, I'm thinking of your comment about the character_tools mixin, and how the purpose for it seemed confusing.
[12:03:08] leitz: The "Character" class could be an Ostruct, there are only two or three "standard" methods the class would need, and they can be extracted to whatever class needs them.
[12:04:04] leitz: Since my view of "Character" is fairly organic, OStruct might be better.
[12:11:29] leitz: apeiros, "enumerate" as in "explain" or as in "is enumerable"?
[12:12:19] leitz: Ah, then depending on use case, no.
[12:13:27] leitz: It is a limited number of properties, but different use cases add properties while usually using the core set or properties.
[12:22:12] leitz: apeiros: https://gist.github.com/LeamHall/53609ff097768d6efc7b1e29097a3154
[12:24:38] leitz: The issue I have is the ability to add properties that are undefined.
[12:25:26] leitz: I pulled "Character_Tools" out of "Character" because the tools are only used on creation, not on presentation.
[12:25:46] leitz: Having them combined made for a huge class definition.
[12:26:41] leitz: How would you set the Character class up to add properties not in the original class?
[12:28:46] leitz: At the moment there are two sets of properties: "Base + Usual" and "Leitz's Expanded which includes Base + Usual".
[12:30:03] leitz: Ah, so the base Character has a "@custom" property?
[12:33:41] leitz: Would you put the "standard" generation methods in the base class? There are a couple dozen of them. Less if the @custom stuff is pulled out.
[14:08:47] leitz: apeiros, no worries. Class Character can either take an existing hash and convert it to a Character, or it can take an empty hash and generate the data. For the "standard" use of the class, should the generation methods go into the base class? Those things all Characters have?
[14:14:35] leitz: Okay, i'm working on understanding it. Slowly...
[14:30:29] leitz: apeiros, this is what I have so far. https://gist.github.com/LeamHall/d5aed9d0f1cfa0f55e74967310e90d66
[14:30:35] leitz: Critique?
[14:34:56] leitz: The "separate class" for generate was most of what "Character_Tools" did, I thought you recommended it be in the class?
[14:38:58] leitz: If the generation is pulled out then there are no real methods in the Character class. So back to an Ostruct.
[14:40:25] leitz: There's a Presenter for different output styles, and I'm building stuff to input from CSV and JSON.
[20:07:08] leitz: apeiros, do you know of some code that is structured like that? I'd love to take a look and learn.
[20:31:54] leitz: apeiros, I read baweaver's stuff, can't say that I understand it yet. I sort of scratch my head and say "Nice...I think." ;)
[21:10:15] leitz: Hey havenwood, in your copious free time (!), can you look at: https://github.com/makhidkarun/ftl_chargen/blob/master/bin/chargen#L83-L87
[21:10:54] leitz: I haven't figured out how to use the careers in the module refactor.
[21:12:09] leitz: havenwood, a sample career. https://github.com/makhidkarun/ftl_chargen/blob/master/lib/ftl_chargen/careers/navy.rb
[21:13:33] leitz: ACTION thinks if havenwood's help was paid for in libations the poor guy would be drunk for years...
[21:14:05] leitz: havenwood, just one class. The program is called with "bin/chargen -c Navy"
[21:15:09] leitz: Though the career names are put in a list to check. So "bin/chargen -c PoorCoder" would default to a career based on the social standing (:soc) since there is no PoorCoder class.
[21:15:48] leitz: havenwood, it ignores the -c option. Lemme run it real quick and gist it.
[21:16:02] leitz: PooCoder....yeah, see where there's no class? :P
[21:17:41] leitz: havenwood, example: https://gist.github.com/LeamHall/c3ba5c7aaf16b6417130855aee644e2c
[21:19:03] leitz: havenwood, correct. This broke when I moved things to FTLChargen module. Lemme go find the old code.
[21:20:53] leitz: havenwood, Number of terms in that career.
[21:21:09] leitz: Each term ages the character 4 years, but background careers don't.
[21:21:38] leitz: havenwood, so a -t 5 means 20 years in that career.
[21:22:38] leitz: havenwood, the careers hash might be {'Navy' => 2, 'Citizen' => 1 }
[21:23:29] leitz: ACTION backspaces...
[21:24:12] leitz: havenwood, on Line 2 of the gist, "Citizen' is the career, based on Soc.
[21:25:45] leitz: Not familiar with Rails. The careers are in a separate directory to allow the Array to be built from going over the names.
[21:26:18] leitz: havenwood, yeah, hadn't thought of mixed case, so far they are all capitalized.
[21:28:24] leitz: havenwood, the idea was to allow others to write their own career files. Even have a document for it. :)
[21:29:29] leitz: havenwood, can you do it without specifying? That was a design goal, "just plop a career in".
[21:30:30] leitz: ACTION goes to google
[21:30:50] leitz: havenwood, this? Dir["/path/to/directory/*.rb"].each {|file| require file }
[21:31:51] leitz: Should I require all careers even if only one will be used for a program run?
[21:32:51] leitz: ACTION goes to code for a minute.
[21:40:12] leitz: havenwood, apeiros, added the Dir.glob on line 12. Line 88 is giving an uninitialized constant since the constant now has the module prefix. https://github.com/makhidkarun/ftl_chargen/blob/career_refactor/bin/chargen#L88
[21:40:55] leitz: The module prefix is the issue I'm hitting. In the gist, "FTLChargen::Navy" wasn't found in the career array so the Soc was used to make a Citizen.
[21:47:26] leitz: apeiros, this "Dir.glob('ftl_chargen/careers', dir: "../lib") {|file| require file }" gives "in `glob': unknown keyword: dir (ArgumentError)"
[21:47:34] leitz: Why not use srand?
[21:49:24] leitz: apeiros, on the "const_get", it used to work before moving everything to the module.
[21:50:47] leitz: apeiros, okay, base works. And I'm a pragmatic guy; "works" is "correct". :)
[21:52:14] leitz: Harsh is okay, given the amount of help you're providing. :)
[21:58:11] leitz: apeiros, I'm missing how to format the Object.const_get. Tired to remove each section and it still errors. https://github.com/makhidkarun/ftl_chargen/blob/career_refactor/bin/chargen#L87-L91
[21:58:29] leitz: uninitialized constant FTLChargen::Careers (NameError)
[21:59:42] leitz: Line 13 should have it. https://github.com/makhidkarun/ftl_chargen/blob/career_refactor/bin/chargen#L13
[22:02:36] leitz: Hmm...changing "require" to "puts" gives nothing. Poking it some more.
[22:09:47] leitz: apeiros, Dir.glob("ftl_chargen/careers/*.rb", base: "lib/") {|file| require file }
[22:12:06] leitz: At the moment I'm focused on the one issue. Even requiring the files doesn't resolve it.
[22:14:42] leitz: Interesting, may have it. Not sure why.
[22:16:55] leitz: Yup. so the solution is to remove "Careers" since it was never created as a module/namespace.
[22:18:08] leitz: apeiros, it's the level I can understand at the moment.
[22:18:15] leitz: hays, you're in good hands!
[22:29:18] leitz: Hey baweaver, your name was used in vain earlier.
[22:29:32] leitz: I think havenwood wandered off drunk.
[22:30:49] leitz: apeiros, i think the mapping is 1:1, but the Careers namespace is not defined.
[22:31:02] leitz: That is, each career establishes one Constant.
[22:32:11] leitz: apeiros, and that goes back to the dynamic nature of the career files. On the off chance anyone else ever uses this, I wanted added a career to be easy.
[22:32:29] leitz: ACTION smiles since his tests also pass.
[22:44:38] leitz: apeiros, I think I see what you mean. However, there's another issue to fix that's related, it seems. I'm getting "circular requires" and want to fix that before doing any more requires.
[22:45:35] leitz: They are killing the Travis tests.
[22:46:36] leitz: Can you see the results here? https://travis-ci.org/makhidkarun/ftl_chargen/builds/429097613
[22:47:30] leitz: hmm...should not call ftl_tools. Gimme a sex.
[22:47:44] leitz: sec...ARGGGHHH!!!!
[22:50:21] leitz: Me neither.
[22:50:37] leitz: Of course, if havenwood is drunk enough...
[22:51:10] leitz: Which one?
[22:52:24] leitz: Okay, travis passes now. I would still like to get rid of the circular require because it's bad form.
[22:53:15] leitz: In theory (a big word), character_tools should not require anything. It should just be mixed in to Character.
[22:53:24] leitz: In practice...
[22:54:48] leitz: It comes up in rake, too.
[22:55:01] leitz: Sorry, my rake file just runs tests.
[22:57:09] leitz: I'm still chuckling at it being confused about assigned but unused variables. The assignment is the use.
[23:03:20] leitz: Okay, I have some duplicate defs to clean up. While you're awake though. you're saying I should make lib/ftl_chargen/careers.rb do the mass require and put the careers into a Career namespace inside FTLChargen?
[23:10:07] leitz: So take the Dir.glob and put it there, and then just require ftl_chargen/careers?
[23:10:59] leitz: ACTION goes to break more stuff.
[23:15:22] leitz: ACTION really needs to fix these circular requires.
[23:17:09] leitz: What's the best way to fix the direct directory reference? https://github.com/makhidkarun/ftl_chargen/blob/master/bin/chargen#L25-L32
[23:18:19] leitz: I was using the load path.
[23:19:43] leitz: ACTION goes back to breaking stuff.
[23:24:38] leitz: Okay, I'm done for the day. Thanks for the help apeiros! When havenwood sobers up, tell him thanks too.
[23:37:11] leitz: Quit: Leaving

2018-09-14

[09:41:50] leitz: has joined #ruby
[12:50:07] leitz: Don't feel bad; accept that some tools are better for some jobs. We all have picked up the wrong tool at times. Like Perl. :P
[15:25:23] leitz: havenwood, I finally got my tests running after that minor refactor you suggested.
[15:26:04] leitz: Still have issues to fix, but mentally processing apeiros' comment about the mixin module. May need another refactor to use a Builder.
[15:26:24] leitz: I still need to understand the issue more, though.
[15:38:23] leitz: Yeah, you say that now...wait till I start hitting you with questions. ;)
[15:55:19] leitz: apeiros, beats "hit on", since I think havenwood and I have Significant Others that might get concerned. :)
[19:10:03] leitz: Okay havenwood, I told you I'd be back with questions. https://github.com/makhidkarun/ftl_chargen/blob/builder_01/lib/ftl_chargen/builder.rb#L20
[19:10:32] leitz: The error is: builder.rb:20:in `generate_upp': undefined method `[]=' for #<FTLChargen::Character:0x0000563c9b8a2c48> (NoMethodError)
[19:10:52] leitz: But Character has an attr_accessor for upp.
[19:11:18] leitz: What am I missing?
[19:38:23] leitz: Okay...figured that one out.
[22:08:24] leitz: zenspider, me being confused on setting an object's attribute.
[22:08:46] leitz: Sometimes I'm a little slow...
[22:13:04] leitz: Well, storm is finally almost here. Will be shutting down in a bit. hopefully we don't wash away.
[22:41:40] leitz: Quit: Leaving

2018-09-13

[21:22:48] leitz: has joined #ruby
[21:31:21] leitz: Confused on why the tests pass but the program fails. In theory the offending include should be tested, right? https://gist.github.com/LeamHall/f6181aed2d0a1ce26114af399ebee448
[22:26:15] leitz: Sooner or later I have to figure out the circular loading issue.
[22:26:26] leitz: But the program works, again. Finally!
[23:14:43] leitz: Quit: Leaving

2018-09-11

[13:35:36] leitz: has joined #ruby
[14:41:27] leitz: Quit: Leaving

2018-09-10

[09:17:57] leitz: has joined #ruby
[09:20:07] leitz: If calling myobject.class gives "Parent::Me", is there a way to get the 'Me' class name alone, or just split on the '::'?
[10:36:56] leitz: Quit: Leaving

2018-09-09

[08:32:57] leitz: has joined #ruby
[09:10:06] leitz: Good morning apeiros!
[09:12:33] leitz: This morning's work has been to understand more of what havenwood talked about. Especially tests. https://github.com/LeamHall/ruby_namespace
[12:13:45] leitz: Quit: Leaving

2018-09-08

[17:31:31] leitz: Holy Moses! IT WORKED!
[17:31:35] leitz: Once, anyway...
[17:31:48] leitz: Now to clean up the other careers.
[17:33:19] leitz: Yeah, one specific one. What's the convention on a data directory? I'm using: $DATA_PATH = File.expand_path("../../../data", __FILE__)
[17:33:27] leitz: Which does not seem best.
[17:34:30] leitz: Understood. In the project there's lib, and data/. The latter has the database and text files that get used.
[17:37:33] leitz: Will do. The module_function seems to have issues though. Poking at it.
[17:38:58] leitz: I put module_function at the top and now it things social_status is a private method.
[17:39:17] leitz: https://github.com/makhidkarun/ftl_chargen/blob/master/lib/ftl_chargen/character_tools.rb#L10
[17:39:47] leitz: havenwood, old computer, old keyboard monkey. Nothing moves fast here...
[17:40:07] leitz: private method `social_status' called for #<FTLChargen::Character:0x000055c6acec3f10> (NoMethodError)
[17:40:42] leitz: I thought it made everything public? Ah...
[17:41:46] leitz: Dang bipolar methods...
[17:43:42] leitz: If rubocop breaks stuff right after I almost got it working I'm going to whine. Loudly...
[17:44:49] leitz: Hmm...only 3 offences.
[17:45:26] leitz: apeiros, I was hoping to find a way to not have to put "module_function" under everything since they are all to be exportable.
[17:47:03] leitz: havenwood, okay, a lot more stuff changed.
[17:50:25] leitz: havenwood, not sure I get what apeiros is saying. In this case, character_tools is a mixin for character, and other classes. The hope was that an object of class Character could use the methods without having to do module_function or FTLChargen::CharacterTools.social_status.
[17:56:39] leitz: apeiros, what does exist to be used as my_object.social_status? That's a needed functionality.
[17:57:22] leitz: havenwood, using full names like String.new makes it visually easy to find and grep.
[17:58:14] leitz: It's not as easy to see '' or "".
[17:59:41] leitz: apeiros, social_status gives a name to the characters status, based on the stat. That name is used to choose a career.
[18:00:33] leitz: apeiros, yes, it uses the upp.
[18:04:13] leitz: apeiros, havenwood here's the logic. When _creating_ a character, a social "class" is chosen based on a digit in the UPP. This is only used when class Character mixes in module Character_Tools for the purpose of modifying the character. For CSV or Text presentation most if not all of Character_Tools are not used; the character is already created.
[18:04:48] leitz: thanks apeiros!
[18:06:00] leitz: Character_Tools is specifically a set of methods to get mixed in to Character during creation. Character_Tools is also expected to be mixed in with other stuff but I only have so many brain cells. The real reason was to keep Character clean.
[18:06:50] leitz: havenwood, probably. I started this a few years ago when I knew even less.
[18:07:27] leitz: Must have gotten one right by accident...
[18:08:06] leitz: class Character could almost be an ostruct, but I want to learn OOP.
[18:09:06] leitz: Yup. Actually, somewhere else it's DATA_PATH with no $.
[18:10:05] leitz: Ah, I thought it recursed in.
[18:10:48] leitz: havenwood, I'll go make changes as you comment. Won't change it under you though.
[18:13:34] leitz: havenwood, haven't really understood map yet.
[18:15:42] leitz: havenwood, lines 49-58 are my "style" in that I get confused about where things stand. So I do small step by small step so I don't get lost.
[18:16:31] leitz: The default isn't really used in that hash, just me being overly verbose.
[18:18:24] leitz: Not sure when '.hex' came around, the original code was written to work under Ruby 1.8.7. :)
[18:21:17] leitz: Ah, the expansion to be written has other species. Brain hadn't figured out that part yet, but the 'humaniti' is used in the database calls.
[18:25:20] leitz: ACTION notes that map refers to enumerable.collect on page 454 of Programming Ruby. :)
[18:32:14] leitz: havenwood, enjoy brunch! I'll make some changes and notes.
[18:48:14] leitz: havenwood, after brunch, please suggest how to reference the new file structure in the tests, if I don't finish up going over your notes before hand. https://github.com/makhidkarun/ftl_chargen/blob/master/test/tc_character_tools.rb
[19:21:52] leitz: ACTION takes a break.
[19:56:59] leitz: ACTION notes he's been at this for 9 or so of the last 10 hours and will probably zonk out shortly.
[19:58:03] leitz: havenwood, I commented where things were updated. Reload character tools. I'll get back to this tomorrow.
[19:58:05] leitz: And thanks!
[20:11:39] leitz: Quit: Leaving