interactive_brokers_2_tasty_works 0.1.0 → 0.2.0
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 +2 -2
- data/README.md +5 -1
- data/bin/ib2tw +25 -0
- data/interactive_brokers_2_tasty_works.gemspec +2 -2
- data/lib/interactive_brokers_2_tasty_works.rb +2 -0
- data/lib/interactive_brokers_2_tasty_works/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5da3529ee36a231a2ae0f886d9fffca70210ee0f8c6c4e1253942fefaa77a2d
|
4
|
+
data.tar.gz: 98f28bcc63d0bc1ea929d610cc59c130e2d5b4a87023cad08a9b6c3ca73223e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23d68aea06ed3f7a252101294e72b8a7566723b819430c5a28a98c1a093b90f2bbadfc5224878ca3509e618b4b4181220e0ce0c93a95311bb08cd2e159828e6f
|
7
|
+
data.tar.gz: d2ebf3afeff29dc2e9b0300b61bc756674bb1740d407539ad9a8d5ef824b4debb122a0e41f91d1fe7d2749ce347b5d9b3d1173ee5de6abcb6ab4042accd4e3d3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -26,7 +26,11 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
$ gem install interactive_brokers_2_tasty_works
|
28
28
|
|
29
|
-
## Usage
|
29
|
+
## Command Line Usage
|
30
|
+
|
31
|
+
`ib2tw /path/to/input.xml /path/to/output.csv`
|
32
|
+
|
33
|
+
## Programatic Usage
|
30
34
|
|
31
35
|
`InteractiveBrokers2TastyWorks.new(input_path: '~/trades.xml').save_as("/tmp/trades.csv")`
|
32
36
|
|
data/bin/ib2tw
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative '../lib/interactive_brokers_2_tasty_works'
|
4
|
+
|
5
|
+
if ARGV[0].nil? || ARGV[1].nil? || ARGV[0].include?('--help') || ARGV[0].include?('-?')
|
6
|
+
puts "\nUsage: ./ib2tw /path/to/input.xml /path/to/output.csv\n\n"
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
input_file = File.expand_path(ARGV[0])
|
11
|
+
output_file = File.expand_path(ARGV[1])
|
12
|
+
|
13
|
+
unless File.exists?(input_file)
|
14
|
+
puts "\nFile not found: #{input_file}\n\n"
|
15
|
+
exit 1
|
16
|
+
end
|
17
|
+
|
18
|
+
puts "\n"
|
19
|
+
puts "Input: #{input_file}"
|
20
|
+
puts "Output: #{output_file}\n"
|
21
|
+
puts "Converting..."
|
22
|
+
|
23
|
+
InteractiveBrokers2TastyWorks.new(input_path: input_file).save_as(output_file)
|
24
|
+
|
25
|
+
puts "Done!"
|
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
21
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
22
|
end
|
23
|
-
|
24
|
-
spec.executables =
|
23
|
+
|
24
|
+
spec.executables = ["ib2tw"]
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.16"
|
@@ -31,6 +31,8 @@ class InteractiveBrokers2TastyWorks
|
|
31
31
|
file_format = file_format.to_s.to_sym unless file_format.is_a?(Symbol)
|
32
32
|
raise ArgumentError.new("Unknown file format: #{file_format}") unless %i(xml json).include?(file_format)
|
33
33
|
end
|
34
|
+
|
35
|
+
Time.zone ||= Time.now.getlocal.zone
|
34
36
|
end
|
35
37
|
|
36
38
|
def save_as(output_path)
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interactive_brokers_2_tasty_works
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Mercier
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -97,7 +97,8 @@ dependencies:
|
|
97
97
|
description: Interactive Brokers to Tasty Works trade statement converter
|
98
98
|
email:
|
99
99
|
- foss@carlmercier.com
|
100
|
-
executables:
|
100
|
+
executables:
|
101
|
+
- ib2tw
|
101
102
|
extensions: []
|
102
103
|
extra_rdoc_files: []
|
103
104
|
files:
|
@@ -111,6 +112,7 @@ files:
|
|
111
112
|
- README.md
|
112
113
|
- Rakefile
|
113
114
|
- bin/console
|
115
|
+
- bin/ib2tw
|
114
116
|
- bin/setup
|
115
117
|
- interactive_brokers_2_tasty_works.gemspec
|
116
118
|
- lib/interactive_brokers_2_tasty_works.rb
|