bee 0.11.1 → 0.11.2

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.11.1 (C) Michel Casabianca & Contributors - 2006-2011
28
+ bee version 0.11.2 (C) Michel Casabianca & Contributors - 2006-2012
data/bin/bee CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
3
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -7,7 +7,7 @@ goto endofruby
7
7
  goto endofruby
8
8
  #!/usr/bin/env ruby
9
9
 
10
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
10
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
11
11
  #
12
12
  # Licensed under the Apache License, Version 2.0 (the "License");
13
13
  # you may not use this file except in compliance with the License.
@@ -0,0 +1,36 @@
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Build info
16
+ - build: bee
17
+ default: clean
18
+ description: Parent build file to clean
19
+ abstract: true
20
+
21
+ # Build properties
22
+ - properties:
23
+ build_dir: ~
24
+ clean_dirs:
25
+ - :build_dir
26
+ clean_files:
27
+ - "**/*~"
28
+ - "**/.#*#"
29
+
30
+ # Build targets
31
+ - target: clean
32
+ description: Clean generated files
33
+ script:
34
+ - rmdir: :clean_dirs
35
+ - rm: :clean_files
36
+
@@ -1,5 +1,5 @@
1
- - build: application
2
- default: all
1
+ - build: application
2
+ default: all
3
3
  description: "Generate a sample Ruby application project"
4
4
 
5
5
  - properties:
@@ -9,13 +9,13 @@
9
9
  can run unit tests, generate API documentation, generate GEM archive
10
10
  and build a ZIP distribution file.
11
11
 
12
- - target: welcome
12
+ - target: welcome
13
13
  description: "Print information message"
14
14
  script:
15
15
  - print: :description
16
16
 
17
- - target: prompt
18
- depends: welcome
17
+ - target: prompt
18
+ depends: welcome
19
19
  description: "Prompt for project information"
20
20
  script:
21
21
  - print: "Please answer following questions to generate the project:"
@@ -24,8 +24,8 @@
24
24
  default: :name
25
25
  property: name
26
26
 
27
- - target: generate
28
- depends: prompt
27
+ - target: generate
28
+ depends: prompt
29
29
  description: "Generate project"
30
30
  script:
31
31
  - print: "Generating project..."
@@ -48,8 +48,8 @@
48
48
  excludes: ["build.yml", "bin/*"]
49
49
  dest: "#{here}/#{name}"
50
50
 
51
- - target: customization
52
- depends: generate
51
+ - target: customization
52
+ depends: generate
53
53
  description: "Print information about project customization"
54
54
  script:
55
55
  - print: |
@@ -57,5 +57,5 @@
57
57
  to print information about generated build file.
58
58
  Enjoy!
59
59
 
60
- - target: all
60
+ - target: all
61
61
  depends: [welcome, prompt, generate, customization]
@@ -1,5 +1,5 @@
1
- - build: package
2
- default: all
1
+ - build: package
2
+ default: all
3
3
  description: "Generate a bee package project"
4
4
 
5
5
  - properties:
@@ -12,13 +12,13 @@
12
12
  'clean' target to clean generated files and a 'install' target to build
13
13
  and install gem.
14
14
 
15
- - target: welcome
15
+ - target: welcome
16
16
  description: "Print information message"
17
17
  script:
18
18
  - print: :description
19
19
 
20
- - target: prompt
21
- depends: welcome
20
+ - target: prompt
21
+ depends: welcome
22
22
  description: "Prompt for project information"
23
23
  script:
24
24
  - print: "Please answer following questions to generate the project:"
@@ -27,8 +27,8 @@
27
27
  default: :project_name
28
28
  property: project_name
29
29
 
30
- - target: generate
31
- depends: prompt
30
+ - target: generate
31
+ depends: prompt
32
32
  description: "Generate project"
33
33
  script:
34
34
  - print: "Generating project..."
@@ -85,8 +85,8 @@
85
85
  src: "#{base}/package/egg_script.rb"
86
86
  dest: "#{here}/#{project_name}/egg/#{project_short_name}/script.rb"
87
87
 
88
- - target: customization
89
- depends: generate
88
+ - target: customization
89
+ depends: generate
90
90
  description: "Print information about project customization"
91
91
  script:
92
92
  - print: |
@@ -96,5 +96,5 @@
96
96
  generated build file.
97
97
  Enjoy!
98
98
 
99
- - target: all
99
+ - target: all
100
100
  depends: [welcome, prompt, generate, customization]
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
3
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,18 +1,18 @@
1
- - build: source
2
- default: all
1
+ - build: source
2
+ default: all
3
3
  description: "Generate a sample Ruby script project"
4
4
 
5
5
  - properties:
6
- name: script
6
+ name: script
7
7
  description: This script will generate a sample Ruby script project.
8
8
 
9
- - target: welcome
9
+ - target: welcome
10
10
  description: "Print information message"
11
11
  script:
12
12
  - print: :description
13
13
 
14
- - target: prompt
15
- depends: welcome
14
+ - target: prompt
15
+ depends: welcome
16
16
  description: "Prompt for project information"
17
17
  script:
18
18
  - print: "Please answer following questions to generate the project:"
@@ -21,8 +21,8 @@
21
21
  default: :name
22
22
  property: name
23
23
 
24
- - target: generate
25
- depends: prompt
24
+ - target: generate
25
+ depends: prompt
26
26
  description: "Generate project"
27
27
  script:
28
28
  - print: "Generating project..."
@@ -34,11 +34,11 @@
34
34
  src: "#{base}/script/build.yml"
35
35
  dest: "#{here}/#{name}/build.yml"
36
36
 
37
- - target: customization
38
- depends: generate
37
+ - target: customization
38
+ depends: generate
39
39
  description: "Print information about project customization"
40
40
  script:
41
41
  - print: Script project has been generated in directory '#{name}'.
42
42
 
43
- - target: all
43
+ - target: all
44
44
  depends: [welcome, prompt, generate, customization]
@@ -1,5 +1,5 @@
1
- - build: package
2
- default: all
1
+ - build: package
2
+ default: all
3
3
  description: "Generate a Sinatra project"
4
4
 
5
5
  - properties:
@@ -9,13 +9,13 @@
9
9
  target 'run' to run the server, 'zip' to generate a distribution archive
10
10
  and 'clean' to delete generated files.
11
11
 
12
- - target: welcome
12
+ - target: welcome
13
13
  description: "Print information message"
14
14
  script:
15
15
  - print: :description
16
16
 
17
- - target: prompt
18
- depends: welcome
17
+ - target: prompt
18
+ depends: welcome
19
19
  description: "Prompt for project information"
20
20
  script:
21
21
  - print: "Please answer following questions to generate the project:"
@@ -24,8 +24,8 @@
24
24
  default: :name
25
25
  property: name
26
26
 
27
- - target: generate
28
- depends: prompt
27
+ - target: generate
28
+ depends: prompt
29
29
  description: "Generate project"
30
30
  script:
31
31
  - print: "Generating project..."
@@ -40,8 +40,8 @@
40
40
  src: "#{base}/sinatra/server.rb"
41
41
  dest: "#{here}/#{name}/server.rb"
42
42
 
43
- - target: customization
44
- depends: generate
43
+ - target: customization
44
+ depends: generate
45
45
  description: "Print information about project customization"
46
46
  script:
47
47
  - print: |
@@ -51,5 +51,5 @@
51
51
  'b call' for instance (which requires curl).
52
52
  Enjoy!
53
53
 
54
- - target: all
54
+ - target: all
55
55
  depends: [welcome, prompt, generate, customization]
@@ -1,5 +1,5 @@
1
- - build: xmlrpc
2
- default: all
1
+ - build: xmlrpc
2
+ default: all
3
3
  description: "Generate a sample XML-RPC project"
4
4
 
