<havenwood>
geckos: Is there a?: /home/dhilst/bin/rails
<geckos>
There it is!
<geckos>
THANKS!
<havenwood>
geckos: np!
<geckos>
Would this be a Fedora trap?
<havenwood>
geckos: If you feel like having it be the expected dir, you could: export GEM_HOME="$HOME/.gem/ruby"
<havenwood>
geckos: On my install, the EXECUTABLE DIRECTORY is: /usr/bin
<havenwood>
geckos: Oh, I'm root at the moment.
<havenwood>
So yeah. :-P
<geckos>
Are you on Fedora too?
<geckos>
zsh?
<havenwood>
geckos: I hopped onto Fedora to sanity check. I usually do use zsh.
SeepingN has joined #ruby
<havenwood>
geckos: But yeah, no issue here with dnf Ruby with Fedora and zsh.
<havenwood>
geckos: which rails #=> /usr/local/bin/rails
<havenwood>
geckos: I have in my gem env: "gem" => "--install-dir=/usr/local/share/gems --bindir /usr/local/bin"
<havenwood>
geckos: Dunno why our Fedoras are configured differently.
<havenwood>
geckos: If you wanted to, you could: echo '"gem" => "--install-dir=/usr/local/share/gems --bindir /usr/local/bin"' >> "$HOME/.gemrc"
<geckos>
I my messed everything up. I didn't even remeber when I installed this ruby
<havenwood>
geckos: Though my setup assumed root user >.>
<havenwood>
geckos: I don't usually use Fedora, but I do like it!
<geckos>
Cam you: rpm -qf `which ruby` ?
<havenwood>
geckos: rubypick-1.1.1-9.fc29.noarch
<geckos>
Same here, thanks!
<havenwood>
de nada
<geckos>
I usually use Linux
<geckos>
eita, br detectado
<geckos>
:D
moei has quit [Ping timeout: 252 seconds]
thy0 has quit [Quit: TTFN]
geckos has quit [Quit: Page closed]
orbyt_ has joined #ruby
dviola has joined #ruby
Nilium has quit [Ping timeout: 244 seconds]
braincrash has quit [Quit: bye bye]
zhustec has joined #ruby
dviola is now known as Guest46189
Guest46189 has quit [Ping timeout: 252 seconds]
braincrash has joined #ruby
dviola has joined #ruby
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 246 seconds]
Xeago_ is now known as Xeago
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
elphe has joined #ruby
dviola has quit [Ping timeout: 252 seconds]
eckhardt has joined #ruby
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
duderonomy has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
ciro has joined #ruby
jdawgaz has joined #ruby
cliluw has joined #ruby
tdy has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
Azure has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
bkxd has left #ruby [#ruby]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moei has joined #ruby
im0nde has quit [Ping timeout: 252 seconds]
ivanskie has joined #ruby
im0nde has joined #ruby
lytol_ has quit [Remote host closed the connection]
weaksauce has quit [Ping timeout: 246 seconds]
tdy has joined #ruby
reber has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fredlinhares has joined #ruby
fredlinhares has quit [Quit: WeeChat 1.4]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 245 seconds]
reber has quit [Remote host closed the connection]
Nilium_ has joined #ruby
Nilium_ is now known as Nilium
Nilium has quit [Read error: Connection reset by peer]
Nilium has joined #ruby
Dbugger has joined #ruby
sauvin has joined #ruby
RougeR has quit [Ping timeout: 252 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MoritaShinobu has joined #ruby
akem has quit [Remote host closed the connection]
lomex has joined #ruby
darkhanb has joined #ruby
s2013 has joined #ruby
dellavg_ has joined #ruby
ShekharReddy has joined #ruby
duderonomy has joined #ruby
_whitelogger has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
MoritaShinobu has quit [Quit: Leaving]
zhustec has quit [Remote host closed the connection]
clemens3_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xfbs has joined #ruby
zhustec has joined #ruby
yohji has joined #ruby
xfbs has quit [Quit: byebye]
xfbs has joined #ruby
clemens3_ has quit [Remote host closed the connection]
doubledup has joined #ruby
doubledup has quit [Max SendQ exceeded]
Mike11 has joined #ruby
doubledup has joined #ruby
zhustec has quit [Read error: Connection reset by peer]
MoritaShinobu has joined #ruby
sameerynho has joined #ruby
sticaz has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
lomex has quit [Client Quit]
lomex has joined #ruby
lomex has quit [Client Quit]
Puffball has quit [Remote host closed the connection]
desperek has joined #ruby
rippa has joined #ruby
dionysus70 has joined #ruby
justinweiss has quit [Ping timeout: 272 seconds]
ShekharReddy has quit [Quit: Connection closed for inactivity]
furrymcgee has left #ruby [#ruby]
elphe has joined #ruby
Yxhuvud has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 272 seconds]
sticaz has quit [Quit: sticaz]
conta has joined #ruby
Mike11 has quit [Quit: Leaving.]
apg has joined #ruby
<apg>
Hi, how do you prevent a map from returning an item that is taken from a range on Ruby?
yohji has quit [Remote host closed the connection]
<apg>
for example a = 1.upto(Float::INFINITY).lazy.map{|x| x}.first(24), I do not want to add x % != 0
lomex has joined #ruby
mitescugd has left #ruby ["C-x k"]
cd has quit [Quit: cd]
Mike11 has joined #ruby
bhaak has quit [Ping timeout: 252 seconds]
tristanp has joined #ruby
Puffball has joined #ruby
n13z has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
bhaak has joined #ruby
<apeiros>
apg: I don't understand your question. part of that is `x % != 0` seems to be missing something
<apeiros>
I'd assume the answer is to add a select before or after the map
dionysus70 has quit [Ping timeout: 272 seconds]
AJA4350 has joined #ruby
leitz has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RougeR has joined #ruby
elphe has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
elphe has quit [Ping timeout: 252 seconds]
<apg>
Sorry, I was mistyped
<apg>
I mistyped
<leitz>
apg, I missed it, so we're good. :)
<apg>
apeiros, thanks. I ended up using select
apg has quit [Quit: Leaving]
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 252 seconds]
Xeago_ is now known as Xeago
<leitz>
What makes you decide "class" versus "OpenStruct"?
_whitelogger has joined #ruby
amelliaa has joined #ruby
postmodern has quit [Quit: Leaving]
thy0 has joined #ruby
conta has quit [Quit: conta]
elphe has joined #ruby
yohji has joined #ruby
<apeiros>
leitz: simple for me - openstruct only at drafting stage.
jdawgaz has joined #ruby
<leitz>
apeiros, for me that may be an eternity. I've been trying to learn to code for a while. ;)
<leitz>
In this case, I'm thinking of your comment about the character_tools mixin, and how the purpose for it seemed confusing.
<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.
<leitz>
Since my view of "Character" is fairly organic, OStruct might be better.
jdawgaz has quit [Ping timeout: 272 seconds]
roshanavand has joined #ruby
<apeiros>
leitz: can you enumerate the properties a character has?
kapil___ has joined #ruby
<leitz>
apeiros, "enumerate" as in "explain" or as in "is enumerable"?
<apeiros>
the latter
<apeiros>
as in "is it a finite number of properties?"
<leitz>
Ah, then depending on use case, no.
Azure has quit [Ping timeout: 272 seconds]
<leitz>
It is a limited number of properties, but different use cases add properties while usually using the core set or properties.
sameerynho has quit [Ping timeout: 246 seconds]
brianj has joined #ruby
<brianj>
Is this the right channel to ask for help on factoryBot and associations ? There is no #factorybot channel.. :-/
<apeiros>
brianj: sure. chances might be better over in #rubyonrails, though, since I'd assume factorybot is most often used in conjunction with rails
<brianj>
apeiros: ill try there, thanks
<apeiros>
leitz: "needs to be able to add properties defined by the end user", ok, that qualifies as infinite
<apeiros>
personally I'd still not use ostruct, but ostruct would work
<leitz>
The issue I have is the ability to add properties that are undefined.
<leitz>
I pulled "Character_Tools" out of "Character" because the tools are only used on creation, not on presentation.
<leitz>
Having them combined made for a huge class definition.
<leitz>
How would you set the Character class up to add properties not in the original class?
<apeiros>
you'd want to avoid collisions, so I'd go via a proxy. i.e. some_character.first_name (as an example for any predefined property), and some_character.custom.userdefined_proprty_here
<apeiros>
and for custom, you could use openstruct. (class Character; def initialize; @custom = OpenStruct.new; …)
<leitz>
At the moment there are two sets of properties: "Base + Usual" and "Leitz's Expanded which includes Base + Usual".
<leitz>
Ah, so the base Character has a "@custom" property?
<apeiros>
yes
lomex has joined #ruby
<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.
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brianj has quit [Remote host closed the connection]
ZzZombo_ has joined #ruby
beefjoe has joined #ruby
ZzZombo has quit [Ping timeout: 250 seconds]
ZzZombo_ is now known as ZzZombo
yohji has quit [Remote host closed the connection]
thy0 has quit [Ping timeout: 246 seconds]
amelliaa has quit [Quit: -]
elphe has quit [Ping timeout: 252 seconds]
ShekharReddy has joined #ruby
beefjoe has quit [Remote host closed the connection]
<apeiros>
leitz: sorry, missed your last question. not sure what you understand as "generation methods". but sounds like something which might be class methods.
RougeR has quit [Ping timeout: 245 seconds]
jgpawletko has joined #ruby
<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?
<apeiros>
if I understand you correctly, then yes, those should be class methods of the base class.
thy0 has joined #ruby
<leitz>
Okay, i'm working on understanding it. Slowly...
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
ZzZombo has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<apeiros>
generate belongs into class level (and parts of the code probably into a separate class even)
<apeiros>
iirc, upp is a specific set of attributes, I wouldn't use a hash for that. at the very least a struct. and I wouldn't allow manipulation of it by replacing the full hash either (the upp= method)
<apeiros>
ah, and stylistic thing: requires belong to the top of the file. even before opening the class.
<leitz>
The "separate class" for generate was most of what "Character_Tools" did, I thought you recommended it be in the class?
<apeiros>
the only reason I could imagine to recommend keeping it in the same class would be as a temporary thing to grow your code.
<apeiros>
as far as I understand your problem domain, generation of characters will become rather complex. keeping that in the same class will put too many responsibilities in the same place.
<leitz>
If the generation is pulled out then there are no real methods in the Character class. So back to an Ostruct.
Azure has joined #ruby
<leitz>
There's a Presenter for different output styles, and I'm building stuff to input from CSV and JSON.
<apeiros>
I'm pretty sure there's plenty of things one can do with a character which belong into that class. I doubt it'd just be a data container.
elphe has joined #ruby
<apeiros>
also providing methods which connect it with generators and presenters can be worthwhile. it means you have a clear and understandable hub.
<apeiros>
i.e. while you'd have something like Character::Generator, Character::JsonPresenter etc., you'd still use them via Character::generate and Character#to_json
elphe has quit [Ping timeout: 246 seconds]
johnny56 has quit [Ping timeout: 272 seconds]
lomex has joined #ruby
elphe has joined #ruby
johnny56 has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
cagomez has quit [Ping timeout: 264 seconds]
elphe has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elphe has quit [Ping timeout: 264 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
desperek has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
cagomez has joined #ruby
DTZUZU has quit [Quit: WeeChat 1.9]
beefjoe has joined #ruby
MoritaShinobu has quit [Ping timeout: 246 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
FernandoBasso has quit [Remote host closed the connection]
yohji has quit [Remote host closed the connection]
segy has joined #ruby
beefjoe has quit [Remote host closed the connection]
Yxhuvud has joined #ruby
elphe has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
elphe has quit [Ping timeout: 272 seconds]
sticaz has joined #ruby
orbyt_ has joined #ruby
tristanp has joined #ruby
tristanp has quit [Ping timeout: 250 seconds]
Puffball has quit [Remote host closed the connection]
elphe has joined #ruby
dviola has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
elphe has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
dellavg_ has quit [Ping timeout: 272 seconds]
lomex has joined #ruby
tdy has joined #ruby
elphe_ has joined #ruby
elphe_ has quit [Ping timeout: 240 seconds]
tristanp has joined #ruby
darkhanb has quit [Ping timeout: 252 seconds]
elphe has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
FernandoBasso has joined #ruby
jokester has quit [Ping timeout: 276 seconds]
Mike11 has quit [Quit: Leaving.]
reber has joined #ruby
elphe has joined #ruby
cschneid_ has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
jokester has joined #ruby
elphe has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
Eiam has quit [Ping timeout: 272 seconds]
elphe has quit [Ping timeout: 252 seconds]
FernandoBasso has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graphene has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
cd has joined #ruby
troulouliou_dev has joined #ruby
elphe has joined #ruby
yohji has joined #ruby
Puffball has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
Azure has quit [Ping timeout: 252 seconds]
elphe has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 244 seconds]
elphe has joined #ruby
tolland has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
elphe has quit [Ping timeout: 246 seconds]
Puffball has quit [Read error: Connection reset by peer]
xfbs has quit [Read error: Connection reset by peer]
xfbs has joined #ruby
Puffball has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 272 seconds]
troulouliou_dev has joined #ruby
MoritaShinobu has quit [Ping timeout: 244 seconds]
s2013 has joined #ruby
xfbs has quit [Quit: afk]
elphe has joined #ruby
xfbs has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elphe has quit [Ping timeout: 272 seconds]
jasmith has quit [Quit: Leaving]
sameerynho has joined #ruby
lomex has joined #ruby
<leitz>
apeiros, do you know of some code that is structured like that? I'd love to take a look and learn.
conta has joined #ruby
doubledup has quit [Quit: Leaving]
thy0 has quit [Ping timeout: 246 seconds]
yohji has quit [Remote host closed the connection]
yohji has joined #ruby
elphe has joined #ruby
orbyt_ has joined #ruby
marz_d`ghostman has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
<apeiros>
eh, no. but I seem to remember that baweaver once wrote a reference implementation for what you wanted to do. he might have used that pattern.
<apeiros>
(not really a pattern)
agent_white has quit [Quit: brb]
thy0 has joined #ruby
<marz_d`ghostman>
I have a gem mygem-my_util, so in my lib is ./lib/mygem/my_util/util/util.rb How do I describe it in RSpec? I tried Mygem/::Myutil::util::util
Dbugger has quit [Ping timeout: 240 seconds]
<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." ;)
desperek has quit [Quit: xoxo]
kapil___ has quit [Quit: Connection closed for inactivity]
<havenwood>
marz_d`ghostman: Kinda odd to have a `.../util/util.rb`. Usually you'd see `/lib/mygem/my_util/util.rb` maybe with `/lib/mygem/my_util/util/something_else.rb`.
graphene has quit [Read error: Connection reset by peer]
<havenwood>
marz_d`ghostman: But if there were double utils, like you showed, it'd be: Mygem::MyUtil::Util::Util
<havenwood>
marz_d`ghostman: The namespace should mirror the file and directory hierarchy.
<marz_d`ghostman>
havenwood: the util.rb is the main class and the util folder will contain the main class along with any modules and classes that needs to be created
graphene has joined #ruby
<marz_d`ghostman>
havenwood: Do I have to define a require somewhere? cause it's not working though
<havenwood>
marz_d`ghostman: It's expected that there'l be a /lib/mygem/my_util/my_util.rb file.
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<marz_d`ghostman>
It's giving me the error: uninitialized constant Rise::MirrorManager::Sync
<marz_d`ghostman>
Tried adding require 'rise/mirror_manager', didn't help though
<havenwood>
marz_d`ghostman: your dir structure looks good for: /lib/rise/mirror_manager/
<havenwood>
marz_d`ghostman: And it properly then has a:L /lib/rise/mirror_manager.rb
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
marz_d`ghostman: Why is sync.rb in a sync/ dir?
<havenwood>
marz_d`ghostman: I'd expect that not to be nested.
s2013 has joined #ruby
<havenwood>
marz_d`ghostman: /lib/rise/mirror_manager/sync.rb should correspond with Rise::MirrorManager::Sync
<marz_d`ghostman>
havenwood: I'm assuming I'll be creating another class for sync purposes or a module perhaps. To organize it, I'll just have all sync related files inside the sync/ dir
<havenwood>
marz_d`ghostman: Just like you have /rise/mirror_manager.rb and /rise/mirror_manager/, you'd have /rise/mirror_manager/sync.rb and /rise/mirror_manager/sync/*
<havenwood>
marz_d`ghostman: But sync.rb doesn't belong in the sync/ dir, like mirror_manager.rb doesn't belong in the mirror_manager/ dir
<havenwood>
marz_d`ghostman: sync.rb and sync/ should both be in /mirror_manager
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
if you had a sync/brink.rb, it'd be Rise::MirrorManager::Sync::Brink - for example
yohji has quit [Remote host closed the connection]
thy0 has quit [Ping timeout: 272 seconds]
marz_d`ghostman has quit [Ping timeout: 252 seconds]
marz_d`ghostman_ has joined #ruby
<marz_d`ghostman_>
havenwood: I see, so sync.rb should be under mirror_manager
<marz_d`ghostman_>
havenwood: moved it, still having the erorr though
<marz_d`ghostman_>
I have a require 'rise/mirror_manager' at the top of spec_helper.rb as well
elphe has quit [Ping timeout: 272 seconds]
thy0 has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
<havenwood>
marz_d`ghostman_: Does sync_spec.rb require the spec_helper.rb?
<havenwood>
marz_d`ghostman_: If the repo is public, it'd be way easier to look at the real code. If not, we could probably tell what the issue is with the requires from the relevant files.
conta has quit [Quit: conta]
<marz_d`ghostman_>
havenwood: It does not
<havenwood>
marz_d`ghostman_: The specs will probably each need to require the helper.
<marz_d`ghostman_>
havenwood: How do I do that?
<havenwood>
marz_d`ghostman_: With your current directory layout: require_relative '../../spec_helper'
<marz_d`ghostman_>
havenwood: Haven't seen anything like that before though
<havenwood>
marz_d`ghostman_: If you'd like to use the .rspec file to automagically require rather than require_relative, you can totally do that. It's less explicit.
<leitz>
I haven't figured out how to use the careers in the module refactor.
<marz_d`ghostman_>
havenwood: I tried adding a .rspec file still not working though
<marz_d`ghostman_>
havenwood: Okay, I'll give it a try thanks
<havenwood>
marz_d`ghostman_: np
<havenwood>
leitz: So you want to programatically iterate through eh classes that inherit from Career?
<havenwood>
the*
* leitz
thinks if havenwood's help was paid for in libations the poor guy would be drunk for years...
* havenwood
hiccups
<leitz>
havenwood, just one class. The program is called with "bin/chargen -c Navy"
<havenwood>
leitz: ahh
nfk has joined #ruby
s2013 has joined #ruby
<havenwood>
leitz: What goes wrong when you run ^ that?
<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.
reber has quit [Remote host closed the connection]
<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.
<apeiros>
Dir.glob('../lib/ftl_chargen/careers') should be Dir.glob('ftl_chargen/careers', dir: "../lib")
<apeiros>
curious you don't get an exception there
<apeiros>
and yes, you do const_get on the module which contains the constant you want
<apeiros>
which is almost never Module btw., toplevel is Object.
<apeiros>
btw., don't call srand
LiftLeft has joined #ruby
<leitz>
apeiros, this "Dir.glob('ftl_chargen/careers', dir: "../lib") {|file| require file }" gives "in `glob': unknown keyword: dir (ArgumentError)"
s2013 has joined #ruby
<leitz>
Why not use srand?
<leitz>
apeiros, on the "const_get", it used to work before moving everything to the module.
<apeiros>
leitz: don't call srand because ruby does that on its own already
<apeiros>
sorry, base:, not dir: in glob
<apeiros>
and const_get worked coincidentally, not because it was correct :-p
<leitz>
apeiros, okay, base works. And I'm a pragmatic guy; "works" is "correct". :)
<apeiros>
but I see now that you construct the full constant name. Object.const_get("Full::Constant::Path") will work, if it doesn't, it means you either haven't loaded the code which defines the constant yet, or you constructed the name wrong.
<apeiros>
incorrect pragmatism a) will bite you, b) means that you'll not be able to grow, since growing requires a working foundation
<apeiros>
(not be able is too harsh - but it'll certainly limit)
<leitz>
Harsh is okay, given the amount of help you're providing. :)
cschneid_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
and which file defines FTLChargen::Careers?
<apeiros>
also an important note: having your requires relative to the working directory is a *terrible* idea.
<apeiros>
at the very least make it relative to the currently executed file.
<leitz>
At the moment I'm focused on the one issue. Even requiring the files doesn't resolve it.
Pisuke has quit [Ping timeout: 246 seconds]
<apeiros>
00:10 apeiros: and which file defines FTLChargen::Careers?
Sembei has joined #ruby
<leitz>
None.
<leitz>
Interesting, may have it. Not sure why.
<apeiros>
weeeeell, if no file defines that constant, obviously you'll get NameError: uninitialized constant
<apeiros>
from the name, which file *should* define it?
<leitz>
Yup. so the solution is to remove "Careers" since it was never created as a module/namespace.
<apeiros>
nooooo
<apeiros>
well, ok, *maybe*.
<hays>
I am trying to simply scope a function to a module. what is the way to do this so that its seen within classes of that module
kapil___ has joined #ruby
<apeiros>
it may not be the right solution, though
<apeiros>
hays: when you say "scope", what do you understand by that?
<hays>
i tried self.fun and that doesn't seem to be in scope
<hays>
i can call the function without any references to the module
<leitz>
apeiros, it's the level I can understand at the moment.
<leitz>
hays, you're in good hands!
<apeiros>
leitz: you should still try to answer the question which file should define FTLChargen::Careers, because understanding that is quite crucial.
<apeiros>
because the mapping between module/class constants and files *should* be 1:1
* baweaver
wanders in
<apeiros>
hays: ruby doesn't do that at all.
<apeiros>
hays: what you can do is define the myfoo method in a module and use `include ThatModule` in your class DEF, and then you can use myfoo in DEF.
<apeiros>
but nesting namespaces are never considered for method lookup.
<apeiros>
only inheritance.
elphe has joined #ruby
<leitz>
Hey baweaver, your name was used in vain earlier.
<leitz>
I think havenwood wandered off drunk.
sameerynho has quit [Ping timeout: 272 seconds]
<leitz>
apeiros, i think the mapping is 1:1, but the Careers namespace is not defined.
<leitz>
That is, each career establishes one Constant.
elphe has quit [Ping timeout: 240 seconds]
<apeiros>
leitz: so then answer the question :) which file *should* define FTLChargen::Careers
<hays>
hmm.. ok. i think i can live with that
<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.
* leitz
smiles since his tests also pass.
Emmanuel_Chanel has quit [Quit: Leaving]
<apeiros>
leitz: no. it does not go back to the dynamic nature. there is one clear file which should define FTLChargen::Careers. you can infer it directly from the constant name.
graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
ellcs has joined #ruby
<apeiros>
leitz: with your naming style, the rule is simple: downcase and replace :: with /. so FTLChargen::Careers is ftlchargen/careers, so lib/ftlchargen/careers.rb
<apeiros>
leitz: from that also follows that if you have lib/ftlchargen/careers/somejob.rb, then that should define FTLChargen::Careers::Somejob
<apeiros>
sidenote though: FtlChargen::Careers --> ftl_chargen/careers.rb is nowadays the preferred style (stems from rails). simply because it allows the mapping to be bijective.
<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.
<leitz>
hmm...should not call ftl_tools. Gimme a sex.
<apeiros>
absolutely not :-p
<leitz>
sec...ARGGGHHH!!!!
<apeiros>
sorry leitz, I just don't find you that attractive ;-)
<leitz>
Me neither.
<leitz>
Of course, if havenwood is drunk enough...
<apeiros>
shh, we don't talk about that incident.
<leitz>
Which one?
<apeiros>
exactly.
<leitz>
Okay, travis passes now. I would still like to get rid of the circular require because it's bad form.
<leitz>
In theory (a big word), character_tools should not require anything. It should just be mixed in to Character.
<leitz>
In practice...
<apeiros>
na, somebody at travis needs a serious talking to.
<apeiros>
that warning is bull.
<leitz>
It comes up in rake, too.
<leitz>
Sorry, my rake file just runs tests.
<apeiros>
I guess I have to run my code with -w again, might come from there, not travis itself. it's still bull.
<leitz>
I'm still chuckling at it being confused about assigned but unused variables. The assignment is the use.
thy0 has quit [Ping timeout: 246 seconds]
cschneid_ has joined #ruby
<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?
alem0lars has quit [Ping timeout: 272 seconds]
Emmanuel_Chanel has joined #ruby
<apeiros>
in my old style, I'd require everything I need in every file. for the slight special case of careers/*.rb being dynamic, I'd do a glob require in careers.rb, yes.
elphe has joined #ruby
<leitz>
So take the Dir.glob and put it there, and then just require ftl_chargen/careers?
agent_white has joined #ruby
<apeiros>
yopp
* leitz
goes to break more stuff.
* apeiros
goes to rewrite Pawn#checkMove (in JS)
<baweaver>
was about to say, apeiros
graphene has quit [Remote host closed the connection]
<baweaver>
you're going down a dark path
<baweaver>
:P
<apeiros>
wat, y?
<apeiros>
pawn movement is actually unexpectedly complex. until I started this coding exercise with my wife, I never knew about "en passant" move of the pawn.
graphene has joined #ruby
<baweaver>
checkMove
<baweaver>
camels O_O
* leitz
really needs to fix these circular requires.
<apeiros>
aaah, heh, yes. javaScript. much camel.
<apeiros>
quite honestly, this trips me up quite a bit. ruby_variables, javaScript and css-classes
cschneid_ has quit [Ping timeout: 272 seconds]
<apeiros>
oh, and of course #css_ids, just because…