caboodle 0.2.9 → 0.2.10

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.9
1
+ 0.2.10
@@ -5,4 +5,5 @@ kits:
5
5
  - Standard
6
6
  - Skimmed
7
7
  - Susy
8
- - Jquery
8
+ - Jquery
9
+ - Gravatar
data/lib/caboodle/app.rb CHANGED
@@ -10,7 +10,7 @@ module Caboodle
10
10
  helpers Sinatra::CaboodleHelpers
11
11
 
12
12
  configure do
13
- Caboodle::Kit.configure File.expand_path(File.join(Caboodle::App.root,"config","site.yml"))
13
+ Caboodle::Kit.configure_site File.expand_path(File.join(Caboodle::App.root,"config","site.yml"))
14
14
  end
15
15
 
16
16
  end
@@ -2,6 +2,11 @@
2
2
  module Caboodle
3
3
  module Command
4
4
  class << self
5
+ def configure
6
+ config = File.expand_path(File.join(".","config","site.yml"))
7
+ Caboodle::Kit.configure_site config
8
+ end
9
+
5
10
  def run(command, args, retries=0)
6
11
  case command
7
12
  when "create"
@@ -12,7 +17,7 @@ module Caboodle
12
17
  puts `cd #{site_name} && cp -i #{File.expand_path(File.join(File.dirname(__FILE__), 'app'))}/.gems .`
13
18
  puts `cd #{site_name} && git init`
14
19
  config = File.expand_path(File.join(".",site_name,"config","site.yml"))
15
- Caboodle::Kit.configure config
20
+ Caboodle::Kit.configure_site config
16
21
  puts "Please set a few settings to get started"
17
22
  Caboodle::Kit.ask_user_for_all_missing_settings
18
23
  puts `cd #{site_name} && git add .`
@@ -21,12 +26,7 @@ module Caboodle
21
26
  Caboodle::Kit.load_kit args.first.capitalize
22
27
  puts "Dump config"
23
28
  Caboodle::Kit.dump_config
24
- puts "Pushing to Heroku"
25
- puts "Please be patient - this could take some time the first time you do this"
26
- puts `git add .`
27
29
  puts `git commit -m"kit:add #{args}" -a`
28
- puts `git push heroku master`
29
- puts "Done!"
30
30
  when /kit:home/
31
31
  if Caboodle::Kit.available_kits.include?(args.first.capitalize)
32
32
  Caboodle::Site.home_kit = args.first.capitalize
@@ -38,11 +38,21 @@ module Caboodle
38
38
  Caboodle::Kit.available_kits.each {|kit| puts kit}
39
39
  when /kit:remove/
40
40
  Caboodle::Kit.unload_kit args.first.capitalize
41
- puts "Pushing to Heroku"
42
- puts `git add .`
43
41
  puts `git commit -m"kit:remove #{args}" -a`
44
- puts `git push heroku master`
45
- puts "Done!"
42
+ when /config:list/
43
+ configure
44
+ Caboodle::Site.each{|k,v| puts "#{k}: #{v}"}
45
+ when /config:set/
46
+ configure
47
+ Caboodle::Site[args[0]] = args[1]
48
+ Caboodle::Kit.dump_config
49
+ when /config:get/
50
+ configure
51
+ puts Caboodle::Site[args[0]]
52
+ when /config:kits/
53
+ puts "The following kits are loaded"
54
+ configure
55
+ puts Caboodle::Site.kits.join("\n")
46
56
  when "deploy"
47
57
  gem 'heroku'
48
58
  require 'heroku'
@@ -51,7 +61,18 @@ module Caboodle
51
61
  puts `git commit -m"deploy" -a`
52
62
  puts `git push heroku master`
53
63
  else
54
- puts "Sorry, that command is not recognized"
64
+ puts "Sorry, that command is not recognized" unless command == "help"
65
+ puts "Caboodle accepts the following commands:"
66
+ puts " "
67
+ puts "caboodle create <sitename> - sets up a new caboodle"
68
+ puts "caboodle kit:add <kit name> - adds a specificed kit to the caboodle"
69
+ puts "caboodle kit:home <kit name> - sets the kit as the one that runs the home page"
70
+ puts "caboodle kit:remove <kit name> - removes the kit"
71
+ puts "caboodle kit:list - lists all of the available kits"
72
+ puts "caboodle config:list - shows the configuration variables"
73
+ puts "caboodle config:set <variable name> <value> - sets a value for the configuration variable"
74
+ puts "caboodle config:get <variable name> - shows the value of the configuration variable"
75
+ puts "caboodle deploy - pushes the caboodle to Heroku"
55
76
  end
56
77
  end
57
78
  end
data/lib/caboodle/kit.rb CHANGED
@@ -22,7 +22,7 @@ module Caboodle
22
22
  class << self
23
23
  attr_accessor :credit_link
24
24
 
25
- def configure config_path
25
+ def configure_site config_path
26
26
  set :config, config_path
27
27
  if File.exists?(config_path)
28
28
  Caboodle::Kit.load_config(config_path)
@@ -257,7 +257,6 @@ module Caboodle
257
257
  Caboodle::Layout[k.to_sym] = v
258
258
  end
259
259
  end
260
- puts Caboodle::Layout.inspect
261
260
  end
262
261
 
263
262
  def defaults hash
@@ -289,7 +288,6 @@ module Caboodle
289
288
 
290
289
  def start
291
290
  errors = []
292
- puts self.required_settings.inspect
293
291
  self.required_settings.each do |s|
294
292
  if Site[s].blank?
295
293
  errors << " :#{s} has not been set"
@@ -0,0 +1,14 @@
1
+ require 'digest/md5'
2
+
3
+ module Caboodle
4
+ class Standard < Caboodle::Kit
5
+ optional [:email]
6
+
7
+ configure do
8
+ if Caboodle::Site.logo_url.to_s.blank? && !Caboodle::Site.email.to_s.blank?
9
+ hash = Digest::MD5.hexdigest(Caboodle::Site.email)
10
+ Caboodle::Site.logo_url = "http://www.gravatar.com/avatar/#{hash}"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -2,7 +2,7 @@ module Caboodle
2
2
  class Standard < Caboodle::Kit
3
3
  required [:title, :description, :author]
4
4
  optional [:logo_url]
5
- if Caboodle::Site.home_kit.blank? || !(Caboodle::Kit.available_kits.include?(Caboodle::Site.home_kit)) || !(Caboodle::Kits.include?(Caboodle::Site.home_kit))
5
+ if Caboodle::Site.home_kit.blank?
6
6
  puts "Using the default home kit - you will want to run 'caboodle kit:home <kit name>' to specify your own kit"
7
7
  get "/" do
8
8
  haml :standard
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: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 9
10
- version: 0.2.9
9
+ - 10
10
+ version: 0.2.10
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-08-26 00:00:00 +01:00
18
+ date: 2010-08-27 00:00:00 +01:00
19
19
  default_executable: caboodle
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency