soda 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/SodaSummaryCreator +124 -0
  2. metadata +5 -3
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env ruby
2
+ ###############################################################################
3
+ # Copyright (c) 2010, SugarCRM, Inc.
4
+ # All rights reserved.
5
+ #
6
+ # Redistribution and use in source and binary forms, with or without
7
+ # modification, are permitted provided that the following conditions are met:
8
+ # * Redistributions of source code must retain the above copyright
9
+ # notice, this list of conditions and the following disclaimer.
10
+ # * Redistributions in binary form must reproduce the above copyright
11
+ # notice, this list of conditions and the following disclaimer in the
12
+ # documentation and/or other materials provided with the distribution.
13
+ # * Neither the name of SugarCRM, Inc. nor the
14
+ # names of its contributors may be used to endorse or promote products
15
+ # derived from this software without specific prior written permission.
16
+ #
17
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
+ # ARE DISCLAIMED. IN NO EVENT SHALL SugarCRM, Inc. BE LIABLE FOR ANY
21
+ # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
+ # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ ###############################################################################
28
+
29
+ require 'rubygems'
30
+ require 'SodaReportSummery'
31
+ require 'getoptlong'
32
+
33
+ ###############################################################################
34
+ # PrintHelp -- function
35
+ # This function prints out the help message for this script.
36
+ #
37
+ # Input:
38
+ # None.
39
+ #
40
+ # Output:
41
+ # None:
42
+ #
43
+ ###############################################################################
44
+ def PrintHelp()
45
+ help_msg = <<HLP
46
+ #{$0}
47
+ Usage:
48
+ #{$0} --reportdir="some directory with soda .log files"
49
+
50
+ Required Flags:
51
+ --reportdir: This flag tells #{$0} where to find the Soda log files.
52
+
53
+ Optional Flags:
54
+ --help: Prints this message and exits.
55
+
56
+ HLP
57
+
58
+ print help_msg
59
+
60
+ return 0
61
+ end
62
+
63
+ ###############################################################################
64
+ # Main -- function
65
+ # This is a C like main function to help with program flow control and
66
+ # debugging.
67
+ #
68
+ # Input:
69
+ # None.
70
+ #
71
+ # Output:
72
+ # Always returns 0.
73
+ #
74
+ ###############################################################################
75
+ def Main()
76
+ opts = nil
77
+ reportdir = nil
78
+ summary_file = nil
79
+ summary_obj = nil
80
+
81
+ opts = GetoptLong.new(
82
+ ['--reportdir', '-r', GetoptLong::REQUIRED_ARGUMENT],
83
+ ['--help', '-h', GetoptLong::OPTIONAL_ARGUMENT]
84
+ )
85
+
86
+ opts.quiet = true
87
+ opts.each do |opt, arg|
88
+ case (opt)
89
+ when "--reportdir"
90
+ reportdir = arg
91
+ when "--help"
92
+ PrintHelp()
93
+ exit(0)
94
+ end
95
+ end
96
+
97
+ if (reportdir == nil)
98
+ print "(!)Error: Missing needed command line switch: --reportdir!\n\n"
99
+ PrintHelp()
100
+ exit(1)
101
+ end
102
+
103
+ summary_file = "#{reportdir}/summary.html"
104
+ begin
105
+ print "(*)Creating summary report...\n"
106
+ summary_obj = SodaReportSummery.new(reportdir, summary_file, true)
107
+ print "(*)Finished creating report.\n"
108
+ print "(*)Summary File: #{summary_file}\n"
109
+ rescue Exception => e
110
+ print "(!)Error: #{e.message}!\n\n"
111
+ exit(2)
112
+ ensure
113
+ end
114
+
115
+ print "(*)Done.\n\n"
116
+
117
+ return 0
118
+ end
119
+
120
+ ###############################################################################
121
+ # Start executing code here -->
122
+ ###############################################################################
123
+ Main()
124
+ exit(0)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soda
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 11
10
- version: 0.0.11
9
+ - 12
10
+ version: 0.0.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Trampus Richmond
@@ -52,6 +52,7 @@ description: This is a wrapper around the watir api for web testing.
52
52
  email: trichmond@sugarcrm.com
53
53
  executables:
54
54
  - SodaSuite
55
+ - SodaSummaryCreator
55
56
  extensions: []
56
57
 
57
58
  extra_rdoc_files: []
@@ -70,6 +71,7 @@ files:
70
71
  - lib/SodaReporter.rb
71
72
  - lib/SodaLogReporter.rb
72
73
  - lib/SodaElements.xml
74
+ - bin/SodaSummaryCreator
73
75
  - bin/SodaSuite
74
76
  - lib/utils/sodalookups.rb
75
77
  - lib/fields/SelectField.rb