stella 0.5.1 → 0.5.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.
- data/README.txt +84 -24
- data/Rakefile +6 -1
- data/lib/stella.rb +5 -4
- data/lib/stella/adapter/ab.rb +31 -4
- data/lib/stella/adapter/base.rb +15 -1
- data/lib/stella/adapter/httperf.rb +35 -4
- data/lib/stella/adapter/siege.rb +51 -29
- data/lib/stella/cli.rb +45 -22
- data/lib/stella/cli/agents.rb +73 -0
- data/lib/stella/cli/language.rb +2 -0
- data/lib/stella/cli/localtest.rb +5 -0
- data/lib/stella/command/base.rb +1 -1
- data/lib/stella/command/localtest.rb +84 -68
- data/lib/stella/test/{summarybase.rb → base.rb} +3 -7
- data/lib/stella/test/definition.rb +10 -5
- data/lib/stella/test/{runsummary.rb → run/summary.rb} +4 -6
- data/lib/stella/test/{testsummary.rb → summary.rb} +27 -29
- data/lib/utils/escape.rb +302 -0
- data/lib/utils/mathutil.rb +36 -34
- data/support/text/en.yaml +7 -1
- metadata +8 -102
- data/doc/classes/Crypto.html +0 -248
- data/doc/classes/Crypto/Key.html +0 -308
- data/doc/classes/Enumerable.html +0 -309
- data/doc/classes/FileUtil.html +0 -310
- data/doc/classes/HTTPUtil.html +0 -530
- data/doc/classes/MathUtil.html +0 -210
- data/doc/classes/Stella.html +0 -238
- data/doc/classes/Stella/Adapter.html +0 -127
- data/doc/classes/Stella/Adapter/ApacheBench.html +0 -1076
- data/doc/classes/Stella/Adapter/Base.html +0 -432
- data/doc/classes/Stella/Adapter/CommandNotReady.html +0 -146
- data/doc/classes/Stella/Adapter/Httperf.html +0 -949
- data/doc/classes/Stella/Adapter/Siege.html +0 -1011
- data/doc/classes/Stella/CLI.html +0 -914
- data/doc/classes/Stella/CLI/Base.html +0 -186
- data/doc/classes/Stella/CLI/Language.html +0 -149
- data/doc/classes/Stella/CLI/LocalTest.html +0 -268
- data/doc/classes/Stella/Command.html +0 -111
- data/doc/classes/Stella/Command/Base.html +0 -335
- data/doc/classes/Stella/Config.html +0 -292
- data/doc/classes/Stella/InvalidArgument.html +0 -242
- data/doc/classes/Stella/LocalTest.html +0 -450
- data/doc/classes/Stella/Logger.html +0 -548
- data/doc/classes/Stella/Response.html +0 -846
- data/doc/classes/Stella/Storable.html +0 -928
- data/doc/classes/Stella/Test.html +0 -142
- data/doc/classes/Stella/Test/DaySummary.html +0 -249
- data/doc/classes/Stella/Test/Definition.html +0 -294
- data/doc/classes/Stella/Test/Definition/Rampup.html +0 -215
- data/doc/classes/Stella/Test/RunSummary.html +0 -315
- data/doc/classes/Stella/Test/SummaryBase.html +0 -286
- data/doc/classes/Stella/Test/TestSummary.html +0 -200
- data/doc/classes/Stella/Text.html +0 -581
- data/doc/classes/Stella/Text/Resource.html +0 -289
- data/doc/classes/Stella/UnavailableAdapter.html +0 -242
- data/doc/classes/Stella/UnknownValue.html +0 -242
- data/doc/classes/Stella/UnsupportedLanguage.html +0 -115
- data/doc/classes/Stella/Util.html +0 -348
- data/doc/classes/TextGraph.html +0 -460
- data/doc/classes/TimerUtil.html +0 -431
- data/doc/created.rid +0 -1
- data/doc/files/LICENSE_txt.html +0 -129
- data/doc/files/README_txt.html +0 -209
- data/doc/files/lib/stella/adapter/ab_rb.html +0 -101
- data/doc/files/lib/stella/adapter/base_rb.html +0 -101
- data/doc/files/lib/stella/adapter/httperf_rb.html +0 -101
- data/doc/files/lib/stella/adapter/siege_rb.html +0 -101
- data/doc/files/lib/stella/cli/base_rb.html +0 -101
- data/doc/files/lib/stella/cli/language_rb.html +0 -101
- data/doc/files/lib/stella/cli/localtest_rb.html +0 -101
- data/doc/files/lib/stella/cli_rb.html +0 -112
- data/doc/files/lib/stella/command/base_rb.html +0 -101
- data/doc/files/lib/stella/command/localtest_rb.html +0 -101
- data/doc/files/lib/stella/logger_rb.html +0 -101
- data/doc/files/lib/stella/response_rb.html +0 -101
- data/doc/files/lib/stella/storable_rb.html +0 -109
- data/doc/files/lib/stella/support_rb.html +0 -101
- data/doc/files/lib/stella/test/daysummary_rb.html +0 -101
- data/doc/files/lib/stella/test/definition_rb.html +0 -101
- data/doc/files/lib/stella/test/runsummary_rb.html +0 -101
- data/doc/files/lib/stella/test/summarybase_rb.html +0 -101
- data/doc/files/lib/stella/test/testsummary_rb.html +0 -108
- data/doc/files/lib/stella/text/resource_rb.html +0 -108
- data/doc/files/lib/stella/text_rb.html +0 -108
- data/doc/files/lib/stella_rb.html +0 -128
- data/doc/files/lib/utils/crypto-key_rb.html +0 -116
- data/doc/files/lib/utils/fileutil_rb.html +0 -108
- data/doc/files/lib/utils/httputil_rb.html +0 -110
- data/doc/files/lib/utils/mathutil_rb.html +0 -101
- data/doc/files/lib/utils/textgraph_rb.html +0 -138
- data/doc/files/lib/utils/timerutil_rb.html +0 -108
- data/doc/fr_class_index.html +0 -66
- data/doc/fr_file_index.html +0 -62
- data/doc/fr_method_index.html +0 -309
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/lib/stella/test/daysummary.rb +0 -93
- data/spec/base.rb +0 -26
- data/spec/shell_spec.rb +0 -12
data/lib/utils/mathutil.rb
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
module MathUtil
|
|
4
|
+
|
|
5
|
+
def self.variance(population)
|
|
6
|
+
n = 0
|
|
7
|
+
mean = 0.0
|
|
8
|
+
s = 0.0
|
|
9
|
+
population.each { |x|
|
|
10
|
+
n = n + 1
|
|
11
|
+
delta = (x - mean).to_f
|
|
12
|
+
mean = (mean + (delta / n)).to_f
|
|
13
|
+
s = (s + delta * (x - mean)).to_f
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return s / n
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# calculate the standard deviation of a population
|
|
20
|
+
# accepts: an array, the population
|
|
21
|
+
# returns: the standard deviation
|
|
22
|
+
def self.standard_deviation(population)
|
|
23
|
+
Math.sqrt(variance(population))
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# enforce_limit
|
|
27
|
+
#
|
|
28
|
+
# Enforce a minimum and maximum value
|
|
29
|
+
def self.enforce_limit(val,min,max)
|
|
30
|
+
val = min if val < min
|
|
31
|
+
val = max if val > max
|
|
32
|
+
val
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
3
39
|
|
|
4
40
|
module Enumerable
|
|
5
41
|
|
|
@@ -39,38 +75,4 @@ module Enumerable
|
|
|
39
75
|
return Math.sqrt(self.sample_variance)
|
|
40
76
|
end
|
|
41
77
|
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
module MathUtil
|
|
45
|
-
|
|
46
|
-
def self.variance(population)
|
|
47
|
-
n = 0
|
|
48
|
-
mean = 0.0
|
|
49
|
-
s = 0.0
|
|
50
|
-
population.each { |x|
|
|
51
|
-
n = n + 1
|
|
52
|
-
delta = (x - mean).to_f
|
|
53
|
-
mean = (mean + (delta / n)).to_f
|
|
54
|
-
s = (s + delta * (x - mean)).to_f
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return s / n
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# calculate the standard deviation of a population
|
|
61
|
-
# accepts: an array, the population
|
|
62
|
-
# returns: the standard deviation
|
|
63
|
-
def self.standard_deviation(population)
|
|
64
|
-
Math.sqrt(variance(population))
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# enforce_limit
|
|
68
|
-
#
|
|
69
|
-
# Enforce a minimum and maximum value
|
|
70
|
-
def self.enforce_limit(val,min,max)
|
|
71
|
-
val = min if val < min
|
|
72
|
-
val = max if val > max
|
|
73
|
-
val
|
|
74
|
-
end
|
|
75
|
-
|
|
76
78
|
end
|
data/support/text/en.yaml
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
:enabled: true
|
|
6
6
|
:text_available_languages: "Available languages: %s"
|
|
7
7
|
|
|
8
|
+
|
|
9
|
+
:agents_option_full: Return complete user-agent strings.
|
|
10
|
+
:agents_option_list: List available user-agent shortnames.
|
|
11
|
+
:agents_option_search: Return only user agents which match the search term.
|
|
12
|
+
:agents_count_message: "There are %d user agent strings matching your query"
|
|
13
|
+
|
|
8
14
|
:option_help_stdout: Print STDOUT output from load tool for each test run
|
|
9
15
|
:option_help_stderr: Print STDERR output from load tool for each test run
|
|
10
16
|
:option_help_verbose: Specify the output verbosity (level 1, 2 or 3)
|
|
@@ -36,7 +42,7 @@
|
|
|
36
42
|
:option_help_format: "Output file format. One of: csv [default], yaml, tsv, json"
|
|
37
43
|
:option_help_version: Display the version, then exit
|
|
38
44
|
:option_help_sleep: Number of seconds to sleep between runs
|
|
39
|
-
:option_help_agent: Specify a User-Agent. Can be a short string or complete agent string.
|
|
45
|
+
:option_help_agent: Specify a User-Agent. Can be a short string or complete agent string. Defaults to 'random'.
|
|
40
46
|
:option_help_help: Displays this message
|
|
41
47
|
:option_help_rampup: Execute multiple tests, incremented by R users every test, up to U users
|
|
42
48
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stella
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Delano Mandelbaum
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-12-
|
|
12
|
+
date: 2008-12-23 00:00:00 -05:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -41,100 +41,6 @@ extra_rdoc_files:
|
|
|
41
41
|
files:
|
|
42
42
|
- Rakefile
|
|
43
43
|
- bin/stella
|
|
44
|
-
- doc/classes
|
|
45
|
-
- doc/classes/Crypto
|
|
46
|
-
- doc/classes/Crypto/Key.html
|
|
47
|
-
- doc/classes/Crypto.html
|
|
48
|
-
- doc/classes/Enumerable.html
|
|
49
|
-
- doc/classes/FileUtil.html
|
|
50
|
-
- doc/classes/HTTPUtil.html
|
|
51
|
-
- doc/classes/MathUtil.html
|
|
52
|
-
- doc/classes/Stella
|
|
53
|
-
- doc/classes/Stella/Adapter
|
|
54
|
-
- doc/classes/Stella/Adapter/ApacheBench.html
|
|
55
|
-
- doc/classes/Stella/Adapter/Base.html
|
|
56
|
-
- doc/classes/Stella/Adapter/CommandNotReady.html
|
|
57
|
-
- doc/classes/Stella/Adapter/Httperf.html
|
|
58
|
-
- doc/classes/Stella/Adapter/Siege.html
|
|
59
|
-
- doc/classes/Stella/Adapter.html
|
|
60
|
-
- doc/classes/Stella/CLI
|
|
61
|
-
- doc/classes/Stella/CLI/Base.html
|
|
62
|
-
- doc/classes/Stella/CLI/Language.html
|
|
63
|
-
- doc/classes/Stella/CLI/LocalTest.html
|
|
64
|
-
- doc/classes/Stella/CLI.html
|
|
65
|
-
- doc/classes/Stella/Command
|
|
66
|
-
- doc/classes/Stella/Command/Base.html
|
|
67
|
-
- doc/classes/Stella/Command.html
|
|
68
|
-
- doc/classes/Stella/Config.html
|
|
69
|
-
- doc/classes/Stella/InvalidArgument.html
|
|
70
|
-
- doc/classes/Stella/LocalTest.html
|
|
71
|
-
- doc/classes/Stella/Logger.html
|
|
72
|
-
- doc/classes/Stella/Response.html
|
|
73
|
-
- doc/classes/Stella/Storable.html
|
|
74
|
-
- doc/classes/Stella/Test
|
|
75
|
-
- doc/classes/Stella/Test/DaySummary.html
|
|
76
|
-
- doc/classes/Stella/Test/Definition
|
|
77
|
-
- doc/classes/Stella/Test/Definition/Rampup.html
|
|
78
|
-
- doc/classes/Stella/Test/Definition.html
|
|
79
|
-
- doc/classes/Stella/Test/RunSummary.html
|
|
80
|
-
- doc/classes/Stella/Test/SummaryBase.html
|
|
81
|
-
- doc/classes/Stella/Test/TestSummary.html
|
|
82
|
-
- doc/classes/Stella/Test.html
|
|
83
|
-
- doc/classes/Stella/Text
|
|
84
|
-
- doc/classes/Stella/Text/Resource.html
|
|
85
|
-
- doc/classes/Stella/Text.html
|
|
86
|
-
- doc/classes/Stella/UnavailableAdapter.html
|
|
87
|
-
- doc/classes/Stella/UnknownValue.html
|
|
88
|
-
- doc/classes/Stella/UnsupportedLanguage.html
|
|
89
|
-
- doc/classes/Stella/Util.html
|
|
90
|
-
- doc/classes/Stella.html
|
|
91
|
-
- doc/classes/TextGraph.html
|
|
92
|
-
- doc/classes/TimerUtil.html
|
|
93
|
-
- doc/created.rid
|
|
94
|
-
- doc/files
|
|
95
|
-
- doc/files/lib
|
|
96
|
-
- doc/files/lib/stella
|
|
97
|
-
- doc/files/lib/stella/adapter
|
|
98
|
-
- doc/files/lib/stella/adapter/ab_rb.html
|
|
99
|
-
- doc/files/lib/stella/adapter/base_rb.html
|
|
100
|
-
- doc/files/lib/stella/adapter/httperf_rb.html
|
|
101
|
-
- doc/files/lib/stella/adapter/siege_rb.html
|
|
102
|
-
- doc/files/lib/stella/cli
|
|
103
|
-
- doc/files/lib/stella/cli/base_rb.html
|
|
104
|
-
- doc/files/lib/stella/cli/language_rb.html
|
|
105
|
-
- doc/files/lib/stella/cli/localtest_rb.html
|
|
106
|
-
- doc/files/lib/stella/cli_rb.html
|
|
107
|
-
- doc/files/lib/stella/command
|
|
108
|
-
- doc/files/lib/stella/command/base_rb.html
|
|
109
|
-
- doc/files/lib/stella/command/localtest_rb.html
|
|
110
|
-
- doc/files/lib/stella/logger_rb.html
|
|
111
|
-
- doc/files/lib/stella/response_rb.html
|
|
112
|
-
- doc/files/lib/stella/storable_rb.html
|
|
113
|
-
- doc/files/lib/stella/support_rb.html
|
|
114
|
-
- doc/files/lib/stella/test
|
|
115
|
-
- doc/files/lib/stella/test/daysummary_rb.html
|
|
116
|
-
- doc/files/lib/stella/test/definition_rb.html
|
|
117
|
-
- doc/files/lib/stella/test/runsummary_rb.html
|
|
118
|
-
- doc/files/lib/stella/test/summarybase_rb.html
|
|
119
|
-
- doc/files/lib/stella/test/testsummary_rb.html
|
|
120
|
-
- doc/files/lib/stella/text
|
|
121
|
-
- doc/files/lib/stella/text/resource_rb.html
|
|
122
|
-
- doc/files/lib/stella/text_rb.html
|
|
123
|
-
- doc/files/lib/stella_rb.html
|
|
124
|
-
- doc/files/lib/utils
|
|
125
|
-
- doc/files/lib/utils/crypto-key_rb.html
|
|
126
|
-
- doc/files/lib/utils/fileutil_rb.html
|
|
127
|
-
- doc/files/lib/utils/httputil_rb.html
|
|
128
|
-
- doc/files/lib/utils/mathutil_rb.html
|
|
129
|
-
- doc/files/lib/utils/textgraph_rb.html
|
|
130
|
-
- doc/files/lib/utils/timerutil_rb.html
|
|
131
|
-
- doc/files/LICENSE_txt.html
|
|
132
|
-
- doc/files/README_txt.html
|
|
133
|
-
- doc/fr_class_index.html
|
|
134
|
-
- doc/fr_file_index.html
|
|
135
|
-
- doc/fr_method_index.html
|
|
136
|
-
- doc/index.html
|
|
137
|
-
- doc/rdoc-style.css
|
|
138
44
|
- lib/stella
|
|
139
45
|
- lib/stella/adapter
|
|
140
46
|
- lib/stella/adapter/ab.rb
|
|
@@ -142,6 +48,7 @@ files:
|
|
|
142
48
|
- lib/stella/adapter/httperf.rb
|
|
143
49
|
- lib/stella/adapter/siege.rb
|
|
144
50
|
- lib/stella/cli
|
|
51
|
+
- lib/stella/cli/agents.rb
|
|
145
52
|
- lib/stella/cli/base.rb
|
|
146
53
|
- lib/stella/cli/language.rb
|
|
147
54
|
- lib/stella/cli/localtest.rb
|
|
@@ -154,24 +61,23 @@ files:
|
|
|
154
61
|
- lib/stella/storable.rb
|
|
155
62
|
- lib/stella/support.rb
|
|
156
63
|
- lib/stella/test
|
|
157
|
-
- lib/stella/test/
|
|
64
|
+
- lib/stella/test/base.rb
|
|
158
65
|
- lib/stella/test/definition.rb
|
|
159
|
-
- lib/stella/test/
|
|
160
|
-
- lib/stella/test/
|
|
161
|
-
- lib/stella/test/
|
|
66
|
+
- lib/stella/test/run
|
|
67
|
+
- lib/stella/test/run/summary.rb
|
|
68
|
+
- lib/stella/test/summary.rb
|
|
162
69
|
- lib/stella/text
|
|
163
70
|
- lib/stella/text/resource.rb
|
|
164
71
|
- lib/stella/text.rb
|
|
165
72
|
- lib/stella.rb
|
|
166
73
|
- lib/utils
|
|
167
74
|
- lib/utils/crypto-key.rb
|
|
75
|
+
- lib/utils/escape.rb
|
|
168
76
|
- lib/utils/fileutil.rb
|
|
169
77
|
- lib/utils/httputil.rb
|
|
170
78
|
- lib/utils/mathutil.rb
|
|
171
79
|
- lib/utils/textgraph.rb
|
|
172
80
|
- lib/utils/timerutil.rb
|
|
173
|
-
- spec/base.rb
|
|
174
|
-
- spec/shell_spec.rb
|
|
175
81
|
- support/text
|
|
176
82
|
- support/text/en.yaml
|
|
177
83
|
- support/text/nl.yaml
|
data/doc/classes/Crypto.html
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Module: Crypto</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Module</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Crypto</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../files/lib/utils/crypto-key_rb.html">
|
|
59
|
-
lib/utils/crypto-key.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
</table>
|
|
66
|
-
</div>
|
|
67
|
-
<!-- banner header -->
|
|
68
|
-
|
|
69
|
-
<div id="bodyContent">
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<div id="contextContent">
|
|
74
|
-
|
|
75
|
-
<div id="description">
|
|
76
|
-
<pre>
|
|
77
|
-
ELSE
|
|
78
|
-
</pre>
|
|
79
|
-
<p>
|
|
80
|
-
module JRuby
|
|
81
|
-
</p>
|
|
82
|
-
<pre>
|
|
83
|
-
module OpenSSL
|
|
84
|
-
GEM_ONLY = false unless defined?(GEM_ONLY)
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
if JRuby::OpenSSL::GEM_ONLY
|
|
89
|
-
require 'jruby/openssl/gem'
|
|
90
|
-
else
|
|
91
|
-
module OpenSSL
|
|
92
|
-
class OpenSSLError < StandardError; end
|
|
93
|
-
# These require the gem
|
|
94
|
-
%w[
|
|
95
|
-
ASN1
|
|
96
|
-
BN
|
|
97
|
-
Cipher
|
|
98
|
-
Config
|
|
99
|
-
Netscape
|
|
100
|
-
PKCS7
|
|
101
|
-
PKey
|
|
102
|
-
Random
|
|
103
|
-
SSL
|
|
104
|
-
X509
|
|
105
|
-
].each {|c| autoload c, "jruby/openssl/gem"}
|
|
106
|
-
end
|
|
107
|
-
require "jruby/openssl/builtin"
|
|
108
|
-
end
|
|
109
|
-
</pre>
|
|
110
|
-
<p>
|
|
111
|
-
end
|
|
112
|
-
</p>
|
|
113
|
-
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
<div id="method-list">
|
|
120
|
-
<h3 class="section-bar">Methods</h3>
|
|
121
|
-
|
|
122
|
-
<div class="name-list">
|
|
123
|
-
<a href="#M000250">aws_sign</a>
|
|
124
|
-
<a href="#M000248">create_keys</a>
|
|
125
|
-
<a href="#M000249">sign</a>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<!-- if includes -->
|
|
133
|
-
|
|
134
|
-
<div id="section">
|
|
135
|
-
|
|
136
|
-
<div id="class-list">
|
|
137
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
|
138
|
-
|
|
139
|
-
Class <a href="Crypto/Key.html" class="link">Crypto::Key</a><br />
|
|
140
|
-
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
<div id="constants-list">
|
|
144
|
-
<h3 class="section-bar">Constants</h3>
|
|
145
|
-
|
|
146
|
-
<div class="name-list">
|
|
147
|
-
<table summary="Constants">
|
|
148
|
-
<tr class="top-aligned-row context-row">
|
|
149
|
-
<td class="context-item-name">VERSION</td>
|
|
150
|
-
<td>=</td>
|
|
151
|
-
<td class="context-item-value">1.0</td>
|
|
152
|
-
</tr>
|
|
153
|
-
</table>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<!-- if method_list -->
|
|
163
|
-
<div id="methods">
|
|
164
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
165
|
-
|
|
166
|
-
<div id="method-M000250" class="method-detail">
|
|
167
|
-
<a name="M000250"></a>
|
|
168
|
-
|
|
169
|
-
<div class="method-heading">
|
|
170
|
-
<a href="#M000250" class="method-signature">
|
|
171
|
-
<span class="method-name">aws_sign</span><span class="method-args">(secret, string)</span>
|
|
172
|
-
</a>
|
|
173
|
-
</div>
|
|
174
|
-
|
|
175
|
-
<div class="method-description">
|
|
176
|
-
<p><a class="source-toggle" href="#"
|
|
177
|
-
onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
|
|
178
|
-
<div class="method-source-code" id="M000250-source">
|
|
179
|
-
<pre>
|
|
180
|
-
<span class="ruby-comment cmt"># File lib/utils/crypto-key.rb, line 50</span>
|
|
181
|
-
50: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">aws_sign</span>(<span class="ruby-identifier">secret</span>, <span class="ruby-identifier">string</span>)
|
|
182
|
-
51: <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sign</span>(<span class="ruby-identifier">secret</span>, <span class="ruby-identifier">string</span>)).<span class="ruby-identifier">strip</span>
|
|
183
|
-
52: <span class="ruby-keyword kw">end</span>
|
|
184
|
-
</pre>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
<div id="method-M000248" class="method-detail">
|
|
190
|
-
<a name="M000248"></a>
|
|
191
|
-
|
|
192
|
-
<div class="method-heading">
|
|
193
|
-
<a href="#M000248" class="method-signature">
|
|
194
|
-
<span class="method-name">create_keys</span><span class="method-args">(bits = 2048)</span>
|
|
195
|
-
</a>
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
<div class="method-description">
|
|
199
|
-
<p><a class="source-toggle" href="#"
|
|
200
|
-
onclick="toggleCode('M000248-source');return false;">[Source]</a></p>
|
|
201
|
-
<div class="method-source-code" id="M000248-source">
|
|
202
|
-
<pre>
|
|
203
|
-
<span class="ruby-comment cmt"># File lib/utils/crypto-key.rb, line 41</span>
|
|
204
|
-
41: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_keys</span>(<span class="ruby-identifier">bits</span> = <span class="ruby-value">2048</span>)
|
|
205
|
-
42: <span class="ruby-identifier">pk</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">PKey</span><span class="ruby-operator">::</span><span class="ruby-constant">RSA</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">bits</span>)
|
|
206
|
-
43: <span class="ruby-keyword kw">end</span>
|
|
207
|
-
</pre>
|
|
208
|
-
</div>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
|
|
212
|
-
<div id="method-M000249" class="method-detail">
|
|
213
|
-
<a name="M000249"></a>
|
|
214
|
-
|
|
215
|
-
<div class="method-heading">
|
|
216
|
-
<a href="#M000249" class="method-signature">
|
|
217
|
-
<span class="method-name">sign</span><span class="method-args">(secret, string)</span>
|
|
218
|
-
</a>
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
<div class="method-description">
|
|
222
|
-
<p><a class="source-toggle" href="#"
|
|
223
|
-
onclick="toggleCode('M000249-source');return false;">[Source]</a></p>
|
|
224
|
-
<div class="method-source-code" id="M000249-source">
|
|
225
|
-
<pre>
|
|
226
|
-
<span class="ruby-comment cmt"># File lib/utils/crypto-key.rb, line 46</span>
|
|
227
|
-
46: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sign</span>(<span class="ruby-identifier">secret</span>, <span class="ruby-identifier">string</span>)
|
|
228
|
-
47: <span class="ruby-identifier">sig</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">HMAC</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-ivar">@@digest</span>, <span class="ruby-identifier">secret</span>, <span class="ruby-identifier">string</span>).<span class="ruby-identifier">strip</span>
|
|
229
|
-
48: <span class="ruby-comment cmt">#sig.gsub(/\+/, "%2b")</span>
|
|
230
|
-
49: <span class="ruby-keyword kw">end</span>
|
|
231
|
-
</pre>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
</div>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
<div id="validator-badges">
|
|
244
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
</body>
|
|
248
|
-
</html>
|