crunchbase 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,37 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
-
3
- module Crunchbase
4
- describe Company do
5
-
6
- it "should pull from web api" do
7
- company = Company.get("facebook")
8
- company.name.should == "Facebook"
9
- end
10
-
11
- it "should find companies by name" do
12
- company = Company.find("Adobe Systems")
13
- company.permalink.should == "adobe-systems"
14
- end
15
-
16
- it "should return date for founded" do
17
- company = Company.new({"founded_year" => 2004, "founded_month" => 2,
18
- "founded_day" => 1, "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
19
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007"})
20
- company.founded.should === Date.new(2004, 2, 1)
21
- end
22
-
23
- it "should return date for deadpooled" do
24
- company = Company.new({"deadpooled_year" => 2004, "deadpooled_month" => 2,
25
- "deadpooled_day" => 1, "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
26
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007"})
27
- company.deadpooled.should === Date.new(2004, 2, 1)
28
- end
29
-
30
- it "should get a complete list" do
31
- all_companies = Company.all
32
- all_companies[0].entity.name.should == all_companies[0].name
33
- end
34
-
35
-
36
- end
37
- end
@@ -1,29 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
-
3
- module Crunchbase
4
- describe FinancialOrganization do
5
-
6
- it "should pull from web api" do
7
- finorg = FinancialOrganization.get("robin-hood-ventures")
8
- finorg.name.should == "Robin Hood Ventures"
9
- end
10
-
11
- it "should find by name" do
12
- f = FinancialOrganization.find("Accel Partners")
13
- f.permalink.should == "accel-partners"
14
- end
15
-
16
- it "should return date for founded" do
17
- finorg = FinancialOrganization.new({"founded_year" => 2004, "founded_month" => 2,
18
- "founded_day" => 1, "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
19
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007"})
20
- finorg.founded.should === Date.new(2004, 2, 1)
21
- end
22
-
23
- it "should get a complete list" do
24
- all_fins = FinancialOrganization.all
25
- all_fins[0].entity.name.should == all_fins[0].name
26
- end
27
-
28
- end
29
- end
@@ -1,82 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
- require 'json'
3
-
4
- module Crunchbase
5
- describe Person do
6
-
7
- before(:all) do
8
- @steve = File.open(File.join(File.dirname(__FILE__), "..", "fixtures", "steve-jobs.js"))
9
- @brad = File.open(File.join(File.dirname(__FILE__), "..", "fixtures", "brad-fitzpatrick.js"))
10
- end
11
-
12
- before(:each) do
13
- @steve.rewind
14
- @brad.rewind
15
- end
16
-
17
- it "should ask for JSON object" do
18
- API.should_receive(:single_entity).with("brad-fitzpatrick", "person").and_return(JSON.parse(@brad.read))
19
- person = Person.get("brad-fitzpatrick")
20
- end
21
-
22
- it "should get information from supplied file" do
23
- API.should_receive(:single_entity).with("steve-jobs", "person").and_return(JSON.parse(@steve.read))
24
- person = Person.get("steve-jobs")
25
- person.first_name.should == "Steve"
26
-
27
- API.should_receive(:single_entity).with("brad-fitzpatrick", "person").and_return(JSON.parse(@brad.read))
28
- person = Person.get("brad-fitzpatrick")
29
- person.first_name.should == "Brad"
30
- end
31
-
32
- it "should return a date for born" do
33
- person = Person.new(JSON.parse(@steve.read))
34
- date = Date.new(1955, 2, 24)
35
- person.born.should === date
36
- end
37
-
38
- it "should return nil when birthday is unavailable" do
39
- person = Person.new({
40
- "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
41
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007"})
42
- person.born.should be_nil
43
- end
44
-
45
- it "should get an array of tags" do
46
- person = Person.new({"tag_list" => "computers, technology",
47
- "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
48
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007"})
49
- person.tags.should == ["computers", "technology"]
50
- end
51
-
52
- it "should return empty array for null tags" do
53
- person = Person.new({"tag_list" => nil,
54
- "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
55
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007"})
56
- person.tags.should == []
57
- end
58
-
59
- it "should get from web" do
60
- person = Person.get("steve-jobs")
61
- person.first_name.should == "Steve"
62
- end
63
-
64
- it "should find a person by name" do
65
- person = Person.find("Steve", "Jobs")
66
- person.permalink.should == "steve-jobs"
67
- end
68
-
69
- it "should be equal to another with the same permalink and last updated" do
70
- person = Person.get("steve-jobs")
71
- person2 = Person.get("steve-jobs")
72
- person.should === person2
73
- end
74
-
75
- it "should get a complete list" do
76
- all_people = Person.all
77
- all_people[0].entity.first_name.should == all_people[0].first_name
78
- all_people[0].entity.last_name.should == all_people[0].last_name
79
- end
80
-
81
- end
82
- end
@@ -1,35 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
-
3
- module Crunchbase
4
- describe Product do
5
-
6
- it "should pull from web api" do
7
- product = Product.get("iphone")
8
- product.name.should == "iPhone"
9
- end
10
-
11
- it "should find by name" do
12
- product = Product.find("iPhone")
13
- product.permalink.should == "iphone"
14
- end
15
-
16
- it "should return date for launched" do
17
- product = Product.new({"launched_year" => 2004, "launched_month" => 2,
18
- "launched_day" => 1, "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
19
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007", "company" => {}})
20
- product.launched.should === Date.new(2004, 2, 1)
21
- end
22
-
23
- it "should return date for deadpooled" do
24
- product = Product.new({"deadpooled_year" => 2004, "deadpooled_month" => 2,
25
- "deadpooled_day" => 1, "created_at" => "Sat Dec 22 08:42:28 UTC 2007",
26
- "updated_at" => "Sat Dec 22 08:42:28 UTC 2007", "company" => {}})
27
- product.deadpooled.should === Date.new(2004, 2, 1)
28
- end
29
-
30
- it "should get a complete list" do
31
- all_products = Product.all
32
- all_products[0].entity.name.should == all_products[0].name
33
- end
34
- end
35
- end
@@ -1,16 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
- require 'net/http'
3
-
4
- module Crunchbase
5
- describe SearchResult do
6
-
7
- before(:all) do
8
- @result = Search.find('google')[0]
9
- end
10
-
11
- it "should return the entity which is named" do
12
- @result.name.should == @result.entity.name
13
- end
14
-
15
- end
16
- end
@@ -1,65 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
- require 'net/http'
3
-
4
- module Crunchbase
5
- describe Search do
6
-
7
- it "should retrieve search results" do
8
- s = Search.find('google')
9
- s[0].class.should == SearchResult
10
- end
11
-
12
- describe "advanced indexing" do
13
- before(:all) do
14
- @s = Search.find('google')
15
- end
16
-
17
- it "should return slices with ranges" do
18
- slice = @s[8..11]
19
- slice.class.should == Array
20
- slice[0].class.should == SearchResult
21
- end
22
-
23
- it "should return abbreviated slice for range with upper out of range" do
24
- slice = @s[@s.size-3..@s.size+2]
25
- slice.length.should == 3
26
- end
27
-
28
- it "should return nil for slice out of range" do
29
- slice = @s[@s.size..@s.size+4]
30
- slice.should == nil
31
- end
32
-
33
- it "should slice with two arguments" do
34
- start = @s.size / 3
35
- slice = @s[start, 5]
36
- slice.length.should == 5
37
- slice[0].class.should == SearchResult
38
- end
39
-
40
- it "should slice with negative start" do
41
- slice = @s[-12, 4]
42
- slice.length.should == 4
43
- slice[0].class.should == SearchResult
44
- end
45
-
46
- end #Indexing
47
-
48
- it "should accept negative indices" do
49
- s = Search.find('google')
50
- s[-13].should == s[s.size-13]
51
- s[-13].class.should == SearchResult
52
- end
53
-
54
- it "should return higher search results" do
55
- s = Search.find('google')
56
- s[s.size/2].class.should == SearchResult
57
- end
58
-
59
- it "should return nil for array out of bounds" do
60
- s = Search.find('google')
61
- s[s.size].should be_nil
62
- end
63
-
64
- end
65
- end
@@ -1,22 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
2
-
3
- module Crunchbase
4
- describe ServiceProvider do
5
-
6
- it "should pull from web api" do
7
- sp = ServiceProvider.get("fox-rothschild")
8
- sp.name.should == "Fox Rothschild"
9
- end
10
-
11
- it "should find by name" do
12
- sp = ServiceProvider.find("Fox Rothschild")
13
- sp.permalink.should == "fox-rothschild"
14
- end
15
-
16
- it "should get a complete list" do
17
- all_sps = ServiceProvider.all
18
- all_sps[0].entity.name.should == all_sps[0].name
19
- end
20
-
21
- end
22
- end
@@ -1,70 +0,0 @@
1
- {"first_name": "Brad",
2
- "last_name": "Fitzpatrick",
3
- "permalink": "brad-fitzpatrick",
4
- "crunchbase_url": "http://www.crunchbase.com/person/brad-fitzpatrick",
5
- "homepage_url": "http://bradfitz.com",
6
- "birthplace": "Iowa",
7
- "twitter_username": null,
8
- "blog_url": "http://brad.livejournal.com",
9
- "blog_feed_url": "http://brad.livejournal.com/data/rss",
10
- "affiliation_name": "LiveJournal",
11
- "born_year": 1980,
12
- "born_month": 2,
13
- "born_day": 5,
14
- "tag_list": "",
15
- "alias_list": null,
16
- "created_at": "Sun Dec 09 14:29:02 UTC 2007",
17
- "updated_at": "Wed Feb 02 19:23:16 UTC 2011",
18
- "overview": "\u003Cp\u003EBrad Fitzpatrick originated the \u003Ca href=\"http://www.crunchbase.com/product/openid\" title=\"OpenID\"\u003EOpenID\u003C/a\u003E protocol in 2005 while working at \u003Ca href=\"http://www.crunchbase.com/company/six+apart\" title=\"Six Apart\"\u003ESix Apart\u003C/a\u003E, which he started in 1999.\u003C/p\u003E\n\n\u003Cp\u003EHe\u0026#8217;s also known creating memcached, MogileFS (a GFS-like filesystem), djabberd (a Jabber server), Gearman (and RPC balancer), and other open source backend software.\u003C/p\u003E\n\n\u003Cp\u003EHe now works at Google.\u003C/p\u003E",
19
- "image":
20
- {"available_sizes":
21
- [[[112,
22
- 150],
23
- "assets/images/resized/0001/6259/16259v3-max-150x150.jpg"],
24
- [[188,
25
- 250],
26
- "assets/images/resized/0001/6259/16259v3-max-250x250.jpg"],
27
- [[188,
28
- 250],
29
- "assets/images/resized/0001/6259/16259v3-max-450x450.jpg"]],
30
- "attribution": ""},
31
- "degrees":
32
- [],
33
- "relationships":
34
- [{"is_past": true,
35
- "title": "Founder",
36
- "firm":
37
- {"name": "LiveJournal",
38
- "permalink": "livejournal",
39
- "type_of_entity": "company"}},
40
- {"is_past": false,
41
- "title": "",
42
- "firm":
43
- {"name": "Google",
44
- "permalink": "google",
45
- "type_of_entity": "company"}},
46
- {"is_past": true,
47
- "title": "",
48
- "firm":
49
- {"name": "OpenID Foundation",
50
- "permalink": "openid-foundation",
51
- "type_of_entity": "company"}},
52
- {"is_past": true,
53
- "title": "",
54
- "firm":
55
- {"name": "Six Apart",
56
- "permalink": "six-apart",
57
- "type_of_entity": "company"}}],
58
- "investments":
59
- [],
60
- "milestones":
61
- [],
62
- "video_embeds":
63
- [],
64
- "external_links":
65
- [],
66
- "web_presences":
67
- [{"external_url": "http://en.wikipedia.org/wiki/Brad_Fitzpatrick",
68
- "title": "Wikipedia"},
69
- {"external_url": "http://www.linkedin.com/in/bradfitz",
70
- "title": "Linkedin"}]}
@@ -1,178 +0,0 @@
1
- {"name": "CarGurus",
2
- "permalink": "cargurus",
3
- "crunchbase_url": "http://www.crunchbase.com/company/cargurus",
4
- "homepage_url": "http://www.cargurus.com",
5
- "blog_url": "http://www.cargurus.com/blog/",
6
- "blog_feed_url": "http://www.cargurus.com/blog/feed/",
7
- "twitter_username": "CarGurus",
8
- "category_code": "web",
9
- "number_of_employees": 18,
10
- "founded_year": 2006,
11
- "founded_month": null,
12
- "founded_day": null,
13
- "deadpooled_year": null,
14
- "deadpooled_month": null,
15
- "deadpooled_day": null,
16
- "deadpooled_url": null,
17
- "tag_list": "",
18
- "alias_list": null,
19
- "email_address": "",
20
- "phone_number": "617-234-5502",
21
- "description": "",
22
- "created_at": "Sun Feb 17 02:26:00 UTC 2008",
23
- "updated_at": "Fri May 25 02:37:33 UTC 2012",
24
- "overview": "\u003Cp\u003EA comparison shopping site for automobiles that uses proprietary pricing algorithms to analyze millions of new and used car listings to help consumers find the best deals and avoid bad deals in their local area. Users share information, including reviews of dealers, mechanics, and cars and advice on other car topics.\u003C/p\u003E",
25
- "image":
26
- {"available_sizes":
27
- [[[150,
28
- 38],
29
- "assets/images/resized/0002/2167/22167v1-max-150x150.png"],
30
- [[250,
31
- 64],
32
- "assets/images/resized/0002/2167/22167v1-max-250x250.png"],
33
- [[257,
34
- 66],
35
- "assets/images/resized/0002/2167/22167v1-max-450x450.png"]],
36
- "attribution": null},
37
- "products":
38
- [],
39
- "relationships":
40
- [{"is_past": false,
41
- "title": "CEO",
42
- "person":
43
- {"first_name": "Langley",
44
- "last_name": "Steinert",
45
- "permalink": "langley-steinert-2",
46
- "image": null}},
47
- {"is_past": false,
48
- "title": "Vice President, Business Development",
49
- "person":
50
- {"first_name": "Martha",
51
- "last_name": "(Marty) Blue",
52
- "permalink": "martha-marty-blue",
53
- "image": null}},
54
- {"is_past": false,
55
- "title": "VP of Technology",
56
- "person":
57
- {"first_name": "Oliver",
58
- "last_name": "Chrzan",
59
- "permalink": "oliver-chrzan",
60
- "image": null}},
61
- {"is_past": false,
62
- "title": "Senior Architect",
63
- "person":
64
- {"first_name": "Jasper",
65
- "last_name": "Rosenberg",
66
- "permalink": "jasper-rosenberg",
67
- "image": null}},
68
- {"is_past": false,
69
- "title": "Software Engineer",
70
- "person":
71
- {"first_name": "Steve",
72
- "last_name": "Wollkind",
73
- "permalink": "steve-wollkind",
74
- "image": null}},
75
- {"is_past": false,
76
- "title": "Senior Architect",
77
- "person":
78
- {"first_name": "Igor",
79
- "last_name": "Kaplansky",
80
- "permalink": "igor-kaplansky",
81
- "image": null}},
82
- {"is_past": false,
83
- "title": "Manager of Public Relations",
84
- "person":
85
- {"first_name": "Amy",
86
- "last_name": "Mueller",
87
- "permalink": "amy-mueller-2",
88
- "image": null}},
89
- {"is_past": true,
90
- "title": "CTO",
91
- "person":
92
- {"first_name": "Nicholas",
93
- "last_name": "Shanny",
94
- "permalink": "nicholas-shanny",
95
- "image": null}},
96
- {"is_past": true,
97
- "title": "Senior Architect",
98
- "person":
99
- {"first_name": "Yoav",
100
- "last_name": "Shapira",
101
- "permalink": "yoav-shapira",
102
- "image":
103
- {"available_sizes":
104
- [[[100,
105
- 100],
106
- "assets/images/resized/0001/2524/12524v1-max-150x150.jpg"],
107
- [[100,
108
- 100],
109
- "assets/images/resized/0001/2524/12524v1-max-250x250.jpg"],
110
- [[100,
111
- 100],
112
- "assets/images/resized/0001/2524/12524v1-max-450x450.jpg"]],
113
- "attribution": null}}}],
114
- "competitions":
115
- [],
116
- "providerships":
117
- [],
118
- "total_money_raised": "$0",
119
- "funding_rounds":
120
- [],
121
- "investments":
122
- [],
123
- "acquisition": null,
124
- "acquisitions":
125
- [],
126
- "offices":
127
- [{"description": "Boston Office",
128
- "address1": "138 Mount Auburn Street",
129
- "address2": "",
130
- "zip_code": "02138",
131
- "city": "Cambridge",
132
- "state_code": "MA",
133
- "country_code": "USA",
134
- "latitude": 42.373182,
135
- "longitude": -71.120786}],
136
- "milestones":
137
- [{"description": "Ranked 96th in Inc's 2011 list of the 500 fastest-growing private companies in the U.S.",
138
- "stoned_year": 2011,
139
- "stoned_month": null,
140
- "stoned_day": null,
141
- "source_url": "http://www.inc.com/inc5000/profile/cargurus",
142
- "source_text": null,
143
- "source_description": "2011 Inc 500",
144
- "stoneable_type": "Company",
145
- "stoned_value": null,
146
- "stoned_value_type": null,
147
- "stoned_acquirer": null,
148
- "stoneable":
149
- {"name": "CarGurus",
150
- "permalink": "cargurus"}}],
151
- "ipo": null,
152
- "video_embeds":
153
- [],
154
- "screenshots":
155
- [{"available_sizes":
156
- [[[150,
157
- 141],
158
- "assets/images/resized/0019/0758/190758v2-max-150x150.png"],
159
- [[250,
160
- 236],
161
- "assets/images/resized/0019/0758/190758v2-max-250x250.png"],
162
- [[450,
163
- 425],
164
- "assets/images/resized/0019/0758/190758v2-max-450x450.png"]],
165
- "attribution": null},
166
- {"available_sizes":
167
- [[[150,
168
- 114],
169
- "assets/images/resized/0019/0759/190759v2-max-150x150.png"],
170
- [[250,
171
- 190],
172
- "assets/images/resized/0019/0759/190759v2-max-250x250.png"],
173
- [[450,
174
- 343],
175
- "assets/images/resized/0019/0759/190759v2-max-450x450.png"]],
176
- "attribution": null}],
177
- "external_links":
178
- []}