Sha256: e6a5832ae84c3596559c0c5bfd54fcf1ddcd7bfbd6474fcbc7ebd1cb0b64427e

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

class AppBuilder < Rails::AppBuilder
  include Thor::Actions
  include Thor::Shell

  # Express app templating for Rails
  # ------------------------------------
  # USAGE:
  #   1. run: `rails new app_name --builder=path/to/builder.rb` (URI's work here too)
  #   2. ???
  #   3. PROFIT!

  def test
    return
    # TODO
    # skips test framework, but we can probably just bastardize the options in the same way as with :skip_bundle
    # either make `test` build the actual directories etc., or use a script
    # either way, this method is stupid.
  end

<% generator_methods.each do |m| %>
  def <%= m %>
    <%= 'super' if overridden_generator_method?(m) %>
<%= @directives[m].join("\n") %>
  end
<% end %>

  def leftovers

    <%= leftover_directives.join("\n") %>

    # This should be removed when the database drone is installed
    rake 'db:create'
    rake 'db:migrate'

    <% if generator_methods.include?(:final) %>
    final
    <% end %>

    # Drone Notices
    <% drone_notices.each do |drone, notices| %>
      <% notices.each do |notice| %>
        say "[<%= drone.human_name %>] <%= notice %>", :red
      <% end %>
    <% end %>

    say "She's all yours, sparky!\n\n", :green

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
app_drone-0.12.1 lib/app_drone/template.erb
app_drone-0.12.0 lib/app_drone/template.erb
app_drone-0.11.3 lib/app_drone/template.erb
app_drone-0.11.2 lib/app_drone/template.erb
app_drone-0.11.1 lib/app_drone/template.erb
app_drone-0.11.0 lib/app_drone/template.erb