hackersays 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/hackersays.rb ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ require 'yaml'
3
+ require 'open-uri'
4
+ class Hacker
5
+ def self.said
6
+ @quotes = []
7
+ hackers_said = File.dirname(__FILE__) + "/.said"
8
+ @quotes = YAML::load(open(hackers_said).read)
9
+ quote = @quotes[rand(@quotes.length)]
10
+ said = quote[:c]
11
+ who = quote[:a] || "Some hacker"
12
+ "#{said} ~ #{who}".gsub(/\n/,"")
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ require 'test/unit'
2
+ require 'hackersays'
3
+
4
+ class HackerTest < Test::Unit::TestCase
5
+ def test_hacker_said
6
+ assert_not_nil Hacker.said()
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hackersays
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Hemanth.HM
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-20 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: The best lines from hackers around the world!
15
+ email: hemanth.hm@gmail.com
16
+ executables:
17
+ - hackersays
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - Rakefile
22
+ - lib/hackersays.rb
23
+ - bin/hackersays
24
+ - lib/.said
25
+ - test/test_hackersays.rb
26
+ homepage: http://rubygems.org/gems/gita
27
+ licenses: []
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 1.8.10
47
+ signing_key:
48
+ specification_version: 3
49
+ summary: Hackersays!
50
+ test_files:
51
+ - test/test_hackersays.rb
52
+ has_rdoc: