knjappserver 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.24
1
+ 0.0.25
data/knjappserver.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{knjappserver}
8
- s.version = "0.0.24"
8
+ s.version = "0.0.25"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = %q{2012-06-10}
12
+ s.date = %q{2012-06-28}
13
13
  s.description = %q{Which supports a lot of undocumented stuff.}
14
14
  s.email = %q{k@spernj.org}
15
15
  s.executables = ["check_running.rb", "knjappserver_start.rb"]
@@ -9,6 +9,7 @@ class Knjappserver::Httpsession::Post_multipart
9
9
  @data = nil
10
10
  @mode = nil
11
11
  @headers = {}
12
+ @counts = {}
12
13
 
13
14
  @args["io"].each do |line|
14
15
  if boundary_regexp =~ line
@@ -48,9 +49,26 @@ class Knjappserver::Httpsession::Post_multipart
48
49
  disp = @headers["content-disposition"]
49
50
  raise "No 'content-disposition' was given." if !disp
50
51
 
52
+
53
+ #Figure out value-name in post-hash.
51
54
  match_name = disp.match(/name=\"(.+?)\"/)
52
55
  raise "Could not match name." if !match_name
56
+ name = match_name[1]
57
+
58
+
59
+ #Fix count with name if given as increamental [].
60
+ if match = name.match(/^(.+)\[\]$/)
61
+ if !@counts.key?(match[1])
62
+ @counts[match[1]] = 0
63
+ else
64
+ @counts[match[1]] += 1
65
+ end
66
+
67
+ name = "#{match[1]}[#{@counts[match[1]]}]"
68
+ end
69
+
53
70
 
71
+ #Figure out actual filename.
54
72
  match_fname = disp.match(/filename=\"(.+?)\"/)
55
73
 
56
74
  if match_fname
@@ -59,12 +77,12 @@ class Knjappserver::Httpsession::Post_multipart
59
77
  "headers" => @headers,
60
78
  "data" => @data
61
79
  )
62
- @return[match_name[1]] = obj
80
+ @return[name] = obj
63
81
  @data = nil
64
82
  @headers = {}
65
83
  @mode = nil
66
84
  else
67
- @return[match_name[1]] = @data
85
+ @return[name] = @data
68
86
  @data = nil
69
87
  @headers = {}
70
88
  @mode = nil
@@ -1,3 +1,12 @@
1
+ #The class that stands for the whole appserver / webserver.
2
+ #===Examples
3
+ # appsrv = Knjappserver.new(
4
+ # :locales_root => "/some/path/locales",
5
+ # :locales_gettext_funcs => true,
6
+ # :magic_methods => true
7
+ # )
8
+ # appsrv.start
9
+ # appsrv.join
1
10
  class Knjappserver
2
11
  attr_reader :cio, :config, :httpserv, :debug, :db, :db_handler, :ob, :translations, :paused, :should_restart, :events, :mod_event, :db_handler, :gettext, :sessions, :logs_access_pending, :threadpool, :vars, :magic_procs, :magic_vars, :types, :eruby_cache, :httpsessions_ids
3
12
  attr_accessor :served, :should_restart, :should_restart_done
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: knjappserver
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.24
5
+ version: 0.0.25
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-06-10 00:00:00 +02:00
13
+ date: 2012-06-28 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -208,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
208
  requirements:
209
209
  - - ">="
210
210
  - !ruby/object:Gem::Version
211
- hash: -2439640920706539794
211
+ hash: 1244618300287044198
212
212
  segments:
213
213
  - 0
214
214
  version: "0"