5
5
  - properties:
@@ -8,13 +8,13 @@
8
8
  This script will create a sample XML-RPC project with a Ruby server and
9
9
  client.
10
10
 
11
- - target: welcome
11
+ - target: welcome
12
12
  description: "Print information message"
13
13
  script:
14
14
  - print: :description
15
15
 
16
- - target: prompt
17
- depends: welcome
16
+ - target: prompt
17
+ depends: welcome
18
18
  description: "Prompt for project information"
19
19
  script:
20
20
  - print: "Please answer following questions to generate the project:"
@@ -23,8 +23,8 @@
23
23
  default: :project_name
24
24
  property: project_name
25
25
 
26
- - target: generate
27
- depends: prompt
26
+ - target: generate
27
+ depends: prompt
28
28
  description: "Generate project"
29
29
  script:
30
30
  - print: "Generating project..."
@@ -42,8 +42,8 @@
42
42
  src: "#{base}/xmlrpc/client.rb"
43
43
  dest: "#{here}/#{project_name}/client.rb"
44
44
 
45
- - target: customization
46
- depends: generate
45
+ - target: customization
46
+ depends: generate
47
47
  description: "Print information about project customization"
48
48
  script:
49
49
  - print: |
@@ -51,5 +51,5 @@
51
51
  to print information about generated build file.
52
52
  Enjoy!
53
53
 
54
- - target: all
54
+ - target: all
55
55
  depends: [welcome, prompt, generate, customization]
@@ -13,17 +13,17 @@
13
13
  clean_files: ["**/*~", "**/.#*", "**/.DS_Store"]
14
14
 
15
15
  # Build targets
16
- - target: server
16
+ - target: server
17
17
  description: Run server
18
18
  script:
19
19
  - "ruby server.rb"
20
20
 
21
- - target: client
21
+ - target: client
22
22
  description: Run client
23
23
  script:
24
24
  - "ruby client.rb"
25
25
 
26
- - target: zip
26
+ - target: zip
27
27
  description: Generate ZIP distribution archive
28
28
  script:
29
29
  - mkdir: :build
@@ -31,12 +31,12 @@
31
31
  prefix: "#{name}-#{version}"
32
32
  dest: :zip
33
33
 
34
- - target: clean
34
+ - target: clean
35
35
  description: Clean generated files
36
36
  script:
37
37
  - rmdir: :clean_dirs
38
38
  - rm: :clean_files
39
39
 
40
- - target: all
41
- depends: [clean, zip]
40
+ - target: all
41
+ depends: [clean, zip]
42
42
  description: Generate the whole project
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
14
14
 
15
15
  require 'rubygems'
16
16
  require 'bee_console_style'
17
+ require 'yaml'
17
18
 
18
19
  module Bee
19
20
 
@@ -224,7 +225,7 @@ module Bee
224
225
  help << "properties:\n"
225
226
  for property in build.context.properties.sort
226
227
  help << "- #{property}: " +
227
- "#{build.context.get_property(property).inspect}\n"
228
+ "#{format_property_value(build.context.get_property(property))}\n"
228
229
  end
229
230
  end
230
231
  # print build targets
@@ -307,6 +308,18 @@ module Bee
307
308
  return "UNKNOWN CONSTRUCT"
308
309
  end
309
310
 
311
+ def format_property_value(data)
312
+ if data.kind_of?(Hash)
313
+ pairs = []
314
+ for key in data.keys()
315
+ pairs << "#{format_property_value(key)}: #{format_property_value(data[key])}"
316
+ end
317
+ return "{#{pairs.join(', ')}}"
318
+ else
319
+ return data.inspect
320
+ end
321
+ end
322
+
310
323
  end
311
324
 
312
325
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ module Bee
42
42
  #
43
43
  # - echo: "Hello World!"
44
44
  def echo(message)
45
+ message = '' if message == nil
45
46
  case message
46
47
  when String
47
48
  puts message
