-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
191 lines (149 loc) · 9.69 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<!-- The Time Machine GitHub pages theme was designed and developed by Jon Rohan, on Feb 7, 2012. -->
<!-- Follow him for fun. http://twitter.com/jonrohan. Tail his code on http://github.com/jonrohan -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="stylesheets/stylesheet.css" media="screen"/>
<link rel="stylesheet" href="stylesheets/pygment_trac.css"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="javascripts/script.js"></script>
<title>Campy</title>
<meta name="description" content="A tiny zero-dependency Campfire Ruby client so you can get on with it">
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<div class="wrapper">
<header>
<h1 class="title">Campy</h1>
</header>
<div id="container">
<p class="tagline">A tiny zero-dependency Campfire Ruby client so you can get on with it</p>
<div id="main" role="main">
<div class="download-bar">
<div class="inner">
<a href="https://github.com/fnichol/campy/tarball/master" class="download-button tar"><span>Download</span></a>
<a href="https://github.com/fnichol/campy/zipball/master" class="download-button zip"><span>Download</span></a>
<a href="https://github.com/fnichol/campy" class="code">View Campy on GitHub</a>
</div>
<span class="blc"></span><span class="trc"></span>
</div>
<article class="markdown-body">
<p><a href="http://badge.fury.io/rb/campy"><img src="https://badge.fury.io/rb/campy.png" alt="Gem Version"></a>
<a href="http://travis-ci.org/fnichol/campy"><img src="https://secure.travis-ci.org/fnichol/campy.png" alt="Build Status"></a>
<a href="https://codeclimate.com/github/fnichol/campy"><img src="https://codeclimate.com/github/fnichol/campy.png" alt="Code Climate"></a>
<a href="https://gemnasium.com/fnichol/campy"><img src="https://gemnasium.com/fnichol/campy.png" alt="Dependency Status"></a></p>
<p>Tiny Campfire Ruby client so you can get on with it. It's implemented on top of
<code>Net::HTTP</code> with <strong>no</strong> external dependencies for Ruby compatibilities.</p>
<h2>
<a name="installation"></a> Installation</h2>
<p>Add this line to your application's Gemfile:</p>
<div class="highlight"><pre><span class="n">gem</span> <span class="s1">'campy'</span>
</pre></div>
<p>And then execute:</p>
<div class="highlight"><pre><span class="nv">$ </span>bundle
</pre></div>
<p>Or install it yourself as:</p>
<pre><code>$ gem install campy
</code></pre>
<h2>
<a name="usage"></a> Usage</h2>
<p>First create a <code>campfire.yml</code> file in your home directory:</p>
<div class="highlight"><pre><span class="nv">$ </span>cat <span class="s"><<CAMPFIRE_YAML > $HOME/.campfire.yml</span>
<span class="s">:account: mysubdomain</span>
<span class="s">:token: mytoken123</span>
<span class="s">:room: House of Hubot</span>
<span class="s">CAMPFIRE_YAML</span>
</pre></div>
<h3>
<a name="usage-bin"></a> campy Command</h3>
<p>Campy comes with the <code>campy</code> command so you can send messages from the
command line:</p>
<div class="highlight"><pre><span class="nv">$ </span>campy speak <span class="s2">"Campy says yello"</span>
<span class="nv">$ </span>campy paste <span class="s2">"Long pastes are long"</span>
<span class="nv">$ </span>campy play ohmy
</pre></div>
<p>Or pipe in your message:</p>
<div class="highlight"><pre><span class="nv">$ </span><span class="nb">echo</span> <span class="s2">"Campy tries to honor unix conventions"</span> | campy speak
<span class="nv">$ </span>cat ~/stackdump.log | campy paste
<span class="nv">$ </span><span class="nb">echo </span>ohmy | campy play
</pre></div>
<h3>
<a name="usage-ruby"></a> Ruby Library</h3>
<p>There's not much to the API; create a <code>Campy::Room</code> and go:</p>
<div class="highlight"><pre><span class="nb">require</span> <span class="s1">'campy'</span>
<span class="n">campy</span> <span class="o">=</span> <span class="ss">Campy</span><span class="p">:</span><span class="ss">:Room</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">:account</span> <span class="o">=></span> <span class="s2">"mysubdomain"</span><span class="p">,</span>
<span class="ss">:token</span> <span class="o">=></span> <span class="s2">"mytoken123"</span><span class="p">,</span> <span class="ss">:room</span> <span class="o">=></span> <span class="s2">"House of Hubot"</span><span class="p">)</span>
<span class="n">campy</span><span class="o">.</span><span class="n">speak</span> <span class="s2">"Campy says yello"</span>
<span class="n">campy</span><span class="o">.</span><span class="n">paste</span> <span class="s2">"Long pastes are long"</span>
<span class="n">campy</span><span class="o">.</span><span class="n">play</span> <span class="s2">"ohmy"</span>
</pre></div>
<p>If you know the room ID and would prefer to use that instead of the name:</p>
<div class="highlight"><pre><span class="nb">require</span> <span class="s1">'campy'</span>
<span class="n">campy</span> <span class="o">=</span> <span class="ss">Campy</span><span class="p">:</span><span class="ss">:Room</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">:account</span> <span class="o">=></span> <span class="s2">"mysubdomain"</span><span class="p">,</span>
<span class="ss">:token</span> <span class="o">=></span> <span class="s2">"mytoken123"</span><span class="p">,</span> <span class="ss">:room_id</span> <span class="o">=></span> <span class="s2">"12345"</span><span class="p">)</span>
<span class="n">campy</span><span class="o">.</span><span class="n">speak</span> <span class="s2">"Campy says yello"</span>
<span class="n">campy</span><span class="o">.</span><span class="n">paste</span> <span class="s2">"Long pastes are long"</span>
<span class="n">campy</span><span class="o">.</span><span class="n">play</span> <span class="s2">"ohmy"</span>
</pre></div>
<p>Why not use the <code>campfire.yml</code> config? Let's do that:</p>
<div class="highlight"><pre><span class="nb">require</span> <span class="s1">'campy'</span>
<span class="nb">require</span> <span class="s1">'yaml'</span>
<span class="n">campy</span> <span class="o">=</span> <span class="ss">Campy</span><span class="p">:</span><span class="ss">:Room</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="no">YAML</span><span class="o">.</span><span class="n">load_file</span><span class="p">(</span>
<span class="no">File</span><span class="o">.</span><span class="n">expand_path</span><span class="p">(</span><span class="s2">"~/.campfire.yml"</span><span class="p">)))</span>
<span class="n">campy</span><span class="o">.</span><span class="n">speak</span> <span class="s2">"Campy says yello"</span>
<span class="n">campy</span><span class="o">.</span><span class="n">paste</span> <span class="s2">"Long pastes are long"</span>
<span class="n">campy</span><span class="o">.</span><span class="n">play</span> <span class="s2">"ohmy"</span>
</pre></div>
<h2>
<a name="development"></a> Development</h2>
<ul>
<li>Source hosted at <a href="https://github.com/fnichol/campy">GitHub</a>
</li>
<li>Report issues/questions/feature requests on <a href="https://github.com/fnichol/campy/issues">GitHub Issues</a>
</li>
</ul><p>Pull requests are very welcome! Make sure your patches are well tested.
Ideally create a topic branch for every separate change you make. For
example:</p>
<ol>
<li>Fork the repo</li>
<li>Create your feature branch (<code>git checkout -b my-new-feature</code>)</li>
<li>Commit your changes (<code>git commit -am 'Added some feature'</code>)</li>
<li>Push to the branch (<code>git push origin my-new-feature</code>)</li>
<li>Create new Pull Request</li>
</ol><h2>
<a name="authors"></a> Authors</h2>
<p>Created and maintained by <a href="https://github.com/fnichol">Fletcher Nichol</a> (<a href="mailto:fnichol@nichol.ca">fnichol@nichol.ca</a>)</p>
<h2>
<a name="license"></a> License</h2>
<p>MIT (see <a href="https://github.com/fnichol/campy/blob/master/LICENSE">LICENSE</a>)</p>
</article>
</div>
</div>
<footer>
<div class="owner">
<p><a href="https://github.com/fnichol" class="avatar"><img src="https://secure.gravatar.com/avatar/9891e8299426fb9b6e361b84b3155a2d?s=30&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="48" height="48"/></a> <a href="https://github.com/fnichol">fnichol</a> maintains <a href="https://github.com/fnichol/campy">Campy</a></p>
</div>
<div class="creds">
<small>This page generated using <a href="https://pages.github.com/">GitHub Pages</a><br/>theme by <a href="http://twitter.com/jonrohan/">Jon Rohan</a></small>
</div>
</footer>
</div>
<div class="current-section">
<a href="#top">Scroll to top</a>
<a href="https://github.com/fnichol/campy/tarball/master" class="tar">tar</a><a href="https://github.com/fnichol/campy/zipball/master" class="zip">zip</a><a href="" class="code">source code</a>
<p class="name"></p>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-29670723-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body>
</html>