caboodle 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -37,7 +37,7 @@
37
37
  = before_header
38
38
  %header#site-header
39
39
  = above_header
40
- - unless Caboodle::Site.logo_url.blank?
40
+ - unless Caboodle::Site.logo_url.to_s.blank?
41
41
  #logo
42
42
  %a{:href => "/", :rel => "home", :title => Caboodle::Site.title }
43
43
  %img{:src=>Caboodle::Site.logo_url, :width=>"64", :height=>"64"}
@@ -46,7 +46,7 @@
46
46
  %h1
47
47
  %a{:href => "/", :rel => "home", :title => Caboodle::Site.title }
48
48
  = Caboodle::Site.title
49
- - unless Caboodle::Site.description.blank?
49
+ - unless Caboodle::Site.description.to_s.blank?
50
50
  #site-description
51
51
  %h2= Caboodle::Site.description
52
52
  #access
@@ -26,6 +26,10 @@ module Caboodle
26
26
  puts `git commit -m"kit:add #{args}" -a`
27
27
  puts `git push heroku master`
28
28
  puts "Done!"
29
+ when /kit:home/
30
+ if Caboodle::Kit.available_kits.include?(args.first.capitalize)
31
+ Caboodle::Site.home_kit = args.first.capitalize
32
+ end
29
33
  when /kit:remove/
30
34
  Caboodle::Kit.unload_kit args.first.capitalize
31
35
  puts "Pushing to Heroku"
@@ -1,5 +1,4 @@
1
- home_title: Blog
2
- home_kit: Posterous
1
+ home_title: Home
3
2
  skimmed: abc123
4
3
  has_footer: true
5
4
  has_caboodle_link: true
data/lib/caboodle/kit.rb CHANGED
@@ -74,22 +74,18 @@ module Caboodle
74
74
  unless name.blank?
75
75
  kit_name = name.to_s.split("::").last || name
76
76
  kit_name = kit_name.downcase
77
- puts "))) Loading Kit: #{kit_name}"
78
77
  orig = Caboodle.constants
79
78
  begin
80
79
  require "caboodle/kits/#{kit_name}/#{kit_name}" #rescue puts "Problem loading Kit: #{kit_name}"
81
80
  added = Caboodle.constants - orig
82
- puts added
83
81
  added.each do |d|
84
82
  c = Caboodle.const_get(d)
85
83
  if c.respond_to?(:is_a_caboodle_kit)
86
- puts "*** Register #{c}"
87
84
  c.register_kit
88
85
  end
89
86
  end
90
87
  rescue Exception=>e
91
88
  if ENV["RACK_ENV"] == "production"
92
- puts e.inspect
93
89
  Caboodle::Errors << Hashie::Mash.new({:title=>"Failed to load #{name} kit", :reason=>e.backtrace})
94
90
  else
95
91
  raise e
@@ -152,7 +148,7 @@ module Caboodle
152
148
  if(Caboodle::Site.kits)
153
149
  Caboodle::Site.kits.each { |k| load_kit k }
154
150
  else
155
- STDERR.puts "Kits not registered"
151
+ STDERR.puts "No kits to register"
156
152
  end
157
153
  Caboodle::Kits
158
154
  end
@@ -165,11 +161,13 @@ module Caboodle
165
161
  path = "/" if Site.home_kit == self.to_s.gsub("Caboodle::","")
166
162
  Caboodle::MenuItems << {:display=>display, :link=>path, :kit=>self}
167
163
  self.get path, &block
168
- if Site.home_kit.blank?
169
- Site.home_kit = name
170
- end
164
+ @@has_menu = true
171
165
  end
172
-
166
+
167
+ def has_menu?
168
+ defined?(@@has_menu)
169
+ end
170
+
173
171
  def required keys
174
172
  if keys.class == Array
175
173
  keys.each do |k|
@@ -251,6 +249,10 @@ module Caboodle
251
249
  RequiredSettings[self.ancestors.first.to_s.split("::").last]
252
250
  end
253
251
 
252
+ def available_kits
253
+ Dir.new(File.join(File.dirname(__FILE__),"kits")).entries.delete_if{|a| a[0,1]=="."}
254
+ end
255
+
254
256
  def start
255
257
  errors = []
256
258
  puts self.required_settings.inspect
@@ -1,4 +1,5 @@
1
1
  require "open-uri"
2
+ require "nokogiri"
2
3
 
3
4
  module Caboodle
4
5
 
@@ -8,7 +9,7 @@ module Caboodle
8
9
  return Site.flickr_user_id unless Site.flickr_user_id.blank?
9
10
  unless Site.flickr_username.blank?
10
11
  url = "http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fisithackday.com%2Fapi%2Fflickr.whois.xml%22%20as%20flickr.whois%3Bselect%20*%20from%20flickr.whois%20where%20owner%3D%22#{Site.flickr_username}%22&format=xml"
11
- doc = Nokogiri::XML.parse(open(url).read)
12
+ doc = ::Nokogiri::XML.parse(open(url).read)
12
13
  val = doc.css("owner").first.attributes["nsid"].value
13
14
  Site.flickr_user_id = val
14
15
  Caboodle::Kit.dump_config
@@ -2,8 +2,10 @@ module Caboodle
2
2
  class Standard < Caboodle::Kit
3
3
  required [:title, :description, :logo_url, :author]
4
4
 
5
- get "/" do
6
- "The default home page"
5
+ if Caboodle::Site.home_kit.to_s.blank?
6
+ get "/" do
7
+ haml :standard
8
+ end
7
9
  end
8
10
  end
9
11
  end
@@ -0,0 +1,25 @@
1
+ #standard.page
2
+ %h2
3
+ Welcome to Caboodle
4
+
5
+ %h3
6
+ Get started by adding Kits
7
+
8
+ %p
9
+ Add a Kit to your Caboodle by typing a command like this in your terminal:
10
+
11
+ %pre
12
+ caboodle kit:add flickr
13
+
14
+ %p
15
+ Then follow the on-screen commands. You can use any of the following:
16
+
17
+ %p
18
+ = Caboodle::Kit.available_kits.join(", ")
19
+ \.
20
+
21
+ %p
22
+ Set a home page Kit
23
+
24
+ %pre
25
+ caboodle kit:home flickr
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 5
10
- version: 0.2.5
9
+ - 6
10
+ version: 0.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - steflewandowski
@@ -314,6 +314,7 @@ files:
314
314
  - lib/caboodle/kits/soundcloud/soundcloud.rb
315
315
  - lib/caboodle/kits/soundcloud/views/soundcloud.haml
316
316
  - lib/caboodle/kits/standard/standard.rb
317
+ - lib/caboodle/kits/standard/views/standard.haml
317
318
  - lib/caboodle/kits/susy/susy.rb
318
319
  - lib/caboodle/kits/susy/views/susy/_base.scss
319
320
  - lib/caboodle/kits/susy/views/susy/_defaults.scss