content_engine 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/README +1 -0
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/content_engine.gemspec +3 -118
  5. metadata +6 -117
  6. data/Gemfile +0 -40
  7. data/README.md +0 -43
  8. data/app/controllers/content_engine/articles_controller.rb +0 -54
  9. data/app/controllers/content_engine/pages_controller.rb +0 -76
  10. data/app/controllers/content_engine_controller.rb +0 -14
  11. data/app/helpers/application_helper.rb +0 -2
  12. data/app/models/article.rb +0 -29
  13. data/app/models/content.rb +0 -64
  14. data/app/models/page.rb +0 -40
  15. data/app/models/site.rb +0 -26
  16. data/app/models/tag.rb +0 -53
  17. data/app/models/user.rb +0 -5
  18. data/app/views/content_engine/articles/_form.erb +0 -8
  19. data/app/views/content_engine/articles/edit.html.erb +0 -7
  20. data/app/views/content_engine/articles/index.html.erb +0 -10
  21. data/app/views/content_engine/articles/new.html.erb +0 -6
  22. data/app/views/content_engine/articles/show.html.erb +0 -9
  23. data/app/views/content_engine/pages/_form.erb +0 -8
  24. data/app/views/content_engine/pages/edit.html.erb +0 -7
  25. data/app/views/content_engine/pages/index.html.erb +0 -10
  26. data/app/views/content_engine/pages/new.html.erb +0 -6
  27. data/app/views/content_engine/pages/show.html.erb +0 -9
  28. data/app/views/layouts/application.html.erb +0 -16
  29. data/config/application.rb +0 -1
  30. data/config/locales/en.yml +0 -5
  31. data/config/routes.rb +0 -25
  32. data/db/migrate/20100225105011_create_contents.rb +0 -22
  33. data/db/migrate/20100225105903_create_users.rb +0 -8
  34. data/db/migrate/20100225110024_create_sites.rb +0 -15
  35. data/db/migrate/20100225110037_create_memberships.rb +0 -12
  36. data/db/migrate/20100225112236_acts_as_taggable_on.rb +0 -26
  37. data/db/schema.rb +0 -58
  38. data/lib/content_engine.rb +0 -24
  39. data/lib/tasks/content_engine.rake +0 -24
  40. data/spec/blueprint.rb +0 -41
  41. data/spec/models/article_spec.rb +0 -56
  42. data/spec/models/page_spec.rb +0 -158
  43. data/spec/models/site_spec.rb +0 -32
  44. data/spec/rails_app/.gitignore +0 -4
  45. data/spec/rails_app/Rakefile +0 -10
  46. data/spec/rails_app/app/controllers/admins_controller.rb +0 -6
  47. data/spec/rails_app/app/controllers/application_controller.rb +0 -6
  48. data/spec/rails_app/app/controllers/home_controller.rb +0 -4
  49. data/spec/rails_app/app/controllers/sessions_controller.rb +0 -6
  50. data/spec/rails_app/app/controllers/users_controller.rb +0 -12
  51. data/spec/rails_app/app/helpers/application_helper.rb +0 -3
  52. data/spec/rails_app/app/views/home/index.html.erb +0 -1
  53. data/spec/rails_app/app/views/layouts/application.html.erb +0 -19
  54. data/spec/rails_app/config.ru +0 -4
  55. data/spec/rails_app/config/application.rb +0 -30
  56. data/spec/rails_app/config/boot.rb +0 -9
  57. data/spec/rails_app/config/database.yml +0 -16
  58. data/spec/rails_app/config/environment.rb +0 -5
  59. data/spec/rails_app/config/environments/development.rb +0 -19
  60. data/spec/rails_app/config/environments/production.rb +0 -33
  61. data/spec/rails_app/config/environments/test.rb +0 -29
  62. data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  63. data/spec/rails_app/config/initializers/cookie_verification_secret.rb +0 -7
  64. data/spec/rails_app/config/initializers/inflections.rb +0 -2
  65. data/spec/rails_app/config/initializers/session_store.rb +0 -15
  66. data/spec/rails_app/config/routes.rb +0 -21
  67. data/spec/rails_app/db/migrate/20100225105011_create_contents.rb +0 -22
  68. data/spec/rails_app/db/migrate/20100225105903_create_users.rb +0 -8
  69. data/spec/rails_app/db/migrate/20100225110024_create_sites.rb +0 -15
  70. data/spec/rails_app/db/migrate/20100225110037_create_memberships.rb +0 -12
  71. data/spec/rails_app/db/migrate/20100225112236_acts_as_taggable_on.rb +0 -26
  72. data/spec/rails_app/db/schema.rb +0 -59
  73. data/spec/rails_app/public/404.html +0 -26
  74. data/spec/rails_app/public/422.html +0 -26
  75. data/spec/rails_app/public/500.html +0 -26
  76. data/spec/rails_app/public/favicon.ico +0 -0
  77. data/spec/rails_app/public/images/rails.png +0 -0
  78. data/spec/rails_app/public/javascripts/application.js +0 -2
  79. data/spec/rails_app/public/javascripts/controls.js +0 -963
  80. data/spec/rails_app/public/javascripts/dragdrop.js +0 -973
  81. data/spec/rails_app/public/javascripts/effects.js +0 -1128
  82. data/spec/rails_app/public/javascripts/prototype.js +0 -4320
  83. data/spec/rails_app/public/javascripts/rails.js +0 -110
  84. data/spec/rails_app/public/robots.txt +0 -5
  85. data/spec/rails_app/public/stylesheets/.gitkeep +0 -0
  86. data/spec/rails_app/script/rails +0 -10
  87. data/spec/requests/user_manage_articles_spec.rb +0 -85
  88. data/spec/requests/user_manage_pages_spec.rb +0 -92
  89. data/spec/requests/webrat.log +0 -17
  90. data/spec/spec.opts +0 -2
  91. data/spec/spec_helper.rb +0 -36
