aslakjo-comatose 2.0.5.2 → 2.0.5.3
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.
- data/comatose.gemspec +1 -1
- data/lib/comatose.rb +12 -0
- data/test/functional/comatose_controller_test.rb +0 -1
- data/test/test_helper.rb +3 -1
- metadata +1 -1
data/comatose.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated on Tue May 20 20:13:12 -0500 2008
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "comatose"
|
4
|
-
s.version = "2.0.5.
|
4
|
+
s.version = "2.0.5.3"
|
5
5
|
s.date = "2008-10-31" # 2008-05-20
|
6
6
|
s.summary = "Micro CMS designed for being embedded into existing Rails applications"
|
7
7
|
s.email = "matt@elucidata.net"
|
data/lib/comatose.rb
CHANGED
@@ -9,6 +9,7 @@ module Comatose
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
|
12
13
|
end
|
13
14
|
|
14
15
|
require 'acts_as_versioned'
|
@@ -31,3 +32,14 @@ require 'dispatcher' unless defined?(::Dispatcher)
|
|
31
32
|
::Dispatcher.to_prepare :comatose do
|
32
33
|
Comatose.config.after_setup.call
|
33
34
|
end
|
35
|
+
|
36
|
+
module Comatose
|
37
|
+
def self.create_root_page(options ={})
|
38
|
+
unless ComatosePage.root
|
39
|
+
page = ComatosePage.create({:title=>'root page', :body=>"Welcome to comatose", :author=>'System', :parent_id=>nil}.merge(options))
|
40
|
+
page.save(false)
|
41
|
+
else
|
42
|
+
raise "There exists a comatose root page, cant create another one"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
ENV["RAILS_ENV"] = 'test'
|
2
2
|
|
3
|
-
require File.expand_path(File.join(File.dirname(__FILE__),
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "/../../comatose_harness/config/environment.rb"))
|
4
4
|
|
5
5
|
require 'test/unit'
|
6
6
|
require 'test_help'
|
@@ -42,6 +42,8 @@ class Test::Unit::TestCase
|
|
42
42
|
assert_difference object, method, 0, &block
|
43
43
|
end
|
44
44
|
|
45
|
+
|
46
|
+
|
45
47
|
class << self
|
46
48
|
def should(behave,&block)
|
47
49
|
method_name = "test_should_#{behave.gsub(' ', '_')}"
|