Permalink
Browse files

convert from nerdsnippets format to snipmate

Snippets that have nested tabstops have been left in the nerdsnippets
format
  • Loading branch information...
1 parent a547422 commit 4690ff98d34d2750b1d8bd1648a17a53a5b1651c @scrooloose committed Feb 21, 2009
View
2 ruby-rails/crw.snippet
@@ -1 +1 @@
-cattr_accessor :<+attr_names+>
+cattr_accessor :${1:attr_names}
View
12 ruby-rails/defcreate.snippet
@@ -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}
View
8 ruby-rails/defdestroy.snippet
@@ -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}
View
2 ruby-rails/defedit.snippet
@@ -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
View
6 ruby-rails/defindex.snippet
@@ -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}
View
6 ruby-rails/defnew.snippet
@@ -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}
View
6 ruby-rails/defshow.snippet
@@ -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}
View
12 ruby-rails/defupdate.snippet
@@ -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}
View
2 ruby-rails/habtm.snippet
@@ -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}
View
2 ruby-rails/ho.snippet
@@ -1 +1 @@
-has_one :<+object+><+, :class_name => "<+Class+>", :foreign_key => "<+<++>_id+>"+>
+has_one :${1:object}, :class_name => "${2:Class}", :foreign_key => "${3:class}_id"
View
2 ruby-rails/mac.snippet
@@ -1 +1 @@
-add_column :<+table+>, :<+column+>, :<+type+>
+add_column :${1:table}, :${2:column}, :${3:type}
View
2 ruby-rails/mapc.snippet
@@ -1 +1 @@
-<+map+>.<+connect+> '<+controller/:action/:id+>'
+${1:map}.${2:connect} '${3:controller/:action/:id}'
View
2 ruby-rails/mapca.snippet
@@ -1 +1 @@
-<+map+>.catch_all "*<+anything+>", :controller => "<+default+>", :action => "<+error+>"
+${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"${5}
View
2 ruby-rails/mapr.snippet
@@ -1 +1 @@
-<+map+>.resource :<+resource+>
+${1:map}.resource :${2:resource}
View
2 ruby-rails/maprs.snippet
@@ -1 +1 @@
-<+map+>.resources :<+resource+>
+${1:map}.resources :${2:resource}
View
4 ruby-rails/mccc.snippet
@@ -1,2 +1,2 @@
-t.column :<+title+>, :<+string+>
-mccc<++>
+t.column :${1:title}, :${2:string}
+mccc${3}
View
2 ruby-rails/mcol.snippet
@@ -1 +1 @@
-remove_column :<+table+>, :<+column+>
+remove_column :${1:table}, :${2:column}
View
4 ruby-rails/mct.snippet
@@ -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
View
5 ruby-rails/migration.snippet
@@ -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
View
2 ruby-rails/mp.snippet
@@ -1 +1 @@
-map(&:<+id+>)
+map(&:${1:id})
View
2 ruby-rails/mrnc.snippet
@@ -1 +1 @@
-rename_column :<+table+>, :<+old+>, :<+new+>
+rename_column :${1:table}, :${2:old}, :${3:new}
View
2 ruby-rails/mrw.snippet
@@ -1 +1 @@
-mattr_accessor :<+attr_names+>
+mattr_accessor :${1:attr_names}
View
2 ruby-rails/ra.snippet
@@ -1 +1 @@
-render :action => "<+action+>"
+render :action => "${1:action}"
View
2 ruby-rails/ral.snippet
@@ -1 +1 @@
-render :action => "<+action+>", :layout => "<+layoutname+>"
+render :action => "${1:action}", :layout => "${2:layoutname}"
View
2 ruby-rails/rf.snippet
@@ -1 +1 @@
-render :file => "<+filepath+>"
+render :file => "${1:filepath}"
View
2 ruby-rails/rfu.snippet
@@ -1 +1 @@
-render :file => "<+filepath+>", :use_full_path => <+false+>
+render :file => "${1:filepath}", :use_full_path => ${2:false}
View
2 ruby-rails/ril.snippet
@@ -1 +1 @@
-render :inline => "<+<%= 'hello' %>+>", :locals => { <+:name+> => "<+value+>"<++> }
+render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"${4} }
View
2 ruby-rails/rit.snippet
@@ -1 +1 @@
-render :inline => "<+<%= 'hello' %>+>", :type => <+:rxml+>
+render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml}
View
2 ruby-rails/rl.snippet
@@ -1 +1 @@
-render :layout => "<+layoutname+>"
+render :layout => "${1:layoutname}"
View
2 ruby-rails/rn.snippet
@@ -1 +1 @@
-render :nothing => <+true+>
+render :nothing => ${1:true}
View
2 ruby-rails/rns.snippet
@@ -1 +1 @@
-render :nothing => <+true+>, :status => <+401+>
+render :nothing => ${1:true}, :status => ${2:401}
View
2 ruby-rails/rp.snippet
@@ -1 +1 @@
-render :partial => "<+item+>"
+render :partial => "${1:item}"
View
2 ruby-rails/rps.snippet
@@ -1 +1 @@
-render :partial => "<+item+>", :status => <+500+>
+render :partial => "${1:item}", :status => ${2:500}
View
2 ruby-rails/rt.snippet
@@ -1 +1 @@
-render :text => "<+text to render+>"
+render :text => "${1:text to render}"
View
2 ruby-rails/rtl.snippet
@@ -1 +1 @@
-render :text => "<+text to render+>", :layout => "<+layoutname+>"
+render :text => "${1:text to render}", :layout => "${2:layoutname}"
View
2 ruby-rails/rtlt.snippet
@@ -1 +1 @@
-render :text => "<+text to render+>", :layout => <+true+>
+render :text => "${1:text to render}", :layout => ${2:true}
View
2 ruby-rails/rts.snippet
@@ -1 +1 @@
-render :text => "<+text to render+>", :status => <+401+>
+render :text => "${1:text to render}", :status => ${2:401}
View
14 ruby-rails/sweeper.snippet
@@ -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
View
4 ruby-rails/tct.snippet
@@ -1,2 +1,2 @@
-t.text :<+title+>
-<++>
+t.text :${1:title}
+${2}
View
4 ruby-rails/tcti.snippet
@@ -1,2 +1,2 @@
-t.time :<+title+>
-<++>
+t.time :${1:title}
+${2}
View
4 ruby-rails/tcts.snippet
@@ -1,2 +1,2 @@
-t.timestamp :<+title+>
-<++>
+t.timestamp :${1:title}
+${2}
View
2 ruby-rails/tctss.snippet
@@ -1,2 +1,2 @@
t.timestamps
-<++>
+${1}

0 comments on commit 4690ff9

Please sign in to comment.