beef-acts_as_content_node 0.1.5 → 0.1.6

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/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "acts_as_content_node"
8
- gem.summary = %Q{Common functions for an record used as content of a website. Generator for cms and front end}
8
+ gem.summary = %Q{Common functions for a record used as content of a website. Generator for cms and front end}
9
9
  gem.email = "steve@wearebeef.co.uk"
10
10
  gem.homepage = "http://github.com/beef/acts_as_content_node"
11
11
  gem.authors = ["Steve England"]
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  require 'rake/testtask'
20
20
  Rake::TestTask.new(:test) do |test|
21
- test.libs << 'lib' << 'test'
21
+ test.libs << 'test'
22
22
  test.pattern = 'test/**/*_test.rb'
23
23
  test.verbose = true
24
24
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{acts_as_content_node}
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steve England"]
9
- s.date = %q{2009-09-01}
9
+ s.date = %q{2009-09-07}
10
10
  s.email = %q{steve@wearebeef.co.uk}
11
11
  s.extra_rdoc_files = [
12
12
  "LICENSE",
@@ -51,7 +51,7 @@ Gem::Specification.new do |s|
51
51
  s.rdoc_options = ["--charset=UTF-8"]
52
52
  s.require_paths = ["lib"]
53
53
  s.rubygems_version = %q{1.3.5}
54
- s.summary = %q{Common functions for an record used as content of a website. Generator for cms and front end}
54
+ s.summary = %q{Common functions for a record used as content of a website. Generator for cms and front end}
55
55
  s.test_files = [
56
56
  "test/acts_as_content_node_test.rb",
57
57
  "test/schema.rb",
@@ -1,7 +1,7 @@
1
1
  module ContentNodesHelper
2
2
 
3
3
  def content_status(node)
4
- if node.published_at
4
+ if node.published?
5
5
  '<span class="status approved">Approved</span>'
6
6
  elsif node.published_at.nil?
7
7
  '<span class="status draft">Draft</span>'
@@ -6,6 +6,7 @@ module Beef
6
6
  send :include, InstanceMethods
7
7
 
8
8
  named_scope :published, lambda { { :conditions => ["(published_at IS NOT NULL AND published_at != '') AND published_at < ? AND (published_to > ? OR published_to IS NULL OR published_to = '')", Time.now, Time.now] } }
9
+ named_scope :draft, :conditions => { :published_at => nil }
9
10
 
10
11
  before_save :set_published
11
12
 
@@ -10,6 +10,8 @@ class ContentNodeTest < Test::Unit::TestCase
10
10
  setup do
11
11
  @content_node = Factory(:content_node)
12
12
  end
13
+
14
+ subject { @content_node }
13
15
 
14
16
  should_validate_uniqueness_of :title, :message => 'has been used before'
15
17
 
@@ -53,6 +55,7 @@ class ContentNodeTest < Test::Unit::TestCase
53
55
  @permalink = 'something-else'
54
56
  @content_node = Factory(:content_node, :permalink => @permalink)
55
57
  end
58
+ subject { @content_node }
56
59
 
57
60
  should_validate_uniqueness_of :permalink, :message => 'has been used before'
58
61
 
@@ -11,9 +11,6 @@ $KCODE = 'UTF8'
11
11
  # Makes TimeZone work
12
12
  Time.zone = 'UTC'
13
13
 
14
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
- $LOAD_PATH.unshift(File.dirname(__FILE__))
16
-
17
14
  RAILS_DEFAULT_LOGGER = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))
18
15
  ActiveRecord::Base.logger = RAILS_DEFAULT_LOGGER
19
16
 
@@ -27,7 +24,7 @@ ActiveRecord::Base.send :include, Beef::Acts::Publishable
27
24
  ActiveRecord::Base.configurations = YAML::load(IO.read(File.dirname(__FILE__) + "/database.yml"))
28
25
  ActiveRecord::Base.establish_connection(ENV["DB"] || "sqlite3mem")
29
26
  ActiveRecord::Migration.verbose = false
30
- load(File.join(File.dirname(__FILE__), "schema.rb"))
27
+ load("schema.rb")
31
28
 
32
29
  class ContentNode < ActiveRecord::Base
33
30
  acts_as_content_node
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beef-acts_as_content_node
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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-09-01 00:00:00 -07:00
12
+ date: 2009-09-07 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -58,6 +58,7 @@ files:
58
58
  - test/test_helper.rb
59
59
  has_rdoc: false
60
60
  homepage: http://github.com/beef/acts_as_content_node
61
+ licenses:
61
62
  post_install_message:
62
63
  rdoc_options:
63
64
  - --charset=UTF-8
@@ -78,10 +79,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
79
  requirements: []
79
80
 
80
81
  rubyforge_project:
81
- rubygems_version: 1.2.0
82
+ rubygems_version: 1.3.5
82
83
  signing_key:
83
84
  specification_version: 3
84
- summary: Common functions for an record used as content of a website. Generator for cms and front end
85
+ summary: Common functions for a record used as content of a website. Generator for cms and front end
85
86
  test_files:
86
87
  - test/acts_as_content_node_test.rb
87
88
  - test/schema.rb