lucy_cms 0.0.3 → 0.0.4

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 (59) hide show
  1. data/README.md +1 -1
  2. data/Rakefile +3 -2
  3. data/VERSION +1 -1
  4. data/app/controllers/cms_admin/base_controller.rb +2 -2
  5. data/app/controllers/cms_admin/sites_controller.rb +6 -4
  6. data/app/controllers/cms_admin/upload_dirs_controller.rb +1 -1
  7. data/app/controllers/cms_content_controller.rb +1 -1
  8. data/app/models/cms_layout.rb +3 -3
  9. data/app/models/cms_page.rb +3 -3
  10. data/app/models/cms_snippet.rb +3 -3
  11. data/app/views/cms_admin/pages/_form_blocks.html.erb +1 -1
  12. data/app/views/cms_admin/sites/_form.html.erb +1 -1
  13. data/app/views/cms_admin/upload_dirs/conflict.html.erb +3 -3
  14. data/app/views/cms_admin/upload_dirs/index.html.erb +1 -1
  15. data/app/views/cms_admin/upload_dirs/show.html.erb +1 -1
  16. data/app/views/layouts/cms_admin.html.erb +2 -2
  17. data/config.ru +1 -1
  18. data/config/application.rb +2 -2
  19. data/config/environment.rb +1 -1
  20. data/config/environments/development.rb +1 -1
  21. data/config/environments/production.rb +1 -1
  22. data/config/environments/test.rb +1 -1
  23. data/config/initializers/{LucyCMS.rb → lucy_cms.rb} +4 -4
  24. data/config/routes.rb +2 -2
  25. data/lib/LucyCMS/acts_as_tree.rb +3 -3
  26. data/lib/LucyCMS/cms_tag.rb +4 -4
  27. data/lib/LucyCMS/cms_tag/field_datetime.rb +0 -4
  28. data/lib/LucyCMS/cms_tag/field_integer.rb +0 -4
  29. data/lib/LucyCMS/cms_tag/field_string.rb +0 -4
  30. data/lib/LucyCMS/cms_tag/field_text.rb +0 -4
  31. data/lib/LucyCMS/cms_tag/helper.rb +0 -4
  32. data/lib/LucyCMS/cms_tag/page_datetime.rb +0 -4
  33. data/lib/LucyCMS/cms_tag/page_integer.rb +0 -4
  34. data/lib/LucyCMS/cms_tag/page_rich_text.rb +0 -4
  35. data/lib/LucyCMS/cms_tag/page_string.rb +0 -4
  36. data/lib/LucyCMS/cms_tag/page_text.rb +0 -4
  37. data/lib/LucyCMS/cms_tag/partial.rb +0 -4
  38. data/lib/LucyCMS/cms_tag/snippet.rb +0 -4
  39. data/lib/LucyCMS/configuration.rb +11 -11
  40. data/lib/LucyCMS/controller_methods.rb +3 -3
  41. data/lib/LucyCMS/engine.rb +2 -2
  42. data/lib/LucyCMS/form_builder.rb +1 -1
  43. data/lib/LucyCMS/site_form_builder.rb +10 -10
  44. data/lib/LucyCMS/view_hooks.rb +1 -1
  45. data/lib/LucyCMS/view_methods.rb +5 -7
  46. data/lib/generators/README +0 -12
  47. data/lib/generators/cms_generator.rb +1 -1
  48. data/lib/{LucyCMS.rb → lucy_cms.rb} +8 -2
  49. data/lucy_cms.gemspec +4 -4
  50. data/test/functional/cms_content_controller_test.rb +2 -2
  51. data/test/integration/rake_tasks_test.rb +3 -3
  52. data/test/integration/render_cms_seed_test.rb +3 -3
  53. data/test/integration/sites_test.rb +1 -1
  54. data/test/test_helper.rb +1 -1
  55. data/test/unit/cms_configuration_test.rb +1 -1
  56. data/test/unit/cms_layout_test.rb +5 -5
  57. data/test/unit/cms_page_test.rb +5 -5
  58. data/test/unit/cms_snippet_test.rb +5 -5
  59. metadata +5 -5
data/README.md CHANGED
@@ -37,7 +37,7 @@ Before creating pages and populating them with content you need to create a layo
37
37
 
38
38
  Once you have a layout, you may start creating pages and populating content. It's that easy.
39
39
 
40
- Many options can be found and changed in the cms initializer: /config/initializers/LucyCMS.rb
40
+ Many options can be found and changed in the cms initializer: /config/initializers/lucy_cms.rb
41
41
 
42
42
  CMS Tags
43
43
  --------
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require File.expand_path('../config/application', __FILE__)
5
5
  require 'rubygems'
6
6
  require 'rake'
7
7
 
8
- LucyCMS::Application.load_tasks
8
+ LucyCms::Application.load_tasks
9
9
 
10
10
  begin
11
11
  require 'jeweler'
@@ -14,7 +14,8 @@ begin
14
14
  gem.summary = 'LucyCMS is a Rails 3 CMS that lives inside your Rails App, but does not interfere with it'
15
15
  gem.description = ''
16
16
  gem.email = 'lucy@lucysoft.com'
17
- gem.authors = ['Lucysoft']
17
+ gem.authors = ['Lucy']
18
+
18
19
  end
19
20
  Jeweler::GemcutterTasks.new
20
21
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -18,8 +18,8 @@ protected
18
18
  redirect_to new_cms_admin_site_path
19
19
  else
20
20
  @cms_site = CmsSite.first
21
- if @cms_site.version < LucyCMS.config.version
22
- @cms_site.version = LucyCMS.config.version
21
+ if @cms_site.version < LucyCms.config.version
22
+ @cms_site.version = LucyCms.config.version
23
23
  @cms_site.save
24
24
  end
25
25
  end
@@ -60,10 +60,12 @@ class CmsAdmin::SitesController < CmsAdmin::BaseController
60
60
  protected
61
61
 
62
62
  def check_admin
