Permalink
Browse files

initial for clojure rewrite

  • Loading branch information...
zk committed Mar 4, 2012
1 parent 67ebc78 commit 611d4d823a848edc7e3b56207689aeee716f0670
Showing 696 changed files with 144 additions and 67,606 deletions.
View
@@ -1,7 +0,0 @@
-require 'autotest/fsevent'
-require 'autotest/growl'
-
-Autotest.add_hook :initialize do |autotest|
- %w{.git .svn .hg .DS_Store ._* vendor}.each {|exception| autotest.add_exception(exception) }
- false
-end
View
@@ -1,11 +1,8 @@
-log/*
-tmp/*
-db/sphinx
-.DS_Store
-public/javascripts/cache-application.js
-public/stylesheets/cache-application.css
-coverage.data
-test/coverage
-.bundle
-config/database.yml
-tags
+/pom.xml
+*jar
+/lib
+/classes
+/native
+/.lein-failures
+/checkouts
+/.lein-deps-sum
View
@@ -1,6 +0,0 @@
-# pair.io config
-
-quickstart: rails3
-size: small
-inbound-ports: [22, 80, 443, 3000, 3443]
-
View
1 .rvmrc
@@ -1 +0,0 @@
-rvm use ruby-1.8.7-p299
View
95 Capfile
@@ -1,95 +0,0 @@
-load 'deploy' if respond_to?(:namespace) # cap2 differentiator
-Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
-
-load 'config/deploy' # remove this line to skip loading any of the default tasks
-
-after "deploy:update", :copy_database_yml
-after "deploy:update", :set_permissions
-after "deploy:update", :update_sphinx
-after "deploy:setup", :create_database
-
-task :create_database, :role => [:web, :app] do
- run "echo 'create database clojuredocs_production' | mysql -u#{db_user}"
-end
-
-task :copy_database_yml, :role => [:web, :app] do
- run "cp #{release_path}/config/database.example.yml #{release_path}/config/database.yml"
-end
-
-task :set_permissions, :role => [:web, :app] do
- run "mkdir -p #{release_path}/tmp/openids"
- run "mkdir -p #{release_path}/tmp/openids/associations"
- run "mkdir -p #{release_path}/tmp/openids/nonces"
- run "mkdir -p #{release_path}/tmp/openids/temp"
- run "chown -R nobody #{release_path}/tmp"
- run "chown -R nobody #{release_path}/public"
- run "touch #{release_path}/log/production.log"
- run "chmod 0666 #{release_path}/log/production.log"
-end
-
-namespace :bundler do
- task :create_symlink, :roles => :app do
- shared_dir = File.join(shared_path, 'bundle')
- release_dir = File.join(current_release, '.bundle')
- run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}")
- end
-
- task :bundle_new_release, :roles => :app do
- bundler.create_symlink
- run "cd #{release_path} && /opt/ruby-enterprise/bin/bundle install --without test"
- end
-end
-
-after 'deploy:update_code', 'bundler:bundle_new_release'
-
-task :update_sphinx, :role => [:web, :app] do
- run("killall searchd; true")
- run("cd #{deploy_to}/current && #{rake} thinking_sphinx:rebuild RAILS_ENV=production")
-end
-
-require 'yaml'
-
-desc "Backup the remote production database"
-task :backup, :roles => :db, :only => { :primary => true } do
- filename = "#{application.downcase}.dump.#{Time.now.to_i}.sql.bz2"
- file = "/tmp/#{filename}"
- on_rollback { run "rm -f #{file}" }
- db = YAML::load(ERB.new(IO.read(File.join(File.dirname(__FILE__), './config/database.yml'))).result)['production']
- run "mysqldump -u #{db['username']} #{db['database']} | bzip2 -c > #{file}" do |ch, stream, data|
- puts data
- end
- `mkdir -p ~/.#{application.downcase}_db_backups`
- get file, File.expand_path("~/.#{application.downcase}_db_backups/#{filename}")
- run "rm -f #{file}"
-end
-
-desc "Backup the database before running migrations"
-before 'deploy:migrate', :backup
-
-task :clean_dump, :roles => :db do
- filename = "unprotected_dump.sql"
- file = "/tmp/#{filename}"
- on_rollback { run "rm -f #{file}" }
- db = YAML::load(ERB.new(IO.read(File.join(File.dirname(__FILE__), './config/database.yml'))).result)['production']
- run "echo 'create database clean_temp;' | mysql -u root"
- run "mysqldump -u root clojuredocs_production > #{file}"
- run "mysql -uroot clean_temp < #{file}"
-
- run "rm -f #{file}"
-
- run "echo 'use clean_temp; UPDATE users set login = MD5(RAND()), email = MD5(RAND()), openid_identifier = MD5(RAND()), password_salt = MD5(RAND()), crypted_password = MD5(RAND());' | mysql -u root"
-
- filename = "clojuredocs_clean_dump.#{Time.now.to_i}.sql.bz2"
- file = "/tmp/#{filename}"
-
- run "mysqldump -u root clean_temp | bzip2 -c > #{file}" do |ch, stream, data|
- puts data
- end
- run "echo 'drop database clean_temp;' | mysql -u root"
-
- `mkdir -p ~/.#{application.downcase}_db_backups`
- get file, File.expand_path("~/.#{application.downcase}_db_backups/#{filename}")
- run "rm -f #{file}"
-
-end
-
View
22 Gemfile
@@ -1,22 +0,0 @@
-source 'http://rubygems.org'
-
-gem 'rake', '0.8.7'
-gem 'rails', '2.3.5'
-gem 'ruby-openid', '2.1.7'
-gem 'rack-openid', '1.0.3', :require => nil
-gem 'mysql', '2.8.1'
-gem 'rubytree', '0.7.0'
-
-gem 'rdiscount', '1.6.5'
-gem 'chronic', '0.2.3'
-gem 'will_paginate', '2.3.12'
-gem 'levenshtein', '0.2.0'
-gem 'capistrano', '2.5.19'
-
-group :test do
- gem 'shoulda', '2.11.3'
- gem 'flexmock', '0.8.7'
- gem 'ZenTest', '4.4.0'
- gem 'rcov', '0.9.9', :require => nil
- gem 'ruby-prof', '0.9.2'
-end
View
@@ -1,79 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- ZenTest (4.4.0)
- actionmailer (2.3.5)
- actionpack (= 2.3.5)
- actionpack (2.3.5)
- activesupport (= 2.3.5)
- rack (~> 1.0.0)
- activerecord (2.3.5)
- activesupport (= 2.3.5)
- activeresource (2.3.5)
- activesupport (= 2.3.5)
- activesupport (2.3.5)
- capistrano (2.5.19)
- highline
- net-scp (>= 1.0.0)
- net-sftp (>= 2.0.0)
- net-ssh (>= 2.0.14)
- net-ssh-gateway (>= 1.0.0)
- chronic (0.2.3)
- hoe (>= 1.2.1)
- flexmock (0.8.7)
- highline (1.6.1)
- hoe (2.6.2)
- rake (>= 0.8.7)
- rubyforge (>= 2.0.4)
- json_pure (1.4.6)
- levenshtein (0.2.0)
- mysql (2.8.1)
- net-scp (1.0.4)
- net-ssh (>= 1.99.1)
- net-sftp (2.0.5)
- net-ssh (>= 2.0.9)
- net-ssh (2.0.23)
- net-ssh-gateway (1.0.1)
- net-ssh (>= 1.99.1)
- rack (1.0.1)
- rack-openid (1.0.3)
- rack (>= 0.4)
- ruby-openid (>= 2.1.6)
- rails (2.3.5)
- actionmailer (= 2.3.5)
- actionpack (= 2.3.5)
- activerecord (= 2.3.5)
- activeresource (= 2.3.5)
- activesupport (= 2.3.5)
- rake (>= 0.8.3)
- rake (0.8.7)
- rcov (0.9.9)
- rdiscount (1.6.5)
- ruby-openid (2.1.7)
- ruby-prof (0.9.2)
- rubyforge (2.0.4)
- json_pure (>= 1.1.7)
- rubytree (0.7.0)
- shoulda (2.11.3)
- will_paginate (2.3.12)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- ZenTest (= 4.4.0)
- capistrano (= 2.5.19)
- chronic (= 0.2.3)
- flexmock (= 0.8.7)
- levenshtein (= 0.2.0)
- mysql (= 2.8.1)
- rack-openid (= 1.0.3)
- rails (= 2.3.5)
- rake (= 0.8.7)
- rcov (= 0.9.9)
- rdiscount (= 1.6.5)
- ruby-openid (= 2.1.7)
- ruby-prof (= 0.9.2)
- rubytree (= 0.7.0)
- shoulda (= 2.11.3)
- will_paginate (= 2.3.12)
View
@@ -1,45 +1,9 @@
-# ClojureDocs Web App
+# clojuredocs
-[ClojureDocs](http://clojuredocs.org) is a community powered documentation and examples repository designed to aid clojurists of all skill levels in groking clojure core and third party libraries.
+## Usage
-The alpha version of ClojureDocs was released on July 9th, 2010. See the [original mailing list post](http://groups.google.com/group/clojure/browse_thread/thread/a97d472679f2cade/810b73543fd6a2a5?q=clojuredocs&lnk=ol&) for more information.
-
-ClojureDocs consists of three main projects: this website, the [library importer](https://github.com/zkim/clojuredocs-analyzer), and the [external API](http://github.com/dakrone/cd-wsapi.git).
-
-## Requirements
-* Ruby 1.8.7 & Rails 2.1.5.
-* MySQL 5.1
-* bundler
-* Sphinx 0.9.9
-* RVM - not required, but highly suggested.
-
-## Getting Started
-* Open up a terminal.
-* Clone the repo: `git clone https://github.com/zkim/clojuredocs.git`
-* `cd clojuredocs`
-* Copy the database template: `cp ./config/database.example.yml ./config/database.yml`
-* Install required gems: `bundle install`
-* Create the required databases: `echo 'create database clojuredocs_development; create database clojuredocs_test' | mysql -uroot`
-* Run database migrations: `rake db:migrate`
-* Start the dev server: `script/server`
-* Navigate to `http://localhost:3000`
-
-
-This will give you a pristine working version of ClojureDocs. Not very interesting without data, so lets import some:
-
-* Download the latest [database export](https://github.com/zkim/clojuredocs/downloads)
-* Import the database: `mysql -uroot clojuredocs_development < downloaded_export_file`
-* Refresh `http://localhost:3000`
-
-Enabling search requires sphinx
-
-* Download `http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz`
-* Unzip and cd into the sphinx directory
-* `./configure`
-* `make`
-* `sudo make install`
-* Back in the clojuredocs project directory: `rake thinking_sphinx:rebuild` This will index the database and start the sphinx search daemon.
+## License
+Copyright (C) 2010-2012 Zachary Kim
-## License
-ClojureDocs is licensed under the EPL v1.0 http://opensource.org/licenses/eclipse-1.0.php
+Distributed under the Eclipse Public License, the same as Clojure.
View
@@ -1,67 +0,0 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
-
-require 'digest/sha1'
-
-puts ENV['RAILS_ENV']
-
-
-def sha1(s)
- Digest::SHA1.hexdigest(s) if s
-end
-
-if ENV['RAILS_ENV'] != 'production'
-
- require 'rcov/rcovtask'
-
- namespace :test do
- namespace :coverage do
- desc "Delete aggregate coverage data."
- task(:clean) { rm_f "coverage.data" }
- end
- desc 'Aggregate code coverage for unit, functional and integration tests'
- task :coverage => "test:coverage:clean"
- %w[unit functional integration].each do |target|
- namespace :coverage do
- Rcov::RcovTask.new(target) do |t|
- t.libs << "test"
- t.test_files = FileList["test/#{target}/*_test.rb"]
- t.output_dir = "test/coverage/#{target}"
- t.verbose = true
- t.rcov_opts << '--rails --aggregate coverage.data --exclude "gems,cc_quick_ref\.rb"'
- end
- end
- task :coverage => "test:coverage:#{target}"
- end
- end
-
- desc "Anonymize user table."
- namespace :db do
- task :clean => :environment do
-
- # Need to do this with reflection
- User.find_each do |u|
- u.login = sha1 u.login
- u.email = "#{sha1(u.email)}@clojuredocs.org"
- u.crypted_password = sha1 u.crypted_password
- u.password_salt = sha1 u.password_salt
- u.persistence_token = sha1 u.persistence_token
- u.current_login_ip = sha1 u.current_login_ip
- u.last_login_ip = sha1 u.last_login_ip
- u.openid_identifier = nil
- u.save(false)
- end
-
- end
- end
-
-end
-
Oops, something went wrong.

0 comments on commit 611d4d8

Please sign in to comment.