Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

http://heroesofruby.heroku.com/ Fork #24

Closed
wants to merge 29 commits into
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+1,668 −10,115
Split
View
@@ -0,0 +1,8 @@
+---
+:stylesheet: none
+:test: none
+:renderer: slim
+:script: jquery
+:mock: none
+:orm: activerecord
+
View
@@ -1,4 +1,6 @@
.bundle
-db/*.sqlite3
+db/rubycommitters_development.db
+db/rubycommitters_test.db
log/*.log
-tmp/**/*
+tmp/
+.sass-cache/
View
54 Gemfile
@@ -1,31 +1,23 @@
-source 'http://rubygems.org'
-
-gem 'rails', '3.0.3'
-
-# Bundle edge Rails instead:
-# gem 'rails', :git => 'git://github.com/rails/rails.git'
-
-gem 'sqlite3-ruby', :require => 'sqlite3'
-
-# Use unicorn as the web server
-# gem 'unicorn'
-
-# Deploy with Capistrano
-# gem 'capistrano'
-
-# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
-# gem 'ruby-debug'
-# gem 'ruby-debug19'
-
-# Bundle the extra gems:
-# gem 'bj'
-# gem 'nokogiri'
-# gem 'sqlite3-ruby', :require => 'sqlite3'
-# gem 'aws-s3', :require => 'aws/s3'
-
-# Bundle gems for the local environment. Make sure to
-# put test-only gems in this group so their generators
-# and rake tasks are available in development mode:
-# group :development, :test do
-# gem 'webrat'
-# end
+source :rubygems
+
+# Project requirements
+gem 'rake'
+gem 'rack-flash'
+gem 'thin', :group => :development
+
+# Component requirements
+gem 'slim', '>= 0.8.3'
+gem 'sqlite3'
+gem 'activerecord', '~> 3.0.3', :require => 'active_record'
+gem 'rack-cache', '~> 1.0', :require => 'rack/cache'
+gem 'mini_magick'
+gem 'carrierwave'
+gem 'sass'
+gem 'rdiscount'
+
+# Test requirements
+gem 'rack-test', :require => 'rack/test', :group => :test
+
+# Padrino
+gem 'sinatra', '1.1.2', :require => 'sinatra/base'
+gem 'padrino', '0.9.20'
View
@@ -1,20 +1,6 @@
GEM
remote: http://rubygems.org/
specs:
- abstract (1.0.0)
- actionmailer (3.0.3)
- actionpack (= 3.0.3)
- mail (~> 2.2.9)
- actionpack (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.4)
- rack (~> 1.2.1)
- rack-mount (~> 0.6.13)
- rack-test (~> 0.5.6)
- tzinfo (~> 0.3.23)
activemodel (3.0.3)
activesupport (= 3.0.3)
builder (~> 2.1.2)
@@ -24,50 +10,98 @@ GEM
activesupport (= 3.0.3)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
- activeresource (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
activesupport (3.0.3)
- arel (2.0.6)
+ arel (2.0.7)
builder (2.1.2)
- erubis (2.6.6)
- abstract (>= 1.0.0)
+ carrierwave (0.5.1)
+ activesupport (~> 3.0)
+ daemons (1.1.0)
+ eventmachine (0.12.10)
+ git (1.2.5)
+ http_router (0.5.2)
+ rack (>= 1.0.0)
+ url_mount (~> 0.2.1)
i18n (0.5.0)
- mail (2.2.13)
+ mail (2.2.14)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
+ mini_magick (3.2)
+ subexec (~> 0.0.4)
+ padrino (0.9.20)
+ padrino-admin (= 0.9.20)
+ padrino-core (= 0.9.20)
+ padrino-gen (= 0.9.20)
+ padrino-helpers (= 0.9.20)
+ padrino-mailer (= 0.9.20)
+ padrino-admin (0.9.20)
+ padrino-core (= 0.9.20)
+ padrino-helpers (= 0.9.20)
+ padrino-core (0.9.20)
+ activesupport (>= 3.0.0)
+ http_router (~> 0.5.0)
+ sinatra (>= 1.1.0)
+ thor (>= 0.14.3)
+ tzinfo
+ padrino-gen (0.9.20)
+ bundler (>= 1.0.2)
+ git
+ padrino-core (= 0.9.20)
+ padrino-helpers (0.9.20)
+ i18n (>= 0.4.1)
+ padrino-core (= 0.9.20)
+ padrino-mailer (0.9.20)
+ mail (>= 2.2.0)
+ padrino-core (= 0.9.20)
polyglot (0.3.1)
rack (1.2.1)
- rack-mount (0.6.13)
- rack (>= 1.0.0)
- rack-test (0.5.6)
+ rack-cache (1.0)
+ rack (>= 0.4)
+ rack-flash (0.1.1)
+ rack
+ rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.3)
- actionmailer (= 3.0.3)
- actionpack (= 3.0.3)
- activerecord (= 3.0.3)
- activeresource (= 3.0.3)
- activesupport (= 3.0.3)
- bundler (~> 1.0)
- railties (= 3.0.3)
- railties (3.0.3)
- actionpack (= 3.0.3)
- activesupport (= 3.0.3)
- rake (>= 0.8.7)
- thor (~> 0.14.4)
rake (0.8.7)
- sqlite3-ruby (1.3.2)
+ rdiscount (1.6.5)
+ sass (3.1.0.alpha.218)
+ sinatra (1.1.2)
+ rack (~> 1.1)
+ tilt (~> 1.2)
+ slim (0.8.3)
+ temple (~> 0.1.6)
+ tilt (~> 1.1)
+ sqlite3 (1.3.3)
+ subexec (0.0.4)
+ temple (0.1.7)
+ thin (1.2.7)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
thor (0.14.6)
+ tilt (1.2.2)
treetop (1.4.9)
polyglot (>= 0.3.1)
- tzinfo (0.3.23)
+ tzinfo (0.3.24)
+ url_mount (0.2.1)
+ rack
PLATFORMS
ruby
DEPENDENCIES
- rails (= 3.0.3)
- sqlite3-ruby
+ activerecord (~> 3.0.3)
+ carrierwave
+ mini_magick
+ padrino (= 0.9.20)
+ rack-cache (~> 1.0)
+ rack-flash
+ rack-test
+ rake
+ rdiscount
+ sass
+ sinatra (= 1.1.2)
+ slim (>= 0.8.3)
+ sqlite3
+ thin
@@ -1,8 +1,8 @@
-= rubycommitters.org
+# rubycommitters.org
This is the source code for the rubycommitters.org website.
-== Hacking
+## Hacking
First clone the repo:
@@ -12,10 +12,10 @@ First clone the repo:
Then import committer data
$ bundle install
- $ rake import
+ $ padrino rake import
Start your server
- $ ruby script/rails server
+ $ padrino start
Have fun hacking!
View
@@ -1,7 +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.expand_path('../config/application', __FILE__)
-require 'rake'
-
-Rubycommitters::Application.load_tasks
View
@@ -0,0 +1,50 @@
+class RubyCommitters < Padrino::Application
+ register SassInitializer
+ register Padrino::Mailer
+ register Padrino::Helpers
+
+ Slim::Engine.set_default_options :pretty => true
+
+ ##
+ # Application configuration options
+ #
+ # set :raise_errors, true # Show exceptions (default for development)
+ # set :public, "foo/bar" # Location for static assets (default root/public)
+ # set :reload, false # Reload application files (default in development)
+ # set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
+ # set :locale_path, "bar" # Set path for I18n translations (defaults to app/locale/)
+ # enable :sessions # Disabled by default
+ # disable :flash # Disables rack-flash (enabled by default if sessions)
+ # layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
+ #
+
+ ##
+ # You can configure for a specified environment like:
+ #
+ configure :production do
+ use Rack::Cache do
+ set :verbose, true
+ set :metastore, "file:cache/meta"
+ set :entitystore, "file:cache/body"
+ end
+ end
+
+ ##
+ # You can manage errors like:
+ #
+ # error 404 do
+ # render 'errors/404'
+ # end
+ #
+
+ ##
+ # site settings
+ #
+ set :site_name, 'Ruby Committers'
+ set :bios, {
+ 'matz' => {
+ :eng => %q{**Matz's English bio is coming soon!** Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},
+ :jap => %q{Matz's Japanese bio is coming soon!},
+ }
+ }
+end
@@ -1,5 +0,0 @@
-class AccountsController < ApplicationController
- def index
- @accounts = Account.find :all
- end
-end
@@ -1,3 +0,0 @@
-class ApplicationController < ActionController::Base
- protect_from_forgery
-end
View
@@ -0,0 +1,16 @@
+RubyCommitters.controllers :heroes do
+ get :index, :map => '/' do
+ @site_name = RubyCommitters.site_name
+ @heroes = Hero.all
+ @attrs = {
+ 'names' => 'names',
+ 'nicks' => 'a.k.a.',
+ 'sites' => 'sites',
+ 'books' => 'books',
+ 'services' => 'social',
+ }
+
+ cache_control :public, :max_age => 300
+ render 'heroes/index'
+ end
+end
@@ -1,22 +0,0 @@
-module AccountsHelper
- def link_to_service name, service
- case service.name
- when 'twitter'
- link_to name, 'http://twitter.com/' + service.key
- when 'friendfeed'
- link_to name, 'http://friendfeed.com/' + service.key
- when 'mixi'
- link_to name, 'http://mixi.jp/show_friend.pl?id=' + service.key
- when 'github'
- link_to name, 'http://github.com/' + service.key
- when 'facebook'
- if service.key =~ /^\s*\d+$/
- link_to name, 'http://www.facebook.com/profile.php?id=' + service.key
- else
- link_to name, 'http://www.facebook.com/' + service.key
- end
- when 'iddy'
- link_to name, 'http://iddy.jp/profile/' + service.key
- end
- end
-end
@@ -0,0 +1,22 @@
+RubyCommitters.helpers do
+ def link_to_service(name, service)
+ _link_to = Proc.new { |url| link_to service.name, url + service.key, :alt => service.name, :title => service.name }
+
+ case service.name
+ when 'twitter' then _link_to.call('http://twitter.com/')
+ when 'friendfeed' then _link_to.call('http://friendfeed.com/')
+ when 'mixi' then _link_to.call('http://show_friend.pl?id=')
+ when 'github' then _link_to.call('http://github.com/')
+ when 'iddy' then _link_to.call('http://iddy.jp/profile/')
+ when 'facebook' then _link_to.call("http://www.facebook.com/#{'profile.php?id=' if service.key =~ /^\d+$/}")
+ end
+ end
+
+ def link_to_book(isbn)
+ link_to isbn, 'http://www.google.com/search?tbs=bks:1&tbo=1&q=isbn:' + isbn
+ end
+
+ def markdownsize(text)
+ RDiscount.new(text, :autolink).to_html
+ end
+end
Oops, something went wrong.