thirteen_f 0.5.7 → 0.5.8
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 +4 -4
- data/Gemfile.lock +4 -2
- data/lib/thirteen_f/cusip_securities.rb +5 -1
- data/lib/thirteen_f/position.rb +7 -7
- data/lib/thirteen_f/sec_request.rb +2 -0
- data/lib/thirteen_f/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9773a685a61e1713a417d4aef59fb58b211cfe7fea47800924c9db97d58a286
|
|
4
|
+
data.tar.gz: 1d1541d8f279d47fd98980755a975aaa3c48e621faa964d47970bc25b6b3ef4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80336d550bcb73bb1ef81675944b677e090ea1627c8cc0457ef49ea18b3d6c9dcaa2bc3749a5c6800694da2a1142a3668e8b69787b0134852e700f348c00e9d6
|
|
7
|
+
data.tar.gz: 3a5fe0414f07e6eb4848be4af5d109a5b34e79b479db433c68709c6081e1ce6f41186b9cecc883d2c394f717c008c5c46a5ccc74b4a35fd99927bdd40bc1de8b
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
thirteen_f (0.5.
|
|
4
|
+
thirteen_f (0.5.8)
|
|
5
5
|
http (>= 5.1)
|
|
6
6
|
nokogiri (>= 1.15)
|
|
7
7
|
pdf-reader (>= 2.11)
|
|
@@ -32,8 +32,10 @@ GEM
|
|
|
32
32
|
ffi-compiler (~> 1.0)
|
|
33
33
|
rake (~> 13.0)
|
|
34
34
|
method_source (1.0.0)
|
|
35
|
+
mini_portile2 (2.8.5)
|
|
35
36
|
minitest (5.20.0)
|
|
36
|
-
nokogiri (1.15.5
|
|
37
|
+
nokogiri (1.15.5)
|
|
38
|
+
mini_portile2 (~> 2.8.2)
|
|
37
39
|
racc (~> 1.4)
|
|
38
40
|
pdf-reader (2.11.0)
|
|
39
41
|
Ascii85 (~> 1.0)
|
|
@@ -37,7 +37,11 @@ class ThirteenF
|
|
|
37
37
|
|
|
38
38
|
def get_list_entries
|
|
39
39
|
return false unless file_location
|
|
40
|
-
io = URI.open
|
|
40
|
+
io = URI.open(
|
|
41
|
+
file_location,
|
|
42
|
+
'User-Agent' => "ThirteenF/v#{::ThirteenF::VERSION} (Open Source Ruby Gem) savannah.fischer@hey.com",
|
|
43
|
+
'Host' => 'www.sec.gov'
|
|
44
|
+
)
|
|
41
45
|
reader = PDF::Reader.new io
|
|
42
46
|
valid_entries = []
|
|
43
47
|
reader.pages[2..-1].each do |page|
|
data/lib/thirteen_f/position.rb
CHANGED
|
@@ -30,7 +30,7 @@ class ThirteenF
|
|
|
30
30
|
@cusip = info_table.search('cusip').text
|
|
31
31
|
@value_in_thousands = set_value_to_thousands info_table.search('value').text
|
|
32
32
|
@shares_or_principal_amount_type = info_table.search('sshPrnamtType').text
|
|
33
|
-
@shares_or_principal_amount =
|
|
33
|
+
@shares_or_principal_amount = to_float(info_table.search('sshPrnamt').text)
|
|
34
34
|
|
|
35
35
|
not_found = info_table.search('putCall').count == 0
|
|
36
36
|
@put_or_call = info_table.search('putCall').text unless not_found
|
|
@@ -38,9 +38,9 @@ class ThirteenF
|
|
|
38
38
|
@investment_discretion = info_table.search('investmentDiscretion').text
|
|
39
39
|
@other_managers = info_table.search('otherManager').text
|
|
40
40
|
@voting_authority = {
|
|
41
|
-
sole:
|
|
42
|
-
shared:
|
|
43
|
-
none:
|
|
41
|
+
sole: to_float(info_table.search('Sole').text),
|
|
42
|
+
shared: to_float(info_table.search('Shared').text),
|
|
43
|
+
none: to_float(info_table.search('None').text)
|
|
44
44
|
}
|
|
45
45
|
end
|
|
46
46
|
|
|
@@ -56,13 +56,13 @@ class ThirteenF
|
|
|
56
56
|
def set_value_to_thousands(text)
|
|
57
57
|
before_change = filing.time_accepted < Date.parse('2023-01-03')
|
|
58
58
|
if before_change
|
|
59
|
-
|
|
59
|
+
to_float(text)
|
|
60
60
|
else
|
|
61
|
-
|
|
61
|
+
to_float(text) / 1000
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
def
|
|
65
|
+
def to_float(text)
|
|
66
66
|
text.delete(',').to_f
|
|
67
67
|
end
|
|
68
68
|
end
|
|
@@ -33,6 +33,8 @@ class ThirteenF
|
|
|
33
33
|
response = HTTP.use(:auto_inflate).headers(www_headers).get(url)
|
|
34
34
|
handle_response response, response_type: response_type
|
|
35
35
|
end
|
|
36
|
+
rescue
|
|
37
|
+
raise "Request failed at this url: #{url} \n With this response #{response.to_s}"
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
def self.post(url, json)
|
data/lib/thirteen_f/version.rb
CHANGED