سؤال

I’d like to use csscss tool to detect duplicated CSS in Rails environment. My end goal is to run it whenever a commit is added (and detecting duplicates is only a first step), but assume the simpler case: making csscss go with guard.

I have not found any plugins to handle that nor I have experience to create one.

Did anyone find similar problem?

هل كانت مفيدة؟

المحلول

You could use Guard-Shell to execute csscss on every stylesheet modification:

guard :shell do
  watch /app/assets/stylesheets/(.*)/ do |m|
    `csscss #{ m[0] }`
  end
end

نصائح أخرى

What do you think about Gruntjs?

There is a good wrapper for cscscs in the gruntjs:
https://npmjs.org/package/grunt-csscss

I think, watch task + csscss task is the good decision.

link to the watch task:
https://npmjs.org/package/grunt-contrib-watch

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top