Skip to content

Commit

Permalink
Documentation cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Nov 9, 2016
1 parent 68bafa8 commit 5c20e0a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 26 deletions.
11 changes: 7 additions & 4 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
=== 1.3.1 / 24.10.2016
=== 1.3.1 / 9.11.2016
* Moved from mod_ruby to using webrick/rack interface
* Incompatible changes to 1.3.0 are that all trans_handlers must be fixed, as the parameters are
* changed now in the params field (to be compatible with Rack::Request). The SBSM::Request field notes has gone!
*
* See changes in steinwies.ch which were minimal
** Removed an unused require 'sbsm/request' in src/view/navbar.rb
** added a config.ru
** Changed Steinwies::App to derive from SBSM::App instead of SBSM::DRbServer and its initialize method
** The Session.initialize method had to pass a validator when calling super

* Open problems
** There is no real integration test using rack-test to prove that a minimal app is working
** Handling a POST request for handling a form does not work yet
** Handling redirects is not tested (and probably will not work)
** Handling passthru is not tested (and probably will not work)

Expand Down
31 changes: 31 additions & 0 deletions lib/sbsm.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#--
# Copyright 2016 Niklaus Giger <ngiger@ywesee.com>
#++
#
# *SBSM:* Application framework for state based session management.
#
# We document here a few aspects of SBSM. As it is written over 10 years
# after the creation of one of the few users, who never had the chance to
# discuss with the creator of this piece of software, errors/obmission
# are found quite often.
#
# The behaviour of SBSM can be extended or overriden in many ways.
# Often in derived classes you simply define a few constants, these
# extension points can be spotted by searching for occurrences of
# -self::class::- in the implementation of SBSM.
#
# * *lookandfeel*: offers a simple way to customize views, constants
# for different languages
#
# * *viralstate*: Used in bbmb and sandoz.com
#
# * *session*: Used in bbmb and sandoz.com
#
# * *request*: Used in bbmb and sandoz.com
#
# * *transhandler*: Responsible for converting an URI into a hash of
# option values, e.g. /de/gcc/fachinfo/reg/58980
#
module SBSM

end
23 changes: 1 addition & 22 deletions lib/sbsm/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,14 @@ class App < SBSM::DRbServer
#
# === arguments
#
# * +config_file+ - YAML config file defining values for other parameters
# * +trans_handler+ - A Ruby class overriding the SBSM::TransHandler class
# * +validator+ - A Ruby class overriding the SBSM::Validator class
# * +session+ - A Ruby class overriding the SBSM::Session class
# * +unknown_user+ - A Ruby class overriding the SBSM::UNKNOWN_USER class
# * +server_uri+ - URL of DrbServer to be started, defaults to druby://localhost:10001
# * +trans_handler+ - A Ruby class overriding the SBSM::TransHandler class
# * +persistence_layer+ - Persistence Layer to use
#
# === Examples
# Look at steinwies.ch
# * https://github.com/zdavatz/steinwies.ch (simple, mostly static files, one form, no persistence layer)
#
def initialize_neu(app:,
session:,
config_file: nil,
trans_handler: nil,
validator: nil,
persistence_layer: nil,
server_uri: 'druby://localhost:10001')
OPTIONS.each{ |opt| eval "@#{opt} = #{opt}" }
@server_uri = URI(server_uri)
@unknown_user ||= SBSM::UnknownUser.new
@app = app.new
@sbsm = SBSM::Request.new(@server_uri, @trans_handler, {})
@my_self = self

# start_drb_server
end

def initialize(app:, validator:, trans_handler:, persistence_layer: nil)
@app = app
@trans_handler = trans_handler
Expand Down
1 change: 1 addition & 0 deletions lib/sbsm/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ def self.info(msg)
info = "#{File.basename(caller[0])} #{msg}"
x = caller.dup
@@logger.info(info)
# puts info # handy for debugging
end
end

0 comments on commit 5c20e0a

Please sign in to comment.