Skip to content

Commit

Permalink
Merge pull request #113 from hideokamoto/phpmd
Browse files Browse the repository at this point in the history
add phpmd
  • Loading branch information
miya0001 committed May 15, 2016
2 parents aee4004 + 87f9ea7 commit e9f082a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions provision/site-cookbooks/vccw/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
default[:vccw][:phpcs][:alias] = 'wpcs'

default[:vccw][:phpdoc][:composer] = "phpdocumentor/phpdocumentor=2.*"
default[:vccw][:phpmd][:composer] = "phpmd/phpmd=*"

default[:vccw][:wordmove][:movefile] = '/vagrant/Movefile'
default[:vccw][:wordmove][:url] = 'http://wordpress.local'
Expand Down
9 changes: 9 additions & 0 deletions provision/site-cookbooks/vccw/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@
EOH
end

execute "phpmd-install" do
user node[:vccw][:user]
group node[:vccw][:group]
environment ({'COMPOSER_HOME' => node[:vccw][:composer_home]})
command <<-EOH
#{node[:vccw][:composer][:link]} global require #{Shellwords.shellescape(node[:vccw][:phpmd][:composer])}
EOH
end

# Generate Movefile
template node[:vccw][:wordmove][:movefile] do
source "Movefile.erb"
Expand Down
5 changes: 5 additions & 0 deletions spec/default/vccw_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
its(:exit_status) { should eq 0 }
end

describe command('~/.composer/vendor/bin/phpmd --version') do
let(:disable_sudo) { true }
its(:exit_status) { should eq 0 }
end

describe file('/vagrant/Movefile') do
let(:disable_sudo) { true }
it { should be_file }
Expand Down

0 comments on commit e9f082a

Please sign in to comment.