bee 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -25,4 +25,4 @@ or go to URL http://www.apache.org/licenses/LICENSE-2.0).
25
25
 
26
26
  = Copyright
27
27
 
28
- bee version 0.7.1 (C) Michel Casabianca & Contributors - 2006-2010
28
+ bee version 0.8.0 (C) Michel Casabianca & Contributors - 2006-2010
@@ -0,0 +1,61 @@
1
+ - build: application
2
+ default: all
3
+ description: "Generate a sample Ruby application project"
4
+
5
+ - properties:
6
+ - name: application
7
+ - description: |
8
+ This script will create a sample Ruby application project. Build file
9
+ can run unit tests, generate API documentation, generate GEM archive
10
+ and build a ZIP distribution file.
11
+
12
+ - target: welcome
13
+ description: "Print information message"
14
+ script:
15
+ - print: :description
16
+
17
+ - target: prompt
18
+ depends: welcome
19
+ description: "Prompt for project information"
20
+ script:
21
+ - print: "Please answer following questions to generate the project:"
22
+ - prompt:
23
+ message: "What is the project's name?"
24
+ default: :name
25
+ property: name
26
+
27
+ - target: generate
28
+ depends: prompt
29
+ description: "Generate project"
30
+ script:
31
+ - print: "Generating project..."
32
+ - if: 'File.exists?("#{here}/#{name}")'
33
+ then:
34
+ - throw: "A directory named '#{name}' already exists, aborting"
35
+ - mkdir: "#{here}/#{name}"
36
+ - erb:
37
+ src: "#{base}/application/build.yml"
38
+ dest: "#{here}/#{name}/build.yml"
39
+ - mkdir: "#{here}/#{name}/bin"
40
+ - cp:
41
+ src: "#{base}/application/bin/start"
42
+ dest: "#{here}/#{name}/bin/#{name}"
43
+ - cp:
44
+ src: "#{base}/application/bin/start.bat"
45
+ dest: "#{here}/#{name}/bin/#{name}.bat"
46
+ - copy:
47
+ root: "#{base}/application"
48
+ excludes: ["build.yml", "bin/*"]
49
+ dest: "#{here}/#{name}"
50
+
51
+ - target: customization
52
+ depends: generate
53
+ description: "Print information about project customization"
54
+ script:
55
+ - print: |
56
+ Project has been generated in directory '#{name}'. Type 'bee -b'
57
+ to print information about generated build file.
58
+ Enjoy!
59
+
60
+ - target: all
61
+ depends: [welcome, prompt, generate, customization]
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Launching script.
4
+
5
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ require 'rubygems'
7
+ require 'application'
8
+
9
+ parse_command_line
@@ -0,0 +1,19 @@
1
+ @echo off
2
+ if not "%~f0" == "~f0" goto WinNT
3
+ ruby -Sx "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
4
+ goto endofruby
5
+ :WinNT
6
+ "%~d0%~p0ruby" -x "%~f0" %*
7
+ goto endofruby
8
+ #!/usr/bin/env ruby
9
+
10
+ # Launching script.
11
+
12
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
13
+ require 'rubygems'
14
+ require 'application'
15
+
16
+ parse_command_line
17
+
18
+ __END__
19
+ :endofruby
@@ -0,0 +1,96 @@
1
+ # Build info
2
+ - build: <%= name %>
3
+ default: all
4
+ description: Build file to build sample Ruby application.
5
+
6
+ # Build properties
7
+ - properties:
8
+ - name: "<%= name %>"
9
+ - version: ~
10
+ - author: ~
11
+ - years: ~
12
+ - platform: "Gem::Platform::RUBY"
13
+ - summary: ~
14
+ - email: ~
15
+ - homepage: ~
16
+ - rubyforge: ~
17
+ - dependencies:
18
+ bee: [">= 0.7.0"]
19
+ - lib_dir: "lib"
20
+ - test_dir: "test"
21
+ - build_dir: "build"
22
+ - api_dir: "#{build_dir}/api"
23
+ - gem_spec: "gem.spec"
24
+ - gem_spec_erb: "gem.spec.erb"
25
+ - gem_package: "#{name}-#{version}.gem"
26
+ - rdoc_files: ["#{lib_dir}/*.rb"]
27
+ - zip_excludes: ["**/CVS", "**/.DS_Store", "**/*~"]
28
+ - zip_prefix: "#{name}-#{version}"
29
+ - zip_archive: "#{build_dir}/#{name}-#{version}.zip"
30
+ - clean_dirs: [:build_dir]
31
+ - clean_files: ["**/*~", "**/.#*", "**/.DS_Store", :gem_spec]
32
+
33
+ # Build targets
34
+ - target: test
35
+ description: Run unit tests
36
+ script:
37
+ - test:
38
+ includes: "#{test_dir}/**/tc_*.rb"
39
+ dir: :test_dir
40
+
41
+ - target: gem
42
+ depends: test
43
+ description: Generate Gem package
44
+ script:
45
+ - mkdir: :build_dir
46
+ - erb: { src: :gem_spec_erb, dest: :gem_spec }
47
+ - gem: :gem_spec
48
+ - mv: { src: :gem_package, dest: :build_dir }
49
+
50
+ - target: api
51
+ description: Generate API documentation
52
+ script:
53
+ - mkdir: :build_dir
54
+ - rdoc: { includes: :rdoc_files, dest: :api_dir }
55
+
56
+ - target: zip
57
+ depends: [gem, api]
58
+ description: Generate ZIP distribution archive
59
+ script:
60
+ - zip:
61
+ root: :build_dir
62
+ includes: "*.gem"
63
+ prefix: "#{zip_prefix}/gem"
64
+ dest: :zip_archive
65
+ - zip:
66
+ root: :api_dir
67
+ includes: "**/*"
68
+ prefix: "#{zip_prefix}/doc"
69
+ dest: :zip_archive
70
+
71
+ - target: push
72
+ depends: [clean, gem]
73
+ description: Push gem on gemcutter (must have installed gemcutter to run)
74
+ script:
75
+ - "gem push #{build_dir}/#{gem_package}"
76
+
77
+ - target: install
78
+ depends: gem
79
+ description: Install generated gem
80
+ script:
81
+ - "sudo gem install -l #{build_dir}/#{gem_package}"
82
+
83
+ - target: uninstall
84
+ description: Uninstall gem
85
+ script:
86
+ - "sudo gem uninstall -x #{name}"
87
+
88
+ - target: clean
89
+ description: Clean generated files
90
+ script:
91
+ - rmdir: :clean_dirs
92
+ - rm: :clean_files
93
+
94
+ - target: all
95
+ depends: [clean, zip]
96
+ description: Generate the whole project
@@ -0,0 +1,24 @@
1
+ require 'rubygems'
2
+
3
+ SPEC = Gem::Specification.new do |spec|
4
+ spec.name = '<%= name %>'
5
+ spec.version = '<%= version %>'
6
+ spec.author = '<%= author %>'
7
+ spec.email = '<%= email %>'
8
+ spec.homepage = '<%= homepage %>'
9
+ spec.rubyforge_project = '<%= rubyforge %>'
10
+ spec.platform = <%= platform %>
11
+ spec.summary = '<%= summary %>'
12
+ spec.files = Dir.glob('{bin,lib}/**/*').delete_if do |file|
13
+ file =~ /CVS/
14
+ end
15
+ spec.require_path = 'lib'
16
+ spec.has_rdoc = true
17
+ spec.executables = ['<%= name %>']
18
+ spec.default_executable = '<%= name %>'
19
+ <% for key in dependencies.keys.sort %>
20
+ spec.add_dependency("<%= key %>", <%= dependencies[key].inspect %>)
21
+ <% end %>
22
+ spec.post_install_message = 'Enjoy <%= name %>!' if
23
+ spec.respond_to? :post_install_message
24
+ end
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Sample Ruby source file.
4
+
5
+ require 'getoptlong'
6
+
7
+ HELP = 'Usage: <%= name %>.rb [-h] [-t times] who
8
+ -h To print this help screen
9
+ -t times The number of times to great
10
+ who To name the person to great'
11
+
12
+ # Great a given person.
13
+ # - who: the person to great.
14
+ def hello(who)
15
+ return "Hello #{who}!"
16
+ end
17
+
18
+ # Run a given number of times.
19
+ # - times: the number of times to run.
20
+ def run(who, times)
21
+ times.times do
22
+ puts hello(who)
23
+ end
24
+ end
25
+
26
+ # parse command line
27
+ def parse_command_line()
28
+ who = 'World'
29
+ times = 1
30
+ opts = GetoptLong.new(
31
+ ["--help", "-h", GetoptLong::NO_ARGUMENT],
32
+ ["--times", "-t", GetoptLong::REQUIRED_ARGUMENT]
33
+ )
34
+ opts.each do |opt, arg|
35
+ case opt
36
+ when '--help'
37
+ puts HELP
38
+ exit 0
39
+ when '--times'
40
+ times = arg.to_i
41
+ end
42
+ end
43
+ if ARGV.length > 1
44
+ puts HELP
45
+ exit 0
46
+ end
47
+ if ARGV.length == 1
48
+ who = ARGV[0]
49
+ end
50
+ run(who, times)
51
+ end
52
+
53
+ # start from command line
54
+ if __FILE__ == $0
55
+ start_command_line
56
+ end
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Test suite for sample Ruby application.
4
+
5
+ require 'test/unit'
6
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ require 'application'
8
+
9
+ # Test sample Ruby application
10
+ class TestApplication < Test::Unit::TestCase
11
+
12
+ # Run before each test
13
+ def setup
14
+ end
15
+
16
+ # Test hello method
17
+ def test_hello
18
+ expected = 'Hello Foo!'
19
+ actual = hello('Foo')
20
+ assert_equal(expected, actual)
21
+ end
22
+
23
+ end
data/egg/script.yml ADDED
@@ -0,0 +1,44 @@
1
+ - build: source
2
+ default: all
3
+ description: "Generate a sample Ruby script project"
4
+
5
+ - properties:
6
+ - name: script
7
+ - description: This script will generate a sample Ruby script project.
8
+
9
+ - target: welcome
10
+ description: "Print information message"
11
+ script:
12
+ - print: :description
13
+
14
+ - target: prompt
15
+ depends: welcome
16
+ description: "Prompt for project information"
17
+ script:
18
+ - print: "Please answer following questions to generate the project:"
19
+ - prompt:
20
+ message: "What is the script project name?"
21
+ default: :name
22
+ property: name
23
+
24
+ - target: generate
25
+ depends: prompt
26
+ description: "Generate project"
27
+ script:
28
+ - print: "Generating project..."
29
+ - mkdir: "#{here}/#{name}"
30
+ - erb:
31
+ src: "#{base}/script/script.rb"
32
+ dest: "#{here}/#{name}/#{name}.rb"
33
+ - erb:
34
+ src: "#{base}/script/build.yml"
35
+ dest: "#{here}/#{name}/build.yml"
36
+
37
+ - target: customization
38
+ depends: generate
39
+ description: "Print information about project customization"
40
+ script:
41
+ - print: Script project has been generated in directory '#{name}'.
42
+
43
+ - target: all
44
+ depends: [welcome, prompt, generate, customization]
@@ -0,0 +1,32 @@
1
+ # Build info
2
+ - build: <%= name %>
3
+ default: all
4
+ description: Build file for the sample script project
5
+
6
+ # Build properties
7
+ - properties:
8
+ - name: "<%= name %>"
9
+ - version: "0.0.0"
10
+ - build: "build"
11
+ - clean_dirs: [:build]
12
+ - clean_files: ["**/*~", "**/.#*", "**/.DS_Store"]
13
+
14
+ # Build targets
15
+ - target: zip
16
+ description: Generate ZIP distribution archive
17
+ script:
18
+ - mkdir: :build
19
+ - zip:
20
+ excludes: "#{build}/**/*"
21
+ prefix: "#{name}-#{version}"
22
+ dest: "#{build}/#{name}-#{version}.zip"
23
+
24
+ - target: clean
25
+ description: Clean generated files
26
+ script:
27
+ - rmdir: :clean_dirs
28
+ - rm: :clean_files
29
+
30
+ - target: all
31
+ depends: [clean, zip]
32
+ description: Generate the whole project
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Sample Ruby source file.
4
+
5
+ require 'getoptlong'
6
+
7
+ HELP = 'Usage: <%= name %>.rb [-h] [-t times] who
8
+ -h To print this help screen
9
+ -t times The number of times to great
10
+ who To name the person to great'
11
+
12
+ # Great a given person.
13
+ # - who: the person to great.
14
+ # - times: number of times to great (defaults to 1).
15
+ def hello(who, times=1)
16
+ times.times do
17
+ puts "Hello #{who}!"
18
+ end
19
+ end
20
+
21
+ # parse command line
22
+ if __FILE__ == $0
23
+ who = 'World'
24
+ times = 1
25
+ opts = GetoptLong.new(
26
+ ["--help", "-h", GetoptLong::NO_ARGUMENT],
27
+ ["--times", "-t", GetoptLong::REQUIRED_ARGUMENT]
28
+ )
29
+ opts.each do |opt, arg|
30
+ case opt
31
+ when '--help'
32
+ puts HELP
33
+ exit 0
34
+ when '--times'
35
+ times = arg.to_i
36
+ end
37
+ end
38
+ if ARGV.length > 1
39
+ puts HELP
40
+ exit 0
41
+ end
42
+ if ARGV.length == 1
43
+ who = ARGV[0]
44
+ end
45
+ hello(who, times)
46
+ end
data/egg/source.yml ADDED
@@ -0,0 +1,40 @@
1
+ - build: source
2
+ default: all
3
+ description: "Generate a sample Ruby source file"
4
+
5
+ - properties:
6
+ - name: source.rb
7
+ - description: This script will generate a sample Ruby source file.
8
+
9
+ - target: welcome
10
+ description: "Print information message"
11
+ script:
12
+ - print: :description
13
+
14
+ - target: prompt
15
+ depends: welcome
16
+ description: "Prompt for project information"
17
+ script:
18
+ - print: "Please answer following questions to generate the project:"
19
+ - prompt:
20
+ message: "What is the source file name?"
21
+ default: :name
22
+ property: name
23
+
24
+ - target: generate
25
+ depends: prompt
26
+ description: "Generate project"
27
+ script:
28
+ - print: "Generating project..."
29
+ - erb:
30
+ src: "#{base}/source/source.rb"
31
+ dest: "#{here}/#{name}"
32
+
33
+ - target: customization
34
+ depends: generate
35
+ description: "Print information about project customization"
36
+ script:
37
+ - print: Source file '#{name}' has been generated in this directory.
38
+
39
+ - target: all
40
+ depends: [welcome, prompt, generate, customization]
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Sample Ruby source file.
4
+
5
+ require 'getoptlong'
6
+
7
+ HELP = 'Usage: <%= name %>.rb [-h] [-t times] who
8
+ -h To print this help screen
9
+ -t times The number of times to great
10
+ who To name the person to great'
11
+
12
+ # Great a given person.
13
+ # - who: the person to great.
14
+ # - times: number of times to great (defaults to 1).
15
+ def hello(who, times=1)
16
+ times.times do
17
+ puts "Hello #{who}!"
18
+ end
19
+ end
20
+
21
+ # parse command line
22
+ if __FILE__ == $0
23
+ who = 'World'
24
+ times = 1
25
+ opts = GetoptLong.new(
26
+ ["--help", "-h", GetoptLong::NO_ARGUMENT],
27
+ ["--times", "-t", GetoptLong::REQUIRED_ARGUMENT]
28
+ )
29
+ opts.each do |opt, arg|
30
+ case opt
31
+ when '--help'
32
+ puts HELP
33
+ exit 0
34
+ when '--times'
35
+ times = arg.to_i
36
+ end
37
+ end
38
+ if ARGV.length > 1
39
+ puts HELP
40
+ exit 0
41
+ end
42
+ if ARGV.length == 1
43
+ who = ARGV[0]
44
+ end
45
+ hello(who, times)
46
+ end
data/egg/xmlrpc.yml ADDED
@@ -0,0 +1,55 @@
1
+ - build: xmlrpc
2
+ default: all
3
+ description: "Generate a sample XML-RPC project"
4
+
5
+ - properties:
6
+ - project_name: xmlrpc
7
+ - description: |
8
+ This script will create a sample XML-RPC project with a Ruby server and
9
+ client.
10
+
11
+ - target: welcome
12
+ description: "Print information message"
13
+ script:
14
+ - print: :description
15
+
16
+ - target: prompt
17
+ depends: welcome
18
+ description: "Prompt for project information"
19
+ script:
20
+ - print: "Please answer following questions to generate the project:"
21
+ - prompt:
22
+ message: "What is the project's name?"
23
+ default: :project_name
24
+ property: project_name
25
+
26
+ - target: generate
27
+ depends: prompt
28
+ description: "Generate project"
29
+ script:
30
+ - print: "Generating project..."
31
+ - rb: |
32
+ error "A directory named '#{project_name}' already exists, aborting" if
33
+ File.exists?("#{here}/#{project_name}")
34
+ - mkdir: "#{here}/#{project_name}"
35
+ - erb:
36
+ src: "#{base}/xmlrpc/build.yml"
37
+ dest: "#{here}/#{project_name}/build.yml"
38
+ - cp:
39
+ src: "#{base}/xmlrpc/server.rb"
40
+ dest: "#{here}/#{project_name}/server.rb"
41
+ - cp:
42
+ src: "#{base}/xmlrpc/client.rb"
43
+ dest: "#{here}/#{project_name}/client.rb"
44
+
45
+ - target: customization
46
+ depends: generate
47
+ description: "Print information about project customization"
48
+ script:
49
+ - print: |
50
+ Project has been generated in directory '#{project_name}'. Type 'bee -b'
51
+ to print information about generated build file.
52
+ Enjoy!
53
+
54
+ - target: all
55
+ depends: [welcome, prompt, generate, customization]
@@ -0,0 +1,42 @@
1
+ # Build info
2
+ - build: <%= project_name %>
3
+ default: all
4
+ description: Sample XML-RPC project
5
+
6
+ # Build properties
7
+ - properties:
8
+ - name: <%= project_name %>
9
+ - version: "0.0.0"
10
+ - build: "build"
11
+ - zip: "#{build}/#{name}-#{version}.zip"
12
+ - clean_dirs: [:build]
13
+ - clean_files: ["**/*~", "**/.#*", "**/.DS_Store"]
14
+
15
+ # Build targets
16
+ - target: server
17
+ description: Run server
18
+ script:
19
+ - "ruby server.rb"
20
+
21
+ - target: client
22
+ description: Run client
23
+ script:
24
+ - "ruby client.rb"
25
+
26
+ - target: zip
27
+ description: Generate ZIP distribution archive
28
+ script:
29
+ - mkdir: :build
30
+ - zip:
31
+ prefix: "#{name}-#{version}"
32
+ dest: :zip
33
+
34
+ - target: clean
35
+ description: Clean generated files
36
+ script:
37
+ - rmdir: :clean_dirs
38
+ - rm: :clean_files
39
+
40
+ - target: all
41
+ depends: [clean, zip]
42
+ description: Generate the whole project
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Test Ruby XML-RPC client.
4
+
5
+ require 'xmlrpc/client'
6
+
7
+ client = XMLRPC::Client.new('localhost', '/', 8000)
8
+ puts client.call('test.hello', 'World')
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Test Ruby XML-RPC server.
4
+
5
+ require 'xmlrpc/server'
6
+
7
+ server = XMLRPC::Server.new(8000)
8
+ server.add_handler('test.hello') do |who|
9
+ "Hello #{who}!"
10
+ end
11
+ server.serve
data/lib/bee_console.rb CHANGED
@@ -60,7 +60,7 @@ targets Targets to run (default target if omitted).'
60
60
  | |__ ___ ___