63
- if ! CmsUser.find_by_id(session[:cms_user_id]).admin?
64
- flash[:error] = 'You must be an Admin to change the Setup'
65
- redirect_to :action => 'setup'
66
- end
63
+ unless CmsUser.count == 0
64
+ if ! CmsUser.find_by_id(session[:cms_user_id]).admin?
65
+ flash[:error] = 'You must be an Admin to change the Setup'
66
+ redirect_to :action => 'setup'
67
+ end
68
+ end
67
69
  end
68
70
 
69
71
  end
@@ -69,7 +69,7 @@ class CmsAdmin::UploadDirsController < CmsAdmin::BaseController
69
69
  protected
70
70
 
71
71
  def check_and_set_base_dir
72
- @base_dir = File.join(Rails.public_path,LucyCMS.config.cms_upload_directory)
72
+ @base_dir = File.join(Rails.public_path,LucyCms.config.cms_upload_directory)
73
73
  if File::exists?(@base_dir) && !File::directory?(@base_dir)
74
74
  flash[:error] = 'File conflict'
75
75
  redirect_to :action => :conflict
@@ -4,7 +4,7 @@ class CmsContentController < ApplicationController
4
4
  before_filter :load_cms_page, :only => :render_html
5
5
  before_filter :load_cms_layout, :only => [:render_css, :render_js]
6
6
 
7
- caches_page :render_css, :render_js, :if => LucyCMS.config.enable_caching
7
+ caches_page :render_css, :render_js, :if => LucyCms.config.enable_caching
8
8
 
9
9
  def render_html(status = 200)
10
10
  layout = @cms_page.cms_layout.app_layout.blank?? false : @cms_page.cms_layout.app_layout
@@ -49,8 +49,8 @@ class CmsLayout < ActiveRecord::Base
49
49
 
50
50
  # Attempting to initialize layout object from yaml file that is found in config.seed_data_path
51
51
  def self.load_from_file(site, slug)
52
- return nil if LucyCMS.config.seed_data_path.blank?
53
- file_path = "#{LucyCMS.config.seed_data_path}/#{site.hostname}/layouts/#{slug}.yml"
52
+ return nil if LucyCms.config.seed_data_path.blank?
53
+ file_path = "#{LucyCms.config.seed_data_path}/#{site.hostname}/layouts/#{slug}.yml"
54
54
  return nil unless File.exists?(file_path)
55
55
  attributes = YAML.load_file(file_path).symbolize_keys!
56
56
  attributes[:parent] = CmsLayout.load_from_file(site, attributes[:parent])
@@ -63,7 +63,7 @@ class CmsLayout < ActiveRecord::Base
63
63
  # Wrapper around load_from_file and find_by_slug
64
64
  # returns layout object if loaded / found
65
65
  def self.load_for_slug!(site, slug)
66
- if LucyCMS.configuration.seed_data_path
66
+ if LucyCms.configuration.seed_data_path
67
67
  load_from_file(site, slug)
68
68
  else
69
69
  site.cms_layouts.find_by_slug(slug)
@@ -56,9 +56,9 @@ class CmsPage < ActiveRecord::Base
56
56
  # Attempting to initialize page object from yaml file that is found in config.seed_data_path
57
57
  # This file defines all attributes of the page plus all the block information
58
58
  def self.load_from_file(site, path)
59
- return nil if LucyCMS.config.seed_data_path.blank?
59
+ return nil if LucyCms.config.seed_data_path.blank?
60
60
  path = (path == '/')? '/index' : path.to_s.chomp('/')
61
- file_path = "#{LucyCMS.config.seed_data_path}/#{site.hostname}/pages#{path}.yml"
61
+ file_path = "#{LucyCms.config.seed_data_path}/#{site.hostname}/pages#{path}.yml"
62
62
  return nil unless File.exists?(file_path)
63
63
  attributes = YAML.load_file(file_path).symbolize_keys!
64
64
  attributes[:cms_layout] = CmsLayout.load_from_file(site, attributes[:cms_layout])
@@ -72,7 +72,7 @@ class CmsPage < ActiveRecord::Base
72
72
  # Wrapper around load_from_file and find_by_full_path
73
73
  # returns page object if loaded / found
74
74
  def self.load_for_full_path!(site, path)
75
- if LucyCMS.configuration.seed_data_path
75
+ if LucyCms.configuration.seed_data_path
76
76
  load_from_file(site, path)
77
77
  else
78
78
  site.cms_pages.find_by_full_path(path)
@@ -29,8 +29,8 @@ class CmsSnippet < ActiveRecord::Base
29
29
 
30
30
  # Attempting to initialize snippet object from yaml file that is found in config.seed_data_path
31
31
  def self.load_from_file(site, name)
32
- return nil if LucyCMS.config.seed_data_path.blank?
33
- file_path = "#{LucyCMS.config.seed_data_path}/#{site.hostname}/snippets/#{name}.yml"
32
+ return nil if LucyCms.config.seed_data_path.blank?
33
+ file_path = "#{LucyCms.config.seed_data_path}/#{site.hostname}/snippets/#{name}.yml"
34
34
  return nil unless File.exists?(file_path)
35
35
  attributes = YAML.load_file(file_path).symbolize_keys!
36
36
  new(attributes)
@@ -41,7 +41,7 @@ class CmsSnippet < ActiveRecord::Base
41
41
  # Wrapper around load_from_file and find_by_slug
42
42
  # returns layout object if loaded / found
43
43
  def self.load_for_slug!(site, slug)
44
- if LucyCMS.configuration.seed_data_path
44
+ if LucyCms.configuration.seed_data_path
45
45
  load_from_file(site, slug)
46
46
  else
47
47
  # FIX: This a bit odd... Snippet is used as a tag, so sometimes there's no site scope
@@ -1,5 +1,5 @@
1
1
  <div id='form_blocks'>
2
- <%= fields_for :cms_blocks, :builder => LucyCMS::FormBuilder do |cms_blocks| %>
2
+ <%= fields_for :cms_blocks, :builder => LucyCms::FormBuilder do |cms_blocks| %>
3
3
  <% @cms_page.cms_tags(true).each do |tag| %>
4
4
  <%= cms_blocks.send(tag.class.name.underscore.downcase.idify, tag)%>
5
5
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= form.hidden_field :version, :value => LucyCMS.config.version %>
1
+ <%= form.hidden_field :version, :value => LucyCms.config.version %>
2
2
  <%= form.text_field :label, :label => 'Title'%>
3
3
  <%= form.text_field :hostname, :label => 'Hostname<br>(www.example.com)' %>
4
4
  <div class='form_element radio_button_element '>
@@ -1,12 +1,12 @@
1
1
  <h1>Houston we have a problem</h1>
2
2
 
3
- <%= LucyCMS.config.cms_title %> uses a directory named <b><%= LucyCMS.config.cms_upload_directory %></b> to put all uploaded content in. This directory is located in <b><%=Rails.public_path%></b>.<br>
3
+ <%= LucyCms.config.cms_title %> uses a directory named <b><%= LucyCms.config.cms_upload_directory %></b> to put all uploaded content in. This directory is located in <b><%=Rails.public_path%></b>.<br>
4
4
  <br>
5
- Unfortunatly there is already a file named <b><%= LucyCMS.config.cms_upload_directory %></b> in this directory.<br>
5
+ Unfortunatly there is already a file named <b><%= LucyCms.config.cms_upload_directory %></b> in this directory.<br>
6
6
  <br>
7
7
  This problem can be fixed in two ways:<br>
8
8
  <br>
9
9
  1. Delete or rename this file.<br>
10
- 2. Edit the setting <i>config.cms_upload_directory</i> in the <b>LucyCMS.rb</b> file located in the <b>config/initializers/</b> directory to use a directory name that is not already in use.<br>
10
+ 2. Edit the setting <i>config.cms_upload_directory</i> in the <b>lucy_cms.rb</b> file located in the <b>config/initializers/</b> directory to use a directory name that is not already in use.<br>
11
11
  <br>
12
12
  Sorry for the inconvenience
@@ -1,6 +1,6 @@
1
1
  <%= link_to span_tag('Create New Directory'), new_cms_admin_upload_dir_path, :class => 'big button' %>
2
2
  <h1>Upload Directories</h1>
3
- <b>Base Directory: /<%=LucyCMS.config.cms_upload_directory%></b><br>
3
+ <b>Base Directory: /<%=LucyCms.config.cms_upload_directory%></b><br>
4
4
  <br>
5
5
  <ul class='list'>
6
6
  <% @cms_upload_dirs.each do |cms_upload_dir| %>
@@ -3,7 +3,7 @@
3
3
  <a id='uploader_button' href='#' class='big button'>Upload Files</a>
4
4
  </div>
5
5
  </div>
6
- <h1>Directory: /<%=LucyCMS.config.cms_upload_directory%>/<%=@cms_upload_dir.label%></h1>
6
+ <h1>Directory: /<%=LucyCms.config.cms_upload_directory%>/<%=@cms_upload_dir.label%></h1>
7
7
 
8
8
  <ul class='list' id = 'uploaded_files'>
9
9
  <% @cms_uploads.each do |cms_upload| %>
@@ -10,8 +10,8 @@
10
10
  <% end %>
11
11
  </title>
12
12
  <%= csrf_meta_tag %>
13
- <%= stylesheet_link_tag :cms, :cache => ('_cms' if LucyCMS.config.enable_caching) %>
14
- <%= javascript_include_tag :cms, :cache => ('_cms' if LucyCMS.config.enable_caching) %>
13
+ <%= stylesheet_link_tag :cms, :cache => ('_cms' if LucyCms.config.enable_caching) %>
14
+ <%= javascript_include_tag :cms, :cache => ('_cms' if LucyCms.config.enable_caching) %>
15
15
  <%= yield :head %>
16
16
  <%= cms_hook :html_head %>
17
17
  </head>
data/config.ru CHANGED
@@ -1,4 +1,4 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
3
  require ::File.expand_path('../config/environment', __FILE__)
4
- run LucyCMS::Application
4
+ run LucyCms::Application
@@ -6,10 +6,10 @@ require 'rails/all'
6
6
  # you've limited to :test, :development, or :production.
7
7
  Bundler.require(:default, Rails.env) if defined?(Bundler)
8
8
 
9
- module LucyCMS
9
+ module LucyCms
10
10
  class Application < Rails::Application
11
11
 
12
- require 'LucyCMS'
12
+ require 'lucy_cms'
13
13
 
14
14
  # Settings in config/environments/* take precedence over those specified here.
15
15
  # Application configuration should go into files in config/initializers
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the rails application
5
- LucyCMS::Application.initialize!
5
+ LucyCms::Application.initialize!
@@ -1,4 +1,4 @@
1
- LucyCMS::Application.configure do
1
+ LucyCms::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- LucyCMS::Application.configure do
1
+ LucyCms::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # The production environment is meant for finished, "live" apps.
@@ -1,4 +1,4 @@
1
- LucyCMS::Application.configure do
1
+ LucyCms::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -1,4 +1,4 @@
1
- LucyCMS.configure do |config|
1
+ LucyCms.configure do |config|
2
2
 
3
3
  # Default url to access admin area is http://yourhost/cms-admin/
4
4
  # You can change 'cms-admin' to 'admin', for example.
@@ -32,6 +32,6 @@ end
32
32
 
33
33
  # If you need to inject some html in cms admin views you can define what partial
34
34
  # should be rendered into the following areas:
35
- # ComfortableMexicanSofa::ViewHooks.add(:navigation, '/layouts/admin/navigation')
36
- # ComfortableMexicanSofa::ViewHooks.add(:html_head, '/layouts/admin/html_head')
37
- # ComfortableMexicanSofa::ViewHooks.add(:page_form, '/layouts/admin/page_form')
35
+ # LucyCms::ViewHooks.add(:navigation, '/layouts/admin/navigation')
36
+ # LucyCms::ViewHooks.add(:html_head, '/layouts/admin/html_head')
37
+ # LucyCms::ViewHooks.add(:page_form, '/layouts/admin/page_form')
data/config/routes.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
- namespace :cms_admin, :path => LucyCMS.config.admin_route_prefix, :except => :show do
4
- get '/' => redirect(LucyCMS.config.admin_route_redirect)
3
+ namespace :cms_admin, :path => LucyCms.config.admin_route_prefix, :except => :show do
4
+ get '/' => redirect(LucyCms.config.admin_route_redirect)
5
5
  resources :pages do
