darthapo-comatose 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ - version: 2.0.4 (beta)
2
+ - Added a rake task to generate a test_harness (for use in development). From the comatose directory, run: `rake test_harness TARGET=../comatose_test_harness`. This will create an empty rails app, copy this working folder over to vendor/plugins/comatose, install acts_as_list and acts_as_tree, and run any setup needed, like script/generate comatose_migration and rake db:migrate.
3
+ - Bugfix in tasks/comatose.rake
4
+ - Comatose migration generator now adds the default comatose routes (`map.comatose_admin` and `map.comatose_root ''`) to the top of the routes.rb file. POSSIBLE GOTCHA: `map.comatose_root` should be moved to the bottom of the routes file!
5
+
1
6
  - version: 2.0.3 (beta)
2
7
  - Moving from alpha to beta!
3
8
  - staugaard: Added import and export of pages in admin controller
data/INSTALL CHANGED
@@ -8,14 +8,13 @@ Be sure and install the acts_as_tree and acts_as_list plugins!
8
8
  From here you'll want to run:
9
9
 
10
10
  $ ./script/generate comatose_migration
11
+
12
+ NOTE: The generator will add the default comatose routes to the top of your routes.rb file. You'll want to move `map.comatose_root ''` to the bottom of your routes block.
11
13
 
12
14
  When that's finished, run:
13
15
 
14
16
  $ rake db:migrate
15
17
 
16
- That's it for the Comatose setup! Now just add the following line to the bottom of your config/routes.rb file:
17
-
18
- map.comatose_admin
19
- map.comatose_root ''
18
+ That's it for the Comatose setup!
20
19
 
21
20
  Be sure to read the README file, and the 'Getting Started' guide. They are located at vendor/plugins/comatose/README and http://comatose.rubyforge.org/getting-started-guide respectively.
data/Rakefile CHANGED
@@ -77,7 +77,7 @@ EOGS
77
77
  puts "Update GEMSPEC"
78
78
  end
79
79
 
80
- desc "Builds the admin costumizable layout, the embedded layout have the JS and CSS inlined"
80
+ desc "Builds the admin customizable layout, the embedded layout have the JS and CSS inlined"
81
81
  task :build do
82
82
  require 'erb'
83
83
 
@@ -120,3 +120,52 @@ task :build do
120
120
  # That's it -- we're done.
121
121
  puts "Finished."
122
122
  end
123
+
124
+
125
+ desc "Creates an empty rails application for use as a test harness"
126
+ task :test_harness do
127
+ target = ENV['TARGET']
128
+ if target.nil?
129
+ puts "You must specify a TARGET for the test harness"
130
+ exit(1)
131
+ else
132
+ target = File.expand_path target
133
+ if target == File.expand_path(File.dirname(__FILE__))
134
+ puts "You must specify a folder other than this one."
135
+ exit(1)
136
+ end
137
+ end
138
+ comatose_plugin_path = target / 'vendor' / 'plugins' / 'comatose'
139
+
140
+ puts "Creating test harness at #{ target }"
141
+ run_sh "rails -d sqlite3 #{target}"
142
+ run_sh "cp -r #{ File.dirname(__FILE__) }/ #{ comatose_plugin_path }"
143
+ run_sh "ruby #{ comatose_plugin_path / 'install.rb' }"
144
+ run_sh "ruby #{ target / 'script' / 'generate' } comatose_migration"
145
+ run_sh "ruby #{ comatose_plugin_path / 'bin' / 'comatose' } --plugin #{ target }"
146
+ run_sh "cd #{ target } && rake db:migrate"
147
+
148
+ run_sh "cp #{ target / 'db' / 'development.sqlite3' } #{target / 'db' / 'test.sqlite3'}"
149
+ run_sh "rm #{ target / 'public' / 'index.html' }"
150
+ run_sh "cp #{ comatose_plugin_path / 'views' / 'layouts' / 'comatose_content.html.erb' } #{ target / 'app' / 'views' / 'layouts' / 'comatose_content.html.erb' }"
151
+
152
+ # Remove me soon!
153
+ run_sh "cd #{ target } && ruby #{ target / 'script' / 'plugin' } install acts_as_tree"
154
+ run_sh "cd #{ target } && ruby #{ target / 'script' / 'plugin' } install acts_as_list"
155
+
156
+ puts "Done."
157
+ end
158
+
159
+ class String
160
+ def /(str)
161
+ File.join(self, str)
162
+ end
163
+ end
164
+
165
+ def run_sh(command)
166
+ puts "-------------------------------------------------------------------------------"
167
+ puts "Running `#{command}`:"
168
+ sh command
169
+ puts
170
+ puts
171
+ end
data/about.yml CHANGED
@@ -3,5 +3,5 @@ summary: A micro CMS for embedding in Rails applications.
3
3
  homepage: http://comatose.rubyforge.org