61
61
  ____ | '_ \ / _ \/ _ \ _____ _____ _____ _____ _____ _____ _____ _____ _____
62
62
  |____| | |_) | __/ __/ |_____|_____|_____|_____|_____|_____|_____|_____|_____|
63
- |_.__/ \___|\___| 0.7.0 http://bee.rubyforge.org
63
+ |_.__/ \___|\___| 0.8.0 http://bee.rubyforge.org
64
64
 
65
65
  EOF
66
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Casabianca & Contributors
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-01 00:00:00 +02:00
12
+ date: 2010-04-04 00:00:00 +02:00
13
13
  default_executable: bee
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -49,6 +49,13 @@ files:
49
49
  - lib/bee_task.rb
50
50
  - lib/bee_task_default.rb
51
51
  - lib/bee_util.rb
52
+ - egg/application/bin/start
53
+ - egg/application/bin/start.bat
54
+ - egg/application/build.yml
55
+ - egg/application/gem.spec.erb
56
+ - egg/application/lib/application.rb
57
+ - egg/application/test/tc_application.rb
58
+ - egg/application.yml
52
59
  - egg/package/bee_task.erb
53
60
  - egg/package/build.erb
54
61
  - egg/package/egg.yml
@@ -64,9 +71,18 @@ files:
64
71
  - egg/package/test_build_listener.rb
65
72
  - egg/package/test_suite.rb
66
73
  - egg/package.yml
74
+ - egg/script/build.yml
75
+ - egg/script/script.rb
76
+ - egg/script.yml
67
77
  - egg/sinatra/build.yml
68
78
  - egg/sinatra/server.rb
69
79
  - egg/sinatra.yml
80
+ - egg/source/source.rb
81
+ - egg/source.yml
82
+ - egg/xmlrpc/build.yml
83
+ - egg/xmlrpc/client.rb
84
+ - egg/xmlrpc/server.rb
85
+ - egg/xmlrpc.yml
70
86
  - README
71
87
  - LICENSE
72
88
  has_rdoc: true