Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 71 lines (61 sloc) 2.095 kb
75447a9d »
2009-04-10 work in progress
1 NAME=File.basename(root)
2
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
3 # environment options
4 @lego_options = ENV['LEGOS'] ? ENV['LEGOS'].downcase.split(/[,\s]+/) : false
df7a1a44 » lackac
2009-02-06 Added module specific localizations
5 @used_legos = []
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
6
75447a9d »
2009-04-10 work in progress
7
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
8 def use_lego?(lego, question)
df7a1a44 » lackac
2009-02-06 Added module specific localizations
9 use = if @lego_options
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
10 @lego_options.include?(lego)
11 else
12 yes?(question)
13 end
df7a1a44 » lackac
2009-02-06 Added module specific localizations
14 @used_legos << lego if use
15 use
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
16 end
17
18 # braid helpers
19 if use_lego?("braid", "Use braid for vendor management?")
20 def braid(repo, dir, type=nil)
21 run "braid add #{"-t #{type} " if type}#{repo} #{dir}"
22 end
23
24 def plugin(name, options)
25 log "braid plugin", name
26
27 if options[:git] || options[:svn]
28 in_root do
29 `braid add -p #{options[:svn] || options[:git]}`
30 end
31 else
32 log "! no git or svn provided for #{name}. skipping..."
33 end
34 end
35 end
36
37 modules = [
f9259b83 » lackac
2009-02-06 Moved basic setup to its on module
38 ["basic", "Do basic setup? (only exclude this if you already have a Rails app skeleton with Rails 2.3+ frozen, or as a gem)"],
75447a9d »
2009-04-10 work in progress
39 ["frozen_edge", "Freeze edge Rails?"],
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
40 ["rspec", "Use RSpec instead of test/unit?"],
41 ["haml", "Use haml for views and sass for css?"],
75447a9d »
2009-04-10 work in progress
42 ["hoptoad", "Use Hoptoad error notifier?"],
43 ["compass", "Use compass for CSS?"],
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
44 ["jquery", "Use jQuery instead of Prototype + Script.aculo.us?"],
75447a9d »
2009-04-10 work in progress
45 ["jrails", "install jquery for rails plugin?"],
2cb3c73e » lackac
2009-02-06 Added auth module
46 ["auth", "Add authentication module?"],
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
47 ["couchdb", "Use CouchDB?"],
48 ["locale", "Add specific localizations?"],
75447a9d »
2009-04-10 work in progress
49 ["layout", "Add basic layout?"],
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
50 ["misc", "Add miscellaneous stuff (helpers, basic layout, flashes, initializers)?"],
51 ]
52
53 if @lego_options or yes?("Do you want to play LEGO?")
54 all_yes = @lego_options ? false : yes?("Install everything without question?")
55
df7a1a44 » lackac
2009-02-06 Added module specific localizations
56 @base_path = if template =~ %r{^(/|\w+://)}
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
57 File.dirname(template)
58 else
59 log '', "You used the app generator with a relative template path."
60 ask "Please enter the full path or URL where the modules are located:"
61 end
62
63 modules.each do |modul, question|
64 if all_yes or use_lego?(modul, question)
df7a1a44 » lackac
2009-02-06 Added module specific localizations
65 tmpl = "#{@base_path}/#{modul}.rb"
2d302ab1 » lackac
2008-12-31 App LEGO with rspec, haml, jquery, couchdb, locale and misc modules a…
66 log "applying", "template: #{tmpl}"
67 load_template(tmpl)
68 log "applied", tmpl
69 end
70 end
71 end
Something went wrong with that request. Please try again.