nephos-server 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fdc970288b999aeab76422947f72cfbfcba0710
4
- data.tar.gz: 38042ea637910e98ca204e6119d457b51417c3a0
3
+ metadata.gz: 88dc123fd7778e73c4170a998c38f2a29bf63ad4
4
+ data.tar.gz: 0831153c3949c6c869212c28fc98ee7c03046b23
5
5
  SHA512:
6
- metadata.gz: e95c52c9519e04511f62db2d89197923ebf5bc485bad8997c0facf3142cf423953b010e997345df57ff1db1ff03e73f275fc747ef36a2fd1e2057b4ba48dc858
7
- data.tar.gz: a8e1e84c5d8f58b0598b5987759ea1e545258977f96a0745f81fdbf1394f23055daa2485cf29501cd7c41ead58f2e19cf62ad0b8fb9df491121984013361ee1c
6
+ metadata.gz: 1164950bbde121ac27a0e779bbe3e8db88c1832d6b18021355382c698bc7604c8c9877fe9721ab31f9aa059c88ffd2c85b4c43ea63c90141134a4dc5c4117b8d
7
+ data.tar.gz: ebf578920edd66b5171670b3675b37dd988c04855350eb0a6434c1e1ff6e9316909a2a73aa32dd7869b3ccc738fc14c0a86bd08c461167fc26b315c445ca1409
data/CHANGELOG ADDED
@@ -0,0 +1,101 @@
1
+ v0.4.3
2
+ * improve gemspec changelog
3
+ * improve generator
4
+ * improve responder (with integer argument)
5
+ * fix router helpers
6
+
7
+ v0.4.2
8
+ * add version to code
9
+ * fix a file permissions
10
+ * add generator route --rm
11
+ * add test for generator (routes and route --rm)
12
+ * improve routes generator with a 4th optional argument
13
+
14
+ v0.4.1
15
+ * fix regression for binary with --debug feature
16
+ * improve routes generator
17
+
18
+ v0.4.0
19
+ * add nephos-status executable
20
+ * add nephos-generator route option
21
+
22
+ v0.3.2
23
+ * fix gem
24
+ * add tests for generator
25
+
26
+ v0.3.1
27
+ * fix controller parameters
28
+ * add new unitary tests
29
+
30
+ v0.3.0
31
+ * improve documentation (and fix it)
32
+ * add documentation (guide for slim, sequel, generator)
33
+
34
+ v0.2.4
35
+ * improve global coherence (file, class, consts names)
36
+ * rename directory "controllers/" -> "app/"
37
+
38
+ v0.2.3
39
+ * add class params
40
+ * change file place (controller)
41
+ * improve controller
42
+ * add unitary tests (params, controller)
43
+
44
+ v0.2.2
45
+ * minor fix bug
46
+
47
+ v0.2.0
48
+ * add documentation
49
+
50
+ v0.1.12
51
+ * fix regressions from v0.1.11 and previous (routing)
52
+ * add complet unitary tests (rendering)
53
+ * add partial unitary tests (routing)
54
+ * update gemspec
55
+ * factorize some code
56
+
57
+ v0.1.11
58
+ * fix regressions from v0.1.10
59
+ * improve rendering code
60
+
61
+ v0.1.10
62
+ * improve status content
63
+ * add url's parameters like /u/:param
64
+
65
+ v0.1.9
66
+ * minor fixes
67
+ * improve exceptions
68
+ * improve generator
69
+
70
+ v0.1.8
71
+ * improve rendering
72
+ * add html rendering
73
+ * improve documentation
74
+ * improve exceptions
75
+
76
+ v0.1.7
77
+ * improve routing error
78
+
79
+ v0.1.6
80
+ * fix documentation
81
+
82
+ v0.1.5
83
+ * improve routing (resource and matching)
84
+
85
+ v0.1.4
86
+ * improve routing
87
+
88
+ v0.1.3
89
+ * improve generators (errors and arguments)
90
+
91
+ v0.1.2
92
+ * fix procfile
93
+
94
+ v0.1.1
95
+ * rename src to controllers
96
+ * improve generator
97
+ v0.1
98
+ * basic routing, rendering, and controllers
99
+ * valid gemspec
100
+ * basic working server
101
+ * basic generator
data/README.md CHANGED
@@ -67,6 +67,7 @@ end
67
67
  To render a content to the client, you can return informations from a Controller method:
68
68
 
69
69
  ```ruby
70
+ return 404
70
71
  return {status: code}
71
72
  return {status: code, content: "Not today"}
72
73
  return {json: {status: "resource created"}, status: 201}
@@ -98,6 +99,12 @@ end
98
99
 
99
100
  ## TODO v0.4
100
101
  - improve generator with application status, tests, more generation (routing, ...)
102
+ - improved render status
103
+
104
+ ## TODO v0.5
105
+ - improve documentation (bin)
106
+ - executables with version
107
+ - improve executables (tests, arguments)
101
108
 
102
109
  ## TODO v1
103
110
  - Improved Routing (more helper options)
data/bin/nephos-generator CHANGED
@@ -49,6 +49,7 @@ module Nephos
49
49
  controller = dest_c.split("#")[0]
50
50
  method = dest_c.split("#")[1]
51
51
  end
52
+ verb = verb.upcase
52
53
  line = "add_route \"#{verb}\", url: \"#{url}\", controller: \"#{controller}\", method: \"#{method}\""
53
54
  if exists? line
54
55
  if $remove
data/bin/nephos-server CHANGED
@@ -33,7 +33,8 @@ begin
33
33
  Nephos::Server.start($server_port)
34
34
 
35
35
  rescue RoutingError => err
36
- puts "#{err.class}. Check out the documentation and `routes.rb` file: #{err.message}"
36
+ puts "#{err.class}. Check out the documentation and `routes.rb` file."
37
+ puts err.message
37
38
 
38
39
  rescue => err
39
40
  puts "Error: #{err.message}"
@@ -3,8 +3,8 @@ def route_prefix
3
3
  File.join(["/"] + @route_prefix)
4
4
  end
5
5
 
6
- def add_route(what, verb)
7
- raise InvalidRoute unless what.is_a? Hash
6
+ def add_route(verb, what)
7
+ raise InvalidRoute, "what must be a hash" unless what.is_a? Hash
8
8
  what[:url] = File.expand_path File.join(route_prefix, what[:url])
9
9
  Nephos::Router.check!(what)
10
10
  Nephos::Router.add_params!(what)
@@ -13,17 +13,17 @@ end
13
13
 
14
14
  # @param what [Hash]
15
15
  def get what
16
- add_route what, "GET"
16
+ add_route "GET", what
17
17
  end
18
18
 
19
19
  # @param what [Hash]
20
20
  def post what
21
- add_route what, "POST"
21
+ add_route "POST", what
22
22
  end
23
23
 
24
24
  # @param what [Hash]
25
25
  def put what
26
- add_route what, "PUT"
26
+ add_route "PUT", what
27
27
  end
28
28
 
29
29
  def resource(name, &block)
@@ -65,6 +65,7 @@ module Nephos
65
65
  # @param params [Hash, Symbol]
66
66
  def self.render params
67
67
  return [204, ct_specific({type: PRESET_CT[:plain]}), [""]] if params == :empty
68
+ return render(status: params) if params.is_a? Integer
68
69
  params = set_default_params(params)
69
70
  return [
70
71
  params[:status],
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = 'nephos-server'
3
3
  s.version = File.read("version")
4
4
  s.date = Time.now.getgm.to_s.split.first
5
- s.summary = 'See Changelog'
5
+ s.summary = File.read("CHANGELOG").match(/^v[^\n]+\n((\t[^\n]+\n)+)/m)[1].split("\t").join
6
6
  s.description = ' a minimalist server, based on rack/puma, with routing, rendering, and controllers. Designed for quick api.'
7
7
  s.authors = [
8
8
  'poulet_a'
@@ -20,6 +20,7 @@ lib/nephos-server/router/main.rb
20
20
  lib/nephos-server/router/load.rb
21
21
  lib/nephos-server/router/helpers.rb
22
22
  README.md
23
+ CHANGELOG
23
24
  Rakefile
24
25
  Procfile
25
26
  Gemfile
data/version CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nephos-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - poulet_a
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-06 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nomorebeer
@@ -67,6 +67,7 @@ email:
67
67
  - lib/nephos-server/router/load.rb
68
68
  - lib/nephos-server/router/helpers.rb
69
69
  - README.md
70
+ - CHANGELOG
70
71
  - Rakefile
71
72
  - Procfile
72
73
  - Gemfile
@@ -93,6 +94,7 @@ executables:
93
94
  extensions: []
94
95
  extra_rdoc_files: []
95
96
  files:
97
+ - CHANGELOG
96
98
  - Gemfile
97
99
  - Gemfile.lock
98
100
  - Procfile
@@ -146,5 +148,6 @@ rubyforge_project:
146
148
  rubygems_version: 2.4.8
147
149
  signing_key:
148
150
  specification_version: 4
149
- summary: See Changelog
151
+ summary: "* improve gemspec changelog * improve generator * improve responder (with
152
+ integer argument) * fix router helpers"
150
153
  test_files: []