simple-httpd 0.3.3 → 0.3.4

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
  SHA256:
3
- metadata.gz: cc1dda6853c5b404f0e0fc39e99a683ab07e2c0fbe1b1b1652d4fc435795478a
4
- data.tar.gz: cea28ea197759a048180cb96a8b7bac0f05e2ce9bdc6e77cb568bfcd0f19f230
3
+ metadata.gz: e552a1dc3cc22d3fa1e614a440e86820ec7f95157711f77cfb5b2492966a4414
4
+ data.tar.gz: d014f9712b6493403d09a35b650467070dd46079a6bf401f22aa2da9edcb79a3
5
5
  SHA512:
6
- metadata.gz: a78da1bd982ab52563ec1032f5ad678fbdf73019e02eaa21552cfc48783303aa715a9eecaa626687ea44a81177e91e1b39c29ee84ec317f7b929e43b181989c8
7
- data.tar.gz: 25bd47a6a122d648d351b3fac73c3938d0e42eb556869cd6c618a096225e3e09d218f2cfbf8994fae1657ecce38e9978d94f27db48adbf820c9dd0bc1d845186
6
+ metadata.gz: 6c258058969660cf9c45a6a1fb5193b1f5fdba24cda123bd77257531251da295082c5c71af48af16aa01fae9f28539c66409b8900d005ba525ad4ab52aa70ad8
7
+ data.tar.gz: 5bf9584a2c7be956483792568aa19e8996ec116ae8c49998da39e104c5943414ed3b6fb8ef6d3664958c851037292ef769f6b4248b7cca894a21d43c03d1aa11
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
data/lib/simple/httpd.rb CHANGED
@@ -7,18 +7,22 @@ class Simple::Httpd
7
7
  end
8
8
 
9
9
  require "simple/service"
10
-
11
10
  require "simple/httpd/helpers"
12
11
  require "simple/httpd/base_controller"
13
12
  require "simple/httpd/version"
14
13
  require "simple/httpd/mount"
15
14
  require "simple/httpd/server"
16
-
17
15
  require "simple/httpd/service_adapter"
18
16
 
19
17
  class Simple::Httpd
20
18
  SELF = self
21
19
 
20
+ class << self
21
+ attr_accessor :env
22
+ end
23
+
24
+ self.env = "development"
25
+
22
26
  # returns a logger for Simple::Httpd.
23
27
  #
24
28
  # Initially we default to <tt>::Simple::CLI.logger</tt>. This gives colored
@@ -1,8 +1,5 @@
1
1
  module Simple
2
2
  class Httpd
3
- class << self
4
- attr_accessor :env
5
- end
6
3
  end
7
4
  end
8
5
 
@@ -78,11 +75,11 @@ module Simple::Httpd::CLI
78
75
  private
79
76
 
80
77
  def prepare_environment!(environment:)
81
- ::Simple::Httpd.env = environment
82
78
  start_simplecov if environment == "test"
83
79
 
84
80
  # late loading simple/httpd, for simplecov support
85
81
  require "simple/httpd"
82
+ ::Simple::Httpd.env = environment
86
83
  end
87
84
 
88
85
  def build_app!(mounts:, services:)
@@ -72,7 +72,7 @@ module Simple::Httpd::ServiceAdapter
72
72
  # define sinatra route.
73
73
  route(verb, path) do
74
74
  ::Simple::Service.with_context(context) do
75
- result = ::Simple::Service.invoke2(service, action_name, args: self.parsed_body, flags: self.params)
75
+ result = ::Simple::Service.invoke(service, action_name, args: self.parsed_body, flags: stringified_params)
76
76
  encode_result(result)
77
77
  end
78
78
  end
@@ -91,6 +91,12 @@ module Simple::Httpd::ServiceAdapter
91
91
  end
92
92
 
93
93
  module Helpers
94
+ def stringified_params
95
+ params.each_with_object({}) do |(k,v), hsh|
96
+ hsh[k.to_s] = v
97
+ end
98
+ end
99
+
94
100
  def context
95
101
  # We return nil here. nil *is* a valid value for Simple::Service.with_context.
96
102
  # Important is that with_context is being called.
data/simple-httpd.gemspec CHANGED
@@ -24,6 +24,6 @@ Gem::Specification.new do |gem|
24
24
  gem.add_dependency "sinatra", "~> 2"
25
25
  # gem.add_dependency "sinatra-reloader", "~> 1"
26
26
  gem.add_dependency "expectation", "~> 1"
27
- gem.add_dependency "simple-cli", "~> 0.3.3"
28
- gem.add_dependency "simple-service", "~> 0.1.3"
27
+ gem.add_dependency "simple-cli", "~> 0.3.5"
28
+ gem.add_dependency "simple-service", "~> 0.1.5"
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-httpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: neatjson
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.3.3
61
+ version: 0.3.5
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.3.3
68
+ version: 0.3.5
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simple-service
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.3
75
+ version: 0.1.5
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.3
82
+ version: 0.1.5
83
83
  description: Super-simple HTTPD server - sinatra w/gimmiks
84
84
  email: eno@radiospiel.org
85
85
  executables: