hahuang6- has quit [Quit: ZNC 1.8.x-nightly-20190111-e415d9f5 - https://znc.in]
CBebop has left #ruby ["See you later, Space Cowboy."]
hahuang6- has joined #ruby
lytol_ has quit [Remote host closed the connection]
<phaul>
on testing root & release. it's kind of tricky because of the external dependency on etc. If you stub etc then you can control different etc behaviour for different test cases. But test stubbing and mocking is a bigger topic
<havenwood>
jason479: You can stub Etc.uname to be a Hash for the other public method.
sgen has joined #ruby
<havenwood>
jason479: If you have trouble with the gem layout or getting specs working in it, let us know and we can help.
blackmesa1 has quit [Ping timeout: 264 seconds]
<jason479>
ok thank you so much havenwood and phaul
<jason479>
shame that i can't name it 'needs' as already exists
<jason479>
i need to find a good name
<phaul>
One of the 3 most difficult problems in computer science ;)
<havenwood>
jason479: How about OpenNeeds?
cthulchu_ has joined #ruby
<havenwood>
jason479: That'd be a gem name of open_needs.
conta has quit [Ping timeout: 250 seconds]
<phaul>
the other one being off by one errors
<havenwood>
jason479: Are you going to publish it to RubyGems?
<jason479>
yep
<havenwood>
jason479: What are you using it for? Maybe that'll help with the name.
<jason479>
in fact i wish to publish multiple small gems like 'Needs' to be able use them to deploy for example a mailserver (scripting)
<jason479>
I'm a fan of OpenBSD
<havenwood>
jason479: You could might consider a single gem namespace, with plugin gems.
<jason479>
if i publish OpenBSDHelper (openbsd_helper) as a namespace, publish a gem with the 'Needs' plugin, can i later update it and add for example a new plugin named 'Rcctl' ?
<jason479>
sorry for my newbie questions, i'm totally new to Ruby
cthu| has quit [Ping timeout: 240 seconds]
<jason479>
So i will have something like : OpenBSDHelper::Needs.root ...
<havenwood>
jason479: OpenBSDHelper would be open_bsd_helper.
<havenwood>
jason479: Yes. That plugin gem would be named open_bsd_helper-needs.
<havenwood>
jason479: or Mailserver (mailserver) with Mailserver::Needs (mailserver-needs).
<jason479>
it will be 2 gems ? open_bsd_helper and open_bsd_helper-needs ?
<havenwood>
jason479: I do like OpenBSDHelper. That's descriptive.
<jason479>
it will be 2 gems ?
<havenwood>
jason479: Yes. It's a pretty common pattern. Sometimes the root gem installs the plugins. Sometimes you cherrypick plugins.
<havenwood>
jason479: For example, pry-theme and pry-remote are pry gem plugins.
<havenwood>
jason479: It can be multiple gems, or you can ship it as one.
<jason479>
if i choose the plugins way
<havenwood>
jason479: Consider if they should always be used together. Is there an advantage in making it modular?
<jason479>
what's about the alone OpenBSDHelper ? what it is exactly without plugins ?
<havenwood>
jason479: Well, if there's a common core, it'd go there.
<havenwood>
jason479: If not, it'd be an empty module.
Dbugger has joined #ruby
<jason479>
havenwood: you re right, when scripting , i ll need all the modules
<havenwood>
jason479: Maybe try making a single gem, with namespaced modules.
<havenwood>
jason479: An open_bsd_helper gem can have OpenBSDHelper::Needs, etc.
<havenwood>
jason479: Mirror the filestructure after the namespace.
<jason479>
but if i publish the gem OpenBSDHelper with for example only one module embedded like Needs, if i need to add a new module to the already published gem, how can i update that ?
<havenwood>
jason479: OpenBSDHelper is lib/open_bsd_helper.rb and OpenBSDHelper::Needs is lib/open_bsd_helper/needs.rb.
<jason479>
i understand this point
<jason479>
but if later i need to add a new module
<jason479>
for example a module named 'Rcctl'
<havenwood>
just add it and publish a new version of the gem
<jason479>
can i update a gem ?
<havenwood>
yes
<jason479>
ok !
<jason479>
Now i want to use this gem, writing a script, i will need each time type : OpenBSDHelper::ModuleName.method ...
<jason479>
can i remove the root name (OpenBSDHelper) ?
<jason479>
to get a better readable script
<havenwood>
jason479: Yes, You can make it so you can: include OpenBSDHelper
<havenwood>
jason479: Then: Needs.method
<havenwood>
jason479: It *just works* like that ^
AJA4350 has quit [Ping timeout: 246 seconds]
reber has joined #ruby
maryo has quit [Read error: Connection reset by peer]
maryo has joined #ruby
namkeen has quit [Quit: Leaving]
Tharbakim has joined #ruby
<jason479>
thank you so much havenwood
jason479 has quit [Quit: Page closed]
blackmesa1 has joined #ruby
ravenousmoose is now known as ravenousmoose[aw
ravenousmoose[aw has quit [Quit: Taking a quick nap...ZZzzz]
reber has quit [Remote host closed the connection]
jason479 has joined #ruby
<jason479>
havenwood: still there ?
<jason479>
so the module will live in lib/open_bsd_helper
<jason479>
but regarding the main file lib/open_bsd_helper.rb it will be also a module, yes ?
nfk has joined #ruby
paulscoder has joined #ruby
ravenousmoose has joined #ruby
renich has quit [Ping timeout: 268 seconds]
<phaul>
jason479: you can create a directory structure that follows module nesting. lib/open_bsd_helper/needs.rb in this case. Whether you have a lib/open_bsd_helper.rb or not can depend on if there is any code going in there. Just for empty modules you don't have to create the source file
jason479 has quit [Ping timeout: 256 seconds]
<phaul>
ah. they just left
<KindOna>
never lucky
<phaul>
never :)
jottr has quit [Quit: WeeChat 2.3]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
deathwishdave has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has joined #ruby
sgen has quit [Ping timeout: 268 seconds]
[Butch] has joined #ruby
liya has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
[Butch] has quit [Client Quit]
dionysus70 has quit [Ping timeout: 250 seconds]
sgen has joined #ruby
paulscoder has quit [Quit: paulscoder]
xlegoman_ has joined #ruby
xlegoman has quit [Read error: Connection reset by peer]
xlegoman_ is now known as xlegoman
cnsvc has quit [Remote host closed the connection]
crankharder has joined #ruby
cnsvc has joined #ruby
segy has quit [Ping timeout: 245 seconds]
crankharder has quit [Ping timeout: 240 seconds]
segy has joined #ruby
Emmanuel_Chanel has joined #ruby
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
dviola has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deathwishdave has joined #ruby
deathwishdave has quit [Client Quit]
AJA4350 has quit [Ping timeout: 245 seconds]
Swyper has joined #ruby
bairyn has quit [Ping timeout: 245 seconds]
paulscoder has joined #ruby
Swyper has quit [Ping timeout: 250 seconds]
ByronJohnson has joined #ruby
renich has joined #ruby
dellavg__ has quit [Ping timeout: 250 seconds]
renich has quit [Remote host closed the connection]
i8igmac has joined #ruby
<i8igmac>
any tips for reading files on mtp device
AJA4350 has joined #ruby
crankharder has joined #ruby
tdy has joined #ruby
nowhereman has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
cnsvc has quit [Remote host closed the connection]
ByronJohnson has quit [Ping timeout: 250 seconds]
Fernando-Basso has quit [Remote host closed the connection]
ByronJohnson has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
Tharbakim has quit [Ping timeout: 246 seconds]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
leah2 has quit [Ping timeout: 264 seconds]
mistergibson has joined #ruby
orbyt_ has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
leah2 has joined #ruby
mistergibson has quit [Quit: Leaving]
crankharder has joined #ruby
Nicmavr has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
bmurt has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
i8igmac has quit [Remote host closed the connection]
cnsvc has joined #ruby
<phaul>
Net: I read the code on RSpec lets. The anwer to whether lets are re-defined if defined in sub-contexts is yes. But technically that's not how they work.
nchambers has joined #ruby
<phaul>
They achieve lazy and one time evaluation of let. Only lets that are needed for each example are run and only once. They are reset per examples.
Tharbakim has joined #ruby
paulscoder has quit [Quit: paulscoder]
postmodern has joined #ruby
<phaul>
they are methods, and the block is used in define_method. Sub-contexting also means inheritance so sub-describe let would shadow parents method. I beleive calling super should work to get the outer let value.