Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing some foodcritic errors

  • Loading branch information...
commit a97bbedaf438547bc93f32c8b1f30b7958931447 1 parent 0bc5674
@mkocher mkocher authored
View
2  attributes/versions.rb
@@ -1,4 +1,4 @@
-node.default[:versions]= {
+node.default['versions']= {
"homebrew" => "448fbc9afa407de85f14c71ea53ad8f6c66134ab",
"rvm" => "45a40eaa24c1d89268746e8de2913290afd9af42",
"Pivotal-Preferences-RubyMine" => "d0eb393ab3d4c92ac80ce3135aa9f71e59cccbd3",
View
2  libraries/version.rb
@@ -4,6 +4,6 @@ def marker_version_string_for(application_name)
end
def version_string_for(application_name)
- node[:versions][application_name] || raise("you must define a version for #{application_name} in attributes.")
+ node['versions'][application_name] || raise("you must define a version for #{application_name} in attributes.")
end
end
View
2  recipes/add_ops_user.rb
@@ -18,7 +18,7 @@
uid uid
home "/Users/#{username}"
shell "/bin/bash"
- not_if "id #{username}"
+ not_if { system("id #{username}") }
end
#create the user's home directory
View
2  recipes/git_projects.rb
@@ -1,6 +1,6 @@
include_recipe "pivotal_workstation::workspace_directory"
-node.git_projects.each do |repo_name, repo_address|
+node['git_projects'].each do |repo_name, repo_address|
execute "clone #{repo_name}" do
command "git clone #{repo_address} #{repo_name}"
user WS_USER
View
6 recipes/github_for_mac.rb
@@ -1,17 +1,17 @@
unless File.exists?(node["github_for_mac_app_path"])
- remote_file "/tmp/github_for_mac.zip" do
+ remote_file "#{Chef::Config[:file_cache_path]}/github_for_mac.zip" do
source node["github_for_mac_download_uri"]
owner WS_USER
end
execute "unzip github_for_mac" do
- command "unzip /tmp/github_for_mac.zip -d /tmp/"
+ command "unzip #{Chef::Config[:file_cache_path]}/github_for_mac.zip -d #{Chef::Config[:file_cache_path]}/"
user WS_USER
end
execute "copy github_for_mac to /Applications" do
- command "mv /tmp/GitHub.app #{Regexp.escape(node["github_for_mac_app_path"])}"
+ command "mv #{Chef::Config[:file_cache_path]}/GitHub.app #{Regexp.escape(node["github_for_mac_app_path"])}"
user WS_USER
group "admin"
end
View
8 recipes/gitx.rb
@@ -6,23 +6,23 @@
unless File.exists?(GITX_PATH)
- remote_file "/tmp/gitx.zip" do
+ remote_file "#{Chef::Config[:file_cache_path]}/gitx.zip" do
source node["gitx_download_location"]
owner WS_USER
end
- directory "/tmp/GitX.app" do
+ directory "#{Chef::Config[:file_cache_path]}/GitX.app" do
action :delete
recursive true
end
execute "unzip gitx" do
- command "unzip /tmp/gitx.zip -d /tmp/"
+ command "unzip #{Chef::Config[:file_cache_path]}/gitx.zip -d #{Chef::Config[:file_cache_path]}/"
user WS_USER
end
execute "copy gitx to /Applications" do
- command "rsync -a /tmp/GitX.app /Applications"
+ command "rsync -a #{Chef::Config[:file_cache_path]}/GitX.app /Applications"
user WS_USER
group "admin"
end
View
6 recipes/homebrew.rb
@@ -10,16 +10,16 @@
# recipe creates it, and that's a pre-req. Also, things like
# MacFuse, Audacity, and others tend to put things in /usr/local
-git "/tmp/homebrew" do
+git "#{Chef::Config[:file_cache_path]}/homebrew" do
repository "https://github.com/mxcl/homebrew.git"
revision homebrew_git_revision_hash
- destination "/tmp/homebrew"
+ destination "#{Chef::Config[:file_cache_path]}/homebrew"
action :sync
user WS_USER
end
execute "Copying homebrew's .git to /usr/local" do
- command "rsync -axSH /tmp/homebrew/ /usr/local/"
+ command "rsync -axSH #{Chef::Config[:file_cache_path]}/homebrew/ /usr/local/"
user WS_USER
end
View
4 recipes/jumpcut.rb
@@ -1,7 +1,7 @@
ruby_block "Install Jumpcut" do
block do
- system("cd /tmp/ && curl -L 'http://downloads.sourceforge.net/project/jumpcut/jumpcut/0.63/Jumpcut_0.63.tgz?r=http%3A%2F%2Fjumpcut.sourceforge.net%2F&ts=1319134739&use_mirror=iweb' | gunzip | tar xf -")
- system("mv /tmp/Jumpcut.app /Applications")
+ system("cd #{Chef::Config[:file_cache_path]}/ && curl -L 'http://downloads.sourceforge.net/project/jumpcut/jumpcut/0.63/Jumpcut_0.63.tgz?r=http%3A%2F%2Fjumpcut.sourceforge.net%2F&ts=1319134739&use_mirror=iweb' | gunzip | tar xf -")
+ system("mv #{Chef::Config[:file_cache_path]}/Jumpcut.app /Applications")
system("chown -R #{WS_USER} /Applications/Jumpcut.app")
end
not_if {File.exists?("/Applications/Jumpcut.app")}
View
4 recipes/mouse_locator.rb
@@ -1,13 +1,13 @@
unless File.exists?(node['mouse_locator_dst'])
- remote_file "/tmp/mouse_locator.dmg" do
+ remote_file "#{Chef::Config[:file_cache_path]}/mouse_locator.dmg" do
source node["mouse_locator_download_uri"]
mode "0644"
action :create_if_missing
end
execute "mount mouse_locator dmg" do
- command "hdid /tmp/mouse_locator.dmg"
+ command "hdid #{Chef::Config[:file_cache_path]}/mouse_locator.dmg"
user WS_USER
end
View
2  recipes/mysql.rb
@@ -34,7 +34,7 @@
execute "load the mysql plist into the mac daemon startup thing" do
command "launchctl load -w #{WS_HOME}/Library/LaunchAgents/com.mysql.mysqld.plist"
user WS_USER
- not_if "launchctl list com.mysql.mysqld"
+ not_if { system("launchctl list com.mysql.mysqld") }
end
ruby_block "Checking that mysql is running" do
View
2  recipes/osx_updates.rb
@@ -1,7 +1,7 @@
# This is a theorteically flawed chef recipe. This installs anything apple thinks
# is a good idea. Please understand why you shouldn't use this before using it.
-last_update_touchfile = "/tmp/last_software_update"
+last_update_touchfile = "#{Chef::Config[:file_cache_path]}/last_software_update"
execute "Check & install all available OS X updates from Apple" do
command "softwareupdate -i -a && touch #{last_update_touchfile}"
View
6 recipes/pivotal_logos.rb
@@ -40,7 +40,7 @@
end
end
- template "/tmp/jpegphoto.dsimport" do
+ template "#{Chef::Config[:file_cache_path]}/jpegphoto.dsimport" do
source "pivotal_logos-dsimport.erb"
owner WS_USER
end
@@ -52,10 +52,10 @@
# ->Users & Groups
# ->select your username->click on icon->click "Edit Picture..."
# ->set your picture to the one you want. Then:
- # dscl . read /Users/$USER JPEGPhoto |tail +2 |xxd -r -p > /tmp/precious.jpeg
+ # dscl . read /Users/$USER JPEGPhoto |tail +2 |xxd -r -p > #{Chef::Config[:file_cache_path]}/precious.jpeg
execute("dscl . delete /Users/#{WS_USER} JPEGPhoto")
execute("dscl . create /Users/#{WS_USER} Picture \"#{WS_HOME}/Pictures/Icons/tracker_dot.png\"")
- execute("dsimport /tmp/jpegphoto.dsimport /Local/Default M")
+ execute("dsimport #{Chef::Config[:file_cache_path]}/jpegphoto.dsimport /Local/Default M")
gem_package("plist")
View
2  recipes/rubymine_preferences_pivotal.rb
@@ -2,7 +2,7 @@
rubymine_version_string = version_string_for("RubyMine-VersionString")
run_unless_marker_file_exists("#{marker_version_string_for("Pivotal-Preferences-RubyMine")}-#{rubymine_version_string}") do
- download_dir = "/tmp/Pivotal-Preferences-RubyMine"
+ download_dir = "#{Chef::Config[:file_cache_path]}/Pivotal-Preferences-RubyMine"
rubymine_preferences_dir = "#{WS_HOME}/Library/Preferences/RubyMine#{rubymine_version_string}"
execute "reset dir" do
View
4 recipes/selenium_webdriver.rb
@@ -2,12 +2,12 @@
run_unless_marker_file_exists("selenium_webdriver_13_0_775_3") do
execute "download webdriver" do
- command "curl -o /tmp/webdriver.zip #{webdriver_location}"
+ command "curl -o #{Chef::Config[:file_cache_path]}/webdriver.zip #{webdriver_location}"
user WS_USER
end
execute "unzip" do
- command "unzip -o /tmp/webdriver.zip chromedriver -d /usr/bin/"
+ command "unzip -o #{Chef::Config[:file_cache_path]}/webdriver.zip chromedriver -d /usr/bin/"
end
end
View
4 recipes/sizeup.rb
@@ -1,6 +1,6 @@
unless File.exists?("/Applications/SizeUp.app")
- remote_file "/tmp/sizeup.zip" do
+ remote_file "#{Chef::Config[:file_cache_path]}/sizeup.zip" do
source node["sizeup_download_uri"]
mode "0644"
end
@@ -13,7 +13,7 @@
end
execute "unzip sizeup" do
- command "unzip /tmp/sizeup.zip SizeUp.app/* -d /Applications/"
+ command "unzip #{Chef::Config[:file_cache_path]}/sizeup.zip SizeUp.app/* -d /Applications/"
user WS_USER
end
end
View
2  recipes/ssl_certificate.rb
@@ -2,7 +2,7 @@
ca_path = node["ssl_settings"]["ca_path"]
run_unless_marker_file_exists("ssl_certificate") do
- ["/usr/local", "/usr/local/etc", cert_path, "#{ca_path}", "#{ca_path}/keys", "#{ca_path}/requests", "#{ca_path}/certs", "#{ca_path}/newcerts"].each do |dir|
+ ["/usr/local", "/usr/local/etc", cert_path, ca_path, "#{ca_path}/keys", "#{ca_path}/requests", "#{ca_path}/certs", "#{ca_path}/newcerts"].each do |dir|
directory dir do
recursive true
owner WS_USER
View
4 recipes/textmate.rb
@@ -2,12 +2,12 @@
unless File.exists?("/Applications/TextMate.app")
execute "download text mate to temp dir" do
- command "curl -o /tmp/textmate.zip http://dl.macromates.com/TextMate_1.5.10_r1631.zip"
+ command "curl -o #{Chef::Config[:file_cache_path]}/textmate.zip http://dl.macromates.com/TextMate_1.5.10_r1631.zip"
user WS_USER
end
execute "extract text mate to /Applications" do
- command 'unzip -o /tmp/textmate.zip -x __MACOSX* -d /Applications/'
+ command 'unzip -o #{Chef::Config[:file_cache_path]}/textmate.zip -x __MACOSX* -d /Applications/'
user WS_USER
end
View
4 recipes/textmate_plugins.rb
@@ -1,11 +1,11 @@
run_unless_marker_file_exists("textmate_plugins_0") do
execute "download ProjectPlus to temp dir" do
- command "curl -o /tmp/projectplus.dmg http://ciaranwal.sh/projectplus-files/ProjectPlus-1.3.dmg"
+ command "curl -o #{Chef::Config[:file_cache_path]}/projectplus.dmg http://ciaranwal.sh/projectplus-files/ProjectPlus-1.3.dmg"
user WS_USER
end
execute "mount dmg" do
- command "hdid /tmp/projectplus.dmg"
+ command "hdid #{Chef::Config[:file_cache_path]}/projectplus.dmg"
user WS_USER
end
View
2  recipes/vim.rb
@@ -21,7 +21,7 @@
end
end
-git "#{node["vim_home"]}" do
+git node["vim_home"] do
repository "git://github.com/pivotal/vim-config.git"
branch "master"
revision node["vim_hash"] || "HEAD"
Please sign in to comment.
Something went wrong with that request. Please try again.