startupstats 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/startupstats/countdb/counts.rb +10 -1
- data/lib/startupstats/version.rb +1 -1
- data/spec/countdb/counts_spec.rb +11 -0
- data/spec/formd/filings_spec.rb +1 -0
- metadata +2 -2
@@ -80,13 +80,22 @@ module StartupStats
|
|
80
80
|
|
81
81
|
# Deletes all counts for a key
|
82
82
|
#
|
83
|
-
# @raise [StartupStats::Error::ParamsError]
|
84
83
|
# @param key [String]
|
85
84
|
# return [Boolean]
|
86
85
|
def delete_counts( key )
|
87
86
|
res = send( :delete , "counts" , { 'key' => key , 'db_id' => @db_id } )
|
88
87
|
( res[:status] == 200 )
|
89
88
|
end
|
89
|
+
|
90
|
+
# Updates all keys to a new key
|
91
|
+
#
|
92
|
+
# @param orig_key [String]
|
93
|
+
# @param new_key
|
94
|
+
# return [Boolean]
|
95
|
+
def update_key( orig_key , new_key )
|
96
|
+
res = send( :put , "counts/#{orig_key}" , { 'count' => { 'key' => "#{new_key}" } , 'db_id' => @db_id } )
|
97
|
+
( res[:status] == 200 )
|
98
|
+
end
|
90
99
|
end
|
91
100
|
end
|
92
101
|
end
|
data/lib/startupstats/version.rb
CHANGED
data/spec/countdb/counts_spec.rb
CHANGED
@@ -132,5 +132,16 @@ describe StartupStats::Countdb::Counts do
|
|
132
132
|
@client.delete_counts( 'instagram.com' ).should eq true
|
133
133
|
end
|
134
134
|
end
|
135
|
+
|
136
|
+
describe "#update_key" do
|
137
|
+
it "calls request with put to counts/:key" do
|
138
|
+
@client.should_receive(:request).with( :put , 'counts/Instagram.com' , { 'count' => { 'key' => 'instagram.com' }, 'db_id' => anything } ).and_return( { status: 200 } )
|
139
|
+
@client.update_key( 'Instagram.com' , 'instagram.com' )
|
140
|
+
end
|
141
|
+
|
142
|
+
it "returns true" do
|
143
|
+
@client.update_key( 'Instagram.com' , 'instagram.com' ).should be_true
|
144
|
+
end
|
145
|
+
end
|
135
146
|
end
|
136
147
|
end
|
data/spec/formd/filings_spec.rb
CHANGED
@@ -37,6 +37,7 @@ describe StartupStats::Formd::Filings do
|
|
37
37
|
filings = client.filings_with_count( start = 0 , limit = 5 , industry = nil )
|
38
38
|
expect(filings).to be_a StartupStats::ApiResult
|
39
39
|
expect(filings.total_count).to be > 0
|
40
|
+
expect(filings.filings).to be_a Array
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: startupstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|