elsmore 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/hackference.co.uk/assets/css/site.css +488 -0
  4. data/hackference.co.uk/assets/css/slicknav.css +178 -0
  5. data/hackference.co.uk/assets/css/tito.css +130 -0
  6. data/hackference.co.uk/assets/img/algolia.png +0 -0
  7. data/hackference.co.uk/assets/img/andrew-faraday.jpg +0 -0
  8. data/hackference.co.uk/assets/img/conf.png +0 -0
  9. data/hackference.co.uk/assets/img/contentful.jpg +0 -0
  10. data/hackference.co.uk/assets/img/cristiano-betta.jpg +0 -0
  11. data/hackference.co.uk/assets/img/dan-jenkins.png +0 -0
  12. data/hackference.co.uk/assets/img/daniel-knell.jpg +0 -0
  13. data/hackference.co.uk/assets/img/etiene-dalcol.jpg +0 -0
  14. data/hackference.co.uk/assets/img/felienne-hermans.jpg +0 -0
  15. data/hackference.co.uk/assets/img/hack.png +0 -0
  16. data/hackference.co.uk/assets/img/hugh-rawlinson.jpg +0 -0
  17. data/hackference.co.uk/assets/img/improbable.png +0 -0
  18. data/hackference.co.uk/assets/img/jessica-rose-cartoon.png +0 -0
  19. data/hackference.co.uk/assets/img/jonathan-kingsley.jpeg +0 -0
  20. data/hackference.co.uk/assets/img/logo-small.png +0 -0
  21. data/hackference.co.uk/assets/img/martin-splitt.jpg +0 -0
  22. data/hackference.co.uk/assets/img/microsoft.png +0 -0
  23. data/hackference.co.uk/assets/img/mozilla.png +0 -0
  24. data/hackference.co.uk/assets/img/nexmo.png +0 -0
  25. data/hackference.co.uk/assets/img/packt.png +0 -0
  26. data/hackference.co.uk/assets/img/pebble.png +0 -0
  27. data/hackference.co.uk/assets/img/proactive.png +0 -0
  28. data/hackference.co.uk/assets/img/pusher.png +0 -0
  29. data/hackference.co.uk/assets/img/remy-sharp.jpg +0 -0
  30. data/hackference.co.uk/assets/img/sam-wierema.jpg +0 -0
  31. data/hackference.co.uk/assets/img/samathy-barratt.jpg +0 -0
  32. data/hackference.co.uk/assets/img/soledad.png +0 -0
  33. data/hackference.co.uk/assets/img/technical-team-solutions.png +0 -0
  34. data/hackference.co.uk/assets/img/terence-eden.png +0 -0
  35. data/hackference.co.uk/cdn-cgi/l/email-protection/index.html +75 -0
  36. data/hackference.co.uk/cdn-cgi/scripts/cf.common.js +78 -0
  37. data/hackference.co.uk/cdn-cgi/scripts/zepto.min.js +2 -0
  38. data/hackference.co.uk/cdn-cgi/styles/cf.errors.css +1 -0
  39. data/hackference.co.uk/cdnjs.cloudflare.com/ajax/libs/SlickNav/1.0.7/jquery.slicknav.min.js +6 -0
  40. data/hackference.co.uk/code-of-conduct.html +525 -0
  41. data/hackference.co.uk/code.jquery.com/jquery-1.12.3.min.js +5 -0
  42. data/hackference.co.uk/conference.html +776 -0
  43. data/hackference.co.uk/contact.html +365 -0
  44. data/hackference.co.uk/credits.html +399 -0
  45. data/hackference.co.uk/hackathon.html +585 -0
  46. data/hackference.co.uk/index.html +543 -0
  47. data/hackference.co.uk/js.tito.io/v1/index.html +1 -0
  48. data/hackference.co.uk/maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css +6 -0
  49. data/hackference.co.uk/maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css +4 -0
  50. data/hackference.co.uk/platform.twitter.com/js/tweet.00c2bb81d4f3f312a9a021c715a1c9dc.js +1 -0
  51. data/hackference.co.uk/platform.twitter.com/widgets.js +11 -0
  52. data/hackference.co.uk/speakers/andrew-faraday.html +363 -0
  53. data/hackference.co.uk/speakers/dan-jenkins.html +378 -0
  54. data/hackference.co.uk/speakers/daniel-knell.html +382 -0
  55. data/hackference.co.uk/speakers/etiene-dalcol.html +378 -0
  56. data/hackference.co.uk/speakers/felienne-hermans.html +386 -0
  57. data/hackference.co.uk/speakers/hugh-rawlinson.html +378 -0
  58. data/hackference.co.uk/speakers/jonathan-kingsley.html +386 -0
  59. data/hackference.co.uk/speakers/martin-splitt.html +402 -0
  60. data/hackference.co.uk/speakers/remy-sharp.html +380 -0
  61. data/hackference.co.uk/speakers/sam-wierema.html +378 -0
  62. data/hackference.co.uk/speakers/samathy-barratt.html +397 -0
  63. data/hackference.co.uk/speakers/soledad-penades.html +382 -0
  64. data/hackference.co.uk/speakers/terence-eden.html +388 -0
  65. data/hackference.co.uk/sponsors/algolia.html +350 -0
  66. data/hackference.co.uk/sponsors/contentful.html +350 -0
  67. data/hackference.co.uk/sponsors/improbable.html +351 -0
  68. data/hackference.co.uk/sponsors/index.html +655 -0
  69. data/hackference.co.uk/sponsors/microsoft.html +350 -0
  70. data/hackference.co.uk/sponsors/nexmo.html +350 -0
  71. data/hackference.co.uk/sponsors/packt.html +350 -0
  72. data/hackference.co.uk/sponsors/pebble.html +350 -0
  73. data/hackference.co.uk/sponsors/pusher.html +350 -0
  74. data/hackference.co.uk/sponsors/sponsor-us.html +658 -0
  75. data/hackference.co.uk/tickets.html +406 -0
  76. data/lib/elsmore/command.rb +2 -1
  77. data/lib/elsmore/document.rb +7 -3
  78. data/lib/elsmore/emitter.rb +22 -12
  79. data/lib/elsmore/resource.rb +4 -3
  80. data/lib/elsmore/rewriter.rb +13 -3
  81. data/lib/elsmore/scraper.rb +42 -26
  82. data/lib/elsmore/version.rb +1 -1
  83. data/lib/elsmore/writer.rb +4 -1
  84. metadata +74 -1
