-
Notifications
You must be signed in to change notification settings - Fork 30
Use path instead of individually hard coded commands #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
- only 1 'local' method Distros.local - don't 'exist' on a release_file that doesn't exist - consistent stubbing of distro.
- move package distro case statement into distro itself - remove redhat distro constant (it is rhel or fedora) - leverage Distros.all instead of meta class fu
|
spec/etc_issue_spec.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would flip this to be expect(subject).to include("phrase")
- remove knowledge of internals from specs - lazy load file - add include? method
Checked commits kbrock@ae44751 .. kbrock@3b0f239 with rubocop Everything looks good. 👍 |
Use path instead of individually hard coded commands
Specifically commit c99c63b Previously Rpm < Package < LinuxAdmin, and LinuxAdmin is where the .run method comes from. By removing Package, Rpm broke by not having access to .run. This readds the class to fix that issue.
Specifically commit c99c63b Previously Rpm < Package < LinuxAdmin, and LinuxAdmin is where the .run method comes from. By removing Package, Rpm broke by not having access to .run. This readds the class to fix that issue.
Specifically commit c99c63b Previously Rpm < Package < LinuxAdmin, and LinuxAdmin is where the .run method comes from. By removing Package, Rpm broke by not having access to .run. This readds the class to fix that issue.
Readd Package abstract class that was removed in #96
Hey @Fryguy
I understand we used to use the system PATH, but it had too many special cases and code around such a simple lookup. Using an internal PATH (much the way system daemons like cron and ssh do) seemed like a simpler and more resilient approach.
In order to do this, I needed to do some cleanup, so this PR took on a life of its own.
@jrafanie: let me know where you want me to split up the code into multiple PRs. As always, the commits represent the different blocks of work I performed.
Oh, and @jrafanie, it would have been delta -111 lines, but I added 45 lines in new specs. Let them eat 🍰!
UPDATE:
Notes on implementation:
Distros::Distro.local
andDistors.local
, with more consistent rspec stubs.Package
case statement in favor of inheritence inDistro
Distros.redhat
in favor ofrhel
,fedora
and leveragedDistros.all
instead of meta class fuDistro
subclasses (e.g.:RedHat
,Fedora
), just useDistro
instead.Distro
constants likeCOMMANDS
and just used instance variables instead. (aside: Something odd was happening withRELEASE_FILE
)