Skip to content
Browse files

Moved everything into doo_hickies and added a todo markdown

  • Loading branch information...
1 parent 6b64e3d commit adb63b35682c37d5bd43d584d4d288370ed5a72c Brad Gessler committed Apr 1, 2009
Showing with 18 additions and 11 deletions.
  1. +10 −0 TODO.markdown
  2. +5 −0 lib/doo_hickies.rb
  3. +3 −11 shorty.rb
View
10 TODO.markdown
@@ -0,0 +1,10 @@
+= TODO
+Some stuff that I might do if I get around to it (in no particular order).
+
+ * JSON API - Build an API so people can plug these URL minifiers into their preferred services.
+ * Make all of the text boxes size to the contents in them.
+ * Get read of the difference between new and show; AJAXify the whole damn thing with jquery.
+ * Look at ditching more of the gem dependencies to make this more portable.
+ * Write some tests around this whole thing.
+ * Publish the JSON API as a microformat for all URL shortening services to adopt.
+ * Get some app developers to adopt this format so folks can drop in their own URL shortening service.
View
5 lib/doo_hickies.rb
@@ -5,6 +5,11 @@ def redirect(route={})
redirect route.values.first
end
end
+
+ def random_key
+ # Base 64 is fantastic except for the =, \, +, and / characters. Base62 anybody?
+ ActiveSupport::SecureRandom.base64(4).gsub(/\=|\\|\+|\//,'')
+ end
end
include DooHickies
View
14 shorty.rb
@@ -8,11 +8,12 @@
# Database settings. The DATABASE_URL stuff is used by Heroku
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3:///#{Dir.pwd}/shorty.db")
-# What do you want to do with the root URL? Personally, I want it to
+# What do you want to do with the root URL? Personally, I want it to
# redirect to http://bradgessler.com
redirect '/' => '/new'
-# Ok, you probably don't need to change anything beyond this point...
+# Ok, you probably don't need to change anything beyond this point! You can
+# stop unless you're feeling like superman.
# The data model doesn't get any stupider than this folks!
class Url
@@ -29,15 +30,6 @@ class Url
validates_format :key, :as => /^[-_a-z0-9]+$/i
end
-module Shorty
- def random_key
- # Base 64 is fantastic except for the =, \, +, and / characters. Base62 anybody?
- ActiveSupport::SecureRandom.base64(4).gsub(/\=|\\|\+|\//,'')
- end
-end
-
-include Shorty
-
template :layout
get '/stylesheet.css' do

0 comments on commit adb63b3

Please sign in to comment.
Something went wrong with that request. Please try again.