Module: Cashflow
- Defined in:
- lib/cashflow.rb,
lib/cashflow/cli.rb,
lib/cashflow/config.rb,
lib/cashflow/report.rb,
lib/cashflow/version.rb,
lib/cashflow/transaction.rb
Defined Under Namespace
Modules: Config
Classes: Cli, Report, Transaction
Constant Summary
collapse
- VERSION =
"0.1.3".freeze
Class Method Summary
collapse
Class Method Details
.create_database ⇒ Object
24
25
26
27
28
29
|
# File 'lib/cashflow.rb', line 24
def create_database
unless File.exists?(File.expand_path(Config.db_config[Config.env]['database']))
Rake::Task['db:create'].invoke
Rake::Task['db:schema:load'].invoke
end
end
|
.create_directory ⇒ Object
20
21
22
|
# File 'lib/cashflow.rb', line 20
def create_directory
FileUtils.mkdir_p(File.expand_path('~/.cashflow'))
end
|
.establish_connection ⇒ Object
31
32
33
|
# File 'lib/cashflow.rb', line 31
def establish_connection
::ActiveRecord::Base.establish_connection(Config.db_config[Config.env])
end
|