@@ -1,32 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Site do
4
- before do
5
- @site = Site.make
6
- @first_page = @site.pages.make(:title => 'home')
7
- @second_page = @site.pages.make(:title => 'about us')
8
- end
9
-
10
- it "has a homepage" do
11
- @site.homepage.should be_a(Page)
12
- end
13
-
14
- it "marks the first page as homepage" do
15
- @site.homepage.should == @first_page
16
- end
17
-
18
- it "has many pages" do
19
- @site.pages.count.should == 2
20
- end
21
-
22
- it "has many articles" do
23
- @post_1 = @site.articles.make(:title => "first post")
24
- @post_2 = @site.articles.make(:title => "second post")
25
-
26
- @site.should have(2).articles
27
- end
28
-
29
- it "finds pages by url" do
30
- @site.pages.find_by_url("")
31
- end
32
- end
@@ -1,4 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/**/*
@@ -1,10 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
-
6
- require 'rake'
7
- require 'rake/testtask'
8
- require 'rake/rdoctask'
9
-
10
- Rails::Application.load_tasks
@@ -1,6 +0,0 @@
1
- class AdminsController < ApplicationController
2
- before_filter :authenticate_admin!
3
-
4
- def index
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- protect_from_forgery
6
- end
@@ -1,4 +0,0 @@
1
- class HomeController < ApplicationController
2
- def index
3
- end
4
- end
@@ -1,6 +0,0 @@
1
- class SessionsController < Devise::SessionsController
2
- def new
3
- flash[:notice] = "Welcome to #{controller_path.inspect} controller!"
4
- super
5
- end
6
- end
@@ -1,12 +0,0 @@
1
- class UsersController < ApplicationController
2
- before_filter :authenticate_user!
3
-
4
- def index
5
- user_session[:cart] = "Cart"
6
- end
7
-
8
- def expire
9
- user_session['last_request_at'] = 31.minutes.ago.utc
10
- render :text => 'User will be expired on next request'
11
- end
12
- end
@@ -1,3 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module ApplicationHelper
3
- end
@@ -1 +0,0 @@
1
- Home!
@@ -1,19 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html>
4
- <head>
5
- <title>Devise Test App</title>
6
- <%= stylesheet_link_tag 'scaffold' %>
7
- <%= javascript_include_tag :defaults %>
8
- <%= csrf_meta_tag %>
9
- </head>
10
- <body>
11
- <div id="container">
12
- <%- flash.each do |name, msg| -%>
13
- <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
14
- <%- end -%>
15
-
16
- <%= yield %>
17
- </div>
18
- </body>
19
- </html>
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run RailsApp::Application
@@ -1,30 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require "active_record/railtie"
4
- require "action_controller/railtie"
5
- require "action_mailer/railtie"
6
- require "active_resource/railtie"
7
- require "rails/test_unit/railtie"
8
-
9
- Bundler.require
10
- require "content_engine"
11
-
12
- module RailsApp
13
- class Application < Rails::Application
14
- config.root = File.expand_path("../..", __FILE__)
15
-
16
- # Add additional load paths for your own custom dirs
17
- config.load_paths.reject!{ |p| p =~ /\/app\/(\w+)$/ && !%w(controllers models helpers views).include?($1) }
18
- # config.load_paths += [ "#{config.root}/app/#{DEVISE_ORM}" ]
19
-
20
- # Configure generators values. Many other options are available, be sure to check the documentation.
21
- # config.generators do |g|
22
- # g.orm :active_record
23
- # g.template_engine :erb
24
- # g.test_framework :test_unit, :fixture => true
25
- # end
26
-
27
- # Configure sensitive parameters which will be filtered from the log file.
28
- config.filter_parameters << :password
29
- end
30
- end
@@ -1,9 +0,0 @@
1
- begin
2
- require File.expand_path("../../../../.bundle/environment", __FILE__)
3
- rescue LoadError
4
- require 'rubygems'
5
- require 'bundler'
6
- Bundler.setup
7
- end
8
-
9
- $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,16 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
- development:
4
- adapter: sqlite3
5
- database: "db/development.sqlite3"
6
-
7
- # Warning: The database defined as "test" will be erased and
8
- # re-generated from your development database when you run "rake".
9
- # Do not set this db to the same as development or production.
10
- test:
11
- adapter: sqlite3
12
- database: ":memory:"
13
-
14
- production:
15
- adapter: sqlite3
16
- database: ":memory:"
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- RailsApp::Application.initialize!
@@ -1,19 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.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
- end
@@ -1,33 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.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
- # See everything in the log (default is :info)
13
- # config.log_level = :debug
14
-
15
- # Use a different logger for distributed setups
16
- # config.logger = SyslogLogger.new
17
-
18
- # Use a different cache store in production
19
- # config.cache_store = :mem_cache_store
20
-
21
- # Disable Rails's static asset server
22
- # In production, Apache or nginx will already do this
23
- config.serve_static_assets = false
24
-
25
- # Enable serving of images, stylesheets, and javascripts from an asset server
26
- # config.action_controller.asset_host = "http://assets.example.com"
27
-
28
- # Disable delivery errors, bad email addresses will be ignored
29
- # config.action_mailer.raise_delivery_errors = false
30
-
31
- # Enable threaded mode
32
- # config.threadsafe!
33
- end
@@ -1,29 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.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
- # Disable request forgery protection in test environment
18
- config.action_controller.allow_forgery_protection = false
19
-
20
- # Tell Action Mailer not to deliver emails to the real world.
21
- # The :test delivery method accumulates sent emails in the
22
- # ActionMailer::Base.deliveries array.
23
- config.action_mailer.delivery_method = :test
24
-
25
- # Use SQL instead of Active Record's schema dumper when creating the test database.
26
- # This is necessary if your schema can't be completely dumped by the schema dumper,
27
- # like if you have constraints or database-specific column types
28
- # config.active_record.schema_format = :sql
29
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- Rails.backtrace_cleaner.remove_silencers!
@@ -1,7 +0,0 @@
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
- ActionController::Base.cookie_verifier_secret = 'ea942c41850d502f2c8283e26bdc57829f471bb18224ddff0a192c4f32cdf6cb5aa0d82b3a7a7adbeb640c4b06f3aa1cd5f098162d8240f669b39d6b49680571'
@@ -1,2 +0,0 @@
1
- ActiveSupport::Inflector.inflections do |inflect|
2
- end
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying cookie session data integrity.
4
- # If you change this key, all old sessions 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
- ActionController::Base.session = {
8
- :key => '_rails_app_session',
9
- :secret => '0c31f123b2bd4424ac366a7976aaa0696f0c82337c4073a5816a3abc6553293ad14f70cf23acb391954a8ce8cf08aaca3fab21e7642aa52ea212aefa19b7439d'
10
- }
11
-
12
- # Use the database for sessions instead of the cookie-based default,
13
- # which shouldn't be used to store highly confidential information
14
- # (create the session table with "rake db:sessions:create")
15
- # ActionController::Base.session_store = :active_record_store
@@ -1,21 +0,0 @@
1
- Rails::Application.routes.draw do
2
- # resources :users, :only => [:index] do
3
- # get :expire, :on => :member
4
- # end
5
- #
6
- # resources :admins, :only => [:index]
7
- #
8
- # devise_for :users
9
- # devise_for :admin, :as => "admin_area", :controllers => { :sessions => "sessions" }
10
- # devise_for :accounts, :scope => "manager", :path_prefix => ":locale",
11
- # :class_name => "User", :path_names => {
12
- # :sign_in => "login", :sign_out => "logout",
13
- # :password => "secret", :confirmation => "verification",
14
- # :unlock => "unblock", :sign_up => "register"
15
- # }
16
- #
17
- # match "/admin_area/home", :to => "admins#index", :as => :admin_root
18
- # match "/sign_in", :to => "devise/sessions#new"
19
-
20
- root :to => "home#index"
21
- end
@@ -1,22 +0,0 @@
1
- class CreateContents < ActiveRecord::Migration
2
- def self.up
3
- create_table :contents do |t|
4
- t.string :title
5
- t.string :permalink
6
- t.text :description
7
- t.text :body
8
- t.string :type, :default => 'Page'
9
- t.integer :parent_id
10
- t.integer :site_id
11
- t.integer :user_id
12
- t.integer :lft
13
- t.integer :rgt
14
- t.datetime :published_at
15
- t.timestamps
16
- end
17
- end
18
-
19
- def self.down
20
- drop_table :contents
21
- end
22
- end
@@ -1,8 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def self.up
3
-
4
- end
5
-
6
- def self.down
7
- end
8
- end
@@ -1,15 +0,0 @@
1
- class CreateSites < ActiveRecord::Migration
2
- def self.up
3
- create_table :sites do |t|
4
- t.string :title
5
- t.text :description
6
- t.string :time_zone
7
- t.integer :owner_id
8
- t.string :host
9
- end
10
- end
11
-
12
- def self.down
13
- drop_table :sites
14
- end
15
- end
@@ -1,12 +0,0 @@
1
- class CreateMemberships < ActiveRecord::Migration
2
- def self.up
3
- create_table :memberships do |t|
4
- t.integer :site_id
5
- t.integer :user_id
6
- end
7
- end
8
-
9
- def self.down
10
- drop_table :memberships
11
- end
12
- end
@@ -1,26 +0,0 @@
1
- class ActsAsTaggableOn < ActiveRecord::Migration
2
- def self.up
3
- create_table :tags do |t|
4
- t.column :name, :string
5
- end
6
-
7
- create_table :taggings do |t|
8
- t.column :tag_id, :integer
9
- t.column :taggable_id, :integer
10
- t.column :tagger_id, :integer
11
- t.column :tagger_type, :string
12
-
13
- # You should make sure that the column created is
14
- # long enough to store the required class names.
15
- t.column :taggable_type, :string
16
- t.column :context, :string
17
-
18
- t.column :created_at, :datetime
19
- end
20
-
21
- add_index :taggings, :tag_id
22
- end
23
-
24
- def self.down
25
- end
26
- end
@@ -1,59 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead of editing this file,
2
- # please use the migrations feature of Active Record to incrementally modify your database, and
3
- # then regenerate this schema definition.
4
- #
5
- # Note that this schema.rb definition is the authoritative source for your database schema. If you need
6
- # to create the application database on another system, you should be using db:schema:load, not running
7
- # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
8
- # you'll amass, the slower it'll run and the greater likelihood for issues).
9
- #
10
- # It's strongly recommended to check this file into your version control system.
11
-
12
- ActiveRecord::Schema.define(:version => 20100225112236) do
13
-
14
- create_table "contents", :force => true do |t|
15
- t.string "title"
16
- t.string "permalink"
17
- t.text "description"
18
- t.text "body"
19
- t.string "type", :default => "Page"
20
- t.integer "parent_id"
21
- t.integer "site_id"
22
- t.integer "user_id"
23
- t.integer "lft"
24
- t.integer "rgt"
25
- t.datetime "published_at"
26
- t.datetime "created_at"
27
- t.datetime "updated_at"
28
- end
29
-
30
- create_table "memberships", :force => true do |t|
31
- t.integer "site_id"
32
- t.integer "user_id"
33
- end
34
-
35
- create_table "sites", :force => true do |t|
36
- t.string "title"
37
- t.text "description"
38
- t.string "time_zone"
39
- t.integer "owner_id"
40
- t.string "host"
41
- end
42
-
43
- create_table "taggings", :force => true do |t|
44
- t.integer "tag_id"
45
- t.integer "taggable_id"
46
- t.integer "tagger_id"
47
- t.string "tagger_type"
48
- t.string "taggable_type"
49
- t.string "context"
50
- t.datetime "created_at"
51
- end
52
-
53
- add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
54
-
55
- create_table "tags", :force => true do |t|
56
- t.string "name"
57
- end
58
-
59
- end