color-cop 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cb92add80ffe479823bb80b63f7deec2f6499c9
4
- data.tar.gz: 08f765cf713a662a0278a86b078adbe06c50ea21
3
+ metadata.gz: 9d0fc94ad142417e8a22954257ad2304d588c986
4
+ data.tar.gz: 88e7dda83e7dde05e7f5ed77b7ff5b4703dd218e
5
5
  SHA512:
6
- metadata.gz: fba47aaffe16425432f3a4b7a604157fd7a717b2bf0a1791e3ecdeac13de604ef1dce6ceb05b7386d765a6219c3a46f84ad84ce1be18cf08b84386d4987cbcf8
7
- data.tar.gz: ee05ead82b8d1397b2e77ab1bb775409a349d59e8bc4fb91455a9de92e6fa6fc5e44f13ea66b17d6e83f2eae1ebed5420dd74ae5aec5a8ee1bda0a9b5c19a329
6
+ metadata.gz: 653e50dda49b970e4913a77392b224c23edab75084ef956d69447504288cfae35f15976720647a92ff57ee92e37ab506fdf74e26027d0c7e8a54fb6f05b2e223
7
+ data.tar.gz: 4cba58472718604cf104daf00d763369a11d9acf9a9ee97695fd30b70b8e8cc034cf473487a124fd90cc90cac9a231f865ed9bace67ed429e28aaab78cebd330
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require 'color/cop.rb'
4
+ Color::Cop::CLI.new.execute!
@@ -18,6 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
+ spec.add_development_dependency 'pry'
21
22
  spec.add_development_dependency 'bundler', '~> 1.6'
22
23
  spec.add_development_dependency 'rake'
24
+ spec.add_development_dependency 'rspec', '~> 3.2'
25
+ spec.add_development_dependency 'cucumber'
26
+ spec.add_development_dependency 'aruba'
23
27
  end
@@ -0,0 +1,19 @@
1
+ Feature: Detecting hex codes
2
+ When a file contains hex codes
3
+
4
+ Scenario:
5
+ Given a file named "main.scss" with:
6
+ """
7
+ body: {
8
+ background-color: #ffffff;
9
+ }
10
+ """
11
+ And a file named "more-colors.scss" with:
12
+ """
13
+ .container: {
14
+ color: #000000;
15
+ }
16
+ """
17
+ When I run `color-cop`
18
+ Then the output should contain "main.scss"
19
+ And the output should contain "more-colors.scss"
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
@@ -1,8 +1,24 @@
1
1
  require "color/cop/version"
2
+ require 'pry'
2
3
 
3
4
  module Color
4
5
  module Cop
5
-
6
6
  # Your code goes here...
7
+ class CLI
8
+ def execute!
9
+ puts "SCSS files within current path that have hex codes:"
10
+ files_names = Dir.glob("**/*") # for all files
11
+
12
+ files_names.select do |file_name|
13
+ if file_name =~ /^.*\.scss$/
14
+ File.read(file_name) =~ /#\w{3,6}/
15
+ else
16
+ false
17
+ end
18
+ end.each do |files_name|
19
+ puts "- #{files_name}"
20
+ end
21
+ end
22
+ end
7
23
  end
8
24
  end
@@ -1,5 +1,5 @@
1
1
  module Color
2
2
  module Cop
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color-cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Farino
@@ -11,6 +11,20 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2015-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: bundler
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -39,11 +53,54 @@ dependencies:
39
53
  - - '>='
40
54
  - !ruby/object:Gem::Version
41
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '3.2'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '3.2'
70
+ - !ruby/object:Gem::Dependency
71
+ name: cucumber
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: aruba
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
42
98
  description: ''
43
99
  email:
44
100
  - paul.farino1@gmail.com
45
101
  - mark.mcdonald.ga@gmail.com
46
- executables: []
102
+ executables:
103
+ - color-cop
47
104
  extensions: []
48
105
  extra_rdoc_files: []
49
106
  files:
@@ -52,7 +109,10 @@ files:
52
109
  - LICENSE.txt
53
110
  - README.md
54
111
  - Rakefile
112
+ - bin/color-cop
55
113
  - color-cop.gemspec
114
+ - features/detect_stray_hex_codes.feature
115
+ - features/support/setup.rb
56
116
  - lib/color/cop.rb
57
117
  - lib/color/cop/version.rb
58
118
  homepage: https://github.com/paulfarino/color-cop
@@ -79,4 +139,6 @@ rubygems_version: 2.2.2
79
139
  signing_key:
80
140
  specification_version: 4
81
141
  summary: Find stray hex codes in your sass files.
82
- test_files: []
142
+ test_files:
143
+ - features/detect_stray_hex_codes.feature
144
+ - features/support/setup.rb