sprout 1.1.10.pre → 1.1.11.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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.10.pre
1
+ 1.1.11.pre
@@ -378,14 +378,14 @@ module Sprout
378
378
  # @param path [File] Path to the executable binary that should be executed instead
379
379
  # of whatever Sprout.load would have provided. If a value is set here, Sprout.load
380
380
  # will not be called.
381
- # @returns [File] Path to the executable binary that should be executed.
381
+ # @return [File] Path to the executable binary that should be executed.
382
382
  #
383
383
  def binary_path=(path)
384
384
  @binary_path = path
385
385
  end
386
386
 
387
387
  ##
388
- # @returns [File] Path to the executable binary that should be executed.
388
+ # @return [File] Path to the executable binary that should be executed.
389
389
  def binary_path
390
390
  @binary_path ||= Sprout::Executable.load(executable, pkg_name, pkg_version).path
391
391
  end
@@ -99,21 +99,22 @@ module Sprout::Executable
99
99
  # already exists.
100
100
  def create_action_method options
101
101
  name = options[:name]
102
- accessor_can_be_defined_at name
103
-
104
- define_method(name) do |*params|
105
- action = name.to_s
106
- action = "y" if name == :confirm # Convert affirmation
107
- action << " #{params.join(' ')}" unless params.nil?
108
- action_stack << action
109
- execute_actions if process_launched?
102
+ if accessor_can_be_defined_at? name
103
+ define_method(name) do |*params|
104
+ action = name.to_s
105
+ action = "y" if name == :confirm # Convert confirmation
106
+ action << " #{params.join(' ')}" unless params.nil?
107
+ action_stack << action
108
+ execute_actions if process_launched?
109
+ end
110
110
  end
111
111
  end
112
112
 
113
113
  ##
114
- # TODO: Raise an exception if the name is
114
+ # TODO: Raise an exception and/or return false if the name is
115
115
  # already taken?
116
- def accessor_can_be_defined_at name
116
+ def accessor_can_be_defined_at? name
117
+ true
117
118
  end
118
119
 
119
120
  end
@@ -280,6 +281,7 @@ module Sprout::Executable
280
281
  # solution.
281
282
  #params = "#{params} " + '2>&1'
282
283
  @process_thread = Sprout.current_system.execute_thread binary, params, prompt do |message|
284
+ yield message if block_given?
283
285
  Sprout.stdout.printf message
284
286
  @prompted = true if prompt.match message
285
287
  end
@@ -121,6 +121,10 @@ module Sprout::System
121
121
  sleep(0.1)
122
122
  end
123
123
 
124
+ if !t.alive?
125
+ raise Sprout::Errors::UsageError.new(t['runner'].read_err)
126
+ end
127
+
124
128
  t
125
129
  end
126
130
 
@@ -0,0 +1,3 @@
1
+
2
+ YARD::Templates::Engine.register_template_path File.join('sprout', 'script', 'templates')
3
+
@@ -0,0 +1,17 @@
1
+ <div id="footer">
2
+ Generated on <%= Time.now.strftime("%c") %> by
3
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
4
+ <%= YARD::VERSION %> (ruby-<%= RUBY_VERSION %>).
5
+ </div>
6
+
7
+ <!-- Google Analytics for projectsprouts.org -->
8
+ <script type="text/javascript">
9
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
10
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
11
+ </script>
12
+ <script type="text/javascript">
13
+ var pageTracker = _gat._getTracker("UA-1619511-4");
14
+ pageTracker._initData();
15
+ pageTracker._trackPageview();
16
+ </script>
17
+
@@ -3,6 +3,43 @@ module Sprout
3
3
 
4
4
  class FDB < Executable::Session
5
5
 
6
+ ##
7
+ # Path to the file where test results should be written.
8
+ #
9
+ # @default 'TestResults.xml'
10
+ # @see :test_result_prefix
11
+ # @see :test_result_suffix
12
+ attr_accessor :test_result_file
13
+
14
+ ##
15
+ # Regular expression that will match the preamble that is sent
16
+ # by your test framework to indicate the beginning of structured
17
+ # test output.
18
+ #
19
+ # @default /<TestResults>/
20
+ # @see :test_result_file
21
+ # @see :test_result_suffix
22
+ attr_accessor :test_result_prefix
23
+
24
+ ##
25
+ # Regular expression that will match the suffix that is sent
26
+ # by your test framework to indicate the end of structured
27
+ # test output.
28
+ #
29
+ # @default /<\/TestResults>/
30
+ # @see :test_result_file
31
+ # @see :test_result_prefix
32
+ attr_accessor :test_result_suffix
33
+
34
+ def initialize
35
+ super
36
+ @test_result = ''
37
+ @inside_test_result = false
38
+ @test_result_file = 'TestResults.xml'
39
+ @test_result_prefix = /<TestResults>/
40
+ @test_result_suffix = /<\/TestResults>/
41
+ end
42
+
6
43
  set :default_prefix, '-'