6
6
  member do
7
7
  match :form_blocks
@@ -1,4 +1,4 @@
1
- module LucyCMS::ActsAsTree
1
+ module LucyCms::ActsAsTree
2
2
 
3
3
  def self.included(base)
4
4
  base.extend(ClassMethods)
@@ -27,7 +27,7 @@ module LucyCMS::ActsAsTree
27
27
  :dependent => configuration[:dependent]
28
28
 
29
29
  class_eval <<-EOV
30
- include LucyCMS::ActsAsTree::InstanceMethods
30
+ include LucyCms::ActsAsTree::InstanceMethods
31
31
 
32
32
  scope :roots,
33
33
  :conditions => "#{configuration[:foreign_key]} IS NULL",
@@ -99,4 +99,4 @@ module LucyCMS::ActsAsTree
99
99
  end
100
100
  end
101
101
 
102
- ActiveRecord::Base.send :include, LucyCMS::ActsAsTree
102
+ ActiveRecord::Base.send :include, LucyCms::ActsAsTree
@@ -18,7 +18,7 @@ module CmsTag
18
18
  # /\{\{\s*?cms:page:(\w+)\}\}/
19
19
  # will match tags like these:
20
20
  # {{cms:page:my_label}}
21
- def regex_tag_signature
21
+ def regex_tag_signature(label = nil)
22
22
  nil
23
23
  end
24
24
 
@@ -56,7 +56,7 @@ module CmsTag
56
56
  # Example:
57
57
  # /<\{\s*?cms:page:tag_label\}/
58
58
  def regex_tag_signature
59
- nil
59
+ self.class.regex_tag_signature(label)
60
60
  end
61
61
 
62
62
  # Content that is accociated with Tag instance.
@@ -68,7 +68,7 @@ module CmsTag
68
68
  # as a default.
69
69
  def render
70
70
  # cleaning content from possible irb stuff. Partial and Helper tags are OK.
71
- if LucyCMS.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class)
71
+ if ComfortableMexicanSofa.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class)
72
72
  content.to_s.gsub('<%', '&lt;%').gsub('%>', '%&gt;')
73
73
  else
74
74
  content.to_s
@@ -116,4 +116,4 @@ private
116
116
  def self.tag_classes
117
117
  @@tag_classes ||= []
118
118
  end
