Permalink
Browse files

devise basics added

  • Loading branch information...
Fenec
Fenec committed Feb 25, 2011
1 parent 6913804 commit 7c2a3c44c79cd94a80afa1554c67b44eb482a63d
View
14 Gemfile
@@ -5,7 +5,10 @@ gem 'rails', '3.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'sqlite3'
+gem 'mysql2'
+gem 'devise'
+gem 'cancan'
+gem 'nifty-generators'
# Use unicorn as the web server
# gem 'unicorn'
@@ -26,6 +29,9 @@ gem 'sqlite3'
# 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
+ group :development, :test do
+ gem 'cucumber'
+ gem 'rspec'
+ gem 'factory_girl'
+ gem 'capybara'
+ end
View
@@ -0,0 +1,133 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.4)
+ actionpack (= 3.0.4)
+ mail (~> 2.2.15)
+ actionpack (3.0.4)
+ activemodel (= 3.0.4)
+ activesupport (= 3.0.4)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.4)
+ activesupport (= 3.0.4)
+ builder (~> 2.1.2)
+ i18n (~> 0.4)
+ activerecord (3.0.4)
+ activemodel (= 3.0.4)
+ activesupport (= 3.0.4)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.4)
+ activemodel (= 3.0.4)
+ activesupport (= 3.0.4)
+ activesupport (3.0.4)
+ arel (2.0.8)
+ bcrypt-ruby (2.1.4)
+ builder (2.1.2)
+ cancan (1.5.1)
+ capybara (0.4.1.2)
+ celerity (>= 0.7.9)
+ culerity (>= 0.2.4)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (>= 0.0.27)
+ xpath (~> 0.1.3)
+ celerity (0.8.8)
+ childprocess (0.1.7)
+ ffi (~> 0.6.3)
+ cucumber (0.10.0)
+ builder (>= 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.3.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ culerity (0.2.15)
+ devise (1.1.5)
+ bcrypt-ruby (~> 2.1.2)
+ warden (~> 1.0.2)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ factory_girl (1.3.3)
+ ffi (0.6.3)
+ rake (>= 0.8.7)
+ gherkin (2.3.3)
+ json (~> 1.4.6)
+ i18n (0.5.0)
+ json (1.4.6)
+ json_pure (1.5.1)
+ mail (2.2.15)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ mysql2 (0.2.6)
+ nifty-generators (0.4.5)
+ nokogiri (1.4.4)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rails (3.0.4)
+ actionmailer (= 3.0.4)
+ actionpack (= 3.0.4)
+ activerecord (= 3.0.4)
+ activeresource (= 3.0.4)
+ activesupport (= 3.0.4)
+ bundler (~> 1.0)
+ railties (= 3.0.4)
+ railties (3.0.4)
+ actionpack (= 3.0.4)
+ activesupport (= 3.0.4)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.5.0)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.1.3)
+ childprocess (~> 0.1.5)
+ ffi (~> 0.6.3)
+ json_pure
+ rubyzip
+ term-ansicolor (1.0.5)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.24)
+ warden (1.0.3)
+ rack (>= 1.0.0)
+ xpath (0.1.3)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ cancan
+ capybara
+ cucumber
+ devise
+ factory_girl
+ mysql2
+ nifty-generators
+ rails (= 3.0.4)
+ rspec
View
15 ROADMAP
@@ -0,0 +1,15 @@
+ADD:
+
+pagination
+sorting by date, popularity in catalog
+captcha
+user auth, profiles
+showing author for a word, rating of author
+reference. from where word was taken
+rating of a word
+adding picture
+word of a day, week, month etc
+integration with memonauts
+category separation
+search for a word/phrase
+
@@ -0,0 +1,8 @@
+class PagesController < ApplicationController
+
+ def home
+ @words_list = Word.all
+ render :action => 'home'
+ end
+
+end
@@ -0,0 +1,9 @@
+class WordsController < ApplicationController
+
+ attr_accessible :word, :definiton, :author
+
+ def add_word
+
+ end
+
+end
@@ -0,0 +1,2 @@
+module PagesHelper
+end
@@ -0,0 +1,2 @@
+module WordsHelper
+end
View
@@ -0,0 +1,9 @@
+class User < ActiveRecord::Base
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :confirmable, :lockable and :timeoutable
+ devise :database_authenticatable, :registerable,
+ :recoverable, :rememberable, :trackable, :validatable
+
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
+end
View
@@ -0,0 +1,2 @@
+class Word < ActiveRecord::Base
+end
@@ -7,8 +7,17 @@
<%= csrf_meta_tag %>
</head>
<body>
-
+<div id="container">
+<div id="user">
+ <% if user_signed_in? %>
+ <%= current_user.email %>
+ <%= link_to "Sign out", destroy_user_session_path %>
+ <% else %>
+ <%= link_to "Sign Up", new_user_registration_path %> or <%= link_to "Sign In", new_user_session_path %>
+ <% end %>
+</div>
<%= yield %>
+</div>
</body>
</html>
View
@@ -0,0 +1,15 @@
+Hi!
+This is my project that show you a list of cool english words
+
+<% for word in @words_list do %>
+<p>Word
+<%= word.word.inspect() %>
+</p>
+<p>
+Definition
+<%= word.definition.inspect() %>
+</p>
+<p>by
+</p>
+---
+<% end %>
View
@@ -1,22 +1,51 @@
-# SQLite version 3.x
-# gem install sqlite3
+# MySQL. Versions 4.1 and 5.0 are recommended.
+#
+# Install the MySQL driver:
+# gem install 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
+# This sets the ARCHFLAGS environment variable to your native architecture
+# On Windows:
+# gem install mysql
+# Choose the win32 build.
+# Install MySQL and put its /bin directory on your path.
+#
+# And be sure to use new-style password hashing:
+# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
- adapter: sqlite3
- database: db/development.sqlite3
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ database: cw_development
pool: 5
- timeout: 5000
+ username: root
+ password: admin
+# socket: /tmp/mysql.sock
# 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:
- adapter: sqlite3
- database: db/test.sqlite3
+test: &TEST
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ database: cw_test
pool: 5
- timeout: 5000
+ username: root
+ password: admin
+# socket: /tmp/mysql.sock
production:
- adapter: sqlite3
- database: db/production.sqlite3
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ database: cw_production
pool: 5
- timeout: 5000
+ username: root
+ password:
+ socket: /var/run/mysqld/mysqld.sock
+
+cucumber:
+ <<: *TEST
@@ -22,5 +22,8 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+
end
Oops, something went wrong.

0 comments on commit 7c2a3c4

Please sign in to comment.