bbmb 2.3.1 → 2.3.2

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: 509fc49dd58770c80b653a8978b68fcc409c0805
4
- data.tar.gz: 4b0a696b35073a886f6ce95306ccc06d26c2bb6f
3
+ metadata.gz: b487ee07c8fd64af7c360241bf8c3c4a9ccb3778
4
+ data.tar.gz: a7198aa78b2da4fbf68ed8a9c89793cb5880eac8
5
5
  SHA512:
6
- metadata.gz: c0591becd04827df23cb0e7f0099db759d3ce8298b0aa9fa79811359f27fb88c5fe8b22d7693af6e1ca1311fcd2ed7b1db8d7d2d69f7971a6c5b1e6b0950b4c1
7
- data.tar.gz: 121df3abf31245a43270eace8db52c00ea77a127c027e23b15692fa35ba8b2ab3d75a3f6582a3824cdd81bb194a9a7aeb80c3c2a120bbe13b43be63f4c14ed6e
6
+ metadata.gz: 26ab6091e17afc1581e1fec5c4907fdebaf286a846c66cc3aba6bb09fa0af1f96ffa8d7f6bd3ede97b705a07e901281c3bdb5438253f8d774ff37d9765babb90
7
+ data.tar.gz: 1c01e22b9cbc39a7cdb6b593d2701c9f81bcc351d8c6955d9e38d6d8d2293f14f400d1155d2092cfefdc70c15ef75d526b829b80a0cf6e2d97e6072234023af3
data/Gemfile CHANGED
@@ -2,10 +2,6 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :debugger do
5
- if RUBY_VERSION.match(/^1/)
6
- gem 'pry-debugger'
7
- else
8
- gem 'pry-byebug'
9
- gem 'pry-doc'
10
- end
5
+ gem 'pry-byebug'
6
+ gem 'pry-doc'
11
7
  end
@@ -1,3 +1,9 @@
1
+ === 2.3.2 / 20.06.2017
2
+
3
+ * Use SBSM 1.4.5 and adapt KnownUser
4
+ * Use SBSM.debug to log sending mail
5
+ * Log postprocess TargetDir
6
+
1
7
  === 2.3.1 / 12.06.2017
2
8
 
3
9
  * Fix inject_order for xmlconv
@@ -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.4.2'
24
+ spec.add_dependency "sbsm", '>= 1.4.5'
25
25
  spec.add_dependency "htmlgrid"
26
26
  spec.add_dependency "ydim", '>= 0.5.1'
27
27
  spec.add_dependency "syck"
@@ -96,8 +96,8 @@ module BBMB
96
96
  }
97
97
 
98
98
  config = RCLConf::RCLConf.new(ARGV, defaults)
99
- raise "config file #{config.config} must exist" unless File.exist?(config.config)
99
+ raise "config file #{config.config} must exist" if !defined?(MiniTest) && !File.exist?(config.config)
100
100
  puts "Loading BBMB config from #{config.config}"
101
- config.load(config.config)
101
+ config.load(config.config) if File.exist?(config.config)
102
102
  @config = config
103
103
  end
@@ -17,8 +17,8 @@ class KnownUser < SBSM::User
17
17
  # login BBMB.config.auth_domain + ".Customer"
18
18
  attr_reader :auth_session
19
19
  PREFERENCE_KEYS = [ :home, :pagestep ]
20
- def initialize(session)
21
- @auth_session = session.auth_session
20
+ def initialize(auth_session)
21
+ @auth_session = auth_session
22
22
  end
23
23
  def allowed?(action, key=nil)
24
24
  if @auth_session
@@ -28,7 +28,7 @@ class Session < SBSM::Session
28
28
  # Before rack: @user = @app.login(user_input(:email), user_input(:pass))
29
29
  @auth_session = BBMB.auth.login(user_input(:email), user_input(:pass), BBMB.config.auth_domain) # logs in claude meier without problem, but not admin
30
30
  if @auth_session.valid?
31
- @user = BBMB::Html::Util::KnownUser.new(self) # TODO:Should we set it already in the initialize method?
31
+ @user = BBMB::Html::Util::KnownUser.new(@auth_session)
32
32
  else
33
33
  @user = SBSM::UnknownUser
34
34
  end
@@ -65,8 +65,10 @@ module Mail
65
65
  puts msg unless defined?(::MiniTest)
66
66
  ::Mail.defaults do delivery_method :test end
67
67
  else
68
- puts "Mail.sendmail #{config.smtp_server} #{config.smtp_port} #{config.smtp_helo} smtp_user: #{ config.smtp_user} #{ config.smtp_pass} #{ config.smtp_authtype}"
69
- puts "Mail.sendmail from #{from_addr} to #{to_addr} cc #{cc_addrs} message: #{my_body.class}"
68
+ msg = "Mail.sendmail #{config.smtp_server} #{config.smtp_port} #{config.smtp_helo} smtp_user: #{ config.smtp_user} #{ config.smtp_pass} #{ config.smtp_authtype}\n" +
69
+ "Mail.sendmail from #{from_addr} to #{to_addr} cc #{cc_addrs} subject: #{my_subject} message: #{my_body.class}"
70
+ puts msg
71
+ SBSM.debug(msg)
70
72
  return if to_addr == nil
71
73
  ::Mail.defaults do
72
74
  options = { :address => config.smtp_server,
@@ -38,7 +38,6 @@ module BBMB
38
38
  @app = app
39
39
  super(app: app,
40
40
  session_class: BBMB::Html::Util::Session,
41
- unknown_user: Html::Util::KnownUser,
42
41
  validator: validator,
43
42
  cookie_name: 'virbac.bbmb'
44
43
  )
@@ -12,6 +12,7 @@ module TargetDir
12
12
  def TargetDir.send_order(order)
13
13
  content = order.to_target_format
14
14
  basename = BBMB.config.tmpfile_basename
15
+ SBSM.info("TargetDir.send_order #{order.order_id} basename #{basename} -> #{BBMB.config.order_destinations}")
15
16
  BBMB.config.order_destinations.each { |destination|
16
17
  uri = URI.parse(File.join(destination, order.filename))
17
18
  case uri.scheme
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.3.1'
2
+ VERSION = '2.3.2'
3
3
  end
@@ -15,7 +15,7 @@ class TestTargetDir < Minitest::Test
15
15
  BBMB.config = config = flexmock('config')
16
16
  bbmb_dir = File.expand_path('..', File.dirname(__FILE__))
17
17
  config.should_receive(:bbmb_dir).and_return(bbmb_dir)
18
- @dir = File.expand_path('../data/destination',
18
+ @dir = File.expand_path('../data/destination',
19
19
  File.dirname(__FILE__))
20
20
  end
21
21
  def teardown
@@ -30,6 +30,7 @@ class TestTargetDir < Minitest::Test
30
30
  config.should_receive(:order_destinations).and_return([ftp])
31
31
  config.should_receive(:tmpfile_basename).and_return('bbmb')
32
32
  order = flexmock('order')
33
+ order.should_receive(:order_id).and_return('order_id')
33
34
  order.should_receive(:to_target_format).and_return('data')
34
35
  order.should_receive(:filename).and_return('order.csv')
35
36
  flexstub(Net::FTP).should_receive(:open)\
@@ -51,6 +52,7 @@ class TestTargetDir < Minitest::Test
51
52
  config.should_receive(:order_destinations).and_return([@dir])
52
53
  config.should_receive(:tmpfile_basename).and_return('bbmb')
53
54
  order = flexmock('order')
55
+ order.should_receive(:order_id).and_return('order_id')
54
56
  order.should_receive(:to_target_format).and_return('data')
55
57
  order.should_receive(:filename).and_return('order.csv')
56
58
  flexstub(Net::FTP).should_receive(:open).times(0)
@@ -66,6 +68,7 @@ class TestTargetDir < Minitest::Test
66
68
  config.should_receive(:order_destinations).and_return(['data/destination'])
67
69
  config.should_receive(:tmpfile_basename).and_return('bbmb')
68
70
  order = flexmock('order')
71
+ order.should_receive(:order_id).and_return('order_id')
69
72
  order.should_receive(:to_target_format).and_return('data')
70
73
  order.should_receive(:filename).and_return('order.csv')
71
74
  flexstub(Net::FTP).should_receive(:open).times(0)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbmb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
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: 2017-06-12 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: odba
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.4.2
75
+ version: 1.4.5
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.4.2
82
+ version: 1.4.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: htmlgrid
85
85
  requirement: !ruby/object:Gem::Requirement