Sha256: d46f9b4b9f7441a13bc52194194bd072fb274e4f7023db77003bf11e5ce96b52
Contents?: true
Size: 591 Bytes
Versions: 1
Compression:
Stored size: 591 Bytes
Contents
require "color/cop/version" module Color module Cop # Your code goes here... class CLI def execute! puts "SCSS files within current path that have hex codes:" files_names = Dir.glob("**/*") # for all files files_names.select do |file_name| if file_name =~ /^.*\.scss$/ File.read(file_name) =~ /#\w{3,6}/ || File.read(file_name) =~ rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\) else false end end.each do |files_name| puts "- #{files_name}" end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
color-cop-0.0.4 | lib/color/cop.rb |