caboodle 0.2.23 → 0.2.24

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.23
1
+ 0.2.24
data/lib/caboodle/kit.rb CHANGED
@@ -96,6 +96,8 @@ module Caboodle
96
96
  end
97
97
 
98
98
  def menu display, path=nil, &block
99
+ Settings.menu_items ||= []
100
+
99
101
  #todo proper slugify
100
102
  slug = display.downcase.gsub(" ","-").gsub("'","")
101
103
  path = "/#{slug}" unless path
@@ -115,7 +117,6 @@ module Caboodle
115
117
  @title = '#{display}'
116
118
  end"
117
119
 
118
- Settings.menu_items ||= []
119
120
  Settings.menu_items << path
120
121
  end
121
122
 
@@ -14,6 +14,7 @@ module Caboodle
14
14
  pages.each do |page|
15
15
  puts "Add page: #{page}"
16
16
  menu "#{page.capitalize.gsub('_',' ')}" do
17
+ @title = page.capitalize.gsub('_',' ')
17
18
  markdown :"#{page}"
18
19
  end
19
20
  end
@@ -8,11 +8,15 @@ module Caboodle
8
8
 
9
9
  def initialize(opts={})
10
10
  Site.posterous_password ||= ENV["posterous_password"]
11
- self.credentials(opts[:username] || Site.posterous_username, opts[:password] || Site.posterous_password)
11
+
12
+ u = opts[:email] || Site.posterous_email
13
+ p = opts[:password] || Site.posterous_password
14
+
15
+ self.credentials(u, p)
12
16
  sitename = opts[:sitename] || Site.posterous_sitename
13
17
  unless defined?(Site.posterous_site_id)
14
- sites = Hashie::Mash.new(getsites.perform_sleepily.parse).rsp.site
15
-
18
+ response = Hashie::Mash.new(getsites.perform_sleepily.parse)
19
+ sites = response.rsp.site
16
20
  sites.each do |site|
17
21
  if site.url.include?("http://#{Site.posterous_sitename}.posterous.com")
18
22
  Site.posterous_site_id = site.id
@@ -56,7 +60,9 @@ module Caboodle
56
60
  opts["title"] = doc.css('title').inner_html.split(" - ").first
57
61
  opts["link"] = "http://#{Site.posterous_sitename}.posterous.com/#{slug}"
58
62
  perma = doc.css('.permalink').inner_html
59
- opts["date"] = Date.parse(perma)
63
+ date = doc.css('article time').first["datetime"]
64
+ puts date
65
+ opts["date"] = Date.parse(date)
60
66
  PosterousPost.new(opts)
61
67
  end
62
68
 
@@ -70,7 +76,9 @@ module Caboodle
70
76
  p = PosterousAPI.new
71
77
  opts[:site_id] = Site.posterous_site_id
72
78
  rsp = p.all(opts).perform_sleepily.parse["rsp"]
73
- rsp["post"].each{|a| r << PosterousPost.new(a)} if rsp["post"]
79
+ posts = rsp["post"]
80
+ posts = [posts] if posts.class == Hash
81
+ posts.each{|a| r << PosterousPost.new(a) } if posts
74
82
  r
75
83
  end
76
84
 
@@ -79,6 +87,7 @@ module Caboodle
79
87
  end
80
88
 
81
89
  def [] k
90
+ @attributes = {} if @attributes.nil?
82
91
  @attributes[k]
83
92
  end
84
93
 
@@ -131,7 +140,7 @@ module Caboodle
131
140
 
132
141
  description "Displays a Posterous blog with permalinks, pagination and commends if the Disqus kit is included"
133
142
 
134
- required [:posterous_sitename, :posterous_username, :posterous_password]
143
+ required [:posterous_sitename, :posterous_email, :posterous_password]
135
144
 
136
145
  optional [:disqus]
137
146
 
@@ -157,7 +166,7 @@ module Caboodle
157
166
 
158
167
  stylesheets ["http://disqus.com/stylesheets/#{disqus}/disqus.css?v=2.0"] if disqus
159
168
 
160
- rss ["feed://stef.posterous.com/rss.xml"]
169
+ rss ["feed://#{posterous_sitename}.posterous.com/rss.xml"]
161
170
 
162
171
  credit "http://#{posterous_sitename}.posterous.com", "#{posterous_sitename} on Posterous"
163
172
 
@@ -4,6 +4,7 @@
4
4
  Sorry, there's a problem communicating with Posterous.com
5
5
  - else
6
6
  - @posts.each do |post|
7
+ - puts post.inspect
7
8
  = haml :_post, :layout=>false, :locals=>{:post=>post}
8
9
  %nav#pagination
9
10
  - page = params[:page].to_i if defined?(params[:page])
@@ -23,6 +23,8 @@ $side-gutter-width: $gutter-width;
23
23
 
24
24
  $base: #4c4c4c;
25
25
  $alt: #ff6600;
26
+ $header_color: #999;
27
+ $article_color: #999;
26
28
 
27
29
 
28
30
  // Fonts --------------------------------------------------------------
@@ -73,7 +73,7 @@ section#main {
73
73
  {
74
74
  h1, h2 {
75
75
  @include adjust-font-size-to(48px);
76
- color: #aaa;
76
+ color: $header_color;
77
77
  @include prefix(2);
78
78
  }
79
79
  }
@@ -88,9 +88,9 @@ section#main {
88
88
  article {
89
89
  @include trailer(2,32px);
90
90
  aside {
91
- color: #aaa;
91
+ color: $article_color;
92
92
  a {
93
- color: #999;
93
+ color: $article_color;
94
94
  }
95
95
  }
96
96
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboodle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 39
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 23
10
- version: 0.2.23
9
+ - 24
10
+ version: 0.2.24
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stef Lewandowski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-06 00:00:00 +01:00
18
+ date: 2010-09-12 00:00:00 +01:00
19
19
  default_executable: caboodle
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency