bcaparser 0.1.1 → 0.1.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 +4 -4
- data/bin/bcaparser +1 -1
- data/lib/bcaparser/account.rb +0 -2
- data/lib/bcaparser/parser.rb +4 -6
- data/lib/bcaparser/regex_check.rb +0 -3
- data/lib/bcaparser/time_keeper.rb +2 -10
- metadata +1 -2
- data/lib/bcaparser/transaction.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e21be959f6eda94841d101b1e37b7c5e6c797b0a
|
4
|
+
data.tar.gz: cbf0981a9225e598a0d40f54b7a6e122f39fc057
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd7ddeeb8403435038b824f76010a865dd685009007e3f358d96df2f325c83ab5a5b0ab9e3aa71fff0da0b3856b46e51c7fd9192bf9f949e39eb5f887838ba11
|
7
|
+
data.tar.gz: 1155bf27052b743f3dfcf6909850ea04eaee00abd736c177d8e586c5efe2695401a473bca57faf807642ee9b7de3744d92716a58d8cb5385fc39a90aa59bb6c1
|
data/bin/bcaparser
CHANGED
@@ -18,7 +18,7 @@ class Main < Thor
|
|
18
18
|
parser.close
|
19
19
|
end
|
20
20
|
|
21
|
-
desc "cek_mutasi_harian", "
|
21
|
+
desc "cek_mutasi_harian", "cek_username password"
|
22
22
|
def cek_mutasi_harian(*parameters)
|
23
23
|
start_day, start_month, end_day, end_month, output, print_format, filename = nil
|
24
24
|
loop do
|
data/lib/bcaparser/account.rb
CHANGED
data/lib/bcaparser/parser.rb
CHANGED
@@ -4,8 +4,6 @@ require 'csv'
|
|
4
4
|
require 'spreadsheet'
|
5
5
|
require_relative 'time_keeper'
|
6
6
|
require_relative 'account'
|
7
|
-
require_relative 'transaction'
|
8
|
-
|
9
7
|
|
10
8
|
module BcaParser
|
11
9
|
class Parser
|
@@ -161,14 +159,14 @@ module BcaParser
|
|
161
159
|
|
162
160
|
|
163
161
|
def saveDataToCSV(filename)
|
164
|
-
CSV.open(File.join(
|
162
|
+
CSV.open(File.join(Dir.pwd, "#{filename}.csv"), "w") do |csv|
|
165
163
|
csv << ["Tanggal", "Informasi", "Jumlah", "Jenis Mutasi", "Saldo"]
|
166
164
|
@account.transactions.each do |transaction|
|
167
165
|
next if transaction[:date].nil?
|
168
166
|
csv << [transaction[:date], transaction[:info], transaction[:amount], transaction[:type], transaction[:balance]]
|
169
167
|
end
|
170
168
|
end
|
171
|
-
puts "#{filename}.csv has been saved"
|
169
|
+
puts "#{filename}.csv has been saved to #{Dir.pwd}"
|
172
170
|
end
|
173
171
|
|
174
172
|
def saveDataToSpreadsheet(filename)
|
@@ -181,8 +179,8 @@ module BcaParser
|
|
181
179
|
sheet1.row(count).replace [transaction[:date], transaction[:info], transaction[:amount], transaction[:type], transaction[:balance]]
|
182
180
|
count += 1
|
183
181
|
end
|
184
|
-
book.write(File.join(
|
185
|
-
puts "#{filename}.xls has been saved"
|
182
|
+
book.write(File.join(Dir.pwd, "#{filename}.xls"))
|
183
|
+
puts "#{filename}.xls has been saved to #{Dir.pwd}"
|
186
184
|
end
|
187
185
|
|
188
186
|
end
|
@@ -12,8 +12,6 @@ module BcaParser
|
|
12
12
|
[month - 2, month - 1]
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
15
|
def self.checkMonthForBalance(month)
|
18
16
|
month = month.to_i
|
19
17
|
now_month = Time.now.month
|
@@ -25,8 +23,6 @@ module BcaParser
|
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
28
|
-
|
29
|
-
|
30
26
|
def self.checkDateForBalance(start_date, start_month, end_date, end_month)
|
31
27
|
start_day = TimeKeeper.makeDateFromString(start_date, start_month, Time.now.year)
|
32
28
|
end_day = TimeKeeper.makeDateFromString(end_date, end_month, Time.now.year)
|
@@ -98,7 +94,7 @@ module BcaParser
|
|
98
94
|
when 10
|
99
95
|
'Oktober'
|
100
96
|
when 11
|
101
|
-
'
|
97
|
+
'Nopember'
|
102
98
|
when 12
|
103
99
|
'Desember'
|
104
100
|
end
|
@@ -128,8 +124,4 @@ module BcaParser
|
|
128
124
|
|
129
125
|
end
|
130
126
|
end
|
131
|
-
end
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
127
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcaparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alfian Losari
|
@@ -102,7 +102,6 @@ files:
|
|
102
102
|
- lib/bcaparser/parser.rb
|
103
103
|
- lib/bcaparser/regex_check.rb
|
104
104
|
- lib/bcaparser/time_keeper.rb
|
105
|
-
- lib/bcaparser/transaction.rb
|
106
105
|
- spec/regex_check_spec.rb
|
107
106
|
- spec/time_keeper_spec.rb
|
108
107
|
homepage: https://www.linkedin.com/pub/alfian-lo/48/579/943
|