semilla 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,87 +1,87 @@
1
- require "rake"
2
-
3
- module Semilla
4
-
5
- class TestCaseFile
6
- attr_accessor :path
7
-
8
- #Constructor. The parameter should be a string from rake
9
- def initialize(fpath)
10
- @path = fpath
11
- end
12
-
13
-
14
- #The file name without extension
15
- def name
16
- @path.pathmap '%n'
17
- end
18
-
19
-
20
- #Get the package name from the contents of the file
21
- def package
22
- if !@_package
23
- #Open the file
24
- File.open @path do |io|
25
- io.each do |line|
26
- #Search for the package name
27
- if line =~ /^package (.*)/
28
- @_package = $1.rstrip
29
- end
30
- end
31
- #no package name found, set to empty string
32
- @_package = "" if !@_package
33
- end
34
- end
35
- return @_package
36
- end
37
-
38
-
39
- #The import statement for this class
40
- def import
41
- if self.package != ""
42
- return "#{self.package}.#{self.name}"
43
- else
44
- return self.name
45
- end
46
- end
47
- end
48
-
49
-
50
- ######################################################################
51
- #Define a rake task for auto generating the TestRunner code
52
- def self.test_runner(output, files, port=1026, template="test-src/TestRunner.template")
53
- #Prepare arguments for the FileTask
54
- files.include template
55
- args = Array.new
56
- args << {output => files} #target file => dependencies
57
-
58
- body = proc {
59
- #create the test case generators
60
- generators = Array.new
61
- files.each do |f|
62
- tc = TestCaseFile.new f
63
- puts "[testRunner] Adding: #{tc.import}"
64
- generators << tc
65
- end
66
- #open the template and insert the import statements and class list
67
- File.open template do |io|
68
- txt = io.read
69
- #insert import list
70
- txt.sub! "@@IMPORTS@@", generators.map { |t| "\timport #{t.import};" }.join("\n")
71
- #insert class names
72
- txt.sub! "@@CLASSES@@", generators.map { |t| t.name }.join(",")
73
- #insert port number
74
- txt.sub! "@@PORT@@", port.to_s
75
-
76
- #write the generated code
77
- generated = File.new output, "w"
78
- generated.write txt
79
- generated.close
80
- end
81
- }
82
-
83
- #Create the file task (checks for dependency updates for us)
84
- Rake::FileTask.define_task(*args, &body)
85
- end
86
-
87
- end
1
+ require "rake"
2
+
3
+ module Semilla
4
+
5
+ class TestCaseFile
6
+ attr_accessor :path
7
+
8
+ #Constructor. The parameter should be a string from rake
9
+ def initialize(fpath)
10
+ @path = fpath
11
+ end
12
+
13
+
14
+ #The file name without extension
15
+ def name
16
+ @path.pathmap '%n'
17
+ end
18
+
19
+
20
+ #Get the package name from the contents of the file
21
+ def package
22
+ if !@_package
23
+ #Open the file
24
+ File.open @path do |io|
25
+ io.each do |line|
26
+ #Search for the package name
27
+ if line =~ /^package (.*)/
28
+ @_package = $1.rstrip
29
+ end
30
+ end
31
+ #no package name found, set to empty string
32
+ @_package = "" if !@_package
33
+ end
34
+ end
35
+ return @_package
36
+ end
37
+
38
+
39
+ #The import statement for this class
40
+ def import
41
+ if self.package != ""
42
+ return "#{self.package}.#{self.name}"
43
+ else
44
+ return self.name
45
+ end
46
+ end
47
+ end
48
+
49
+
50
+ ######################################################################
51
+ #Define a rake task for auto generating the TestRunner code
52
+ def self.test_runner(output, files, port=1026, template="test-src/TestRunner.template")
53
+ #Prepare arguments for the FileTask
54
+ files.include template
55
+ args = Array.new
56
+ args << {output => files} #target file => dependencies
57
+
58
+ body = proc {
59
+ #create the test case generators
60
+ generators = Array.new
61
+ files.each do |f|
62
+ tc = TestCaseFile.new f
63
+ puts "[testRunner] Adding: #{tc.import}"
64
+ generators << tc
65
+ end
66
+ #open the template and insert the import statements and class list
67
+ File.open template do |io|
68
+ txt = io.read
69
+ #insert import list
70
+ txt.sub! "@@IMPORTS@@", generators.map { |t| "\timport #{t.import};" }.join("\n")
71
+ #insert class names
72
+ txt.sub! "@@CLASSES@@", generators.map { |t| t.name }.join(",")
73
+ #insert port number
74
+ txt.sub! "@@PORT@@", port.to_s
75
+
76
+ #write the generated code
77
+ generated = File.new output, "w"
78
+ generated.write txt
79
+ generated.close
80
+ end
81
+ }
82
+
83
+ #Create the file task (checks for dependency updates for us)
84
+ Rake::FileTask.define_task(*args, &body)
85
+ end
86
+
87
+ end
@@ -1,3 +1,3 @@
1
- module Semilla
2
- VERSION = '0.0.3'
3
- end
1
+ module Semilla
2
+ VERSION = '0.0.4'
3
+ end
data/lib/semilla.rb CHANGED
@@ -1,36 +1,38 @@
1
-
2
-
3
- require 'semilla/report_server'
4
- require 'semilla/reports'
5
- require 'semilla/test'
6
- require 'semilla/test_runner'
7
-
8
-
9
- ## Rake usage
10
-
11
- =begin
12
-
13
- #################################################################
14
- # Rake task to create the test runner actionscript
15
- #
16
- # @param output file
17
- # @param test classes file list
18
- # @param report server port
19
- Semilla::test_runner "outputfile.as", FileList["test-src/**/*Test.as"], 1026
20
-
21
- #################################################################
22
- # Rake task to test a swf and get a report in junit xml format.
23
- #
24
- # @param task id
25
- # @param dependencies
26
- Semilla::flex_unit :taskname => [dependencies]] do |t|
27
- #Configuration options
28
- # serverPort :player, :swf, :reportpath, :timeout
29
- # serverPort :player, :swf, :reportpath, :timeout
30
- t.serverPort = 1026
31
- t.swf = "app.swf"
32
- t.reportpath = "reports"
33
- t.timeout = 10
34
- end
35
-
36
- =end
1
+
2
+
3
+ require 'semilla/report_server'
4
+ require 'semilla/reports'
5
+ require 'semilla/test'
6
+ require 'semilla/test_runner'
7
+ require 'semilla/platform'
8
+ require 'semilla/flash_player'
9
+
10
+
11
+ ## Rake usage
12
+
13
+ =begin
14
+
15
+ #################################################################
16
+ # Rake task to create the test runner actionscript
17
+ #
18
+ # @param output file
19
+ # @param test classes file list
20
+ # @param report server port
21
+ Semilla::test_runner "outputfile.as", FileList["test-src/**/*Test.as"], 1026
22
+
23
+ #################################################################
24
+ # Rake task to test a swf and get a report in junit xml format.
25
+ #
26
+ # @param task id
27
+ # @param dependencies
28
+ Semilla::flex_unit :taskname => [dependencies]] do |t|
29
+ #Configuration options
30
+ # serverPort :player, :swf, :reportpath, :timeout
31
+ # serverPort :player, :swf, :reportpath, :timeout
32
+ t.serverPort = 1026
33
+ t.swf = "app.swf"
34
+ t.reportpath = "reports"
35
+ t.timeout = 10
36
+ end
37
+
38
+ =end
data/rakefile.rb CHANGED
@@ -1,39 +1,39 @@
1
- require 'rubygems'
2
- require 'rake/clean'
3
- require 'rake'
4
- require_relative "lib/semilla/version"
5
-
6
-
7
- version = Semilla::VERSION
8
- gemfile = "semilla-#{version}.gem"
9
- gemspecfile = "semilla.gemspec"
10
- ########################################################################################################################
11
-
12
- #####################################
13
- #Clean
14
- CLEAN << FileList["*.gem"]
15
-
16
-
17
- #####################################
18
- #Build the gem file
19
- file gemfile => [gemspecfile] do |t|
20
- sh "gem build #{gemspecfile}"
21
- end
22
-
23
- desc "Builds the gem"
24
- task :build => gemfile
25
-
26
- ####################################
27
- desc "Uninstall the gem"
28
- task :uninstall do |t|
29
- sh "gem uninstall semilla"
30
- end
31
-
32
- ##################################
33
- desc "Install the gem"
34
- task :install => :build do |t|
35
- sh "gem install #{gemfile}"
36
- end
37
-
38
- ##################################
1
+ require 'rubygems'
2
+ require 'rake/clean'
3
+ require 'rake'
4
+ require_relative "lib/semilla/version"
5
+
6
+
7
+ version = Semilla::VERSION
8
+ gemfile = "semilla-#{version}.gem"
9
+ gemspecfile = "semilla.gemspec"
10
+ ########################################################################################################################
11
+
12
+ #####################################
13
+ #Clean
14
+ CLEAN << FileList["*.gem"]
15
+
16
+
17
+ #####################################
18
+ #Build the gem file
19
+ file gemfile => [gemspecfile] do |t|
20
+ sh "gem build #{gemspecfile}"
21
+ end
22
+
23
+ desc "Builds the gem"
24
+ task :build => gemfile
25
+
26
+ ####################################
27
+ desc "Uninstall the gem"
28
+ task :uninstall do |t|
29
+ sh "gem uninstall semilla"
30
+ end
31
+
32
+ ##################################
33
+ desc "Install the gem"
34
+ task :install => :build do |t|
35
+ sh "gem install #{gemfile}"
36
+ end
37
+
38
+ ##################################
39
39
  task :default => [:clean, :build, :install]
