beef-pages 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,4 +1,6 @@
1
- class Admin::PagesController < Admin::BaseController
1
+ class Admin::PagesController < Admin::BaseController
2
+ include Beef::Pages::HelperMethods
3
+ helper_method :get_template_names
2
4
 
3
5
  def index
4
6
  @pages = Page.top
@@ -96,18 +98,5 @@ class Admin::PagesController < Admin::BaseController
96
98
  Page.find(params[:id]).move_lower
97
99
  redirect_to :back
98
100
  end
99
-
100
- protected
101
-
102
- def get_template_names
103
- templates = []
104
- Dir.glob("#{RAILS_ROOT}/app/views/pages/templates/*"){|f| match = /\/([^\/]+)\.html\.erb$/.match(f); templates << match[1] unless match.nil? }
105
- # Move default to top if it exists
106
- if default = templates.delete('default')
107
- templates.insert(0, default)
108
- end
109
- templates.sort
110
- end
111
- helper_method :get_template_names
112
101
 
113
102
  end
@@ -1,5 +1,6 @@
1
1
  class PagesController < ApplicationController
2
-
2
+ include Beef::Pages::HelperMethods
3
+
3
4
  def show
4
5
  @page = Page.published.find_by_permalink(params[:id])
5
6
 
data/app/models/page.rb CHANGED
@@ -9,7 +9,7 @@ class Page < ActiveRecord::Base
9
9
  acts_as_tree
10
10
  acts_as_list :scope => :parent_id
11
11
  acts_as_textiled :body
12
- acts_as_taggable_on :tags
12
+ acts_as_taggable
13
13
 
14
14
  before_save :keep_position_sane
15
15
 
data/lib/pages.rb CHANGED
@@ -0,0 +1,15 @@
1
+ module Beef
2
+ module Pages
3
+ module HelperMethods
4
+ def get_template_names
5
+ templates = []
6
+ Dir.glob("#{RAILS_ROOT}/app/views/pages/templates/*"){|f| match = /\/([^\/]+)\.html\.erb$/.match(f); templates << match[1] unless match.nil? }
7
+ # Move default to top if it exists
8
+ if default = templates.delete('default')
9
+ templates.insert(0, default)
10
+ end
11
+ templates.sort
12
+ end
13
+ end
14
+ end
15
+ end
data/pages.gemspec ADDED
@@ -0,0 +1,60 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{pages}
5
+ s.version = "0.1.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Steve England"]
9
+ s.date = %q{2009-07-13}
10
+ s.email = %q{steve@wearebeef.co.uk}
11
+ s.extra_rdoc_files = [
12
+ "LICENSE",
13
+ "README.rdoc"
14
+ ]
15
+ s.files = [
16
+ ".document",
17
+ ".gitignore",
18
+ "LICENSE",
19
+ "README.rdoc",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "app/controllers/admin/pages_controller.rb",
23
+ "app/controllers/pages_controller.rb",
24
+ "app/helpers/pages_helper.rb",
25
+ "app/models/page.rb",
26
+ "app/views/admin/pages/_page.html.erb",
27
+ "app/views/admin/pages/feature.html.erb",
28
+ "app/views/admin/pages/index.html.erb",
29
+ "app/views/admin/pages/preview.rjs",
30
+ "app/views/admin/pages/show.html.erb",
31
+ "config/routes.rb",
32
+ "generators/page_tempate/page_template_generator.rb",
33
+ "generators/page_tempate/templates/default.html.erb",
34
+ "generators/pages_migration/pages_migration_generator.rb",
35
+ "generators/pages_migration/templates/migration.rb",
36
+ "lib/pages.rb",
37
+ "pages.gemspec",
38
+ "test/pages_test.rb",
39
+ "test/test_helper.rb"
40
+ ]
41
+ s.homepage = %q{http://github.com/stengland/pages}
42
+ s.rdoc_options = ["--charset=UTF-8"]
43
+ s.require_paths = ["lib"]
44
+ s.rubygems_version = %q{1.3.3}
45
+ s.summary = %q{Pages engine}
46
+ s.test_files = [
47
+ "test/pages_test.rb",
48
+ "test/test_helper.rb"
49
+ ]
50
+
51
+ if s.respond_to? :specification_version then
52
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
53
+ s.specification_version = 3
54
+
55
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
56
+ else
57
+ end
58
+ else
59
+ end
60
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beef-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve England
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-24 00:00:00 -07:00
12
+ date: 2009-07-13 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -44,6 +44,7 @@ files:
44
44
  - generators/pages_migration/pages_migration_generator.rb
45
45
  - generators/pages_migration/templates/migration.rb
46
46
  - lib/pages.rb
47
+ - pages.gemspec
47
48
  - test/pages_test.rb
48
49
  - test/test_helper.rb
49
50
  has_rdoc: false