Ruby On ATOM feed to identi.ca stat...

by hellekin, September 14, 2009 23:27

There are a number of probl...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
  def determine_layout
    %w(index show edit update).include?(params[:action]) ? "application" : "sessions"
  end

Ruby On Determine layout

by hellekin, September 12, 2009 02:04 Star_fullStar_fullStar_fullStar_fullStar_full

You don't even need to assi...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
4
#!/usr/bin/env ruby1.8
#
# p0wn1e is the hackerspaces.org notifier.
...

Ruby ATOM feed to identi.ca stat...

by hellekin, September 12, 2009 02:00, 2 refactorings, tagged with ruby, atom, feed, notification, bot, identica, statusnet, twitter

I want to refactor this cod...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
4
# Add this to spec/spec_helper.rb
# Use as:
#   check_route_for(:route_name => 'foo', :route_path => '/foo/:bar/baz/:quuq', :controller => 'foo', :action => 'foos', :bar => 'BAR', :quux => 'Moo')
...

Ruby On route spec'ing

by hellekin, October 28, 2008 14:52

This version is more solid

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
  def interpreted_route_path(path, params)
...

Ruby On route spec'ing

by hellekin, October 27, 2008 23:00

Here is the final final ver...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
@route_hash = { :controller => controller, :action => action }.merge(options)

Ruby On route spec'ing

by hellekin, October 27, 2008 22:37

Hmmm line 13 is wrong!

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
4
  def interpreted_route_path(path, params)
    path.gsub(/:([^\/]+)/) { |b| params[$1.to_sym] }
  end
...

Ruby On route spec'ing

by hellekin, October 27, 2008 22:31

So, here's the final versio...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
  def interpreted_route_path(path, params)
...

Ruby On route spec'ing

by hellekin, October 27, 2008 22:17

Ok, here's one solution, bu...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
  def interpreted_route_path(path, params)
...

Ruby On route spec'ing

by hellekin, October 27, 2008 22:16

Ok, here's one solution, bu...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk
1
2
3
>> path
=> "/:foo/bar/:baz"
...

Ruby route spec'ing

by hellekin, October 27, 2008 22:00, 6 refactorings, tagged with ruby rails routes

I'm trying to extract a pat...

2cfbd4a81664e5d31b4b2fd0ace83c42 Talk