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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 107cc67b642f951260cc80eac4ee26dc91019d8c
4
- data.tar.gz: 456365241263c8ef910fe7fe05cea8a7e79bcaf7
3
+ metadata.gz: d2d210d93eb390fa23ea7f01df90370c205bc33d
4
+ data.tar.gz: ad8df9cff209c08540e4c9ac630ae5f35890e602
5
5
  SHA512:
6
- metadata.gz: 16c878c53075f8ea22e660b2ac6db3b8069a057d78ff2574d02fa3e24090d256c28afa56440fad16db4c4571a3d59a53800b33b62ec81e2e734669b3a7258aa0
7
- data.tar.gz: d1921429cf9a762ea6ac6b43442167a0416fd51c8b355ea0362a77a0486a5fdeb43a441354085ce61604b82b60e40936c118bc38714d2c35f03c0d29f46c7df6
6
+ metadata.gz: 54e603219f3177f595928136a92bd665d09a90044cd51059c4341459dddfee358f959a055d32cea4d56ffd9ab96f11b4166cc177d53c5533a88491641ef25e14
7
+ data.tar.gz: b1137ac647b1b4c02e5432146ecc4617a8a68c4df01ed7bb92a8322fad1302e99abcbda79cf592a3b9bbb665b344da596baeb1539dac4ceea68c092463c00076
data/.gitignore CHANGED
@@ -15,5 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
- TODO
19
- db/cashflow.db
18
+ TODO
data/Rakefile CHANGED
@@ -1 +1 @@
1
- require "bundler/gem_tasks"
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
@@ -1,3 +1,3 @@
1
1
  module Cashflow
2
- VERSION = "0.0.5".freeze
2
+ VERSION = "0.0.6".freeze
3
3
  end
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.join(root, 'db/cashflow.db'))
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.5
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 00:00:00.000000000 Z
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