pre-commit 0.20.0 → 0.21.0

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: 0b7eca26aaae49efaf8967fb7a02d01521f272cc
4
- data.tar.gz: 7e36f001ca2d85847d5038b757f442ffbb411a4e
3
+ metadata.gz: d9f9bf8ebb73fb121cdc9ce60b5bd6f8fbb88738
4
+ data.tar.gz: daae6e81f29f5d0b0d98be38fbda95bda9ed0c14
5
5
  SHA512:
6
- metadata.gz: f21965abc93d4cec2c941d53b519aa8bcf0416334a329784e061d8791108651f289184d7e0504e54da1b57e5b93d5395992753f856fbde69f08735c7810940e9
7
- data.tar.gz: df10779b7b8a0be223b55b6f70a0cd476b080bc75074b39832a3b4409da5c966aefcd55f28ff5b95e8010142525e3e6fe611ca736247f0409b966e68f3dc2e54
6
+ metadata.gz: 71055c47a64fec652fc176defceceab2c80d913d442f7c91c025ffc527461f2e0224da2f1fd54944e1ce6b59f89f7e411a5b62c89345a581ec3b1d257644dc2f
7
+ data.tar.gz: c4e33f9f692303cf706b80be808c20769f87bae32f8c3e5ae2b2f83efd8df89ecafb0845a2267f83d9f799bdf494ed2269a32987b42509f619da43eb579c4abe
@@ -12,9 +12,9 @@
12
12
  cmd=`git config pre-commit.ruby 2>/dev/null`
13
13
  if test -n "${cmd}"
14
14
  then true
15
- elif which rvm > /dev/null
15
+ elif which rvm >/dev/null 2>/dev/null
16
16
  then cmd="rvm default do ruby"
17
- elif which rbenv > /dev/null
17
+ elif which rbenv >/dev/null 2>/dev/null
18
18
  then cmd="rbenv exec ruby"
19
19
  else cmd="ruby"
20
20
  fi
@@ -12,9 +12,9 @@
12
12
  cmd=`git config pre-commit.ruby 2>/dev/null`
13
13
  if test -n "${cmd}"
14
14
  then true
15
- elif which rvm > /dev/null
15
+ elif which rvm >/dev/null 2>/dev/null
16
16
  then cmd="rvm default do ruby"
17
- elif which rbenv > /dev/null
17
+ elif which rbenv >/dev/null 2>/dev/null
18
18
  then cmd="rbenv exec ruby"
19
19
  else cmd="ruby"
20
20
  fi
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pre-commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shajith Chacko, Josh Lubaway
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pluginator
@@ -136,7 +136,6 @@ files:
136
136
  - lib/plugins/pre_commit/checks/merge_conflict.rb
137
137
  - lib/plugins/pre_commit/checks/migration.rb
138
138
  - lib/plugins/pre_commit/checks/nb_space.rb
139
- - lib/plugins/pre_commit/checks/php.rb
140
139
  - lib/plugins/pre_commit/checks/pry.rb
141
140
  - lib/plugins/pre_commit/checks/rails.rb
142
141
  - lib/plugins/pre_commit/checks/rspec_focus.rb
@@ -1,33 +0,0 @@
1
- require 'pre-commit/checks/plugin'
2
-
3
- module PreCommit
4
- module Checks
5
- class Php < Plugin
6
-
7
- def call(staged_files)
8
- staged_files = staged_files.grep /\.(php|engine|theme|install|inc|module|test)$/
9
- return if staged_files.empty?
10
-
11
- errors = staged_files.map { |file| run_check(file) }.compact
12
- return if errors.empty?
13
-
14
- errors.join("\n")
15
- end
16
-
17
- def run_check(file)
18
- # We force PHP to display errors otherwise they will likely end up in the
19
- # error_log and not in stdout.
20
- result = `php -d display_errors=1 -l #{file} 2>&1`
21
- # Filter out the obvious note from PHP.
22
- result = result.split($/).find_all {|line| line !~ /Errors/}.join($/)
23
- # If PHP exited non-zero then there was a parse error.
24
- result.strip unless $? == 0
25
- end
26
-
27
- def self.description
28
- "Detects PHP errors."
29
- end
30
-
31
- end
32
- end
33
- end