test_pivotal_workstation 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.markdown +31 -0
  5. data/Rakefile +1 -0
  6. data/lib/test_pivotal_workstation.rb +5 -0
  7. data/lib/test_pivotal_workstation/attributes/default.rb +20 -0
  8. data/lib/test_pivotal_workstation/attributes/git_pairs.rb +5 -0
  9. data/lib/test_pivotal_workstation/attributes/git_projects.rb +3 -0
  10. data/lib/test_pivotal_workstation/attributes/github_for_mac.rb +4 -0
  11. data/lib/test_pivotal_workstation/attributes/gitx.rb +1 -0
  12. data/lib/test_pivotal_workstation/attributes/mouse_locator.rb +5 -0
  13. data/lib/test_pivotal_workstation/attributes/nginx.rb +11 -0
  14. data/lib/test_pivotal_workstation/attributes/pg_admin.rb +4 -0
  15. data/lib/test_pivotal_workstation/attributes/rvm.rb +8 -0
  16. data/lib/test_pivotal_workstation/attributes/sizeup.rb +1 -0
  17. data/lib/test_pivotal_workstation/attributes/versions.rb +6 -0
  18. data/lib/test_pivotal_workstation/attributes/vim.rb +2 -0
  19. data/lib/test_pivotal_workstation/attributes/workspace_directory.rb +1 -0
  20. data/lib/test_pivotal_workstation/libraries/applescript.rb +5 -0
  21. data/lib/test_pivotal_workstation/libraries/bash_profile_include.rb +11 -0
  22. data/lib/test_pivotal_workstation/libraries/brew.rb +38 -0
  23. data/lib/test_pivotal_workstation/libraries/directories.rb +25 -0
  24. data/lib/test_pivotal_workstation/libraries/marker.rb +42 -0
  25. data/lib/test_pivotal_workstation/libraries/osx_app.rb +97 -0
  26. data/lib/test_pivotal_workstation/libraries/rvm_ruby_install.rb +36 -0
  27. data/lib/test_pivotal_workstation/libraries/user.rb +4 -0
  28. data/lib/test_pivotal_workstation/libraries/version.rb +9 -0
  29. data/lib/test_pivotal_workstation/providers/package.rb +95 -0
  30. data/lib/test_pivotal_workstation/recipes/ack.rb +1 -0
  31. data/lib/test_pivotal_workstation/recipes/active_corners.rb +24 -0
  32. data/lib/test_pivotal_workstation/recipes/activemq.rb +1 -0
  33. data/lib/test_pivotal_workstation/recipes/bash_path_order.rb +13 -0
  34. data/lib/test_pivotal_workstation/recipes/bash_profile-arch_flags.rb +1 -0
  35. data/lib/test_pivotal_workstation/recipes/bash_profile-better_history.rb +1 -0
  36. data/lib/test_pivotal_workstation/recipes/bash_profile-no_sudo_gem_install.rb +1 -0
  37. data/lib/test_pivotal_workstation/recipes/bash_profile-ps1.rb +1 -0
  38. data/lib/test_pivotal_workstation/recipes/bash_profile-ree_settings.rb +1 -0
  39. data/lib/test_pivotal_workstation/recipes/bash_profile.rb +11 -0
  40. data/lib/test_pivotal_workstation/recipes/ccmenu.rb +6 -0
  41. data/lib/test_pivotal_workstation/recipes/chrome.rb +6 -0
  42. data/lib/test_pivotal_workstation/recipes/default_editor.rb +55 -0
  43. data/lib/test_pivotal_workstation/recipes/defaults_fast_key_repeat_rate.rb +10 -0
  44. data/lib/test_pivotal_workstation/recipes/disable_front_row.rb +4 -0
  45. data/lib/test_pivotal_workstation/recipes/dock_preferences.rb +13 -0
  46. data/lib/test_pivotal_workstation/recipes/dropbox.rb +6 -0
  47. data/lib/test_pivotal_workstation/recipes/ec2_api_tools.rb +3 -0
  48. data/lib/test_pivotal_workstation/recipes/finder_display_full_path.rb +4 -0
  49. data/lib/test_pivotal_workstation/recipes/firefox.rb +5 -0
  50. data/lib/test_pivotal_workstation/recipes/gem_no_rdoc_no_ri.rb +14 -0
  51. data/lib/test_pivotal_workstation/recipes/git.rb +8 -0
  52. data/lib/test_pivotal_workstation/recipes/git_config_global_defaults.rb +72 -0
  53. data/lib/test_pivotal_workstation/recipes/git_projects.rb +29 -0
  54. data/lib/test_pivotal_workstation/recipes/git_scripts.rb +19 -0
  55. data/lib/test_pivotal_workstation/recipes/github_for_mac.rb +25 -0
  56. data/lib/test_pivotal_workstation/recipes/github_ssh_keys.rb +16 -0
  57. data/lib/test_pivotal_workstation/recipes/gitx.rb +56 -0
  58. data/lib/test_pivotal_workstation/recipes/global_environment_variables.rb +3 -0
  59. data/lib/test_pivotal_workstation/recipes/google_chrome_prevent_updates.rb +10 -0
  60. data/lib/test_pivotal_workstation/recipes/homebrew.rb +27 -0
  61. data/lib/test_pivotal_workstation/recipes/imagemagick.rb +3 -0
  62. data/lib/test_pivotal_workstation/recipes/inputrc.rb +6 -0
  63. data/lib/test_pivotal_workstation/recipes/iterm_set_defaults.rb +167 -0
  64. data/lib/test_pivotal_workstation/recipes/java.rb +8 -0
  65. data/lib/test_pivotal_workstation/recipes/joe.rb +3 -0
  66. data/lib/test_pivotal_workstation/recipes/libreoffice.rb +6 -0
  67. data/lib/test_pivotal_workstation/recipes/lion_basedev.rb +38 -0
  68. data/lib/test_pivotal_workstation/recipes/locate_on.rb +8 -0
  69. data/lib/test_pivotal_workstation/recipes/memcached.rb +20 -0
  70. data/lib/test_pivotal_workstation/recipes/mongodb.rb +20 -0
  71. data/lib/test_pivotal_workstation/recipes/mouse_locator.rb +54 -0
  72. data/lib/test_pivotal_workstation/recipes/mysql.rb +44 -0
  73. data/lib/test_pivotal_workstation/recipes/nginx.rb +46 -0
  74. data/lib/test_pivotal_workstation/recipes/osx_updates.rb +3 -0
  75. data/lib/test_pivotal_workstation/recipes/pg_admin.rb +4 -0
  76. data/lib/test_pivotal_workstation/recipes/pivotal_logos.rb +101 -0
  77. data/lib/test_pivotal_workstation/recipes/postgres.rb +89 -0
  78. data/lib/test_pivotal_workstation/recipes/remove_garageband.rb +11 -0
  79. data/lib/test_pivotal_workstation/recipes/rubymine.rb +8 -0
  80. data/lib/test_pivotal_workstation/recipes/rubymine_preferences_pivotal.rb +36 -0
  81. data/lib/test_pivotal_workstation/recipes/rvm.rb +53 -0
  82. data/lib/test_pivotal_workstation/recipes/safari_preferences.rb +4 -0
  83. data/lib/test_pivotal_workstation/recipes/screen_sharing_app.rb +12 -0
  84. data/lib/test_pivotal_workstation/recipes/screen_sharing_on.rb +16 -0
  85. data/lib/test_pivotal_workstation/recipes/selenium_webdriver.rb +24 -0
  86. data/lib/test_pivotal_workstation/recipes/set_finder_show_hd_on_desktop.rb +4 -0
  87. data/lib/test_pivotal_workstation/recipes/set_multitouch_preferences.rb +9 -0
  88. data/lib/test_pivotal_workstation/recipes/set_screensaver_preferences.rb +21 -0
  89. data/lib/test_pivotal_workstation/recipes/sizeup.rb +19 -0
  90. data/lib/test_pivotal_workstation/recipes/skype.rb +5 -0
  91. data/lib/test_pivotal_workstation/recipes/ssh_copy_id.rb +3 -0
  92. data/lib/test_pivotal_workstation/recipes/sshd_on.rb +16 -0
  93. data/lib/test_pivotal_workstation/recipes/ssl_certificate.rb +50 -0
  94. data/lib/test_pivotal_workstation/recipes/svn.rb +1 -0
  95. data/lib/test_pivotal_workstation/recipes/terminal_focus.rb +4 -0
  96. data/lib/test_pivotal_workstation/recipes/terminal_preferences.rb +9 -0
  97. data/lib/test_pivotal_workstation/recipes/textmate.rb +29 -0
  98. data/lib/test_pivotal_workstation/recipes/textmate_plugins.rb +31 -0
  99. data/lib/test_pivotal_workstation/recipes/textmate_preferences.rb +83 -0
  100. data/lib/test_pivotal_workstation/recipes/timemachine_preferences.rb +22 -0
  101. data/lib/test_pivotal_workstation/recipes/user_owns_usr_local.rb +8 -0
  102. data/lib/test_pivotal_workstation/recipes/vim.rb +66 -0
  103. data/lib/test_pivotal_workstation/recipes/virtualbox.rb +7 -0
  104. data/lib/test_pivotal_workstation/recipes/workspace_directory.rb +5 -0
  105. data/lib/test_pivotal_workstation/resources/package.rb +34 -0
  106. data/lib/test_pivotal_workstation/templates/default/bash_profile-arch_flags.sh.erb +3 -0
  107. data/lib/test_pivotal_workstation/templates/default/bash_profile-better_history.sh.erb +4 -0
  108. data/lib/test_pivotal_workstation/templates/default/bash_profile-ec2_tools.sh.erb +5 -0
  109. data/lib/test_pivotal_workstation/templates/default/bash_profile-git_vim.sh.erb +1 -0
  110. data/lib/test_pivotal_workstation/templates/default/bash_profile-no_sudo_gem_install.sh.erb +2 -0
  111. data/lib/test_pivotal_workstation/templates/default/bash_profile-ps1.sh.erb +8 -0
  112. data/lib/test_pivotal_workstation/templates/default/bash_profile-ree_settings.sh.erb +6 -0
  113. data/lib/test_pivotal_workstation/templates/default/bash_profile-rvm.sh.erb +1 -0
  114. data/lib/test_pivotal_workstation/templates/default/bash_profile-vi_is_minimal_vim.sh.erb +1 -0
  115. data/lib/test_pivotal_workstation/templates/default/bash_profile.erb +6 -0
  116. data/lib/test_pivotal_workstation/templates/default/git_scripts_pairs.erb +12 -0
  117. data/lib/test_pivotal_workstation/templates/default/inputrc.erb +10 -0
  118. data/lib/test_pivotal_workstation/templates/default/launchd.conf.erb +6 -0
  119. data/lib/test_pivotal_workstation/templates/default/nginx.conf.erb +79 -0
  120. data/lib/test_pivotal_workstation/templates/default/org.nginx.nginx.plist.erb +22 -0
  121. data/lib/test_pivotal_workstation/templates/default/pivotal_logos-dsimport.erb +2 -0
  122. data/lib/test_pivotal_workstation/version.rb +3 -0
  123. data/test_pivotal_workstation.gemspec +24 -0
  124. metadata +168 -0
