guard-phpcs 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/guard/phpcs.rb +3 -3
- metadata +4 -4
data/lib/guard/phpcs.rb
CHANGED
@@ -4,22 +4,22 @@ require 'guard/guard'
|
|
4
4
|
module Guard
|
5
5
|
class PHPCS < Guard
|
6
6
|
|
7
|
-
VERSION = '0.0.
|
7
|
+
VERSION = '0.0.4'
|
8
8
|
|
9
9
|
DEFAULT_OPTIONS = {
|
10
10
|
:standard => 'Zend',
|
11
|
-
:tabs => 4
|
12
11
|
}
|
13
12
|
|
14
13
|
def initialize(watchers = [], options = {})
|
15
14
|
defaults = DEFAULT_OPTIONS.clone
|
16
15
|
@options = defaults.merge(options)
|
16
|
+
@tabs = @options[:tabs]? " --tab-width=#{@options[:tabs]} " : ' '
|
17
17
|
super(watchers, @options)
|
18
18
|
end
|
19
19
|
|
20
20
|
def run_on_changes(paths)
|
21
21
|
paths.each do |path|
|
22
|
-
results = `phpcs --report=full
|
22
|
+
results = `phpcs --report=full#{@tabs}--standard=#{@options[:standard]} #{path}`
|
23
23
|
if $?.to_i > 0 then
|
24
24
|
::Guard::Notifier.notify(results.gsub(/^-+\n/, '').gsub(/^FILE:.*\n/, '').gsub(/^Time:.*\n/, ''), :title => 'PHP Codesniffer', :image => :failed)
|
25
25
|
puts results
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-phpcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrik Henningsson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-10-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: guard
|