phare 0.1.2 → 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: 11fe615491686ce1118fce87c2a2a0d683786737
4
- data.tar.gz: 749f30f43a1801c68775c3514a7e56113e4ff1f7
3
+ metadata.gz: 68da804aeb2fef50fa402ca2751178599d3ebc51
4
+ data.tar.gz: c403260c2e1bd14530d22eddd6ac15cad0223475
5
5
  SHA512:
6
- metadata.gz: f240c0a96b2a14a167c31b7f210ad63fec4fa76c126fa4bb59c1164f50bb3e4e5ebc3e45df9b94e5c43c1ff44a9e4b011a54b140bcccf2bdf321c648c53c9664
7
- data.tar.gz: 4063492f0c2cdfa86af88152e8e707fe0b62d1d20a95c71804d9255c579cbab9fd6d5f48abf29dbef6820f81a979adf93640ecda4bb16be0766fb5c7a64f6673
6
+ metadata.gz: a19e7afe867999a353c59f0d94598e7d3c6f8c859964523ec47acf22a61f2b6b0a26a348bd295cb276f24e122e6f6516cdd9abee3ec781f1e7bbf3e09a6ddd8d
7
+ data.tar.gz: d73d72d49693b4e1bf109dca1adb389aeeda5fcb8857670151fa34f04f690025e99a526aa043808d209b62871850eab57f6b0fc1b231693530d7d5f25697680c
data/README.md CHANGED
@@ -1,15 +1,27 @@
1
- # Phare
1
+ <p align="center">
2
+ <a href="https://github.com/mirego/phare">
3
+ <img src="http://i.imgur.com/9Pa2RgE.png" alt="Phare" />
4
+ </a>
5
+ <br />
6
+ Phare looks into your files and check for coding style errors.
7
+ <br /><br />
8
+ <a href="https://rubygems.org/gems/phare"><img src="https://badge.fury.io/rb/phare.png" /></a>
9
+ </p>
2
10
 
3
11
  ## Installation
4
12
 
5
- Add this line to your application’s Gemfile as a development dependancy:
13
+ Add these lines to your application’s Gemfile as development dependancies:
6
14
 
7
15
  ```ruby
8
16
  group :development do
17
+ gem 'rubocop' # to check Ruby code
18
+ gem 'scss-lint' # to check SCSS code
19
+
9
20
  gem 'phare'
10
21
  end
11
22
  ```
12
23
 
24
+
13
25
  If you wish to check for JavaScript code style using JSHint and JSCS, you must install them too:
14
26
 
15
27
  ```bash
data/lib/phare.rb CHANGED
@@ -5,5 +5,6 @@ require 'phare/cli'
5
5
  require 'phare/check'
6
6
 
7
7
  require 'phare/checks/ruby_rubocop'
8
+ require 'phare/checks/scss_lint'
8
9
  require 'phare/checks/javascript_jshint'
9
10
  require 'phare/checks/javascript_jscs'
data/lib/phare/check.rb CHANGED
@@ -11,6 +11,9 @@ module Phare
11
11
  ruby = Checks::RubyRubocop.new
12
12
  ruby.run
13
13
 
14
+ scsslint = Checks::ScssLint.new(@directory)
15
+ scsslint.run
16
+
14
17
  jshint = Checks::JavaScriptJSHint.new(@directory)
15
18
  jshint.run
16
19
 
@@ -4,7 +4,7 @@ module Phare
4
4
  attr_reader :status
5
5
 
6
6
  def initialize
7
- @command = 'bundle exec rubocop'
7
+ @command = 'rubocop'
8
8
  end
9
9
 
10
10
  def run
@@ -0,0 +1,42 @@
1
+ module Phare
2
+ module Checks
3
+ class ScssLint
4
+ attr_reader :status
5
+
6
+ def initialize(directory)
7
+ @path = File.expand_path("#{directory}app/assets/**/*.css.scss", __FILE__)
8
+ @command = "scss-lint #{@path}"
9
+ end
10
+
11
+ def run
12
+ if should_run?
13
+ print_banner
14
+ system(@command)
15
+ @status = $CHILD_STATUS.exitstatus
16
+
17
+ if @status == 0
18
+ puts 'No code style errors found.'
19
+ else
20
+ puts "Something went wrong. Program exited with #{@status}"
21
+ end
22
+
23
+ puts ''
24
+ else
25
+ @status = 0
26
+ end
27
+ end
28
+
29
+ protected
30
+
31
+ def should_run?
32
+ !`which scss-lint`.empty?
33
+ end
34
+
35
+ def print_banner
36
+ puts '------------------------------------------'
37
+ puts 'Running SCSS-Lint to check for SCSS style…'
38
+ puts '------------------------------------------'
39
+ end
40
+ end
41
+ end
42
+ end
data/lib/phare/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Phare
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2'
3
3
  end
data/phare.gemspec CHANGED
@@ -20,6 +20,4 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
22
  spec.add_development_dependency 'rake'
23
-
24
- spec.add_dependency 'rubocop'
25
23
  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.1.2
4
+ version: '0.2'
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-02-26 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  description: ''
56
42
  email:
57
43
  - remi@exomel.com
@@ -71,6 +57,7 @@ files:
71
57
  - lib/phare/checks/javascript_jscs.rb
72
58
  - lib/phare/checks/javascript_jshint.rb
73
59
  - lib/phare/checks/ruby_rubocop.rb
60
+ - lib/phare/checks/scss_lint.rb
74
61
  - lib/phare/cli.rb
75
62
  - lib/phare/version.rb
76
63
  - phare.gemspec