truss-router 0.0.1

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: acb68fcca495a20529240f4dbc8879756ef8984d
4
+ data.tar.gz: d66814d6ee823e2d89064d97f55643d93a8c64e1
5
+ SHA512:
6
+ metadata.gz: 15dffabd400cd9d351261d4612caca972bb553ce40b657780347984e3a74943ad6770ba7935b83b19a5978f54ceef039a3d555124a04ffe4a38835989aefe125
7
+ data.tar.gz: 8ca1c257d8cea17dc77ca830066c43cb7624e19e1f611611c1a479efee03cdd341cdab98a75987a90d595be88908050d08b78c68251775eb77fe14e64ee6501c
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --require spec_helper
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
5
+ - "jruby-1.7.3"
6
+ - "rbx-19mode"
7
+ script: bundle exec rspec spec
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in truss-router.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 John Maxwell
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ [![Build Status](https://travis-ci.org/truss-io/router.png)](https://travis-ci.org/truss-io/router)
2
+ # Truss::Router
3
+
4
+ TODO: Write a gem description
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'truss-router'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install truss-router
19
+
20
+ ## Usage
21
+
22
+ TODO: Write usage instructions here
23
+
24
+ ## Contributing
25
+
26
+ 1. Fork it
27
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
28
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
29
+ 4. Push to the branch (`git push origin my-new-feature`)
30
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ module Truss
2
+ module Router
3
+ class Node
4
+ attr_accessor :request_method, :path, :endpoint
5
+ def initialize(meth, path, endpoint, opts={})
6
+ @request_method, @path, @endpoint = meth, path, endpoint
7
+ @opts = opts
8
+ end
9
+
10
+ def matches?
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Delete < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:delete, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Get < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:get, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Head < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:head, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,12 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Options < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:options, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,11 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Patch < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:patch, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Post < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:post, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Truss
2
+ module Router
3
+ module Routes
4
+ class Put < Node
5
+ def initialize(path, endpoint, opts={})
6
+ super(:put, path, endpoint, opts)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Truss
2
+ module Router
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require "truss/router/version"
2
+
3
+ module Truss
4
+ module Router
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ require 'truss/router'
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+
3
+ describe Truss::Router::Node do
4
+ subject { Truss::Router::Node.new(:get, "/home", "Class") }
5
+ it { should respond_to(:request_method) }
6
+ it { should respond_to(:endpoint) }
7
+ it { should respond_to(:path) }
8
+ it { should respond_to(:matches?) }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/delete'
3
+
4
+ describe Truss::Router::Routes::Delete do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:delete) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/get'
3
+
4
+ describe Truss::Router::Routes::Get do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:get) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/head'
3
+
4
+ describe Truss::Router::Routes::Head do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:head) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/options'
3
+
4
+ describe Truss::Router::Routes::Options do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:options) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/patch'
3
+
4
+ describe Truss::Router::Routes::Patch do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:patch) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/post'
3
+
4
+ describe Truss::Router::Routes::Post do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:post) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'truss/router/node'
2
+ require 'truss/router/routes/put'
3
+
4
+ describe Truss::Router::Routes::Put do
5
+ subject { described_class.new("/home", String) }
6
+ its(:request_method) { should eq(:put) }
7
+ its(:endpoint) { should eq(String) }
8
+ its(:path) { should eq("/home") }
9
+ end
@@ -0,0 +1,12 @@
1
+ require 'rack'
2
+ require 'rspec'
3
+
4
+ $:.unshift File.expand_path("../../lib", __FILE__)
5
+
6
+ RSpec.configure do |config|
7
+ config.treat_symbols_as_metadata_keys_with_true_values = true
8
+ config.run_all_when_everything_filtered = true
9
+ config.filter_run :focus
10
+ config.backtrace_clean_patterns << /gems\//
11
+ config.order = 'random'
12
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'truss/router/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "truss-router"
8
+ spec.version = Truss::Router::VERSION
9
+ spec.authors = ["John Maxwell"]
10
+ spec.email = ["john@musicglue.com"]
11
+ spec.description = %q{Truss Router is a modular Rack Router for Truss}
12
+ spec.summary = %q{Truss Router is a modular Rack Router for Truss}
13
+ spec.homepage = "http://truss-io.github.io"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec"
24
+
25
+ spec.add_dependency "rack", "~> 1.5.0"
26
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: truss-router
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - John Maxwell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.5.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.5.0
69
+ description: Truss Router is a modular Rack Router for Truss
70
+ email:
71
+ - john@musicglue.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .rspec
78
+ - .travis.yml
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - lib/truss-router.rb
84
+ - lib/truss/router.rb
85
+ - lib/truss/router/node.rb
86
+ - lib/truss/router/routes/delete.rb
87
+ - lib/truss/router/routes/get.rb
88
+ - lib/truss/router/routes/head.rb
89
+ - lib/truss/router/routes/options.rb
90
+ - lib/truss/router/routes/patch.rb
91
+ - lib/truss/router/routes/post.rb
92
+ - lib/truss/router/routes/put.rb
93
+ - lib/truss/router/version.rb
94
+ - spec/lib/truss/router/node_spec.rb
95
+ - spec/lib/truss/router/routes/delete_spec.rb
96
+ - spec/lib/truss/router/routes/get_spec.rb
97
+ - spec/lib/truss/router/routes/head_spec.rb
98
+ - spec/lib/truss/router/routes/options_spec.rb
99
+ - spec/lib/truss/router/routes/patch_spec.rb
100
+ - spec/lib/truss/router/routes/post_spec.rb
101
+ - spec/lib/truss/router/routes/put_spec.rb
102
+ - spec/spec_helper.rb
103
+ - truss-router.gemspec
104
+ homepage: http://truss-io.github.io
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.0.3
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: Truss Router is a modular Rack Router for Truss
128
+ test_files:
129
+ - spec/lib/truss/router/node_spec.rb
130
+ - spec/lib/truss/router/routes/delete_spec.rb
131
+ - spec/lib/truss/router/routes/get_spec.rb
132
+ - spec/lib/truss/router/routes/head_spec.rb
133
+ - spec/lib/truss/router/routes/options_spec.rb
134
+ - spec/lib/truss/router/routes/patch_spec.rb
135
+ - spec/lib/truss/router/routes/post_spec.rb
136
+ - spec/lib/truss/router/routes/put_spec.rb
137
+ - spec/spec_helper.rb