simple-httpd 0.0.2 → 0.0.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: e3943911c33876d60f023ec58fab2d875eb9e2b0b23c3649f0d7601e8b1f304c
4
- data.tar.gz: 7ff0ef4341bb717ed1b6fafc7339335aa738a660638df64d1b5eba5ec6174a2c
3
+ metadata.gz: 3273a1672a08dca30bf4541e2169bee7e5eb107b0cbf4f335c20c5c4d2190756
4
+ data.tar.gz: c5262312bb70eb9e213688d6b85c05c4c1bd447d3e682eed5f1ba415d69a33b9
5
5
  SHA512:
6
- metadata.gz: ca193f4c704a1d94f2cc193f953c259c97164dcc28eae9a75347b72e18b31447cf1222df51c36109c129827e09e65e9ad0d3c098fb63a41597052c86cbf08277
7
- data.tar.gz: 27045e31517c41301ad6ce9e43c8bad59b90e4e099b64c115a9061ba6eed6b28d238e1a117a65efe85fa3fd0d1d3131a369ffd98cf1beff4b98ceabf94854aa6
6
+ metadata.gz: 44224855c4874348894465f0a56e4910a4d136a5fb675dd34dec7d4306affacdae9c161caccad1eb91122eddb9d1894811938c6f3888abba7e8090d8111d0657
7
+ data.tar.gz: 6b4bc045304a398031f17471d74c3dca151b0b7ae3847f859fbdf91e80777c9f77b10946f380ebf12e5946a9e6caca7f60a79cdd274ce593a8c25f00e41fb963
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.4
@@ -100,6 +100,7 @@ class Simple::Httpd::BaseController
100
100
  # -- print unspecified errors.
101
101
 
102
102
  error do |exc|
103
+ content_type :text
103
104
  message = <<~MSG
104
105
  === #{exc.class.name} =====================
105
106
  #{exc.message.chomp}
@@ -15,7 +15,7 @@ class VersionNumberTracker
15
15
  end
16
16
 
17
17
  def auto_version_bump
18
- old_version_number = File.read("VERSION")
18
+ old_version_number = File.read("VERSION").chomp
19
19
  old = old_version_number.split('.')
20
20
  current = old[0..-2] << old[-1].next
21
21
  new_version_number = current.join('.')
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.0.2
4
+ version: 0.0.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-06-09 00:00:00.000000000 Z
11
+ date: 2019-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: neatjson
@@ -162,7 +162,6 @@ files:
162
162
  - lib/simple/httpd/base_controller/build_url.rb
163
163
  - lib/simple/httpd/base_controller/cors.rb
164
164
  - lib/simple/httpd/base_controller/debug.rb
165
- - lib/simple/httpd/base_controller/erb.rb
166
165
  - lib/simple/httpd/base_controller/error_handling.rb
167
166
  - lib/simple/httpd/base_controller/json.rb
168
167
  - lib/simple/httpd/base_controller/x_processing.rb
@@ -1,20 +0,0 @@
1
- require "erb"
2
-
3
- class Simple::Httpd::BaseController
4
- # A simple ERB renderer
5
- helpers do
6
- module ERB::Helpers
7
- def self.json(data)
8
- JSON.pretty_generate(data)
9
- end
10
- end
11
-
12
- def erb(template, data)
13
- content_type "text/html"
14
-
15
- erb = template.is_a?(ERB) ? template : ERB.new(template)
16
- data[:helpers] = ERB::Helpers
17
- erb.result_with_hash(data)
18
- end
19
- end
20
- end