ydim 1.1.1 → 1.1.3

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
- SHA1:
3
- metadata.gz: 70d04b6ba7bb61d3eb310d9acba4c9faed12bb94
4
- data.tar.gz: eb85e935f2179e171af5ce157f68bf613256b794
2
+ SHA256:
3
+ metadata.gz: c254440df78cdec7a937bf535dac4ed7be344eb1256460fd11deb92fb03122ec
4
+ data.tar.gz: 1c1ed4f8b067219ffa102b22c9024d36e9cfff911398e16d3a63f1058b840a89
5
5
  SHA512:
6
- metadata.gz: b29399d8957eece7a4c87faabbfd0d88cfed316bbe73fc70458602096065ce2945ececc34da4a5e1bdd9d37a609e862c62f293acbd9ecbe257f3e813867c4821
7
- data.tar.gz: 97f0992c2f9ec3987669b8df83ce3847600a8bbd64c87f63a68969b59c71027c99f2b4c9337d10ce5c6b15e01bb0a7afbe232e51d101958d3887ea1dae01f062
6
+ metadata.gz: 148cb4f4583c6e89223ab142c5c44d079700b5101cb6bb4a7c80e903e4e49b32d2e1196d3572a4eded8b4cc33b02b2613ff5ca5dcbd0c4a5a9f50aefa79867b0
7
+ data.tar.gz: 9c7ac52fcf3b6b24818a328a31d3e9838fcae5ee748065710ef9d21bb1cc03c7b6a93ec1d1c20e6ad5f78abfa3e93bcb4ed56f861340fd9a1a6796ad6ee9c5a4
@@ -0,0 +1,31 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+ # see https://github.com/ruby/setup-ruby
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest]
23
+ ruby: [ '2.7', '3.0', '3.1', '3.2']
24
+ runs-on: ${{ matrix.os }}
25
+ steps:
26
+ - uses: actions/checkout@v3
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - run: bundle exec rake test
data/Rakefile CHANGED
@@ -2,19 +2,11 @@
2
2
  # encoding: utf-8
