This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
(maint) Pay down tech debt #349
Merged
glennsarti
merged 10 commits into
puppetlabs-toy-chest:master
from
jpogran:maint-pay-down-tech-debt
Apr 25, 2018
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ef94d6c
(maint) Extract type cleaning
jpogran 70d3fed
(maint) Extract type document builder
jpogran b04791c
(maint) Extracts type building
jpogran 27efe52
(maint) Extract type import
jpogran 90962f8
(maint) Cleanup rake task descriptions
jpogran 4b282c9
(maint) Remove dsc:module:skeleton task
jpogran a5e3579
(maint) Remove unused code from Manager
jpogran 7f0876e
(maint) Standardize folder paths in build tasks
jpogran 7693dfd
(maint) Remove unused variables from dsc.rake
jpogran ffc7ed9
(maint) Rename global variables
jpogran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module Dsc | ||
class TypeCleaner | ||
attr_accessor :target_module_path | ||
attr_accessor :puppet_type_subpath | ||
attr_accessor :puppet_type_spec_subpath | ||
attr_accessor :module_path | ||
|
||
def initialize(target_module_path, puppet_type_subpath, puppet_type_spec_subpath) | ||
@target_module_path = target_module_path | ||
@puppet_type_subpath = puppet_type_subpath | ||
@puppet_type_spec_subpath = puppet_type_spec_subpath | ||
end | ||
|
||
def clean_dsc_types | ||
puppet_type_path = "#{@target_module_path}/#{@puppet_type_subpath}" | ||
clean_folder(["#{puppet_type_path}/dsc_*.rb"]) | ||
end | ||
|
||
def clean_dsc_type_specs | ||
puppet_type_spec_path = "#{@target_module_path}/#{@puppet_type_spec_subpath}" | ||
clean_folder(["#{puppet_type_spec_path}/dsc_*_spec.rb"]) | ||
end | ||
|
||
def clean_folder(folders) | ||
type_pathes = [] | ||
folders.each do |folder| | ||
Dir.glob("#{folder}").each do |filepath| | ||
pn = Pathname.new(filepath).expand_path.relative_path_from(@target_module_path) | ||
type_pathes << "Remove - #{pn.to_s}" | ||
FileUtils.rm_rf filepath | ||
end | ||
end | ||
type_pathes | ||
end | ||
|
||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: typo. Won't stop a merge though