venom 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/bin/venom +4 -0
- data/lib/venom/generator.rb +18 -0
- data/lib/venom/generators/workshop/Gemfile.tt +9 -0
- data/lib/venom/generators/workshop/Rakefile +8 -0
- data/lib/venom/generators/workshop/cucumber.yml +4 -0
- data/lib/venom/generators/workshop/env.rb.tt +34 -0
- data/lib/venom/generators/workshop/hooks.rb +11 -0
- data/lib/venom/generators/workshop.rb +72 -0
- data/lib/venom/version.rb +3 -0
- data/lib/venom.rb +2 -0
- data/venom.gemspec +17 -0
- metadata +63 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Jeff Nyman
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Venom
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'venom'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install venom
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/venom
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'venom/generators/workshop'
|
3
|
+
|
4
|
+
module Venom
|
5
|
+
class Generator < Thor
|
6
|
+
desc "workshop NAME", "Create a new workshop."
|
7
|
+
method_option :driver, aliases: "-d", type: :string, required: false, desc: "Use Symbiont to drive the browser. (Valid value is 'watir'.)"
|
8
|
+
method_option :library, aliases: "-l", type: :boolean, desc: "Use a shared library directory."
|
9
|
+
|
10
|
+
def workshop(name)
|
11
|
+
puts "Name of workshop: #{name}"
|
12
|
+
driver = options[:driver].nil? ? 'No Driver' : options[:driver]
|
13
|
+
library = options[:library] == true ? 'true' : 'false'
|
14
|
+
|
15
|
+
Venom::Generators::Workshop.start([name, driver, library])
|
16
|
+
end
|
17
|
+
end # class: Generator
|
18
|
+
end # module: Venom
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<% if library == 'true' -%>
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<% unless driver.downcase == 'no driver' -%>
|
6
|
+
require 'symbiont'
|
7
|
+
require 'symbiont/factory'
|
8
|
+
|
9
|
+
<% if library == 'true' -%>
|
10
|
+
require 'require_all'
|
11
|
+
|
12
|
+
require_all 'lib'
|
13
|
+
<% end -%>
|
14
|
+
|
15
|
+
module Symbiont
|
16
|
+
module Browser
|
17
|
+
|
18
|
+
def self.start
|
19
|
+
unless @browser
|
20
|
+
<% if driver.downcase == 'watir' -%>
|
21
|
+
@browser = Watir::Browser.new(ENV['BROWSER'])<% end %>
|
22
|
+
end
|
23
|
+
@browser
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.stop
|
27
|
+
@browser.quit if @browser
|
28
|
+
end
|
29
|
+
|
30
|
+
end # module: Browser
|
31
|
+
end # module: Symbiont
|
32
|
+
|
33
|
+
World(Symbiont::Factory)
|
34
|
+
<% end %>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module Venom
|
4
|
+
module Generators
|
5
|
+
class Workshop < Thor::Group
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
argument :name, type: :string, desc: "Name of the workshop."
|
9
|
+
argument :driver, type: :string, desc: "Driver to use with Symbiont."
|
10
|
+
argument :library, type: :string, desc: "Use shared library directory."
|
11
|
+
desc "Generates a workshop structure."
|
12
|
+
|
13
|
+
def self.source_root
|
14
|
+
File.dirname(__FILE__) + "/workshop"
|
15
|
+
end
|
16
|
+
|
17
|
+
def spit_back_values
|
18
|
+
puts "Create workshop '#{name}' using #{driver}."
|
19
|
+
puts "Use a separate library." if use_library
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_workshop_directory
|
23
|
+
empty_directory(name)
|
24
|
+
end
|
25
|
+
|
26
|
+
def create_workshop_structure
|
27
|
+
empty_directory("#{name}/specs")
|
28
|
+
empty_directory("#{name}/specs/support")
|
29
|
+
empty_directory("#{name}/specs/support/test_steps")
|
30
|
+
empty_directory("#{name}/specs/support/test_data")
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_library_directory
|
34
|
+
empty_directory("#{name}/lib") if use_library
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_definitions_directory
|
38
|
+
if use_library
|
39
|
+
empty_directory("#{name}/lib/definitions")
|
40
|
+
else
|
41
|
+
empty_directory("#{name}/specs/definitions")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def copy_dsl_runner
|
46
|
+
copy_file "cucumber.yml", "#{name}/cucumber.yml"
|
47
|
+
end
|
48
|
+
|
49
|
+
def copy_rakefile
|
50
|
+
copy_file "Rakefile", "#{name}/Rakefile"
|
51
|
+
end
|
52
|
+
|
53
|
+
def copy_gemfile
|
54
|
+
template "Gemfile.tt", "#{name}/Gemfile"
|
55
|
+
end
|
56
|
+
|
57
|
+
def copy_env
|
58
|
+
template "env.rb.tt", "#{name}/specs/support/env.rb"
|
59
|
+
end
|
60
|
+
|
61
|
+
def copy_hooks
|
62
|
+
copy_file "hooks.rb", "#{name}/specs/support/hooks.rb"
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def use_library
|
68
|
+
library == 'true'
|
69
|
+
end
|
70
|
+
end # class: Workshop
|
71
|
+
end # module: Generators
|
72
|
+
end # module: Venom
|
data/lib/venom.rb
ADDED
data/venom.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/venom/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Jeff Nyman"]
|
6
|
+
gem.email = ["jeffnyman@gmail.com"]
|
7
|
+
gem.description = "A test generator for Symbiont."
|
8
|
+
gem.summary = gem.description
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = "venom"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Venom::VERSION
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: venom
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jeff Nyman
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-04 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: A test generator for Symbiont.
|
15
|
+
email:
|
16
|
+
- jeffnyman@gmail.com
|
17
|
+
executables:
|
18
|
+
- venom
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- bin/venom
|
28
|
+
- lib/venom.rb
|
29
|
+
- lib/venom/generator.rb
|
30
|
+
- lib/venom/generators/workshop.rb
|
31
|
+
- lib/venom/generators/workshop/Gemfile.tt
|
32
|
+
- lib/venom/generators/workshop/Rakefile
|
33
|
+
- lib/venom/generators/workshop/cucumber.yml
|
34
|
+
- lib/venom/generators/workshop/env.rb.tt
|
35
|
+
- lib/venom/generators/workshop/hooks.rb
|
36
|
+
- lib/venom/version.rb
|
37
|
+
- venom.gemspec
|
38
|
+
homepage: ''
|
39
|
+
licenses: []
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.24
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: A test generator for Symbiont.
|
62
|
+
test_files: []
|
63
|
+
has_rdoc:
|