Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

basic card generation

  • Loading branch information...
commit 571e59b3ac623ddcc8e42f6cca4c4c055e73826d 1 parent 9d74a2f
@pelle pelle authored
View
12 .gitignore
@@ -0,0 +1,12 @@
+doc
+pkg
+*.log
+.DS_Store
+log/*.log
+tmp
+.DS_Store
+db/schema.rb
+db/development_structure.sql
+config/database.yml
+db/*.sqlite3
+app/stylesheets/.sass-cache
View
1  app/controllers/application_controller.rb
@@ -2,7 +2,6 @@
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
- include Clearance::Authentication
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
View
3  app/models/user.rb
@@ -1,3 +0,0 @@
-class User < ActiveRecord::Base
- include Clearance::User
-end
View
51 config/database.yml
@@ -1,25 +1,54 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
+# PostgreSQL. Versions 7.4 and 8.x are supported.
+#
+# Install the ruby-postgres driver:
+# gem install ruby-postgres
+# On Mac OS X:
+# gem install ruby-postgres -- --include=/usr/local/pgsql
+# On Windows:
+# gem install ruby-postgres
+# Choose the win32 build.
+# Install PostgreSQL and put its /bin directory on your path.
development:
- adapter: sqlite3
- database: db/development.sqlite3
+ adapter: postgresql
+ encoding: unicode
+ database: capcard_development
pool: 5
- timeout: 5000
+# username: capcard
+# password:
+
+ # Connect on a TCP socket. Omitted by default since the client uses a
+ # domain socket that doesn't need configuration. Windows does not have
+ # domain sockets, so uncomment these lines.
+ #host: localhost
+ #port: 5432
+
+ # Schema search path. The server defaults to $user,public
+ #schema_search_path: myapp,sharedapp,public
+
+ # Minimum log levels, in increasing order:
+ # debug5, debug4, debug3, debug2, debug1,
+ # log, notice, warning, error, fatal, and panic
+ # The server defaults to notice.
+ #min_messages: warning
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &TEST
- adapter: sqlite3
- database: db/test.sqlite3
+ adapter: postgresql
+ encoding: unicode
+ database: capcard_test
pool: 5
- timeout: 5000
+# username: capcard
+# password:
production:
- adapter: sqlite3
- database: db/production.sqlite3
+ adapter: postgresql
+ encoding: unicode
+ database: capcard_production
pool: 5
- timeout: 5000
+ username: capcard
+ password:
cucumber:
<<: *TEST
View
7 config/environment.rb
@@ -7,9 +7,10 @@
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
- config.gem 'oauth', :version => '0.3.5'
- config.gem 'thoughtbot-clearance', :lib => 'clearance', :source => 'http://gems.github.com', :version => '0.6.6'
- config.gem 'haml', :lib => 'haml', :version => '2.2'
+ config.gem 'oauth', :version => '>=0.3.5'
+ config.gem 'haml', :lib => 'haml', :version => '>=2.2'
+ config.gem 'json'
+
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
View
10 config/environments/test.rb
@@ -25,4 +25,12 @@
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
-# config.active_record.schema_format = :sql
+# config.active_record.schema_format = :sql
+
+config.gem "rspec", :lib => false, :version => ">=1.2.8"
+config.gem "rspec-rails", :lib => false, :version => ">=1.2.7.1"
+config.gem "webrat", :lib => false, :version => ">=0.5.0"
+config.gem "cucumber", :lib => false, :version => ">=0.3.94"
+config.gem 'bmabey-email_spec', :lib => 'email_spec'
+config.gem "faker"
+config.gem "notahat-machinist", :lib => 'machinist', :source => 'http://gems.github.com'
View
41 config/routes.rb
@@ -1,43 +1,6 @@
ActionController::Routing::Routes.draw do |map|
- # The priority is based upon order of creation: first created -> highest priority.
-
- # Sample of regular route:
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # map.resources :products
-
- # Sample resource route with options:
- # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
-
- # Sample resource route with sub-resources:
- # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
-
- # Sample resource route with more complex sub-resources
- # map.resources :products do |products|
- # products.resources :comments
- # products.resources :sales, :collection => { :recent => :get }
- # end
-
- # Sample resource route within a namespace:
- # map.namespace :admin do |admin|
- # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
- # admin.resources :products
- # end
-
- # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
- # map.root :controller => "welcome"
-
- # See how all your routes lay out with "rake routes"
-
- # Install the default routes as the lowest priority.
- # Note: These default routes make all actions in every controller accessible via GET requests. You should
- # consider removing or commenting them out if you're using named routes and resources.
+ map.resource :card
+ map.root :controller=>"cards",:action=>"new"
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
View
21 db/migrate/20090907230352_clearance_create_users.rb
@@ -1,21 +0,0 @@
-class ClearanceCreateUsers < ActiveRecord::Migration
- def self.up
- create_table(:users) do |t|
- t.string :email
- t.string :encrypted_password, :limit => 128
- t.string :salt, :limit => 128
- t.string :confirmation_token, :limit => 128
- t.string :remember_token, :limit => 128
- t.boolean :email_confirmed, :default => false, :null => false
- t.timestamps
- end
-
- add_index :users, [:id, :confirmation_token]
- add_index :users, :email
- add_index :users, :remember_token
- end
-
- def self.down
- drop_table :users
- end
-end
View
3  features/support/env.rb
@@ -17,9 +17,12 @@
require 'webrat'
require 'cucumber/webrat/element_locator' # Lets you do table.diff!(element_at('#my_table_or_dl_or_ul_or_ol').to_table)
+require File.join(RAILS_ROOT, 'spec', 'blueprints')
+
Webrat.configure do |config|
config.mode = :rails
end
require 'cucumber/rails/rspec'
require 'webrat/core/matchers'
+require 'email_spec/cucumber'
View
8 log/development.log
@@ -1,8 +0,0 @@
- SQL (0.3ms)  SELECT name
- FROM sqlite_master
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
-
- SQL (0.1ms)  SELECT name
- FROM sqlite_master
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
-
View
0  log/production.log
No changes.
View
0  log/server.log
No changes.
View
0  log/test.log
No changes.
View
275 public/index.html
@@ -1,275 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Ruby on Rails: Welcome aboard</title>
- <style type="text/css" media="screen">
- body {
- margin: 0;
- margin-bottom: 25px;
- padding: 0;
- background-color: #f0f0f0;
- font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
- font-size: 13px;
- color: #333;
- }
-
- h1 {
- font-size: 28px;
- color: #000;
- }
-
- a {color: #03c}
- a:hover {
- background-color: #03c;
- color: white;
- text-decoration: none;
- }
-
-
- #page {
- background-color: #f0f0f0;
- width: 750px;
- margin: 0;
- margin-left: auto;
- margin-right: auto;
- }
-
- #content {
- float: left;
- background-color: white;
- border: 3px solid #aaa;
- border-top: none;
- padding: 25px;
- width: 500px;
- }
-
- #sidebar {
- float: right;
- width: 175px;
- }
-
- #footer {
- clear: both;
- }
-
-
- #header, #about, #getting-started {
- padding-left: 75px;
- padding-right: 30px;
- }
-
-
- #header {
- background-image: url("images/rails.png");
- background-repeat: no-repeat;
- background-position: top left;
- height: 64px;
- }
- #header h1, #header h2 {margin: 0}
- #header h2 {
- color: #888;
- font-weight: normal;
- font-size: 16px;
- }
-
-
- #about h3 {
- margin: 0;
- margin-bottom: 10px;
- font-size: 14px;
- }
-
- #about-content {
- background-color: #ffd;
- border: 1px solid #fc0;
- margin-left: -11px;
- }
- #about-content table {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 11px;
- border-collapse: collapse;
- }
- #about-content td {
- padding: 10px;
- padding-top: 3px;
- padding-bottom: 3px;
- }
- #about-content td.name {color: #555}
- #about-content td.value {color: #000}
-
- #about-content.failure {
- background-color: #fcc;
- border: 1px solid #f00;
- }
- #about-content.failure p {
- margin: 0;
- padding: 10px;
- }
-
-
- #getting-started {
- border-top: 1px solid #ccc;
- margin-top: 25px;
- padding-top: 15px;
- }
- #getting-started h1 {
- margin: 0;
- font-size: 20px;
- }
- #getting-started h2 {
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- color: #333;
- margin-bottom: 25px;
- }
- #getting-started ol {
- margin-left: 0;
- padding-left: 0;
- }
- #getting-started li {
- font-size: 18px;
- color: #888;
- margin-bottom: 25px;
- }
- #getting-started li h2 {
- margin: 0;
- font-weight: normal;
- font-size: 18px;
- color: #333;
- }
- #getting-started li p {
- color: #555;
- font-size: 13px;
- }
-
-
- #search {
- margin: 0;
- padding-top: 10px;
- padding-bottom: 10px;
- font-size: 11px;
- }
- #search input {
- font-size: 11px;
- margin: 2px;
- }
- #search-text {width: 170px}
-
-
- #sidebar ul {
- margin-left: 0;
- padding-left: 0;
- }
- #sidebar ul h3 {
- margin-top: 25px;
- font-size: 16px;
- padding-bottom: 10px;
- border-bottom: 1px solid #ccc;
- }
- #sidebar li {
- list-style-type: none;
- }
- #sidebar ul.links li {
- margin-bottom: 5px;
- }
-
- </style>
- <script type="text/javascript" src="javascripts/prototype.js"></script>
- <script type="text/javascript" src="javascripts/effects.js"></script>
- <script type="text/javascript">
- function about() {
- if (Element.empty('about-content')) {
- new Ajax.Updater('about-content', 'rails/info/properties', {
- method: 'get',
- onFailure: function() {Element.classNames('about-content').add('failure')},
- onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})}
- });
- } else {
- new Effect[Element.visible('about-content') ?
- 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25});
- }
- }
-
- window.onload = function() {
- $('search-text').value = '';
- $('search').onsubmit = function() {
- $('search-text').value = 'site:rubyonrails.org ' + $F('search-text');
- }
- }
- </script>
- </head>
- <body>
- <div id="page">
- <div id="sidebar">
- <ul id="sidebar-items">
- <li>
- <form id="search" action="http://www.google.com/search" method="get">
- <input type="hidden" name="hl" value="en" />
- <input type="text" id="search-text" name="q" value="site:rubyonrails.org " />
- <input type="submit" value="Search" /> the Rails site
- </form>
- </li>
-
- <li>
- <h3>Join the community</h3>
- <ul class="links">
- <li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li>
- <li><a href="http://weblog.rubyonrails.org/">Official weblog</a></li>
- <li><a href="http://wiki.rubyonrails.org/">Wiki</a></li>
- </ul>
- </li>
-
- <li>
- <h3>Browse the documentation</h3>
- <ul class="links">
- <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
- <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
- <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
- <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
- </ul>
- </li>
- </ul>
- </div>
-
- <div id="content">
- <div id="header">
- <h1>Welcome aboard</h1>
- <h2>You&rsquo;re riding Ruby on Rails!</h2>
- </div>
-
- <div id="about">
- <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
- <div id="about-content" style="display: none"></div>
- </div>
-
- <div id="getting-started">
- <h1>Getting started</h1>
- <h2>Here&rsquo;s how to get rolling:</h2>
-
- <ol>
- <li>
- <h2>Use <tt>script/generate</tt> to create your models and controllers</h2>
- <p>To see all available options, run it without parameters.</p>
- </li>
-
- <li>
- <h2>Set up a default route and remove or rename this file</h2>
- <p>Routes are set up in config/routes.rb.</p>
- </li>
-
- <li>
- <h2>Create your database</h2>
- <p>Run <tt>rake db:migrate</tt> to create your database. If you're not using SQLite (the default), edit <tt>config/database.yml</tt> with your username and password.</p>
- </li>
- </ol>
- </div>
- </div>
-
- <div id="footer">&nbsp;</div>
- </div>
- </body>
-</html>
View
9 spec/spec_helper.rb
@@ -5,6 +5,10 @@
require 'spec/autorun'
require 'spec/rails'
+require File.dirname(__FILE__) + "/blueprints"
+require "email_spec/helpers"
+require "email_spec/matchers"
+
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -17,6 +21,11 @@
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ config.before(:each) { Sham.reset }
+
+ config.include(EmailSpec::Helpers)
+ config.include(EmailSpec::Matchers)
+
# == Fixtures
#
# You can declare fixtures for each example_group like this:
View
13 test/factories/clearance.rb
@@ -1,13 +0,0 @@
-Factory.sequence :email do |n|
- "user#{n}@example.com"
-end
-
-Factory.define :user do |user|
- user.email { Factory.next :email }
- user.password { "password" }
- user.password_confirmation { "password" }
-end
-
-Factory.define :email_confirmed_user, :parent => :user do |user|
- user.email_confirmed { true }
-end
Please sign in to comment.
Something went wrong with that request. Please try again.