4
4
  plugin: git://github.com/darthapo/comatose.git
5
5
  license: MIT
6
- version: 2.0.3
6
+ version: 2.0.4
7
7
  rails_version: 2+
data/bin/comatose CHANGED
@@ -13,21 +13,21 @@ begin
13
13
 
14
14
  opts.on("-g", "--gem", "Initialize to run from gem (DEFAULT)") do |s|
15
15
  options[:action] = :gem
16
- puts "GEM"
16
+ puts "Configuring to run from GEM..."
17
17
  end
18
18
 
19
19
  opts.on("-p", "--plugin", "Install as plugin") do |s|
20
20
  options[:action] = :plugin
21
- puts "PLUGIN"
21
+ puts "Configuring to run from PLUGIN..."
22
22
  end
23
23
 
24
- opts.on("-u", "--update", "Update current installation (CURRENTLY UNIMPLEMENTED)") do |s|
25
- options[:action] = :update
26
- puts "UPDATE"
27
- end
24
+ # opts.on("-u", "--update", "Update current installation (CURRENTLY UNIMPLEMENTED)") do |s|
25
+ # options[:action] = :update
26
+ # puts "UPDATE"
27
+ # end
28
28
 
29
29
  opts.separator ""
30
- opts.separator "Common options:"
30
+ opts.separator "Common options:"
31
31
 
32
32
  # No argument, shows at tail. This will print an options summary.
33
33
  # Try it and see!
@@ -71,34 +71,34 @@ comatose_initializer_path = RAILS_ROOT / 'config' / 'initializers' / 'comatose.r
71
71
  unless File.exists?( comatose_initializer_path )
72
72
  File.open(comatose_initializer_path, 'w') do |f|
73
73
  f.write <<-EOT
74
- require 'comatose'
75
-
76
- # 1.) You should add the following snippet to your environment.rb too, probably...
77
- #
78
- # gem 'comatose'
79
- #
80
- # 2.) Following is an example configuration block for Comatose:
81
- #
82
- Comatose.configure do |config|
83
- # Includes AuthenticationSystem in the ComatoseController
84
- #config.includes << :authenticated_system
85
-
86
- # admin
87
- #config.admin_title = "My Content"
88
- #config.admin_sub_title = "Content for the rest of us..."
89
-
90
- # Includes AuthenticationSystem in the ComatoseAdminController
91
- #config.admin_includes << :authenticated_system
92
-
93
- # Calls :login_required as a before_filter
94
- #config.admin_authorization = :login_required
95
- # Returns the author name (login, in this case) for the current user
96
- #config.admin_get_author do
97
- # current_user.login
98
- #end
99
-
100
- # See the getting started guide at http://comatose.rubyforge.org for more...
101
- end
74
+ require 'comatose'
75
+
76
+ # 1.) You should add the following snippet to your environment.rb too, probably...
77
+ #
78
+ # gem 'comatose'
79
+ #
80
+ # 2.) Following is an example configuration block for Comatose:
81
+ #
82
+ Comatose.configure do |config|
83
+ # Includes AuthenticationSystem in the ComatoseController
84
+ #config.includes << :authenticated_system
85
+
86
+ # admin
87
+ #config.admin_title = "My Content"
88
+ #config.admin_sub_title = "Content for the rest of us..."
89
+
90
+ # Includes AuthenticationSystem in the ComatoseAdminController
91
+ #config.admin_includes << :authenticated_system
92
+
93
+ # Calls :login_required as a before_filter
94
+ #config.admin_authorization = :login_required
95
+ # Returns the author name (login, in this case) for the current user
96
+ #config.admin_get_author do
97
+ # current_user.login
98
+ #end
99
+
100
+ # See the getting started guide at http://comatose.rubyforge.org for more...
101
+ end
102
102
  EOT
