Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #13

Merged
merged 25 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2972b20
documetation: update
aristotelesbr Nov 27, 2023
ade61b0
doc: update router docs
aristotelesbr Nov 29, 2023
607fd92
refactory: add default middlewares and set envir.
aristotelesbr Nov 29, 2023
72dec50
documentation: update changelog
aristotelesbr Nov 29, 2023
3866918
test: Add test helpers and base test class
aristotelesbr Dec 4, 2023
fc0e11c
chore: add rack-test gem
aristotelesbr Dec 4, 2023
84b726f
chore: update gemspec
aristotelesbr Dec 4, 2023
17d3d58
test: remove invalid status and cookie tests
aristotelesbr Dec 4, 2023
8eb8e14
refactor: response class attributes and methods
aristotelesbr Dec 4, 2023
0eab726
fix: JSON parsing in test_invalid_json_body
aristotelesbr Dec 4, 2023
b20ae22
feat: add put_header method to set request headers
aristotelesbr Dec 4, 2023
7697dd6
test: ensure build and chain middlewares
aristotelesbr Dec 4, 2023
58f986f
refactor: becomes in singleton class
aristotelesbr Dec 4, 2023
478286d
refactor: rename Base to Application
aristotelesbr Dec 4, 2023
fbcf029
refactor: router.rb to use default middlewares
aristotelesbr Dec 4, 2023
704dbc4
test: for Lenna::Application request api
aristotelesbr Dec 4, 2023
9058ac8
test: ensure params=, status=, bod= and headers=
aristotelesbr Dec 4, 2023
1133345
refactor: remove commented out code and add alias
aristotelesbr Dec 4, 2023
0b952a4
doc: update CHANGELOG.md 0.1.6:
aristotelesbr Dec 4, 2023
95b0036
doc: updte README.md
aristotelesbr Dec 4, 2023
f2b5454
doc: updte README.md
aristotelesbr Dec 4, 2023
13d5108
doc: updte README.md
aristotelesbr Dec 4, 2023
dc38fe9
doc: updte README.md
aristotelesbr Dec 4, 2023
64d4a0b
doc: updte README.md
aristotelesbr Dec 4, 2023
5a83917
doc: updte README.md
aristotelesbr Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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