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 +4 -4
- data/Gemfile +2 -6
- data/History.txt +6 -0
- data/bbmb.gemspec +1 -1
- data/lib/bbmb/config.rb +2 -2
- data/lib/bbmb/html/util/known_user.rb +2 -2
- data/lib/bbmb/html/util/session.rb +1 -1
- data/lib/bbmb/util/mail.rb +4 -2
- data/lib/bbmb/util/rack_interface.rb +0 -1
- data/lib/bbmb/util/target_dir.rb +1 -0
- data/lib/bbmb/version.rb +1 -1
- data/test/util/test_target_dir.rb +4 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b487ee07c8fd64af7c360241bf8c3c4a9ccb3778
|
4
|
+
data.tar.gz: a7198aa78b2da4fbf68ed8a9c89793cb5880eac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26ab6091e17afc1581e1fec5c4907fdebaf286a846c66cc3aba6bb09fa0af1f96ffa8d7f6bd3ede97b705a07e901281c3bdb5438253f8d774ff37d9765babb90
|
7
|
+
data.tar.gz: 1c01e22b9cbc39a7cdb6b593d2701c9f81bcc351d8c6955d9e38d6d8d2293f14f400d1155d2092cfefdc70c15ef75d526b829b80a0cf6e2d97e6072234023af3
|
data/Gemfile
CHANGED
data/History.txt
CHANGED
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.4.
|
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"
|
data/lib/bbmb/config.rb
CHANGED
@@ -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"
|
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(
|
21
|
-
@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(
|
31
|
+
@user = BBMB::Html::Util::KnownUser.new(@auth_session)
|
32
32
|
else
|
33
33
|
@user = SBSM::UnknownUser
|
34
34
|
end
|
data/lib/bbmb/util/mail.rb
CHANGED
@@ -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
|
-
|
69
|
-
|
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,
|
data/lib/bbmb/util/target_dir.rb
CHANGED
@@ -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
|
data/lib/bbmb/version.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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.
|
82
|
+
version: 1.4.5
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: htmlgrid
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|