soybean 2.5.2 → 2.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.2
1
+ 2.5.3
@@ -139,18 +139,11 @@ module Soybean
139
139
  return s, h, b
140
140
  rescue => e
141
141
  [200, {'Allow' => 'POST',
142
- 'Content-Type' => 'text/plain'}, [e.message,
142
+ 'Content-Type' => 'text/xml'}, [e.message,
143
143
  e.backtrace.join("\n")]]
144
144
  end
145
145
 
146
146
  def with_logging(env, logger)
147
- #Started GET "/" for 127.0.0.1 at 2011-09-28 14:21:28 +0400
148
- # Processing by DashboardController#index as HTML
149
- # User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 100 LIMIT 1
150
- # Role Load (0.3ms) SELECT `roles`.* FROM `roles` INNER JOIN `assignments` ON `roles`.`id` = `assignments`.`role_id` WHERE `assignments`.`user_id` = 100
151
- #Redirected to http://localhost:3000/municipal_services
152
- #Completed 302 Found in 89ms
153
-
154
147
  request = Rack::Request.new(env)
155
148
  input_params = request.body.read
156
149
  request.body.rewind
@@ -1,6 +1,5 @@
1
1
  module Engines
2
2
  class <%= class_name %> < Soybean::Engine
3
3
  self.service = <%= model_class_name %>.new
4
- self.endpoint = %r(^/<%= model_class_name %>)
5
4
  end
6
5
  end
@@ -0,0 +1,31 @@
1
+ module Soybean
2
+ class StaticServer < Rack::Static
3
+ attr_accessor :cache
4
+
5
+ def call(env)
6
+ path = env["PATH_INFO"]
7
+
8
+ unless @urls.kind_of? Hash
9
+ can_serve = @urls.any? { |url| path.index(url) == 0 }
10
+ else
11
+ can_serve = @urls.key? path
12
+ end
13
+
14
+ if can_serve
15
+ env["PATH_INFO"] = @urls[path] if @urls.kind_of? Hash
16
+ @file_server.call(env)
17
+ else
18
+ @app.call(env)
19
+ end
20
+ end
21
+
22
+ def rewrite(env)
23
+ doc = Nokogiri.XML File.read(env["PATH_INFO"])
24
+ address = d.search('definitions/service/port/:first').first
25
+ address['location'] = "#{env['SERVER_NAME']}:#{env['SERVER_PORT']}/#{env['soybean.service.endpoint']}"
26
+ @cache[env["PATH_INFO"]] = doc
27
+
28
+ end
29
+
30
+ end
31
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{soybean}
8
- s.version = "2.5.2"
8
+ s.version = "2.5.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Anton Sozontov"]
12
- s.date = %q{2011-10-17}
12
+ s.date = %q{2011-10-27}
13
13
  s.default_executable = %q{soybean}
14
14
  s.description = %q{Generate soap web-services from you wsdl. Generate: all classes from xsd, and other.}
15
15
  s.email = %q{a.sozontov@gmail.com}
@@ -51,6 +51,7 @@ Gem::Specification.new do |s|
51
51
  "lib/soybean/interface_builder.rb",
52
52
  "lib/soybean/literal_mapping_registry_creator.rb",
53
53
  "lib/soybean/soap_attribute.rb",
54
+ "lib/soybean/static_server.rb",
54
55
  "soybean.gemspec",
55
56
  "soybean.log",
56
57
  "spec/soybean_spec.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soybean
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-17 00:00:00.000000000 +04:00
12
+ date: 2011-10-27 00:00:00.000000000 +04:00
13
13
  default_executable: soybean
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
- requirement: &9657940 !ruby/object:Gem::Requirement
17
+ requirement: &8481240 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *9657940
25
+ version_requirements: *8481240
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
- requirement: &9655280 !ruby/object:Gem::Requirement
28
+ requirement: &8475500 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '3.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *9655280
36
+ version_requirements: *8475500
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: i18n
39
- requirement: &9652420 !ruby/object:Gem::Requirement
39
+ requirement: &8471340 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *9652420
47
+ version_requirements: *8471340
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: nokogiri
50
- requirement: &9634920 !ruby/object:Gem::Requirement
50
+ requirement: &8469360 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *9634920
58
+ version_requirements: *8469360
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rack
61
- requirement: &9633360 !ruby/object:Gem::Requirement
61
+ requirement: &8453180 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *9633360
69
+ version_requirements: *8453180
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rack-mount
72
- requirement: &9632240 !ruby/object:Gem::Requirement
72
+ requirement: &8451880 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *9632240
80
+ version_requirements: *8451880
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rspec
83
- requirement: &9629620 !ruby/object:Gem::Requirement
83
+ requirement: &8450920 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: 2.3.0
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *9629620
91
+ version_requirements: *8450920
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: yard
94
- requirement: &9628060 !ruby/object:Gem::Requirement
94
+ requirement: &8449660 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: 0.6.0
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *9628060
102
+ version_requirements: *8449660
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: bundler
105
- requirement: &9626520 !ruby/object:Gem::Requirement
105
+ requirement: &8448460 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ~>
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: 1.0.0
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *9626520
113
+ version_requirements: *8448460
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: jeweler
116
- requirement: &9625080 !ruby/object:Gem::Requirement
116
+ requirement: &8446940 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ~>
@@ -121,7 +121,7 @@ dependencies:
121
121
  version: 1.6.4
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *9625080
124
+ version_requirements: *8446940
125
125
  description: ! 'Generate soap web-services from you wsdl. Generate: all classes from
126
126
  xsd, and other.'
127
127
  email: a.sozontov@gmail.com
@@ -164,6 +164,7 @@ files:
164
164
  - lib/soybean/interface_builder.rb
165
165
  - lib/soybean/literal_mapping_registry_creator.rb
166
166
  - lib/soybean/soap_attribute.rb
167
+ - lib/soybean/static_server.rb
167
168
  - soybean.gemspec
168
169
  - soybean.log
169
170
  - spec/soybean_spec.rb
@@ -343,7 +344,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
343
344
  version: '0'
344
345
  segments:
345
346
  - 0
346
- hash: 3905213212974955204
347
+ hash: 2457752307248948752
347
348
  required_rubygems_version: !ruby/object:Gem::Requirement
348
349
  none: false
349
350
  requirements: