Skip to content

Latest commit

 

History

History
247 lines (167 loc) · 7.28 KB

File metadata and controls

247 lines (167 loc) · 7.28 KB

UC Berkeley, School of Public Health, California Childhood Leukemia Study

As this web app is expected to be replaced by another, I will not be updating it a great deal.

I will be doing one last import of my gem functionality simply to break that last link.

  • ruby >= 1.8.7 - primarily due to the liberal use of #inject

  • rubygems

  • ImageMagick (which may require MacPorts)

    • ImageMagick is used to image manipulation

  • curl - for the installation of rvm

gem sources -a http://rubygems.org
gem sources -a http://gems.github.com
#	Copy session file.
cp config/initializers/session_store.rb.example config/initializers/session_store.rb

#	Copy and setup database file.
cp config/database.yml.example config/database.yml

#	Copy and add your own gmail credentials.
cp config/initializers/mail.rb.example config/initializers/mail.rb

rvm / jruby installation ( Installing RVM ) …

curl http://rvm.beginrescueend.com/releases/rvm-install-head | bash
#	or
sudo gem install rvm
/usr/lib/ruby/user-gems/1.8/gems/rvm-0.1.27/bin/rvm-install

# add ... 
#	if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi
# to your .bashrc
vi .bashrc
bash
rvm install jruby-1.5.1
rvm use jruby-1.5.1
# or perhaps ...
rvm --default jruby-1.5.1

For standard ruby users, install mysql gem …

#	If using mysql ...
# On Mac OS X:
#   sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
# On Mac OS X Leopard:
#   sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
# ... I had to install the mysql gem like so ...

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Everybody join hands together now to install some gems …

#
# Some gems require manual installation for one reason or another.
#
# (sudo may or may not be required or desired.
#  Usage of sudo will/may cause gem installation in /usr/lib
#  which may then require using sudo when running rake tasks
#  or other things.  `gem list` and `sudo gem list` will differ.
#  I recommend avoiding using sudo with rvm, but its your
#  kitchen.)
#
gem source -a http://rubygems.org
gem source -a http://gemcutter.org
gem source -a http://gems.github.com
sudo gem install bundler

# preferably use bunlder to install all specific gem versions
sudo bundle install

# OR with gem, which may not match versions
#

sudo gem install hpricot
sudo gem install rake -v '-0.8.7'
sudo gem install rdoc -v '~> 2'
sudo gem install rails -v '~> 2'
#
# can't rememeber what haml was for (HomeX and Surveyor)
# others will load correctly now
# sudo gem install haml 
# sudo gem install paperclip rubycas-client ssl_requirement
#
# The rest should actually install with ...
#
sudo rake gems:install
#
# This eventually crashed with ...
#
#	Error: Your application used more memory than the safety cap of 500m.
#	Specify -J-Xmx####m to increase it (#### = cap size in MB).
#	Specify -w for full OutOfMemoryError stack trace
#
# ... but a rerun continued and completed.
#
sudo rake gems:install
#
# Some gems are defined in the environments/test.rb file
#
sudo rake gems:install RAILS_ENV=test

then we continue …

#	Add your own session secret to config/initializers/session_store.rb
#	generate a 128 character hex string perfect for using as your secret.
rake secret

rake db:migrate

#	add some expected items (loads fixtures OVERWRITING some db data)
rake app:setup

script/server

#	login to your app
#	The first administrator/deputy must be created via the command line.
#	Others can be created via the command line or web app.
#
rake app:deputize uid=<Your CalNet UID>

As this app is being installed on a VM Java jruby tomcat thing, we need special instructions. Apparently, for Tomcat 5, we need to use jruby-rack-0.9.6.jar, which is included in lib/.

Tomcat will unarchive the war file and DESTROY the existing unarchived version! Any file uploads will need to be kept elsewhere.

( warble from a jruby environment to get the jruby specific gems )

[jakewendt@dev : buffler ]>
bash
rvm use jruby
warble
scp ROOT.war ccls.berkeley.edu:

[jakewendt@ccls-01]>
sudo /sbin/service tomcat5 stop
sudo su -l tomcat
/bin/rm -rf /var/lib/tomcat5/webapps/buffler
cp ~jakewendt/ROOT.war /var/lib/tomcat5/webapps/
exit

sudo /sbin/service tomcat5 start
tail -f /var/log/tomcat5/catalina.out

Kenai

Berkeley Wiki

Inline documentation is sparse and incomplete, but I’m working on it.

sudo gem install rdoc --source http://gemcutter.org
rake doc:plugins
rake doc:app
open doc/app/README_rdoc.html

Ruby Best Practices

RVM on GitHub

  • Fix expire_fragment "#{request.try(:host_with_port)}#{page_path}" so that it works without the try (not necessary)

  • Add to doc/README_FOR_APP

  • one of the images in rdoc isn’t always the correct directory depth and will create a flash error showing this

  • Make RDoc auto recognize the following rails commands and group them together under separate headings (like Public Instance Methods, Private Instance Methods, etc.)

    • named_scope

    • validate_*

    • before_*

    • after_*

    • attr_protected

    • attr_accessible

  • Make RDoc auto recognize these specific commands and group them together under user definable separate headings (like Public Instance Methods, Private Instance Methods, etc.)

* so far, rdoc_rails does everything except the Owner relationship of the Aliquot (counter_cache is causing the problem)

  • rdoc the rake tasks??

  • thickbox-compressed.js has relative location for image which isn’t always correct.

Gradient images made with Gradient Image Maker

Demo on css rounded corners

Background image gradients