crawlab_ruby_sdk 0.2.1 → 0.2.3
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1208f555fcc371c6da946b5c8bbdc83641a52dbde68533fc00fa41f75569300b
|
4
|
+
data.tar.gz: 303aaf9afbe4d602c1c30f7cda1b4479f33868cc7caff3032bfad66e0b1800cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be214c103fe025cefb2c95f63a777633f164af57848b64c1ffbcd1648425023d1486906bd1637df7652d1edc91ef703705aa31a3e02dac0ac92e92122f0e8a40
|
7
|
+
data.tar.gz: ab4616543c95a265bcba4cc2671e54d456ae75dcb90e693d03fd5fca695ce1f7bbfe2076b2b1a5e95cf27ecd6f4fa51f58277650a8f8ba4f9a2179f6bed3241c
|
@@ -42,19 +42,23 @@ class OssServerClient
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def send(oss_path,file_path)
|
45
|
-
if bucket == nil || @oss_client == nil
|
45
|
+
if @bucket == nil || @oss_client == nil
|
46
46
|
return "bucket is nil"
|
47
47
|
end
|
48
|
-
bucket.put_object(oss_path, :file => file_path)
|
48
|
+
@bucket.put_object(oss_path, :file => file_path)
|
49
49
|
|
50
|
-
bucket_url = bucket.object_url(oss_path)
|
50
|
+
bucket_url = @bucket.object_url(oss_path)
|
51
51
|
return bucket_url
|
52
52
|
end
|
53
53
|
|
54
54
|
def send_stream(oss_path,stream)
|
55
|
-
bucket
|
55
|
+
if @bucket == nil || @oss_client == nil
|
56
|
+
return "bucket is nil"
|
57
|
+
end
|
58
|
+
|
59
|
+
@bucket.put_object(oss_path){ |a| a << stream }
|
56
60
|
|
57
|
-
bucket_url = bucket.object_url(oss_path)
|
61
|
+
bucket_url = @bucket.object_url(oss_path)
|
58
62
|
return bucket_url
|
59
63
|
end
|
60
64
|
end
|
data/lib/crawlab_ruby_sdk.rb
CHANGED
@@ -21,6 +21,7 @@ traverse_dir(dir+'/models')
|
|
21
21
|
traverse_dir(dir+'/models/thinktank_expert.rb')
|
22
22
|
traverse_dir(dir+'/models/thinktank_information.rb')
|
23
23
|
traverse_dir(dir+'/verify')
|
24
|
+
traverse_dir(dir+'/client/oss_server_client.rb')
|
24
25
|
|
25
26
|
module CrawlabRubySdk
|
26
27
|
class Error < StandardError; end
|
@@ -35,6 +35,9 @@ class ThinktankExpertReport < BaseModel
|
|
35
35
|
attr_accessor :sub_title
|
36
36
|
attr_accessor :timezone
|
37
37
|
attr_accessor :timezone_location
|
38
|
+
attr_accessor :related_authors
|
39
|
+
attr_accessor :related_author_names
|
40
|
+
attr_accessor :from_author_url
|
38
41
|
|
39
42
|
def self.table_name
|
40
43
|
return "thinktank_expert_reports"
|
@@ -79,6 +82,9 @@ class ThinktankExpertReport < BaseModel
|
|
79
82
|
@sub_title = options["sub_title"]
|
80
83
|
@timezone = options["timezone"]
|
81
84
|
@timezone_location = options["timezone_location"]
|
85
|
+
@related_authors = options["related_authors"]
|
86
|
+
@related_author_names = options["related_author_names"]
|
87
|
+
@from_author_url = options["from_author_url"]
|
82
88
|
end
|
83
89
|
|
84
90
|
def as_json
|
@@ -119,6 +125,9 @@ class ThinktankExpertReport < BaseModel
|
|
119
125
|
sub_title: @sub_title,
|
120
126
|
timezone: @timezone,
|
121
127
|
timezone_location: @timezone_location,
|
128
|
+
related_authors: @related_authors,
|
129
|
+
related_author_names: @related_author_names,
|
130
|
+
from_author_url: @from_author_url,
|
122
131
|
}
|
123
132
|
end
|
124
133
|
|
@@ -154,6 +163,8 @@ class ThinktankExpertReport < BaseModel
|
|
154
163
|
"authors"=> ["json", "fields:author_id,author_name,author_url", "string"],
|
155
164
|
"timezone"=> ["empty", 'regex:[\+|-]\d{4}', "string"],
|
156
165
|
"timezone_location"=> ["empty", "string"],
|
166
|
+
"from_author_url" => ["empty","string"],
|
167
|
+
"related_authors" => ["json","string"],
|
157
168
|
}
|
158
169
|
end
|
159
170
|
|
@@ -36,6 +36,8 @@ class ThinktankInformation < BaseModel
|
|
36
36
|
attr_accessor :sub_title
|
37
37
|
attr_accessor :timezone
|
38
38
|
attr_accessor :timezone_location
|
39
|
+
attr_accessor :related_authors
|
40
|
+
attr_accessor :related_author_names
|
39
41
|
|
40
42
|
def self.table_name
|
41
43
|
return "thinktank_informations"
|
@@ -82,6 +84,8 @@ class ThinktankInformation < BaseModel
|
|
82
84
|
@sub_title = options["sub_title"]
|
83
85
|
@timezone = options["timezone"]
|
84
86
|
@timezone_location = options["timezone_location"]
|
87
|
+
@related_authors = options["related_authors"]
|
88
|
+
@related_author_names = options["related_author_names"]
|
85
89
|
end
|
86
90
|
|
87
91
|
def as_json
|
@@ -122,7 +126,9 @@ class ThinktankInformation < BaseModel
|
|
122
126
|
authors: @authors,
|
123
127
|
sub_title: @sub_title,
|
124
128
|
timezone: @timezone,
|
125
|
-
timezone_location: @timezone_location
|
129
|
+
timezone_location: @timezone_location,
|
130
|
+
related_authors: @related_authors,
|
131
|
+
related_author_names: @related_author_names,
|
126
132
|
|
127
133
|
}
|
128
134
|
end
|
@@ -159,6 +165,7 @@ class ThinktankInformation < BaseModel
|
|
159
165
|
"authors"=> ["json", "fields:author_id,author_name,author_url", "string"],
|
160
166
|
"timezone"=> ["empty", 'regex:[\+|-]\d{4}', "string"],
|
161
167
|
"timezone_location"=> ["empty", "string"],
|
168
|
+
"related_authors" => ["json","string"],
|
162
169
|
}
|
163
170
|
end
|
164
171
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crawlab_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- min
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|