@@ -0,0 +1,406 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <meta charset="utf-8" />
4
+ <title>Tickets | Hackference 2016</title>
5
+
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <meta name="description" content="Hackference is a conference and hackathon based around learning and inspiring people to hack - October 21st for the Conference, 22nd and 23rd for the Hackathon - based in Birmingham, UK" />
8
+ <meta name="robots" content="index, follow" />
9
+ <meta name="author" content="Mike Elsmore, Jake Price, Curtis Harding" />
10
+
11
+ <meta property="og:title" content="Hackference 2016" />
12
+ <meta property="og:type" content="website" />
13
+ <meta property="og:url" content="http://2016.hackference.co.uk" />
14
+ <meta property="og:image" content="https://pbs.twimg.com/profile_images/715514227885211648/gkFpBOS9.jpg" />
15
+
16
+ <!-- Base CSS -->
17
+ <link rel="stylesheet" href="/maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
18
+ <link rel="stylesheet" href="/maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
19
+ <link rel="stylesheet" href="/assets/css/slicknav.css" />
20
+
21
+ <!-- Site CSS -->
22
+ <link rel="stylesheet" type="text/css" href="/assets/css/site.css" />
23
+
24
+ <!-- Other -->
25
+ <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
26
+
27
+ <script type="text/javascript" charset="utf-8" async="" src="/platform.twitter.com/js/tweet.00c2bb81d4f3f312a9a021c715a1c9dc.js"></script>
28
+
29
+ <body>
30
+ <div id="hero">
31
+ <div class="container">
32
+ <div class="col-md-12">
33
+ <h1><a href="/">Hackference 2016</a></h1>
34
+ <h2>21st - 23rd October 2016, Birmingham UK</h2>
35
+ <div class="hero-tickets">
36
+ <a href="/tickets.html" class="art-deco-button">Tickets from £60</a>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ <div id="header">
42
+ <div class="container">
43
+ <div class="col-md-12">
44
+ <ul id="menu" class="top-nav hidden-sm hidden-xs">
45
+ <li><a href="/tickets.html" class="active">Tickets</a></li>
46
+ <li><a href="/conference.html" class="">Conference</a></li>
47
+ <li><a href="/hackathon.html" class="">Hackathon</a></li>
48
+ <li><a href="/sponsors" class="">Sponsors</a></li>
49
+ <li><a href="/code-of-conduct.html" class="">Code of conduct</a></li>
50
+ </ul>
51
+ </div>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- for basic styles include a link to our stylesheet. -->
56
+ <!-- fancy something more adventurous? Copy it and roll your own! -->
57
+ <!-- <link rel="stylesheet" type="text/css" href='https://css.tito.io/v1' /> -->
58
+ <link rel="stylesheet" type="text/css" href="/assets/css/tito.css" />
59
+ <div class="content">
60
+ <div class="container">
61
+ <div class="row">
62
+ <div class="col-md-12">
63
+ <h4 class="sub-header border">Conference Tickets</h4>
64
+ </div>
65
+ </div>
66
+ <div class="row">
67
+ <div class="col-sm-12">
68
+ <p class="big-intro">Tickets for the conference are available to purchase below. We cannot wait to welcome you to the latest edition of the conference on October 21st at The Electric in Birmingham, UK. Conference ticket holders will have priority for the Hackathon tickets.</p>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </div>
73
+
74
+ <a name="diversity"></a>
75
+ <div class="content">
76
+ <div class="container">
77
+ <div class="row">
78
+ <div class="col-md-12">
79
+ <h4 class="sub-header">Diversity Pool</h4>
80
+ </div>
81
+ </div>
82
+ <div class="row">
83
+ <div class="col-sm-12">
84
+ <p class="big-intro">We're hoping to make it easier than ever for minorities and disadvantaged groups to attend. If you'd like to donate and help us move towards that goal, that would be incredible. If you'd like to apply for a diversity ticket just go to <a href="http://bit.ly/hackference2016diversitytickets">http://bit.ly/hackference2016diversitytickets</a>.</p>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </div>
89
+
90
+ <div class="content">
91
+ <div class="container">
92
+ <div class="row">
93
+ <div class="col-md-12">
94
+ <h4 class="sub-header">Group Tickets</h4>
95
+ </div>
96
+ </div>
97
+ <div class="row">
98
+ <div class="col-sm-12">
99
+ <p class="big-intro">If you're looking to buy 3 or more tickets, then we can look at giving you a discount. Please contact <a href="/cdn-cgi/l/email-protection#44292d2f21042c25272f222136212a27216a272b6a312f">Mike</a> and start the conversation. We look to give discounts on a sliding scale, so if you are buying more tickets, you'll get a bigger discount!</p>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="content-darker">
106
+ <div class="container">
107
+ <div class="row">
108
+ <div class="col-md-12">
109
+ <h4 class="sub-header border">Purchase Tickets</h4>
110
+ </div>
111
+ </div>
112
+ <div class="row">
113
+ <div class="col-sm-6 col-sm-offset-3">
114
+ <tito-widget event="hackference/hackference-2016"></tito-widget>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ </div>
119
+
120
+ <div class="content">
121
+ <div class="container">
122
+ <div class="row">
123
+ <div class="col-md-12">
124
+ <a name="hackathon"></a>
125
+ <h4 class="sub-header border">Hackathon Tickets</h4>
126
+ </div>
127
+ </div>
128
+ <div class="row">
129
+ <div class="col-sm-6 col-sm-offset-3">
130
+ <tito-widget event="hackference/hackference-2016-hackathon"></tito-widget>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ <script src="/js.tito.io/v1/index.html" async=""></script>
137
+
138
+ <!-- /Content type 1 -->
139
+ <div class="content">
140
+ <div class="container">
141
+ <div class="row">
142
+ <div class="col-md-12">
143
+ <h4 class="sub-header border">Our Sponsors</h4>
144
+ </div>
145
+ <!-- Top level sponsorship get col-6 -->
146
+ <div class="row">
147
+ <!-- Executive Producer/Platinum -->
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ </div>
172
+ <!-- Second level sponsorship get col-4 -->
173
+ <div class="row">
174
+ <!-- Associate Producer/Gold -->
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <div class="col-sm-6 col-sm-offset-3 col-xs-12 newsponsor">
188
+ <a href="https://www.nexmo.com/">
189
+ <img src="/assets/img/nexmo.png" width="100%" />
190
+ <div class="sponsor-name">Nexmo</div>
191
+ <div class="sponsor-meta">Associate Producer</div>
192
+ </a>
193
+ </div>
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ </div>
207
+ <!-- Rest sponsorship get col-3 -->
208
+ <div class="row">
209
+ <!-- Assistant Producer/Silver -->
210
+
211
+
212
+ <div class="col-sm-3 newsponsor">
213
+ <a href="https://www.algolia.com/">
214
+ <img src="/assets/img/algolia.png" width="100%" />
215
+ <div class="sponsor-name smaller">Algolia</div>
216
+ <div class="sponsor-meta smaller">Assistant Producer</div>
217
+ </a>
218
+ </div>
219
+
220
+
221
+
222
+ <div class="col-sm-3 newsponsor">
223
+ <a href="https://www.contentful.com/">
224
+ <img src="/assets/img/contentful.jpg" width="100%" />
225
+ <div class="sponsor-name smaller">Contentful</div>
226
+ <div class="sponsor-meta smaller">Assistant Producer</div>
227
+ </a>
228
+ </div>
229
+
230
+
231
+
232
+ <div class="col-sm-3 newsponsor">
233
+ <a href="https://improbable.io">
234
+ <img src="/assets/img/improbable.png" width="100%" />
235
+ <div class="sponsor-name smaller">Improbable</div>
236
+ <div class="sponsor-meta smaller">Assistant Producer</div>
237
+ </a>
238
+ </div>
239
+
240
+
241
+
242
+ <div class="col-sm-3 newsponsor">
243
+ <a href="">
244
+ <img src="/assets/img/microsoft.png" width="100%" />
245
+ <div class="sponsor-name smaller">Microsoft</div>
246
+ <div class="sponsor-meta smaller">Assistant Producer</div>
247
+ </a>
248
+ </div>
249
+
250
+
251
+
252
+ <div class="col-sm-3 newsponsor">
253
+ <a href="https://www.mozilla.org">
254
+ <img src="/assets/img/mozilla.png" width="100%" />
255
+ <div class="sponsor-name smaller">Mozilla</div>
256
+ <div class="sponsor-meta smaller">Assistant Producer</div>
257
+ </a>
258
+ </div>
259
+
260
+
261
+
262
+
263
+
264
+ <div class="col-sm-3 newsponsor">
265
+ <a href="https://www.packtpub.com/mapt">
266
+ <img src="/assets/img/packt.png" width="100%" />
267
+ <div class="sponsor-name smaller">Mapt - Powered by Packt</div>
268
+ <div class="sponsor-meta smaller">Assistant Producer</div>
269
+ </a>
270
+ </div>
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+ <div class="col-sm-3 newsponsor">
279
+ <a href="https://pusher.com">
280
+ <img src="/assets/img/pusher.png" width="100%" />
281
+ <div class="sponsor-name smaller">Pusher</div>
282
+ <div class="sponsor-meta smaller">Assistant Producer</div>
283
+ </a>
284
+ </div>
285
+
286
+
287
+
288
+
289
+ </div>
290
+ <!-- Rest sponsorship get col-3 -->
291
+ <div class="row">
292
+ <!-- Coordinating Producer/Bronze -->
293
+ <div class="col-sm-2">
294
+ </div>
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+ <div class="col-sm-3 newsponsor">
312
+ <a href="https://pebble.com">
313
+ <img src="/assets/img/pebble.png" width="100%" />
314
+ </a>
315
+ </div>
316
+
317
+
318
+
319
+ <div class="col-sm-3 newsponsor">
320
+ <a href="http://www.proactive.uk.net/">
321
+ <img src="/assets/img/proactive.png" width="100%" />
322
+ </a>
323
+ </div>
324
+
325
+
326
+
327
+
328
+
329
+ <div class="col-sm-3 newsponsor">
330
+ <a href="http://technicalteamsolutions.co.uk/">
331
+ <img src="/assets/img/technical-team-solutions.png" width="100%" />
332
+ </a>
333
+ </div>
334
+
335
+
336
+ </div>
337
+
338
+ </div>
339
+ </div>
340
+ </div>
341
+
342
+ <div id="footer">
343
+ <div class="container">
344
+ <div class="col-sm-6">
345
+ <img src="/assets/img/logo-small.png" />
346
+ <ul class="footer-nav">
347
+ <li><a href="/contact.html">Contact</a></li>
348
+ <li><a href="/credits.html">Credits</a></li>
349
+ <li>Created with Jekyll. Hosted on Github Pages</li>
350
+ <li>Registered company #09529922</li>
351
+ </ul>
352
+ </div>
353
+ <div class="col-sm-6 text-right">
354
+ <p>Following us on social media and joining out mail list.</p>
355
+ <p>Twitter: <a href="https://twitter.com/hackferencebrum">@hackference</a>, Facebook: <a href="https://www.facebook.com/hackference">hackference</a>, Github: <a href="https://github.com/hackference/hackference-2016">Hackference</a></p>
356
+ <form action="//hackference.us10.list-manage.com/subscribe/post?u=6d8df0266d881f193098c49f0&amp;id=973bd1522a" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate form-inline footer-form" target="_blank" novalidate="" style="margin-top: 40px;">
357
+ <div id="mc_embed_signup_scroll">
358
+ <div class="input-group">
359
+ <div id="mce-responses" class="clear">
360
+ <div class="response" id="mce-error-response" style="display:none"></div>
361
+ <div class="response" id="mce-success-response" style="display:none"></div>
362
+ </div>
363
+ <input type="email" value="" name="EMAIL" class="required email form-control col-md-10" placeholder="Email Address" id="mce-EMAIL" />
364
+ <div style="position: absolute; left: -5000px;"><input type="text" name="b_6d8df0266d881f193098c49f0_973bd1522a" tabindex="-1" value="" /></div>
365
+ <span class="input-group-btn">
366
+ <button class="btn btn-subscribe" type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe">Subscribe</button>
367
+ </span>
368
+ </div><!-- /input-group -->
369
+ </div>
370
+ </form>
371
+ </div>
372
+
373
+ </div>
374
+ </div>
375
+
376
+ <!-- Latest compiled and minified JavaScript -->
377
+ <script src="/code.jquery.com/jquery-1.12.3.min.js"></script>
378
+ <script async="" src="/platform.twitter.com/widgets.js" charset="utf-8"></script>
379
+ <script src="/cdnjs.cloudflare.com/ajax/libs/SlickNav/1.0.7/jquery.slicknav.min.js"></script>
380
+ <script>
381
+ $(function () {
382
+ $('#menu').slicknav({
383
+ prependTo: '#header',
384
+ label: 'Menu',
385
+ });
386
+ $('.slicknav_btn').on('click', function () {
387
+ //-- Scroll to top of page
388
+ $('html, body').animate({
389
+ scrollTop: ($(this).offset().top - 90) + 'px',
390
+ }, 'slow');
391
+ });
392
+ });
393
+ </script>
394
+ <script>
395
+ $(function () {
396
+ $('body').on('click', '#tito-hackference-hackference-2016-1-show-discount-code a', function() {
397
+ $('#tito-hackference-hackference-2016-1-edit-discount-code').toggle();
398
+ });
399
+ });
400
+ </script>
401
+
402
+ <!-- GoSquared -->
403
+ <script>!function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.insertBefore(d,q)}(window,document,'script','_gs');_gs('GSN-309350-E');</script>
404
+
405
+ <script type="text/javascript">/* <![CDATA[ */(function(d,s,a,i,j,r,l,m,t){try{l=d.getElementsByTagName('a');t=d.createElement('textarea');for(i=0;l.length-i;i++){try{a=l[i].href;s=a.indexOf('/cdn-cgi/l/email-protection');m=a.length;if(a&&s>-1&&m>28){j=28+s;s='';if(j<m){r='0x'+a.substr(j,2)|0;for(j+=2;j<m&&a.charAt(j)!='X';j+=2)s+='%'+('0'+('0x'+a.substr(j,2)^r).toString(16)).slice(-2);j++;s=decodeURIComponent(s)+a.substr(j,m-j)}t.innerHTML=s.replace(/</g,'&lt;').replace(/>/g,'&gt;');l[i].href='mailto:'+t.value}}catch(e){}}}catch(e){}})(document);/* ]]> */</script></body>
406
+ </html>
@@ -16,6 +16,8 @@ module Elsmore
16
16
  program :description, 'A convenient scraper for archiving sites'
