cch 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.travis.yml +1 -1
- data/bin/cch_install +7 -4
- data/cch.gemspec +3 -3
- data/lib/cch.rb +0 -2
- data/lib/cch/commands/file_system.rb +12 -1
- data/lib/cch/config/runners.rb +5 -2
- data/lib/cch/logger.rb +6 -3
- data/lib/cch/loggers/level.rb +1 -1
- data/lib/cch/runner.rb +2 -2
- data/lib/cch/setup.rb +1 -1
- data/lib/cch/version.rb +1 -1
- metadata +10 -11
- data/lib/cch/config/logger.rb +0 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2E2ODk5YTcwYmVmYTBhZDRlYWYxOTI2ZjEyZDM1ZWRiN2NkZWQ3Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzUzOGRkMjRjZTE3OWVjMjE0MGY5YjAxZWZmZWViODQ0OTJkZGQ1OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGEwM2IzYzE5NjI5N2RiZDA1NTFlM2VkN2RiN2QyYzFmZGMwM2MzNDg5ZDIw
|
10
|
+
MDkyYWVmOWNhMGU4ZjY4NjY4MDI4ZWY5N2U3NTcwNjM2MDg5ZTJhMGI5NzA0
|
11
|
+
MzRjNWJkODdjMzg4Yjk0MjRhOWQ4M2RmMzAyYjQzNThmOTczMjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGE2YTlmMzMwYzQ5MzUwZmY4MjgzODIwNWNjMWM1ZjM2ZDY5ZjExODgyOGVh
|
14
|
+
MjExM2FhZTFiYTIxOWJlNGI3MjJjMjZhYmM3MjZhYzYwMGU5OWU2OTlhNDY1
|
15
|
+
YjdlNzc3N2U4MTczNGM2OTQ2YTliYjA4YzAwNGU2YzI0ZTBmMGE=
|
data/.travis.yml
CHANGED
data/bin/cch_install
CHANGED
@@ -4,8 +4,11 @@
|
|
4
4
|
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
|
5
5
|
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
file_content = <<STRING
|
8
|
+
# Cch.logger.threshold = :info
|
9
|
+
# Cch.logger.implementation = Cch::Loggers::Stdout.new
|
10
|
+
|
11
|
+
Cch::Runner.run [:rubocop, :haml_lint, :rspec]
|
10
12
|
STRING
|
11
|
-
|
13
|
+
|
14
|
+
File.open('Cchfile', 'w') { |file| file.write file_content }
|
data/cch.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
if spec.respond_to?(:metadata)
|
20
20
|
spec.metadata['allowed_push_host'] = 'https://github.com/vnegrisolo/cch'
|
21
21
|
else
|
22
|
-
|
22
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
23
23
|
end
|
24
24
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = %w(cch cch_install)
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
|
-
spec.add_development_dependency 'bundler'
|
33
|
-
spec.add_development_dependency 'rake'
|
32
|
+
spec.add_development_dependency 'bundler'
|
33
|
+
spec.add_development_dependency 'rake'
|
34
34
|
spec.add_development_dependency 'yard'
|
35
35
|
spec.add_development_dependency 'rubocop'
|
36
36
|
spec.add_development_dependency 'rspec'
|
data/lib/cch.rb
CHANGED
@@ -6,7 +6,8 @@ module Cch
|
|
6
6
|
find_matched_files(files, pattern, transform)
|
7
7
|
end
|
8
8
|
|
9
|
-
existing_files(filtered_files)
|
9
|
+
filtered_files = existing_files(filtered_files)
|
10
|
+
compact(filtered_files)
|
10
11
|
end
|
11
12
|
|
12
13
|
private
|
@@ -21,6 +22,16 @@ module Cch
|
|
21
22
|
def existing_files(files)
|
22
23
|
files.flatten.compact.sort.uniq.select { |f| File.exist?(f) }
|
23
24
|
end
|
25
|
+
|
26
|
+
def compact(files)
|
27
|
+
files.map { |file| file unless sub_file?(files, file) }.compact
|
28
|
+
end
|
29
|
+
|
30
|
+
def sub_file?(files, file)
|
31
|
+
files.each { |f| return true if file != f && file.start_with?(f) }
|
32
|
+
|
33
|
+
false
|
34
|
+
end
|
24
35
|
end
|
25
36
|
end
|
26
37
|
end
|
data/lib/cch/config/runners.rb
CHANGED
@@ -12,8 +12,11 @@ Cch::Runner.configure :rspec do |runner|
|
|
12
12
|
|
13
13
|
runner.watch(%r{^spec/spec_helper.rb$}, proc { %w(spec) })
|
14
14
|
runner.watch(%r{^spec/rails_helper.rb$}, proc { %w(spec) })
|
15
|
-
runner.watch(%r{^config/routes.rb$}, proc { %w(spec/routing) })
|
16
|
-
runner.watch(
|
15
|
+
runner.watch(%r{^config/routes.rb$}, proc { %w(spec/routing spec/requests) })
|
16
|
+
runner.watch(
|
17
|
+
%r{^app/controllers/application_controller.rb$},
|
18
|
+
proc { %w(spec/controllers spec/requests) }
|
19
|
+
)
|
17
20
|
|
18
21
|
runner.watch(%r{^lib/(.+)\.rb$}, proc { |m| %W(spec/#{m[1]}_spec.rb spec/lib/#{m[1]}_spec.rb) })
|
19
22
|
runner.watch(%r{^app/(.+)\.rb$}, proc { |m| %W(spec/#{m[1]}_spec.rb) })
|
data/lib/cch/logger.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
+
require 'cch/loggers/level'
|
2
|
+
require 'cch/loggers/stdout'
|
3
|
+
|
1
4
|
module Cch
|
2
5
|
class Logger
|
3
6
|
attr_accessor :threshold, :implementation
|
4
7
|
|
5
8
|
def initialize(options = {})
|
6
|
-
@threshold = options[:threshold]
|
7
|
-
@implementation = options[:implementation]
|
9
|
+
@threshold = options[:threshold] || :info
|
10
|
+
@implementation = options[:implementation] || Loggers::Stdout.new
|
8
11
|
end
|
9
12
|
|
10
13
|
Loggers::Level.all.each do |level_name, level|
|
@@ -16,7 +19,7 @@ module Cch
|
|
16
19
|
private
|
17
20
|
|
18
21
|
def log(level, message)
|
19
|
-
return unless
|
22
|
+
return unless level.allowed?(threshold)
|
20
23
|
|
21
24
|
implementation.log(level, message)
|
22
25
|
end
|
data/lib/cch/loggers/level.rb
CHANGED
data/lib/cch/runner.rb
CHANGED
@@ -23,7 +23,7 @@ module Cch
|
|
23
23
|
def where(options = {})
|
24
24
|
runners = all
|
25
25
|
runners = runners.select(&:on) if options[:on?]
|
26
|
-
if (names = [options[:name]].flatten.compact).
|
26
|
+
if (names = [options[:name]].flatten.compact).any?
|
27
27
|
runners = runners.select { |r| names.include?(r.name) }
|
28
28
|
end
|
29
29
|
runners
|
@@ -55,7 +55,7 @@ module Cch
|
|
55
55
|
message = "running #{name.to_s.color(:black, :green)}"
|
56
56
|
message << " for #{files.size.to_s.color(:yellow)} files=#{files}"
|
57
57
|
Cch.logger.info(message)
|
58
|
-
files.
|
58
|
+
files.any?
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
data/lib/cch/setup.rb
CHANGED
data/lib/cch/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Ferreira Negrisolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: yard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,6 @@ files:
|
|
122
122
|
- lib/cch.rb
|
123
123
|
- lib/cch/commands/file_system.rb
|
124
124
|
- lib/cch/commands/shell.rb
|
125
|
-
- lib/cch/config/logger.rb
|
126
125
|
- lib/cch/config/runners.rb
|
127
126
|
- lib/cch/config/watchers.rb
|
128
127
|
- lib/cch/extensions/string.rb
|
data/lib/cch/config/logger.rb
DELETED