Skip to content
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

Adds clean component ignore list #163

Merged
merged 2 commits into from
Aug 20, 2015
Merged

Conversation

abrom
Copy link
Contributor

@abrom abrom commented Aug 20, 2015

Allows for a list of bower components to be exempt from the clean.

BowerRails.configure do |bower_rails|
  bower_rails.clean_before_precompile = true
  bower_rails.exclude_from_clean = ['moment']
end

Another option might be to implement something like as suggested in #160 but for the one package where I needed something outside of the main, this seemed suitable.

@@ -197,5 +199,10 @@ def find_command(cmd, paths = [])
def main_files_for_component(name)
Array(dsl.main_files[name])
end

def clean_should_skip_component?(name)
BowerRails.exclude_from_clean.respond_to?(:include?) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add default option as an empty array here and skip this check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking here was that potentially someone could set config.exclude_from_clean = nil and it wouldn't be handled very well. This way the default action doesn't skip, malformed config doesn't skip and it also allows for config with basic string. i.e. config.exclude_from_clean = 'moment'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this makes sence

SergeyKishenin added a commit that referenced this pull request Aug 20, 2015
Adds clean component ignore list
@SergeyKishenin SergeyKishenin merged commit 32c0045 into rharriso:master Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants