ledger_web 1.4.7 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -67,7 +67,7 @@ This says that every value in the `Account` column will be surrounded with an `<
67
67
 
68
68
  #### Customizing
69
69
 
70
- Any ruby files in `~/.ledger_web/lib` will be loaded at startup so you can define your own classes, modules, whatever you want. In addition, you can put [Sequel migrations](http://sequel.rubyforge.org/rdoc/files/doc/migration_rdoc.html) in `~/.ledger_web/migrate` and they'll get applied as necessary at startup.
70
+ You can put [Sequel migrations](http://sequel.rubyforge.org/rdoc/files/doc/migration_rdoc.html) in `~/.ledger_web/migrate` and they'll get applied as necessary at startup.
71
71
 
72
72
  #### Hooks
73
73
 
data/lib/ledger_web.rb CHANGED
@@ -8,14 +8,3 @@ require 'ledger_web/report'
8
8
  require 'ledger_web/watcher'
9
9
  require 'ledger_web/helpers'
10
10
  require 'ledger_web/app'
11
-
12
-
13
- ledger_web_dir = "#{ENV['HOME']}/.ledger_web"
14
-
15
- if File.directory? ledger_web_dir
16
- if File.directory? File.join(ledger_web_dir, "lib")
17
- Dir.glob(File.join(ledger_web_dir, "lib", "*.rb")).each do |f|
18
- require f
19
- end
20
- end
21
- end
@@ -69,6 +69,14 @@ module LedgerWeb
69
69
  self.set :report_directories, dirs
70
70
  end
71
71
 
72
+ if File.directory? "#{user_dir}/migrate"
73
+ self.set :user_migrate_dir, "#{user_dir}/migrate"
74
+ end
75
+
76
+ if File.directory? "#{user_dir}/reports"
77
+ self.set :user_reports_dir, "#{user_dir}/reports"
78
+ end
79
+
72
80
  if File.exists? "#{user_dir}/config.rb"
73
81
  self.override_with(LedgerWeb::Config.from_file("#{user_dir}/config.rb"))
74
82
  end
data/lib/ledger_web/db.rb CHANGED
@@ -22,9 +22,9 @@ module LedgerWeb
22
22
  def self.run_migrations
23
23
  Sequel::Migrator.apply(@@db, File.join(File.dirname(__FILE__), "db/migrate"))
24
24
 
25
- home_migrations = File.join(ENV['HOME'], '.ledger_web', 'migrate')
26
- if LedgerWeb::Config.should_load_user_config && File.directory?(home_migrations)
27
- Sequel::Migrator.run(@@db, home_migrations, :table => "user_schema_changes")
25
+ user_migrations = LedgerWeb::Config.instance.get :user_migrate_directory
26
+ if not user_migrations.nil?
27
+ Sequel::Migrator.run(@@db, user_migrations, :table => "user_schema_changes")
28
28
  end
29
29
  end
30
30
 
@@ -174,7 +174,7 @@ end
174
174
  def find_all_reports
175
175
  directories = [
176
176
  File.join(File.dirname(__FILE__), "reports"),
177
- File.join(ENV['HOME'], ".ledger_web", "reports")
177
+ LedgerWeb::Config.instance.get :user_report_dir
178
178
  ]
179
179
 
180
180
  reports = {}
@@ -1,3 +1,3 @@
1
1
  module LedgerWeb
2
- VERSION = '1.4.7'
2
+ VERSION = '1.4.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: