Skip to content
This repository
Browse code

removing the debugging scaffold rig until it's less poorly thought out

  • Loading branch information...
commit c5550560ba9364be404f5819df2e4a8c7f726ca3 1 parent f47198e
Philip (flip) Kromer authored August 23, 2008

Showing 1 changed file with 0 additions and 97 deletions. Show diff stats Hide diff stats

  1. 97  tasks/scaffold_rest_auth_example.rake
97  tasks/scaffold_rest_auth_example.rake
... ...
@@ -1,97 +0,0 @@
1  
-#!/usr/bin/env ruby
2  
-require 'rubygems'
3  
-require 'fileutils'; include FileUtils::Verbose
4  
-
5  
-APP_BASE_DIR            = '/tmp'
6  
-APP_NAME                = 'empty_app'
7  
-APP_DIR                 = File.join(APP_BASE_DIR, APP_NAME)
8  
-PLUGIN_BASE_DIR         = File.expand_path('~/ics/plugins/rails/')
9  
-PLUGIN_DIRS             = {              # note: _ only in target names
10  
-  :restful_authentication  => File.join(PLUGIN_BASE_DIR, 'mainline_restful_authentication'),
11  
-  :rspec                   => File.join(PLUGIN_BASE_DIR, 'rspec'),
12  
-  :rspec_rails             => File.join(PLUGIN_BASE_DIR, 'rspec_rails'),
13  
-  :aasm                    => File.join(PLUGIN_BASE_DIR, 'aasm'),
14  
-}
15  
-
16  
-
17  
-#
18  
-# Steps
19  
-#
20  
-task :default => ['fubar:empty_app', 'fubar:plugins:link', 'fubar:generate:all', 'fubar:db:migrate', 'fubar:spec']
21  
-
22  
-namespace :fubar do
23  
-  directory APP_BASE_DIR
24  
-  desc "Scaffolds the basic, empty app"
25  
-  file APP_DIR => [APP_BASE_DIR] do |t|
26  
-    cd APP_BASE_DIR do
27  
-      sh %{ rails --force #{APP_NAME} }
28  
-    end
29  
-  end
30  
-  task :empty_app => APP_DIR
31  
-
32  
-  namespace :plugins do
33  
-    desc "Link to required plugins"
34  
-    task :all
35  
-    PLUGIN_DIRS.each do |plugin, src_dir|
36  
-      dest_dir = File.join(APP_DIR, "vendor", "plugins", plugin.to_s)
37  
-      file dest_dir do |t|
38  
-        cd APP_DIR do
39  
-          rm_f dest_dir
40  
-          ln_s src_dir, dest_dir
41  
-        end
42  
-      end
43  
-      desc "Link to the #{plugin} plugin"
44  
-      task "link_#{plugin}" => dest_dir
45  
-      task :all             => "plugins:link_#{plugin}"
46  
-    end
47  
-  end
48  
-
49  
-  # if generators fail as 'not found', try
50  
-  # http://github.com/rails/rails/commit/f90eb81c65d5841b591caf0f5e39ef774d02d06e
51  
-  # -- it's because rails <= 2.1.0 hates symlinked plugin dirs.
52  
-  namespace :generate do
53  
-    desc "Run scaffold generators"
54  
-    task :all
55  
-
56  
-    require 'activesupport'
57  
-    allargs = [:skip_migration, :include_activation, :stateful, :aasm, :rspec, :no_rspec, :skip_routes, :old_passwords, :dump_generator_attrs, ]
58  
-
59  
-    # generator        models   flags     helpers
60  
-    generators = [
61  
-      [:rspec,         '',      [],        [],                    ],
62  
-      [:authenticated, 'User',  [:rspec,], ['sessions', 'users'], ],
63  
-    ]
64  
-
65  
-    generators.each do |generator, models, flags, helpers|
66  
-      task :all => generator
67  
-      argstrs = flags.map{|a| '--'+a.to_s.dasherize}.join(' ')
68  
-      task generator => ['plugins:all'] do
69  
-        cd APP_DIR do
70  
-          helpers.each do |helper| rm_f "app/helpers/#{helper}_helper.rb" end
71  
-          sh %{ ./script/generate #{generator} #{models} #{argstrs} }
72  
-        end
73  
-      end
74  
-      namespace :destroy do
75  
-        task generator do
76  
-          cd APP_DIR do sh %{ ./script/destroy #{generator} #{models} #{argstrs} } end
77  
-        end
78  
-        task :all => generator
79  
-      end
80  
-    end
81  
-
82  
-  end
83  
-
84  
-  namespace :db do
85  
-    task :migrate => ['generate:all'] do
86  
-      cd APP_DIR do sh %{ rake db:migrate:reset } end
87  
-    end
88  
-  end
89  
-
90  
-  task :spec => ['db:migrate'] do
91  
-    cd APP_DIR do sh %{ rake spec } end
92  
-  end
93  
-
94  
-  # generate rspec
95  
-  # rake db:migrate
96  
-  # rake spec
97  
-end

0 notes on commit c555056

Please sign in to comment.
Something went wrong with that request. Please try again.