Permalink
Browse files

Merge pull request #184 from roderik/improvement/allow_custom_bashit_…

…from_other_cookbook

Allow for custom bash-it plugins in other cookbooks
  • Loading branch information...
2 parents 706734e + 13db519 commit 35abfc8d43f8e5ba54e32067d3dbd029e8ce8318 @cunnie cunnie committed Jan 18, 2013
Showing with 17 additions and 8 deletions.
  1. +9 −6 attributes/bash_it.rb
  2. +1 −0 providers/bash_it_custom_plugin.rb
  3. +6 −2 recipes/bash_it.rb
  4. +1 −0 resources/bash_it_custom_plugin.rb
View
@@ -4,12 +4,15 @@
'completion' => %w[defaults git],
'plugins' => %w[ssh]
},
- 'custom_plugins' => %w[
- bash_it/custom/disable_ctrl-s_output_control.bash
- bash_it/custom/enable_ctrl-o_history_execution.bash
- bash_it/custom/ensure_usr_local_bin_first.bash
- bash_it/custom/add_user_initials_to_git_prompt_info.bash
- ],
+ 'custom_plugins' => {
+ "pivotal_workstation" => %w[
+ bash_it/custom/disable_ctrl-s_output_control.bash
+ bash_it/custom/enable_ctrl-o_history_execution.bash
+ bash_it/custom/history_settings.bash
+ bash_it/custom/ensure_usr_local_bin_first.bash
+ bash_it/custom/add_user_initials_to_git_prompt_info.bash
+ ]
+ },
'theme' => 'bobby',
'dir' => ::File.expand_path(".bash_it", WS_HOME),
'bashrc_path' => ::File.expand_path(".bash_profile", WS_HOME),
@@ -6,5 +6,6 @@
source new_resource.name
owner WS_USER
only_if { script_name =~ /\.bash$/ && ::File.directory?(bash_it_custom_dir) }
+ cookbook new_resource.cookbook
end
end
View
@@ -30,6 +30,10 @@
end
end
-node['bash_it']['custom_plugins'].each do |custom_script_name|
- pivotal_workstation_bash_it_custom_plugin custom_script_name
+node['bash_it']['custom_plugins'].each do |cookbook_name, custom_plugins|
+ custom_plugins.each do |custom_plugin|
+ pivotal_workstation_bash_it_custom_plugin custom_plugin do
+ cookbook cookbook_name
+ end
+ end
end
@@ -1,6 +1,7 @@
actions :create
attribute :name, :kind_of => String, :name_attribute => true
+attribute :cookbook, :kind_of => String
def initialize(name, run_context=nil)
super

0 comments on commit 35abfc8

Please sign in to comment.