ydim 1.0.4 → 1.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 878732dac4f51ff26346c7392d8241feb891cf28
4
- data.tar.gz: dccb435ce281b6174843f75530288557d45c30f3
3
+ metadata.gz: ec2b1bd1d980024b40189832831326166a908c42
4
+ data.tar.gz: 02d904fd678e0e801c16cef5f2c96a88c87ff6e9
5
5
  SHA512:
6
- metadata.gz: 84c88d7a0921fec44fbed80751e077a26138b2d8260251a83aaf3ae5e7a2418eebd96b7187d7a1af228557fa4f44eded00848c80927e787fca94fcd68dad886f
7
- data.tar.gz: 2cfe94ce46a6dcba53096d3a596b54fe1067ac5dae6d2d110292921228779c63a3814ab6dcb0327ec8a3b2cdb3ffbe183768e65255360fdc9bc116e76db5a3b0
6
+ metadata.gz: 38a217974af3e9b5127c95c34bcec04681aac241481bd8a7524d1cbc88c476e996ad47f7839acfca0cfea7b555af1157b8abe3531a7ac51b5232b7b54e2a55e3
7
+ data.tar.gz: cd853964aeaa71cffdf8ff274ccc85a6e1b5c9c4c2e97ae3a470e7388f7ee0572c9dcaa9e277238d678ede9274bd7b7e7233575578cfc183b849347d5b6bc495
@@ -1,3 +1,7 @@
1
+ === 1.0.5 / 08.03.2017
2
+
3
+ * Fixed loading bin/ydimd
4
+
1
5
  === 1.0.4 / 08.03.2017
2
6
 
3
7
  * Using mail gem instead of rmail. Updated tests.
@@ -1,17 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'ydim/server' # to pick up the configuration
3
+ require 'ydim/server_config' # to pick up the configuration
4
4
  require 'mail'
5
5
 
6
6
  module YDIM
7
7
  module Mail
8
+ config = YDIM::Server.config
8
9
  ::Mail.defaults do
9
10
  delivery_method :smtp, {
10
- :address => Server.config.smtp_server,
11
- :port => Server.config.smtp_port,
12
- :domain => Server.config.smtp_domain,
13
- :user_name => Server.config.smtp_user,
14
- :password => Server.config.smtp_pass,
11
+ :address => config.smtp_server,
12
+ :port => config.smtp_port,
13
+ :domain => config.smtp_domain,
14
+ :user_name => config.smtp_user,
15
+ :password => config.smtp_pass,
15
16
  }
16
17
  end
17
18
  def Mail.body(config, debitor, invoice)
@@ -3,6 +3,7 @@
3
3
  # YDIM::Server -- ydim -- 09.12.2011 -- mhatakeyama@ywesee.com
4
4
  # YDIM::Server -- ydim -- 10.01.2006 -- hwyss@ywesee.com
5
5
 
6
+ require 'ydim/server_config'
6
7
  require 'logger'
7
8
  require 'needle'
8
9
  require 'odba/id_server'
@@ -18,55 +19,7 @@ require 'odba/18_19_loading_compatibility'
18
19
 
19
20
  module YDIM
20
21
  class Server
21
- ydim_default_dir = File.join(ENV['HOME'], '.ydim')
22
- default_config_files = [
23
- File.join(ydim_default_dir, 'ydimd.yml'),
24
- '/etc/ydim/ydimd.yml',
25
- ]
26
- defaults = {
27
- 'autoinvoice_hour' => 1,
28
- 'config' => default_config_files,
29
- 'conf_dir' => File.join(ydim_default_dir, 'conf'),
30
- 'currencies' => ['CHF', 'EUR', 'USD'],
31
- 'currency_update_hour' => 2,
32
- 'data_dir' => File.join(ydim_default_dir, 'data'),
33
- 'server_url' => 'druby://localhost:12375',
34
- 'db_driver_url' => 'DBI:Pg:ydim',
35
- 'db_user' => 'ydim',
36
- 'db_auth' => '',
37
- 'detach' => false,
38
- 'home_country' => 'Schweiz',
39
- 'invoice_number_start' => 10000,
40
- 'log_level' => 'INFO',
41
- 'log_file' => STDOUT,
42
- 'mail_body' => "%s %s\n%s",
43
- 'mail_charset' => 'iso-8859-1',
44
- 'mail_from' => '',
45
- 'mail_recipients' => [],
46
- 'root_name' => 'Root',
47
- 'root_email' => '',
48
- 'root_key' => 'root_dsa',
49
- 'salutation' => {
50
- '' => 'Sehr geehrter Herr',
51
- 'Herr' => 'Sehr geehrter Herr',
52
- 'Frau' => 'Sehr geehrte Frau',
53
- },
54
- 'smtp_from' => '',
55
- 'smtp_authtype' => :plain,
56
- 'smtp_domain' => 'ywesee.com',
57
- 'smtp_pass' => nil,
58
- 'smtp_port' => 587,
59
- 'smtp_server' => 'localhost',
60
- 'smtp_user' => 'ydim@ywesee.com',
61
- 'vat_rate' => 8.0,
62
- }
63
- config = RCLConf::RCLConf.new(ARGV, defaults)
64
- config.load(config.config)
65
- CONFIG = config
66
22
  SECONDS_IN_DAY = 24*60*60
67
- def Server.config
68
- CONFIG
69
- end
70
23
  def initialize(config, logger)
71
24
  @serv = Needle::Registry.new
72
25
  @serv.register(:auth_server) {
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+ # YDIM::Server -- ydim -- 09.12.2011 -- mhatakeyama@ywesee.com
4
+ # YDIM::Server -- ydim -- 10.01.2006 -- hwyss@ywesee.com
5
+
6
+ require 'rclconf'
7
+
8
+ module YDIM
9
+ class Server
10
+ ydim_default_dir = File.join(ENV['HOME'], '.ydim')
11
+ default_config_files = [
12
+ File.join(ydim_default_dir, 'ydimd.yml'),
13
+ '/etc/ydim/ydimd.yml',
14
+ ]
15
+ defaults = {
16
+ 'autoinvoice_hour' => 1,
17
+ 'config' => default_config_files,
18
+ 'conf_dir' => File.join(ydim_default_dir, 'conf'),
19
+ 'currencies' => ['CHF', 'EUR', 'USD'],
20
+ 'currency_update_hour' => 2,
21
+ 'data_dir' => File.join(ydim_default_dir, 'data'),
22
+ 'server_url' => 'druby://localhost:12375',
23
+ 'db_driver_url' => 'DBI:Pg:ydim',
24
+ 'db_user' => 'ydim',
25
+ 'db_auth' => '',
26
+ 'detach' => false,
27
+ 'home_country' => 'Schweiz',
28
+ 'invoice_number_start' => 10000,
29
+ 'log_level' => 'INFO',
30
+ 'log_file' => STDOUT,
31
+ 'mail_body' => "%s %s\n%s",
32
+ 'mail_charset' => 'iso-8859-1',
33
+ 'mail_from' => '',
34
+ 'mail_recipients' => [],
35
+ 'root_name' => 'Root',
36
+ 'root_email' => '',
37
+ 'root_key' => 'root_dsa',
38
+ 'salutation' => {
39
+ '' => 'Sehr geehrter Herr',
40
+ 'Herr' => 'Sehr geehrter Herr',
41
+ 'Frau' => 'Sehr geehrte Frau',
42
+ },
43
+ 'smtp_from' => '',
44
+ 'smtp_authtype' => :plain,
45
+ 'smtp_domain' => 'ywesee.com',
46
+ 'smtp_pass' => nil,
47
+ 'smtp_port' => 587,
48
+ 'smtp_server' => 'localhost',
49
+ 'smtp_user' => 'ydim@ywesee.com',
50
+ 'vat_rate' => 8.0,
51
+ }
52
+ CONFIG = RCLConf::RCLConf.new(ARGV, defaults)
53
+ def Server.config
54
+ CONFIG
55
+ end
56
+ end
57
+ end
@@ -1,3 +1,3 @@
1
1
  module YDIM
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ydim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger
@@ -300,6 +300,7 @@ files:
300
300
  - lib/ydim/root_session.rb
301
301
  - lib/ydim/root_user.rb
302
302
  - lib/ydim/server.rb
303
+ - lib/ydim/server_config.rb
303
304
  - lib/ydim/util.rb
304
305
  - lib/ydim/version.rb
305
306
  - lib/ydim/ydim-edit