bbmb 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/bin/admin +0 -2
- data/bin/bbmbd +2 -0
- data/bin/migrate_bbmb_to_utf_8 +0 -8
- data/lib/bbmb/html/state/customers.rb +2 -1
- data/lib/bbmb/html/state/global.rb +17 -7
- data/lib/bbmb/html/state/global_predefine.rb +20 -0
- data/lib/bbmb/html/state/init.rb +20 -0
- data/lib/bbmb/html/util/session.rb +8 -6
- data/lib/bbmb/html/util/validator.rb +1 -1
- data/lib/bbmb/html/view/customer.rb +2 -2
- data/lib/bbmb/version.rb +1 -1
- data/test/util/test_invoicer.rb +2 -3
- data/test/util/test_mail.rb +1 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaa30df636673ef2b0750209b94e560b321b1003
|
4
|
+
data.tar.gz: 722f5f6e81069348fd13ccfe66bca2baeda41030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a18a4776e43b0532aa0d7f453fad64c9a17a586fe36d4c9001c34ccf8a848017ed71152c8bdf329794406c375d06cd5d5a2fbb3e1559b7b920e96ad4afaa5bb
|
7
|
+
data.tar.gz: 34b1eb5c2a44ec0c04d1f2cad8d9c5db9044cafe3ce7abcbd902e67a2b1214e2e513a4c57df5a96adb1146c3fae033dc22c141e2fa12c8bd1c4727e3804d6cf9
|
data/History.txt
CHANGED
data/bin/admin
CHANGED
data/bin/bbmbd
CHANGED
data/bin/migrate_bbmb_to_utf_8
CHANGED
@@ -5,12 +5,6 @@ STDOUT.sync = true
|
|
5
5
|
|
6
6
|
require 'syck'
|
7
7
|
|
8
|
-
|
9
|
-
begin
|
10
|
-
require 'pry'
|
11
|
-
rescue LoadError
|
12
|
-
end
|
13
|
-
|
14
8
|
here = File.expand_path(File.join(File.dirname(File.dirname(__FILE__)), 'lib'))
|
15
9
|
$: << here
|
16
10
|
require 'logger'
|
@@ -111,7 +105,6 @@ module YDIM
|
|
111
105
|
child = child.force_encoding(Encoding::ISO_8859_1).clone.encode(Encoding::UTF_8)
|
112
106
|
puts "force_encoding from ISO_8859_1 #{old}. is now #{child}"
|
113
107
|
end
|
114
|
-
binding.pry unless child.valid_encoding?
|
115
108
|
case child.encoding.to_s
|
116
109
|
when /ASCII-8BIT|US-ASCII/
|
117
110
|
# nothing todo
|
@@ -124,7 +117,6 @@ module YDIM
|
|
124
117
|
puts "force_encoding from #{old}. is now #{child}"
|
125
118
|
else
|
126
119
|
puts "Unhandeled encoding #{child.encoding}"
|
127
|
-
# require 'pry'; binding.pry
|
128
120
|
# child = child.force_encoding
|
129
121
|
end
|
130
122
|
when
|
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Html::State::Customers -- bbmb.ch -- 18.09.2006 -- hwyss@ywesee.com
|
3
3
|
|
4
|
-
require 'bbmb/html/state/
|
4
|
+
require 'bbmb/html/state/global_predefine'
|
5
|
+
require 'bbmb/html/state/customer'
|
5
6
|
require 'bbmb/html/view/customers'
|
6
7
|
require 'bbmb/model/customer'
|
7
8
|
require 'ostruct'
|
@@ -1,19 +1,29 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Html::State::Global -- bbmb.ch -- 18.09.2006 -- hwyss@ywesee.com
|
3
|
-
|
4
3
|
require 'sbsm/state'
|
4
|
+
require 'bbmb/html/state/global_predefine'
|
5
|
+
require 'bbmb/html/state/init'
|
6
|
+
require 'bbmb/html/state/change_password'
|
7
|
+
require 'bbmb/html/state/current_order'
|
8
|
+
require 'bbmb/html/state/customer'
|
9
|
+
require 'bbmb/html/state/customers'
|
10
|
+
require 'bbmb/html/state/favorites'
|
11
|
+
require 'bbmb/html/state/favorites_result'
|
12
|
+
require 'bbmb/html/state/history'
|
13
|
+
require 'bbmb/html/state/info'
|
14
|
+
require 'bbmb/html/state/json'
|
5
15
|
require 'bbmb/html/state/login'
|
16
|
+
require 'bbmb/html/state/order'
|
17
|
+
require 'bbmb/html/state/orders'
|
18
|
+
require 'bbmb/html/state/result'
|
19
|
+
require 'bbmb/html/state/show_pass'
|
6
20
|
|
7
21
|
module BBMB
|
8
22
|
module Html
|
9
23
|
module State
|
10
24
|
class Global < SBSM::State
|
11
|
-
|
12
|
-
|
13
|
-
define_method(:_mandatory) { keys }
|
14
|
-
define_method(:mandatory) { _mandatory }
|
15
|
-
define_method(:mandatory?) { |key| mandatory.include?(key) }
|
16
|
-
end
|
25
|
+
def initialize(first, second)
|
26
|
+
super(first, second)
|
17
27
|
end
|
18
28
|
def logout
|
19
29
|
@session.logout
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
# Html::State::Global -- ydim -- 12.01.2006 -- hwyss@ywesee.com
|
4
|
+
|
5
|
+
require 'sbsm/state'
|
6
|
+
module BBMB
|
7
|
+
module Html
|
8
|
+
module State
|
9
|
+
class Global < SBSM::State
|
10
|
+
class << self
|
11
|
+
def mandatory(*keys)
|
12
|
+
define_method(:_mandatory) { keys }
|
13
|
+
define_method(:mandatory) { _mandatory }
|
14
|
+
define_method(:mandatory?) { |key| mandatory.include?(key) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
require 'bbmb/html/state/customers'
|
5
|
+
require 'bbmb/html/view/login'
|
6
|
+
|
7
|
+
module BBMB
|
8
|
+
module Html
|
9
|
+
module State
|
10
|
+
class Init < SBSM::State
|
11
|
+
VIEW = Html::View::LoginForm
|
12
|
+
def login
|
13
|
+
if(res = @session.login)
|
14
|
+
Customers.new(@session, nil)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,18 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
# encoding: utf-8
|
3
3
|
|
4
4
|
require 'bbmb/config'
|
5
|
-
require 'bbmb/html/util/known_user'
|
6
|
-
require 'bbmb/html/state/login'
|
7
5
|
require 'sbsm/session'
|
8
|
-
require '
|
6
|
+
require 'bbmb/html/state/global'
|
7
|
+
require 'bbmb/html/util/lookandfeel'
|
8
|
+
require 'bbmb/html/util/known_user'
|
9
|
+
|
9
10
|
|
10
11
|
module BBMB
|
11
12
|
module Html
|
12
13
|
module Util
|
13
14
|
class Session < SBSM::Session
|
14
|
-
include SBSM::Redirector
|
15
15
|
DEFAULT_LANGUAGE = 'de'
|
16
|
+
DEFAULT_FLAVOR = "sandoz"
|
16
17
|
DEFAULT_STATE = State::Login
|
17
18
|
EXPIRES = BBMB.config.session_timeout
|
18
19
|
PERSISTENT_COOKIE_NAME = "bbmb-barcodereader"
|
@@ -25,6 +26,7 @@ class Session < SBSM::Session
|
|
25
26
|
@app.logout(@user.auth_session) if(@user.respond_to?(:auth_session))
|
26
27
|
super
|
27
28
|
end
|
29
|
+
|
28
30
|
def lookandfeel
|
29
31
|
if(@lookandfeel.nil? \
|
30
32
|
|| (@lookandfeel.language != persistent_user_input(:language)))
|
@@ -34,7 +36,7 @@ class Session < SBSM::Session
|
|
34
36
|
@lookandfeel
|
35
37
|
end
|
36
38
|
def process(request)
|
37
|
-
begin
|
39
|
+
begin
|
38
40
|
if(@user.is_a?(KnownUser) && @user.auth_session.expired?)
|
39
41
|
logout
|
40
42
|
end
|
@@ -72,7 +72,7 @@ class CustomerForm < HtmlGrid::Form
|
|
72
72
|
form = "document.#{formname}"
|
73
73
|
button.onclick = "#{form}.event.value='change_pass';#{form}.submit();"
|
74
74
|
button.value = @lookandfeel.lookup("change_pass")
|
75
|
-
matrix = components.
|
75
|
+
matrix = components.key(:change_pass)
|
76
76
|
@grid.set_colspan(*matrix)
|
77
77
|
button
|
78
78
|
end
|
@@ -91,7 +91,7 @@ class CustomerForm < HtmlGrid::Form
|
|
91
91
|
button = HtmlGrid::Button.new(:generate_pass, model, @session, self)
|
92
92
|
form = "document.#{formname}"
|
93
93
|
button.onclick = "#{form}.event.value='generate_pass';#{form}.submit();"
|
94
|
-
matrix = components.
|
94
|
+
matrix = components.key(:change_pass)
|
95
95
|
@grid.set_colspan(*matrix)
|
96
96
|
button
|
97
97
|
end
|
data/lib/bbmb/version.rb
CHANGED
data/test/util/test_invoicer.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
$: << File.expand_path('..', File.dirname(__FILE__))
|
6
|
-
$: << File.expand_path('
|
6
|
+
$: << File.expand_path('../../lib', File.dirname(__FILE__))
|
7
7
|
|
8
8
|
|
9
9
|
require "minitest/autorun"
|
@@ -80,7 +80,6 @@ class TestInvoicer < Minitest::Test
|
|
80
80
|
}
|
81
81
|
range = Time.local(2006,9)...Time.local(2006,10)
|
82
82
|
result = Invoicer.create_invoice(range, Util::Money.new(24), [order1, order2], today)
|
83
|
-
skip('Why does this test fail?')
|
84
83
|
assert_equal(invoice, result)
|
85
84
|
assert_equal("01.09.2006 - 30.09.2006", invoice.description)
|
86
85
|
assert_equal(today, invoice.date)
|
@@ -99,7 +98,7 @@ class TestInvoicer < Minitest::Test
|
|
99
98
|
@ydim_server.should_receive(:logout).and_return { |client|
|
100
99
|
assert_equal(session, client)
|
101
100
|
}
|
102
|
-
skip('this test
|
101
|
+
skip('this test fails')
|
103
102
|
Invoicer.send_invoice(123)
|
104
103
|
end
|
105
104
|
def test_run
|
data/test/util/test_mail.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Util::TestMail -- bbmb.ch -- 27.09.2006 -- hwyss@ywesee.com
|
3
3
|
|
4
|
-
|
5
|
-
$: << File.expand_path('../lib', File.dirname(__FILE__))
|
4
|
+
$: << File.expand_path('../../lib', File.dirname(__FILE__))
|
6
5
|
|
7
6
|
require "minitest/autorun"
|
8
7
|
require 'flexmock/test_unit'
|
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.0.
|
4
|
+
version: 2.0.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: 2016-06-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: odba
|
@@ -349,8 +349,10 @@ files:
|
|
349
349
|
- lib/bbmb/html/state/favorites.rb
|
350
350
|
- lib/bbmb/html/state/favorites_result.rb
|
351
351
|
- lib/bbmb/html/state/global.rb
|
352
|
+
- lib/bbmb/html/state/global_predefine.rb
|
352
353
|
- lib/bbmb/html/state/history.rb
|
353
354
|
- lib/bbmb/html/state/info.rb
|
355
|
+
- lib/bbmb/html/state/init.rb
|
354
356
|
- lib/bbmb/html/state/json.rb
|
355
357
|
- lib/bbmb/html/state/login.rb
|
356
358
|
- lib/bbmb/html/state/order.rb
|