-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert from nerdsnippets format to snipmate
Snippets that have nested tabstops have been left in the nerdsnippets format
- Loading branch information
Martin Grenfell
committed
Feb 21, 2009
1 parent
a547422
commit 4690ff9
Showing
42 changed files
with
73 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cattr_accessor :<+attr_names+> | ||
cattr_accessor :${1:attr_names} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
def create | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.new(params[:\<c-r>=NS_underscore(snippet_classname)\<cr>]) | ||
@${1:model_class_name} = ${2:ModelClassName}.new(params[:$1]) | ||
|
||
respond_to do |wants| | ||
if @\<c-r>=NS_underscore(snippet_classname)\<cr>.save | ||
if @$1.save | ||
flash[:notice] = '\<c-r>=snippet_classname\<cr> was successfully created.' | ||
wants.html { redirect_to(@\<c-r>=NS_underscore(snippet_classname)\<cr>) } | ||
wants.xml { render :xml => @\<c-r>=NS_underscore(snippet_classname)\<cr>, :status => :created, :location => @\<c-r>=NS_underscore(snippet_classname)\<cr> } | ||
wants.html { redirect_to(@$1) } | ||
wants.xml { render :xml => @$1, :status => :created, :location => @$1 } | ||
else | ||
wants.html { render :action => "new" } | ||
wants.xml { render :xml => @\<c-r>=NS_underscore(snippet_classname)\<cr>.errors, :status => :unprocessable_entity } | ||
wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
end${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
def destroy | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.find(params[:id]) | ||
@\<c-r>=NS_underscore(snippet_classname)\<cr>.destroy | ||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) | ||
@$1.destroy | ||
|
||
respond_to do |wants| | ||
wants.html { redirect_to(\<c-r>=NS_underscore(snippet_classname)\<cr>s_url) } | ||
wants.html { redirect_to($1s_url) } | ||
wants.xml { head :ok } | ||
end | ||
end | ||
end${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
def edit | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.find(params[:id]) | ||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
def index | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.all | ||
@${1:model_class_name} = ${2:ModelClassName}.all | ||
|
||
respond_to do |wants| | ||
wants.html # index.html.erb | ||
wants.xml { render :xml => @\<c-r>=NS_underscore(snippet_classname)\<cr>s } | ||
wants.xml { render :xml => @$1s } | ||
end | ||
end | ||
end${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
def new | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.new | ||
@${1:model_class_name} = ${2:ModelClassName}.new | ||
|
||
respond_to do |wants| | ||
wants.html # new.html.erb | ||
wants.xml { render :xml => @\<c-r>=NS_underscore(snippet_classname)\<cr> } | ||
wants.xml { render :xml => @$1 } | ||
end | ||
end | ||
end${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
def show | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.find(params[:id]) | ||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) | ||
|
||
respond_to do |wants| | ||
wants.html # show.html.erb | ||
wants.xml { render :xml => @\<c-r>=NS_underscore(snippet_classname)\<cr> } | ||
wants.xml { render :xml => @$1 } | ||
end | ||
end | ||
end${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
def update | ||
@\<c-r>=NS_underscore(NS_prompt("snippet_classname", "Model ClassName", ""))\<cr> = \<c-r>=snippet_classname\<cr>.find(params[:id]) | ||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) | ||
|
||
respond_to do |wants| | ||
if @\<c-r>=NS_underscore(snippet_classname)\<cr>.update_attributes(params[:\<c-r>=NS_underscore(snippet_classname)\<cr>]) | ||
flash[:notice] = '\<c-r>=snippet_classname\<cr> was successfully updated.' | ||
wants.html { redirect_to(@\<c-r>=NS_underscore(snippet_classname)\<cr>) } | ||
if @$1.update_attributes(params[:$1]) | ||
flash[:notice] = '$2 was successfully updated.' | ||
wants.html { redirect_to(@$1) } | ||
wants.xml { head :ok } | ||
else | ||
wants.html { render :action => "edit" } | ||
wants.xml { render :xml => @\<c-r>=NS_underscore(snippet_classname)\<cr>.errors, :status => :unprocessable_entity } | ||
wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
end${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
has_and_belongs_to_many :<+object+><+, :join_table => "<+table_name+>", :foreign_key => "<+<++>_id+>"+> | ||
has_and_belongs_to_many :${1:object}, :join_table => "${2:table_name}", :foreign_key => "${3}_id"${4} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
has_one :<+object+><+, :class_name => "<+Class+>", :foreign_key => "<+<++>_id+>"+> | ||
has_one :${1:object}, :class_name => "${2:Class}", :foreign_key => "${3:class}_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
add_column :<+table+>, :<+column+>, :<+type+> | ||
add_column :${1:table}, :${2:column}, :${3:type} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<+map+>.<+connect+> '<+controller/:action/:id+>' | ||
${1:map}.${2:connect} '${3:controller/:action/:id}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<+map+>.catch_all "*<+anything+>", :controller => "<+default+>", :action => "<+error+>" | ||
${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"${5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<+map+>.resource :<+resource+> | ||
${1:map}.resource :${2:resource} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<+map+>.resources :<+resource+> | ||
${1:map}.resources :${2:resource} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
t.column :<+title+>, :<+string+> | ||
mccc<++> | ||
t.column :${1:title}, :${2:string} | ||
mccc${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
remove_column :<+table+>, :<+column+> | ||
remove_column :${1:table}, :${2:column} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
create_table :<+table_name+> do |t| | ||
t.column :<+name+>, :<+type+> | ||
create_table :${1:table_name} do |t| | ||
t.column :${2:name}, :${3:type} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
class \<c-r>=Snippet_MigrationNameFromFilename()\<cr> < ActiveRecord::Migration | ||
class ${1:`Snippet_MigrationNameFromFilename()`} < ActiveRecord::Migration | ||
def self.up | ||
<++> | ||
${2} | ||
end | ||
|
||
def self.down | ||
<++> | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
map(&:<+id+>) | ||
map(&:${1:id}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rename_column :<+table+>, :<+old+>, :<+new+> | ||
rename_column :${1:table}, :${2:old}, :${3:new} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mattr_accessor :<+attr_names+> | ||
mattr_accessor :${1:attr_names} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :action => "<+action+>" | ||
render :action => "${1:action}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :action => "<+action+>", :layout => "<+layoutname+>" | ||
render :action => "${1:action}", :layout => "${2:layoutname}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :file => "<+filepath+>" | ||
render :file => "${1:filepath}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :file => "<+filepath+>", :use_full_path => <+false+> | ||
render :file => "${1:filepath}", :use_full_path => ${2:false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :inline => "<+<%= 'hello' %>+>", :locals => { <+:name+> => "<+value+>"<++> } | ||
render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"${4} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :inline => "<+<%= 'hello' %>+>", :type => <+:rxml+> | ||
render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :layout => "<+layoutname+>" | ||
render :layout => "${1:layoutname}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :nothing => <+true+> | ||
render :nothing => ${1:true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :nothing => <+true+>, :status => <+401+> | ||
render :nothing => ${1:true}, :status => ${2:401} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :partial => "<+item+>" | ||
render :partial => "${1:item}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :partial => "<+item+>", :status => <+500+> | ||
render :partial => "${1:item}", :status => ${2:500} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :text => "<+text to render+>" | ||
render :text => "${1:text to render}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :text => "<+text to render+>", :layout => "<+layoutname+>" | ||
render :text => "${1:text to render}", :layout => "${2:layoutname}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :text => "<+text to render+>", :layout => <+true+> | ||
render :text => "${1:text to render}", :layout => ${2:true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
render :text => "<+text to render+>", :status => <+401+> | ||
render :text => "${1:text to render}", :status => ${2:401} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
class \<c-r>=NS_prompt("snip_classname", "Model classname", "")\<cr>Sweeper < ActionController::Caching::Sweeper | ||
observe \<c-r>=snip_classname\<cr> | ||
class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper | ||
observe $1 | ||
|
||
def after_save(\<c-r>=NS_underscore(snip_classname)\<cr>) | ||
expire_cache(\<c-r>=NS_underscore(snip_classname)\<cr>) | ||
def after_save(${2:model_class_name}) | ||
expire_cache($2) | ||
end | ||
|
||
def after_destroy(\<c-r>=NS_underscore(snip_classname)\<cr>) | ||
expire_cache(\<c-r>=NS_underscore(snip_classname)\<cr>) | ||
def after_destroy($2) | ||
expire_cache($2) | ||
end | ||
|
||
def expire_cache(\<c-r>=NS_underscore(snip_classname)\<cr>) | ||
def expire_cache($2) | ||
expire_page | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
t.text :<+title+> | ||
<++> | ||
t.text :${1:title} | ||
${2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
t.time :<+title+> | ||
<++> | ||
t.time :${1:title} | ||
${2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
t.timestamp :<+title+> | ||
<++> | ||
t.timestamp :${1:title} | ||
${2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
t.timestamps | ||
<++> | ||
${1} |