119
- end
119
+ end
@@ -7,10 +7,6 @@ class CmsTag::FieldDateTime < CmsBlock
7
7
  /\{\{\s*cms:field:(#{label}):datetime\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::FieldInteger < CmsBlock
7
7
  /\{\{\s*cms:field:(#{label}):integer\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::FieldString < CmsBlock
7
7
  /\{\{\s*cms:field:(#{label}):?(?:string)?\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::FieldText < CmsBlock
7
7
  /\{\{\s*cms:field:(#{label}):?(?:text)?\s*?\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -9,10 +9,6 @@ class CmsTag::Helper
9
9
  /\{\{\s*cms:helper:(#{label}):?(.*?)\s*\}\}/
10
10
  end
11
11
 
12
- def regex_tag_signature
13
- self.class.regex_tag_signature(label)
14
- end
15
-
16
12
  def content
17
13
  "<%= #{label}(#{params.split(':').collect{|p| "'#{p}'"}.join(', ')}) %>"
18
14
  end
@@ -7,10 +7,6 @@ class CmsTag::PageDateTime < CmsBlock
7
7
  /\{\{\s*cms:page:(#{label}):datetime\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::PageInteger < CmsBlock
7
7
  /\{\{\s*cms:page:(#{label}):integer\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::PageRichText < CmsBlock
7
7
  /\{\{\s*cms:page:(#{label}):rich_text\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::PageString < CmsBlock
7
7
  /\{\{\s*cms:page:(#{label}):string\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -7,10 +7,6 @@ class CmsTag::PageText < CmsBlock
7
7
  /\{\{\s*cms:page:(#{label}):?(?:text)?\s*\}\}/
8
8
  end
9
9
 
10
- def regex_tag_signature
11
- self.class.regex_tag_signature(label)
12
- end
13
-
14
10
  def content=(value)
15
11
  write_attribute(:content, value)
16
12
  end
@@ -9,10 +9,6 @@ class CmsTag::Partial
9
9
  /\{\{\s*cms:partial:(#{label}):?(.*?)\s*\}\}/
10
10
  end
11
11
 
12
- def regex_tag_signature
13
- self.class.regex_tag_signature(label)
14
- end
15
-
16
12
  def content
17
13
  ps = params.split(':').collect_with_index{|p, i| ":param_#{i+1} => '#{p}'"}.join(', ')
18
14
  "<%= render :partial => '#{label}'#{ps.blank?? nil : ", :locals => {#{ps}}"} %>"
@@ -11,10 +11,6 @@ class CmsTag::Snippet < CmsSnippet
11
11
  /\{\{\s*cms:snippet:(#{label})\s*\}\}/
12
12
  end
13
13
 
14
- def regex_tag_signature
15
- self.class.regex_tag_signature(label)
16
- end
17
-
18
14
  def content
19
15
  self.read_attribute(:content)
20
16
  end
@@ -1,13 +1,7 @@
1
- class LucyCMS::Configuration
1
+ class LucyCms::Configuration
2
2
 
3
- # Location of YAML files that can be used to render pages instead of pulling
4
- # data from the database. Not active if not specified.
5
- attr_accessor :seed_data_path
3
+ attr_accessor :version
6
4
 
7
- attr_accessor :version
8
-
9
- attr_accessor :cms_upload_directory
10
-
11
5
  # Default url to access admin area is http://yourhost/cms-admin/
12
6
  # You can change 'cms-admin' to 'admin', for example.
13
7
  attr_accessor :admin_route_prefix
@@ -16,6 +10,12 @@ class LucyCMS::Configuration
16
10
  # to something else
17
11
  attr_accessor :admin_route_redirect
18
12
 
13
+ # Location of YAML files that can be used to render pages instead of pulling
14
+ # data from the database. Not active if not specified.
15
+ attr_accessor :seed_data_path
16
+
17
+ attr_accessor :cms_upload_directory
18
+
19
19
  # Not allowing irb code to be run inside page content. True by default.
20
20
  attr_accessor :disable_irb
21
21
 
@@ -24,11 +24,11 @@ class LucyCMS::Configuration
24
24
 
25
25
  # Configuration defaults
26
26
  def initialize
27
- @seed_data_path = nil
28
- @version = '0.0.2'
29
- @cms_upload_directory = 'common'
27
+ @version = '0.0.4'
30
28
  @admin_route_prefix = 'cms-admin'
31
29
  @admin_route_redirect = "/#{@admin_route_prefix}/pages"
30
+ @seed_data_path = nil
31
+ @cms_upload_directory = 'common'
32
32
  @disable_irb = true
33
33
  @enable_caching = true
34
34
  end
@@ -1,4 +1,4 @@
1
- module LucyCMS::ControllerMethods
1
+ module LucyCms::ControllerMethods
2
2
 
3
3
  def self.included(base)
4
4
 
@@ -21,7 +21,7 @@ module LucyCMS::ControllerMethods
21
21
  def render(options = {}, locals = {}, &block)
22
22
  if options.is_a?(Hash) && path = options.delete(:cms_page)
23
23
  site = CmsSite.find_by_hostname(request.host.downcase)
24
- page = CmsPage.load_from_file(site, path) if site && LucyCMS.configuration.seed_data_path
24
+ page = CmsPage.load_from_file(site, path) if site && LucyCms.configuration.seed_data_path
25
25
  page ||= site && site.cms_pages.find_by_full_path(path)
26
26
  if page
27
27
  cms_app_layout = page.cms_layout.try(:app_layout)
@@ -39,4 +39,4 @@ module LucyCMS::ControllerMethods
39
39
  end
40
40
  end
41
41
 
42
- ActionController::Base.send :include, LucyCMS::ControllerMethods
42
+ ActionController::Base.send :include, LucyCms::ControllerMethods
@@ -1,10 +1,10 @@
1
- require 'LucyCMS'
1
+ require 'lucy_cms'
2
2
  require 'rails'
3
3
  require 'paperclip'
4
4
  require 'active_link_to'
5
5
  require 'mime/types'
6
6
 
7
- module LucyCMS
7
+ module LucyCms
8
8
  class Engine < ::Rails::Engine
9
9
 
10
10
  end
@@ -1,4 +1,4 @@
1
- class LucyCMS::FormBuilder < ActionView::Helpers::FormBuilder
1
+ class LucyCms::FormBuilder < ActionView::Helpers::FormBuilder
2
2
 
3
3
  helpers = field_helpers -
4
4
  %w(hidden_field fields_for) +
@@ -1,4 +1,4 @@
1
- class LucyCMS::SiteFormBuilder < ActionView::Helpers::FormBuilder
1
+ class LucyCms::SiteFormBuilder < ActionView::Helpers::FormBuilder
2
2
 
3
3
  helpers = field_helpers -
4
4
  %w(hidden_field fields_for) +
@@ -23,9 +23,9 @@ class LucyCMS::SiteFormBuilder < ActionView::Helpers::FormBuilder
23
23
  desc = "<div class='desc'>#{desc}</div>"
24
24
  end
25
25
  %(
26
- <div class='site_form_element #{type}_element #{'errors' if errors}'>
27
- <div class='label'>#{label_for(field, options)}</div>
28
- <div class='value'>#{yield}</div>
26
+ <div class='form_element #{type}_element #{'errors' if errors}'>
27
+ <div class='site_label'>#{label_for(field, options)}</div>
28
+ <div class='site_value'>#{yield}</div>
29
29
  #{desc}
30
30
  #{errors}
31
31
  </div>
@@ -35,9 +35,9 @@ class LucyCMS::SiteFormBuilder < ActionView::Helpers::FormBuilder
35
35
  def simple_field(label = nil, content = nil, options = {}, &block)
36
36
  content ||= @template.capture(&block) if block_given?
37
37
  %(
38
- <div class='site_form_element #{options.delete(:class)}'>
39
- <div class='label'>#{label}</div>
40
- <div class='value'>#{content}</div>
38
+ <div class='form_element #{options.delete(:class)}'>
39
+ <div class='site_label'>#{label}</div>
40
+ <div class='site_value'>#{content}</div>
41
41
  </div>
42
42
  ).html_safe
43
43
  end
@@ -69,9 +69,9 @@ class LucyCMS::SiteFormBuilder < ActionView::Helpers::FormBuilder
69
69
  @template.send(options[:content_field_method], 'cms_page[cms_blocks_attributes][][content]', tag.content, :id => nil, :class => field_css_class)
70
70
 
71
71
  %(
72
- <div class='site_form_element #{css_class}'>
73
- <div class='label'>#{label}</div>
74
- <div class='value'>
72
+ <div class='form_element #{css_class}'>
73
+ <div class='site_label'>#{label}</div>
74
+ <div class='site_value'>
75
75
  #{field}
76
76
  #{@template.hidden_field_tag('cms_page[cms_blocks_attributes][][label]', tag.label, :id => nil)}
77
77
  #{@template.hidden_field_tag('cms_page[cms_blocks_attributes][][id]', tag.record_id, :id => nil) if tag.record_id}
@@ -1,4 +1,4 @@
1
- module LucyCMS::ViewHooks
1
+ module LucyCms::ViewHooks
2
2
 
3
3
  # Array of declared hooks
4
4
  def self.hooks
@@ -1,15 +1,14 @@
1
- module LucyCMS::ViewMethods
1
+ module LucyCms::ViewMethods
2
2
  # Wrapper around CmsFormBuilder
3
3
  def cms_form_for(record_or_name_or_array, *args, &proc)
4
4
  options = args.extract_options!
5
- form_for(record_or_name_or_array, *(args << options.merge(:builder => LucyCMS::FormBuilder)), &proc)
5
+ form_for(record_or_name_or_array, *(args << options.merge(:builder => LucyCms::FormBuilder)), &proc)
6
6
  end
7
7
 
8
8
  def cms_site_form_for(record_or_name_or_array, *args, &proc)
9
9
  options = args.extract_options!
10
- form_for(record_or_name_or_array, *(args << options.merge(:builder => LucyCMS::SiteFormBuilder)), &proc)
10
+ form_for(record_or_name_or_array, *(args << options.merge(:builder => LucyCms::SiteFormBuilder)), &proc)
11
11
  end
12
-
13
12
 
14
13
  # Wrapper for <span>
15
14
  def span_tag(*args)
@@ -23,7 +22,7 @@ module LucyCMS::ViewMethods
23
22
 
24
23
  # Injects some content somewhere inside cms admin area
25
24
  def cms_hook(name, options = {})
26
- LucyCMS::ViewHooks.render(name, self, options)
25
+ LucyCms::ViewHooks.render(name, self, options)
27
26
  end
28
27
 
29
28
  # Content of a snippet. Example:
@@ -44,7 +43,7 @@ module LucyCMS::ViewMethods
44
43
  end
45
44
  end
46
45
 
47
- ActionView::Base.send :include, LucyCMS::ViewMethods
46
+ ActionView::Base.send :include, LucyCms::ViewMethods
48
47
 
49
48
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :cms => [
50
49
  'LucyCMS/jquery',
@@ -62,7 +61,6 @@ ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :cms => [
62
61
  'LucyCMS/structure',
63
62
  'LucyCMS/typography',
64
63
  'LucyCMS/form',
65
- 'LucyCMS/site_form',
66
64
  'LucyCMS/content',
67
65
  '/javascripts/LucyCMS/jquery-ui/jquery-ui'
68
66
  ]
@@ -1,17 +1,5 @@
1
- ____ __ _ _ _
2
- / ___|___ _ __ ___ / _| ___ _ __| |_ __ _| |__ | | ___
3
- | | / _ \| '_ ` _ \| |_ / _ \| '__| __/ _` | '_ \| |/ _ \
4
- | |__| (_) | | | | | | _| (_) | | | || (_| | |_) | | __/
5
- \____\___/|_| |_| |_|_| \___/|_| \__\__,_|_.__/|_|\___|
6
- __ __ _ ____ __
7
- | \/ | _____ _(_) ___ __ _ _ __ / ___| ___ / _| __ _
8
- | |\/| |/ _ \ \/ / |/ __/ _` | '_ \ \___ \ / _ \| |_ / _` |
9
- | | | | __/> <| | (_| (_| | | | | ___) | (_) | _| (_| |
10
- |_| |_|\___/_/\_\_|\___\__,_|_| |_| |____/ \___/|_| \__,_|
11
-
12
1
  Hey! Everything is almost done. Please don't forget to
13
2
 
14
3
  * run migrations -> `rake db:migrate`
15
4
 
16
5
  After that go to http://your-awesome-app/cms-admin to start populating content.
17
- Default username and password are: username // password
@@ -18,7 +18,7 @@ class CmsGenerator < Rails::Generators::Base
18
18
  end
19
19
 
20
20
  def generate_initialization
21
- copy_file 'config/initializers/LucyCMS.rb', 'config/initializers/LucyCMS.rb'
21
+ copy_file 'config/initializers/lucy_cms.rb', 'config/initializers/lucy_cms.rb'
22
22
  end
23
23
 
24
24
  def generate_public_assets
@@ -1,5 +1,5 @@
1
1
  # Loading engine only if this is not a standalone installation
2
- unless defined? LucyCMS::Application
2
+ unless defined? LucyCms::Application
3
3
  require File.expand_path('LucyCMS/engine', File.dirname(__FILE__))
4
4
  end
5
5
 
@@ -22,14 +22,20 @@ Dir.glob(File.expand_path('LucyCMS/cms_tag/*.rb', File.dirname(__FILE__))).each
22
22
  require tag_path
23
23
  end
24
24
 
25
- module LucyCMS
25
+ module LucyCms
26
26
 
27
27
  class << self
28
28
 
29
+ # Modify CMS configuration
30
+ # Example:
31
+ # ComfortableMexicanSofa.configure do |config|
32
+ # config.cms_title = 'Comfortable Mexican Sofa'
33
+ # end
29
34
  def configure
30
35
  yield configuration
31
36
  end
32
37
 
38
+ # Accessor for ComfortableMexicanSofa::Configuration
33
39
  def configuration
34
40
  @configuration ||= Configuration.new
35
41
  end
data/lucy_cms.gemspec CHANGED
@@ -5,10 +5,10 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lucy_cms}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Lucysoft"]
11
+ s.authors = ["Lucy"]
12
12
  s.date = %q{2011-03-09}
13
13
  s.description = %q{}
14
14
  s.email = %q{lucy@lucysoft.com}
@@ -85,7 +85,7 @@ Gem::Specification.new do |s|
85
85
  "config/environments/development.rb",
86
86
  "config/environments/production.rb",
87
87
  "config/environments/test.rb",
88
- "config/initializers/LucyCMS.rb",
88
+ "config/initializers/lucy_cms.rb",
89
89
  "config/initializers/mime_types.rb",
90
90
  "config/locales/en.yml",
91
91
  "config/routes.rb",
@@ -97,7 +97,6 @@ Gem::Specification.new do |s|
97
97
  "db/cms_seeds/example.local/snippets/example.yml",
98
98
  "db/migrate/01_create_cms.rb",
99
99
  "db/seeds.rb",
100
- "lib/LucyCMS.rb",
101
100
  "lib/LucyCMS/acts_as_tree.rb",
102
101
  "lib/LucyCMS/cms_tag.rb",
103
102
  "lib/LucyCMS/cms_tag/field_datetime.rb",
@@ -122,6 +121,7 @@ Gem::Specification.new do |s|
122
121
  "lib/LucyCMS/view_methods.rb",
123
122
  "lib/generators/README",
124
123
  "lib/generators/cms_generator.rb",
124
+ "lib/lucy_cms.rb",
125
125
  "lib/tasks/LucyCMS.rake",
126
126
  "lucy_cms.gemspec",
127
127
  "public/404.html",
@@ -68,7 +68,7 @@ class CmsContentControllerTest < ActionController::TestCase
68
68
  end
69
69
 
70
70
  def test_render_page_with_irb_disabled
71
- assert LucyCMS.config.disable_irb
71
+ assert LucyCms.config.disable_irb
72
72
 
73
73
  irb_page = cms_sites(:default).cms_pages.create!(
74
74
  :label => 'irb',
@@ -88,7 +88,7 @@ class CmsContentControllerTest < ActionController::TestCase
88
88
  end
89
89
 
90
90
  def test_render_page_with_irb_enabled
91
- LucyCMS.config.disable_irb = false
91
+ LucyCms.config.disable_irb = false
92
92
 
93
93
  irb_page = cms_sites(:default).cms_pages.create!(
94
94
  :label => 'irb',
@@ -10,7 +10,7 @@ class RakeTasksTest < ActionDispatch::IntegrationTest
10
10
 
11
11
  def test_layouts_import
12
12
  CmsLayout.destroy_all
13
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
13
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
14
14
 
15
15
  assert_difference 'CmsLayout.count', 2 do
16
16
  capture_rake_output{
@@ -24,7 +24,7 @@ class RakeTasksTest < ActionDispatch::IntegrationTest
24
24
 
25
25
  def test_pages_import
26
26
  CmsPage.destroy_all
27
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
27
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
28
28
 
29
29
  assert_difference ['CmsPage.count', 'CmsBlock.count'], 3 do
30
30
  capture_rake_output{
@@ -38,7 +38,7 @@ class RakeTasksTest < ActionDispatch::IntegrationTest
38
38
 
39
39
  def test_snippets_import
40
40
  CmsSnippet.destroy_all
41
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
41
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
42
42
 
43
43
  assert_difference 'CmsSnippet.count', 1 do
44
44
  capture_rake_output{
@@ -6,7 +6,7 @@ class RenderCmsSeedTest < ActionDispatch::IntegrationTest
6
6
  get '/child/subchild'
7
7
  assert_response 404
8
8
 
9
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
9
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
10
10
 
11
11
  get '/child/subchild'
12
12
  assert_response :success
@@ -14,7 +14,7 @@ class RenderCmsSeedTest < ActionDispatch::IntegrationTest
14
14
  end
15
15
 
16
16
  def test_get_seed_data_page
17
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
17
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
18
18
 
19
19
  get '/'
20
20
  assert_response :success
@@ -23,7 +23,7 @@ class RenderCmsSeedTest < ActionDispatch::IntegrationTest
23
23
  end
24
24
 
25
25
  def test_get_seed_data_css
26
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
26
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
27
27
 
28
28
  get '/cms-css/default'
29
29
  assert_response :success
@@ -43,7 +43,7 @@ class SitesTest < ActionDispatch::IntegrationTest
43
43
  end
44
44
 
45
45
  def test_get_admin_with_no_site_and_no_auto_manage
46
- LucyCMS.config.auto_manage_sites = false
46
+ LucyCms.config.auto_manage_sites = false
47
47
  CmsSite.delete_all
48
48
  assert_no_difference 'CmsSite.count' do
49
49
  http_auth :get, cms_admin_pages_path
data/test/test_helper.rb CHANGED
@@ -14,7 +14,7 @@ class ActiveSupport::TestCase
14
14
 
15
15
  # resetting default configuration
16
16
  def reset_config
17
- LucyCMS.configure do |config|
17
+ LucyCms.configure do |config|
18
18
  config.seed_data_path = nil
19
19
  config.admin_route_prefix = 'cms-admin'
20
20
  config.admin_route_redirect = "/cms-admin/pages"
@@ -3,7 +3,7 @@ require File.expand_path('../test_helper', File.dirname(__FILE__))
3
3
  class CmsConfigurationTest < ActiveSupport::TestCase
4
4
 
5
5
  def test_configuration_presense
6
- assert config = LucyCMS.configuration
6
+ assert config = LucyCms.configuration
7
7
  assert_equal nil, config.seed_data_path
8
8
  assert_equal 'cms-admin', config.admin_route_prefix
9
9
  assert_equal '/cms-admin/pages', config.admin_route_redirect
@@ -87,7 +87,7 @@ class CmsLayoutTest < ActiveSupport::TestCase
87
87
  def test_load_from_file
88
88
  assert !CmsLayout.load_from_file(cms_sites(:default), 'default')
89
89
 
90
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
90
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
91
91
 
92
92
  assert !CmsLayout.load_from_file(cms_sites(:default), 'bogus')
93
93
 
@@ -102,8 +102,8 @@ class CmsLayoutTest < ActiveSupport::TestCase
102
102
  end
103
103
 
104
104
  def test_load_from_file_broken
105
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
106
- error_message = "Failed to load from #{LucyCMS.configuration.seed_data_path}/test.host/layouts/broken.yml"
105
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
106
+ error_message = "Failed to load from #{LucyCms.configuration.seed_data_path}/test.host/layouts/broken.yml"
107
107
  assert_exception_raised RuntimeError, error_message do
108
108
  CmsLayout.load_from_file(cms_sites(:default), 'broken')
109
109
  end
@@ -114,7 +114,7 @@ class CmsLayoutTest < ActiveSupport::TestCase
114
114
  assert !layout.new_record?
115
115
  db_content = layout.content
116
116
 
117
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
117
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
118
118
  assert layout = CmsLayout.load_for_slug!(cms_sites(:default), 'default')
119
119
  assert layout.new_record?
120
120
  file_content = layout.content
@@ -127,7 +127,7 @@ class CmsLayoutTest < ActiveSupport::TestCase
127
127
  end
128
128
  assert !CmsLayout.load_for_slug(cms_sites(:default), 'not_found')
129
129
 
130
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
130
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
131
131
  assert_exception_raised ActiveRecord::RecordNotFound, 'CmsLayout with slug: not_found cannot be found' do
132
132
  CmsLayout.load_for_slug!(cms_sites(:default), 'not_found')
133
133
  end
@@ -155,7 +155,7 @@ class CmsPageTest < ActiveSupport::TestCase
155
155
  def test_load_from_file
156
156
  assert !CmsPage.load_from_file(cms_sites(:default), '/')
157
157
 
158
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
158
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
159
159
 
160
160
  assert !CmsPage.load_from_file(cms_sites(:default), '/bogus')
161
161
 
@@ -178,8 +178,8 @@ class CmsPageTest < ActiveSupport::TestCase
178
178
  end
179
179
 
180
180
  def test_load_from_file_broken
181
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
182
- error_message = "Failed to load from #{LucyCMS.configuration.seed_data_path}/test.host/pages/broken.yml"
181
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
182
+ error_message = "Failed to load from #{LucyCms.configuration.seed_data_path}/test.host/pages/broken.yml"
183
183
  assert_exception_raised RuntimeError, error_message do
184
184
  CmsPage.load_from_file(cms_sites(:default), '/broken')
185
185
  end
@@ -190,7 +190,7 @@ class CmsPageTest < ActiveSupport::TestCase
190
190
  assert !page.new_record?
191
191
  db_content = page.content
192
192
 
193
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
193
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
194
194
  assert page = CmsPage.load_for_full_path!(cms_sites(:default), '/')
195
195
  assert page.new_record?
196
196
  file_content = page.content
@@ -203,7 +203,7 @@ class CmsPageTest < ActiveSupport::TestCase
203
203
  end
204
204
  assert !CmsPage.load_for_full_path(cms_sites(:default), '/invalid_page')
205
205
 
206
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
206
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
207
207
  assert_exception_raised ActiveRecord::RecordNotFound, 'CmsPage with path: /invalid_page cannot be found' do
208
208
  CmsPage.load_for_full_path!(cms_sites(:default), '/invalid_page')
209
209
  end
@@ -23,7 +23,7 @@ class CmsSnippetTest < ActiveSupport::TestCase
23
23
  def test_load_from_file
24
24
  assert !CmsSnippet.load_from_file(cms_sites(:default), 'default')
25
25
 
26
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
26
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
27
27
 
28
28
  assert !CmsSnippet.load_from_file(cms_sites(:default), 'bogus')
29
29
 
@@ -33,8 +33,8 @@ class CmsSnippetTest < ActiveSupport::TestCase
33
33
  end
34
34
 
35
35
  def test_load_from_file_broken
36
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
37
- error_message = "Failed to load from #{LucyCMS.configuration.seed_data_path}/test.host/snippets/broken.yml"
36
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
37
+ error_message = "Failed to load from #{LucyCms.configuration.seed_data_path}/test.host/snippets/broken.yml"
38
38
  assert_exception_raised RuntimeError, error_message do
39
39
  CmsSnippet.load_from_file(cms_sites(:default), 'broken')
40
40
  end
@@ -45,7 +45,7 @@ class CmsSnippetTest < ActiveSupport::TestCase
45
45
  assert !snippet.new_record?
46
46
  db_content = snippet.content
47
47
 
48
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
48
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
49
49
  assert snippet = CmsSnippet.load_for_slug!(cms_sites(:default), 'default')
50
50
  assert snippet.new_record?
51
51
  file_content = snippet.content
@@ -58,7 +58,7 @@ class CmsSnippetTest < ActiveSupport::TestCase
58
58
  end
59
59
  assert !CmsSnippet.load_for_slug(cms_sites(:default), 'not_found')
60
60
 
61
- LucyCMS.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
61
+ LucyCms.configuration.seed_data_path = File.expand_path('../cms_seeds', File.dirname(__FILE__))
62
62
  assert_exception_raised ActiveRecord::RecordNotFound, 'CmsSnippet with slug: not_found cannot be found' do
63
63
  CmsSnippet.load_for_slug!(cms_sites(:default), 'not_found')
64
64
  end
metadata CHANGED
@@ -2,10 +2,10 @@
2
2
  name: lucy_cms
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
- - Lucysoft
8
+ - Lucy
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
@@ -157,7 +157,7 @@ files:
157
157
  - config/environments/development.rb
158
158
  - config/environments/production.rb
159
159
  - config/environments/test.rb
160
- - config/initializers/LucyCMS.rb
160
+ - config/initializers/lucy_cms.rb
161
161
  - config/initializers/mime_types.rb
162
162
  - config/locales/en.yml
163
163
  - config/routes.rb
@@ -169,7 +169,6 @@ files:
169
169
  - db/cms_seeds/example.local/snippets/example.yml
170
170
  - db/migrate/01_create_cms.rb
171
171
  - db/seeds.rb
172
- - lib/LucyCMS.rb
173
172
  - lib/LucyCMS/acts_as_tree.rb
174
173
  - lib/LucyCMS/cms_tag.rb
175
174
  - lib/LucyCMS/cms_tag/field_datetime.rb
@@ -194,6 +193,7 @@ files:
194
193
  - lib/LucyCMS/view_methods.rb
195
194
  - lib/generators/README
196
195
  - lib/generators/cms_generator.rb
196
+ - lib/lucy_cms.rb
197
197
  - lib/tasks/LucyCMS.rake
198
198
  - lucy_cms.gemspec
199
199
  - public/404.html
@@ -347,7 +347,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
347
347
  requirements:
348
348
  - - ">="
349
349
  - !ruby/object:Gem::Version
350
- hash: 3314535251217685534
350
+ hash: 3548456258913461842
351
351
  segments:
352
352
  - 0
353
353
  version: "0"