data/semilla.gemspec CHANGED
@@ -1,45 +1,45 @@
1
-
2
- # -*- encoding: utf-8 -*-
3
- $:.push('lib')
4
- require "semilla/version"
5
-
6
- Gem::Specification.new do |s|
7
- s.name = "semilla"
8
- s.version = Semilla::VERSION
9
- s.date = "2011-12-28"
10
- s.summary = "Rake tasks for flexunit4"
11
- s.email = "support@semilla.com"
12
- s.homepage = "https://github.com/Darkoleptiko/semilla"
13
- s.authors = ['Victor G. Rosales']
14
-
15
- s.description = <<-EOF
16
- Rake tasks for executing flex unit 4 tests.
17
- It should be used in addition to the sprout gem.
18
- EOF
19
-
20
- dependencies = [
21
- # Examples:
22
- # [:runtime, "rack", "~> 1.1"],
23
- # [:development, "rspec", "~> 2.1"],
24
- [:sprout_flashsdk, "flashsdk", "~> 1.0.29.pre"]
25
- ]
26
-
27
- s.files = Dir['**/*']
28
- s.test_files = Dir['test/**/*'] + Dir['spec/**/*']
29
- s.executables = Dir['bin/*'].map { |f| File.basename(f) }
30
- s.require_paths = ["lib"]
31
-
32
-
33
- ## Make sure you can build the gem on older versions of RubyGems too:
34
- s.rubygems_version = "1.8.13"
35
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
36
- s.specification_version = 3 if s.respond_to? :specification_version
37
-
38
- dependencies.each do |type, name, version|
39
- if s.respond_to?("add_#{type}_dependency")
40
- s.send("add_#{type}_dependency", name, version)
41
- else
42
- s.add_dependency(name, version)
43
- end
44
- end
45
- end
1
+
2
+ # -*- encoding: utf-8 -*-
3
+ $:.push('lib')
4
+ require "semilla/version"
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "semilla"
8
+ s.version = Semilla::VERSION
9
+ s.date = "2011-12-28"
10
+ s.summary = "Rake tasks for flexunit4"
11
+ s.email = "support@semilla.com"
12
+ s.homepage = "https://github.com/Darkoleptiko/semilla"
13
+ s.authors = ['Victor G. Rosales']
14
+
15
+ s.description = <<-EOF
16
+ Rake tasks for executing flex unit 4 tests.
17
+ It should be used in addition to the sprout gem.
18
+ EOF
19
+
20
+ dependencies = [
21
+ # Examples:
22
+ # [:runtime, "rack", "~> 1.1"],
23
+ # [:development, "rspec", "~> 2.1"],
24
+ [:sprout_flashsdk, "flashsdk", "~> 1.0.29.pre"]
25
+ ]
26
+
27
+ s.files = Dir['**/*']
28
+ s.test_files = Dir['test/**/*'] + Dir['spec/**/*']
29
+ s.executables = Dir['bin/*'].map { |f| File.basename(f) }
30
+ s.require_paths = ["lib"]
31
+
32
+
33
+ ## Make sure you can build the gem on older versions of RubyGems too:
34
+ s.rubygems_version = "1.8.13"
35
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
36
+ s.specification_version = 3 if s.respond_to? :specification_version
37
+
38
+ dependencies.each do |type, name, version|
39
+ if s.respond_to?("add_#{type}_dependency")
40
+ s.send("add_#{type}_dependency", name, version)
41
+ else
42
+ s.add_dependency(name, version)
43
+ end
44
+ end
45
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semilla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-28 00:00:00.000000000Z
12
+ date: 2011-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: flashsdk
16
- requirement: &21882276 !ruby/object:Gem::Requirement
16
+ requirement: &2151815580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.0.29.pre
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *21882276
24
+ version_requirements: *2151815580
25
25
  description: ! 'Rake tasks for executing flex unit 4 tests.
