red_davis 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 reddavis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,31 @@
1
+ = My CV
2
+
3
+ == Install
4
+
5
+ gem sources -a http://gemcutter.org
6
+ sudo gem install red_davis
7
+
8
+ == How To Use
9
+
10
+ Boot up IRB
11
+
12
+ require 'rubygems'
13
+ require 'red_davis'
14
+
15
+ # Lets create a me
16
+ a = RedDavis.new
17
+
18
+ # Want to view my blog?
19
+ a.blog
20
+
21
+ # Need to share my CV with other co-workers
22
+ a.share_with('you@yourcompany.com', 'your_co_workers@a.com', 'co_worker2@b.com')
23
+
24
+ # Want to hire me?
25
+ a.hired!(:from => 'you', :body => 'hey, nice cv', :subject => 'hello')
26
+
27
+ View the documentation for all methods
28
+
29
+ == Copyright
30
+
31
+ Copyright (c) 2010 Red Davis. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,47 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "red_davis"
8
+ gem.summary = %Q{My CV}
9
+ gem.description = %Q{My CV}
10
+ gem.email = "reddavis@gmail.com"
11
+ gem.homepage = "http://github.com/reddavis/CV"
12
+ gem.authors = ["reddavis"]
13
+ gem.add_development_dependency "rspec", ">= 1.2.9"
14
+ gem.add_dependency "pony"
15
+ gem.add_dependency "json"
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
+ end
22
+
23
+ require 'spec/rake/spectask'
24
+ Spec::Rake::SpecTask.new(:spec) do |spec|
25
+ spec.libs << 'lib' << 'spec'
26
+ spec.spec_files = FileList['spec/**/*_spec.rb']
27
+ end
28
+
29
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
30
+ spec.libs << 'lib' << 'spec'
31
+ spec.pattern = 'spec/**/*_spec.rb'
32
+ spec.rcov = true
33
+ end
34
+
35
+ task :spec => :check_dependencies
36
+
37
+ task :default => :spec
38
+
39
+ require 'rake/rdoctask'
40
+ Rake::RDocTask.new do |rdoc|
41
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
42
+
43
+ rdoc.rdoc_dir = 'rdoc'
44
+ rdoc.title = "CV - Red Davis #{version}"
45
+ rdoc.rdoc_files.include('README*')
46
+ rdoc.rdoc_files.include('lib/**/*.rb')
47
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
data/lib/red_davis.rb ADDED
@@ -0,0 +1,95 @@
1
+ require 'pony'
2
+ require 'net/http'
3
+ require 'json'
4
+
5
+ class RedDavis
6
+
7
+ # Returns a hash containg info about all my current OS projects on Github
8
+ def projects
9
+ request = Net::HTTP.get(URI.parse(github_profile_url))
10
+ JSON.parse(request)
11
+ end
12
+
13
+ def location
14
+ {
15
+ :country => 'England',
16
+ :city => 'Bath',
17
+ :google_map => "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Bath,+Avon,+United+Kingdom&sll=37.0625,-95.677068&sspn=55.981213,108.544922&ie=UTF8&hq=&hnear=Bath,+Avon,+United+Kingdom&z=13"
18
+ }
19
+ end
20
+
21
+ # Opens a browser window and sends you to my blog (Not tested on Windows)
22
+ def blog
23
+ system("open #{blog_url}")
24
+ end
25
+
26
+ def interested_in
27
+ [
28
+ 'Machine Learning',
29
+ 'Data',
30
+ 'Ruby',
31
+ 'Rails',
32
+ 'Fun things'
33
+ ]
34
+ end
35
+
36
+ def work_experience
37
+ {
38
+ :green_thing => {
39
+ :url => 'http://dothegreenthing.com',
40
+ :position => 'Lead Developer',
41
+ :started => Time.local(2008, 'apr', 1),
42
+ :finished => nil
43
+ }
44
+ }
45
+ end
46
+
47
+ # Print out all basic information
48
+ def print
49
+ text = File.expand_path(File.dirname(__FILE__) + '/text/cv.txt')
50
+ File.readlines(text).each do |line|
51
+ puts line
52
+ end
53
+ end
54
+
55
+ # Hire me!
56
+ # * :from => Who you are
57
+ # * :body => A little message
58
+ # * :subject => Subject of the email
59
+ def hired!(options={})
60
+ raise "You need to specify from, subject and body" unless options.key?(:from) || options.key?(:body) || options.key?(:subject)
61
+ Pony.mail({:to => 'reddavis@gmail.com'}.merge(options))
62
+ end
63
+
64
+ # My contact details
65
+ def contact_details
66
+ {
67
+ :email => 'reddavis@gmail.com',
68
+ :phone => '07515353733'
69
+ }
70
+ end
71
+
72
+ # Shared me CV with fellow co-workers. Sends them a URL to download this CV
73
+ def share_with(from, *emails)
74
+ emails.each do |email|
75
+ Pony.mail(:to => email,
76
+ :from => from,
77
+ :subject => 'Hey what do you think of this guy...',
78
+ :body => github_cv_url)
79
+ end
80
+ end
81
+
82
+ private
83
+
84
+ def github_profile_url
85
+ 'http://github.com/api/v2/json/repos/show/reddavis'
86
+ end
87
+
88
+ def github_cv_url
89
+ end
90
+
91
+ def blog_url
92
+ 'http://redwriteshere.com'
93
+ end
94
+
95
+ end
data/lib/text/cv.txt ADDED
@@ -0,0 +1,12 @@
1
+ Red Davis
2
+ Location: Bath, UK
3
+ Email: reddavis@gmail.com
4
+ Phone: 07515353733
5
+
6
+ Projects: http://github.com/reddavis
7
+ Blog: http://redwriteshere.com
8
+
9
+ Work Experience:
10
+ Green Thing
11
+ http://dothegreenthing.com
12
+ Lead Developer
data/red_davis.gemspec ADDED
@@ -0,0 +1,62 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{red_davis}
8
+ s.version = "0.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["reddavis"]
12
+ s.date = %q{2010-02-07}
13
+ s.description = %q{My CV}
14
+ s.email = %q{reddavis@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/red_davis.rb",
27
+ "lib/text/cv.txt",
28
+ "red_davis.gemspec",
29
+ "spec/red_davis_spec.rb",
30
+ "spec/spec.opts",
31
+ "spec/spec_helper.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/reddavis/CV}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.5}
37
+ s.summary = %q{My CV}
38
+ s.test_files = [
39
+ "spec/red_davis_spec.rb",
40
+ "spec/spec_helper.rb"
41
+ ]
42
+
43
+ if s.respond_to? :specification_version then
44
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
45
+ s.specification_version = 3
46
+
47
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
48
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
49
+ s.add_runtime_dependency(%q<pony>, [">= 0"])
50
+ s.add_runtime_dependency(%q<json>, [">= 0"])
51
+ else
52
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
53
+ s.add_dependency(%q<pony>, [">= 0"])
54
+ s.add_dependency(%q<json>, [">= 0"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
58
+ s.add_dependency(%q<pony>, [">= 0"])
59
+ s.add_dependency(%q<json>, [">= 0"])
60
+ end
61
+ end
62
+
@@ -0,0 +1,78 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "RedDavis" do
4
+ before(:all) do
5
+ @reddavis = RedDavis.new
6
+ end
7
+
8
+ describe "Blog" do
9
+ it "should return http://redwriteshere" do
10
+ @reddavis.should_receive(:system)
11
+ @reddavis.blog
12
+ end
13
+ end
14
+
15
+ describe "Location" do
16
+ it "should be a hash" do
17
+ @reddavis.location.should be_a(Hash)
18
+ end
19
+ end
20
+
21
+ describe "Contact Details" do
22
+ it "should be a hash" do
23
+ @reddavis.contact_details.should be_a(Hash)
24
+ end
25
+ end
26
+
27
+ describe "Project taken off github" do
28
+ it "should query github and return a hash" do
29
+ Net::HTTP.should_receive(:get).and_return(json)
30
+ @reddavis.projects.should be_a(Hash)
31
+ end
32
+ end
33
+
34
+ describe "Send a hired email" do
35
+ it "should send the email" do
36
+ Pony.should_receive(:mail)
37
+ @reddavis.hired!(:from => 'supercoolcompany@us.com', :subject => 'we like you!', :body => 'hey')
38
+ end
39
+
40
+ it "should raise an error" do
41
+ lambda do
42
+ @reddavis.hired!
43
+ end.should raise_error
44
+ end
45
+ end
46
+
47
+ describe "Share the CV" do
48
+ it "should send to 2 people" do
49
+ Pony.should_receive(:mail).twice
50
+ @reddavis.share_with('me', 'reddavis@gmail.com', 'red@dothegreenthing.com')
51
+ end
52
+ end
53
+
54
+ describe "Print" do
55
+ it "should print cv" do
56
+ $stdout = StringIO.new
57
+ @reddavis.print
58
+
59
+ $stdout.string.should match(/Lead Developer$/)
60
+ end
61
+ end
62
+
63
+ describe "Work experience" do
64
+ it "should return a hash" do
65
+ @reddavis.work_experience.should be_a(Hash)
66
+ end
67
+ end
68
+
69
+ describe "Interests" do
70
+ it "should return an array" do
71
+ @reddavis.interested_in.should be_a(Array)
72
+ end
73
+ end
74
+
75
+ def json
76
+ %{{"name": "repo_name"}}
77
+ end
78
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,10 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'rubygems'
4
+ require 'red_davis'
5
+ require 'spec'
6
+ require 'spec/autorun'
7
+
8
+ Spec::Runner.configure do |config|
9
+
10
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: red_davis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - reddavis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-02-07 00:00:00 +00:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.9
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: pony
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: json
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ description: My CV
46
+ email: reddavis@gmail.com
47
+ executables: []
48
+
49
+ extensions: []
50
+
51
+ extra_rdoc_files:
52
+ - LICENSE
53
+ - README.rdoc
54
+ files:
55
+ - .document
56
+ - .gitignore
57
+ - LICENSE
58
+ - README.rdoc
59
+ - Rakefile
60
+ - VERSION
61
+ - lib/red_davis.rb
62
+ - lib/text/cv.txt
63
+ - red_davis.gemspec
64
+ - spec/red_davis_spec.rb
65
+ - spec/spec.opts
66
+ - spec/spec_helper.rb
67
+ has_rdoc: true
68
+ homepage: http://github.com/reddavis/CV
69
+ licenses: []
70
+
71
+ post_install_message:
72
+ rdoc_options:
73
+ - --charset=UTF-8
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: "0"
81
+ version:
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: "0"
87
+ version:
88
+ requirements: []
89
+
90
+ rubyforge_project:
91
+ rubygems_version: 1.3.5
92
+ signing_key:
93
+ specification_version: 3
94
+ summary: My CV
95
+ test_files:
96
+ - spec/red_davis_spec.rb
97
+ - spec/spec_helper.rb