apphunk 0.1.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -6
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/apphunk.gemspec +35 -3
- data/doc/apple-touch-icon.png +0 -0
- data/doc/classes/Apphunk/Config.html +159 -0
- data/doc/classes/Apphunk/Logger.html +105 -0
- data/doc/classes/Apphunk/Proxy.html +196 -0
- data/doc/classes/Apphunk/Remote/Result.html +125 -0
- data/doc/classes/Apphunk/Remote.html +117 -0
- data/doc/classes/Apphunk.html +294 -0
- data/doc/created.rid +1 -0
- data/doc/css/main.css +263 -0
- data/doc/css/panel.css +383 -0
- data/doc/css/reset.css +53 -0
- data/doc/favicon.ico +0 -0
- data/doc/files/LICENSE.html +81 -0
- data/doc/files/README_rdoc.html +87 -0
- data/doc/files/lib/apphunk/config_rb.html +59 -0
- data/doc/files/lib/apphunk/logger_rb.html +59 -0
- data/doc/files/lib/apphunk/proxy_rb.html +68 -0
- data/doc/files/lib/apphunk/remote/result_rb.html +59 -0
- data/doc/files/lib/apphunk/remote_rb.html +70 -0
- data/doc/files/lib/apphunk_rb.html +66 -0
- data/doc/i/arrows.png +0 -0
- data/doc/i/results_bg.png +0 -0
- data/doc/i/tree_bg.png +0 -0
- data/doc/index.html +14 -0
- data/doc/js/jquery-1.3.2.min.js +19 -0
- data/doc/js/jquery-effect.js +593 -0
- data/doc/js/main.js +22 -0
- data/doc/js/searchdoc.js +628 -0
- data/doc/panel/index.html +71 -0
- data/doc/panel/search_index.js +1 -0
- data/doc/panel/tree.js +1 -0
- data/lib/apphunk/config.rb +54 -0
- data/lib/apphunk/logger.rb +12 -4
- data/lib/apphunk/proxy.rb +6 -2
- data/lib/apphunk.rb +57 -0
- data/rails/init.rb +3 -0
- data/spec/apphunk/proxy_spec.rb +11 -5
- metadata +35 -3
@@ -0,0 +1,125 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>Apphunk::Remote::Result</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
<span class="type">Class</span>
|
19
|
+
Apphunk::Remote::Result
|
20
|
+
|
21
|
+
<span class="parent"><
|
22
|
+
|
23
|
+
Object
|
24
|
+
|
25
|
+
</span>
|
26
|
+
|
27
|
+
</h1>
|
28
|
+
<ul class="files">
|
29
|
+
|
30
|
+
<li><a href="../../../files/lib/apphunk/remote/result_rb.html">lib/apphunk/remote/result.rb</a></li>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
<div id="bodyContent">
|
35
|
+
<div id="content">
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
<div class="sectiontitle">Methods</div>
|
46
|
+
<dl class="methods">
|
47
|
+
|
48
|
+
<dt>N</dt>
|
49
|
+
<dd>
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li><a href="#M000004">new</a></li>
|
53
|
+
|
54
|
+
</ul>
|
55
|
+
</dd>
|
56
|
+
|
57
|
+
</dl>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div class="sectiontitle">Attributes</div>
|
70
|
+
<table border='0' cellpadding='5'>
|
71
|
+
|
72
|
+
<tr valign='top'>
|
73
|
+
<td class='attr-rw'>
|
74
|
+
[RW]
|
75
|
+
</td>
|
76
|
+
<td class='attr-name'>status</td>
|
77
|
+
<td class='attr-desc'></td>
|
78
|
+
</tr>
|
79
|
+
|
80
|
+
<tr valign='top'>
|
81
|
+
<td class='attr-rw'>
|
82
|
+
[RW]
|
83
|
+
</td>
|
84
|
+
<td class='attr-name'>response</td>
|
85
|
+
<td class='attr-desc'></td>
|
86
|
+
</tr>
|
87
|
+
|
88
|
+
</table>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<div class="sectiontitle">Class Public methods</div>
|
93
|
+
|
94
|
+
<div class="method">
|
95
|
+
<div class="title" id="M000004">
|
96
|
+
|
97
|
+
<a name="M000004"></a><b>new</b>(opts = {})
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<div class="sourcecode">
|
105
|
+
<p class="source-link">
|
106
|
+
Source: <a href="javascript:toggleSource('M000004_source')" id="l_M000004_source">show</a>
|
107
|
+
|
108
|
+
| <a href="http://github.com/apphunk/apphunk/blob/48fc95d4142cff080234f5d745b1ba413803411e/lib/apphunk/remote/result.rb#L8" target="_blank" class="github_url">on GitHub</a>
|
109
|
+
|
110
|
+
</p>
|
111
|
+
<div id="M000004_source" class="dyn-source">
|
112
|
+
<pre><span class="ruby-comment cmt"># File lib/apphunk/remote/result.rb, line 8</span>
|
113
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">opts</span> = {})
|
114
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:status</span>)
|
115
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">response</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:response</span>)
|
116
|
+
<span class="ruby-keyword kw">end</span></pre>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
</body>
|
125
|
+
</html>
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>Apphunk::Remote</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
<span class="type">Module</span>
|
19
|
+
Apphunk::Remote
|
20
|
+
|
21
|
+
</h1>
|
22
|
+
<ul class="files">
|
23
|
+
|
24
|
+
<li><a href="../../files/lib/apphunk/remote/result_rb.html">lib/apphunk/remote/result.rb</a></li>
|
25
|
+
|
26
|
+
<li><a href="../../files/lib/apphunk/remote_rb.html">lib/apphunk/remote.rb</a></li>
|
27
|
+
|
28
|
+
</ul>
|
29
|
+
</div>
|
30
|
+
<div id="bodyContent">
|
31
|
+
<div id="content">
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
<div class="sectiontitle">Methods</div>
|
42
|
+
<dl class="methods">
|
43
|
+
|
44
|
+
<dt>P</dt>
|
45
|
+
<dd>
|
46
|
+
<ul>
|
47
|
+
|
48
|
+
<li><a href="#M000005">post</a></li>
|
49
|
+
|
50
|
+
</ul>
|
51
|
+
</dd>
|
52
|
+
|
53
|
+
</dl>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<div class="sectiontitle">Classes and Modules</div>
|
62
|
+
<ul>
|
63
|
+
|
64
|
+
<li><span class="type">CLASS</span> <a href="Remote/Result.html">Apphunk::Remote::Result</a></li>
|
65
|
+
|
66
|
+
</ul>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<div class="sectiontitle">Class Public methods</div>
|
75
|
+
|
76
|
+
<div class="method">
|
77
|
+
<div class="title" id="M000005">
|
78
|
+
|
79
|
+
<a name="M000005"></a><b>post</b>(url, payload = {}, post_timeout = 30)
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<div class="sourcecode">
|
87
|
+
<p class="source-link">
|
88
|
+
Source: <a href="javascript:toggleSource('M000005_source')" id="l_M000005_source">show</a>
|
89
|
+
|
90
|
+
| <a href="http://github.com/apphunk/apphunk/blob/48fc95d4142cff080234f5d745b1ba413803411e/lib/apphunk/remote.rb#L12" target="_blank" class="github_url">on GitHub</a>
|
91
|
+
|
92
|
+
</p>
|
93
|
+
<div id="M000005_source" class="dyn-source">
|
94
|
+
<pre><span class="ruby-comment cmt"># File lib/apphunk/remote.rb, line 12</span>
|
95
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">payload</span> = {}, <span class="ruby-identifier">post_timeout</span> = <span class="ruby-value">30</span>)
|
96
|
+
<span class="ruby-keyword kw">begin</span>
|
97
|
+
<span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">post_timeout</span>) <span class="ruby-keyword kw">do</span>
|
98
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>)
|
99
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">Remote</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:response</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">post_form</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">payload</span>))
|
100
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">:ok</span>
|
101
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
|
102
|
+
<span class="ruby-keyword kw">end</span>
|
103
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SocketError</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span>
|
104
|
+
<span class="ruby-constant">Remote</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:status</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:connection_error</span>)
|
105
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
|
106
|
+
<span class="ruby-constant">Remote</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:status</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:timeout</span>)
|
107
|
+
<span class="ruby-keyword kw">end</span>
|
108
|
+
<span class="ruby-keyword kw">end</span></pre>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,294 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>Apphunk</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
<span class="type">Module</span>
|
19
|
+
Apphunk
|
20
|
+
|
21
|
+
</h1>
|
22
|
+
<ul class="files">
|
23
|
+
|
24
|
+
<li><a href="../files/lib/apphunk/config_rb.html">lib/apphunk/config.rb</a></li>
|
25
|
+
|
26
|
+
<li><a href="../files/lib/apphunk/logger_rb.html">lib/apphunk/logger.rb</a></li>
|
27
|
+
|
28
|
+
<li><a href="../files/lib/apphunk/proxy_rb.html">lib/apphunk/proxy.rb</a></li>
|
29
|
+
|
30
|
+
<li><a href="../files/lib/apphunk/remote/result_rb.html">lib/apphunk/remote/result.rb</a></li>
|
31
|
+
|
32
|
+
<li><a href="../files/lib/apphunk/remote_rb.html">lib/apphunk/remote.rb</a></li>
|
33
|
+
|
34
|
+
<li><a href="../files/lib/apphunk_rb.html">lib/apphunk.rb</a></li>
|
35
|
+
|
36
|
+
</ul>
|
37
|
+
</div>
|
38
|
+
<div id="bodyContent">
|
39
|
+
<div id="content">
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div class="sectiontitle">Methods</div>
|
50
|
+
<dl class="methods">
|
51
|
+
|
52
|
+
<dt>C</dt>
|
53
|
+
<dd>
|
54
|
+
<ul>
|
55
|
+
|
56
|
+
<li><a href="#M000008">config</a></li>
|
57
|
+
|
58
|
+
</ul>
|
59
|
+
</dd>
|
60
|
+
|
61
|
+
<dt>L</dt>
|
62
|
+
<dd>
|
63
|
+
<ul>
|
64
|
+
|
65
|
+
<li><a href="#M000006">log</a>,</li>
|
66
|
+
|
67
|
+
<li><a href="#M000007">log_with_options</a></li>
|
68
|
+
|
69
|
+
</ul>
|
70
|
+
</dd>
|
71
|
+
|
72
|
+
</dl>
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<div class="sectiontitle">Classes and Modules</div>
|
81
|
+
<ul>
|
82
|
+
|
83
|
+
<li><span class="type">MODULE</span> <a href="Apphunk/Config.html">Apphunk::Config</a></li>
|
84
|
+
|
85
|
+
<li><span class="type">MODULE</span> <a href="Apphunk/Logger.html">Apphunk::Logger</a></li>
|
86
|
+
|
87
|
+
<li><span class="type">MODULE</span> <a href="Apphunk/Proxy.html">Apphunk::Proxy</a></li>
|
88
|
+
|
89
|
+
<li><span class="type">MODULE</span> <a href="Apphunk/Remote.html">Apphunk::Remote</a></li>
|
90
|
+
|
91
|
+
</ul>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<div class="sectiontitle">Attributes</div>
|
98
|
+
<table border='0' cellpadding='5'>
|
99
|
+
|
100
|
+
<tr valign='top'>
|
101
|
+
<td class='attr-rw'>
|
102
|
+
[RW]
|
103
|
+
</td>
|
104
|
+
<td class='attr-name'>default_options</td>
|
105
|
+
<td class='attr-desc'><p>
|
106
|
+
Default options to be used for <a
|
107
|
+
href="Apphunk.html#M000006">Apphunk.log</a>. Initialized by <a
|
108
|
+
href="Apphunk/Config.html">Apphunk::Config</a>.
|
109
|
+
</p></td>
|
110
|
+
</tr>
|
111
|
+
|
112
|
+
</table>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<div class="sectiontitle">Class Public methods</div>
|
117
|
+
|
118
|
+
<div class="method">
|
119
|
+
<div class="title" id="M000008">
|
120
|
+
|
121
|
+
<a name="M000008"></a><b>config</b>(&block)
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="description">
|
126
|
+
<p>
|
127
|
+
Set runtime configuration options
|
128
|
+
</p>
|
129
|
+
<p>
|
130
|
+
Yields <a href="Apphunk/Config.html">Apphunk::Config</a> which can be used
|
131
|
+
to set configuration options in one place. See <a
|
132
|
+
href="Apphunk/Config.html">Apphunk::Config</a> for a list of available
|
133
|
+
options. These options will be available in <a
|
134
|
+
href="Apphunk.html#default_options">Apphunk.default_options</a>.
|
135
|
+
</p>
|
136
|
+
<h4>Examples</h4>
|
137
|
+
<pre>
|
138
|
+
Apphunk.config do |config|
|
139
|
+
config.token = "secret_project_token"
|
140
|
+
config.environments = %w(staging production)
|
141
|
+
end
|
142
|
+
</pre>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<div class="sourcecode">
|
150
|
+
<p class="source-link">
|
151
|
+
Source: <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show</a>
|
152
|
+
|
153
|
+
| <a href="http://github.com/apphunk/apphunk/blob/a37092d225a325b738783fba89641741a886e1ca/lib/apphunk.rb#L68" target="_blank" class="github_url">on GitHub</a>
|
154
|
+
|
155
|
+
</p>
|
156
|
+
<div id="M000008_source" class="dyn-source">
|
157
|
+
<pre><span class="ruby-comment cmt"># File lib/apphunk.rb, line 68</span>
|
158
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
159
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>
|
160
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>[<span class="ruby-identifier">:tags</span>] = <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">tags</span>
|
161
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>[<span class="ruby-identifier">:token</span>] = <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">token</span>
|
162
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>[<span class="ruby-identifier">:trails</span>] = <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">trails</span>
|
163
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>[<span class="ruby-identifier">:environments</span>] = <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">environments</span>
|
164
|
+
|
165
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">environment</span>.<span class="ruby-identifier">blank?</span>
|
166
|
+
<span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">environment</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>[<span class="ruby-identifier">:environment</span>]
|
167
|
+
<span class="ruby-keyword kw">else</span>
|
168
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>[<span class="ruby-identifier">:environment</span>] = <span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">environment</span>
|
169
|
+
<span class="ruby-keyword kw">end</span>
|
170
|
+
<span class="ruby-keyword kw">end</span></pre>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div class="method">
|
177
|
+
<div class="title" id="M000006">
|
178
|
+
|
179
|
+
<a name="M000006"></a><b>log</b>(message, options = {})
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="description">
|
184
|
+
<p>
|
185
|
+
Sends a <tt>message</tt> to your remote inbox at apphunk.com
|
186
|
+
</p>
|
187
|
+
<ul>
|
188
|
+
<li><tt>message</tt> - The body of the message
|
189
|
+
|
190
|
+
</li>
|
191
|
+
<li><tt>options</tt> - A hash of options. Merges with <a
|
192
|
+
href="Apphunk.html#default_options">Apphunk.default_options</a>
|
193
|
+
|
194
|
+
</li>
|
195
|
+
</ul>
|
196
|
+
<p>
|
197
|
+
For a list of available options see <a
|
198
|
+
href="Apphunk/Config.html">Apphunk::Config</a>.
|
199
|
+
</p>
|
200
|
+
<h4>Examples</h4>
|
201
|
+
<pre>
|
202
|
+
Apphunk.log("Yet another hello world")
|
203
|
+
Apphunk.log("Tag me baby", :tags => 'apphunk, doc, examples', :trails => { :user_id => 5 })
|
204
|
+
Apphunk.log("I'm on my way to a different project", :token => 'secret_project_access_token')
|
205
|
+
</pre>
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<div class="sourcecode">
|
213
|
+
<p class="source-link">
|
214
|
+
Source: <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show</a>
|
215
|
+
|
216
|
+
| <a href="http://github.com/apphunk/apphunk/blob/a37092d225a325b738783fba89641741a886e1ca/lib/apphunk.rb#L28" target="_blank" class="github_url">on GitHub</a>
|
217
|
+
|
218
|
+
</p>
|
219
|
+
<div id="M000006_source" class="dyn-source">
|
220
|
+
<pre><span class="ruby-comment cmt"># File lib/apphunk.rb, line 28</span>
|
221
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">options</span> = {})
|
222
|
+
<span class="ruby-identifier">options</span> = (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span> <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
223
|
+
<span class="ruby-constant">Apphunk</span><span class="ruby-operator">::</span><span class="ruby-constant">Proxy</span>.<span class="ruby-identifier">send_message_to_apphunkd</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">options</span>)
|
224
|
+
<span class="ruby-keyword kw">end</span></pre>
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
<div class="method">
|
231
|
+
<div class="title" id="M000007">
|
232
|
+
|
233
|
+
<a name="M000007"></a><b>log_with_options</b>(options = {}, &block)
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div class="description">
|
238
|
+
<p>
|
239
|
+
Send messages with predefined options in a block
|
240
|
+
</p>
|
241
|
+
<p>
|
242
|
+
Yields the <a href="Apphunk.html">Apphunk</a> module which can be used to
|
243
|
+
send messages via <a href="Apphunk.html#M000006">Apphunk.log</a>, but
|
244
|
+
temporarily merges the provided <tt>options</tt> with <a
|
245
|
+
href="Apphunk.html#default_options">Apphunk.default_options</a>. Can be
|
246
|
+
used to send a bunch of messages with the same options.
|
247
|
+
</p>
|
248
|
+
<ul>
|
249
|
+
<li><tt>options</tt> - A hash of options. Merges with <a
|
250
|
+
href="Apphunk.html#default_options">Apphunk.default_options</a>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
</ul>
|
254
|
+
<p>
|
255
|
+
For a list of available options see <a
|
256
|
+
href="Apphunk/Config.html">Apphunk::Config</a>.
|
257
|
+
</p>
|
258
|
+
<h4>Examples</h4>
|
259
|
+
<pre>
|
260
|
+
Apphunk.log_with_options(:tags => 'hello world') do |apphunk|
|
261
|
+
apphunk.log("A messages with tags")
|
262
|
+
apphunk.log("Another messages with the same tags")
|
263
|
+
end
|
264
|
+
</pre>
|
265
|
+
|
266
|
+
</div>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
<div class="sourcecode">
|
272
|
+
<p class="source-link">
|
273
|
+
Source: <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show</a>
|
274
|
+
|
275
|
+
| <a href="http://github.com/apphunk/apphunk/blob/a37092d225a325b738783fba89641741a886e1ca/lib/apphunk.rb#L49" target="_blank" class="github_url">on GitHub</a>
|
276
|
+
|
277
|
+
</p>
|
278
|
+
<div id="M000007_source" class="dyn-source">
|
279
|
+
<pre><span class="ruby-comment cmt"># File lib/apphunk.rb, line 49</span>
|
280
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_with_options</span>(<span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
281
|
+
<span class="ruby-identifier">preserved_defaults</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>
|
282
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span> = (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span> <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
283
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span>
|
284
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span> = <span class="ruby-identifier">preserved_defaults</span>
|
285
|
+
<span class="ruby-keyword kw">end</span></pre>
|
286
|
+
</div>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
</body>
|
294
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Fri, 27 Nov 2009 13:37:17 +0100
|