Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-ngx-mruby-ext
Extended Nginx class for ngx_mruby. You can exnted Nginx class by mrbgem.
https://github.com/matsumotory/mruby-ngx-mruby-ext
Last synced: about 2 months ago
JSON representation
Extended Nginx class for ngx_mruby. You can exnted Nginx class by mrbgem.
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-ngx-mruby-ext
- Owner: matsumotory
- License: other
- Created: 2014-02-26T08:42:18.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-13T06:15:59.000Z (about 10 years ago)
- Last Synced: 2024-10-18T18:24:13.309Z (3 months ago)
- Language: Ruby
- Size: 184 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# This is moved to [ngx_mruby core](https://github.com/matsumoto-r/ngx_mruby).
# mruby-ngx-mruby-ext [![Build Status](https://travis-ci.org/matsumoto-r/mruby-ngx-mruby-ext.png?branch=master)](https://travis-ci.org/matsumoto-r/mruby-ngx-mruby-ext)
Extended Nginx class for ngx_mruby. You can exnted Nginx class by mrbgem.## install by mrbgems
- add conf.gem line to `build_config.rb````ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :git => 'https://github.com/matsumoto-r/mruby-ngx-mruby-ext.git'
end
```
## example- define method by mrbgem
```ruby
class Nginx
class Headers_in
def user_agent
self["User-Agent"]
end
end
end
```- you can use the method defined by mruby-ngx-mruby-ext in ngx_mruby
```ruby
Nginx.echo Nginx::Request.new.headers_in.user_agent
#=> "your user agent"
```## License
under the MIT License:
- see LICENSE file