@@ -1316,8 +1317,10 @@ EOF
1316
1317
  params_desc = {
1317
1318
  :root => { :mandatory => false, :type => :string },
1318
1319
  :includes => { :mandatory => true, :type => :string_or_array },
1319
- :excludes => { :mandatory => false, :type => :string_or_array, :default => nil },
1320
- :dotmatch => { :mandatory => false, :type => :boolean, :default => false },
1320
+ :excludes => { :mandatory => false, :type => :string_or_array,
1321
+ :default => nil },
1322
+ :dotmatch => { :mandatory => false, :type => :boolean,
1323
+ :default => false },
1321
1324
  :dest => { :mandatory => true, :type => :string }
1322
1325
  }
1323
1326
  check_parameters(parameters, params_desc)
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2011 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2012 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  # 2006 Avi Bryant
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@ module Bee
25
25
  # Default package name.
26
26
  DEFAULT_PACKAGE = 'default'
27
27
  # Compact pattern for resource (':gem.file[version]')
28
- COMPACT_PATTERN = /^:(.*?)\.(.*?)(\[(.*)\])?$/
28
+ COMPACT_PATTERN = /^:(.*?):(.*?)(\[(.*)\])?$/
29
29
  # Expanded pattern for resource ('ruby://gem:version/file')
30
30
  EXPANDED_PATTERN = /^ruby:\/\/(.*?)(:(.*?))?\/(.*)$/
31
31
  # Default terminal width
@@ -168,6 +168,7 @@ module Bee
168
168
  case resource
169
169
  when COMPACT_PATTERN
170
170
  gem, version, path = $1, $4, $2
171
+ gem = "bee_#{gem}" if gem != 'bee'
171
172
  when EXPANDED_PATTERN
172
173
  gem, version, path = $1, $3, $4
173
174
  else
@@ -208,16 +209,14 @@ module Bee
208
209
  # - template: template to look for (like 'foo.bar').
209
210
  # return: found associated file.
210
211
  def self.find_template(template)
211
- raise Bee::Util::BuildError.
212
- new("Invalid template name '#{template}'") if
212
+ raise Bee::Util::BuildError.new("Invalid template name '#{template}'") if
213
213
  not template =~ /^([^.]+\.)?[^.]+$/
214
214
  package, egg = template.split('.')
215
215
  if not egg
216
216
  egg = package
217
217
  package = 'bee'
218
218
  end
219
- prefix = (package == 'bee' ? '':'bee_')
220
- resource = ":#{prefix}#{package}.egg/#{egg}.yml"
219
+ resource = ":#{package}:egg/#{egg}.yml"
221
220
  begin
222
221
  file = absolute_path(resource, Dir.pwd)
223
222
  rescue Exception
@@ -240,9 +239,8 @@ module Bee
240
239
  egg = package
241
240
  package = 'bee'
242
241
  end
243
- prefix = (package == 'bee' ? '':'bee_')
244
242
  egg = '*' if egg == '?'
245
- resource = ":#{prefix}#{package}.egg/#{egg}.yml"
243
+ resource = ":#{package}:egg/#{egg}.yml"
246
244
  begin
247
245
  glob = absolute_path(resource, nil)
248
246
  rescue
@@ -1,5 +1,5 @@
1
1
  module Bee
2
2
 
3
- VERSION = '0.11.1'
3
+ VERSION = '0.11.2'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bee
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 11
9
- - 1
10
- version: 0.11.1
9
+ - 2
10
+ version: 0.11.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michel Casabianca & Contributors
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-09 00:00:00 +01:00
18
+ date: 2012-01-29 00:00:00 +01:00
19
19
  default_executable: bee
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -127,6 +127,7 @@ files:
127
127
  - egg/xmlrpc/client.rb
128
128
  - egg/xmlrpc/server.rb
129
129
  - egg/xmlrpc.yml
130
+ - clean.yml
130
131
  - README
131
132
  - LICENSE
132
133
  has_rdoc: true