include some useful tools for my own rails-projects development.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

ToolBox
=======

已经作废,还是以前学Rails的时候写的.


Example
=======
1) extend Hash
    1,cut!(arg)
    #  {"a" => 100, "b" => 200, "c" => 300}.cut! {"b" => 300, "c" => 300} #=> {"a" =>100}
    #  or .cut! "a"                                                       #=> {"b" => 200, "c" => 300}
    #  or .cut! {"d" => 300}                                              #=> {"a" => 100, "b" => 200, "c" => 300}
    #  or .cut! ["a","b"]                                                 #=> {"c" => 300}

    2,draw_out(arg)
    #{"a" => 100, "b" => 200}.draw_out("a")                               #=> {"a" => 100 }
    #or .draw_out(["a","b","c"])                                          #=> {"a" => 100, "b" => 200}

2) extend ActionView::Helpers
    2,table_for(*args,&proc)
    # <% table_for(:caption=>'caption',:col => 'col',:colgroup => 'colgroup',:id => 'table') do %>
      <% t_tr :id => 'ttr' do %>
        <% t_th("tool")%>
        <% t_td("box",:class => "hello")%>
      <% end %>
      <% tr(2,{:class => "world"},["one","two",true],["o","t"])%>
      <% end %>
      
            #=><table id='table'>
               <caption>caption</caption>
               <col :id=>"col"></col>
               <colgroup :id=>"colgroup"></colgroup>
               <tr id="ttr">
                 <th>tool</th>
                 <td :class => "hello">box<td>
               </tr>
               <tr :class => "world">
                 <th>one</th>
                 <th>two</th>
               </tr>
               <tr :class => "world">
                 <td>o</td>
                 <td>t</td>
               </tr>
               </table>



Copyright (c) 2009 [zshuaibin], released under the MIT license