3
3
  lib = File.expand_path('../lib', __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'ydim/version'
6
5
  require "bundler/gem_tasks"
7
6
  require 'rspec/core/rake_task'
8
7
 
9
8
  RSpec::Core::RakeTask.new(:spec)
10
9
 
11
- # dependencies are now declared in ydim.gemspec
12
-
13
- desc 'Offer a gem task like hoe'
14
- task :gem => :build do
15
- Rake::Task[:build].invoke
16
- end
17
-
18
10
  task :spec => :clean
19
11
  require 'rake/testtask'
20
12
 
data/lib/ydim/server.rb CHANGED
@@ -3,7 +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
+ require_relative './server_config'
7
7
  require 'logger'
8
8
  require 'needle'
9
9
  require 'odba/id_server'
@@ -7,7 +7,7 @@ require 'rclconf'
7
7
 
8
8
  module YDIM
9
9
  class Server
10
- ydim_default_dir = File.join(ENV['HOME'], '.ydim')
10
+ ydim_default_dir = File.join(ENV['HOME'] ? ENV['HOME'] : '.', '.ydim')
11
11
  default_config_files = [
12
12
  File.join(ydim_default_dir, 'ydimd.yml'),
13
13
  '/etc/ydim/ydimd.yml',
data/lib/ydim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module YDIM
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.3'
3
3
  end
data/readme.md CHANGED
@@ -6,6 +6,28 @@
6
6
 
7
7
  ywesee distributed invoice manager, Ruby
8
8
 
9
+ ## Install Ruby
10
+
11
+ * git clone https://github.com/rbenv/rbenv.git ~/.rbenv
12
+ * echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
13
+ * git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
14
+
15
+ ## Install Postgresql
16
+ ```
17
+ * sudo apt-get install postgresql-10 postgresql-contrib-10
18
+ * wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
19
+ * sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/postgresql-pgdg.list > /dev/null
20
+ * sudo apt-get install postgresql-10
21
+ * sudo -u postgres psql -c 'create role ydim;'
22
+ * sudo su
23
+ * su - postgres
24
+ * dropdb ydim
25
+ * createdb ydim
26
+ * -> check DB
27
+ * psql
28
+ * \l
29
+ * bzcat 22:00-postgresql_database-ch_oddb-backup.bz2 | sudo -u postgres psql -p 5433 ydim
30
+ ```
9
31
  ## INSTALL:
10
32
 
11
33
  * gem install ydim
data/test/suite.rb CHANGED
@@ -7,7 +7,7 @@ SimpleCov.start :rails do
7
7
  add_filter do |src|
8
8
  src.filename =~ /vendo/
9
9
  end
10
- end
10
+ end if false # TODO: Why does the coverage fail ?
11
11
  Dir.foreach(File.dirname(__FILE__)) do |file|
12
12
  if /^test_.*\.rb$/o.match(file)
13
13
  require file
data/test/test_mail.rb CHANGED
@@ -69,10 +69,9 @@ module YDIM
69
69
  assert_equal(0, ::Mail::TestMailer.deliveries.size)
70
70
  Mail.send_invoice(setup_config, invoice)
71
71
  assert_equal(1, ::Mail::TestMailer.deliveries.size)
72
- assert_equal(" Sehr geehrter Herr Contact-Name\n" +
73
- " Description\n",
74
- ::Mail::TestMailer.deliveries.first.body.to_s)
75
72
  assert_equal('Rechnung Company-Name #12345, Description', ::Mail::TestMailer.deliveries.first.subject)
73
+ assert_match(/ Description/m, ::Mail::TestMailer.deliveries.first.body.parts.first.to_s)
74
+ assert_match(/ Sehr geehrter Herr Contact-Name/m, ::Mail::TestMailer.deliveries.first.body.parts.first.to_s)
76
75
  end
77
76
  def test_send_reminder
78
77
  debitor = flexmock('Debitor')
data/test/test_server.rb CHANGED
@@ -30,7 +30,7 @@ module YDIM
30
30
  @config.should_receive(:root_key).and_return { "root_dsa.pub" }
31
31
  @config.should_receive(:conf_dir).and_return { @datadir }
32
32
  filepath = File.join(@datadir, "root_dsa.pub")
33
- key = OpenSSL::PKey::DSA.new(8)
33
+ key = OpenSSL::PKey::DSA.new(1024)
34
34
  File.open(filepath, 'w') { |fh|
35
35
  fh.puts(key.public_key.to_s)
36
36
  }
@@ -53,7 +53,7 @@ module YDIM
53
53
  }
54
54
  @config.should_receive(:conf_dir).and_return { @datadir }
55
55
  filepath = File.join(@datadir, "absolute_dsa.pub")
56
- key = OpenSSL::PKey::DSA.new(8)
56
+ key = OpenSSL::PKey::DSA.new(1024)
57
57
  File.open(filepath, 'w') { |fh|
58
58
  fh.puts(key.public_key.to_s)
59
59
  }
@@ -68,7 +68,7 @@ module YDIM
68
68
  FileUtils.rm_r(@datadir) if File.exist?(@datadir)
69
69
  end
70
70
  def test_root_user__dump
71
- key = OpenSSL::PKey::DSA.new(8)
71
+ key = OpenSSL::PKey::DSA.new(1024)
72
72
  @config.should_receive(:root_name).and_return { 'Root' }
73
73
  @config.should_receive(:root_email).and_return { 'test@ywesee.com' }
74
74
  @config.should_receive(:root_key).and_return {
@@ -94,7 +94,7 @@ module YDIM
94
94
  @logger.should_receive(:error).and_return { |msg, block|
95
95
  error_messages << msg << "\n" }
96
96
  @logger.should_receive(:error).and_return { |msg, block| flunk(msg) }
97
- key = OpenSSL::PKey::DSA.new(8)
97
+ key = OpenSSL::PKey::DSA.new(1024)
98
98
  @config.should_receive(:root_name).and_return { 'Root' }
99
99
  @config.should_receive(:root_email).and_return { 'test@ywesee.com' }
100
100
  @config.should_receive(:root_key).and_return {
@@ -118,7 +118,7 @@ module YDIM
118
118
  info_messages << msg << "\n" }
119
119
  @logger.should_receive(:error).and_return { |msg, block|
120
120
  error_messages << msg << "\n" }
121
- key = OpenSSL::PKey::DSA.new(8)
121
+ key = OpenSSL::PKey::DSA.new(1024)
122
122
  @config.should_receive(:root_name).and_return { 'Root' }
123
123
  @config.should_receive(:root_email).and_return { 'test@ywesee.com' }
124
124
  @config.should_receive(:root_key).and_return {
data/ydim.gemspec CHANGED
@@ -17,6 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
+
21
+ spec.add_dependency 'net-smtp'
22
+ spec.add_dependency 'net-imap'
23
+ spec.add_dependency 'net-pop'
24
+ spec.add_dependency "rexml"
20
25
  spec.add_dependency "odba", '>= 1.1.2'
21
26
  spec.add_dependency "ydbd-pg", '>= 0.5.5'
22
27
  spec.add_dependency "ydbi", '>= 0.5.5'
@@ -27,6 +32,7 @@ Gem::Specification.new do |spec|
27
32
  spec.add_dependency "ypdf-writer"
28
33
  spec.add_dependency "rrba"
29
34
  spec.add_dependency "hpricot"
35
+ spec.add_dependency "pkg-config"
30
36
  spec.add_runtime_dependency 'deprecated', '= 2.0.1'
31
37
 
32
38
  spec.add_development_dependency "bundler"
metadata CHANGED
@@ -1,15 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ydim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-23 00:00:00.000000000 Z
11
+ date: 2023-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: net-smtp
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: net-imap
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: net-pop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rexml
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
13
69
  - !ruby/object:Gem::Dependency
14
70
  name: odba
15
71
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +206,20 @@ dependencies:
150
206
  - - ">="
151
207
  - !ruby/object:Gem::Version
152
208
  version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: pkg-config
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
153
223
  - !ruby/object:Gem::Dependency
154
224
  name: deprecated
155
225
  requirement: !ruby/object:Gem::Requirement
@@ -267,11 +337,11 @@ email: mhatakeyama@ywesee.com, zdavatz@ywesee.com, ngiger@ywesee.com
267
337
  executables:
268
338
  - ydim-edit
269
339
  - ydim-inject
270
- - ydimd
271
340
  extensions: []
272
341
  extra_rdoc_files: []
273
342
  files:
274
343
  - ".gitattributes"
344
+ - ".github/workflows/ruby.yml"
275
345
  - ".gitignore"
276
346
  - ".travis.yml"
277
347
  - Gemfile
@@ -281,7 +351,6 @@ files:
281
351
  - Rakefile
282
352
  - bin/ydim-edit
283
353
  - bin/ydim-inject
284
- - bin/ydimd
285
354
  - get_db_ydim
286
355
  - install.rb
287
356
  - lib/pdfinvoice/config.rb
@@ -345,8 +414,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
414
  - !ruby/object:Gem::Version
346
415
  version: '0'
347
416
  requirements: []
348
- rubyforge_project:
349
- rubygems_version: 2.6.8
417
+ rubygems_version: 3.4.1
350
418
  signing_key:
351
419
  specification_version: 4
352
420
  summary: ywesee distributed invoice manager
data/bin/ydimd DELETED
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env ruby231
2
- # ypdmd -- ydim -- 12.01.2005 -- hwyss@ywesee.com
3
-
4
- require 'yaml'
5
- require 'syck'
6
-
7
- require 'ydim/server'
8
- require 'ydim/odba'
9
- require 'logger'
10
- require 'rclconf'
11
- require 'drb'
12
- require 'fileutils'
13
- require 'odba/connection_pool'
14
- require 'odba/drbwrapper'
15
- require 'pg'
16
- require 'dbi'
17
- require 'dbi/version'
18
- require 'dbd/Pg'
19
-
20
- $0 = __FILE__
21
-
22
- config = YDIM::Server.config
23
- config.load(config.config)
24
-
25
- ODBA.storage.dbi = ODBA::ConnectionPool.new(config.db_driver_url,
26
- config.db_user, config.db_auth, :client_encoding => 'LATIN1')
27
- ODBA.cache.setup
28
-
29
- DRb.install_id_conv ODBA::DRbIdConv.new
30
-
31
- log_file = config.log_file
32
- if(log_file.is_a?(String))
33
- FileUtils.mkdir_p(File.dirname(log_file))
34
- log_file = File.open(log_file, 'a')
35
- at_exit { log_file.close }
36
- end
37
- logger = Logger.new(log_file)
38
- logger.level = Logger.const_get(config.log_level)
39
-
40
- server = YDIM::Server.new(config, logger)
41
- server.extend(DRbUndumped)
42
-
43
- if(config.detach)
44
- pidfile = '/var/run/ydimd.pid'
45
- File.open(pidfile, 'w') { |fh| fh.puts $$ }
46
- at_exit { File.unlink(pidfile) }
47
- Process.fork and exit!(0)
48
- end
49
-
50
- begin
51
- url = config.server_url
52
- url.untaint
53
- DRb.start_service(url, server)
54
- $SAFE = 1
55
- logger.info('start') {
56
- sprintf("starting ydim-server on %s", config.server_url) }
57
- DRb.thread.join
58
- rescue Exception => error
59
- logger.error('fatal') { error }
60
- raise
61
- end
62
-