imhotep 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. data/lib/imhotep.rb +14 -0
  2. data/lib/imhotep/config.rb +4 -0
  3. data/lib/imhotep/controllers/pages_controller.rb +42 -0
  4. data/lib/imhotep/models/page.rb +25 -0
  5. data/lib/imhotep/routes.rb +15 -0
  6. data/test/functional/pages_controller_test.rb +43 -0
  7. data/test/functional/routes_test.rb +43 -0
  8. data/test/functional/wiki_controller_test.rb +38 -0
  9. data/test/integration/edit_pages_test.rb +33 -0
  10. data/test/integration/edit_wiki_test.rb +33 -0
  11. data/test/rails_app/app/controllers/application_controller.rb +3 -0
  12. data/test/rails_app/app/controllers/home_controller.rb +2 -0
  13. data/test/rails_app/app/controllers/pages_controller.rb +3 -0
  14. data/test/rails_app/app/controllers/wiki_controller.rb +3 -0
  15. data/test/rails_app/app/helpers/application_helper.rb +2 -0
  16. data/test/rails_app/app/models/page.rb +3 -0
  17. data/test/rails_app/app/models/wiki.rb +4 -0
  18. data/test/rails_app/config/application.rb +42 -0
  19. data/test/rails_app/config/boot.rb +6 -0
  20. data/test/rails_app/config/environment.rb +5 -0
  21. data/test/rails_app/config/environments/development.rb +26 -0
  22. data/test/rails_app/config/environments/production.rb +49 -0
  23. data/test/rails_app/config/environments/test.rb +35 -0
  24. data/test/rails_app/config/initializers/imhotep.rb +2 -0
  25. data/test/rails_app/config/initializers/secret_token.rb +7 -0
  26. data/test/rails_app/config/initializers/session_store.rb +8 -0
  27. data/test/rails_app/config/routes.rb +5 -0
  28. data/test/rails_app/db/migrate/20110416154842_create_pages.rb +17 -0
  29. data/test/rails_app/db/migrate/20110416154847_create_wiki.rb +17 -0
  30. data/test/rails_app/db/schema.rb +37 -0
  31. data/test/rails_app/db/seeds.rb +7 -0
  32. data/test/test_helper.rb +15 -0
  33. metadata +139 -0
