brake 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. data/lib/brake.rb +38 -32
  2. metadata +19 -3
data/lib/brake.rb CHANGED
@@ -35,34 +35,40 @@ class Brake
35
35
  options = []
36
36
  untangle = false
37
37
 
38
- # parses the options from the command line
39
- OptionParser.new do |opts|
40
- opts.banner = "\nBrake, The Brandwatch Rake wrapper for cucumber, Give Rake a Brake.\nUsage: brake <task> [options]"
41
- opts.separator ""
42
- opts.separator "Global options:"
43
- opts.on("-e", "--enviroment release", String, "String: The enviroment to run the tests against eg Release" ) { |o| options.push([:env, o]) }
44
- opts.on("-p", "--platform brandwatchWeb", String, "String: The platform to run the tests on eg brandwatchWeb" ) { |o| options.push([:platform, o]) }
45
- opts.on("-t", "--tags @high,@login", Array, "Array: A list of all tagged test to be run" ) { |o| options.push([:tags, o]) }
46
- opts.on("-l", "--log_level debug", String, "String: The log output level debug|info" ) { |o| options.push([:log_level, o]) }
47
- opts.separator ""
48
- opts.separator "Browser options:"
49
- opts.on("-H", "--[no-]highlight", "Bool: To turn off the highlight of elements" ) { |o| options.push([:highlight, o]) }
50
- opts.separator ""
51
- opts.separator "BrandwatchWeb options:"
52
- opts.on("-b", "--browser chrome", String, "String: The type of browser to run" ) { |o| options.push([:browser, o]) }
53
- opts.on("-s", "--screen 1280,1024", Array, "Array: The width,hight of the browser window" ) { |o| options.push([:screen, o]) }
54
- opts.on("--pos", "--position 0,0", Array, "Array: The x,y coords of the browser 0,0 top left" ) { |o| options.push([:position, o]) }
55
- opts.separator ""
56
- opts.separator "API options:"
57
- opts.on("-v", "--version 00", String, "String: API Version number" ) { |o| options.push([:version, o]) }
58
- opts.separator ""
59
- opts.separator "For furthur assistance please contact Ben Slaughter"
60
- opts.on("-u", "--[no-]untangle", "Bool: Turns Debug on/off" ) { |o| untangle = o }
61
- opts.on_tail("-h", "--help", "Show this message") do
62
- puts opts
63
- exit
64
- end
65
- end.parse!
38
+ begin
39
+ # parses the options from the command line
40
+ OptionParser.new do |opts|
41
+ opts.banner = "\nBrake, The Brandwatch Rake wrapper for cucumber, Give Rake a Brake.\nUsage: brake <task> [options]"
42
+ opts.separator ""
43
+ opts.separator "Global options:"
44
+ opts.on("-e", "--enviroment release", String, "String: The enviroment to run the tests against eg Release" ) { |o| options.push([:env, o]) }
45
+ opts.on("-p", "--platform brandwatchWeb", String, "String: The platform to run the tests on eg brandwatchWeb" ) { |o| options.push([:platform, o]) }
46
+ opts.on("-t", "--tags @high,@login", Array, "Array: A list of all tagged test to be run" ) { |o| options.push([:tags, o]) }
47
+ opts.on("-l", "--log_level debug", String, "String: The log output level debug|info" ) { |o| options.push([:log_level, o]) }
48
+ opts.separator ""
49
+ opts.separator "Browser options:"
50
+ opts.on("-H", "--[no-]highlight", "Bool: To turn off the highlight of elements" ) { |o| options.push([:highlight, o]) }
51
+ opts.separator ""
52
+ opts.separator "BrandwatchWeb options:"
53
+ opts.on("-b", "--browser chrome", String, "String: The type of browser to run" ) { |o| options.push([:browser, o]) }
54
+ opts.on("-s", "--screen 1280,1024", Array, "Array: The width,hight of the browser window" ) { |o| options.push([:screen, o]) }
55
+ opts.on("--pos", "--position 0,0", Array, "Array: The x,y coords of the browser 0,0 top left" ) { |o| options.push([:position, o]) }
56
+ opts.separator ""
57
+ opts.separator "API options:"
58
+ opts.on("-v", "--version 00", String, "String: API Version number" ) { |o| options.push([:version, o]) }
59
+ opts.separator ""
60
+ opts.separator "For furthur assistance please contact Ben Slaughter"
61
+ opts.on("-u", "--[no-]untangle", "Bool: Turns Debug on/off" ) { |o| untangle = o }
62
+ opts.on_tail("-h", "--help", "Show this message") do
63
+ puts opts
64
+ exit
65
+ end
66
+ end.parse!
67
+ rescue OptionParser::InvalidOption => e
68
+ puts e.message
69
+ # puts e.backtrace[0].to_s
70
+ exit
71
+ end
66
72
 
67
73
  # creates the default arguments
68
74
  # --require features Ensures that all features are included
@@ -105,16 +111,16 @@ class Brake
105
111
  case task.downcase
106
112
  when 'default'
107
113
  puts "WARNING: No Defaults set for default task"
108
- Rake::Task[:default].invoke( arguments.values.join( ' ' ) )
114
+ Rake::Task[:default].execute( arguments.values.join( ' ' ) )
109
115
  when 'brandwatchweb', 'bw'
110
116
  arguments = arguments.merge({ :platform => "PLATFORM=brandwatchweb", :env => 'ENVIRONMENT=release', :browser => 'BROWSERNAME=chrome' })
111
- Rake::Task[:brandwatchWeb].invoke( arguments.values.join( ' ' ) )
117
+ Rake::Task[:brandwatchWeb].execute( arguments.values.join( ' ' ) )
112
118
  when 'brandwatchapi', 'api'
113
119
  arguments = arguments.merge({ :platform => "PLATFORM=brandwatchapi", :env => 'ENVIRONMENT=int', :version => 'VERSION=1' })
114
- Rake::Task[:brandwatchAPI].invoke( arguments.values.join( ' ' ) )
120
+ Rake::Task[:brandwatchAPI].execute( arguments.values.join( ' ' ) )
115
121
  else
116
122
  puts "WARNING: No Defaults set for custom task"
117
- Rake::Task[task].invoke( arguments.values.join( ' ' ) )
123
+ Rake::Task[task].execute( arguments.values.join( ' ' ) )
118
124
  end
119
125
  end
120
126
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,8 +10,24 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-07 00:00:00.000000000 Z
14
- dependencies: []
13
+ date: 2012-09-14 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - '='
21
+ - !ruby/object:Gem::Version
22
+ version: 0.9.2.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - '='
29
+ - !ruby/object:Gem::Version
30
+ version: 0.9.2.2
15
31
  description: A Brandwatch made, options parser wrapper for Rake, No Brake for Rake.
16
32
  email: bens@brandwatch.com
17
33
  executables: