phare 0.2 → 0.2.1

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: 68da804aeb2fef50fa402ca2751178599d3ebc51
4
- data.tar.gz: c403260c2e1bd14530d22eddd6ac15cad0223475
3
+ metadata.gz: e10309d7762735ae3ef48fb1112727084dd1d8da
4
+ data.tar.gz: dd3b9dd9fc72ebb2131f2ec462d062545aea5430
5
5
  SHA512:
6
- metadata.gz: a19e7afe867999a353c59f0d94598e7d3c6f8c859964523ec47acf22a61f2b6b0a26a348bd295cb276f24e122e6f6516cdd9abee3ec781f1e7bbf3e09a6ddd8d
7
- data.tar.gz: d73d72d49693b4e1bf109dca1adb389aeeda5fcb8857670151fa34f04f690025e99a526aa043808d209b62871850eab57f6b0fc1b231693530d7d5f25697680c
6
+ metadata.gz: 1741179c8af6003784155267c49de9eb1a6f0585e5c3df597a3f745090e02f34f2d3042c39cfa81a88b554b3044a75dc1b1cf36e0036b1a478e113c2effceac6
7
+ data.tar.gz: ce128dca925a212769ee105964d024fbddd7e27eb1a3884f94647d363b2504537ca30cf2b33b28bf1abb0a5f5a8fca2c484053bc6b256fe9a89cf758b1dc1e90
data/lib/phare/check.rb CHANGED
@@ -8,19 +8,21 @@ module Phare
8
8
  end
9
9
 
10
10
  def run
11
- ruby = Checks::RubyRubocop.new
11
+ @checks = []
12
+
13
+ @checks << ruby = Checks::RubyRubocop.new
12
14
  ruby.run
13
15
 
14
- scsslint = Checks::ScssLint.new(@directory)
16
+ @checks << scsslint = Checks::ScssLint.new(@directory)
15
17
  scsslint.run
16
18
 
17
- jshint = Checks::JavaScriptJSHint.new(@directory)
19
+ @checks << jshint = Checks::JavaScriptJSHint.new(@directory)
18
20
  jshint.run
19
21
 
20
- jscs = Checks::JavaScriptJSCS.new(@directory)
22
+ @checks << jscs = Checks::JavaScriptJSCS.new(@directory)
21
23
  jscs.run
22
24
 
23
- @status = [ruby.status, jshint.status, jscs.status].find { |status| status > 0 } || 0
25
+ @status = @checks.map!(&:status).find { |status| status > 0 } || 0
24
26
  end
25
27
  end
26
28
  end
@@ -28,7 +28,7 @@ module Phare
28
28
  protected
29
29
 
30
30
  def should_run?
31
- !`which jscs`.empty? && File.exists?(@config)
31
+ !`which jscs`.empty? && File.exists?(@config) && Dir.exists?(@path)
32
32
  end
33
33
 
34
34
  def print_banner
@@ -5,8 +5,9 @@ module Phare
5
5
 
6
6
  def initialize(directory)
7
7
  @config = File.expand_path("#{directory}.jshintrc", __FILE__)
8
- @path = File.expand_path("#{directory}app/assets/javascripts/**/*", __FILE__)
9
- @command = "jshint --config #{@config} --extra-ext .js,.es6.js #{@path}"
8
+ @path = File.expand_path("#{directory}app/assets/javascripts", __FILE__)
9
+ @glob = File.join(@path, '**/*')
10
+ @command = "jshint --config #{@config} --extra-ext .js,.es6.js #{@glob}"
10
11
  end
11
12
 
12
13
  def run
@@ -30,7 +31,7 @@ module Phare
30
31
  protected
31
32
 
32
33
  def should_run?
33
- !`which jshint`.empty? && File.exists?(@config)
34
+ !`which jshint`.empty? && File.exists?(@config) && Dir.exists?(@path)
34
35
  end
35
36
 
36
37
  def print_banner
@@ -4,8 +4,9 @@ module Phare
4
4
  attr_reader :status
5
5
 
6
6
  def initialize(directory)
7
- @path = File.expand_path("#{directory}app/assets/**/*.css.scss", __FILE__)
8
- @command = "scss-lint #{@path}"
7
+ @path = File.expand_path("#{directory}app/assets/stylesheets", __FILE__)
8
+ @glob = File.join(@path, '**/*.css.scss')
9
+ @command = "scss-lint #{@glob}"
9
10
  end
10
11
 
11
12
  def run
@@ -29,7 +30,7 @@ module Phare
29
30
  protected
30
31
 
31
32
  def should_run?
32
- !`which scss-lint`.empty?
33
+ !`which scss-lint`.empty? && Dir.exists?(@path)
33
34
  end
34
35
 
35
36
  def print_banner
data/lib/phare/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Phare
2
- VERSION = '0.2'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phare
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rémi Prévost
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-03 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler