bbmb 2.1.6 → 2.1.7

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: d5365fd813153ac20b43e196524e0c9545f75e53
4
- data.tar.gz: 8646828879d9666acb695a24cc3623784a62151d
3
+ metadata.gz: c6e2c40f9e08bfaa1590a132dfd79a843dcab512
4
+ data.tar.gz: 5ba3de786806de5a811194f9b56385afad3dd8aa
5
5
  SHA512:
6
- metadata.gz: 2f06402f1cea28e3315f9249cae42c88f7248b90ba8a5efb934e399267711b91c31250f7e4881fb74969cef1c11a9ca3a7fdd25dd24fda174747f334e253e255
7
- data.tar.gz: 3fb14b307539caaa45e632ca72c4cb8fa6c545733d51da53dfb9c7efa1aa63f11739fd1cf845b6fb1fa5ec7efc52b3cb25a8676d404a723806f596c56f2d0b5a
6
+ metadata.gz: 2042e778619244928656a79f4ebf46a52ef3ab48c3e4e0c0dc17a4ed25486647960d5700e4796aae71451638727f622f1573246ff07efb8114e596adead7179d
7
+ data.tar.gz: 22b23be9e8bbd187a99b1e7beccda8378de9fdc072ed1457c9235534e7c325cee3964558055dc0d6a4ad2643ca02abfe015fc1c09b4f415e7d066a7dec1f8adc
data/.travis.yml CHANGED
@@ -10,11 +10,11 @@ before_install:
10
10
 
11
11
  rvm:
12
12
  - 2.4.0
13
- - 2.3.1
14
13
  - ruby-head
15
14
 
16
15
  matrix:
17
16
  allow_failures:
17
+ - 2.3.1 # FixNumber instead of Integer
18
18
  - rvm: ruby-head
19
19
 
20
20
  notifications:
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 2.1.7 / 16.05.2017
2
+
3
+ * Fix renaming/adding an email-address (if not already in yus)
4
+ * Fixed running some unit tests
5
+ * Require sbsm >= 1.3.9
6
+
1
7
  === 2.1.6 / 16.05.2017
2
8
 
3
9
  * Fixed sorting via last_login when logged in as admin
data/bbmb.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "ydbd-pg", '>= 0.5.2'
22
22
  spec.add_dependency "ydbi", '>= 0.5.3'
23
23
  spec.add_dependency "json"
24
- spec.add_dependency "sbsm", '>= 1.3.8'
24
+ spec.add_dependency "sbsm", '>= 1.3.9'
25
25
  spec.add_dependency "htmlgrid"
26
26
  spec.add_dependency "ydim", '>= 0.5.1'
27
27
  spec.add_dependency "syck"
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env ruby
2
+ # Util::Server -- de.bbmb.org -- 01.09.2006 -- hwyss@ywesee.com
3
+
4
+ require 'bbmb/config'
5
+ require 'bbmb/html/util/known_user'
6
+ require 'bbmb/html/util/session'
7
+ require 'bbmb/html/util/validator'
8
+ require 'bbmb/util/invoicer'
9
+ require 'bbmb/util/invoicer'
10
+ require 'bbmb/util/mail'
11
+ require 'bbmb/util/updater'
12
+ require 'bbmb/model/order' # needed to be enable to invoice later
13
+ require 'bbmb/model/customer'
14
+ require 'date'
15
+ require 'sbsm/app'
16
+ require 'bbmb/persistence/odba'
17
+ require 'bbmb/model/customer'
18
+ require 'bbmb/model/quota'
19
+ require 'bbmb/model/product'
20
+ require 'bbmb/model/promotion'
21
+ require 'bbmb/util/server'
22
+
23
+ module BBMB
24
+ def self.persistence
25
+ @@persistence ||= BBMB::Persistence::ODBA
26
+ end
27
+ module Util
28
+ class App < SBSM::App
29
+ attr_accessor :db_manager, :yus_server
30
+ attr_accessor :auth, :config, :persistence, :server
31
+
32
+ def start_service
33
+ case BBMB.config.persistence
34
+ when 'odba'
35
+ DRb.install_id_conv ODBA::DRbIdConv.new
36
+ @persistence = BBMB::Persistence::ODBA
37
+ end
38
+ @auth = DRb::DRbObject.new(nil, BBMB.config.auth_url)
39
+ puts "installed @auth #{@auth}"
40
+ @server = BBMB::Util::Server.new(@persistence, self)
41
+ @server.extend(DRbUndumped)
42
+ BBMB.server = @server
43
+ puts "installed BBMB.server #{BBMB.server}"
44
+ if(BBMB.config.update?)
45
+ @server.run_updater
46
+ end
47
+ if(BBMB.config.invoice?)
48
+ @server.run_invoicer
49
+ end
50
+ url = BBMB.config.server_url
51
+ url.untaint
52
+ DRb.start_service(url, @server)
53
+ $SAFE = 1
54
+ $0 = BBMB.config.name
55
+ SBSM.logger.info('start') { sprintf("starting bbmb-server on %s", url) }
56
+ DRb.thread.join
57
+ SBSM.logger.info('finished') { sprintf("starting bbmb-server on %s", url) }
58
+ rescue Exception => error
59
+ SBSM.logger.error('fatal') { error }
60
+ raise
61
+ end
62
+ def initialize
63
+ super
64
+ puts "Starting Rack-Service #{self.class} and service #{BBMB.config.server_url}"
65
+ Thread.new {
66
+ start_service
67
+ }
68
+ end
69
+ def login(email, pass)
70
+ session = BBMB.auth.login(email, pass, BBMB.config.auth_domain)
71
+ Html::Util::KnownUser.new(session)
72
+ end
73
+ def logout(session)
74
+ # Here we start when logging in from the home page
75
+ BBMB.auth.logout(session)
76
+ rescue DRb::DRbError, RangeError, NameError
77
+ end
78
+ end
79
+ end
80
+ end
@@ -44,7 +44,14 @@ module BBMB
44
44
  @app.inject_order(customer_id, products, infos, opts)
45
45
  end
46
46
  def rename_user(old_name, new_name)
47
- @app.rename_user(old_name, new_name)
47
+ return if old_name.eql?(new_name)
48
+ @app.auth.autosession(BBMB.config.auth_domain) do |session|
49
+ if(old_name.nil?)
50
+ session.create_entity(new_name)
51
+ else
52
+ session.rename(old_name, new_name)
53
+ end
54
+ end
48
55
  end
49
56
  def run_invoicer
50
57
  @invoicer ||= Thread.new {
@@ -200,16 +207,5 @@ module BBMB
200
207
  end
201
208
  end
202
209
  end
203
- class App < SBSM::App
204
- def login(email, pass)
205
- session = BBMB.auth.login(email, pass, BBMB.config.auth_domain)
206
- Html::Util::KnownUser.new(session)
207
- end
208
- def logout(session)
209
- # Here we start when logging in from the home page
210
- BBMB.auth.logout(session)
211
- rescue DRb::DRbError, RangeError, NameError
212
- end
213
- end
214
- end
215
- end
210
+ end
211
+ end
data/lib/bbmb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.1.6'
2
+ VERSION = '2.1.7'
3
3
  end
@@ -76,7 +76,7 @@ class TestInvoicer < Minitest::Test
76
76
  range = Time.local(2006,9)..Time.local(2006,10)
77
77
  @drb_server = DRb.start_service(@ydim_url, @ydim_server)
78
78
  sleep 0.5
79
- result = Invoicer.create_invoice(range, Util::Money.new(24), [order1, order2], today.to_time + 3600)
79
+ result = Invoicer.create_invoice(range, Util::Money.new(24), [order1, order2], today)
80
80
  if result.is_a?(FlexMock::Undefined)
81
81
  msg = "Skipping this sometimes failing test "
82
82
  puts msg
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbmb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.3.8
75
+ version: 1.3.9
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.3.8
82
+ version: 1.3.9
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: htmlgrid
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -414,6 +414,7 @@ files:
414
414
  - lib/bbmb/persistence/odba/model/order.rb
415
415
  - lib/bbmb/persistence/odba/model/product.rb
416
416
  - lib/bbmb/persistence/odba/model/quota.rb
417
+ - lib/bbmb/util/app.rb
417
418
  - lib/bbmb/util/invoicer.rb
418
419
  - lib/bbmb/util/mail.rb
419
420
  - lib/bbmb/util/multilingual.rb