cashflow 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/Rakefile +1 -1
- data/lib/cashflow/cli.rb +1 -1
- data/lib/cashflow/version.rb +1 -1
- data/lib/cashflow.rb +4 -1
- metadata +2 -3
- data/db/.gitkeep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d210d93eb390fa23ea7f01df90370c205bc33d
|
4
|
+
data.tar.gz: ad8df9cff209c08540e4c9ac630ae5f35890e602
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e603219f3177f595928136a92bd665d09a90044cd51059c4341459dddfee358f959a055d32cea4d56ffd9ab96f11b4166cc177d53c5533a88491641ef25e14
|
7
|
+
data.tar.gz: b1137ac647b1b4c02e5432146ecc4617a8a68c4df01ed7bb92a8322fad1302e99abcbda79cf592a3b9bbb665b344da596baeb1539dac4ceea68c092463c00076
|
data/.gitignore
CHANGED
data/Rakefile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
data/lib/cashflow/cli.rb
CHANGED
@@ -19,7 +19,7 @@ module Cashflow
|
|
19
19
|
option :day, :type => :numeric, :aliases => "-d"
|
20
20
|
def report
|
21
21
|
# Normalize the options.
|
22
|
-
months_span = options[:span]
|
22
|
+
months_span = options[:span] > 0 ? options[:span] : 4
|
23
23
|
if options[:day] && options[:day] <= Date.today.day && options[:day] > 0
|
24
24
|
day_of_month = options[:day]
|
25
25
|
elsif options[:day] && options[:day] <= 0
|
data/lib/cashflow/version.rb
CHANGED
data/lib/cashflow.rb
CHANGED
@@ -33,7 +33,7 @@ module Cashflow
|
|
33
33
|
def self.db
|
34
34
|
@db ||= begin
|
35
35
|
# Initialize the database. Create the table if necessary.
|
36
|
-
db = SQLite3::Database.new(File.
|
36
|
+
db = SQLite3::Database.new(File.expand_path('~/.cashflow/cashflow.db'))
|
37
37
|
db.execute("CREATE TABLE IF NOT EXISTS #{table_name} (id string primary key, type varchar(6), amount integer, date date);")
|
38
38
|
# Return the database connection.
|
39
39
|
db
|
@@ -47,3 +47,6 @@ module Cashflow
|
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
50
|
+
|
51
|
+
# Ensure cashflow is in the home directory.
|
52
|
+
FileUtils.mkdir_p(File.expand_path('~/.cashflow'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cashflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Fulcher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,7 +111,6 @@ files:
|
|
111
111
|
- Rakefile
|
112
112
|
- bin/cashflow
|
113
113
|
- cashflow.gemspec
|
114
|
-
- db/.gitkeep
|
115
114
|
- lib/cashflow.rb
|
116
115
|
- lib/cashflow/cli.rb
|
117
116
|
- lib/cashflow/patches.rb
|
data/db/.gitkeep
DELETED
File without changes
|