Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

hook_CUSTOM command #2

Merged
merged 1 commit into from May 14, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions drupal.ruble/bundle.rb
Expand Up @@ -3,12 +3,13 @@
bundle 'Drupal 7' do |bundle|
bundle.author = 'Jamie Holly/HollyIT'
bundle.contact_email_rot_13 = 'jamie@hollyit.net'
bundle.description = <<END
Development support for <a href="http://drupal.org/">Drupal</a>.
END
bundle.description = 'Development support for <a href="http://drupal.org/">Drupal</a>.'

bundle.menu 'Drupal 7' do |main_menu|
main_menu.menu 'Hooks' do |submenu|
submenu.menu 'Custom' do |custom|
custom.command 'hook_CUSTOM'
end
submenu.menu 'aggregator' do |aggregator|
aggregator.command 'hook_aggregator_fetch'
aggregator.command 'hook_aggregator_fetch_info'
Expand Down
20 changes: 20 additions & 0 deletions drupal.ruble/commands/hooks.rb
Expand Up @@ -4903,4 +4903,24 @@
end
end

command 'hook_CUSTOM' do |cmd|
require 'functions.rb'
cmd.trigger = 'hook_CUSTOM'
cmd.invoke do |context|
moduleName = find_module_name(ENV['TM_DIRECTORY'])
options = {}
options[:title] = "Hook Name"
options[:prompt] = "What is the hook name?"
hook = Ruble::UI.request_string(options)
func = moduleName + '_' + hook
"
/**
* Implements hook_#{hook}().
*/
function #{func}() {
${1}
}"
end
end

end