schwab_rb 0.9.0 → 0.9.2
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: 04505f39521ec9ea419c4a0a0a90000758ecd2b2ee112fb49f0a3557004b3d21
|
|
4
|
+
data.tar.gz: 8fbdaf07886c79942573a3e1b3249a6be66ae7c3fdc6b9be23161d50c450f0df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21580fbeb51a9d336dd0913eeb51048fb718c02c79f63dbd509fa3a02262e531ad012cd6ac0a9f05f0eacf7ac3c7f34d6f4404ddbf24b52c4bb5fcfdb8eef4bf
|
|
7
|
+
data.tar.gz: 30277381c65d9ffaf180d3ef6e579c47f0b53fc12356652a0a982ea6a42acc8f26c5238ef819fe5b720fb079ca574254861bd5ac7a6c47aaafc7ed46245f6311
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### Fixed
|
|
4
|
+
- CLI `login` no longer reads from `ARGF` at the browser prompt, which prevented `schwab_rb login` from opening the browser when command arguments were present
|
|
5
|
+
- `OptionExpirationChain` now accepts both string-keyed and symbol-keyed hashes, matching `BaseClient#get_option_expiration_chain`
|
|
6
|
+
|
|
3
7
|
### Added
|
|
4
8
|
- CLI `sample` command for saving single-expiration option chain snapshots as CSV or JSON
|
|
5
9
|
- `--root` option for filtering sampled contracts by option root and using that root in output filenames
|
|
@@ -70,6 +70,7 @@ module SchwabRb
|
|
|
70
70
|
enforce_enums: false,
|
|
71
71
|
callback_timeout: 300.0,
|
|
72
72
|
interactive: true,
|
|
73
|
+
input: $stdin,
|
|
73
74
|
requested_browser: nil
|
|
74
75
|
)
|
|
75
76
|
token_path = SchwabRb::PathSupport.expand_path(token_path)
|
|
@@ -130,7 +131,7 @@ module SchwabRb
|
|
|
130
131
|
|
|
131
132
|
if interactive
|
|
132
133
|
puts "Press ENTER to open the browser..."
|
|
133
|
-
gets
|
|
134
|
+
input.gets
|
|
134
135
|
end
|
|
135
136
|
|
|
136
137
|
open_browser(requested_browser, auth_context.authorization_url)
|
|
@@ -12,8 +12,8 @@ module SchwabRb
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def initialize(data)
|
|
15
|
-
@expiration_list = data
|
|
16
|
-
@status = data
|
|
15
|
+
@expiration_list = Array(fetch_value(data, "expirationList")).map { |expiration_data| Expiration.new(expiration_data) }
|
|
16
|
+
@status = fetch_value(data, "status")
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def to_h
|
|
@@ -70,17 +70,25 @@ module SchwabRb
|
|
|
70
70
|
|
|
71
71
|
include Enumerable
|
|
72
72
|
|
|
73
|
+
private
|
|
74
|
+
|
|
75
|
+
def fetch_value(data, key)
|
|
76
|
+
data[key] || data[key.to_sym]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
public
|
|
80
|
+
|
|
73
81
|
class Expiration
|
|
74
82
|
attr_reader :expiration_date, :days_to_expiration, :expiration_type,
|
|
75
83
|
:settlement_type, :option_roots, :standard
|
|
76
84
|
|
|
77
85
|
def initialize(data)
|
|
78
|
-
@expiration_date = data
|
|
79
|
-
@days_to_expiration = data
|
|
80
|
-
@expiration_type = data
|
|
81
|
-
@settlement_type = data
|
|
82
|
-
@option_roots = data
|
|
83
|
-
@standard = data
|
|
86
|
+
@expiration_date = fetch_value(data, "expirationDate")
|
|
87
|
+
@days_to_expiration = fetch_value(data, "daysToExpiration")
|
|
88
|
+
@expiration_type = fetch_value(data, "expirationType")
|
|
89
|
+
@settlement_type = fetch_value(data, "settlementType")
|
|
90
|
+
@option_roots = fetch_value(data, "optionRoots")
|
|
91
|
+
@standard = fetch_value(data, "standard")
|
|
84
92
|
end
|
|
85
93
|
|
|
86
94
|
def to_h
|
|
@@ -129,6 +137,12 @@ module SchwabRb
|
|
|
129
137
|
def expires_tomorrow?
|
|
130
138
|
@days_to_expiration == 1
|
|
131
139
|
end
|
|
140
|
+
|
|
141
|
+
private
|
|
142
|
+
|
|
143
|
+
def fetch_value(data, key)
|
|
144
|
+
data[key] || data[key.to_sym]
|
|
145
|
+
end
|
|
132
146
|
end
|
|
133
147
|
end
|
|
134
148
|
end
|
data/lib/schwab_rb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: schwab_rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joseph Platta
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-04-
|
|
10
|
+
date: 2026-04-13 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: async
|