lennarb 0.4.1 → 0.4.2

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: 0e395a91c3650883770feaf41c00a2be532f9ac0b3919a6ed26fcc4758ae3319
4
- data.tar.gz: 25f09b0d53fb906eee6cd73197b970a01213a64ee4e8e0052e8bc73dca506d0b
3
+ metadata.gz: d8f83fbde3862f89138c06960e7e10d92febf1b2568ec1ac7d5f414e56eb7861
4
+ data.tar.gz: 2ae1191814fc395c684f7d3b52a3d16d41cdb722d61ebd1c18937ab7e2eeff00
5
5
  SHA512:
6
- metadata.gz: 034171202b487ef2b9de9fd21995df2918f6e4da6427088c665644646f34e8d3d4e4238b8708de2fb89a3303fd9d3d3f334c8402ee66ba70fdb889f8be7eca00
7
- data.tar.gz: 66308251d5eaf6361f8e4d464858a068dfeaa49051d2cfb1157e2ca52a21338639ba7af8ceb92bba15ca8bbed76124a493c30d58563b1c0403fc403c0946ad87
6
+ metadata.gz: 9bf21b6aeaaafc3b1c1f795ae356883ad6c4581506527f6b92b2a10b823770e6d5a8249dc7ebacc0776e0d5a8b4d10a818dcb05ac22ec5cb48e84c7f027d9925
7
+ data.tar.gz: 96a9067abdf1f6062da9cac71fd79df3a7da8d01a19d662419c9f7d9498438b57299074a5ac2ac86b44271f263e0a52c69d8f48e69c7843177191a653d68e508
data/changelog.md CHANGED
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.1] - 2024-08-02
9
+
10
+ ### Change
11
+
12
+ - Change behavior of `Lennarb::ApplicationBase` class to be the base class of the `Lennarb` class. Now, the `Lennarb` class is a subclass of `Lennarb::ApplicationBase` class.
13
+
14
+ That permits to create a new application with the `Lennarb::ApplicationBase` class and use http methods to create the routes. Ex.
15
+
16
+ ```rb
17
+ # app.rb
18
+
19
+ require 'lennarb'
20
+
21
+ class MyApp < Lennarb::ApplicationBase
22
+ get '/hello' do |req, res|
23
+ res.html('Hello World')
24
+ end
25
+ end
26
+ ```
27
+
28
+ ### Removed
29
+
30
+ - Remove `Lennarb::Application` module from the project. Now, the `Lennarb` class is the main class of the project.
31
+
32
+
8
33
  ## [0.4.0] - 2024-07-02
9
34
 
10
35
  ### Added
@@ -80,7 +80,7 @@ class Lennarb
80
80
  def write(str)
81
81
  str = str.to_s
82
82
  @length += str.bytesize
83
- @headers[CONTENT_LENGTH] ||= @length.to_s
83
+ @headers[CONTENT_LENGTH] = @length.to_s
84
84
  @body << str
85
85
  end
86
86
 
@@ -4,7 +4,7 @@
4
4
  # Copyright, 2023-2024, by Aristóteles Coutinho.
5
5
 
6
6
  class Lennarb
7
- VERSION = '0.4.1'
7
+ VERSION = '0.4.2'
8
8
 
9
9
  public_constant :VERSION
10
10
  end
data/lib/lennarb.rb CHANGED
@@ -76,10 +76,12 @@ class Lennarb
76
76
  # @returns [void]
77
77
  #
78
78
  def get(path, &block) = add_route(path, :GET, block)
79
- def post(path, &block) = add_route(path, :POST, block)
80
79
  def put(path, &block) = add_route(path, :PUT, block)
80
+ def post(path, &block) = add_route(path, :POST, block)
81
+ def head(path, &block) = add_route(path, :HEAD, block)
81
82
  def patch(path, &block) = add_route(path, :PATCH, block)
82
83
  def delete(path, &block) = add_route(path, :DELETE, block)
84
+ def options(path, &block) = add_route(path, :OPTIONS, block)
83
85
 
84
86
  private
85
87
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lennarb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aristóteles Coutinho