Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean out deprecated rv harness, update readme

  • Loading branch information...
commit 59d2ff9342bf6103c3ab447ead435940ddd691be 1 parent f9f15a9
Mike Mondragon authored
View
3  History.txt
@@ -1,3 +1,6 @@
+== 2.0.0 / 2008-05-02
+* complete refactor
+
== 1.0.0 / 2007-07-04
* 1 major enhancement
View
49 README.txt
@@ -12,55 +12,42 @@ metaprogramming.
== FEATURES/PROBLEMS:
-Enter URL, get back even smaller URL.
+Enter URL, get back an even smaller URL.
== REQUIREMENTS:
* camping
* mime-types
* erubis
-* builder
* sqlite3-ruby
* mysql
+* alphadecimal http://github.com/JackDanger/Alphadecimal
+* deployment in RV
+ http://blog.evanweaver.com/articles/2006/12/19/rv-a-tool-for-luxurious-camping/
== INSTALL:
-* gem install hurl
-
-The Hurl will a prepopulate 3906 keys (62^1 + 62^2) when it itializes
-its database with a migration in production mode.
+* git clone git@github.com:monde/hurl.git
+* modify template erb's in templates directory to suit your desires
+* modify urchin.txt in templates directory for Google Analytics support
== Administrative
-Use the make_keys.rb script to make additional prepopulated keys. For
-instance make 238328 unique keys:
-ruby admin/make_keys.rb 3 > /tmp/hurl_keys-3.sql
-
-Make another 14776336 unique keys:
-ruby admin/make_keys.rb 4 > /tmp/hurl_keys-4.sql
-
-Then load those keys your db, the example db is named hurl:
-mysql -u root -p hurl < /tmp/hurl_keys-3.sql
-mysql -u root -p hurl < /tmp/hurl_keys-4.sql
-note: 62^4 keys takes up about 750MB disk space with the MyISAM engine.
-
-Also in the admin directory is an example RV harness, see "rv, a tool for
-luxurious camping" by Evan Weaver for more information:
+The admin directory contains an example RV harness yaml configuration file,
+see "rv, a tool for luxurious camping" by Evan Weaver for more information:
http://blog.evanweaver.com/articles/2006/12/19/rv-a-tool-for-luxurious-camping
-There is also an alternative harness called RV2 in the admin direcotry
-that is SysV init.d shell based. For its use see:
-
-http://blog.mondragon.cc/articles/2007/07/04/small-urls-with-camping
-http://blog.mondragon.cc/articles/2007/07/05/rv2-camping-on-gentoo
-
When running in testing mode Hurl will use a local SQLite3 database. When
-running in produciton mode Hurl will use a MySQL database. See the
+running in productiton mode Hurl will use a MySQL database. See the
db migration to examine how the db is tuned based on the running mode.
See http://camping.rubyforge.org/files/README.html for more information about
Camping applications.
+Original blog post announcing (deprecated HURL)
+http://blog.mondragon.cc/articles/2007/07/04/small-urls-with-camping
+http://blog.mondragon.cc/articles/2007/07/05/rv2-camping-on-gentoo
+
== Running
In testing mode:
@@ -69,7 +56,7 @@ or
camping hurl.rb
In production mode:
-see rv and RV2 notes
+see rv notes
== Test
@@ -80,12 +67,12 @@ autotest
== LICENSE:
-rv_harness.rb and rv_harness2.rb are AFL licensed works dervived from
-Evan Weaver. Everything else is MIT
+rv_harness.rb are AFL licensed works derived from Evan Weaver.
+Everything else is MIT
(The MIT License)
-Copyright (c) 2007 FIX
+Copyright (c) 2007, 2008 Mike Mondragon (mikemondragon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
4 admin/hurl_rv2.conf
@@ -1,4 +0,0 @@
-CAMPING_ENV=production
-RV2_APP_DIR=/var/www/hurl.it/hurl
-PORT=3089
-ADDRESS=127.0.0.1
View
37 admin/make_keys.rb
@@ -1,37 +0,0 @@
-require 'rubygems'
-require "#{File.dirname(__FILE__)}/../hurl"
-
-include Base62
-
-begin
- raise if ARGV.length == 0
- pow = ARGV[0].to_i
- raise if pow < 1
-rescue
- STDERR.puts "Usage, where power is 1 or greater and will be used as a power of 62:"
- STDERR.puts "ruby #{$0} POWER"
- exit 1
-end
-pow = pow - 1
-table_name = Hurl::Models::Key.table_name
-puts "/* creating #{62 ** (pow+1)} keys for the #{table_name} table */;"
-
-#puts "LOCK TABLES \`#{table_name}\` WRITE;"
-(pow...pow+1).each do |pow|
- lower = 62 ** pow
- upper = 62 ** (pow+1)
- a = (lower...upper).collect.sort_by { rand }
- values = Array.new
- a.each do |i|
- key = base62_encode(i)
- values << "('#{key}')"
- if i > 61 && i % 1000 == 0 && values.length > 0
- puts "INSERT INTO \`#{table_name}\` (\`key\`) VALUES #{values.join(', ')};"
- values.clear
- end
- end
- if values.length > 0
- puts "INSERT INTO \`#{table_name}\` (\`key\`) VALUES #{values.join(', ')};"
- end
-end
-#puts "UNLOCK TABLES;"
View
59 admin/rv2_harness.rb
@@ -1,59 +0,0 @@
-
-# Example mongrel harness for camping apps with rv2
-# based on Evan Weaver's original rv implementation:
-# http://blog.evanweaver.com/articles/2006/12/19/rv-a-tool-for-luxurious-camping
-#
-# author: Mike Mondragon
-# url: http://blog.mondragon.cc/
-# license: AFL 3.0
-
-# from the command line:
-# ruby rv_harness2.rb PORT ADDRESS
-
-require 'rubygems'
-require 'mongrel'
-require 'mongrel/camping'
-$LOAD_PATH.unshift File.dirname(__FILE__)
-
-ENV['CAMPING_ENV'] ||= 'production'
-
-LOGFILE = "#{File.dirname(__FILE__)}/mongrel.log"
-PIDFILE = "#{File.dirname(__FILE__)}/mongrel.pid"
-
-# or whatever else you want passed in
-PORT = ARGV[0].to_i
-ADDR = ARGV[1]
-
-# this is your camping app
-require 'hurl'
-app = Hurl
-
-if ENV['CAMPING_ENV'].eql?('production')
- app::Models::Base.establish_connection :adapter => 'mysql',
- :database => 'hurl',
- :host => 'localhost',
- :username => 'root',
- :password => ''
-else
- app::Models::Base.establish_connection :adapter => 'sqlite3',
- :database => 'db/hurl.db'
-end
-
-app::Models::Base.logger = Logger.new(LOGFILE) # comment me out if you don't want to log
-app::Models::Base.threaded_connections=false
-app.create
-
-config = Mongrel::Configurator.new :host => ADDR, :pid_file => PIDFILE do
- listener :port => PORT do
- uri '/', :handler => Mongrel::Camping::CampingHandler.new(app)
- # use the mongrel static server in production instead of the camping controller
- uri '/static/', :handler => Mongrel::DirHandler.new("static/")
- uri '/favicon.ico', :handler => Mongrel::Error404Handler.new('')
- setup_signals
- run
- write_pid_file
- log "#{app} available at #{ADDR}:#{PORT}"
- join
- end
-end
-
View
9 bin/hurl
@@ -5,12 +5,13 @@ rc = File.expand_path("~/.hurlrc")
config = YAML.load_file(rc)
command = ARGV[0]
case command
-when 'conditions' then data = "--data \"conditions=#{URI.escape(ARGV[1])}\""
-when 'keys' then data = "--data \"keys=#{URI.escape(ARGV[1])}\""
-when /.+/ then data = "--data \"#{ARGV[1]}\""
-else data = ''
+when /.*/
+ puts "admin command line script not functional at this time"
+ exit 1
end
+=begin
cmd = "curl --insecure -X POST -H 'Accept: text/plain' #{data} -u #{config['user']}:#{config['password']} #{config['app']}"
puts "running:\n#{cmd}"
result = `#{cmd}`
puts result
+=end
Please sign in to comment.
Something went wrong with that request. Please try again.