nerd_quiz 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ before_install:
2
+ - git submodule update --init --recursive
3
+ language: ruby
4
+ rvm:
5
+ - 1.9.2
6
+ - 1.9.3
7
+ - rbx-19mode
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](http://travis-ci.org/simeonwillbanks/nerd_quiz.png)](http://travis-ci.org/simeonwillbanks/nerd_quiz)
2
+
1
3
  # Nerd Quiz
2
4
  ## Test your nerd skills by answering [NerdPursuit](https://github.com/Nerds/NerdPursuit) questions!
3
5
  A ruby gem which implements a command line interface to [NerdPursuit](https://github.com/Nerds/NerdPursuit) questions
@@ -6,10 +6,10 @@ module NerdQuiz
6
6
  @input = input
7
7
  @output = output
8
8
  @scorecard = scorecard
9
- Signal.trap('INT', 'EXIT')
10
9
  end
11
10
 
12
11
  def run
12
+ handle_signals
13
13
  questions
14
14
  start
15
15
  while @scorecard.incomplete?
@@ -83,5 +83,9 @@ module NerdQuiz
83
83
  end
84
84
  @output.puts text
85
85
  end
86
+
87
+ def handle_signals
88
+ Signal.trap('INT', 'EXIT')
89
+ end
86
90
  end
87
91
  end
@@ -1,3 +1,3 @@
1
1
  module NerdQuiz
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
data/nerd_quiz.gemspec CHANGED
@@ -7,13 +7,14 @@ Gem::Specification.new do |s|
7
7
  s.version = NerdQuiz::VERSION
8
8
  s.authors = ['Simeon F. Willbanks']
9
9
  s.email = ['sfw@simeonfosterwillbanks.com']
10
- s.homepage = 'https://github.com/simeonwillbanks/nerd_quiz'
10
+ s.homepage = 'http://simeonwillbanks.github.com/nerd_quiz/'
11
11
  s.summary = %q{A ruby gem which implements a command line interface to NerdPursuit questions}
12
12
  s.description = %q{Test your nerd skills by answering NerdPursuit questions!}
13
13
 
14
14
  s.rubyforge_project = 'nerd_quiz'
15
15
 
16
16
  s.files = [".rspec",
17
+ ".travis.yml",
17
18
  ".gitignore",
18
19
  ".gitmodules",
19
20
  "Gemfile",
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module NerdQuiz
4
4
  describe Question do
5
5
  describe '.get' do
6
- let(:path) { "/Users/simeon/Projects/nerd_quiz/NerdPursuit/questions/yo_dawg.json" }
6
+ let(:path) { File.expand_path('../../../NerdPursuit/questions/yo_dawg.json', __FILE__) }
7
7
  let(:text) do
8
8
  "Yo dawg, I herd you like ...\n" +
9
9
  "a1) music, so I put a tape in your pants so you can listen while you sleep!\n" +
@@ -95,6 +95,10 @@ module NerdQuiz
95
95
  it 'always says bye' do
96
96
  output.should_receive(:puts).with("\e[1m\e[34mBye!\e[0m")
97
97
  end
98
+
99
+ it 'catches SIGINTs' do
100
+ Signal.should_receive(:trap).with('INT', 'EXIT').once
101
+ end
98
102
  end
99
103
  end
100
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nerd_quiz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yajl-ruby
16
- requirement: &70189996098200 !ruby/object:Gem::Requirement
16
+ requirement: &70200808752580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70189996098200
24
+ version_requirements: *70200808752580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70189996097500 !ruby/object:Gem::Requirement
27
+ requirement: &70200808751840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70189996097500
35
+ version_requirements: *70200808751840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70189996096820 !ruby/object:Gem::Requirement
38
+ requirement: &70200808751220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70189996096820
46
+ version_requirements: *70200808751220
47
47
  description: Test your nerd skills by answering NerdPursuit questions!
48
48
  email:
49
49
  - sfw@simeonfosterwillbanks.com
@@ -53,6 +53,7 @@ extensions: []
53
53
  extra_rdoc_files: []
54
54
  files:
55
55
  - .rspec
56
+ - .travis.yml
56
57
  - .gitignore
57
58
  - .gitmodules
58
59
  - Gemfile
@@ -248,7 +249,7 @@ files:
248
249
  - NerdPursuit/questions/who_is_the_first_character_to_b.json
249
250
  - NerdPursuit/questions/yo_dawg.json
250
251
  - NerdPursuit/questions/z-index_property.json
251
- homepage: https://github.com/simeonwillbanks/nerd_quiz
252
+ homepage: http://simeonwillbanks.github.com/nerd_quiz/
252
253
  licenses:
253
254
  - MIT
254
255
  post_install_message:
@@ -269,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
270
  version: '0'
270
271
  segments:
271
272
  - 0
272
- hash: -870043030186754183
273
+ hash: 3758517233295047994
273
274
  requirements: []
274
275
  rubyforge_project: nerd_quiz
275
276
  rubygems_version: 1.8.11