103
103
  end
104
104
  else
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.3"
4
+ s.version = "2.0.4"
5
5
  s.date = "2008-10-10" # 2008-05-20
6
6
  s.summary = "Micro CMS designed for being embedded into existing Rails applications"
7
7
  s.email = "matt@elucidata.net"
@@ -1,3 +1,15 @@
1
+ class Rails::Generator::Commands::Create
2
+ def new_route(name, options='')
3
+ sentinel = 'ActionController::Routing::Routes.draw do |map|'
4
+ logger.route "map.#{name} #{options}"
5
+ unless options[:pretend]
6
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
7
+ "#{match}\n map.#{name} #{options}\n"
8
+ end
9
+ end
10
+ end
11
+ end
12
+
1
13
  class ComatoseMigrationGenerator < Rails::Generator::Base
2
14
 
3
15
 
@@ -38,6 +50,8 @@ class ComatoseMigrationGenerator < Rails::Generator::Base
38
50
  case @mode
39
51
  when :new
40
52
  m.migration_template 'migration.rb', 'db/migrate', :migration_file_name=>'add_comatose_support', :assigns=>{:class_name=>'AddComatoseSupport'}
53
+ m.new_route 'comatose_root', "''"
54
+ m.new_route 'comatose_admin'
41
55
 
42
56
  when :upgrade
43
57
  from = @upgrade_from
@@ -57,3 +71,4 @@ class ComatoseMigrationGenerator < Rails::Generator::Base
57
71
  end
58
72
  end
59
73
  end
74
+
data/install.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  # Copy the images (*.gif) into RAILS_ROOT/public/images/comatose
2
4
  RAILS_ROOT = File.join(File.dirname(__FILE__), '../../../')
3
5
 
@@ -1,4 +1,4 @@
1
1
  module Comatose
2
- VERSION = "2.0"
3
- VERSION_STRING = "#{VERSION} (uber-alpha)"
2
+ VERSION = "2.0.4"
3
+ VERSION_STRING = "#{VERSION} (beta)"
4
4
  end
data/tasks/comatose.rake CHANGED
@@ -1,5 +1,5 @@
1
1
  begin
2
- require 'comatose'
2
+ require 'comatose/version'
3
3
  rescue LoadError
