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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb90d7e562d23095d59b3843adea7a0f1a62f376
4
- data.tar.gz: 19bd72a5567c15406e9614a20bf2cb215e14a2dd
3
+ metadata.gz: eaa30df636673ef2b0750209b94e560b321b1003
4
+ data.tar.gz: 722f5f6e81069348fd13ccfe66bca2baeda41030
5
5
  SHA512:
6
- metadata.gz: bfd42913edd1a4a2af6e481512a385de3fe75147d3c8ccbaab92e3002086438a464587441bf0ee2d4b1ac495ac486328fb2c0bd6a3797825acddd977996f1cc2
7
- data.tar.gz: 3f153e61f12038feb43c6045c289f1a3b799c19293fe5fbb5d558e1fa3a43bdd1d52112596f99490e7e3309321dd8b320481a0b64f1829dd36cea99a96e18675
6
+ metadata.gz: 6a18a4776e43b0532aa0d7f453fad64c9a17a586fe36d4c9001c34ccf8a848017ed71152c8bdf329794406c375d06cd5d5a2fbb3e1559b7b920e96ad4afaa5bb
7
+ data.tar.gz: 34b1eb5c2a44ec0c04d1f2cad8d9c5db9044cafe3ce7abcbd902e67a2b1214e2e513a4c57df5a96adb1146c3fae033dc22c141e2fa12c8bd1c4727e3804d6cf9
@@ -1,3 +1,8 @@
1
+ === 2.0.3 / 08.06.2016
2
+
3
+ * Added a DEFAULT_FLAVOR sandoz to work without rockit
4
+ * Various cleanups. Added state/init.rb und global_predefine.rb in analogy to ydim-html
5
+
1
6
  === 2.0.1 / 01.06.2016
2
7
 
3
8
  * Fixed getting git version
data/bin/admin CHANGED
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Admin -- bbmb -- 09.07.2003 -- hwyss@ywesee.com
3
3
 
4
- $KCODE = 'u'
5
-
6
4
  require 'drb'
7
5
  require 'sbsm/drb'
8
6
  require 'bbmb'
data/bin/bbmbd CHANGED
@@ -6,8 +6,10 @@ $: << File.expand_path('../lib', File.dirname(__FILE__))
6
6
 
7
7
  require 'drb'
8
8
  require 'logger'
9
+ require 'ydim/invoice'
9
10
  require 'bbmb/config'
10
11
  require 'bbmb/util/server'
12
+ require 'bbmb/util/server'
11
13
  require 'pp'
12
14
 
13
15
  module BBMB
@@ -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/global'
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
- class << self
12
- def mandatory(*keys)
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
- # Html::Util::Session -- bbmb.ch -- 15.09.2006 -- hwyss@ywesee.com
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 'sbsm/redirector'
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
@@ -47,7 +47,7 @@ class Validator < SBSM::Validator
47
47
  match[0]
48
48
  end
49
49
  def perform_validation(key, value)
50
- super(key, u(value))
50
+ super(key, value)
51
51
  end
52
52
  end
53
53
  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.index(:change_pass)
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.index(:change_pass)
94
+ matrix = components.key(:change_pass)
95
95
  @grid.set_colspan(*matrix)
96
96
  button
97
97
  end
@@ -2,5 +2,5 @@
2
2
  # Bbmb -- bbmb.ch -- 17.12.2019 -- zdavatz@ywesee.com
3
3
 
4
4
  module BBMB
5
- VERSION = '2.0.2'
5
+ VERSION = '2.0.3'
6
6
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
  $: << File.expand_path('..', File.dirname(__FILE__))
6
- $: << File.expand_path('../lib', File.dirname(__FILE__))
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 failes')
101
+ skip('this test fails')
103
102
  Invoicer.send_invoice(123)
104
103
  end
105
104
  def test_run
@@ -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.2
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-01 00:00:00.000000000 Z
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