From 999c445d2f17778daf846b387461edf7fc2e00ac Mon Sep 17 00:00:00 2001 From: Joseph Vartuli Date: Fri, 30 Oct 2015 16:17:23 +1100 Subject: [PATCH] Updated to comply with Chef lint tool foodcritic --- .gitignore | 24 +++++++++++++++++++++--- Berksfile | 5 +++++ attributes/default.rb | 8 ++++---- metadata.json | 33 --------------------------------- metadata.rb | 15 ++++++++------- recipes/tarball.rb | 25 ++++++++++++------------- 6 files changed, 50 insertions(+), 60 deletions(-) create mode 100644 Berksfile delete mode 100644 metadata.json diff --git a/.gitignore b/.gitignore index 7a7c37e..69d2d2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,22 @@ *~ -#~ -.rbx -*.class +*# +.#* +\#*# +.*.sw[a-z] +*.un~ +pkg/ + +# Berkshelf +.vagrant +/cookbooks +Berksfile.lock + +# Bundler +Gemfile.lock +bin/* +.bundle/* + +.berkshelf +.chef +.kitchen/ +.kitchen.local.yml diff --git a/Berksfile b/Berksfile new file mode 100644 index 0000000..1e4186a --- /dev/null +++ b/Berksfile @@ -0,0 +1,5 @@ +source 'https://api.berkshelf.com' + +metadata + +cookbook 'ark' diff --git a/attributes/default.rb b/attributes/default.rb index 4645920..2511ca1 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,4 +1,4 @@ -default[:gradle][:name] = "gradle" -default[:gradle][:version] = "2.8" -default[:gradle][:home_dir] = "/usr/local" -default[:gradle][:release_url] = "http://services.gradle.org/distributions/gradle-#{node[:gradle][:version]}-bin.zip" +default['gradle']['name'] = 'gradle' +default['gradle']['version'] = '2.8' +default['gradle']['home_dir'] = '/usr/local' +default['gradle']['release_url'] = "http://services.gradle.org/distributions/gradle-#{node['gradle']['version']}-bin.zip" diff --git a/metadata.json b/metadata.json deleted file mode 100644 index fce34df..0000000 --- a/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "gradle", - "description": "Installs gradle", - "long_description": "# gradle chef cookbook\n\nInstalls the gradle build system ", - "maintainer": "Michael S. Klishin", - "maintainer_email": "michael@clojurewerkz.org", - "license": "MIT", - "platforms": { - "debian": ">= 0.0.0", - "ubuntu": ">= 0.0.0" - }, - "dependencies": { - "ark": ">= 0.0.0" - }, - "recommendations": { - }, - "suggestions": { - }, - "conflicting": { - }, - "providing": { - }, - "replacing": { - }, - "attributes": { - }, - "groupings": { - }, - "recipes": { - "gradle::tarball": "installing gradle from tarball " - }, - "version": "1.0.0" -} diff --git a/metadata.rb b/metadata.rb index 77e5776..943a374 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,9 +1,10 @@ -name "gradle" -maintainer "Michael S. Klishin" -maintainer_email "michael@clojurewerkz.org" -license "MIT" +name 'gradle' +maintainer 'Michael S. Klishin' +maintainer_email 'michael@clojurewerkz.org' +license 'MIT' +description 'Installs Gradle' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "1.0.0" -description "Installs Gradle" -recipe "gradle::tarball", "installs gradle from tarball" +recipe 'gradle::tarball', 'installs gradle from tarball' +version '1.0.0' +depends 'ark', '>= 0.0.0' diff --git a/recipes/tarball.rb b/recipes/tarball.rb index 2ac603d..84c460b 100644 --- a/recipes/tarball.rb +++ b/recipes/tarball.rb @@ -22,19 +22,18 @@ include_recipe 'ark' -ark node[:gradle][:name] do - url node[:gradle][:release_url] - version node[:gradle][:version] - prefix_home node[:gradle][:home_dir] - prefix_root node[:gradle][:home_dir] - prefix_bin "#{node[:gradle][:home_dir]}/bin" - action :install - end +ark node['gradle']['name'] do + url node['gradle']['release_url'] + version node['gradle']['version'] + prefix_home node['gradle']['home_dir'] + prefix_root node['gradle']['home_dir'] + prefix_bin "#{node['gradle']['home_dir']}/bin" + action :install +end -cookbook_file "/etc/profile.d/gradle.sh" do - owner "root" - group "root" +cookbook_file '/etc/profile.d/gradle.sh' do + owner 'root' + group 'root' mode 0644 - - source "etc/profile.d/gradle.sh" + source 'etc/profile.d/gradle.sh' end