diff --git a/.gitignore b/.gitignore
index 923b697..3128817 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ db/*.sqlite3
log/*.log
tmp/
.sass-cache/
+nbproject/
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..98fc067
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# 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__)
+
+Simpledns::Application.load_tasks
diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png
new file mode 100644
index 0000000..d5edc04
Binary files /dev/null and b/app/assets/images/rails.png differ
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
new file mode 100644
index 0000000..d1bd28c
--- /dev/null
+++ b/app/assets/javascripts/application.js
@@ -0,0 +1,10 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require pjax
+//= require active_scaffold
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
new file mode 100644
index 0000000..4e3e0d4
--- /dev/null
+++ b/app/assets/stylesheets/application.css
@@ -0,0 +1,16 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require web_app_theme
+ *= require active_scaffold
+*/
+
+#main .block .content h2 {
+ margin-left: 0;
+}
+
+#main .block .content .active-scaffold-header h2 {
+ font-size: 200%;
+}
diff --git a/app/assets/stylesheets/web_app_theme.css b/app/assets/stylesheets/web_app_theme.css
new file mode 100644
index 0000000..19b7668
--- /dev/null
+++ b/app/assets/stylesheets/web_app_theme.css
@@ -0,0 +1,14 @@
+/*
+ * This css will include all web-app-theme css you need
+ *
+ *= require web-app-theme/base
+ *= require web-app-theme/themes/default/style.css
+ *= require_self
+ */
+
+/* Write here your css for overriding the theme's rules */
+
+.flash .alert {
+ border: 1px solid #e0d300;
+ background-color: #ffffcc;
+}
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
new file mode 100644
index 0000000..b4b2114
--- /dev/null
+++ b/app/controllers/application_controller.rb
@@ -0,0 +1,5 @@
+class ApplicationController < ActionController::Base
+ before_filter :authenticate_user!
+ include SentientController
+ protect_from_forgery
+end
diff --git a/app/controllers/domains_controller.rb b/app/controllers/domains_controller.rb
new file mode 100644
index 0000000..fdbb737
--- /dev/null
+++ b/app/controllers/domains_controller.rb
@@ -0,0 +1,4 @@
+class DomainsController < ApplicationController
+ active_scaffold :domain do |conf|
+ end
+end
diff --git a/app/controllers/records_controller.rb b/app/controllers/records_controller.rb
new file mode 100644
index 0000000..e670c17
--- /dev/null
+++ b/app/controllers/records_controller.rb
@@ -0,0 +1,4 @@
+class RecordsController < ApplicationController
+ active_scaffold :record do |conf|
+ end
+end
diff --git a/app/controllers/supermasters_controller.rb b/app/controllers/supermasters_controller.rb
new file mode 100644
index 0000000..156bc03
--- /dev/null
+++ b/app/controllers/supermasters_controller.rb
@@ -0,0 +1,4 @@
+class SupermastersController < ApplicationController
+ active_scaffold :supermaster do |conf|
+ end
+end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
new file mode 100644
index 0000000..bd17d72
--- /dev/null
+++ b/app/helpers/application_helper.rb
@@ -0,0 +1,17 @@
+module ApplicationHelper
+
+ # for each record in the rails flash this
+ # function wraps the message in an appropriate div
+ # and displays it
+ def flash_display(clazz = '')
+ flashes = flash.select{|key, msg| msg.present?}.collect { |key, msg|
+ content_tag :div, (content_tag :p, msg), :class => "message #{key}"
+ }.join
+ if flashes.present?
+ content_tag :div, flashes.html_safe, :class => clazz
+ else
+ nil
+ end
+ end
+
+end
diff --git a/app/helpers/domains_helper.rb b/app/helpers/domains_helper.rb
new file mode 100644
index 0000000..0f906cb
--- /dev/null
+++ b/app/helpers/domains_helper.rb
@@ -0,0 +1,2 @@
+module DomainsHelper
+end
\ No newline at end of file
diff --git a/app/helpers/records_helper.rb b/app/helpers/records_helper.rb
new file mode 100644
index 0000000..4493314
--- /dev/null
+++ b/app/helpers/records_helper.rb
@@ -0,0 +1,2 @@
+module RecordsHelper
+end
\ No newline at end of file
diff --git a/app/helpers/supermasters_helper.rb b/app/helpers/supermasters_helper.rb
new file mode 100644
index 0000000..c4d185b
--- /dev/null
+++ b/app/helpers/supermasters_helper.rb
@@ -0,0 +1,2 @@
+module SupermastersHelper
+end
\ No newline at end of file
diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/app/models/.gitkeep b/app/models/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/app/models/domain.rb b/app/models/domain.rb
new file mode 100644
index 0000000..be603d3
--- /dev/null
+++ b/app/models/domain.rb
@@ -0,0 +1,2 @@
+class Domain < ActiveRecord::Base
+end
diff --git a/app/models/record.rb b/app/models/record.rb
new file mode 100644
index 0000000..f77ac9f
--- /dev/null
+++ b/app/models/record.rb
@@ -0,0 +1,2 @@
+class Record < ActiveRecord::Base
+end
diff --git a/app/models/supermaster.rb b/app/models/supermaster.rb
new file mode 100644
index 0000000..d8a4e95
--- /dev/null
+++ b/app/models/supermaster.rb
@@ -0,0 +1,2 @@
+class Supermaster < ActiveRecord::Base
+end
diff --git a/app/models/user.rb b/app/models/user.rb
new file mode 100644
index 0000000..a6e1f89
--- /dev/null
+++ b/app/models/user.rb
@@ -0,0 +1,16 @@
+class User < ActiveRecord::Base
+ include SentientUser
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :encryptable, :timeoutable and :omniauthable
+ devise :database_authenticatable,
+ :registerable,
+ :recoverable,
+ :rememberable,
+ :trackable,
+ :validatable,
+ :confirmable,
+ :lockable
+
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
+end
diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb
new file mode 100644
index 0000000..b7ae403
--- /dev/null
+++ b/app/views/devise/confirmations/new.html.erb
@@ -0,0 +1,12 @@
+
Resend confirmation instructions
+
+<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+ <%= devise_error_messages! %>
+
+ <%= f.label :email %>
+ <%= f.email_field :email %>
+
+ <%= f.submit "Resend confirmation instructions" %>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb
new file mode 100644
index 0000000..a6ea8ca
--- /dev/null
+++ b/app/views/devise/mailer/confirmation_instructions.html.erb
@@ -0,0 +1,5 @@
+Welcome <%= @resource.email %>!
+
+You can confirm your account through the link below:
+
+<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>
diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb
new file mode 100644
index 0000000..ae9e888
--- /dev/null
+++ b/app/views/devise/mailer/reset_password_instructions.html.erb
@@ -0,0 +1,8 @@
+Hello <%= @resource.email %>!
+
+Someone has requested a link to change your password, and you can do this through the link below.
+
+<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>
+
+If you didn't request this, please ignore this email.
+Your password won't change until you access the link above and create a new one.
diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb
new file mode 100644
index 0000000..2263c21
--- /dev/null
+++ b/app/views/devise/mailer/unlock_instructions.html.erb
@@ -0,0 +1,7 @@
+Hello <%= @resource.email %>!
+
+Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
+
+Click the link below to unlock your account:
+
+<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb
new file mode 100644
index 0000000..e75c937
--- /dev/null
+++ b/app/views/devise/passwords/edit.html.erb
@@ -0,0 +1,16 @@
+Change your password
+
+<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+ <%= devise_error_messages! %>
+ <%= f.hidden_field :reset_password_token %>
+
+ <%= f.label :password, "New password" %>
+ <%= f.password_field :password %>
+
+ <%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation %>
+
+ <%= f.submit "Change my password" %>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb
new file mode 100644
index 0000000..6c21e9f
--- /dev/null
+++ b/app/views/devise/passwords/new.html.erb
@@ -0,0 +1,12 @@
+Forgot your password?
+
+<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
+ <%= devise_error_messages! %>
+
+ <%= f.label :email %>
+ <%= f.email_field :email %>
+
+ <%= f.submit "Send me reset password instructions" %>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
new file mode 100644
index 0000000..b1b1bdb
--- /dev/null
+++ b/app/views/devise/registrations/edit.html.erb
@@ -0,0 +1,35 @@
+
+
+
+
Edit <%= resource_name.to_s.humanize %>
+
+
+
+
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+ <%= devise_error_messages! %>
+
+
<%= f.label :email %>
+ <%= f.email_field :email %>
+
+
<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password %>
+
+
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+
+
<%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>
+
+
<%= f.submit "Update" %>
+ <% end %>
+
+
Cancel my account
+
+
Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.
+
+ <%= link_to "Back", :back %>
+
+
+
+
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb
new file mode 100644
index 0000000..2b03b47
--- /dev/null
+++ b/app/views/devise/registrations/new.html.erb
@@ -0,0 +1,26 @@
+
+
+
Sign up
+
+
+
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+ <%= devise_error_messages! %>
+
+
<%= f.label :email %>
+ <%= f.email_field :email %>
+
+
<%= f.label :password %>
+ <%= f.password_field :password %>
+
+
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+
+
<%= f.submit "Sign up" %>
+ <% end %>
+
+ <%= render :partial => "devise/shared/links" %>
+
+
+
+
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
new file mode 100644
index 0000000..6324fb1
--- /dev/null
+++ b/app/views/devise/sessions/new.html.erb
@@ -0,0 +1,24 @@
+
+
+
Sign in
+
+
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+
<%= f.label :email %>
+ <%= f.email_field :email %>
+
+
<%= f.label :password %>
+ <%= f.password_field :password %>
+
+ <% if devise_mapping.rememberable? -%>
+
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
+ <% end -%>
+
+
<%= f.submit "Sign in" %>
+ <% end %>
+
+ <%= render :partial => "devise/shared/links" %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb
new file mode 100644
index 0000000..eab783a
--- /dev/null
+++ b/app/views/devise/shared/_links.erb
@@ -0,0 +1,25 @@
+<%- if controller_name != 'sessions' %>
+ <%= link_to "Sign in", new_session_path(resource_name) %>
+<% end -%>
+
+<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
+ <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end -%>
+
+<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end -%>
+
+<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end -%>
+
+<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end -%>
+
+<%- if devise_mapping.omniauthable? %>
+ <%- resource_class.omniauth_providers.each do |provider| %>
+ <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb
new file mode 100644
index 0000000..c6cdcfe
--- /dev/null
+++ b/app/views/devise/unlocks/new.html.erb
@@ -0,0 +1,12 @@
+Resend unlock instructions
+
+<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
+ <%= devise_error_messages! %>
+
+ <%= f.label :email %>
+ <%= f.email_field :email %>
+
+ <%= f.submit "Resend unlock instructions" %>
+<% end %>
+
+<%= render :partial => "devise/shared/links" %>
\ No newline at end of file
diff --git a/app/views/fragments/_bottom.html.erb b/app/views/fragments/_bottom.html.erb
new file mode 100644
index 0000000..ce8bb6a
--- /dev/null
+++ b/app/views/fragments/_bottom.html.erb
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/app/views/fragments/_sidebar.html.erb b/app/views/fragments/_sidebar.html.erb
new file mode 100644
index 0000000..14c97d3
--- /dev/null
+++ b/app/views/fragments/_sidebar.html.erb
@@ -0,0 +1,12 @@
+
\ No newline at end of file
diff --git a/app/views/fragments/_top.html.erb b/app/views/fragments/_top.html.erb
new file mode 100644
index 0000000..1c70894
--- /dev/null
+++ b/app/views/fragments/_top.html.erb
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/app/views/fragments/_user_navigation.html.erb b/app/views/fragments/_user_navigation.html.erb
new file mode 100644
index 0000000..f92fcfb
--- /dev/null
+++ b/app/views/fragments/_user_navigation.html.erb
@@ -0,0 +1,9 @@
+
+ <% if user_signed_in? %>
+ - <%= link_to('Account', edit_user_registration_path) %>
+ - <%= link_to('Sign out', destroy_user_session_path, :method => :delete) %>
+ <% else %>
+ - <%= link_to('Sign up', new_user_registration_path) %>
+ - <%= link_to('Sign in', new_user_session_path) %>
+ <% end %>
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
new file mode 100644
index 0000000..8e625e3
--- /dev/null
+++ b/app/views/layouts/application.html.erb
@@ -0,0 +1,35 @@
+
+
+
+ Simple DNS
+ <%= stylesheet_link_tag "application" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tag %>
+
+
+
+
+ <%= render :partial => 'fragments/top' %>
+
+ <%= flash_display 'flash' %>
+
+ <%= render :partial => 'fragments/sidebar' %>
+
+ <%= render :partial => 'fragments/bottom' %>
+
+
+
+
diff --git a/app/views/layouts/devise.html.erb b/app/views/layouts/devise.html.erb
new file mode 100644
index 0000000..b11e0e7
--- /dev/null
+++ b/app/views/layouts/devise.html.erb
@@ -0,0 +1,23 @@
+
+
+
+ Simple DNS
+ <%= stylesheet_link_tag "application" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tag %>
+
+
+
+
+ <%= render :partial => 'fragments/top' %>
+
+ <%= flash_display 'flash' %>
+
+ <%= yield %>
+
+
+ <%= render :partial => 'fragments/bottom' %>
+
+
+
+
diff --git a/config.ru b/config.ru
new file mode 100644
index 0000000..c8650ad
--- /dev/null
+++ b/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Simpledns::Application
diff --git a/config/application.rb b/config/application.rb
new file mode 100644
index 0000000..b309469
--- /dev/null
+++ b/config/application.rb
@@ -0,0 +1,57 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require *Rails.groups(:assets => %w(development test))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
+
+module Simpledns
+ 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
+
+ # 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]
+
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+
+ config.to_prepare do
+ Devise::SessionsController.layout "devise"
+ Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "application" : "devise" }
+ Devise::ConfirmationsController.layout "devise"
+ Devise::UnlocksController.layout "devise"
+ Devise::PasswordsController.layout "devise"
+ end
+
+ end
+end
diff --git a/config/boot.rb b/config/boot.rb
new file mode 100644
index 0000000..4489e58
--- /dev/null
+++ b/config/boot.rb
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/database.yml b/config/database.yml
new file mode 100644
index 0000000..51a4dd4
--- /dev/null
+++ b/config/database.yml
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
+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:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644
index 0000000..7c798a6
--- /dev/null
+++ b/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Simpledns::Application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
new file mode 100644
index 0000000..c336287
--- /dev/null
+++ b/config/environments/development.rb
@@ -0,0 +1,34 @@
+Simpledns::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ config.action_mailer.raise_delivery_errors = true
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.smtp_settings = {:address => "localhost", :port => 1025}
+
+end
diff --git a/config/environments/production.rb b/config/environments/production.rb
new file mode 100644
index 0000000..8a2e91f
--- /dev/null
+++ b/config/environments/production.rb
@@ -0,0 +1,60 @@
+Simpledns::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
+
+ # Specifies the header that your server uses for sending files
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
diff --git a/config/environments/test.rb b/config/environments/test.rb
new file mode 100644
index 0000000..19aca52
--- /dev/null
+++ b/config/environments/test.rb
@@ -0,0 +1,42 @@
+Simpledns::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
+ # Log error messages when you accidentally call methods on nil
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # 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
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+
+ # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
+ config.assets.allow_debugging = true
+end
diff --git a/config/initializers/active_scaffold.rb b/config/initializers/active_scaffold.rb
new file mode 100644
index 0000000..32e1f84
--- /dev/null
+++ b/config/initializers/active_scaffold.rb
@@ -0,0 +1,6 @@
+ActiveScaffold.js_framework = :jquery
+
+ActiveScaffold.set_defaults do |conf|
+ # conf.security.default_permission = false
+ ActiveScaffold::Config::Mark.mark_all_mode = :page
+end
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
new file mode 100644
index 0000000..59385cd
--- /dev/null
+++ b/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
new file mode 100644
index 0000000..a494a5b
--- /dev/null
+++ b/config/initializers/devise.rb
@@ -0,0 +1,211 @@
+# Use this hook to configure devise mailer, warden hooks and so forth. The first
+# four configuration values can also be set straight in your models.
+Devise.setup do |config|
+ # ==> Mailer Configuration
+ # Configure the e-mail address which will be shown in Devise::Mailer,
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
+
+ # Configure the class responsible to send e-mails.
+ # config.mailer = "Devise::Mailer"
+
+ # ==> ORM configuration
+ # Load and configure the ORM. Supports :active_record (default) and
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
+ # available as additional gems.
+ require 'devise/orm/active_record'
+
+ # ==> Configuration for any authentication mechanism
+ # Configure which keys are used when authenticating a user. The default is
+ # just :email. You can configure it to use [:username, :subdomain], so for
+ # authenticating a user, both parameters are required. Remember that those
+ # parameters are used only when authenticating and not when retrieving from
+ # session. If you need permissions, you should implement that in a before filter.
+ # You can also supply a hash where the value is a boolean determining whether
+ # or not authentication should be aborted when the value is not present.
+ # config.authentication_keys = [ :email ]
+
+ # Configure parameters from the request object used for authentication. Each entry
+ # given should be a request method and it will automatically be passed to the
+ # find_for_authentication method and considered in your model lookup. For instance,
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
+ # config.request_keys = []
+
+ # Configure which authentication keys should be case-insensitive.
+ # These keys will be downcased upon creating or modifying a user and when used
+ # to authenticate or find a user. Default is :email.
+ config.case_insensitive_keys = [ :email ]
+
+ # Configure which authentication keys should have whitespace stripped.
+ # These keys will have whitespace before and after removed upon creating or
+ # modifying a user and when used to authenticate or find a user. Default is :email.
+ config.strip_whitespace_keys = [ :email ]
+
+ # Tell if authentication through request.params is enabled. True by default.
+ # config.params_authenticatable = true
+
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
+ # config.http_authenticatable = false
+
+ # If http headers should be returned for AJAX requests. True by default.
+ # config.http_authenticatable_on_xhr = true
+
+ # The realm used in Http Basic Authentication. "Application" by default.
+ # config.http_authentication_realm = "Application"
+
+ # It will change confirmation, password recovery and other workflows
+ # to behave the same regardless if the e-mail provided was right or wrong.
+ # Does not affect registerable.
+ # config.paranoid = true
+
+ # ==> Configuration for :database_authenticatable
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
+ # using other encryptors, it sets how many times you want the password re-encrypted.
+ #
+ # Limiting the stretches to just one in testing will increase the performance of
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
+ # a value less than 10 in other environments.
+ config.stretches = Rails.env.test? ? 1 : 10
+
+ # Setup a pepper to generate the encrypted password.
+ # config.pepper = "4e26db4e43573a80f2101e6aa59f13e0e39b899705eaddcb2259b0e7cb654a7e006385742175fb0676b84a26ab6f82f993e013388fa6d8624f8242a2142d920f"
+
+ # ==> Configuration for :confirmable
+ # The time you want to give your user to confirm his account. During this time
+ # he will be able to access your application without confirming. Default is 0.days
+ # When confirm_within is zero, the user won't be able to sign in without confirming.
+ # You can use this to let your user access some features of your application
+ # without confirming the account, but blocking it after a certain period
+ # (ie 2 days).
+ # config.confirm_within = 2.days
+
+ # Defines which key will be used when confirming an account
+ # config.confirmation_keys = [ :email ]
+
+ # ==> Configuration for :rememberable
+ # The time the user will be remembered without asking for credentials again.
+ # config.remember_for = 2.weeks
+
+ # If true, a valid remember token can be re-used between multiple browsers.
+ # config.remember_across_browsers = true
+
+ # If true, extends the user's remember period when remembered via cookie.
+ # config.extend_remember_period = false
+
+ # If true, uses the password salt as remember token. This should be turned
+ # to false if you are not using database authenticatable.
+ config.use_salt_as_remember_token = true
+
+ # Options to be passed to the created cookie. For instance, you can set
+ # :secure => true in order to force SSL only cookies.
+ # config.cookie_options = {}
+
+ # ==> Configuration for :validatable
+ # Range for password length. Default is 6..128.
+ # config.password_length = 6..128
+
+ # Email regex used to validate email formats. It simply asserts that
+ # an one (and only one) @ exists in the given string. This is mainly
+ # to give user feedback and not to assert the e-mail validity.
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
+
+ # ==> Configuration for :timeoutable
+ # The time you want to timeout the user session without activity. After this
+ # time the user will be asked for credentials again. Default is 30 minutes.
+ # config.timeout_in = 30.minutes
+
+ # ==> Configuration for :lockable
+ # Defines which strategy will be used to lock an account.
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
+ # :none = No lock strategy. You should handle locking by yourself.
+ # config.lock_strategy = :failed_attempts
+
+ # Defines which key will be used when locking and unlocking an account
+ # config.unlock_keys = [ :email ]
+
+ # Defines which strategy will be used to unlock an account.
+ # :email = Sends an unlock link to the user email
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
+ # :both = Enables both strategies
+ # :none = No unlock strategy. You should handle unlocking by yourself.
+ # config.unlock_strategy = :both
+
+ # Number of authentication tries before locking an account if lock_strategy
+ # is failed attempts.
+ # config.maximum_attempts = 20
+
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
+ # config.unlock_in = 1.hour
+
+ # ==> Configuration for :recoverable
+ #
+ # Defines which key will be used when recovering the password for an account
+ # config.reset_password_keys = [ :email ]
+
+ # Time interval you can reset your password with a reset password key.
+ # Don't put a too small interval or your users won't have the time to
+ # change their passwords.
+ config.reset_password_within = 2.hours
+
+ # ==> Configuration for :encryptable
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
+ # REST_AUTH_SITE_KEY to pepper)
+ # config.encryptor = :sha512
+
+ # ==> Configuration for :token_authenticatable
+ # Defines name of the authentication token params key
+ # config.token_authentication_key = :auth_token
+
+ # If true, authentication through token does not store user in session and needs
+ # to be supplied on each request. Useful if you are using the token as API token.
+ # config.stateless_token = false
+
+ # ==> Scopes configuration
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
+ # "users/sessions/new". It's turned off by default because it's slower if you
+ # are using only default views.
+ # config.scoped_views = false
+
+ # Configure the default scope given to Warden. By default it's the first
+ # devise role declared in your routes (usually :user).
+ # config.default_scope = :user
+
+ # Configure sign_out behavior.
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
+ # The default is true, which means any logout action will sign out all active scopes.
+ # config.sign_out_all_scopes = true
+
+ # ==> Navigation configuration
+ # Lists the formats that should be treated as navigational. Formats like
+ # :html, should redirect to the sign in page when the user does not have
+ # access, but formats like :xml or :json, should return 401.
+ #
+ # If you have any extra navigational formats, like :iphone or :mobile, you
+ # should add them to the navigational formats lists.
+ #
+ # The :"*/*" and "*/*" formats below is required to match Internet
+ # Explorer requests.
+ # config.navigational_formats = [:"*/*", "*/*", :html]
+
+ # The default HTTP method used to sign out a resource. Default is :delete.
+ config.sign_out_via = :delete
+
+ # ==> OmniAuth
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
+ # up on your models and hooks.
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
+
+ # ==> Warden configuration
+ # If you want to use other strategies, that are not supported by Devise, or
+ # change the failure app, you can configure them inside the config.warden block.
+ #
+ # config.warden do |manager|
+ # manager.failure_app = AnotherApp
+ # manager.intercept_401 = false
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
+ # end
+end
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
new file mode 100644
index 0000000..9e8b013
--- /dev/null
+++ b/config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
new file mode 100644
index 0000000..72aca7e
--- /dev/null
+++ b/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
new file mode 100644
index 0000000..d1c5c3b
--- /dev/null
+++ b/config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Simpledns::Application.config.secret_token = '0ce1f02a4b3fc4d1a1c8d22973b21e8589e9314dc338294953f0b985e3f44f12c8af74f2d9ba6f7c7bdb736c4efc5ea3f8135e23b1a036d033cd23331383ac75'
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
new file mode 100644
index 0000000..57dcbed
--- /dev/null
+++ b/config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Simpledns::Application.config.session_store :cookie_store, key: '_simpledns_session'
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rails generate session_migration")
+# Simpledns::Application.config.session_store :active_record_store
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644
index 0000000..999df20
--- /dev/null
+++ b/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
new file mode 100644
index 0000000..b182635
--- /dev/null
+++ b/config/locales/devise.en.yml
@@ -0,0 +1,58 @@
+# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
+
+en:
+ errors:
+ messages:
+ expired: "has expired, please request a new one"
+ not_found: "not found"
+ already_confirmed: "was already confirmed, please try signing in"
+ not_locked: "was not locked"
+ not_saved:
+ one: "1 error prohibited this %{resource} from being saved:"
+ other: "%{count} errors prohibited this %{resource} from being saved:"
+
+ devise:
+ failure:
+ already_authenticated: 'You are already signed in.'
+ unauthenticated: 'You need to sign in or sign up before continuing.'
+ unconfirmed: 'You have to confirm your account before continuing.'
+ locked: 'Your account is locked.'
+ invalid: 'Invalid email or password.'
+ invalid_token: 'Invalid authentication token.'
+ timeout: 'Your session expired, please sign in again to continue.'
+ inactive: 'Your account was not activated yet.'
+ sessions:
+ signed_in: 'Signed in successfully.'
+ signed_out: 'Signed out successfully.'
+ passwords:
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
+ updated: 'Your password was changed successfully. You are now signed in.'
+ updated_not_active: 'Your password was changed successfully.'
+ send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
+ confirmations:
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
+ send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
+ registrations:
+ signed_up: 'Welcome! You have signed up successfully.'
+ inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
+ updated: 'You updated your account successfully.'
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
+ reasons:
+ inactive: 'inactive'
+ unconfirmed: 'unconfirmed'
+ locked: 'locked'
+ unlocks:
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
+ omniauth_callbacks:
+ success: 'Successfully authorized from %{kind} account.'
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
+ mailer:
+ confirmation_instructions:
+ subject: 'Confirmation instructions'
+ reset_password_instructions:
+ subject: 'Reset password instructions'
+ unlock_instructions:
+ subject: 'Unlock Instructions'
diff --git a/config/locales/en.yml b/config/locales/en.yml
new file mode 100644
index 0000000..179c14c
--- /dev/null
+++ b/config/locales/en.yml
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
new file mode 100644
index 0000000..5ce3ff6
--- /dev/null
+++ b/config/routes.rb
@@ -0,0 +1,73 @@
+Simpledns::Application.routes.draw do
+
+ devise_for :users
+
+ resources :domains do
+ as_routes
+ end
+ resources :records do
+ as_routes
+ end
+ resources :supermasters do
+ as_routes
+ end
+
+ root :to => lambda { |env| [200, {'Content-Type' => 'text/plain'}, ["Hello world!"]] }
+
+ # The priority is based upon order of creation:
+ # first created -> highest priority.
+
+ # Sample of regular route:
+ # match 'products/:id' => 'catalog#view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Sample resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Sample resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Sample resource route with more complex sub-resources
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', :on => :collection
+ # end
+ # end
+
+ # Sample resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+
+ # You can have the root of your site routed with "root"
+ # just remember to delete public/index.html.
+ # root :to => 'welcome#index'
+
+ # See how all your routes lay out with "rake routes"
+
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
+ # Note: This route will make all actions in every controller accessible via GET requests.
+ # match ':controller(/:action(/:id(.:format)))'
+end
diff --git a/db/migrate/20110917082609_devise_create_users.rb b/db/migrate/20110917082609_devise_create_users.rb
new file mode 100644
index 0000000..533a693
--- /dev/null
+++ b/db/migrate/20110917082609_devise_create_users.rb
@@ -0,0 +1,28 @@
+class DeviseCreateUsers < ActiveRecord::Migration
+ def self.up
+ create_table(:users) do |t|
+ t.database_authenticatable :null => false
+ t.recoverable
+ t.rememberable
+ t.trackable
+ t.confirmable
+ t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
+
+ # t.encryptable
+ # t.token_authenticatable
+
+
+ t.timestamps
+ end
+
+ add_index :users, :email, :unique => true
+ add_index :users, :reset_password_token, :unique => true
+ add_index :users, :confirmation_token, :unique => true
+ add_index :users, :unlock_token, :unique => true
+ # add_index :users, :authentication_token, :unique => true
+ end
+
+ def self.down
+ drop_table :users
+ end
+end
diff --git a/db/migrate/20110917084645_create_domains.rb b/db/migrate/20110917084645_create_domains.rb
new file mode 100644
index 0000000..cea2221
--- /dev/null
+++ b/db/migrate/20110917084645_create_domains.rb
@@ -0,0 +1,16 @@
+class CreateDomains < ActiveRecord::Migration
+ def change
+ create_table :domains do |t|
+ t.string :name, :limit => 255, :null => false
+ t.string :master, :limit => 128
+ t.integer :last_check, :limit => 50, :null => false
+ t.string :type, :limit => 6, :null => false
+ t.integer :notified_serial
+ t.string :account, :limit => 40
+
+ t.timestamps
+ end
+
+ add_index :domains, :name, :name => 'name_index'
+ end
+end
diff --git a/db/migrate/20110917084816_create_records.rb b/db/migrate/20110917084816_create_records.rb
new file mode 100644
index 0000000..0b7602a
--- /dev/null
+++ b/db/migrate/20110917084816_create_records.rb
@@ -0,0 +1,19 @@
+class CreateRecords < ActiveRecord::Migration
+ def change
+ create_table :records do |t|
+ t.references :domain
+ t.string :name, :limit => 255
+ t.string :type, :limit => 10
+ t.string :content, :limit => 255
+ t.integer :ttl
+ t.integer :prio
+ t.integer :change_date
+
+ t.timestamps
+ end
+
+ add_index :records, :name, :name => 'rec_name_index'
+ add_index :records, [:name, :type], :name => 'nametype_index'
+ add_index :records, :domain_id, :name => 'domain_id'
+ end
+end
diff --git a/db/migrate/20110917084834_create_supermasters.rb b/db/migrate/20110917084834_create_supermasters.rb
new file mode 100644
index 0000000..91f1ce7
--- /dev/null
+++ b/db/migrate/20110917084834_create_supermasters.rb
@@ -0,0 +1,11 @@
+class CreateSupermasters < ActiveRecord::Migration
+ def change
+ create_table :supermasters do |t|
+ t.string :ip, :limit => 25, :null => false
+ t.string :nameserver, :limit => 25, :null => false
+ t.string :account, :limit => 255
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 0000000..08460c4
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,79 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20110917084834) do
+
+ create_table "domains", :force => true do |t|
+ t.string "name", :null => false
+ t.string "master", :limit => 128
+ t.integer "last_check", :limit => 50, :null => false
+ t.string "type", :limit => 6, :null => false
+ t.integer "notified_serial"
+ t.string "account", :limit => 40
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "domains", ["name"], :name => "name_index"
+
+ create_table "records", :force => true do |t|
+ t.integer "domain_id"
+ t.string "name"
+ t.string "type", :limit => 10
+ t.string "content"
+ t.integer "ttl"
+ t.integer "prio"
+ t.integer "change_date"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "records", ["domain_id"], :name => "domain_id"
+ add_index "records", ["name", "type"], :name => "nametype_index"
+ add_index "records", ["name"], :name => "rec_name_index"
+
+ create_table "supermasters", :force => true do |t|
+ t.string "ip", :limit => 25, :null => false
+ t.string "nameserver", :limit => 25, :null => false
+ t.string "account"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "users", :force => true do |t|
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
+ t.string "reset_password_token"
+ t.datetime "reset_password_sent_at"
+ t.datetime "remember_created_at"
+ t.integer "sign_in_count", :default => 0
+ t.datetime "current_sign_in_at"
+ t.datetime "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.string "confirmation_token"
+ t.datetime "confirmed_at"
+ t.datetime "confirmation_sent_at"
+ t.integer "failed_attempts", :default => 0
+ t.string "unlock_token"
+ t.datetime "locked_at"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
+ add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
+
+end
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 0000000..d05092e
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1,3 @@
+User.create :email => 'user@app.com',
+ :password => 'useruser',
+ :password_confirmation => 'useruser'
diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP
new file mode 100644
index 0000000..fe41f5c
--- /dev/null
+++ b/doc/README_FOR_APP
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
diff --git a/lib/assets/.gitkeep b/lib/assets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/lib/tasks/.gitkeep b/lib/tasks/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/log/.gitkeep b/log/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 0000000..9a48320
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,26 @@
+
+
+
+ The page you were looking for doesn't exist (404)
+
+
+
+
+
+
+
The page you were looking for doesn't exist.
+
You may have mistyped the address or the page may have moved.
+
+
+
diff --git a/public/422.html b/public/422.html
new file mode 100644
index 0000000..83660ab
--- /dev/null
+++ b/public/422.html
@@ -0,0 +1,26 @@
+
+
+
+ The change you wanted was rejected (422)
+
+
+
+
+
+
+
The change you wanted was rejected.
+
Maybe you tried to change something you didn't have access to.
+
+
+
diff --git a/public/500.html b/public/500.html
new file mode 100644
index 0000000..b80307f
--- /dev/null
+++ b/public/500.html
@@ -0,0 +1,26 @@
+
+
+
+ We're sorry, but something went wrong (500)
+
+
+
+
+
+
+
We're sorry, but something went wrong.
+
We've been notified about this issue and we'll take a look at it shortly.
+
+
+
diff --git a/public/favicon.ico b/public/favicon.ico
new file mode 100644
index 0000000..e69de29
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 0000000..085187f
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,5 @@
+# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
+#
+# To ban all spiders from the entire site uncomment the next two lines:
+# User-Agent: *
+# Disallow: /
diff --git a/script/rails b/script/rails
new file mode 100755
index 0000000..f8da2cf
--- /dev/null
+++ b/script/rails
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'
diff --git a/spec/controllers/domains_controller_spec.rb b/spec/controllers/domains_controller_spec.rb
new file mode 100644
index 0000000..c1f4cb7
--- /dev/null
+++ b/spec/controllers/domains_controller_spec.rb
@@ -0,0 +1,157 @@
+require 'spec_helper'
+
+# This spec was generated by rspec-rails when you ran the scaffold generator.
+# It demonstrates how one might use RSpec to specify the controller code that
+# was generated by Rails when you ran the scaffold generator.
+#
+# It assumes that the implementation code is generated by the rails scaffold
+# generator. If you are using any extension libraries to generate different
+# controller code, this generated spec may or may not pass.
+#
+# It only uses APIs available in rails and/or rspec-rails. There are a number
+# of tools you can use to make these specs even more expressive, but we're
+# sticking to rails and rspec-rails APIs to keep things simple and stable.
+#
+# Compared to earlier versions of this generator, there is very limited use of
+# stubs and message expectations in this spec. Stubs are only used when there
+# is no simpler way to get a handle on the object needed for the example.
+# Message expectations are only used when there is no simpler way to specify
+# that an instance is receiving a specific message.
+
+describe DomainsController do
+
+ # This should return the minimal set of attributes required to create a valid
+ # Domain. As you add validations to Domain, be sure to
+ # update the return value of this method accordingly.
+ def valid_attributes
+ {}
+ end
+
+ describe "GET index" do
+ it "assigns all domains as @domains" do
+ domain = Domain.create! valid_attributes
+ get :index
+ assigns(:domains).should eq([domain])
+ end
+ end
+
+ describe "GET show" do
+ it "assigns the requested domain as @domain" do
+ domain = Domain.create! valid_attributes
+ get :show, :id => domain.id.to_s
+ assigns(:domain).should eq(domain)
+ end
+ end
+
+ describe "GET new" do
+ it "assigns a new domain as @domain" do
+ get :new
+ assigns(:domain).should be_a_new(Domain)
+ end
+ end
+
+ describe "GET edit" do
+ it "assigns the requested domain as @domain" do
+ domain = Domain.create! valid_attributes
+ get :edit, :id => domain.id.to_s
+ assigns(:domain).should eq(domain)
+ end
+ end
+
+ describe "POST create" do
+ describe "with valid params" do
+ it "creates a new Domain" do
+ expect {
+ post :create, :domain => valid_attributes
+ }.to change(Domain, :count).by(1)
+ end
+
+ it "assigns a newly created domain as @domain" do
+ post :create, :domain => valid_attributes
+ assigns(:domain).should be_a(Domain)
+ assigns(:domain).should be_persisted
+ end
+
+ it "redirects to the created domain" do
+ post :create, :domain => valid_attributes
+ response.should redirect_to(Domain.last)
+ end
+ end
+
+ describe "with invalid params" do
+ it "assigns a newly created but unsaved domain as @domain" do
+ # Trigger the behavior that occurs when invalid params are submitted
+ Domain.any_instance.stub(:save).and_return(false)
+ post :create, :domain => {}
+ assigns(:domain).should be_a_new(Domain)
+ end
+
+ it "re-renders the 'new' template" do
+ # Trigger the behavior that occurs when invalid params are submitted
+ Domain.any_instance.stub(:save).and_return(false)
+ post :create, :domain => {}
+ response.should render_template("new")
+ end
+ end
+ end
+
+ describe "PUT update" do
+ describe "with valid params" do
+ it "updates the requested domain" do
+ domain = Domain.create! valid_attributes
+ # Assuming there are no other domains in the database, this
+ # specifies that the Domain created on the previous line
+ # receives the :update_attributes message with whatever params are
+ # submitted in the request.
+ Domain.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
+ put :update, :id => domain.id, :domain => {'these' => 'params'}
+ end
+
+ it "assigns the requested domain as @domain" do
+ domain = Domain.create! valid_attributes
+ put :update, :id => domain.id, :domain => valid_attributes
+ assigns(:domain).should eq(domain)
+ end
+
+ it "redirects to the domain" do
+ domain = Domain.create! valid_attributes
+ put :update, :id => domain.id, :domain => valid_attributes
+ response.should redirect_to(domain)
+ end
+ end
+
+ describe "with invalid params" do
+ it "assigns the domain as @domain" do
+ domain = Domain.create! valid_attributes
+ # Trigger the behavior that occurs when invalid params are submitted
+ Domain.any_instance.stub(:save).and_return(false)
+ put :update, :id => domain.id.to_s, :domain => {}
+ assigns(:domain).should eq(domain)
+ end
+
+ it "re-renders the 'edit' template" do
+ domain = Domain.create! valid_attributes
+ # Trigger the behavior that occurs when invalid params are submitted
+ Domain.any_instance.stub(:save).and_return(false)
+ put :update, :id => domain.id.to_s, :domain => {}
+ response.should render_template("edit")
+ end
+ end
+ end
+
+ describe "DELETE destroy" do
+ it "destroys the requested domain" do
+ domain = Domain.create! valid_attributes
+ expect {
+ delete :destroy, :id => domain.id.to_s
+ }.to change(Domain, :count).by(-1)
+ end
+
+ it "redirects to the domains list" do
+ domain = Domain.create! valid_attributes
+ delete :destroy, :id => domain.id.to_s
+ response.should redirect_to(domains_url)
+ end
+ end
+
+end
diff --git a/spec/controllers/records_controller_spec.rb b/spec/controllers/records_controller_spec.rb
new file mode 100644
index 0000000..1acb8d6
--- /dev/null
+++ b/spec/controllers/records_controller_spec.rb
@@ -0,0 +1,157 @@
+require 'spec_helper'
+
+# This spec was generated by rspec-rails when you ran the scaffold generator.
+# It demonstrates how one might use RSpec to specify the controller code that
+# was generated by Rails when you ran the scaffold generator.
+#
+# It assumes that the implementation code is generated by the rails scaffold
+# generator. If you are using any extension libraries to generate different
+# controller code, this generated spec may or may not pass.
+#
+# It only uses APIs available in rails and/or rspec-rails. There are a number
+# of tools you can use to make these specs even more expressive, but we're
+# sticking to rails and rspec-rails APIs to keep things simple and stable.
+#
+# Compared to earlier versions of this generator, there is very limited use of
+# stubs and message expectations in this spec. Stubs are only used when there
+# is no simpler way to get a handle on the object needed for the example.
+# Message expectations are only used when there is no simpler way to specify
+# that an instance is receiving a specific message.
+
+describe RecordsController do
+
+ # This should return the minimal set of attributes required to create a valid
+ # Record. As you add validations to Record, be sure to
+ # update the return value of this method accordingly.
+ def valid_attributes
+ {}
+ end
+
+ describe "GET index" do
+ it "assigns all records as @records" do
+ record = Record.create! valid_attributes
+ get :index
+ assigns(:records).should eq([record])
+ end
+ end
+
+ describe "GET show" do
+ it "assigns the requested record as @record" do
+ record = Record.create! valid_attributes
+ get :show, :id => record.id.to_s
+ assigns(:record).should eq(record)
+ end
+ end
+
+ describe "GET new" do
+ it "assigns a new record as @record" do
+ get :new
+ assigns(:record).should be_a_new(Record)
+ end
+ end
+
+ describe "GET edit" do
+ it "assigns the requested record as @record" do
+ record = Record.create! valid_attributes
+ get :edit, :id => record.id.to_s
+ assigns(:record).should eq(record)
+ end
+ end
+
+ describe "POST create" do
+ describe "with valid params" do
+ it "creates a new Record" do
+ expect {
+ post :create, :record => valid_attributes
+ }.to change(Record, :count).by(1)
+ end
+
+ it "assigns a newly created record as @record" do
+ post :create, :record => valid_attributes
+ assigns(:record).should be_a(Record)
+ assigns(:record).should be_persisted
+ end
+
+ it "redirects to the created record" do
+ post :create, :record => valid_attributes
+ response.should redirect_to(Record.last)
+ end
+ end
+
+ describe "with invalid params" do
+ it "assigns a newly created but unsaved record as @record" do
+ # Trigger the behavior that occurs when invalid params are submitted
+ Record.any_instance.stub(:save).and_return(false)
+ post :create, :record => {}
+ assigns(:record).should be_a_new(Record)
+ end
+
+ it "re-renders the 'new' template" do
+ # Trigger the behavior that occurs when invalid params are submitted
+ Record.any_instance.stub(:save).and_return(false)
+ post :create, :record => {}
+ response.should render_template("new")
+ end
+ end
+ end
+
+ describe "PUT update" do
+ describe "with valid params" do
+ it "updates the requested record" do
+ record = Record.create! valid_attributes
+ # Assuming there are no other records in the database, this
+ # specifies that the Record created on the previous line
+ # receives the :update_attributes message with whatever params are
+ # submitted in the request.
+ Record.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
+ put :update, :id => record.id, :record => {'these' => 'params'}
+ end
+
+ it "assigns the requested record as @record" do
+ record = Record.create! valid_attributes
+ put :update, :id => record.id, :record => valid_attributes
+ assigns(:record).should eq(record)
+ end
+
+ it "redirects to the record" do
+ record = Record.create! valid_attributes
+ put :update, :id => record.id, :record => valid_attributes
+ response.should redirect_to(record)
+ end
+ end
+
+ describe "with invalid params" do
+ it "assigns the record as @record" do
+ record = Record.create! valid_attributes
+ # Trigger the behavior that occurs when invalid params are submitted
+ Record.any_instance.stub(:save).and_return(false)
+ put :update, :id => record.id.to_s, :record => {}
+ assigns(:record).should eq(record)
+ end
+
+ it "re-renders the 'edit' template" do
+ record = Record.create! valid_attributes
+ # Trigger the behavior that occurs when invalid params are submitted
+ Record.any_instance.stub(:save).and_return(false)
+ put :update, :id => record.id.to_s, :record => {}
+ response.should render_template("edit")
+ end
+ end
+ end
+
+ describe "DELETE destroy" do
+ it "destroys the requested record" do
+ record = Record.create! valid_attributes
+ expect {
+ delete :destroy, :id => record.id.to_s
+ }.to change(Record, :count).by(-1)
+ end
+
+ it "redirects to the records list" do
+ record = Record.create! valid_attributes
+ delete :destroy, :id => record.id.to_s
+ response.should redirect_to(records_url)
+ end
+ end
+
+end
diff --git a/spec/controllers/supermasters_controller_spec.rb b/spec/controllers/supermasters_controller_spec.rb
new file mode 100644
index 0000000..00e87e7
--- /dev/null
+++ b/spec/controllers/supermasters_controller_spec.rb
@@ -0,0 +1,157 @@
+require 'spec_helper'
+
+# This spec was generated by rspec-rails when you ran the scaffold generator.
+# It demonstrates how one might use RSpec to specify the controller code that
+# was generated by Rails when you ran the scaffold generator.
+#
+# It assumes that the implementation code is generated by the rails scaffold
+# generator. If you are using any extension libraries to generate different
+# controller code, this generated spec may or may not pass.
+#
+# It only uses APIs available in rails and/or rspec-rails. There are a number
+# of tools you can use to make these specs even more expressive, but we're
+# sticking to rails and rspec-rails APIs to keep things simple and stable.
+#
+# Compared to earlier versions of this generator, there is very limited use of
+# stubs and message expectations in this spec. Stubs are only used when there
+# is no simpler way to get a handle on the object needed for the example.
+# Message expectations are only used when there is no simpler way to specify
+# that an instance is receiving a specific message.
+
+describe SupermastersController do
+
+ # This should return the minimal set of attributes required to create a valid
+ # Supermaster. As you add validations to Supermaster, be sure to
+ # update the return value of this method accordingly.
+ def valid_attributes
+ {}
+ end
+
+ describe "GET index" do
+ it "assigns all supermasters as @supermasters" do
+ supermaster = Supermaster.create! valid_attributes
+ get :index
+ assigns(:supermasters).should eq([supermaster])
+ end
+ end
+
+ describe "GET show" do
+ it "assigns the requested supermaster as @supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ get :show, :id => supermaster.id.to_s
+ assigns(:supermaster).should eq(supermaster)
+ end
+ end
+
+ describe "GET new" do
+ it "assigns a new supermaster as @supermaster" do
+ get :new
+ assigns(:supermaster).should be_a_new(Supermaster)
+ end
+ end
+
+ describe "GET edit" do
+ it "assigns the requested supermaster as @supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ get :edit, :id => supermaster.id.to_s
+ assigns(:supermaster).should eq(supermaster)
+ end
+ end
+
+ describe "POST create" do
+ describe "with valid params" do
+ it "creates a new Supermaster" do
+ expect {
+ post :create, :supermaster => valid_attributes
+ }.to change(Supermaster, :count).by(1)
+ end
+
+ it "assigns a newly created supermaster as @supermaster" do
+ post :create, :supermaster => valid_attributes
+ assigns(:supermaster).should be_a(Supermaster)
+ assigns(:supermaster).should be_persisted
+ end
+
+ it "redirects to the created supermaster" do
+ post :create, :supermaster => valid_attributes
+ response.should redirect_to(Supermaster.last)
+ end
+ end
+
+ describe "with invalid params" do
+ it "assigns a newly created but unsaved supermaster as @supermaster" do
+ # Trigger the behavior that occurs when invalid params are submitted
+ Supermaster.any_instance.stub(:save).and_return(false)
+ post :create, :supermaster => {}
+ assigns(:supermaster).should be_a_new(Supermaster)
+ end
+
+ it "re-renders the 'new' template" do
+ # Trigger the behavior that occurs when invalid params are submitted
+ Supermaster.any_instance.stub(:save).and_return(false)
+ post :create, :supermaster => {}
+ response.should render_template("new")
+ end
+ end
+ end
+
+ describe "PUT update" do
+ describe "with valid params" do
+ it "updates the requested supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ # Assuming there are no other supermasters in the database, this
+ # specifies that the Supermaster created on the previous line
+ # receives the :update_attributes message with whatever params are
+ # submitted in the request.
+ Supermaster.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
+ put :update, :id => supermaster.id, :supermaster => {'these' => 'params'}
+ end
+
+ it "assigns the requested supermaster as @supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ put :update, :id => supermaster.id, :supermaster => valid_attributes
+ assigns(:supermaster).should eq(supermaster)
+ end
+
+ it "redirects to the supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ put :update, :id => supermaster.id, :supermaster => valid_attributes
+ response.should redirect_to(supermaster)
+ end
+ end
+
+ describe "with invalid params" do
+ it "assigns the supermaster as @supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ # Trigger the behavior that occurs when invalid params are submitted
+ Supermaster.any_instance.stub(:save).and_return(false)
+ put :update, :id => supermaster.id.to_s, :supermaster => {}
+ assigns(:supermaster).should eq(supermaster)
+ end
+
+ it "re-renders the 'edit' template" do
+ supermaster = Supermaster.create! valid_attributes
+ # Trigger the behavior that occurs when invalid params are submitted
+ Supermaster.any_instance.stub(:save).and_return(false)
+ put :update, :id => supermaster.id.to_s, :supermaster => {}
+ response.should render_template("edit")
+ end
+ end
+ end
+
+ describe "DELETE destroy" do
+ it "destroys the requested supermaster" do
+ supermaster = Supermaster.create! valid_attributes
+ expect {
+ delete :destroy, :id => supermaster.id.to_s
+ }.to change(Supermaster, :count).by(-1)
+ end
+
+ it "redirects to the supermasters list" do
+ supermaster = Supermaster.create! valid_attributes
+ delete :destroy, :id => supermaster.id.to_s
+ response.should redirect_to(supermasters_url)
+ end
+ end
+
+end
diff --git a/spec/helpers/domains_helper_spec.rb b/spec/helpers/domains_helper_spec.rb
new file mode 100644
index 0000000..59f9c15
--- /dev/null
+++ b/spec/helpers/domains_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the DomainsHelper. For example:
+#
+# describe DomainsHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe DomainsHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/helpers/records_helper_spec.rb b/spec/helpers/records_helper_spec.rb
new file mode 100644
index 0000000..24f9b84
--- /dev/null
+++ b/spec/helpers/records_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the RecordsHelper. For example:
+#
+# describe RecordsHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe RecordsHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/helpers/supermasters_helper_spec.rb b/spec/helpers/supermasters_helper_spec.rb
new file mode 100644
index 0000000..a7d5955
--- /dev/null
+++ b/spec/helpers/supermasters_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the SupermastersHelper. For example:
+#
+# describe SupermastersHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe SupermastersHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/domain_spec.rb b/spec/models/domain_spec.rb
new file mode 100644
index 0000000..792e493
--- /dev/null
+++ b/spec/models/domain_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe Domain do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/record_spec.rb b/spec/models/record_spec.rb
new file mode 100644
index 0000000..1db9a8d
--- /dev/null
+++ b/spec/models/record_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe Record do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/supermaster_spec.rb b/spec/models/supermaster_spec.rb
new file mode 100644
index 0000000..878f188
--- /dev/null
+++ b/spec/models/supermaster_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe Supermaster do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
new file mode 100644
index 0000000..44032b4
--- /dev/null
+++ b/spec/models/user_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe User do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/requests/domains_spec.rb b/spec/requests/domains_spec.rb
new file mode 100644
index 0000000..3e2c9d4
--- /dev/null
+++ b/spec/requests/domains_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe "Domains" do
+ describe "GET /domains" do
+ it "works! (now write some real specs)" do
+ # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
+ get domains_path
+ response.status.should be(200)
+ end
+ end
+end
diff --git a/spec/requests/records_spec.rb b/spec/requests/records_spec.rb
new file mode 100644
index 0000000..41bde8e
--- /dev/null
+++ b/spec/requests/records_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe "Records" do
+ describe "GET /records" do
+ it "works! (now write some real specs)" do
+ # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
+ get records_path
+ response.status.should be(200)
+ end
+ end
+end
diff --git a/spec/requests/supermasters_spec.rb b/spec/requests/supermasters_spec.rb
new file mode 100644
index 0000000..4bb3f40
--- /dev/null
+++ b/spec/requests/supermasters_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe "Supermasters" do
+ describe "GET /supermasters" do
+ it "works! (now write some real specs)" do
+ # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
+ get supermasters_path
+ response.status.should be(200)
+ end
+ end
+end
diff --git a/spec/routing/domains_routing_spec.rb b/spec/routing/domains_routing_spec.rb
new file mode 100644
index 0000000..ceb8f63
--- /dev/null
+++ b/spec/routing/domains_routing_spec.rb
@@ -0,0 +1,35 @@
+require "spec_helper"
+
+describe DomainsController do
+ describe "routing" do
+
+ it "routes to #index" do
+ get("/domains").should route_to("domains#index")
+ end
+
+ it "routes to #new" do
+ get("/domains/new").should route_to("domains#new")
+ end
+
+ it "routes to #show" do
+ get("/domains/1").should route_to("domains#show", :id => "1")
+ end
+
+ it "routes to #edit" do
+ get("/domains/1/edit").should route_to("domains#edit", :id => "1")
+ end
+
+ it "routes to #create" do
+ post("/domains").should route_to("domains#create")
+ end
+
+ it "routes to #update" do
+ put("/domains/1").should route_to("domains#update", :id => "1")
+ end
+
+ it "routes to #destroy" do
+ delete("/domains/1").should route_to("domains#destroy", :id => "1")
+ end
+
+ end
+end
diff --git a/spec/routing/records_routing_spec.rb b/spec/routing/records_routing_spec.rb
new file mode 100644
index 0000000..43b1e6a
--- /dev/null
+++ b/spec/routing/records_routing_spec.rb
@@ -0,0 +1,35 @@
+require "spec_helper"
+
+describe RecordsController do
+ describe "routing" do
+
+ it "routes to #index" do
+ get("/records").should route_to("records#index")
+ end
+
+ it "routes to #new" do
+ get("/records/new").should route_to("records#new")
+ end
+
+ it "routes to #show" do
+ get("/records/1").should route_to("records#show", :id => "1")
+ end
+
+ it "routes to #edit" do
+ get("/records/1/edit").should route_to("records#edit", :id => "1")
+ end
+
+ it "routes to #create" do
+ post("/records").should route_to("records#create")
+ end
+
+ it "routes to #update" do
+ put("/records/1").should route_to("records#update", :id => "1")
+ end
+
+ it "routes to #destroy" do
+ delete("/records/1").should route_to("records#destroy", :id => "1")
+ end
+
+ end
+end
diff --git a/spec/routing/supermasters_routing_spec.rb b/spec/routing/supermasters_routing_spec.rb
new file mode 100644
index 0000000..5ef72eb
--- /dev/null
+++ b/spec/routing/supermasters_routing_spec.rb
@@ -0,0 +1,35 @@
+require "spec_helper"
+
+describe SupermastersController do
+ describe "routing" do
+
+ it "routes to #index" do
+ get("/supermasters").should route_to("supermasters#index")
+ end
+
+ it "routes to #new" do
+ get("/supermasters/new").should route_to("supermasters#new")
+ end
+
+ it "routes to #show" do
+ get("/supermasters/1").should route_to("supermasters#show", :id => "1")
+ end
+
+ it "routes to #edit" do
+ get("/supermasters/1/edit").should route_to("supermasters#edit", :id => "1")
+ end
+
+ it "routes to #create" do
+ post("/supermasters").should route_to("supermasters#create")
+ end
+
+ it "routes to #update" do
+ put("/supermasters/1").should route_to("supermasters#update", :id => "1")
+ end
+
+ it "routes to #destroy" do
+ delete("/supermasters/1").should route_to("supermasters#destroy", :id => "1")
+ end
+
+ end
+end
diff --git a/spec/views/domains/edit.html.erb_spec.rb b/spec/views/domains/edit.html.erb_spec.rb
new file mode 100644
index 0000000..cd1a9e8
--- /dev/null
+++ b/spec/views/domains/edit.html.erb_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "domains/edit.html.erb" do
+ before(:each) do
+ @domain = assign(:domain, stub_model(Domain))
+ end
+
+ it "renders the edit domain form" do
+ render
+
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
+ assert_select "form", :action => domains_path(@domain), :method => "post" do
+ end
+ end
+end
diff --git a/spec/views/domains/index.html.erb_spec.rb b/spec/views/domains/index.html.erb_spec.rb
new file mode 100644
index 0000000..9b85910
--- /dev/null
+++ b/spec/views/domains/index.html.erb_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe "domains/index.html.erb" do
+ before(:each) do
+ assign(:domains, [
+ stub_model(Domain),
+ stub_model(Domain)
+ ])
+ end
+
+ it "renders a list of domains" do
+ render
+ end
+end
diff --git a/spec/views/domains/new.html.erb_spec.rb b/spec/views/domains/new.html.erb_spec.rb
new file mode 100644
index 0000000..b541e17
--- /dev/null
+++ b/spec/views/domains/new.html.erb_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "domains/new.html.erb" do
+ before(:each) do
+ assign(:domain, stub_model(Domain).as_new_record)
+ end
+
+ it "renders new domain form" do
+ render
+
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
+ assert_select "form", :action => domains_path, :method => "post" do
+ end
+ end
+end
diff --git a/spec/views/domains/show.html.erb_spec.rb b/spec/views/domains/show.html.erb_spec.rb
new file mode 100644
index 0000000..8fea694
--- /dev/null
+++ b/spec/views/domains/show.html.erb_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe "domains/show.html.erb" do
+ before(:each) do
+ @domain = assign(:domain, stub_model(Domain))
+ end
+
+ it "renders attributes in " do
+ render
+ end
+end
diff --git a/spec/views/records/edit.html.erb_spec.rb b/spec/views/records/edit.html.erb_spec.rb
new file mode 100644
index 0000000..cf34535
--- /dev/null
+++ b/spec/views/records/edit.html.erb_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "records/edit.html.erb" do
+ before(:each) do
+ @record = assign(:record, stub_model(Record))
+ end
+
+ it "renders the edit record form" do
+ render
+
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
+ assert_select "form", :action => records_path(@record), :method => "post" do
+ end
+ end
+end
diff --git a/spec/views/records/index.html.erb_spec.rb b/spec/views/records/index.html.erb_spec.rb
new file mode 100644
index 0000000..dd498f2
--- /dev/null
+++ b/spec/views/records/index.html.erb_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe "records/index.html.erb" do
+ before(:each) do
+ assign(:records, [
+ stub_model(Record),
+ stub_model(Record)
+ ])
+ end
+
+ it "renders a list of records" do
+ render
+ end
+end
diff --git a/spec/views/records/new.html.erb_spec.rb b/spec/views/records/new.html.erb_spec.rb
new file mode 100644
index 0000000..e307e1e
--- /dev/null
+++ b/spec/views/records/new.html.erb_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "records/new.html.erb" do
+ before(:each) do
+ assign(:record, stub_model(Record).as_new_record)
+ end
+
+ it "renders new record form" do
+ render
+
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
+ assert_select "form", :action => records_path, :method => "post" do
+ end
+ end
+end
diff --git a/spec/views/records/show.html.erb_spec.rb b/spec/views/records/show.html.erb_spec.rb
new file mode 100644
index 0000000..136bf64
--- /dev/null
+++ b/spec/views/records/show.html.erb_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe "records/show.html.erb" do
+ before(:each) do
+ @record = assign(:record, stub_model(Record))
+ end
+
+ it "renders attributes in
" do
+ render
+ end
+end
diff --git a/spec/views/supermasters/edit.html.erb_spec.rb b/spec/views/supermasters/edit.html.erb_spec.rb
new file mode 100644
index 0000000..b3cd96a
--- /dev/null
+++ b/spec/views/supermasters/edit.html.erb_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "supermasters/edit.html.erb" do
+ before(:each) do
+ @supermaster = assign(:supermaster, stub_model(Supermaster))
+ end
+
+ it "renders the edit supermaster form" do
+ render
+
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
+ assert_select "form", :action => supermasters_path(@supermaster), :method => "post" do
+ end
+ end
+end
diff --git a/spec/views/supermasters/index.html.erb_spec.rb b/spec/views/supermasters/index.html.erb_spec.rb
new file mode 100644
index 0000000..aa738db
--- /dev/null
+++ b/spec/views/supermasters/index.html.erb_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe "supermasters/index.html.erb" do
+ before(:each) do
+ assign(:supermasters, [
+ stub_model(Supermaster),
+ stub_model(Supermaster)
+ ])
+ end
+
+ it "renders a list of supermasters" do
+ render
+ end
+end
diff --git a/spec/views/supermasters/new.html.erb_spec.rb b/spec/views/supermasters/new.html.erb_spec.rb
new file mode 100644
index 0000000..32b7ec8
--- /dev/null
+++ b/spec/views/supermasters/new.html.erb_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "supermasters/new.html.erb" do
+ before(:each) do
+ assign(:supermaster, stub_model(Supermaster).as_new_record)
+ end
+
+ it "renders new supermaster form" do
+ render
+
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
+ assert_select "form", :action => supermasters_path, :method => "post" do
+ end
+ end
+end
diff --git a/spec/views/supermasters/show.html.erb_spec.rb b/spec/views/supermasters/show.html.erb_spec.rb
new file mode 100644
index 0000000..6f9e027
--- /dev/null
+++ b/spec/views/supermasters/show.html.erb_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe "supermasters/show.html.erb" do
+ before(:each) do
+ @supermaster = assign(:supermaster, stub_model(Supermaster))
+ end
+
+ it "renders attributes in
" do
+ render
+ end
+end
diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb
new file mode 100644
index 0000000..3fea27b
--- /dev/null
+++ b/test/performance/browsing_test.rb
@@ -0,0 +1,12 @@
+require 'test_helper'
+require 'rails/performance_test_help'
+
+class BrowsingTest < ActionDispatch::PerformanceTest
+ # Refer to the documentation for all available options
+ # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
+ # :output => 'tmp/performance', :formats => [:flat] }
+
+ def test_homepage
+ get '/'
+ end
+end
diff --git a/test/test_helper.rb b/test/test_helper.rb
new file mode 100644
index 0000000..8bf1192
--- /dev/null
+++ b/test/test_helper.rb
@@ -0,0 +1,13 @@
+ENV["RAILS_ENV"] = "test"
+require File.expand_path('../../config/environment', __FILE__)
+require 'rails/test_help'
+
+class ActiveSupport::TestCase
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
+ #
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
+ # -- they do not yet inherit this setting
+ fixtures :all
+
+ # Add more helper methods to be used by all tests here...
+end
diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/assets/stylesheets/.gitkeep b/vendor/assets/stylesheets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/plugins/.gitkeep b/vendor/plugins/.gitkeep
new file mode 100644
index 0000000..e69de29