guard-phpmd 0.0.3 → 0.0.4
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 +4 -4
- data/README.md +4 -0
- data/lib/guard/phpmd.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59cfda2a630bba62369c1e018fffb1496aa93d10
|
4
|
+
data.tar.gz: ba55da409f019501abf60ed4a2df4de7c57c8aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756424f7e5b7bcaff2936f6ce86b6738678ed9b42214c874d5339057912c91173d262900f81d2ab7292067ef2897725ee91a20c312262331f58f0f306400563f
|
7
|
+
data.tar.gz: 590a1374a6062203c84075a315b781b416bec9b6e1f3e51b1776010000b46093f69180938cbc61a00a2eec5a85eba2fba6e416a5aef52544ce7cdfa1004dc874
|
data/README.md
CHANGED
@@ -28,6 +28,10 @@ Set the working directory (useful when using relative paths used in the rules fi
|
|
28
28
|
|
29
29
|
Path to the rules file.
|
30
30
|
|
31
|
+
* `:excutable # default => "phpmd"`
|
32
|
+
|
33
|
+
Specify the path to the phpmd executable. Useful when installing phpmd with Composer.
|
34
|
+
|
31
35
|
### Example
|
32
36
|
|
33
37
|
guard 'phpmd', :path => 'path/to/PHPMD', :rules => 'path/to/pmd-rules.xml' do
|
data/lib/guard/phpmd.rb
CHANGED
@@ -4,11 +4,12 @@ require 'guard/guard'
|
|
4
4
|
module Guard
|
5
5
|
class PHPMD < Guard
|
6
6
|
|
7
|
-
VERSION = '0.0.
|
7
|
+
VERSION = '0.0.4'
|
8
8
|
|
9
9
|
DEFAULT_OPTIONS = {
|
10
10
|
:path => '.',
|
11
|
-
:rules => 'pmd-rules.xml'
|
11
|
+
:rules => 'pmd-rules.xml',
|
12
|
+
:executable => 'phpmd',
|
12
13
|
}
|
13
14
|
|
14
15
|
def initialize(watchers = [], options = {})
|
@@ -22,7 +23,7 @@ module Guard
|
|
22
23
|
paths.each do |path|
|
23
24
|
path = File.expand_path path
|
24
25
|
Dir.chdir(@options[:path]) do
|
25
|
-
results =
|
26
|
+
results = `#{@options[:executable]} #{path} text #{@options[:rules]}`
|
26
27
|
if $?.to_i > 0 then
|
27
28
|
::Guard::Notifier.notify(results, :title => 'PHP Mess Detector', :image => :failed)
|
28
29
|
puts results
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-phpmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Henningsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|