woodstock1 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in woodstock1.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 TODO: Write your name
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,31 @@
1
+ # Woodstock1
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'woodstock1'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install woodstock1
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/woodstock1/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/lib/controller.rb ADDED
@@ -0,0 +1,13 @@
1
+
2
+ require 'erubis'
3
+
4
+
5
+ class Controller
6
+
7
+ def render(controller, params = {} )
8
+ path = "./views/" + controller + "/index.html"
9
+ template = File.read(path)
10
+ Erubis::Eruby.new(template).result(params)
11
+ end
12
+
13
+ end
@@ -0,0 +1,26 @@
1
+ require_relative 'router'
2
+
3
+
4
+ class HTTPResponse
5
+
6
+ def initialize(env)
7
+ @env = env
8
+ end
9
+
10
+ def generate
11
+
12
+
13
+ begin
14
+
15
+ body = Router.new.route(@env)
16
+ ["200", {}, body ]
17
+
18
+ rescue Exception => ex
19
+ ["500", {}, [ex.message]]
20
+ end
21
+
22
+
23
+
24
+ end
25
+
26
+ end
@@ -0,0 +1,27 @@
1
+
2
+ require_relative 'http_response'
3
+ require_relative 'controller'
4
+
5
+
6
+ class Ornitorrinco
7
+
8
+
9
+ def initialize(env)
10
+ @env = env
11
+ end
12
+
13
+
14
+ def run
15
+
16
+
17
+ HTTPResponse.new(@env).generate
18
+
19
+
20
+ end
21
+
22
+
23
+
24
+
25
+ end
26
+
27
+
data/lib/router.rb ADDED
@@ -0,0 +1,18 @@
1
+
2
+ class Router
3
+
4
+ def route(env)
5
+
6
+ path = env["PATH_INFO"].split("/").last
7
+
8
+ controller_name = path.capitalize + "Controller"
9
+
10
+ controller = Object.const_get(controller_name).new
11
+ [controller.index]
12
+
13
+ end
14
+
15
+ end
16
+
17
+
18
+
data/lib/woodstock1.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "woodstock1/version"
2
+
3
+ module Woodstock1
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module Woodstock1
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'woodstock1/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "woodstock1"
8
+ spec.version = Woodstock1::VERSION
9
+ spec.authors = ["Percy Quevedo"]
10
+ spec.email = ["percy_q@hotmail.com"]
11
+ spec.summary = %q{"test"}
12
+ spec.description = %q{"test"}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
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.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+
24
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: woodstock1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Percy Quevedo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-11-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.7'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.7'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '10.0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '10.0'
46
+ description: ! '"test"'
47
+ email:
48
+ - percy_q@hotmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - LICENSE.txt
56
+ - README.md
57
+ - Rakefile
58
+ - lib/controller.rb
59
+ - lib/http_response.rb
60
+ - lib/ornitorrinco.rb
61
+ - lib/router.rb
62
+ - lib/woodstock1.rb
63
+ - lib/woodstock1/version.rb
64
+ - woodstock1.gemspec
65
+ homepage: ''
66
+ licenses:
67
+ - MIT
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project:
86
+ rubygems_version: 1.8.28
87
+ signing_key:
88
+ specification_version: 3
89
+ summary: ! '"test"'
90
+ test_files: []