trusted 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7b33887e8738fd710d3592bf380a0843a862dd95
4
+ data.tar.gz: 4a1b8204c0e4be0182003ef14ae3920723409d92
5
+ SHA512:
6
+ metadata.gz: 74efdc48c283684844d2d1133ca94ef061275f23a5ea354ee02f874b94e34cc4afa0339ba07286e88317d5bea7d6333b158b08407a09fbf45b645e16bdc7aca8
7
+ data.tar.gz: ec7414302002343fc136d3ad6b6c1a9db5b346be38e4496bae8c5e8d7147303249954a3f01a67919fe8ba645b6fee828d6b48f07eacaba8f6d6d0b4a5ecc817f
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ /ext/trusted/target
12
+ /ext/trusted/Cargo.lock
13
+
14
+ /lib/*.bundle
15
+ /lib/*.dylib
16
+ /lib/*.so
17
+
18
+ *.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in trusted.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Dmitry Gritsay
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Trusted
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/trusted`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'trusted'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install trusted
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/trusted. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'thermite/tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ Thermite::Tasks.new(cargo_project_path: 'ext/trusted')
7
+
8
+ task default: %w(thermite:build)
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'trusted'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,13 @@
1
+ [package]
2
+ name = "trusted"
3
+ version = "0.2.0"
4
+ authors = ["Dmitry Gritsay <dmitry@vinted.com>"]
5
+
6
+ [lib]
7
+ crate-type = ["dylib"]
8
+
9
+ [dependencies]
10
+ hyper = "0.9.10"
11
+ hyperlocal = { git = "https://github.com/softprops/hyperlocal.git" }
12
+ lazy_static = "0.2.1"
13
+ ruru = "0.8.1"
@@ -0,0 +1,55 @@
1
+ use std::io::Write;
2
+ use std::sync::Mutex;
3
+ use std::sync::mpsc::{Sender, Receiver};
4
+
5
+ use hyper::server::{Handler as HyperHandler, Request as HyperRequest, Response as HyperResponse};
6
+ use hyper::status::StatusCode;
7
+
8
+ use request::Request;
9
+ use response::Response;
10
+
11
+ pub struct Handler {
12
+ sender: Mutex<Sender<Request>>,
13
+ receiver: Mutex<Receiver<Response>>,
14
+ }
15
+
16
+ impl Handler {
17
+ pub fn new(sender: Sender<Request>, receiver: Receiver<Response>) -> Self {
18
+ Handler {
19
+ sender: Mutex::new(sender),
20
+ receiver: Mutex::new(receiver),
21
+ }
22
+ }
23
+ }
24
+
25
+ impl HyperHandler for Handler {
26
+ fn handle(&self, hyper_request: HyperRequest, mut hyper_response: HyperResponse) {
27
+ println!("[hyper] New request received");
28
+
29
+ self.sender.lock().unwrap().send(hyper_request.into()).unwrap();
30
+
31
+ println!("[hyper] Sent to main thread");
32
+
33
+ let response = self.receiver.lock().unwrap().recv().unwrap();
34
+
35
+ println!("[hyper] Received response from main thread");
36
+
37
+ {
38
+ let headers = hyper_response.headers_mut();
39
+ *headers = response.headers;
40
+ }
41
+
42
+ {
43
+ let status = hyper_response.status_mut();
44
+ *status = StatusCode::from_u16(response.status);
45
+ }
46
+
47
+ println!("[hyper] Starting to send response to client");
48
+
49
+ let mut res = hyper_response.start().unwrap();
50
+ res.write_all(response.body.as_bytes()).unwrap();
51
+
52
+ println!("[hyper] Response successfully sent to client");
53
+ println!("[hyper] ------------------------------------")
54
+ }
55
+ }
@@ -0,0 +1,19 @@
1
+ #[macro_use] extern crate lazy_static;
2
+ #[macro_use] extern crate ruru;
3
+
4
+ extern crate hyper;
5
+ extern crate hyperlocal;
6
+
7
+ mod handler;
8
+ mod request;
9
+ mod request_processor;
10
+ mod response;
11
+ mod ruby;
12
+ mod server;
13
+
14
+ use ruby::Server;
15
+
16
+ #[no_mangle]
17
+ pub extern fn initialize_my_app() {
18
+ Server::define_ruby_class();
19
+ }
@@ -0,0 +1,46 @@
1
+ use std::convert::From;
2
+ use std::io::Read;
3
+
4
+ use hyper::header::Headers;
5
+ use hyper::server::{Request as HyperRequest};
6
+
7
+ pub struct Request {
8
+ pub method: String,
9
+ pub url: String,
10
+ pub path_info: String,
11
+ pub query_string: String,
12
+ pub remote_addr: String,
13
+ pub server_port: String,
14
+ pub headers: Headers,
15
+ pub body: String,
16
+ }
17
+
18
+ impl<'a, 'b> From<HyperRequest<'a, 'b>> for Request {
19
+ fn from(mut request: HyperRequest) -> Self {
20
+ let mut body = String::new();
21
+
22
+ request.read_to_string(&mut body).unwrap();
23
+
24
+ let method = request.method.to_string();
25
+ let url = request.uri.to_string();
26
+ let parsed_url = url.clone();
27
+ let parsed_url = parsed_url.split('?').collect::<Vec<&str>>();
28
+
29
+ let path_info = parsed_url.get(0).map(|s| *s).unwrap_or("").to_string();
30
+ let query_string = parsed_url.get(1).map(|s| *s).unwrap_or("").to_string();
31
+
32
+ let remote_addr = request.remote_addr.ip().to_string();
33
+ let server_port = request.remote_addr.port().to_string();
34
+
35
+ Request {
36
+ method: method,
37
+ url: url,
38
+ path_info: path_info,
39
+ query_string: query_string,
40
+ remote_addr: remote_addr,
41
+ server_port: server_port,
42
+ headers: request.headers,
43
+ body: body,
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,28 @@
1
+ use ruru::{Object, Proc};
2
+
3
+ use request::Request;
4
+ use response::Response;
5
+ use ruby::{Request as RubyRequest, Response as RubyResponse};
6
+
7
+ pub struct RequestProcessor<'a> {
8
+ request: Request,
9
+ ruby_handler: &'a Proc,
10
+ }
11
+
12
+ impl<'a> RequestProcessor<'a> {
13
+ pub fn new(request: Request, ruby_handler: &'a Proc) -> Self {
14
+ RequestProcessor {
15
+ request: request,
16
+ ruby_handler: ruby_handler,
17
+ }
18
+ }
19
+
20
+ pub fn handle(self) -> Response {
21
+ let ruby_request = RubyRequest::from(self.request);
22
+ let ruby_response = RubyResponse::new();
23
+
24
+ self.ruby_handler.call(vec![ruby_request.to_any_object(), ruby_response.to_any_object()]);
25
+
26
+ ruby_response.into()
27
+ }
28
+ }
@@ -0,0 +1,23 @@
1
+ use std::convert::From;
2
+
3
+ use hyper::header::Headers;
4
+
5
+ use ruby::Response as RubyResponse;
6
+
7
+ pub struct Response {
8
+ pub status: u16,
9
+ pub body: String,
10
+ pub headers: Headers,
11
+ }
12
+
13
+ impl From<RubyResponse> for Response {
14
+ fn from(ruby_response: RubyResponse) -> Self {
15
+ let headers = ruby_response.headers();
16
+
17
+ Response {
18
+ status: ruby_response.status() as u16,
19
+ body: ruby_response.body(),
20
+ headers: headers,
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ mod request;
2
+ mod response;
3
+ mod server;
4
+
5
+ pub use self::request::Request;
6
+ pub use self::response::Response;
7
+ pub use self::server::Server;
@@ -0,0 +1,44 @@
1
+ use std::convert::From;
2
+
3
+ use ruru::{Class, Hash, Object, RString};
4
+
5
+ use request::Request as RustRequest;
6
+
7
+ lazy_static! {
8
+ static ref REQUEST_CLASS: Class = {
9
+ Class::from_existing("Trusted").get_nested_class("Request")
10
+ };
11
+ }
12
+
13
+ class!(Request);
14
+
15
+ impl From<RustRequest> for Request {
16
+ fn from(request: RustRequest) -> Self {
17
+ let mut headers = Hash::new();
18
+
19
+ for header in request.headers.iter() {
20
+ let field = header.name().to_string().replace("-", "_").to_uppercase();
21
+ let value = header.value_string();
22
+
23
+ let field = format!("HTTP_{}", field);
24
+
25
+ headers.store(RString::new(&field), RString::new(&value));
26
+ }
27
+
28
+ let request = (*REQUEST_CLASS).new_instance(
29
+ vec![
30
+ RString::new(&request.method).to_any_object(),
31
+ RString::new(&request.url).to_any_object(),
32
+ RString::new(&request.path_info).to_any_object(),
33
+ RString::new(&request.query_string).to_any_object(),
34
+ RString::new(&request.remote_addr).to_any_object(),
35
+ RString::new(&request.server_port).to_any_object(),
36
+ headers.to_any_object(),
37
+ RString::new(&request.body).to_any_object(),
38
+ ]
39
+ );
40
+
41
+ // We can use unsafe here, because request is created by our own code
42
+ unsafe { request.to::<Self>() }
43
+ }
44
+ }
@@ -0,0 +1,47 @@
1
+ use hyper::header::Headers;
2
+ use ruru::{Class, Fixnum, Hash, Object, RString};
3
+
4
+ lazy_static! {
5
+ static ref RESPONSE_CLASS: Class = {
6
+ Class::from_existing("Trusted").get_nested_class("Response")
7
+ };
8
+ }
9
+
10
+ class!(Response);
11
+
12
+ impl Response {
13
+ pub fn new() -> Self {
14
+ let response = (*RESPONSE_CLASS).new_instance(vec![]);
15
+
16
+ // We can use unsafe here, because response is created by our own code
17
+ unsafe { response.to::<Self>() }
18
+ }
19
+
20
+ pub fn status(&self) -> i32 {
21
+ // We can use unsafe here, because response is created by our own code
22
+ let status = unsafe { self.send("status", vec![]).to::<Fixnum>().to_i64() };
23
+
24
+ status as i32
25
+ }
26
+
27
+ pub fn headers(&self) -> Headers {
28
+ let mut headers = Headers::new();
29
+
30
+ // We can use unsafe here, because response is created by our own code
31
+ let ruby_headers = unsafe { self.send("headers", vec![]).to::<Hash>() };
32
+
33
+ ruby_headers.each(|name, value| {
34
+ let name = unsafe { name.to::<RString>().to_string() };
35
+ let value = unsafe { value.to::<RString>().to_string() };
36
+
37
+ headers.set_raw(name.to_string(), vec![value.to_string().into_bytes()]);
38
+ });
39
+
40
+ headers
41
+ }
42
+
43
+ pub fn body(&self) -> String {
44
+ // We can use unsafe here, because the hash is constructed by our own app
45
+ unsafe { self.send("body", vec![]).to::<RString>().to_string_unchecked() }
46
+ }
47
+ }
@@ -0,0 +1,44 @@
1
+ use std::error::Error;
2
+
3
+ use ruru::{Class, NilClass, RString, Object, VM};
4
+
5
+ use server::Server as RustServer;
6
+
7
+ class!(Server);
8
+
9
+ methods!(
10
+ Server,
11
+ itself,
12
+
13
+ fn initialize(addr: RString) -> Server {
14
+ if let Err(ref error) = addr {
15
+ VM::raise(error.to_exception(), error.description());
16
+ }
17
+
18
+ itself.instance_variable_set("@addr", addr.unwrap());
19
+
20
+ itself
21
+ }
22
+
23
+ fn listen() -> NilClass {
24
+ let handler = VM::block_proc();
25
+
26
+ // We can use unsafe here, because the type of addr is checked in the constructor
27
+ let addr = unsafe { itself.instance_variable_get("@addr").to::<RString>().to_string() };
28
+
29
+ RustServer::new(addr).listen(handler);
30
+
31
+ NilClass::new()
32
+ }
33
+ );
34
+
35
+ impl Server {
36
+ pub fn define_ruby_class() {
37
+ Class::from_existing("Trusted").define(|itself| {
38
+ itself.define_nested_class("Server", None).define(|itself| {
39
+ itself.def("initialize", initialize);
40
+ itself.def("listen", listen);
41
+ });
42
+ });
43
+ }
44
+ }
@@ -0,0 +1,70 @@
1
+ use std::sync::mpsc;
2
+ use std::thread;
3
+
4
+ use hyper::server::Server as HyperServer;
5
+ use hyperlocal::UnixSocketServer;
6
+ use ruru::{Proc, VM};
7
+
8
+ use handler::Handler;
9
+ use request_processor::RequestProcessor;
10
+
11
+ pub struct Server {
12
+ addr: String,
13
+ }
14
+
15
+ enum ServerType {
16
+ Unix,
17
+ Tcp,
18
+ }
19
+
20
+ impl Server {
21
+ pub fn new(addr: String) -> Self {
22
+ Server { addr: addr }
23
+ }
24
+
25
+ pub fn listen(self, ruby_handler: Proc) {
26
+ println!("[rust] Start listening");
27
+
28
+ let (request_sender, request_receiver) = mpsc::channel();
29
+ let (response_sender, response_receiver) = mpsc::channel();
30
+
31
+ let handler = Handler::new(request_sender, response_receiver);
32
+
33
+ let server_type = ServerType::Unix;
34
+
35
+ thread::spawn(move || {
36
+ let handler_function = || -> () {
37
+ match server_type {
38
+ ServerType::Unix => {
39
+ UnixSocketServer::new("/tmp/trusted.sock").unwrap()
40
+ .handle(handler).unwrap();
41
+ },
42
+ ServerType::Tcp => {
43
+ HyperServer::http(self.addr.as_str()).unwrap()
44
+ .handle(handler).unwrap();
45
+ }
46
+ };
47
+ };
48
+
49
+ let unblock_function = || {
50
+ ()
51
+ };
52
+
53
+ VM::thread_call_without_gvl(
54
+ handler_function,
55
+ Some(unblock_function)
56
+ );
57
+ });
58
+
59
+ loop {
60
+ println!("[rust] Trying to receive from sender");
61
+ let request = request_receiver.recv().unwrap();
62
+
63
+ println!("[rust] Sending to Ruby");
64
+ let response = RequestProcessor::new(request, &ruby_handler).handle();
65
+
66
+ println!("[rust] Received response from Ruby, sending back to Hyper");
67
+ response_sender.send(response.into()).unwrap();
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,60 @@
1
+ require 'rack'
2
+ require 'rack/request'
3
+ require 'stringio'
4
+
5
+ module Rack
6
+ module Handler
7
+ class Trusted
8
+ def self.run(app, options = {})
9
+ ::Trusted::Server.new("0.0.0.0:3000").listen do |request, response|
10
+ puts "REQUEST: [#{request.method}] #{request.uri}"
11
+ puts "PATH_INFO: #{request.path_info}"
12
+ puts "QUERY_STRING: #{request.query_string}"
13
+ puts "REMOTE_ADDR: #{request.remote_addr.inspect}"
14
+ puts "SERVER_PORT: #{request.server_port.inspect}"
15
+ puts "REQUEST HEADERS: #{request.headers.inspect}"
16
+
17
+ rack_input = StringIO::new(request.body)
18
+
19
+ env = {
20
+ 'REQUEST_METHOD' => request.method,
21
+ 'REQUEST_URI' => request.uri,
22
+ 'PATH_INFO' => request.path_info,
23
+ 'QUERY_STRING' => request.query_string,
24
+ 'REMOTE_ADDR' => request.remote_addr,
25
+ 'SERVER_PORT' => '3000',
26
+ 'SERVER_NAME' => 'localhost',
27
+ 'SCRIPT_NAME' => '',
28
+ 'rack.version' => Rack::VERSION,
29
+ 'rack.input' => rack_input,
30
+ 'rack.errors' => $stderr,
31
+ 'rack.multithread' => false,
32
+ 'rack.multiprocess' => false,
33
+ 'rack.run_once' => false,
34
+ 'rack.url_scheme' => 'http',
35
+ 'rack.hijack?' => false
36
+ }
37
+
38
+ env.merge!(request.headers)
39
+
40
+ status, headers, body = app.call(env)
41
+
42
+ response.status = status
43
+ response.headers = headers
44
+
45
+ response.body = ''
46
+
47
+ body.each { |b| response.body.concat(b) }
48
+
49
+ body.close if body.respond_to?(:close)
50
+ end
51
+ end
52
+ end
53
+
54
+ register :trusted, 'Rack::Handler::Trusted'
55
+
56
+ def self.default(options = {})
57
+ Rack::Handler::Trusted
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,16 @@
1
+ module Trusted
2
+ class Request
3
+ attr_reader :method, :uri, :path_info, :query_string, :remote_addr, :server_port, :headers, :body
4
+
5
+ def initialize(method, uri, path_info, query_string, remote_addr, server_port, headers, body)
6
+ @method = method
7
+ @uri = uri
8
+ @path_info = path_info
9
+ @query_string = query_string
10
+ @remote_addr = remote_addr
11
+ @server_port = server_port
12
+ @headers = headers
13
+ @body = body
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Trusted
2
+ class Response
3
+ attr_accessor :status, :headers, :body
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Trusted
2
+ VERSION = '0.2.0'
3
+ end
data/lib/trusted.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'fiddle'
2
+
3
+ require 'trusted/request'
4
+ require 'trusted/response'
5
+ require 'trusted/version'
6
+
7
+ require 'rack/handler/trusted'
8
+
9
+ library_path = File.expand_path(
10
+ File.join(File.dirname(__FILE__), 'libtrusted.dylib')
11
+ )
12
+
13
+ library = Fiddle::dlopen(library_path)
14
+ function = Fiddle::Function.new(library['initialize_my_app'], [], Fiddle::TYPE_VOIDP)
15
+ function.call
16
+
17
+ module Trusted
18
+ end
data/trusted.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'trusted/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'trusted'
8
+ spec.version = Trusted::VERSION
9
+ spec.authors = ['Dmitry Gritsay']
10
+ spec.email = ['unseductable@gmail.com']
11
+
12
+ spec.summary = %q{Write a short summary, because Rubygems requires one.}
13
+ spec.description = %q{Write a longer description or delete this line.}
14
+ spec.homepage = "http://this-week-in-ruru.org/"
15
+ spec.license = 'MIT'
16
+
17
+ spec.extensions << 'Rakefile'
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.add_dependency 'thermite', '~> 0.6.0'
25
+
26
+ spec.add_development_dependency 'bundler', '~> 1.10'
27
+ spec.add_development_dependency 'rake', '~> 10.0'
28
+ spec.add_development_dependency 'rspec'
29
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: trusted
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Dmitry Gritsay
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thermite
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Write a longer description or delete this line.
70
+ email:
71
+ - unseductable@gmail.com
72
+ executables: []
73
+ extensions:
74
+ - Rakefile
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".travis.yml"
80
+ - CODE_OF_CONDUCT.md
81
+ - Gemfile
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - bin/console
86
+ - bin/setup
87
+ - ext/trusted/Cargo.toml
88
+ - ext/trusted/src/handler.rs
89
+ - ext/trusted/src/lib.rs
90
+ - ext/trusted/src/request.rs
91
+ - ext/trusted/src/request_processor.rs
92
+ - ext/trusted/src/response.rs
93
+ - ext/trusted/src/ruby/mod.rs
94
+ - ext/trusted/src/ruby/request.rs
95
+ - ext/trusted/src/ruby/response.rs
96
+ - ext/trusted/src/ruby/server.rs
97
+ - ext/trusted/src/server.rs
98
+ - lib/rack/handler/trusted.rb
99
+ - lib/trusted.rb
100
+ - lib/trusted/request.rb
101
+ - lib/trusted/response.rb
102
+ - lib/trusted/version.rb
103
+ - trusted.gemspec
104
+ homepage: http://this-week-in-ruru.org/
105
+ licenses:
106
+ - MIT
107
+ metadata: {}
108
+ post_install_message:
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubyforge_project:
124
+ rubygems_version: 2.5.1
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: Write a short summary, because Rubygems requires one.
128
+ test_files: []