7
44
 
8
45
  ##
@@ -737,6 +774,30 @@ module Sprout
737
774
  add_action :what
738
775
  add_action_alias :wh, :what
739
776
 
777
+ def system_execute binary, params
778
+ super do |message|
779
+ if message.match test_result_suffix
780
+ write_test_result
781
+ end
782
+ if @inside_test_result
783
+ @test_result << message
784
+ end
785
+ if message.match test_result_prefix
786
+ @inside_test_result = true
787
+ end
788
+ end
789
+ end
790
+
791
+ private
792
+
793
+ def write_test_result
794
+ File.open test_result_file, 'w+' do |f|
795
+ f.write @test_result
796
+ end
797
+ @test_result = ''
798
+ @inside_test_result = false
799
+ end
800
+
740
801
  end
741
802
  end
742
803
 
@@ -3,6 +3,7 @@
3
3
  class FakeFDB
4
4
 
5
5
  def initialize
6
+ validate_argv
6
7
  str = "Adobe fdb (Flash Player Debugger) [build 16076]\n"
7
8
  str << "Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.\n"
8
9
  str << "(fdb) "
@@ -39,6 +40,12 @@ class FakeFDB
39
40
  gather_input
40
41
  end
41
42
 
43
+ def validate_argv
44
+ if ARGV.size > 0
45
+ raise "FAKE FDB doesn't expect any params, but received, #{ARGV}"
46
+ end
47
+ end
48
+
42
49
  def handle_run args
43
50
  str = "Waiting for Player to connect\n"
44
51
  str << "Player connected; session starting.\n"
@@ -57,6 +64,9 @@ class FakeFDB
57
64
 
58
65
  def handle_continue args
59
66
  str = "Continuing now\n"
67
+ str << "<TestResults>\n"
68
+ str << "Fake Content\n"
69
+ str << "</TestResults>\n"
60
70
  str << "(fdb) "
61
71
  printf str
62
72
  end
@@ -88,3 +98,4 @@ end
88
98
 
89
99
  fake_fdb = FakeFDB.new
90
100
 
101
+
@@ -10,12 +10,18 @@ class ExecutableSessionTest < Test::Unit::TestCase
10
10
  # Uncomment the following to see interactive sessions:
11
11
  #Sprout.stdout = $stdout
12
12
  #Sprout.stderr = $stderr
13
+ @test_result_file = File.join fixtures, 'executable', 'Result.xml'
14
+ end
15
+
16
+ teardown do
17
+ remove_file @test_result_file
13
18
  end
14
19
 
15
20
  should "execute without shell params" do
16
21
  @fdb = Sprout::FDB.new
17
22
  # Comment to hit real FDB:
18
23
  @fdb.binary_path = File.join fixtures, 'executable', 'flex3sdk_gem', 'fdb'
24
+ @fdb.test_result_file = @test_result_file
19
25
 
20
26
  @fdb.execute false
21
27
  @fdb.run
@@ -28,10 +34,14 @@ class ExecutableSessionTest < Test::Unit::TestCase
28
34
  @fdb.break "AsUnitRunner:12"
29
35
 
30
36
  @fdb.continue
31
- @fdb.continue
37
+ #@fdb.continue
32
38
 
33
39
  #@fdb.handle_user_input
34
40
  @fdb.quit
41
+
42
+ assert_file @test_result_file do |content|
43
+ assert_match content, /Fake Content/
44
+ end
35
45
  end
36
46
 
37
47
  end
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 10
8
+ - 11
9
9
  - pre
10
- version: 1.1.10.pre
10
+ version: 1.1.11.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-18 00:00:00 -08:00
18
+ date: 2011-03-24 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -289,6 +289,8 @@ files:
289
289
  - script/console
290
290
  - script/destroy
291
291
  - script/generate
292
+ - script/google_analytics_footer.rb
293
+ - script/templates/default/layout/html/footer.erb
292
294
  - sprout.gemspec
293
295
  - test/fixtures/archive_unpacker/copyable/some_file.exe
294
296
  - test/fixtures/archive_unpacker/copyable/some_file.rb