caboodle 0.2.3 → 0.2.5

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.3
1
+ 0.2.5
@@ -1,7 +1,7 @@
1
1
  has_footer: true
2
2
  has_caboodle_link: true
3
3
  kits:
4
- - Posterous
4
+ - Standard
5
5
  - Skimmed
6
6
  - Susy
7
7
  - Jquery
@@ -25,7 +25,15 @@
25
25
 
26
26
  %body.caboodle
27
27
  = before_page
28
+
28
29
  #page.hfeed
30
+ - if Caboodle::Errors.size > 0
31
+ %section#errors
32
+ - Caboodle::Errors.each do |err|
33
+ %h2
34
+ = err.title
35
+ %p.reason
36
+ = err.reason
29
37
  = before_header
30
38
  %header#site-header
31
39
  = above_header
@@ -77,13 +85,6 @@
77
85
  = below_social
78
86
  = after_social
79
87
  = before_content
80
- - if Caboodle::Errors.size > 0
81
- %section#errors
82
- - Caboodle::Errors.each do |err|
83
- %h2
84
- = err.title
85
- %p.reason
86
- = err.reason
87
88
  %section#content
88
89
  = above_content
89
90
  = yield
@@ -137,4 +137,8 @@ section.subsection {
137
137
 
138
138
  #testing {
139
139
  background-color: red;
140
+ }
141
+
142
+ section#errors {
143
+ background-color: #ffdddd;
140
144
  }
data/lib/caboodle/kit.rb CHANGED
@@ -76,14 +76,23 @@ module Caboodle
76
76
  kit_name = kit_name.downcase
77
77
  puts "))) Loading Kit: #{kit_name}"
78
78
  orig = Caboodle.constants
79
- require "caboodle/kits/#{kit_name}/#{kit_name}" #rescue puts "Problem loading Kit: #{kit_name}"
80
- added = Caboodle.constants - orig
81
- puts added
82
- added.each do |d|
83
- c = Caboodle.const_get(d)
84
- if c.respond_to?(:is_a_caboodle_kit)
85
- puts "*** Register #{c}"
86
- c.register_kit
79
+ begin
80
+ require "caboodle/kits/#{kit_name}/#{kit_name}" #rescue puts "Problem loading Kit: #{kit_name}"
81
+ added = Caboodle.constants - orig
82
+ puts added
83
+ added.each do |d|
84
+ c = Caboodle.const_get(d)
85
+ if c.respond_to?(:is_a_caboodle_kit)
86
+ puts "*** Register #{c}"
87
+ c.register_kit
88
+ end
89
+ end
90
+ rescue Exception=>e
91
+ if ENV["RACK_ENV"] == "production"
92
+ puts e.inspect
93
+ Caboodle::Errors << Hashie::Mash.new({:title=>"Failed to load #{name} kit", :reason=>e.backtrace})
94
+ else
95
+ raise e
87
96
  end
88
97
  end
89
98
  end
@@ -117,10 +126,13 @@ module Caboodle
117
126
  puts "checking #{r}"
118
127
  puts "value: #{Caboodle::Site[r]}"
119
128
  if Caboodle::Site[r].blank?
120
- puts "Please set a value for #{r}:"
121
- v = STDIN.gets
122
- Caboodle::Site[r] = v
123
- Caboodle::Kit.dump_config
129
+ puts "Rack env #{ENV["RACK_ENV"]}"
130
+ unless ENV["RACK_ENV"] == "production"
131
+ puts "Please set a value for #{r}:"
132
+ v = STDIN.gets
133
+ Caboodle::Site[r] = v
134
+ Caboodle::Kit.dump_config
135
+ end
124
136
  end
125
137
  end
126
138
  Site.kits << name
@@ -235,12 +247,13 @@ module Caboodle
235
247
  end
236
248
 
237
249
  def required_settings
238
- r = RequiredSettings[self.ancestors.first.to_s.split("::").last] ||= [:title, :description, :logo_url, :author]
250
+ r = RequiredSettings[self.ancestors.first.to_s.split("::").last] ||= []
239
251
  RequiredSettings[self.ancestors.first.to_s.split("::").last]
240
252
  end
241
253
 
242
254
  def start
243
255
  errors = []
256
+ puts self.required_settings.inspect
244
257
  self.required_settings.each do |s|
245
258
  if Site[s].blank?
246
259
  errors << " :#{s} has not been set"
@@ -0,0 +1,5 @@
1
+ module Caboodle
2
+ class Broken
3
+
4
+ #deliberately wrong
5
+ end
File without changes
@@ -0,0 +1,9 @@
1
+ module Caboodle
2
+ class Standard < Caboodle::Kit
3
+ required [:title, :description, :logo_url, :author]
4
+
5
+ get "/" do
6
+ "The default home page"
7
+ end
8
+ end
9
+ end
@@ -245,4 +245,16 @@ section.subsection {
245
245
 
246
246
  #testing {
247
247
  background-color: red;
248
+ }
249
+
250
+ section#errors {
251
+ background-color: #ffdddd;
252
+ padding: 0.5em;
253
+ h2 {
254
+ @include adjust-font-size-to(16px);
255
+ color: #882222;
256
+ }
257
+ .reason {
258
+ display: none;
259
+ }
248
260
  }
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: 17
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - steflewandowski
@@ -274,6 +274,7 @@ files:
274
274
  - lib/caboodle/helpers.rb
275
275
  - lib/caboodle/kit.rb
276
276
  - lib/caboodle/kits/analytics/analytics.rb
277
+ - lib/caboodle/kits/broken/broken.rb
277
278
  - lib/caboodle/kits/carbonmade/carbonmade.rb
278
279
  - lib/caboodle/kits/carbonmade/views/carbonmade.haml
279
280
  - lib/caboodle/kits/disqus/disqus.rb
@@ -285,6 +286,7 @@ files:
285
286
  - lib/caboodle/kits/github/github.rb
286
287
  - lib/caboodle/kits/github/views/_repo.haml
287
288
  - lib/caboodle/kits/github/views/github.haml
289
+ - lib/caboodle/kits/gravatar/gravatar.rb
288
290
  - lib/caboodle/kits/history/config/history.yml
289
291
  - lib/caboodle/kits/history/history.rb
290
292
  - lib/caboodle/kits/history/views/history.haml
@@ -311,6 +313,7 @@ files:
311
313
  - lib/caboodle/kits/skimmed/skimmed.rb
312
314
  - lib/caboodle/kits/soundcloud/soundcloud.rb
313
315
  - lib/caboodle/kits/soundcloud/views/soundcloud.haml
316
+ - lib/caboodle/kits/standard/standard.rb
314
317
  - lib/caboodle/kits/susy/susy.rb
315
318
  - lib/caboodle/kits/susy/views/susy/_base.scss
316
319
  - lib/caboodle/kits/susy/views/susy/_defaults.scss