bivouac 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/bivouac CHANGED
@@ -141,6 +141,14 @@ createFile( "#{@conf.appdir}/script/server", true ) { |io|
141
141
  io.puts template( "server" )
142
142
  }
143
143
 
144
+ createFile( "#{@conf.appdir}/script/console", true ) { |io|
145
+ io.puts template( "console" )
146
+ }
147
+
148
+ createFile( "#{@conf.appdir}/Rakefile", true ) { |io|
149
+ io.puts template( "Rakefile" )
150
+ }
151
+
144
152
  copyTemplate( "static/index.html", "#{@conf.appdir}/public" )
145
153
  copyTemplate( "static/camping.png", "#{@conf.appdir}/public/images" )
146
154
  %w{builder.js dragdrop.js prototype.js slider.js unittest.js controls.js effects.js scriptaculous.js tooltip.js}.each do |f|
data/doc/rdoc/created.rid CHANGED
@@ -1 +1 @@
1
- Wed, 09 Jan 2008 18:24:26 +0100
1
+ Wed, 30 Jan 2008 16:46:48 +0100
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'camping'
3
+ require 'camping/session'
4
+ require 'bivouac'
5
+
6
+ include Bivouac
7
+ ENV['BIVOUAC_ROOT'] = File.expand_path( File.dirname(__FILE__) )
8
+
9
+ task :environment do
10
+ Camping.goes :<%= @appname %>
11
+
12
+ # Load models from app/models
13
+ files( 'models' ) { |file| require( file ) }
14
+
15
+ # Load create
16
+ files( '../db' ) { |file| require( file ) }
17
+
18
+ # Load database schema from db/migrate
19
+ files( '../db/migrate' ) { |file| require( file ) }
20
+
21
+ require "#{ENV['BIVOUAC_ROOT']}/config/environment.rb"
22
+ config = Bivouac::Environment.new( )
23
+ database_connection = config.environment.db
24
+ if database_connection[:adapter] =~ /sqlite/
25
+ database_connection[:database] = ENV['BIVOUAC_ROOT'] + "/" + database_connection[:database]
26
+ end
27
+ <%= @appname %>::Models::Base.establish_connection database_connection
28
+ end
29
+
30
+ namespace :db do
31
+ desc "Migrate the database through scripts in db/migrate."
32
+ task :migrate => :environment do
33
+ if <%= @appname %>.respond_to? :create
34
+ <%= @appname %>.create
35
+ else
36
+ puts "Nothing to do!"
37
+ end
38
+ end
39
+
40
+ desc "Clear the sessions table"
41
+ namespace :sessions do
42
+ task :clear => :environment do
43
+ session_table = 'session'
44
+ session_table = Inflector.pluralize(session_table) if ActiveRecord::Base.pluralize_table_names
45
+ ActiveRecord::Base.connection.execute "DELETE FROM #{session_table}"
46
+ end
47
+ end
48
+ end
@@ -70,6 +70,26 @@ while ARGV.size > 0
70
70
  case deamonize
71
71
  when 'webrick'
72
72
  <%= @appname %>Daemon.use='webrick'
73
+ when '-c'
74
+ ARGV.clear
75
+
76
+ include <%= @appname %>::Models
77
+
78
+ config = Bivouac::Environment.new( )
79
+ database_connection = config.environment.db
80
+ if database_connection[:adapter] =~ /sqlite/
81
+ database_connection[:database] = DIRNAME + "/../" + database_connection[:database]
82
+ end
83
+ <%= @appname %>::Models::Base.establish_connection database_connection
84
+ <%= @appname %>.create if <%= @appname %>.respond_to? :create
85
+
86
+ require 'irb'
87
+ require 'irb/completion'
88
+ if File.exists? ".irbrc"
89
+ ENV['IRBRC'] = ".irbrc"
90
+ end
91
+ IRB.start
92
+ break
73
93
  when '-d'
74
94
  <%= @appname %>Daemon.daemonize
75
95
  break
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ app = File.dirname(__FILE__) + "/../app/<%= @conf.appdir %>.rb"
4
+
5
+ ENV['BIVOUAC_ROOT'] = File.expand_path( File.dirname(__FILE__) + "/../" )
6
+ system "ruby #{app} -c #{ARGV.join(' ')}"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: bivouac
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.2
7
- date: 2008-01-09 00:00:00 +01:00
6
+ version: 0.1.3
7
+ date: 2008-01-30 00:00:00 +01:00
8
8
  summary: Developpe with Camping like you do with Rails
9
9
  require_paths:
10
10
  - lib
@@ -88,6 +88,7 @@ files:
88
88
  - lib/bivouac/template/application_erb.rb
89
89
  - lib/bivouac/template/application_goh.rb
90
90
  - lib/bivouac/template/application_jof.rb
91
+ - lib/bivouac/template/console.rb
91
92
  - lib/bivouac/template/environment.rb
92
93
  - lib/bivouac/template/generate
93
94
  - lib/bivouac/template/generate/controller.rb
@@ -110,6 +111,7 @@ files:
110
111
  - lib/bivouac/template/generate/view_erb.rb
111
112
  - lib/bivouac/template/generate/view_goh.rb
112
113
  - lib/bivouac/template/generate.rb
114
+ - lib/bivouac/template/Rakefile.rb
113
115
  - lib/bivouac/template/server.rb
114
116
  - lib/bivouac/template/static
115
117
  - lib/bivouac/template/static/autocomplete.css