sprout 1.0.16.pre → 1.0.17.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sprout might be problematic. Click here for more details.

data/bin/sprout CHANGED
@@ -1,3 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/bash
2
+
3
+ echo 'Type sprout- and then hit the tab key to see the new sprout binaries.'
2
4
 
3
- puts 'Type sprout- and then hit the tab key to see the new sprout binaries.'
@@ -84,6 +84,7 @@ module Sprout
84
84
  options ||= {}
85
85
  options[:name] = name
86
86
  options[:type] = type
87
+ # TODO: Integrate the RDOC-parsed parameter description here:
87
88
  #options[:description] ||= Sprout::RDocParser.description_for_caller caller.shift
88
89
 
89
90
  create_param_accessors options
@@ -450,16 +451,24 @@ module Sprout
450
451
 
451
452
  def assembled_static_collection collection_name
452
453
  collection = []
453
- clazz = self.class
454
- while clazz do
455
- if clazz.respond_to?(collection_name)
454
+ inheritance_chain.reverse.each do |clazz|
455
+ if(clazz.respond_to?(collection_name))
456
456
  collection.concat clazz.send(collection_name)
457
457
  end
458
- clazz = clazz.superclass
459
458
  end
460
459
  collection
461
460
  end
462
461
 
462
+ def inheritance_chain
463
+ chain = []
464
+ clazz = self.class
465
+ while clazz do
466
+ chain << clazz
467
+ clazz = clazz.superclass
468
+ end
469
+ chain
470
+ end
471
+
463
472
  def add_help_param
464
473
  option_parser.on '--help', 'Display this help message' do
465
474
  puts option_parser.to_s
@@ -6,7 +6,7 @@ module Sprout
6
6
  module VERSION #:nodoc:
7
7
  MAJOR = 1
8
8
  MINOR = 0
9
- TINY = 16
9
+ TINY = 17
10
10
  RELEASE = 'pre'
11
11
 
12
12
  STRING = [MAJOR, MINOR, TINY, RELEASE].join('.')
data/rakefile.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
3
 
4
- Bundler.setup
4
+ Bundler.require
5
5
 
6
- require 'rake'
7
6
  require 'rake/clean'
8
7
  require 'rake/testtask'
9
8
  require 'rake/rdoctask'
@@ -31,20 +30,15 @@ namespace :test do
31
30
  task(:clean) { rm_f "coverage.data" }
32
31
  end
33
32
 
34
- # Apparently, rcov does not work on Windows.
33
+ # Apparently, rcov does not work on Windows or Ubuntu?
35
34
  # Hide these tasks so that we can at least
36
35
  # run the others...
37
- if(!(RUBY_PLATFORM =~ /mingw/i) && !(RUBY_PLATFORM =~/mswin/i))
36
+ if(RUBY_PLATFORM =~ /darwin/i)
38
37
  require 'rcov/rcovtask'
39
38
 
40
- namespace :coverage do
41
- desc "Delete aggregate coverage data."
42
- task(:clean) { rm_f "coverage.data" }
43
- end
44
-
45
- desc "Aggregate code coverage for unit, functional and integration tests"
46
- task :coverage => "test:coverage:clean"
47
-
39
+ CLEAN.add('coverage.data')
40
+ CLEAN.add('.coverage')
41
+
48
42
  # Hold collection in case we need it:
49
43
  #%w[unit functional integration].each do |target|
50
44
  %w[unit].each do |target|
@@ -54,7 +48,12 @@ namespace :test do
54
48
  t.test_files = FileList["test/#{target}/**/*_test.rb"]
55
49
  t.output_dir = ".coverage/#{target}"
56
50
  t.verbose = true
57
- t.rcov_opts << "--aggregate coverage.data --exclude .bundle"
51
+ t.rcov_opts = ["--sort coverage",
52
+ "--aggregate coverage.data",
53
+ "--exclude .bundle",
54
+ "--exclude .gem",
55
+ "--exclude errors.rb",
56
+ "--exclude progress_bar.rb"]
58
57
  end
59
58
  end
60
59
  task :coverage => "test:coverage:#{target}"
data/sprout.gemspec CHANGED
@@ -15,11 +15,10 @@ Gem::Specification.new do |s|
15
15
  s.homepage = "http://projectsprouts.org"
16
16
  s.summary = "Software development - evolved"
17
17
  s.description = "Project Sprouts gives you access to beautiful generators and easily customized templates, automated build scripts, distributed libraries and simple system configuration"
18
- s.post_install_message = File.read 'POSTINSTALL.rdoc'
19
18
  s.required_rubygems_version = ">= 1.3.6"
20
19
  s.rubyforge_project = "sprout"
21
20
  s.require_path = ['lib']
22
- s.files = FileList['**/**/*'].exclude /.git|.svn|.DS_Store/
21
+ s.files = FileList['**/**/*'].exclude /.git|.svn|.DS_Store|rdoc|.coverage|coverage|tmp|pkg/
23
22
  s.executables = ['sprout', 'sprout-library', 'sprout-tool', 'sprout-generator', 'sprout-class']
