Skip to content

Commit

Permalink
Merge pull request #13 from aristotelesbr/development
Browse files Browse the repository at this point in the history
  • Loading branch information
aristotelesbr authored Dec 13, 2023
2 parents 114725e + 5a83917 commit 464cee8
Show file tree
Hide file tree
Showing 24 changed files with 850 additions and 236 deletions.
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,61 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.6] - 2023-29-11

### Changed

- Add default middlewares to `Lennarb::Router` class. Now, the `Lennarb::Router` class has the following middlewares by default:
- `Lennarb::Middleware::Default::Logging`
- `Lennarb::Middleware::Default::ErrorHandling`

### Changed

- Replace `assign_status` to `=` on Response

```rb
response.status = 200
```

- Rename `Lenna::Base` to `Lenna::Application` and accept a block to build the routes. Ex.

```rb
Lenna::Application.new do |app|
app.get '/hello' do |req, res|
res.status = 200
res['Content-Type'] = 'text/plain'
res.body = 'Hello World'
end
app.post '/hello' do |req, res|
res.status = 200
res['Content-Type'] = 'text/plain'
res.body = 'Hello World'
end
end
```

- The Middleware app now implements [Singleton](https://ruby-doc.org/stdlib-2.5.1/libdoc/singleton/rdoc/Singleton.html) pattern to manager state.

### Added

- Add alias to `assign_header` to `[]=` on Response. Now, you can use:

```rb
response['Content-Type'] = 'application/json'
```

- Add alias to `assign_body` to `:body=` on Response. Now, you can use:

```rb
response.body = 'Hello World'
```

- Add alias to `assign_params` to `:params=` on Request. Now, you can use:

```rb
request.params = { name: 'John' }
```

## [0.1.5] - 2023-25-11

### Added
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ group :development, :test do
# Minitest provides a complete suite of testing facilities supporting TDD,
# BDD, mocking, and benchmarking.
gem 'minitest', '~> 5.20'
# [https://rubygems.org/gems/rack-test]
# Rack::Test is a small, simple testing API for Rack apps. It can be used on
# its own or as a reusable starting point for Web frameworks and testing
# libraries to build on.
gem 'rack-test', '~> 2.1'
end
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
lennarb (0.1.5)
lennarb (0.1.6)
colorize (~> 1.1)
puma (~> 6.4)
rack (~> 3.0, >= 3.0.8)
Expand All @@ -24,6 +24,8 @@ GEM
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.8)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.1.0)
regexp_parser (2.8.2)
Expand Down Expand Up @@ -55,6 +57,7 @@ DEPENDENCIES
minitest (~> 5.20)
puma (~> 6.4)
rack (~> 3.0, >= 3.0.8)
rack-test (~> 2.1)
rake (~> 13.0, >= 13.0.6)
rubocop (~> 1.57, >= 1.57.2)
rubocop-minitest (~> 0.33.0)
Expand Down
Loading

0 comments on commit 464cee8

Please sign in to comment.