Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 3ad41444a6fea695f7cf0122286dfc6ac5e693c4 Neeraj Singh committed Oct 12, 2010
Showing with 10,623 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +29 −0 Gemfile
  3. +175 −0 Gemfile.lock
  4. +5 −0 README.md
  5. +7 −0 Rakefile
  6. +3 −0 app/controllers/application_controller.rb
  7. +2 −0 app/helpers/application_helper.rb
  8. +3 −0 app/models/phone_number.rb
  9. +16 −0 app/models/user.rb
  10. +3 −0 app/models/website.rb
  11. +14 −0 app/views/layouts/application.html.erb
  12. +2 −0 autotest/discover.rb
  13. +4 −0 config.ru
  14. +42 −0 config/application.rb
  15. +13 −0 config/boot.rb
  16. +11 −0 config/cucumber.yml
  17. +25 −0 config/database.yml
  18. +5 −0 config/environment.rb
  19. +22 −0 config/environments/development.rb
  20. +49 −0 config/environments/production.rb
  21. +35 −0 config/environments/test.rb
  22. +5 −0 config/initializers/admin_data_settings.rb
  23. +7 −0 config/initializers/backtrace_silencers.rb
  24. +10 −0 config/initializers/inflections.rb
  25. +5 −0 config/initializers/mime_types.rb
  26. +7 −0 config/initializers/secret_token.rb
  27. +8 −0 config/initializers/session_store.rb
  28. +5 −0 config/locales/en.yml
  29. +9 −0 config/routes.rb
  30. +19 −0 db/migrate/20091030202259_create_users.rb
  31. +14 −0 db/migrate/20091030202348_create_phone_numbers.rb
  32. +14 −0 db/migrate/20091030202603_create_websites.rb
  33. +41 −0 db/schema.rb
  34. +21 −0 db/seeds.rb
  35. +2 −0 doc/README_FOR_APP
  36. +65 −0 features/crud.feature
  37. +29 −0 features/homepage.feature
  38. +44 −0 features/quick_search.feature
  39. +9 −0 features/step_definitions/app_steps.rb
  40. +24 −0 features/step_definitions/crud_show_steps.rb
  41. +17 −0 features/step_definitions/homepage_steps.rb
  42. +22 −0 features/step_definitions/quick_search_steps.rb
  43. +219 −0 features/step_definitions/web_steps.rb
  44. +65 −0 features/support/env.rb
  45. +33 −0 features/support/paths.rb
  46. 0 lib/tasks/.gitkeep
  47. +53 −0 lib/tasks/cucumber.rake
  48. +26 −0 public/404.html
  49. +26 −0 public/422.html
  50. +26 −0 public/500.html
  51. 0 public/favicon.ico
  52. BIN public/images/rails.png
  53. +2 −0 public/javascripts/application.js
  54. +965 −0 public/javascripts/controls.js
  55. +974 −0 public/javascripts/dragdrop.js
  56. +1,123 −0 public/javascripts/effects.js
  57. +6,001 −0 public/javascripts/prototype.js
  58. +175 −0 public/javascripts/rails.js
  59. +5 −0 public/robots.txt
  60. 0 public/stylesheets/.gitkeep
  61. +10 −0 script/cucumber
  62. +6 −0 script/rails
  63. +27 −0 spec/spec_helper.rb
  64. +15 −0 test/factories.rb
  65. +9 −0 test/performance/browsing_test.rb
  66. +13 −0 test/test_helper.rb
  67. 0 vendor/plugins/.gitkeep