24
23
  s.add_bundler_dependencies
25
24
  end
@@ -0,0 +1,7 @@
1
+
2
+ class ExecutableSubclass < ExecutableSuperclass
3
+ include Sprout::Executable
4
+
5
+ add_param :subclass_param, String
6
+ end
7
+
@@ -0,0 +1,7 @@
1
+
2
+ class ExecutableSuperclass
3
+ include Sprout::Executable
4
+
5
+ add_param :superclass_param, String
6
+ end
7
+
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
  require 'test/fixtures/executable/mxmlc'
3
3
  require 'test/unit/fake_other_executable'
4
+ require 'test/fixtures/executable/subclass/executable_superclass'
5
+ require 'test/fixtures/executable/subclass/executable_subclass'
4
6
 
5
7
  class ExecutableTest < Test::Unit::TestCase
6
8
  include SproutTestCase
@@ -8,7 +10,14 @@ class ExecutableTest < Test::Unit::TestCase
8
10
  context "a new executable delegate" do
9
11
 
10
12
  setup do
11
- @tool = FakeOtherExecutableTask.new
13
+ @tool = FakeOtherExecutableTask.new
14
+ @subclassed = ExecutableSubclass.new
15
+ end
16
+
17
+ should "add subclass params after those added by superclass" do
18
+ @subclassed.superclass_param = 'A.txt'
19
+ @subclassed.subclass_param = 'B.txt'
20
+ assert_equal '--superclass-param=A.txt --subclass-param=B.txt', @subclassed.to_shell
12
21
  end
13
22
 
14
23
  should "accept boolean param" do
@@ -32,7 +32,6 @@ class GeneratorTest < Test::Unit::TestCase
32
32
  @generator = configure_generator FakeGenerator.new
33
33
 
34
34
  Sprout::Generator.register OtherFakeGenerator
35
-
36
35
  FileUtils.mkdir_p @fixture
37
36
  end
38
37
 
@@ -276,7 +275,7 @@ class GeneratorTest < Test::Unit::TestCase
276
275
  end
277
276
 
278
277
  should "be loadable if it's in the load path" do
279
- generator = Sprout::Generator.load :demo, 'temp_generator', '>= 1.0.pre'
278
+ generator = Sprout::Generator.load :application, 'temp_generator', '>= 1.0.pre'
280
279
  assert_not_nil generator
281
280
 
282
281
  generator.logger = StringIO.new
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 16
8
+ - 17
9
9
  - pre
10
- version: 1.0.16.pre
10
+ version: 1.0.17.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes
@@ -243,7 +243,6 @@ files:
243
243
  - lib/sprout/platform.rb
244
244
  - lib/sprout/process_runner.rb
245
245
  - lib/sprout/progress_bar.rb
246
- - lib/sprout/rdoc_parser.rb
247
246
  - lib/sprout/remote_file_loader.rb
248
247
  - lib/sprout/remote_file_target.rb
249
248
  - lib/sprout/ruby_feature.rb
@@ -261,7 +260,6 @@ files:
261
260
  - lib/sprout/version.rb
262
261
  - lib/sprout.rb
263
262
  - MIT-LICENSE
264
- - POSTINSTALL.rdoc
265
263
  - rakefile.rb
266
264
  - README.textile
267
265
  - script/console
@@ -298,6 +296,8 @@ files:
298
296
  - test/fixtures/executable/paths/folder2/file5
299
297
  - test/fixtures/executable/paths/folder3/file6
300
298
  - test/fixtures/executable/src/Main.as
299
+ - test/fixtures/executable/subclass/executable_subclass.rb
300
+ - test/fixtures/executable/subclass/executable_superclass.rb
301
301
  - test/fixtures/executable/windows_line_endings
302
302
  - test/fixtures/generators/song_generator.rb
303
303
  - test/fixtures/generators/song_subclass/least_favorite.rb
@@ -351,7 +351,6 @@ files:
351
351
  - test/unit/paths_param_test.rb
352
352
  - test/unit/platform_test.rb
353
353
  - test/unit/process_runner_test.rb
354
- - test/unit/rdoc_parser_test.rb
355
354
  - test/unit/remote_file_loader_test.rb
356
355
  - test/unit/remote_file_target_test.rb
357
356
  - test/unit/ruby_feature_test.rb
@@ -373,36 +372,7 @@ has_rdoc: true
373
372
  homepage: http://projectsprouts.org
374
373
  licenses: []
375
374
 