@@ -0,0 +1,14 @@
1
+ require 'imhotep/config'
2
+ require 'imhotep/routes'
3
+
4
+ module Imhotep
5
+ autoload :PagesController, "imhotep/controllers/pages_controller"
6
+
7
+ module Models
8
+ autoload :Page, "imhotep/models/page"
9
+ end
10
+
11
+ def self.config
12
+ yield Imhotep::Config
13
+ end
14
+ end
@@ -0,0 +1,4 @@
1
+ module Imhotep
2
+ module Config
3
+ end
4
+ end
@@ -0,0 +1,42 @@
1
+ module Imhotep
2
+ class PagesController < ApplicationController
3
+ def show
4
+ if resource.persisted?
5
+ respond_with(resource)
6
+ else
7
+ respond_to do |format|
8
+ format.html { redirect_to :action => :edit, :path => params[:path], :name => params[:name] }
9
+ format.any { head :not_found }
10
+ end
11
+ end
12
+ end
13
+
14
+ def edit
15
+ respond_with(resource)
16
+ end
17
+
18
+ def update
19
+ resource.attributes = params[:page]
20
+ resource.save
21
+ respond_with(resource, :location => { :action => 'show' })
22
+ end
23
+
24
+ def destroy
25
+ resource.destroy
26
+ respond_with(resource)
27
+ end
28
+
29
+ protected
30
+ def resource
31
+ @page ||= if request.delete?
32
+ resource_class.find_by_path_and_name(params[:path], params[:name])
33
+ else
34
+ resource_class.find_or_build(params[:path], params[:name])
35
+ end
36
+ end
37
+
38
+ def resource_class
39
+ @resource_class ||= self.class.name.sub(/Controller$/, "").singularize.constantize
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,25 @@
1
+ module Imhotep
2
+ module Models
3
+ module Page
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ attr_protected :path, :name, :created_at, :updated_at
8
+ end
9
+
10
+ module ClassMethods
11
+ def find_or_build(path, name, attributes = nil)
12
+ page = find_by_path_and_name(path, name)
13
+
14
+ unless page
15
+ page = new
16
+ page.path = path
17
+ page.name = name
18
+ end
19
+
20
+ page
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ module ActionDispatch # :nodoc:
2
+ module Routing # :nodoc:
3
+ class Mapper
4
+ def imhotep(*resources)
5
+ options = resources.extract_options!
6
+
7
+ resources.each do |resource|
8
+ options[:except] = [:new, :create]
9
+ options[:path] = "#{options[:path] || resource}(/*path)/:name"
10
+ self.resource resource, options
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,43 @@
1
+ require 'test_helper'
2
+
3
+ class PagesControllerTest < ActionController::TestCase
4
+ setup do
5
+ @page = pages(:about)
6
+ end
7
+
8
+ test "should get show" do
9
+ get :show, :name => @page.name
10
+ assert_response :ok
11
+ assert_select "h1", @page.title
12
+ end
13
+
14
+ test "show should redirect to edit" do
15
+ get :show, :name => "faq"
16
+ assert_redirected_to edit_page_url(:name => "faq")
17
+ end
18
+
19
+ test "show with path should redirect to edit" do
20
+ get :show, :path => "help", :name => "contact_us"
21
+ assert_redirected_to edit_page_url(:path => "help", :name => "contact_us")
22
+ end
23
+
24
+ test "should edit existing page" do
25
+ get :edit, :name => @page.name
26
+ assert_response :ok
27
+ assert_select "form[action=" + page_path(@page.path, @page.name) + "]"
28
+ end
29
+
30
+ test "should edit unknown page" do
31
+ get :edit, :name => "faq"
32
+ assert_response :ok
33
+ assert_nil assigns(:page).path
34
+ assert_equal "faq", assigns(:page).name
35
+ assert_select "form[action=" + page_path(:name => "faq") + "]"
36
+ end
37
+
38
+ test "should update" do
39
+ put :update, :name => @page.name, :page => { :body => "some body" }
40
+ assert_redirected_to page_path(@page.path, @page.name)
41
+ assert_equal "some body", @page.reload.body
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ require 'test_helper'
2
+
3
+ class RoutesTest < ActionController::TestCase
4
+ test "root" do
5
+ assert_routing "/", :controller => "home", :action => "index"
6
+ end
7
+
8
+ test "show page" do
9
+ assert_routing "/about", :controller => "pages", :action => "show", :name => "about"
10
+ assert_routing "/help", :controller => "pages", :action => "show", :name => "help"
11
+ assert_routing "/help/howto", :controller => "pages", :action => "show", :name => "howto", :path => "help"
12
+ assert_routing "/a/very/long/path", :controller => "pages", :action => "show", :name => "path", :path => "a/very/long"
13
+ end
14
+
15
+ test "edit page" do
16
+ assert_routing "/about/edit", :controller => "pages", :action => "edit", :name => "about"
17
+ assert_routing "/help/edit", :controller => "pages", :action => "edit", :name => "help"
18
+ assert_routing "/help/howto/edit", :controller => "pages", :action => "edit", :name => "howto", :path => "help"
19
+ assert_routing "/a/very/long/path/edit", :controller => "pages", :action => "edit", :name => "path", :path => "a/very/long"
20
+ end
21
+
22
+ test "update page" do
23
+ assert_routing({:method => :put, :path => "/about"}, :controller => "pages", :action => "update", :name => "about")
24
+ assert_routing({:method => :put, :path => "/help"}, :controller => "pages", :action => "update", :name => "help")
25
+ assert_routing({:method => :put, :path => "/help/howto"}, :controller => "pages", :action => "update", :name => "howto", :path => "help")
26
+ assert_routing({:method => :put, :path => "/a/very/long/path"}, :controller => "pages", :action => "update", :name => "path", :path => "a/very/long")
27
+ end
28
+
29
+ test "destroy page" do
30
+ assert_routing({:method => :delete, :path => "/about"}, :controller => "pages", :action => "destroy", :name => "about")
31
+ assert_routing({:method => :delete, :path => "/help"}, :controller => "pages", :action => "destroy", :name => "help")
32
+ assert_routing({:method => :delete, :path => "/help/howto"}, :controller => "pages", :action => "destroy", :name => "howto", :path => "help")
33
+ assert_routing({:method => :delete, :path => "/a/very/long/path"}, :controller => "pages", :action => "destroy", :name => "path", :path => "a/very/long")
34
+ end
35
+
36
+ test "wiki" do
37
+ assert_routing "/wiki/FrontPage", :controller => "wiki", :action => "show", :name => "FrontPage"
38
+ assert_routing "/wiki/Help::FrontPage", :controller => "wiki", :action => "show", :name => "Help::FrontPage"
39
+ assert_routing "/wiki/Help::FrontPage/edit", :controller => "wiki", :action => "edit", :name => "Help::FrontPage"
40
+ assert_routing({:method => :put, :path => "/wiki/Help"}, :controller => "wiki", :action => "update", :name => "Help")
41
+ assert_routing({:method => :delete, :path => "/wiki/Help"}, :controller => "wiki", :action => "destroy", :name => "Help")
42
+ end
43
+ end
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ class WikiControllerTest < ActionController::TestCase
4
+ setup do
5
+ @wiki = wiki(:frontpage)
6
+ end
7
+
8
+ test "should get show" do
9
+ get :show, :name => @wiki.name
10
+ assert_response :ok
11
+ assert_select "h1", @wiki.title
12
+ end
13
+
14
+ test "show should redirect to edit" do
15
+ get :show, :name => "faq"
16
+ assert_redirected_to edit_wiki_url(:name => "faq")
17
+ end
18
+
19
+ test "should edit existing page" do
20
+ get :edit, :name => @wiki.name
21
+ assert_response :ok
22
+ assert_select "form[action=" + wiki_path(@wiki.path, @wiki.name) + "]"
23
+ end
24
+
25
+ test "should edit unknown page" do
26
+ get :edit, :name => "faq"
27
+ assert_response :ok
28
+ assert_nil assigns(:page).path
29
+ assert_equal "faq", assigns(:page).name
30
+ assert_select "form[action=" + wiki_path(:name => "faq") + "]"
31
+ end
32
+
33
+ test "should update" do
34
+ put :update, :name => @wiki.name, :page => { :body => "some body" }
35
+ assert_redirected_to wiki_path(@wiki.path, @wiki.name)
36
+ assert_equal "some body", @wiki.reload.body
37
+ end
38
+ end
@@ -0,0 +1,33 @@
1
+ require 'test_helper'
2
+
3
+ class EditPagesTest < ActionDispatch::IntegrationTest
4
+ test "should create" do
5
+ visit page_path(:name => "faq")
6
+ assert_equal edit_page_path(:name => "faq"), current_path
7
+
8
+ fill_in 'page_title', :with => "Frequently Asked Questions"
9
+ fill_in 'page_body', :with => "bla bla bla"
10
+
11
+ assert_difference('Page.count') do
12
+ click_button 'page_submit'
13
+ end
14
+
15
+ page = Page.last
16
+ assert_equal "Frequently Asked Questions", page.title
17
+ assert_equal "bla bla bla", page.body
18
+ end
19
+
20
+ test "should update" do
21
+ visit edit_page_path(:name => pages(:about).name)
22
+ fill_in 'page_title', :with => "Frequently Asked Questions"
23
+ fill_in 'page_body', :with => "bla bla bla"
24
+
25
+ assert_no_difference('Page.count') do
26
+ click_button 'page_submit'
27
+ end
28
+
29
+ pages(:about).reload
30
+ assert_equal "Frequently Asked Questions", pages(:about).title
31
+ assert_equal "bla bla bla", pages(:about).body
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ require 'test_helper'
2
+
3
+ class EditWikiTest < ActionDispatch::IntegrationTest
4
+ test "should create" do
5
+ visit wiki_path(:name => "faq")
6
+ assert_equal edit_wiki_path(:name => "faq"), current_path
7
+
8
+ fill_in 'page_title', :with => "Frequently Asked Questions"
9
+ fill_in 'page_body', :with => "bla bla bla"
10
+
11
+ assert_difference('Wiki.count') do
12
+ click_button 'page_submit'
13
+ end
14
+
15
+ wiki = Wiki.last
16
+ assert_equal "Frequently Asked Questions", wiki.title
17
+ assert_equal "bla bla bla", wiki.body
18
+ end
19
+
20
+ test "should update" do
21
+ visit edit_wiki_path(:name => wiki(:frontpage).name)
22
+ fill_in 'page_title', :with => "Frequently Asked Questions"
23
+ fill_in 'page_body', :with => "bla bla bla"
24
+
25
+ assert_no_difference('Wiki.count') do
26
+ click_button 'page_submit'
27
+ end
28
+
29
+ wiki(:frontpage).reload
30
+ assert_equal "Frequently Asked Questions", wiki(:frontpage).title
31
+ assert_equal "bla bla bla", wiki(:frontpage).body
32
+ end
33
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ class HomeController < ApplicationController
2
+ end
@@ -0,0 +1,3 @@
1
+ class PagesController < Imhotep::PagesController
2
+ respond_to :html
3
+ end
@@ -0,0 +1,3 @@
1
+ class WikiController < Imhotep::PagesController
2
+ respond_to :html
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,3 @@
1
+ class Page < ActiveRecord::Base
2
+ include Imhotep::Models::Page
3
+ end
@@ -0,0 +1,4 @@
1
+ class Wiki < ActiveRecord::Base
2
+ include Imhotep::Models::Page
3
+ set_table_name :wiki
4
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # If you have a Gemfile, require the gems listed there, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
8
+
9
+ module RailsApp
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Custom directories with classes and modules you want to be autoloadable.
16
+ # config.autoload_paths += %W(#{config.root}/extras)
17
+
18
+ # Only load the plugins named here, in the order given (default is alphabetical).
19
+ # :all can be used as a placeholder for all plugins not explicitly named.
20
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
+
22
+ # Activate observers that should always be running.
23
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
+
25
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
+ # config.time_zone = 'Central Time (US & Canada)'
28
+
29
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
+ # config.i18n.default_locale = :de
32
+
33
+ # JavaScript files you want as :defaults (application.js is always included).
34
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
35
+
36
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+ end
42
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ RailsApp::Application.initialize!
@@ -0,0 +1,26 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+ end
26
+
@@ -0,0 +1,49 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
+
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
+
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
+
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
+
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
+
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+
43
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
+ # the I18n.default_locale when a translation can not be found)
45
+ config.i18n.fallbacks = true
46
+
47
+ # Send deprecation notices to registered listeners
48
+ config.active_support.deprecation = :notify
49
+ end
@@ -0,0 +1,35 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ end
@@ -0,0 +1,2 @@
1
+ Imhotep.config do |config|
2
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ RailsApp::Application.config.secret_token = 'd02d44431970edceef6bc7746a41b876e1e828e48c0fa76fb94f2e8d068bdc6ae4f0ee129adeb69e8649b4840ba8e7d83894f9be0567eb0151da9b2478dc393d'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ RailsApp::Application.config.session_store :cookie_store, :key => '_rails_app_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # RailsApp::Application.config.session_store :active_record_store
@@ -0,0 +1,5 @@
1
+ RailsApp::Application.routes.draw do
2
+ imhotep :wiki, :controller => "wiki"
3
+ imhotep :page, :path => "", :except => :index
4
+ root :to => "home#index"
5
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePages < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :pages do |t|
4
+ t.string :path
5
+ t.string :name, :null => false
6
+ t.string :title
7
+ t.text :body
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :pages, [:path, :name], :unique => true
12
+ end
13
+
14
+ def self.down
15
+ drop_table :pages
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ class CreateWiki < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :wiki do |t|
4
+ t.string :path
5
+ t.string :name, :null => false
6
+ t.string :title
7
+ t.text :body
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :wiki, [:path, :name], :unique => true
12
+ end
13
+
14
+ def self.down
15
+ drop_table :wiki
16
+ end
17
+ end
@@ -0,0 +1,37 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended to check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(:version => 20110416154847) do
14
+
15
+ create_table "pages", :force => true do |t|
16
+ t.string "path"
17
+ t.string "name", :null => false
18
+ t.string "title"
19
+ t.text "body"
20
+ t.datetime "created_at"
21
+ t.datetime "updated_at"
22
+ end
23
+
24
+ add_index "pages", ["path", "name"], :name => "index_pages_on_path_and_name", :unique => true
25
+
26
+ create_table "wiki", :force => true do |t|
27
+ t.string "path"
28
+ t.string "name", :null => false
29
+ t.string "title"
30
+ t.text "body"
31
+ t.datetime "created_at"
32
+ t.datetime "updated_at"
33
+ end
34
+
35
+ add_index "wiki", ["path", "name"], :name => "index_wiki_on_path_and_name", :unique => true
36
+
37
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Daley', :city => cities.first)
@@ -0,0 +1,15 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ require File.expand_path('../rails_app/config/environment', __FILE__)
4
+ require 'rails/test_help'
5
+ require 'capybara/rails'
6
+
7
+ class ActiveSupport::TestCase
8
+ self.fixture_path = File.expand_path('../fixtures', __FILE__)
9
+ fixtures :all
10
+ end
11
+
12
+ class ActionDispatch::IntegrationTest
13
+ self.fixture_path = File.expand_path('../fixtures', __FILE__)
14
+ include Capybara
15
+ end
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: imhotep
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Julien Portalier
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-09-17 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rails
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 9
30
+ segments:
31
+ - 3
32
+ - 0
33
+ - 7
34
+ version: 3.0.7
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: Wiki engine for Ruby on Rails.
38
+ email: ysbaddaden@gmail.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - lib/imhotep.rb
47
+ - lib/imhotep/config.rb
48
+ - lib/imhotep/controllers/pages_controller.rb
49
+ - lib/imhotep/models/page.rb
50
+ - lib/imhotep/routes.rb
51
+ - test/functional/pages_controller_test.rb
52
+ - test/functional/routes_test.rb
53
+ - test/functional/wiki_controller_test.rb
54
+ - test/integration/edit_pages_test.rb
55
+ - test/integration/edit_wiki_test.rb
56
+ - test/rails_app/app/controllers/application_controller.rb
57
+ - test/rails_app/app/controllers/home_controller.rb
58
+ - test/rails_app/app/controllers/pages_controller.rb
59
+ - test/rails_app/app/controllers/wiki_controller.rb
60
+ - test/rails_app/app/helpers/application_helper.rb
61
+ - test/rails_app/app/models/page.rb
62
+ - test/rails_app/app/models/wiki.rb
63
+ - test/rails_app/config/application.rb
64
+ - test/rails_app/config/boot.rb
65
+ - test/rails_app/config/environment.rb
66
+ - test/rails_app/config/environments/development.rb
67
+ - test/rails_app/config/environments/production.rb
68
+ - test/rails_app/config/environments/test.rb
69
+ - test/rails_app/config/initializers/imhotep.rb
70
+ - test/rails_app/config/initializers/secret_token.rb
71
+ - test/rails_app/config/initializers/session_store.rb
72
+ - test/rails_app/config/routes.rb
73
+ - test/rails_app/db/migrate/20110416154842_create_pages.rb
74
+ - test/rails_app/db/migrate/20110416154847_create_wiki.rb
75
+ - test/rails_app/db/schema.rb
76
+ - test/rails_app/db/seeds.rb
77
+ - test/test_helper.rb
78
+ has_rdoc: true
79
+ homepage: http://github.com/ysbaddaden/imhotep
80
+ licenses: []
81
+
82
+ post_install_message:
83
+ rdoc_options: []
84
+
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ requirements: []
106
+
107
+ rubyforge_project:
108
+ rubygems_version: 1.6.2
109
+ signing_key:
110
+ specification_version: 3
111
+ summary: Wiki engine for Ruby on Rails.
112
+ test_files:
113
+ - test/functional/pages_controller_test.rb
114
+ - test/functional/routes_test.rb
115
+ - test/functional/wiki_controller_test.rb
116
+ - test/integration/edit_pages_test.rb
117
+ - test/integration/edit_wiki_test.rb
118
+ - test/rails_app/app/controllers/application_controller.rb
119
+ - test/rails_app/app/controllers/home_controller.rb
120
+ - test/rails_app/app/controllers/pages_controller.rb
121
+ - test/rails_app/app/controllers/wiki_controller.rb
122
+ - test/rails_app/app/helpers/application_helper.rb
123
+ - test/rails_app/app/models/page.rb
124
+ - test/rails_app/app/models/wiki.rb
125
+ - test/rails_app/config/application.rb
126
+ - test/rails_app/config/boot.rb
127
+ - test/rails_app/config/environment.rb
128
+ - test/rails_app/config/environments/development.rb
129
+ - test/rails_app/config/environments/production.rb
130
+ - test/rails_app/config/environments/test.rb
131
+ - test/rails_app/config/initializers/imhotep.rb
132
+ - test/rails_app/config/initializers/secret_token.rb
133
+ - test/rails_app/config/initializers/session_store.rb
134
+ - test/rails_app/config/routes.rb
135
+ - test/rails_app/db/migrate/20110416154842_create_pages.rb
136
+ - test/rails_app/db/migrate/20110416154847_create_wiki.rb
137
+ - test/rails_app/db/schema.rb
138
+ - test/rails_app/db/seeds.rb
139
+ - test/test_helper.rb