ifin24-client 1.0.0 → 1.1.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.
- data/.idea/dictionaries/lucassus.xml +7 -0
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/ifin24 +1 -0
- data/lib/ifin24/commands/add_expense.rb +21 -21
- data/lib/ifin24/commands/list_limits.rb +5 -4
- metadata +19 -4
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/bin/ifin24
CHANGED
@@ -11,13 +11,13 @@ class Ifin24::Commands::AddExpense < Ifin24::Commands::Base
|
|
11
11
|
menu.index = :letter
|
12
12
|
menu.index_suffix = ") "
|
13
13
|
|
14
|
-
menu.choice("Nazwa: #{entry.title}") {
|
15
|
-
menu.choice("Data: #{entry.date}") {
|
16
|
-
menu.choice("Konto: #{entry.account.name}") {
|
17
|
-
menu.choice("Kategoria: #{entry.category_full_name}") {
|
18
|
-
menu.choice("Kwota: #{entry.amount}") {
|
19
|
-
menu.choice("Tagi: #{entry.tags}") {
|
20
|
-
menu.choice("Opis: #{entry.note}") {
|
14
|
+
menu.choice("Nazwa: #{entry.title}") { get_title_for(entry) }
|
15
|
+
menu.choice("Data: #{entry.date}") { get_date_for(entry) }
|
16
|
+
menu.choice("Konto: #{entry.account.name}") { get_account_for(entry) }
|
17
|
+
menu.choice("Kategoria: #{entry.category_full_name}") { get_category_for(entry) }
|
18
|
+
menu.choice("Kwota: #{entry.amount}") { get_amount_for(entry) }
|
19
|
+
menu.choice("Tagi: #{entry.tags}") { get_tags_for(entry) }
|
20
|
+
menu.choice("Opis: #{entry.note}") { get_note_for(entry) }
|
21
21
|
|
22
22
|
menu.choice("Powrót do głównego menu") do
|
23
23
|
throw :all_ok
|
@@ -38,29 +38,29 @@ class Ifin24::Commands::AddExpense < Ifin24::Commands::Base
|
|
38
38
|
def get_entry
|
39
39
|
entry = Ifin24::Models::Entry.new
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
get_title_for(entry)
|
42
|
+
get_date_for(entry)
|
43
|
+
get_account_for(entry)
|
44
|
+
get_category_for(entry)
|
45
|
+
get_amount_for(entry)
|
46
|
+
get_tags_for(entry)
|
47
|
+
get_note_for(entry)
|
48
48
|
|
49
49
|
return entry
|
50
50
|
end
|
51
51
|
|
52
|
-
def
|
52
|
+
def get_title_for(entry)
|
53
53
|
entry.title = ask('Nazwa: ')
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
56
|
+
def get_date_for(entry)
|
57
57
|
curr_date = Date.today
|
58
58
|
entry.date = ask('Data: ') do |q|
|
59
59
|
q.default = curr_date
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
def
|
63
|
+
def get_account_for(entry)
|
64
64
|
choose do |menu|
|
65
65
|
menu.prompt = 'Wybierz rachunek: '
|
66
66
|
|
@@ -72,7 +72,7 @@ class Ifin24::Commands::AddExpense < Ifin24::Commands::Base
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
def
|
75
|
+
def get_category_for(entry)
|
76
76
|
choose do |menu|
|
77
77
|
menu.prompt = 'Wybierz kategorię: '
|
78
78
|
|
@@ -94,15 +94,15 @@ class Ifin24::Commands::AddExpense < Ifin24::Commands::Base
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
def
|
97
|
+
def get_amount_for(entry)
|
98
98
|
entry.amount = eval ask('Kwota: ')
|
99
99
|
end
|
100
100
|
|
101
|
-
def
|
101
|
+
def get_tags_for(entry)
|
102
102
|
entry.tags = ask('Tagi: ')
|
103
103
|
end
|
104
104
|
|
105
|
-
def
|
105
|
+
def get_note_for(entry)
|
106
106
|
entry.note = ask('Opis: ')
|
107
107
|
end
|
108
108
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Ifin24::Commands::ListLimits < Ifin24::Commands::Base
|
4
|
-
|
4
|
+
LIMIT_BAR_SIZE = 50
|
5
5
|
|
6
6
|
def execute
|
7
7
|
limits = @client.fetch_limits
|
@@ -18,15 +18,16 @@ class Ifin24::Commands::ListLimits < Ifin24::Commands::Base
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def make_limit_bar(amount, max)
|
21
|
+
limit_exceeded = amount >= max
|
21
22
|
amount = [amount, max].min
|
22
|
-
taken = ((amount / max) *
|
23
|
+
taken = ((amount / max) * LIMIT_BAR_SIZE).to_i
|
23
24
|
|
24
25
|
bar = "["
|
25
26
|
taken.times do
|
26
|
-
bar << "#"
|
27
|
+
bar << "#".color(limit_exceeded ? :red : :green)
|
27
28
|
end
|
28
29
|
|
29
|
-
(
|
30
|
+
(LIMIT_BAR_SIZE - taken).times do
|
30
31
|
bar << "."
|
31
32
|
end
|
32
33
|
bar << "]"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ifin24-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.0
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "\xC5\x81ukasz Bandzarewicz"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-30 00:00:00 +02:00
|
19
19
|
default_executable: ifin24
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -74,6 +74,20 @@ dependencies:
|
|
74
74
|
version: "0"
|
75
75
|
type: :runtime
|
76
76
|
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: rainbow
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
type: :runtime
|
90
|
+
version_requirements: *id005
|
77
91
|
description: Console for iFIN24
|
78
92
|
email: lucassus@gmail.com
|
79
93
|
executables:
|
@@ -87,6 +101,7 @@ extra_rdoc_files:
|
|
87
101
|
files:
|
88
102
|
- .document
|
89
103
|
- .gitignore
|
104
|
+
- .idea/dictionaries/lucassus.xml
|
90
105
|
- LICENSE
|
91
106
|
- README
|
92
107
|
- README.rdoc
|