376
- post_install_message: |
377
- +++++++++++++++++++++++++++++++++++
378
- Welcome to Project Sprouts!
379
-
380
- If you want to experiment with Sprouts, try the following steps:
381
-
382
- 1) Create a new ActionScript 3 Project:
383
- sprout -n as3 SomeProject
384
-
385
- 2) cd to the new directory:
386
- cd SomeProject
387
-
388
- 3) Install all prerequisites:
389
- bundle install
390
-
391
- 4) Compile and run the new project:
392
- rake
393
-
394
- 5) Generate a class, test and suite:
395
- script/generate utils.MathUtil
396
-
397
- 6) Compile and run the test harness:
398
- rake test
399
-
400
- If you have any questions or issues, please email us at:
401
-
402
- projectsprouts@googlegroups.com
403
-
404
- +++++++++++++++++++++++++++++++++++
405
-
375
+ post_install_message:
406
376
  rdoc_options: []
407
377
 
408
378
  require_paths:
data/POSTINSTALL.rdoc DELETED
@@ -1,28 +0,0 @@
1
- +++++++++++++++++++++++++++++++++++
2
- Welcome to Project Sprouts!
3
-
4
- If you want to experiment with Sprouts, try the following steps:
5
-
6
- 1) Create a new ActionScript 3 Project:
7
- sprout -n as3 SomeProject
8
-
9
- 2) cd to the new directory:
10
- cd SomeProject
11
-
12
- 3) Install all prerequisites:
13
- bundle install
14
-
15
- 4) Compile and run the new project:
16
- rake
17
-
18
- 5) Generate a class, test and suite:
19
- script/generate utils.MathUtil
20
-
21
- 6) Compile and run the test harness:
22
- rake test
23
-
24
- If you have any questions or issues, please email us at:
25
-
26
- projectsprouts@googlegroups.com
27
-
28
- +++++++++++++++++++++++++++++++++++
@@ -1,91 +0,0 @@
1
- require 'rdoc/rdoc'
2
-
3
- module Sprout
4
-
5
- class RDocParser
6
-
7
- def parse content
8
- end
9
-
10
- def parse_from_caller_string caller_string
11
- class_name, file_name, line_number = parse_caller_string caller_string
12
- rdoc_description_for class_name, file_name, line_number
13
- end
14
-
15
- private
16
-
17
- ##
18
- # NOTE: Don't forget that this string *sometimes* contains a colon on Windows...
19
- def parse_caller_string caller_string
20
- sections = caller_string.split(' ')
21
- parts = sections.first.split(':')
22
- file_name = parts.shift
23
- line_number = parts.shift
24
- class_name = class_name_from_caller_string caller_string
25
- #puts ">> class_name: #{class_name} file_name: #{file_name} line_number: #{line_number}"
26
- [class_name, file_name, line_number]
27
- end
28
-
29
- def class_name_from_caller_string caller_string
30
- parts = caller_string.split(' ')
31
- long = parts.pop
32
- matched = long.match /<class:([\w:]+)>/
33
- matched[1] unless matched.nil?
34
- end
35
-
36
- def rdoc_description_for class_name, file_name, line_number
37
- rendered = rendered_rdoc file_name
38
- end
39
-
40
- def rendered_rdoc file
41
- @rendered_rdoc ||= render_rdoc file
42
- end
43
-
44
- def render_rdoc file
45
- rdoc = RDoc::RDoc.new
46
- puts "==================================="
47
- puts ">> generating rdoc for: #{file}"
48
-
49
- rdoc.document [ file, "--format=xml", "--output=temp" ]
50
- {}
51
- end
52
-
53
- def render_rdoc_from_files
54
- # This works to some extent...
55
- #rdoc test/fixtures/examples/echo_inputs.rb --fmt=xml --op=tmp --all -q
56
- # But the following does not do the same thing:
57
- #response = rdoc.document [ file, '--fmt=xml', '--op=tmp', '--all', '-q' ]
58
-
59
- options = RDoc::Options.new
60
- options.files = FileList[ file ]
61
- options.formatter = 'markup'
62
- options.op_dir = './tmp'
63
- options.verbosity = 0
64
-
65
- rdoc.options = options
66
-
67
- #rdoc.stats = RDoc::Stats.new 1, options.verbosity
68
- #response = rdoc.document []
69
-
70
- response = rdoc.parse_files [ file ]
71
- render_rdoc_toplevel response
72
- end
73
-
74
- def render_rdoc_toplevel toplevel
75
- puts ">> toplevel: #{toplevel}"
76
- toplevel.each do |file|
77
- puts ">> file: #{file.name}"
78
- puts ">> pretty: #{file.pretty_print}"
79
- end
80
-
81
- toplevel
82
- end
83
-
84
- def render_rdoc_bak file
85
- rdoc = RDoc::RDoc.new
86
- rdoc.options = RDoc::Options.new
87
- rdoc.parse_files [file]
88
- end
89
- end
90
- end
91
-
@@ -1,15 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper'
2
- require 'test/fixtures/examples/echo_inputs'
3
-
4
- class ExecutableOptionParserTest < Test::Unit::TestCase
5
- include SproutTestCase
6
-
7
- context "a new RDoc parser" do
8
-
9
- setup do
10
- @parser = Sprout::RDocParser.new
11
- end
12
-
13
- end
14
- end
15
-