beef-articles 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/helpers/articles_helper.rb +12 -4
- data/articles.gemspec +2 -2
- data/config/routes.rb +0 -5
- data/rails/init.rb +1 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -73,14 +73,22 @@ module ArticlesHelper
|
|
73
73
|
content_tag :ul, html, options.reverse_merge!( :class => 'archive' ) unless html.empty?
|
74
74
|
end
|
75
75
|
|
76
|
-
def related_articles(content_node)
|
76
|
+
def related_articles(content_node, &block)
|
77
77
|
articles = Article.find_tagged_with content_node.tag_list, :conditions => ['published_at <= ? AND content_nodes.id != ?', Time.now, content_node.id ], :limit => 3, :include => :created_by
|
78
|
-
|
78
|
+
if block_given?
|
79
|
+
yield(articles)
|
80
|
+
else
|
81
|
+
articles_list(articles)
|
82
|
+
end
|
79
83
|
end
|
80
84
|
|
81
|
-
def recent_articles(limit = 3)
|
85
|
+
def recent_articles(limit = 3, &block)
|
82
86
|
articles = Article.published.all( :limit => limit, :order => 'published_at DESC')
|
83
|
-
|
87
|
+
if block_given?
|
88
|
+
yield(articles)
|
89
|
+
else
|
90
|
+
articles_list(articles)
|
91
|
+
end
|
84
92
|
end
|
85
93
|
|
86
94
|
def articles_list(articles)
|
data/articles.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{articles}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.2.0"
|
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-
|
9
|
+
s.date = %q{2009-07-10}
|
10
10
|
s.email = %q{steve@wearebeef.co.uk}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
ActionController::Routing::Routes.draw do |map|
|
2
|
-
map.resources :comments
|
3
|
-
|
4
2
|
map.resources :categories, :has_many => :articles
|
5
3
|
|
6
4
|
map.with_options :controller => 'articles', :action => 'index' do |articles|
|
@@ -21,12 +19,9 @@ ActionController::Routing::Routes.draw do |map|
|
|
21
19
|
:path_prefix => nil
|
22
20
|
map.resources :articles, :only => [:index], :collection => { :preview => :get }, :has_many => [:comments, { :only => :create } ]
|
23
21
|
|
24
|
-
map.resources :tweets
|
25
22
|
map.namespace(:admin) do |admin|
|
26
23
|
admin.resources :categories
|
27
24
|
admin.resources :articles, :member => { :preview => :put }, :collection => { :preview => :post }
|
28
25
|
admin.resources :comments, :only => [:index, :destroy]
|
29
|
-
admin.resources :things
|
30
|
-
admin.resources :blokes
|
31
26
|
end
|
32
27
|
end
|
data/rails/init.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beef-articles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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-
|
12
|
+
date: 2009-07-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|