GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
cleaner than clean
automatthew (author)
Mon May 12 19:37:30 -0700 2008
commit  d738f21b68983cbedb00efc8d12804abd1766ff7
tree    eaf813fccafd54269f16098e87cc9a9d8e528b8b
parent  69686c13c2e656cc722fcd02358f32f8ee907f83
...
1
 
 
 
2
3
4
5
6
7
 
 
 
 
 
 
 
8
9
10
...
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
 
...
1
2
3
4
5
 
 
 
 
 
6
7
8
9
10
11
12
13
14
15
...
21
22
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
25
26
27
28
29
30
31
32
 
33
34
 
 
 
 
35
36
37
38
0
@@ -1,10 +1,15 @@
0
 #!/usr/bin/env ruby
0
+require 'rubygems'
0
+require 'choice'
0
+require 'genitor'
0
 
0
-# rudimentary argument checks
0
-if ARGV.length != 1 || ARGV[0] == '--help'
0
- $stderr.puts "Usage: waves {app_name}"
0
- $stderr.puts "app_name may contain only letters, numbers, and underscores."
0
- exit 1
0
+Choice.options do
0
+ banner 'Usage: waves path/to/app [-h]'
0
+ option :help do
0
+ long '--help'
0
+ desc 'Show this message'
0
+ end
0
+
0
 end
0
 
0
 app_path = ARGV[0]
0
@@ -16,43 +21,18 @@ if app_name =~ /[^\w\d_]/
0
 TEXT
0
 end
0
 
0
-
0
-require 'rubygems'
0
-require 'genitor'
0
-require 'extensions/all'
0
-begin
0
- require 'utilities/string'
0
-rescue LoadError
0
- require File.join(File.dirname(__FILE__), '..', 'lib', 'utilities', 'string')
0
-end
0
-
0
-require 'fileutils'
0
-include FileUtils
0
-
0
-# are we calling this script from within the waves framework source?
0
-script_path = File.expand_path(__FILE__)
0
-WAVES_SRC = File.dirname(File.dirname(script_path))
0
-
0
-puts "** Creating new Waves application ..."
0
-
0
-# Determine path to template
0
-template = begin
0
- File.join File.dirname(File.readlink(__FILE__)), '..', 'app'
0
-rescue Exception
0
- File.join( File.dirname(__FILE__),'..','app')
0
-end
0
+template = File.join( File.dirname(__FILE__),'..','app')
0
 
0
 generator = Genitor.new("waves:app") do |gen|
0
   gen.source = template
0
   gen.target = app_path
0
   gen.template_assigns = {:name => app_name}
0
+ gen.executables = %w{ bin/waves-console bin/waves-server}
0
 end
0
 
0
-Rake::Task["waves:app"].invoke
0
+puts "** Creating new Waves application ..."
0
 
0
-unless RUBY_PLATFORM =~ /mswin32/
0
- # make the scripts executable
0
- system "chmod ug+x #{app_path}/bin/waves-*"
0
-end
0
+Rake::Task["waves:app"].invoke
0
 
0
 puts "** Application created!"
0
+
...
2
3
4
 
 
5
6
7
8
9
10
11
12
13
14
15
16
17
...
32
33
34
 
 
...
2
3
4
5
6
7
8
 
 
 
 
 
 
 
 
9
10
11
...
26
27
28
29
30
0
@@ -2,16 +2,10 @@
0
 
0
 require File.join(File.dirname(__FILE__) , "helpers")
0
 
0
+clobber_test_app(AppPath)
0
+generate_test_app(AppPath)
0
 
0
 describe "startup.rb in a generated app" do
0
- before do
0
- clobber_test_app(AppPath)
0
- generate_test_app(AppPath)
0
- end
0
-
0
- after do
0
- clobber_test_app(AppPath)
0
- end
0
   
0
   it "should make the scripts executable" do
0
     File.executable?(File.join(AppPath, "bin", "waves-console")).should.be.true
0
@@ -32,3 +26,5 @@ describe "startup.rb in a generated app" do
0
     end
0
   end
0
 end
0
+
0
+clobber_test_app(AppPath)

Comments

    No one has commented yet.