interactive_brokers_2_tasty_works 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b245c8dbf681690ee8b3745c2022c3557d1d2778672c671eb544f14509c5d0c
4
- data.tar.gz: c262fe44d913342bd1ed89bdf0105d80d1174d4f25b3ba755af068e69656de36
3
+ metadata.gz: f5da3529ee36a231a2ae0f886d9fffca70210ee0f8c6c4e1253942fefaa77a2d
4
+ data.tar.gz: 98f28bcc63d0bc1ea929d610cc59c130e2d5b4a87023cad08a9b6c3ca73223e7
5
5
  SHA512:
6
- metadata.gz: 1807f7d098975769600ba3e584abe3866015421b365792f87da87d20375371a6033d5c7440b8c1a44176fd2b709868191b00c8b03b98cf7ef931ddbe0735d5e1
7
- data.tar.gz: f6f2eb90a239c8083ac4d52bcb2a9c26a6ef8c15a5c2bc8f1ecc9df086bb99bbbe7ddfefd25b63c2fa234096b355aab446eb0aaa0538fde8e9b05e08f41870b3
6
+ metadata.gz: 23d68aea06ed3f7a252101294e72b8a7566723b819430c5a28a98c1a093b90f2bbadfc5224878ca3509e618b4b4181220e0ce0c93a95311bb08cd2e159828e6f
7
+ data.tar.gz: d2ebf3afeff29dc2e9b0300b61bc756674bb1740d407539ad9a8d5ef824b4debb122a0e41f91d1fe7d2749ce347b5d9b3d1173ee5de6abcb6ab4042accd4e3d3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- interactive_brokers_2_tasty_works (0.1.0)
4
+ interactive_brokers_2_tasty_works (0.2.0)
5
5
  activesupport
6
6
  xmlhasher
7
7
 
@@ -53,4 +53,4 @@ DEPENDENCIES
53
53
  rspec (~> 3.0)
54
54
 
55
55
  BUNDLED WITH
56
- 1.16.4
56
+ 1.17.1
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
 
@@ -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
- spec.bindir = "exe"
24
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
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)
@@ -1,3 +1,3 @@
1
1
  class InteractiveBrokers2TastyWorks
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Mercier
8
8
  autorequire:
9
- bindir: exe
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