Changed the shebang lines to <tt>#!/usr/bin/env ruby</tt>. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:

{{{
ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*
}}}

I also failed to add the new user-related files and the new migrate task last time I committed, so those are added now.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@141 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-08-28 12:54:47 +00:00
parent 6487400f07
commit 979ae7dc27
17 changed files with 113 additions and 12 deletions

View file

@ -0,0 +1,11 @@
class UserController < ApplicationController
scaffold :user
def index
render_text "This will be our jumping-off point for managing user functions!"
end
def admin
render_text "You'll only be allowed to go here if you're an administrator."
end
end

View file

@ -0,0 +1,2 @@
module UserHelper
end

View file

@ -0,0 +1,9 @@
class AddProjectDescription < ActiveRecord::Migration
def self.up
add_column :projects, :description, :text, :default => ''
end
def self.down
remove_column :projects, :description
end
end

View file

@ -0,0 +1,56 @@
CREATE TABLE `contexts` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`position` int(11) NOT NULL default '0',
`hide` tinyint(1) default '0',
`user_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=InnoDB;
CREATE TABLE `notes` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`project_id` int(11) NOT NULL default '0',
`body` text,
`created_at` datetime default '0000-00-00 00:00:00',
`updated_at` datetime default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=InnoDB;
CREATE TABLE `projects` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`position` int(11) NOT NULL default '0',
`done` tinyint(1) default '0',
`user_id` int(11) NOT NULL default '0',
`description` text,
PRIMARY KEY (`id`)
) TYPE=InnoDB;
CREATE TABLE `schema_info` (
`version` int(11) default NULL
) TYPE=MyISAM;
CREATE TABLE `todos` (
`id` int(11) NOT NULL auto_increment,
`context_id` int(11) NOT NULL default '0',
`project_id` int(11) default NULL,
`description` varchar(255) NOT NULL default '',
`notes` text,
`done` tinyint(1) NOT NULL default '0',
`created_at` datetime default NULL,
`due` date default NULL,
`completed` datetime default NULL,
`user_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=InnoDB;
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`login` varchar(80) NOT NULL default '',
`password` varchar(40) NOT NULL default '',
`word` varchar(255) default NULL,
`is_admin` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=InnoDB;

View file

@ -25,6 +25,9 @@ Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/
8. Modify signup to prevent is_admin being set by malicious user. Begin work on standardising layout for login controller.
9. BIGGEST NEW FEATURE: Tracks is now properly multi-user, thanks to the work of Nicholas Lee. Any new users that you sign up can't view any of your next actions, contexts, projects or notes, and they get a clean slate to add their own. Great Things are planned in this direction...
10. Projects now have a description field which you can edit in the form on [tracks_url]/projects. It's optional, but you can use it to remind you of the aims or purpose of the project. If you have a description, it's displayed in italics just under the project name.
11. Included a new rake task. Call it with <tt>rake setup_tracks</tt> at the command line. This automates a lot of the work of setting up tracks, like renaming the template files (*.tmpl). However, you need to make sure that you've copied database.yml.tmpl to database.yml before you run it (and added the correct settings to the file), because rake can't run without that file in place. The task is safe to run if you're upgrading, because it ignores already converted files.
12. Changed the shebang lines to <tt>#!/usr/bin/env ruby</tt>. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*
== Version 1.03

View file

@ -46,7 +46,8 @@ In the following, I'm assuming that you're using MySQL and the built-in WEBrick
* Check over the file <tt>config/settings.yml</tt>, and make sure that the settings are to your liking.
* If you'd also like some example data to play with, you can import it from tracks_1.031_content.sql (in <tt>tracks/db</tt>). You don't have to use the example data, but if you don't, you'll need to visit <tt>http://YOURURL/contexts</tt> first to add a few contexts before you add any next actions. Note that no users are provided in the content file, so you'll need to visit the signup page (http://YOURURL/signup) to create some users.
* Check that the path to Ruby is correct in the <tt>tracks/public/dispatch.*</tt> files, and also <tt>/script/server</tt>. The default (<tt>#!/usr/bin/ruby</tt>) is fine for Mac OS X Tiger, but if you've installed Ruby yourself in <tt>/usr/local/bin</tt>, you'll need to change it.
* Check the shebang lines of the public/dispatch.* files and all the files in the script directory. They are set to <tt>#!/usr/bin/env ruby</tt> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
<tt>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</tt>
* Run the following command at your command line (<b>Important:</b> If you already have an application running on WEBrick (Tracks or anything else), make sure that you stop the server, or run Tracks on a different port using the <tt>--port</tt> option):
<tt>cd /PATHTO/TRACKS</tt>
<tt>ruby script/server -e production</tt>
@ -73,7 +74,8 @@ In the following, I'm assuming that you're using MySQL and the built-in WEBrick
* If this process reports errors that you can't fix, you'll need to adapt the instructions for manually loading the schema, given below for SQLite (schemas are also provided for MySQL and Postgresql).
* Import your old contents, and check that it looks sensible. In particular, check that the 'user_id' field in the todos, contexts and projects tables have the value of '1' (i.e. they are owned by your admin user, who should have an id of 1).
* Check that the path to Ruby is correct in the <tt>tracks/public/dispatch.*</tt> files, and also <tt>/script/server</tt>. The default (<tt>#!/usr/bin/ruby</tt>) is fine for Mac OS X Tiger, but if you've installed Ruby yourself in <tt>/usr/local/bin</tt>, you'll need to change it.
* Check the shebang lines of the public/dispatch.* files and all the files in the script directory. They are set to <tt>#!/usr/bin/env ruby</tt> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
<tt>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</tt>
* From here, follow the remaining steps for new users above to start the server. Don't forget that if you've deleted your users table, you'll need to re-create your users via <tt>/signup</tt>. Signup is now at <tt>http://0.0.0.0:3000/signup</tt>, and login at <tt>http://0.0.0.0:3000/login</tt>.
==== SQLite or SQLite3

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
if ARGV.empty?
puts "Usage: benchmarker times 'Person.expensive_way' 'Person.another_expensive_way' ..."

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
require 'rubygems'
require_gem 'rails'
require 'breakpoint_client'

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
require 'optparse'

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/environment'
require 'rails_generator'
require 'rails_generator/scripts/destroy'

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/environment'
require 'rails_generator'
require 'rails_generator/scripts/generate'

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
if ARGV.empty?
$stderr.puts "Usage: profiler 'Person.expensive_method(10)' [times]"
exit(1)

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
require 'optparse'
options = { :environment => "development" }

View file

@ -1,4 +1,4 @@
#!/usr/bin/ruby1.8
#!/usr/bin/env ruby
require 'webrick'
require 'optparse'

View file

@ -0,0 +1,18 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'user_controller'
# Re-raise errors caught by the controller.
class UserController; def rescue_action(e) raise e end; end
class UserControllerTest < Test::Unit::TestCase
def setup
@controller = UserController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
# Replace this with your real tests.
def test_truth
assert true
end
end