@@ -0,0 +1,4 @@
1
+ execute "show hard drive on desktop" do
2
+ command "defaults write com.apple.finder ShowHardDrivesOnDesktop -bool YES"
3
+ user WS_USER
4
+ end
@@ -0,0 +1,9 @@
1
+ execute "allow clicking by touch" do
2
+ command "defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking 1"
3
+ user WS_USER
4
+ end
5
+
6
+ execute "allow dragging by touch" do
7
+ command "defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Dragging 1"
8
+ user WS_USER
9
+ end
@@ -0,0 +1,21 @@
1
+ execute "ask for password when screen is locked" do
2
+ command "defaults write com.apple.screensaver askForPassword -int 1"
3
+ user WS_USER
4
+ end
5
+
6
+ execute "wait 60 seconds between screensaver & lock" do
7
+ command "defaults write com.apple.screensaver askForPasswordDelay 60"
8
+ user WS_USER
9
+ end
10
+
11
+ plist_dir = ENV['HOME'] + "/Library/Preferences/ByHost"
12
+ Dir["#{plist_dir}/com.apple.screensaver.*.plist"].each do |file|
13
+ execute "set screensaver timeout" do
14
+ command "defaults write #{file.chomp(".plist")} idleTime 600"
15
+ user WS_USER
16
+ end
17
+ end
18
+
19
+ execute "set display, disk and computer sleep times" do
20
+ command "pmset -a displaysleep 20 disksleep 15 sleep 0"
21
+ end
@@ -0,0 +1,19 @@
1
+ unless File.exists?("/Applications/SizeUp.app")
2
+
3
+ remote_file "/tmp/sizeup.zip" do
4
+ source node["sizeup_download_uri"]
5
+ mode "0644"
6
+ end
7
+
8
+ # The following doesn't work - it causes the checkbox to be enabled, but doesn't turn it on.
9
+ # other people want this feature, leaving this in to remind me or someone else
10
+ # to google for it in the future
11
+ # execute "turn on Access for Assistive Devices" do
12
+ # command "touch /private/var/db/.AccessibilityAPIEnabled"
13
+ # end
14
+
15
+ execute "unzip sizeup" do
16
+ command "unzip /tmp/sizeup.zip SizeUp.app/* -d /Applications/"
17
+ user WS_USER
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ pivotal_workstation_package "Skype" do
2
+ source "http://www.skype.com/go/getskype-macosx.dmg"
3
+ action :install
4
+ checksum "ad4f5a8f2312597b98c420045d0828ec40d440fe0da187bde34b7f40294b8e08"
5
+ end
@@ -0,0 +1,3 @@
1
+ include_recipe "pivotal_workstation::homebrew"
2
+
3
+ brew_install "ssh-copy-id"
@@ -0,0 +1,16 @@
1
+ execute "turn on ssh" do
2
+ command "systemsetup -setremotelogin on"
3
+ end
4
+
5
+ ruby_block "test to see if sshd is running" do
6
+ block do
7
+ require 'socket'
8
+ ssh_port = 22
9
+ begin
10
+ s = TCPSocket.open('localhost',ssh_port)
11
+ rescue => e
12
+ raise "sshd is not running: " << e
13
+ end
14
+ s.close
15
+ end
16
+ end
@@ -0,0 +1,50 @@
1
+ cert_path = node["ssl_settings"]["cert_path"]
2
+ ca_path = node["ssl_settings"]["ca_path"]
3
+
4
+ run_unless_marker_file_exists("ssl_certificate") do
5
+ ["/usr/local", "/usr/local/etc", cert_path, "#{ca_path}", "#{ca_path}/keys", "#{ca_path}/requests", "#{ca_path}/certs", "#{ca_path}/newcerts"].each do |dir|
6
+ directory dir do
7
+ recursive true
8
+ owner WS_USER
9
+ end
10
+ end
11
+
12
+ execute "create database.txt" do
13
+ command "touch #{ca_path}/index.txt"
14
+ user WS_USER
15
+ end
16
+
17
+ execute "create serial" do
18
+ command "echo '01\n' > #{ca_path}/serial"
19
+ user WS_USER
20
+ end
21
+
22
+ execute "generate key" do
23
+ command "openssl genrsa -des3 -passout pass:password -out #{ca_path}/keys/ca.key 1024"
24
+ user WS_USER
25
+ end
26
+
27
+ execute "generate ca" do
28
+ command "cd #{ca_path} && openssl req -new -x509 -days 1001 -key #{ca_path}/keys/ca.key -passin pass:password -out #{ca_path}/certs/ca.cert -subj '/CN=mydomain.com/OU=Org Unit/O=My Org Pty Ltd/L=Sydney/ST=NSW/C=AU/emailAddr=someone@example.com'"
29
+ user WS_USER
30
+ end
31
+
32
+ execute "trust our CA" do
33
+ command "security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain #{ca_path}/certs/ca.cert"
34
+ end
35
+
36
+ execute "generate server key" do
37
+ command "openssl genrsa 1024 > #{cert_path}/server.key"
38
+ user WS_USER
39
+ end
40
+
41
+ execute "generate request" do
42
+ command "openssl req -new -key #{cert_path}/server.key -out #{cert_path}/request.csr -subj '/CN=#{node["ssl_settings"]["common_name"]}/OU=Org Unit/O=My Org Pty Ltd/L=Sydney/ST=NSW/C=AU/emailAddr=someoneATexample.com'"
43
+ user WS_USER
44
+ end
45
+
46
+ execute "sign request with CA" do
47
+ command "cd #{cert_path} && openssl ca -policy policy_anything -cert #{ca_path}/certs/ca.cert -batch -in #{cert_path}/request.csr -passin pass:password -keyfile #{ca_path}/keys/ca.key -days 9999 -out #{cert_path}/signed.cert"
48
+ user WS_USER
49
+ end
50
+ end
@@ -0,0 +1 @@
1
+ brew_install "svn"
@@ -0,0 +1,4 @@
1
+ execute "turn on focus-follows-mouse for terminal" do
2
+ command "defaults write com.apple.Terminal FocusFollowsMouse -string YES"
3
+ user WS_USER
4
+ end
@@ -0,0 +1,9 @@
1
+ execute "set terminal color scheme" do
2
+ command "defaults write com.apple.Terminal 'Default Window Settings' -string Homebrew"
3
+ user WS_USER
4
+ end
5
+
6
+ execute "set terminal color scheme" do
7
+ command "defaults write com.apple.Terminal 'Startup Window Settings' -string Homebrew"
8
+ user WS_USER
9
+ end
@@ -0,0 +1,29 @@
1
+ include_recipe "pivotal_workstation::user_owns_usr_local"
2
+
3
+ unless File.exists?("/Applications/TextMate.app")
4
+ execute "download text mate to temp dir" do
5
+ command "curl -o /tmp/textmate.zip http://dl.macromates.com/TextMate_1.5.10_r1623.zip"
6
+ user WS_USER
7
+ end
8
+
9
+ execute "extract text mate to /Applications" do
10
+ command 'unzip -o /tmp/textmate.zip -x __MACOSX* -d /Applications/'
11
+ user WS_USER
12
+ end
13
+
14
+ execute "link textmate" do
15
+ command "ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/local/bin/mate"
16
+ not_if "test -e /usr/local/bin/mate"
17
+ end
18
+
19
+ ruby_block "test to see if TextMate was installed" do
20
+ block do
21
+ raise "TextMate install failed" unless File.exists?("/Applications/TextMate.app")
22
+ end
23
+ end
24
+ end
25
+
26
+ execute "link textmate" do
27
+ command "ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/local/bin/mate"
28
+ not_if "test -e /usr/local/bin/mate"
29
+ end
@@ -0,0 +1,31 @@
1
+ run_unless_marker_file_exists("textmate_plugins_0") do
2
+ execute "download ProjectPlus to temp dir" do
3
+ command "curl -o /tmp/projectplus.dmg http://ciaranwal.sh/projectplus-files/ProjectPlus-1.3.dmg"
4
+ user WS_USER
5
+ end
6
+
7
+ execute "mount dmg" do
8
+ command "hdid /tmp/projectplus.dmg"
9
+ user WS_USER
10
+ end
11
+
12
+ execute "clear out the existing plugin if it's there" do
13
+ command "rm -rf '#{WS_HOME}/Library/Application Support/TextMate/PlugIns/ProjectPlus.tmplugin'"
14
+ end
15
+
16
+ execute "make textmate plugins directory" do
17
+ command "mkdir -p '#{WS_HOME}/Library/Application Support/TextMate/PlugIns'"
18
+ user WS_USER
19
+ not_if { File.exists?("#{WS_HOME}/Library/Application Support/TextMate/PlugIns") }
20
+ end
21
+
22
+ execute "copy to TextMate" do
23
+ command "cp -Rf /Volumes/ProjectPlus/ProjectPlus.tmplugin '#{WS_HOME}/Library/Application Support/TextMate/PlugIns'"
24
+ user WS_USER
25
+ end
26
+
27
+ execute "unmount dmg" do
28
+ command "hdiutil detach /Volumes/ProjectPlus"
29
+ user WS_USER
30
+ end
31
+ end
@@ -0,0 +1,83 @@
1
+ include_recipe "pivotal_workstation::textmate"
2
+
3
+ execute "set save on losing focus" do
4
+ command "defaults write ~/Library/Preferences/com.macromates.textmate OakSaveAllOnDeactivate -bool TRUE"
5
+ user WS_USER
6
+ end
7
+
8
+ execute "show line numbers" do
9
+ command "defaults write ~/Library/Preferences/com.macromates.textmate OakTextViewLineNumbersEnabled -bool TRUE"
10
+ user WS_USER
11
+ end
12
+
13
+ gem_package("plist")
14
+
15
+ plist_file = "#{ENV['HOME']}/Library/Preferences/com.macromates.textmate.plist"
16
+ ruby_block "soft tabs & tabs stop of 2" do
17
+ block do
18
+ Gem.clear_paths
19
+ require 'rubygems'
20
+ require 'plist'
21
+ require 'time'
22
+ # FIXME: if plist doesn't exist, create it.
23
+ `plutil -convert xml1 #{plist_file}`
24
+ tmate_plist = Plist::parse_xml(plist_file)
25
+ tmate_plist["OakTextViewLineNumbersEnabled"] = true
26
+ tmate_plist["OakTextViewScopedSoftTabs"] =
27
+ { "source.catch-all" =>
28
+ { "softTabs" => false,
29
+ "updated" => Time.parse("2011-07-14T18:59:17Z")
30
+ },
31
+ "source.plist" =>
32
+ { "softTabs" => true,
33
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
34
+ },
35
+ "source.ruby" =>
36
+ { "softTabs" => true,
37
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
38
+ },
39
+ "source.yaml" =>
40
+ { "softTabs" => true,
41
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
42
+ },
43
+ "text.catch-all" =>
44
+ { "softTabs" => false,
45
+ "updated" => Time.parse("2011-07-14T18:59:17Z")
46
+ },
47
+ "text.plain" =>
48
+ { "softTabs" => true,
49
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
50
+ }
51
+ }
52
+ tmate_plist["OakTextViewScopedTabSize"] =
53
+ { "source.catch-all" =>
54
+ { "tabSize" => 4,
55
+ "updated" => Time.parse("2011-07-14T18:59:17Z")
56
+ },
57
+ "source.plist" =>
58
+ { "tabSize" => 2,
59
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
60
+ },
61
+ "source.ruby" =>
62
+ { "tabSize" => 2,
63
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
64
+ },
65
+ "source.yaml" =>
66
+ { "tabSize" => 2,
67
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
68
+ },
69
+ "text.catch-all" =>
70
+ { "tabSize" => 4,
71
+ "updated" => Time.parse("2011-07-14T18:59:17Z")
72
+ },
73
+ "text.plain" =>
74
+ { "tabSize" => 2,
75
+ "updated" => Time.parse("0000-12-30T00:00:00Z")
76
+ }
77
+ }
78
+ puts Plist::Emit.dump(tmate_plist["OakTextViewScopedTabSize"])
79
+ File.open(plist_file, "w") do |plist_handle|
80
+ plist_handle.puts Plist::Emit.dump(tmate_plist)
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,22 @@
1
+ execute "TimeMachine should NOT ask to use every new disk" do
2
+ command "defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES"
3
+ user WS_USER
4
+ end
5
+
6
+ ruby_block "TimeMachine should NOT appear in the status bar" do
7
+ block do
8
+ new_menuExtras=""
9
+ `sudo -u #{WS_USER} defaults read com.apple.systemuiserver menuExtras`.split("\n").each do |line|
10
+ if line !~ /TimeMachine.menu/
11
+ new_menuExtras = new_menuExtras + line + "\n"
12
+ end
13
+ end
14
+ `sudo -u #{WS_USER} defaults write com.apple.systemuiserver menuExtras \'#{new_menuExtras}\'`
15
+ `killall -HUP SystemUIServer`
16
+ end
17
+ end
18
+
19
+ execute "make sure it doesn't exist" do
20
+ command "! defaults read com.apple.systemuiserver menuExtras | grep TimeMachine.menu"
21
+ user WS_USER
22
+ end
@@ -0,0 +1,8 @@
1
+ directory "/usr/local/bin" do
2
+ owner WS_USER
3
+ recursive true
4
+ end
5
+
6
+ execute "your current user owns /usr/local" do
7
+ command "chown -R #{WS_USER} /usr/local"
8
+ end
@@ -0,0 +1,66 @@
1
+ include_recipe "pivotal_workstation::homebrew"
2
+ include_recipe "pivotal_workstation::ack"
3
+ include_recipe "pivotal_workstation::git"
4
+
5
+ brew_install "macvim"
6
+
7
+ #link "/Applications/MacVim.app" do
8
+ # to "#{node["vim_app"]}"
9
+ # owner WS_USER
10
+ #end
11
+
12
+ # There may be multiple macvims; try to find the latest one
13
+ # & link that to /Applications
14
+ ruby_block "Link MacVim to /Applications" do
15
+ block do
16
+ macvim_app=Dir["/usr/local/Cellar/macvim/*/MacVim.app"].last
17
+ if File.exists?(macvim_app)
18
+ system("ln -s #{macvim_app} /Applications/")
19
+ end
20
+ end
21
+ end
22
+
23
+ execute "move existing vim_home out of the way if necessary" do
24
+ user WS_USER
25
+ command "mv #{node["vim_home"]} #{WS_HOME}/.vim-old"
26
+ only_if {
27
+ File.exists?(node["vim_home"]) && !system("cd #{node["vim_home"]} && git remote -v | grep pivotal/vim-config")
28
+ }
29
+ end
30
+
31
+ execute "clone the .vim directory" do
32
+ user WS_USER
33
+ command "git clone https://github.com/pivotal/vim-config.git #{node["vim_home"]}"
34
+ not_if "cd #{node["vim_home"]} && git remote -v | grep pivotal/vim-config"
35
+ end
36
+
37
+ execute "ensure we're on the approved hash" do
38
+ user WS_USER
39
+ command "cd #{node["vim_home"]} && git checkout #{node["vim_hash"]}"
40
+ end
41
+
42
+ execute "get the submodules" do
43
+ user WS_USER
44
+ command "cd #{node["vim_home"]} && git submodule update --init"
45
+ end
46
+
47
+ link "#{WS_HOME}/.vimrc" do
48
+ to "#{node["vim_home"]}/vimrc"
49
+ owner WS_USER
50
+ end
51
+
52
+ brew_install "ctags"
53
+
54
+ execute "compile command-t" do
55
+ cwd "#{node["vim_home"]}/bundle/command-t/ruby/command-t"
56
+ command "ruby extconf.rb && make"
57
+ user WS_USER
58
+ end
59
+
60
+ ruby_block "test to see if MacVim link worked" do
61
+ block do
62
+ raise "/Applications/MacVim install failed" unless File.exists?("/Applications/MacVim.app/Contents")
63
+ end
64
+ end
65
+
66
+ bash_profile_include("vi_is_minimal_vim")
@@ -0,0 +1,7 @@
1
+ pivotal_workstation_package "VirtualBox" do
2
+ source "http://download.virtualbox.org/virtualbox/4.1.2/VirtualBox-4.1.2-73507-OSX.dmg"
3
+ checksum "6fd7b3ed2596cd76004e6d1a8d5ddbfb4193d6508132bfa447304c9cff5703d7"
4
+ action :install
5
+ type "mpkg"
6
+ package_id "org.virtualbox.pkg.virtualbox"
7
+ end
@@ -0,0 +1,5 @@
1
+ directory "#{WS_HOME}/#{node["workspace_directory"]}" do
2
+ owner WS_USER
3
+ mode "0755"
4
+ action :create
5
+ end
@@ -0,0 +1,34 @@
1
+ #
2
+ # Cookbook Name:: dmg
3
+ # Resource:: package
4
+ #
5
+ # Copyright 2011, Joshua Timberman
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ actions :install
20
+
21
+ attribute :app, :kind_of => String, :name_attribute => true
22
+ attribute :source, :kind_of => String, :default => nil
23
+ attribute :destination, :kind_of => String, :default => "/Applications"
24
+ attribute :checksum, :kind_of => String, :default => nil
25
+ attribute :volumes_dir, :kind_of => String, :default => nil
26
+ attribute :dmg_name, :kind_of => String, :default => nil
27
+ attribute :type, :kind_of => String, :default => "app"
28
+ attribute :package_id, :kind_of => String, :default => nil
29
+ attribute :installed, :kind_of => [TrueClass, FalseClass], :default => false
30
+
31
+ def initialize(name, run_context=nil)
32
+ super
33
+ @action = :install
34
+ end