4
4
  $: << File.join(File.dirname(__FILE__), '..', 'lib')
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darthapo-comatose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - M@ McCray
data/README.rdoc DELETED
@@ -1,148 +0,0 @@
1
- = Comatose
2
-
3
- Version:: 2.0.3 (beta)
4
- Author:: M@ McCray
5
- Website:: comatose.rubyforge.org
6
- Email:: matt at elucidata dot net
7
-
8
-
9
- *Comatose* is a micro CMS designed for being embedded into existing Rails
10
- applications.
11
-
12
- It's intended for simple CMS support. Comatose supports
13
-
14
- * Nested pages
15
- * Versioning
16
- * Page markup in Textile, Markdown, RDoc, or easily add your own
17
- * Page processing through Liquid or ERb
18
- * Generators for easy installation/migration
19
- * Completely self-contained within plugin folder
20
-
21
- It's meant to be lean, mean, easily embedded, and easy to re-skin for
22
- existing applications. If you need something more, I would recommend
23
- looking into Radiant.
24
-
25
- For more information, see the 'Getting Started' guide: http://comatose.rubyforge.org
26
-
27
- === Requirements
28
-
29
- * Rails 2+ (2.1)
30
- * <tt>acts_as_list</tt> and <tt>acts_as_tree</tt> plugins are required
31
-
32
-
33
- === Development Notes
34
-
35
- *NOTE*: This is an active branch of Comatose that is built specifically for Rails 2.1.
36
- I will *probably* remove any legacy support.
37
-
38
- * Make comatose fully self-contained, which means removing acts_as_(tree|list)
39
- * Move to gem plugin
40
- * Comatose.configure needs to be an initializer (update docs)
41
- * Go through bugs on 1x branch from google code and ensure they are fixed
42
- * Give access to all the default rails helpers to Comatose Pages by default?
43
-
44
-
45
- == Installation
46
-
47
- *Note*: See the 'Upgrading' section if you already have an older version of
48
- the comatose plugin installed.
49
-
50
- $ ./script/plugin source http://mattmccray.com/svn/rails/plugins
51
- $ ./script/plugin install comatose
52
- $ ./script/generate comatose_migration
53
- $ rake migrate
54
-
55
- Open your <tt>routes.rb</tt> and add the comatose root route at the
56
- bottom:
57
-
58
- map.comatose_admin
59
- map.comatose_root ''
60
-
61
- That's it, you're ready to go! You should be able to browse to
62
- http://127.0.0.1:3000/comatose_admin and start adding pages to your CMS.
63
- Browsing to http://127.0.0.1:3000/ will render your comatose pages if
64
- routing doesn't match any of your controllers.
65
-
66
-
67
- == Upgrading
68
-
69
- *NOTE*: This is an experimental 2.0 branch, so upgrading is possible at
70
- the moment, but these instructions may not work for much longer.
71
-
72
- If you are upgrading from an older version of Comatose (version 0.3,
73
- 0.4, 0.5, or 0.6), then you will need to re-install the comatose
74
- plugin and run:
75
-
76
- $ ./script/plugin remove comatose
77
- $ ./script/plugin install comatose
78
- $ ./script/generate comatose_migration --upgrade --from=VERSION
79
- $ rake migrate
80
-
81
- *Note*: Be sure to set the <tt>--from</tt> parameter to the version of
82
- Comatose you last had installed. Also, you only need to first two digits,
83
- including the dot, of the version you are upgrading from. For example, if
84
- you're upgrading from version 0.6.9 you can use:
85
-
86
- $ ./script/generate comatose_migration --upgrade --from=0.6
87
-
88
- This will create the upgrade migration(s) for you. It just adds the new
89
- fields, so you can keep the original migration comatose created.
90
-
91
-
92
- == Configuration
93
-
94
- You configure Comatose in your `config/environment.rb` file. Here is an example
95
- configuration block:
96
-
97
- Comatose.configure do |config|
98
- # Sets the text in the Admin UI's title area
99
- config.admin_title = "Site Content"
100
- config.admin_sub_title = "Content for the rest of us..."
101
- end
102
-
103
- Here's an example that uses the AuthentiationSystem as generated by the
104
- restful_authentication plugin:
105
-
106
- Comatose.configure do |config|
107
- # Includes AuthenticationSystem in the ComatoseController
108
- config.includes << :authenticated_system
109
-
110
- # admin
111
- config.admin_title = "Comatose - TESTING"
112
- config.admin_sub_title = "Content for the rest of us..."
113
-
114
- # Includes AuthenticationSystem in the ComatoseAdminController
115
- config.admin_includes << :authenticated_system
116
-
117
- # Calls :login_required as a before_filter
118
- config.admin_authorization = :login_required
119
- # Returns the author name (login, in this case) for the current user
120
- config.admin_get_author do
121
- current_user.login
122
- end
123
- end
124
-
125
-
126
- == Extra Credit
127
-
128
- This plugin includes the work of many wonderful contributors to the Railsphere.
129
- Following are the specific libraries that are distributed with Comatose. If I've
130
- missed someone/something please let me know.
131
-
132
- * Liquid (http://home.leetsoft.com/liquid) by Tobias Luetke (http://blog.leetsoft.com)
133
- * RedCloth (http://whytheluckystiff.net/ruby/redcloth) by why the lucky stiff (http://whytheluckystiff.net)
134
- * Acts as Versioned (http://ar-versioned.rubyforge.org) by Rick Olsen (http://weblog.techno-weenie.net)
135
- * Behaviors (http://behaviors.rubyforge.org) by Atomic Object LLC -- very nice BDD-like testing library
136
-
137
- == Feedback
138
-
139
- I’ve released Comatose under the MIT license. Which basically means you
140
- can use it however you want.
141
-
142
- Don't forget to read the 'Getting Started' guide located on the RubyForge
143
- project site: http://comatose.rubyforge.org/getting-started-guide
144
-
145
- If you like it, hate it, or have some ideas for new features, let me know!
146
-
147
- matt at elucidata dot net
148
-