@@ -0,0 +1,8 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/**/*
+vendor/ruby
+capybara*.html
+.rspec
+.rvmrc
29 Gemfile
@@ -0,0 +1,29 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.0.0'
+#gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3-ruby', :require => 'sqlite3'
+
+gem 'ruby-debug'
+
+gem 'capistrano'
+
+gem 'faker'
+
+gem 'admin_data'
+#gem 'admin_data', :git => 'git://github.com/neerajdotname/admin_data.git', :branch => 'rails3_gem'
+#gem 'admin_data', :path => '/Users/nsingh/dev/admin_data'
+
+
+group :development, :test do
+ gem 'factory_girl_rails', :git => 'git://github.com/thoughtbot/factory_girl_rails'
+ gem 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl'
+ gem 'database_cleaner'
+ gem 'shoulda'
+ gem "rspec-rails", ">= 2.0.0.beta.22"
+ gem "cucumber-rails", ">= 0.3.2"
+ gem "capybara"
+ gem "launchy"
+end
+
@@ -0,0 +1,175 @@
+GIT
+ remote: git://github.com/thoughtbot/factory_girl
+ revision: 7c649b2c85ecc05ee74a1b869a2b5d3a626d59be
+ specs:
+ factory_girl (1.3.1)
+
+GIT
+ remote: git://github.com/thoughtbot/factory_girl_rails
+ revision: 6e523f0ed79d988c2c0068059f557e47e1e23e83
+ specs:
+ factory_girl_rails (1.0)
+ factory_girl (~> 1.3)
+ rails (>= 3.0.0.beta4)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.0)
+ actionpack (= 3.0.0)
+ mail (~> 2.2.5)
+ actionpack (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.12)
+ rack-test (~> 0.5.4)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.0)
+ activesupport (= 3.0.0)
+ builder (~> 2.1.2)
+ i18n (~> 0.4.1)
+ activerecord (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ arel (~> 1.0.0)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ activesupport (3.0.0)
+ admin_data (1.0.11)
+ will_paginate (>= 3.0.pre2)
+ arel (1.0.1)
+ activesupport (~> 3.0.0)
+ builder (2.1.2)
+ 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)
+ capybara (0.3.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.3)
+ columnize (0.3.1)
+ configuration (1.1.0)
+ cucumber (0.9.0)
+ builder (~> 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.2.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ cucumber-rails (0.3.2)
+ cucumber (>= 0.8.0)
+ culerity (0.2.12)
+ database_cleaner (0.5.2)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ faker (0.3.1)
+ ffi (0.6.3)
+ rake (>= 0.8.7)
+ gherkin (2.2.4)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ trollop (~> 1.16.2)
+ highline (1.6.1)
+ i18n (0.4.1)
+ json (1.4.6)
+ json_pure (1.4.6)
+ launchy (0.3.7)
+ configuration (>= 0.0.5)
+ rake (>= 0.8.1)
+ linecache (0.43)
+ mail (2.2.6.1)
+ activesupport (>= 2.3.6)
+ mime-types
+ treetop (>= 1.4.5)
+ mime-types (1.16)
+ 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)
+ nokogiri (1.4.3.1)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.0)
+ actionmailer (= 3.0.0)
+ actionpack (= 3.0.0)
+ activerecord (= 3.0.0)
+ activeresource (= 3.0.0)
+ activesupport (= 3.0.0)
+ bundler (~> 1.0.0)
+ railties (= 3.0.0)
+ railties (3.0.0)
+ actionpack (= 3.0.0)
+ activesupport (= 3.0.0)
+ rake (>= 0.8.4)
+ thor (~> 0.14.0)
+ rake (0.8.7)
+ rspec (2.0.0.beta.22)
+ rspec-core (= 2.0.0.beta.22)
+ rspec-expectations (= 2.0.0.beta.22)
+ rspec-mocks (= 2.0.0.beta.22)
+ rspec-core (2.0.0.beta.22)
+ rspec-expectations (2.0.0.beta.22)
+ diff-lcs (>= 1.1.2)
+ rspec-mocks (2.0.0.beta.22)
+ rspec-core (= 2.0.0.beta.22)
+ rspec-expectations (= 2.0.0.beta.22)
+ rspec-rails (2.0.0.beta.22)
+ rspec (= 2.0.0.beta.22)
+ ruby-debug (0.10.3)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.3.0)
+ ruby-debug-base (0.10.3)
+ linecache (>= 0.3)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.0.28)
+ ffi (>= 0.6.1)
+ json_pure
+ rubyzip
+ shoulda (2.11.3)
+ sqlite3-ruby (1.3.1)
+ term-ansicolor (1.0.5)
+ thor (0.14.2)
+ treetop (1.4.8)
+ polyglot (>= 0.3.1)
+ trollop (1.16.2)
+ tzinfo (0.3.23)
+ will_paginate (3.0.pre2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ admin_data
+ capistrano
+ capybara
+ cucumber-rails (>= 0.3.2)
+ database_cleaner
+ factory_girl!
+ factory_girl_rails!
+ faker
+ launchy
+ rails (= 3.0.0)
+ rspec-rails (>= 2.0.0.beta.22)
+ ruby-debug
+ shoulda
+ sqlite3-ruby
@@ -0,0 +1,5 @@
+# This app contains test files for Rails3 compliant version of admin_data gem#
+
+# How do I run test?
+* bundle install
+* bundle exec cucumber
@@ -0,0 +1,7 @@
+# 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'
+
+AdminDataDemo::Application.load_tasks
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,3 @@
+class PhoneNumber < ActiveRecord::Base
+ belongs_to :user
+end
@@ -0,0 +1,16 @@
+class User < ActiveRecord::Base
+ default_scope :order => 'id'
+
+ serialize :data
+
+ has_many :phone_numbers
+ has_one :website
+
+ validates_presence_of :first_name, :age
+ validates_numericality_of :age
+
+ def to_param
+ "#{self.id}-#{self.first_name}-#{self.last_name}".downcase.gsub(/\W/, ' ').strip.gsub(' ', '-').squeeze('-')
+ end
+
+end
@@ -0,0 +1,3 @@
+class Website < ActiveRecord::Base
+ belongs_to :user
+end
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>AdminDataDemo</title>
+ <%= stylesheet_link_tag :all %>
+ <%= javascript_include_tag :defaults %>
+ <%= csrf_meta_tag %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
@@ -0,0 +1,2 @@
+Autotest.add_discovery { "rails" }
+Autotest.add_discovery { "rspec2" }
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run AdminDataDemo::Application
@@ -0,0 +1,42 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module AdminDataDemo
+ class Application < Rails::Application
+ # 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.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
@@ -0,0 +1,13 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
@@ -0,0 +1,11 @@
+<%
+rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
+rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
+%>
+default: <%= std_opts %> features
+wip: --tags @wip:3 --wip features
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
+javascript: --tags @javascript
+
+
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# 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
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
+
+cucumber:
+ <<: *test
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+AdminDataDemo::Application.initialize!
Oops, something went wrong.

0 comments on commit 3ad4144

Please sign in to comment.