17
17
  program :help, 'Author', 'Cristiano Betta <cristiano@betta.io>'
18
18
 
19
+ global_option('--debug') { emitter.debug! }
20
+
19
21
  command :snap do |c|
20
22
  c.syntax = 'spider <url> [options]'
21
23
  c.description = 'Spiders a URL within from the given page, sticking within the original domain'
@@ -36,7 +38,6 @@ module Elsmore
36
38
  alias_command :'go fetch', :'snap'
37
39
  default_command :snap
38
40
 
39
-
40
41
  run!
41
42
  end
42
43
  end
@@ -3,7 +3,7 @@ require 'oga'
3
3
 
4
4
  module Elsmore
5
5
  class Document
6
- attr_accessor :url
6
+ attr_accessor :url, :emitter
7
7
 
8
8
  def initialize url, parent = nil
9
9
  self.url = Elsmore::Url.new(url, parent)
@@ -24,11 +24,15 @@ module Elsmore
24
24
  end
25
25
 
26
26
  def write!
27
- Elsmore::Writer.new(self).write
27
+ writer = Elsmore::Writer.new(self)
28
+ writer.emitter = emitter
29
+ writer.write
28
30
  end
29
31
 
30
32
  def rewrite
31
- Elsmore::Rewriter.new(self).rewrite
33
+ rewriter = Elsmore::Rewriter.new(self)
34
+ rewriter.emitter = emitter
35
+ rewriter.rewrite
32
36
  end
33
37
 
34
38
  def doc
@@ -3,28 +3,38 @@ require 'colorize'
3
3
 
4
4
  module Elsmore
5
5
  class Emitter
6
- def newline
7
- say "\n"
6
+ attr_accessor :debug
7
+
8
+ def initialize
9
+ self.debug = false
8
10
  end
9
11
 
10
- def say value
11
- puts value
12
+ def debug!
13
+ self.debug = true
12
14
  end
13
15
 
14
- def dot
15
- print ".".colorize(:green)
16
+ def newline
17
+ say "\n"
16
18
  end
17
19
 
18
- def x
19
- print "x".colorize(:red)
20
+ def pretty value
21
+ ap value
20
22
  end
21
23
 
22
- def unsure
23
- print "?".colorize(:blue)
24
+ def log message
25
+ if debug
26
+ puts message
27
+ else
28
+ print ".".colorize(:green)
29
+ end
24
30
  end
25
31
 
26
- def pretty value
27
- ap value
32
+ def warning message
33
+ if debug
34
+ puts message.colorize(:yellow)
35
+ else
36
+ print ".".colorize(:yellow)
37
+ end
28
38
  end
29
39
  end
30
40
  end