bcaparser 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 7c8df37de62bff5b8d655f8790f349e82d5780de
4
- data.tar.gz: 288a2e19dbe323f9e711b30c2e133f1aaa44dfdb
3
+ metadata.gz: e21be959f6eda94841d101b1e37b7c5e6c797b0a
4
+ data.tar.gz: cbf0981a9225e598a0d40f54b7a6e122f39fc057
5
5
  SHA512:
6
- metadata.gz: cf2ca29a47d881aecd6d5eec6e51376d6d6407f8032da801130867198250ed62d8010fb4c379302ac397e9e85238904db3f7146258814c93502a9cd188415fc3
7
- data.tar.gz: 35e3e7973a59f9ee77950270b1e1b5022efdc100820f0208e548940d7d6c91e01de27d3617a415c7383c6579cc536b3e28d9cf69d51bb792e992f372b98fbafb
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", "cek_mutasi_harian username password"
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
@@ -1,5 +1,3 @@
1
- require_relative 'transaction'
2
-
3
1
  module BcaParser
4
2
  class Account
5
3
  attr_reader :name, :id, :balance, :transactions
@@ -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(File.dirname(__FILE__), "#{filename}.csv"), "w") do |csv|
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(File.dirname(__FILE__), "#{filename}.xls"))
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
@@ -17,9 +17,6 @@ module BcaParser
17
17
  month =~ MONTHREG ? true : false
18
18
  end
19
19
 
20
-
21
-
22
-
23
20
  end
24
21
  end
25
22
 
@@ -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
- 'November'
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.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
@@ -1,11 +0,0 @@
1
- class Transaction
2
- attr_reader :date, :info, :amount, :type
3
-
4
- def initialize(date, info, amount, type)
5
- @date = date
6
- @info = info
7
- @amount = amount
8
- @type = type
9
- end
10
-
11
- end