26
26
 
27
27
  It should be used in addition to the sprout gem.
@@ -32,14 +32,16 @@ executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - lib/semilla/reports.rb
35
+ - lib/semilla/flash_player.rb
36
+ - lib/semilla/platform.rb
36
37
  - lib/semilla/report_server.rb
38
+ - lib/semilla/reports.rb
37
39
  - lib/semilla/test.rb
38
40
  - lib/semilla/test_runner.rb
39
41
  - lib/semilla/version.rb
40
42
  - lib/semilla.rb
41
43
  - rakefile.rb
42
- - README.textile
44
+ - README.md
43
45
  - semilla.gemspec
44
46
  homepage: https://github.com/Darkoleptiko/semilla
45
47
  licenses: []
@@ -61,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
63
  version: '0'
62
64
  requirements: []
63
65
  rubyforge_project:
64
- rubygems_version: 1.8.13
66
+ rubygems_version: 1.8.15
65
67
  signing_key:
66
68
  specification_version: 3
67
69
  summary: Rake tasks for flexunit4
data/README.textile DELETED
@@ -1,58 +0,0 @@
1
-
2
- h1. Semilla Gem
3
-
4
- This gem adds some rake tasks for testing ActionScript applications with the FlexUnit4 testing framework.
5
-
6
-
7
- h2. Installation
8
-
9
- To install with rake:
10
-
11
- <pre><code>$ rake</code></pre>
12
-
13
- To install with gem:
14
-
15
- <pre><code>$ gem build semilla.gemspec</code></pre>
16
- <pre><code>$ gem install semilla-VERSION.gem</code></pre>
17
-
18
-
19
- h2. Usage
20
-
21
- Generate a TestRunner
22
-
23
- <pre><code>
24
- Semilla::test_runner "outputfile.as", FileList["test-src/**/*Test.as"], 1026
25
-
26
- </code></pre>
27
-
28
-
29
- Run the test and obtain a report.
30
- <pre><code>
31
-
32
- Semilla::flex_unit :taskname => [dependencies]] do |t|
33
- t.serverPort = 1026
34
- t.swf = "app.swf"
35
- t.reportpath = "reports"
36
- t.timeout = 10
37
- end
38
-
39
- </code></pre>
40
-
41
- h2. MIT License
42
-
43
- <pre>
44
- Copyright (c)2011-2012 Victor G. Rosales
45
-
46
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
47
- documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
48
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
49
- persons to whom the Software is furnished to do so, subject to the following conditions:
50
-
51
- The above copyright notice and this permission notice shall be included in all copies or substantial
52
- portions of the Software.
53
-
54
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
55
- THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
56
- OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
57
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58
- </pre>