github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

lackac / app_lego

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 143
    • 12
  • Source
  • Commits
  • Network (12)
  • Issues (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: 128ea59

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A collection of Rails templates I use for projects — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Mirror recent changes in README 
lackac (author)
Fri Feb 06 04:28:58 -0800 2009
commit  128ea59e87992cbc5762ab19565f19f30dfbf891
tree    a5865f639c94955260fced4576345bb4272f57c0
parent  397300a0b737b72b741ecac9136bf45539fe140f
app_lego / app_lego.rb app_lego.rb
100644 64 lines (55 sloc) 1.856 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# environment options
@lego_options = ENV['LEGOS'] ? ENV['LEGOS'].downcase.split(/[,\s]+/) : false
@used_legos = []
 
def use_lego?(lego, question)
  use = if @lego_options
    @lego_options.include?(lego)
  else
    yes?(question)
  end
  @used_legos << lego if use
  use
end
 
# braid helpers
if use_lego?("braid", "Use braid for vendor management?")
  def braid(repo, dir, type=nil)
    run "braid add #{"-t #{type} " if type}#{repo} #{dir}"
  end
 
  def plugin(name, options)
    log "braid plugin", name
 
    if options[:git] || options[:svn]
      in_root do
        `braid add -p #{options[:svn] || options[:git]}`
      end
    else
      log "! no git or svn provided for #{name}. skipping..."
    end
  end
end
 
modules = [
  ["basic", "Do basic setup? (only exclude this if you already have a Rails app skeleton with Rails 2.3+ frozen, or as a gem)"],
  ["rspec", "Use RSpec instead of test/unit?"],
  ["haml", "Use haml for views and sass for css?"],
  ["jquery", "Use jQuery instead of Prototype + Script.aculo.us?"],
  ["auth", "Add authentication module?"],
  ["couchdb", "Use CouchDB?"],
  ["locale", "Add specific localizations?"],
  ["misc", "Add miscellaneous stuff (helpers, basic layout, flashes, initializers)?"],
]
 
if @lego_options or yes?("Do you want to play LEGO?")
  all_yes = @lego_options ? false : yes?("Install everything without question?")
 
  @base_path = if template =~ %r{^(/|\w+://)}
    File.dirname(template)
  else
    log '', "You used the app generator with a relative template path."
    ask "Please enter the full path or URL where the modules are located:"
  end
 
  modules.each do |modul, question|
    if all_yes or use_lego?(modul, question)
      tmpl = "#{@base_path}/#{modul}.rb"
      log "applying", "template: #{tmpl}"
      load_template(tmpl)
      log "applied", tmpl
    end
  end
end
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server