sourcescrub 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +73 -6
- data/lib/sourcescrub/client.rb +1 -1
- data/lib/sourcescrub/models.rb +1 -0
- data/lib/sourcescrub/models/concerns/company_items.rb +2 -2
- data/lib/sourcescrub/utils/request.rb +7 -2
- data/lib/sourcescrub/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 847e87ea8785f58f62705fb85098c4aaca5fe6bd07887a2f498009c46b404710
|
4
|
+
data.tar.gz: 23d25cb69ca12230ae30079d766d09d06ac6a2322f62cb937ce32db8ad0d723d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 350a941ef5e4b7d3c97e2056b0b45a93748321b8613912bc16ffc7e773d8e8199b7bc6209137923b331514daa7f0a61b8b367d78901e8a09e8b369a49fc6ae35
|
7
|
+
data.tar.gz: 1afa30a66e342346e2afed1e4e8d35d70b4d7e73ffe0862a49f26db4034865810311721f2e5a4f9fc22c44eb5ba467897c2ccd84183e9d1fbae82e2bf4964eb8
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -61,8 +61,7 @@ pry(main)> client.headers
|
|
61
61
|
|
62
62
|
```ruby
|
63
63
|
<!-- Company -->
|
64
|
-
response = client.
|
65
|
-
response = client.company_cards('ekohe.com', { card_id: 'sources' })
|
64
|
+
response = client.company('ekohe.com')
|
66
65
|
|
67
66
|
<!-- Get the JSON response of Company -->
|
68
67
|
|
@@ -74,8 +73,8 @@ response.as_json
|
|
74
73
|
#### Get the company data
|
75
74
|
|
76
75
|
```ruby
|
77
|
-
pry(main)> response = client.
|
78
|
-
|
76
|
+
pry(main)> response = client.company('ekohe.com')
|
77
|
+
=> #<Sourcescrub::Models::Company:0x00007f9e915161c0
|
79
78
|
@city="Xinzhuang",
|
80
79
|
@companyType="Private",
|
81
80
|
@country="China",
|
@@ -87,19 +86,87 @@ pry(main)> #<Sourcescrub::Models::Company:0x00007fcd31bcd238
|
|
87
86
|
"Ekohe, Ltd. is a cutting-edge web and mobile design and development agency. It specialize in digital strategy, innovative technology and user-centered design experiences from conceptualization to market launch.",
|
88
87
|
@domain="ekohe.com",
|
89
88
|
@facebook=nil,
|
89
|
+
=> #<Sourcescrub::Models::Company:0x00007f9e915161c0
|
90
|
+
@city="Xinzhuang",
|
91
|
+
@companyType="Private",
|
92
|
+
@country="China",
|
93
|
+
@crunchbase=nil,
|
94
|
+
@currentEmployeeCount=41,
|
95
|
+
@currentEmployeeRange="11-50",
|
96
|
+
@currentJobOpenings=0,
|
97
|
+
@description=
|
98
|
+
"Ekohe, Ltd. is a cutting-edge web and mobile design and development agency. It specialize in digital strategy, innovative technology and user-centered design experiences from conceptualization to market la
|
99
|
+
unch.",
|
100
|
+
@domain="ekohe.com",
|
101
|
+
@facebook=nil,
|
90
102
|
@firmTags=[],
|
91
103
|
@foundingYear=2007,
|
92
104
|
@id="LZ281NVD",
|
93
105
|
@informalName="Ekohe",
|
94
|
-
@investors=
|
106
|
+
@investors="",
|
95
107
|
@linkedIn="https://www.linkedin.com/company/ekohe",
|
96
108
|
@location="Xinzhuang, Shanghai Shi, China",
|
97
109
|
@name="Ekohe, Ltd.",
|
98
|
-
|
110
|
+
@parentCompanyDomain=nil,
|
111
|
+
@personalTags=[],
|
112
|
+
@phoneNumber="",
|
113
|
+
@postalCode=nil,
|
114
|
+
@specialties=
|
115
|
+
["IT & Startup Consulting",
|
116
|
+
"Ruby on Rails leaders",
|
117
|
+
"Intelligent Web & Mobile Development",
|
118
|
+
"Usable Web & Mobile design",
|
119
|
+
"UX or UI Design",
|
120
|
+
"Artificial Intelligence",
|
121
|
+
"Machine Learning",
|
122
|
+
"Data Sourcing",
|
123
|
+
"FinTech Tools"],
|
124
|
+
@state="Shanghai Shi",
|
125
|
+
@totalAmountInvested=0,
|
126
|
+
@twitter=nil,
|
127
|
+
@website="https://ekohe.com">
|
99
128
|
pry(main)> response.name
|
100
129
|
=> "Ekohe, Ltd."
|
101
130
|
pry(main)> response.domain
|
102
131
|
=> "ekohe.com"
|
132
|
+
pry(main)> response.as_json
|
133
|
+
=> {:id=>"LZ281NVD",
|
134
|
+
:companyType=>"Private",
|
135
|
+
:name=>"Ekohe, Ltd.",
|
136
|
+
:informalName=>"Ekohe",
|
137
|
+
:website=>"https://ekohe.com",
|
138
|
+
:domain=>"ekohe.com",
|
139
|
+
:description=>
|
140
|
+
"Ekohe, Ltd. is a cutting-edge web and mobile design and development agency. It specialize in digital strategy, innovative technology and user-centered design experiences from conceptualization to market launch.",
|
141
|
+
:foundingYear=>2007,
|
142
|
+
:location=>"Xinzhuang, Shanghai Shi, China",
|
143
|
+
:city=>"Xinzhuang",
|
144
|
+
:state=>"Shanghai Shi",
|
145
|
+
:postalCode=>nil,
|
146
|
+
:country=>"China",
|
147
|
+
:parentCompanyDomain=>nil,
|
148
|
+
:phoneNumber=>"",
|
149
|
+
:specialties=>
|
150
|
+
["IT & Startup Consulting",
|
151
|
+
"Ruby on Rails leaders",
|
152
|
+
"Intelligent Web & Mobile Development",
|
153
|
+
"Usable Web & Mobile design",
|
154
|
+
"UX or UI Design",
|
155
|
+
"Artificial Intelligence",
|
156
|
+
"Machine Learning",
|
157
|
+
"Data Sourcing",
|
158
|
+
"FinTech Tools"],
|
159
|
+
:facebook=>nil,
|
160
|
+
:twitter=>nil,
|
161
|
+
:crunchbase=>nil,
|
162
|
+
:linkedIn=>"https://www.linkedin.com/company/ekohe",
|
163
|
+
:totalAmountInvested=>0,
|
164
|
+
:currentEmployeeCount=>41,
|
165
|
+
:currentEmployeeRange=>"11-50",
|
166
|
+
:currentJobOpenings=>0,
|
167
|
+
:investors=>"",
|
168
|
+
:personalTags=>[],
|
169
|
+
:firmTags=>[]}
|
103
170
|
```
|
104
171
|
|
105
172
|
### Searches
|
data/lib/sourcescrub/client.rb
CHANGED
data/lib/sourcescrub/models.rb
CHANGED
@@ -17,8 +17,8 @@ module Sourcescrub
|
|
17
17
|
|
18
18
|
dynamic_define_method(self, 'domain', domain)
|
19
19
|
dynamic_define_method(self, 'type', kclass_name)
|
20
|
-
dynamic_define_method(self, 'total', response.dig(total_key))
|
21
|
-
dynamic_define_method(self, 'items', company_items(kclass_name, response.dig(items_key)))
|
20
|
+
dynamic_define_method(self, 'total', response.dig(total_key) || 0)
|
21
|
+
dynamic_define_method(self, 'items', company_items(kclass_name, response.dig(items_key) || []))
|
22
22
|
self
|
23
23
|
end
|
24
24
|
|
@@ -33,9 +33,14 @@ module Sourcescrub
|
|
33
33
|
faraday.response :logger, ::Logger.new(STDOUT), bodies: true if debug_mode?
|
34
34
|
end.get(uri, *args)
|
35
35
|
|
36
|
-
|
36
|
+
response_body = response.body
|
37
|
+
if response.status == 200
|
38
|
+
response_body = {} if response_body.is_a?(Array) && response_body.empty?
|
37
39
|
|
38
|
-
|
40
|
+
return response_body.merge('headers' => response.headers)
|
41
|
+
end
|
42
|
+
|
43
|
+
raise Error, response_body
|
39
44
|
end
|
40
45
|
|
41
46
|
# def put(uri, args)
|
data/lib/sourcescrub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sourcescrub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Encore Shao
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -143,7 +143,7 @@ metadata:
|
|
143
143
|
homepage_uri: https://github.com/ekohe/sourcescrub
|
144
144
|
source_code_uri: https://github.com/ekohe/sourcescrub
|
145
145
|
changelog_uri: https://github.com/ekohe/sourcescrub/blob/master/CHANGELOG.md
|
146
|
-
post_install_message:
|
146
|
+
post_install_message:
|
147
147
|
rdoc_options: []
|
148
148
|
require_paths:
|
149
149
|
- lib
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubygems_version: 3.0.3
|
162
|
-
signing_key:
|
162
|
+
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Sourcescrub is a ruby wrapper based on Source Scrub API.
|
165
165
|
test_files: []
|