yarn 0.1.0 → 0.1.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.
Files changed (87) hide show
  1. data/lib/rack/handler/yarn.rb +3 -7
  2. data/lib/yarn/abstract_handler.rb +19 -4
  3. data/lib/yarn/directory_lister.rb +3 -2
  4. data/lib/yarn/error_page.rb +3 -0
  5. data/lib/yarn/logging.rb +7 -0
  6. data/lib/yarn/parser.rb +3 -0
  7. data/lib/yarn/rack_handler.rb +4 -0
  8. data/lib/yarn/request_handler.rb +23 -13
  9. data/lib/yarn/response.rb +8 -1
  10. data/lib/yarn/server.rb +16 -3
  11. data/lib/yarn/statuses.rb +53 -52
  12. data/lib/yarn/version.rb +2 -1
  13. metadata +27 -108
  14. data/.autotest +0 -5
  15. data/.gitignore +0 -11
  16. data/.rspec +0 -2
  17. data/Gemfile +0 -7
  18. data/LICENCE +0 -22
  19. data/Rakefile +0 -4
  20. data/cucumber.yml +0 -3
  21. data/features/concurrency.feature +0 -13
  22. data/features/dynamic_request.feature +0 -18
  23. data/features/logger.feature +0 -16
  24. data/features/parser.feature +0 -15
  25. data/features/rack.feature +0 -15
  26. data/features/server.feature +0 -14
  27. data/features/static_request.feature +0 -25
  28. data/features/step_definitions/concurrency_steps.rb +0 -34
  29. data/features/step_definitions/parser_steps.rb +0 -23
  30. data/features/step_definitions/rack_steps.rb +0 -16
  31. data/features/step_definitions/server_steps.rb +0 -42
  32. data/features/step_definitions/web_steps.rb +0 -15
  33. data/features/support/env.rb +0 -20
  34. data/features/support/hooks.rb +0 -5
  35. data/spec/helpers.rb +0 -92
  36. data/spec/rack/handler/yarn_spec.rb +0 -21
  37. data/spec/spec_helper.rb +0 -17
  38. data/spec/yarn/abstract_handler_spec.rb +0 -98
  39. data/spec/yarn/directory_lister_spec.rb +0 -41
  40. data/spec/yarn/error_page_spec.rb +0 -33
  41. data/spec/yarn/logging_spec.rb +0 -53
  42. data/spec/yarn/parser_spec.rb +0 -122
  43. data/spec/yarn/rack_handler_spec.rb +0 -55
  44. data/spec/yarn/request_handler_spec.rb +0 -164
  45. data/spec/yarn/response_spec.rb +0 -36
  46. data/spec/yarn/server_spec.rb +0 -102
  47. data/test_objects/.gitignore +0 -10
  48. data/test_objects/config.ru +0 -6
  49. data/test_objects/index.html +0 -13
  50. data/test_objects/jquery.js +0 -8865
  51. data/test_objects/rails_test/.gitignore +0 -5
  52. data/test_objects/rails_test/Gemfile +0 -34
  53. data/test_objects/rails_test/README +0 -261
  54. data/test_objects/rails_test/Rakefile +0 -7
  55. data/test_objects/rails_test/app/assets/images/rails.png +0 -0
  56. data/test_objects/rails_test/app/assets/javascripts/application.js +0 -6
  57. data/test_objects/rails_test/app/assets/stylesheets/application.css +0 -7
  58. data/test_objects/rails_test/app/assets/stylesheets/scaffolds.css.scss +0 -56
  59. data/test_objects/rails_test/app/mailers/.gitkeep +0 -0
  60. data/test_objects/rails_test/app/models/.gitkeep +0 -0
  61. data/test_objects/rails_test/app/views/layouts/application.html.erb +0 -15
  62. data/test_objects/rails_test/app/views/posts/_form.html.erb +0 -25
  63. data/test_objects/rails_test/app/views/posts/edit.html.erb +0 -6
  64. data/test_objects/rails_test/app/views/posts/index.html.erb +0 -20
  65. data/test_objects/rails_test/app/views/posts/new.html.erb +0 -5
  66. data/test_objects/rails_test/app/views/posts/show.html.erb +0 -15
  67. data/test_objects/rails_test/config.ru +0 -4
  68. data/test_objects/rails_test/config/database.yml +0 -25
  69. data/test_objects/rails_test/config/locales/en.yml +0 -5
  70. data/test_objects/rails_test/doc/README_FOR_APP +0 -2
  71. data/test_objects/rails_test/lib/assets/.gitkeep +0 -0
  72. data/test_objects/rails_test/lib/tasks/.gitkeep +0 -0
  73. data/test_objects/rails_test/log/.gitkeep +0 -0
  74. data/test_objects/rails_test/public/404.html +0 -26
  75. data/test_objects/rails_test/public/422.html +0 -26
  76. data/test_objects/rails_test/public/500.html +0 -26
  77. data/test_objects/rails_test/public/favicon.ico +0 -0
  78. data/test_objects/rails_test/public/robots.txt +0 -5
  79. data/test_objects/rails_test/script/rails +0 -6
  80. data/test_objects/rails_test/test/fixtures/.gitkeep +0 -0
  81. data/test_objects/rails_test/test/fixtures/posts.yml +0 -9
  82. data/test_objects/rails_test/test/functional/.gitkeep +0 -0
  83. data/test_objects/rails_test/test/integration/.gitkeep +0 -0
  84. data/test_objects/rails_test/test/unit/.gitkeep +0 -0
  85. data/test_objects/rails_test/vendor/assets/stylesheets/.gitkeep +0 -0
  86. data/test_objects/rails_test/vendor/plugins/.gitkeep +0 -0
  87. data/yarn.gemspec +0 -29
@@ -1,54 +1,55 @@
1
1
  module Yarn
2
- STATUS_CODES = {
3
- # 1xx Informational
4
- 100 => 'Continue',
5
- 101 => 'Switching Protocols',
6
- 102 => 'Processing',
7
- 103 => 'Checkpoint',
8
- 122 => 'Request-URI too long',
9
- # 2xx Success
10
- 200 => 'OK',
11
- 201 => 'Created',
12
- 202 => 'Accepted',
13
- 203 => 'Non-Authoritative Information',
14
- 204 => 'No Content',
15
- 205 => 'Reset Content',
16
- 206 => 'Partial Content',
17
- 207 => 'Multi-Status',
18
- 226 => 'IM Used',
19
- # 3xx Redirection
20
- 300 => 'Multiple Choices',
21
- 301 => 'Moved Permanently',
22
- 302 => 'Moved Temporarily',
23
- 303 => 'See Other',
24
- 304 => 'Not Modified',
25
- 305 => 'Use Proxy',
26
- 307 => 'Temporary Redirect',
27
- 308 => 'Resume Incomplete',
28
- # 4xx Client Error
29
- 400 => 'Bad Request',
30
- 401 => 'Unauthorized',
31
- 402 => 'Payment Required',
32
- 403 => 'Forbidden',
33
- 404 => 'Not Found',
34
- 405 => 'Method Not Allowed',
35
- 406 => 'Not Acceptable',
36
- 407 => 'Proxy Authentication Required',
37
- 408 => 'Request Time-out',
38
- 409 => 'Conflict',
39
- 410 => 'Gone',
40
- 411 => 'Length Required',
41
- 412 => 'Precondition Failed',
42
- 413 => 'Request Entity Too Large',
43
- 414 => 'Request-URI Too Large',
44
- 415 => 'Unsupported Media Type',
45
- 416 => 'Requested Range Not Satisfiable',
46
- # 5xx Server Error
47
- 500 => 'Internal Server Error',
48
- 501 => 'Not Implemented',
49
- 502 => 'Bad Gateway',
50
- 503 => 'Service Unavailable',
51
- 504 => 'Gateway Time-out',
52
- 505 => 'HTTP Version not supported'
53
- }
2
+ # HTTP status codes
3
+ STATUS_CODES = {
4
+ # 1xx Informational
5
+ 100 => 'Continue',
6
+ 101 => 'Switching Protocols',
7
+ 102 => 'Processing',
8
+ 103 => 'Checkpoint',
9
+ 122 => 'Request-URI too long',
10
+ # 2xx Success
11
+ 200 => 'OK',
12
+ 201 => 'Created',
13
+ 202 => 'Accepted',
14
+ 203 => 'Non-Authoritative Information',
15
+ 204 => 'No Content',
16
+ 205 => 'Reset Content',
17
+ 206 => 'Partial Content',
18
+ 207 => 'Multi-Status',
19
+ 226 => 'IM Used',
20
+ # 3xx Redirection
21
+ 300 => 'Multiple Choices',
22
+ 301 => 'Moved Permanently',
23
+ 302 => 'Moved Temporarily',
24
+ 303 => 'See Other',
25
+ 304 => 'Not Modified',
26
+ 305 => 'Use Proxy',
27
+ 307 => 'Temporary Redirect',
28
+ 308 => 'Resume Incomplete',
29
+ # 4xx Client Error
30
+ 400 => 'Bad Request',
31
+ 401 => 'Unauthorized',
32
+ 402 => 'Payment Required',
33
+ 403 => 'Forbidden',
34
+ 404 => 'Not Found',
35
+ 405 => 'Method Not Allowed',
36
+ 406 => 'Not Acceptable',
37
+ 407 => 'Proxy Authentication Required',
38
+ 408 => 'Request Time-out',
39
+ 409 => 'Conflict',
40
+ 410 => 'Gone',
41
+ 411 => 'Length Required',
42
+ 412 => 'Precondition Failed',
43
+ 413 => 'Request Entity Too Large',
44
+ 414 => 'Request-URI Too Large',
45
+ 415 => 'Unsupported Media Type',
46
+ 416 => 'Requested Range Not Satisfiable',
47
+ # 5xx Server Error
48
+ 500 => 'Internal Server Error',
49
+ 501 => 'Not Implemented',
50
+ 502 => 'Bad Gateway',
51
+ 503 => 'Service Unavailable',
52
+ 504 => 'Gateway Time-out',
53
+ 505 => 'HTTP Version not supported'
54
+ }
54
55
  end
@@ -1,3 +1,4 @@
1
1
  module Yarn
2
- VERSION = "0.1.0"
2
+ # Yarn semantic version
3
+ VERSION = "0.1.1"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yarn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parslet
16
- requirement: &23448020 !ruby/object:Gem::Requirement
16
+ requirement: &11689820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *23448020
24
+ version_requirements: *11689820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: trollop
27
- requirement: &23447520 !ruby/object:Gem::Requirement
27
+ requirement: &11689320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.16'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *23447520
35
+ version_requirements: *11689320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack
38
- requirement: &23447040 !ruby/object:Gem::Requirement
38
+ requirement: &11688860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.3'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *23447040
46
+ version_requirements: *11688860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cucumber
49
- requirement: &23446660 !ruby/object:Gem::Requirement
49
+ requirement: &11688460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *23446660
57
+ version_requirements: *11688460
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: faraday
60
- requirement: &23446200 !ruby/object:Gem::Requirement
60
+ requirement: &11687960 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *23446200
68
+ version_requirements: *11687960
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
- requirement: &23445780 !ruby/object:Gem::Requirement
71
+ requirement: &11687440 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *23445780
79
+ version_requirements: *11687440
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &23445360 !ruby/object:Gem::Requirement
82
+ requirement: &11686940 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *23445360
90
+ version_requirements: *11686940
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: simplecov
93
- requirement: &23444940 !ruby/object:Gem::Requirement
93
+ requirement: &11686300 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,111 +98,30 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *23444940
101
+ version_requirements: *11686300
102
102
  description: A multi-process web-server written in Ruby 1.9.
103
103
  email:
104
- - jkjeldgaard@gmail.com
104
+ - thejspr@gmail.com
105
105
  executables:
106
106
  - yarn
107
107
  extensions: []
108
108
  extra_rdoc_files: []
109
109
  files:
110
- - .autotest
111
- - .gitignore
112
- - .rspec
113
- - .rvmrc
114
- - Gemfile
115
- - Gemfile.lock
116
- - LICENCE
117
- - README.md
118
- - Rakefile
119
110
  - bin/yarn
120
- - cucumber.yml
121
- - features/concurrency.feature
122
- - features/dynamic_request.feature
123
- - features/logger.feature
124
- - features/parser.feature
125
- - features/rack.feature
126
- - features/server.feature
127
- - features/static_request.feature
128
- - features/step_definitions/concurrency_steps.rb
129
- - features/step_definitions/parser_steps.rb
130
- - features/step_definitions/rack_steps.rb
131
- - features/step_definitions/server_steps.rb
132
- - features/step_definitions/web_steps.rb
133
- - features/support/env.rb
134
- - features/support/hooks.rb
135
111
  - lib/rack/handler/yarn.rb
136
112
  - lib/yarn.rb
137
- - lib/yarn/abstract_handler.rb
138
- - lib/yarn/directory_lister.rb
139
- - lib/yarn/error_page.rb
140
- - lib/yarn/logging.rb
141
- - lib/yarn/parser.rb
142
- - lib/yarn/rack_handler.rb
143
113
  - lib/yarn/request_handler.rb
144
- - lib/yarn/response.rb
145
114
  - lib/yarn/server.rb
146
- - lib/yarn/statuses.rb
115
+ - lib/yarn/rack_handler.rb
147
116
  - lib/yarn/version.rb
148
- - spec/helpers.rb
149
- - spec/rack/handler/yarn_spec.rb
150
- - spec/spec_helper.rb
151
- - spec/yarn/abstract_handler_spec.rb
152
- - spec/yarn/directory_lister_spec.rb
153
- - spec/yarn/error_page_spec.rb
154
- - spec/yarn/logging_spec.rb
155
- - spec/yarn/parser_spec.rb
156
- - spec/yarn/rack_handler_spec.rb
157
- - spec/yarn/request_handler_spec.rb
158
- - spec/yarn/response_spec.rb
159
- - spec/yarn/server_spec.rb
160
- - test_objects/.gitignore
161
- - test_objects/1.rb
162
- - test_objects/3.rb
163
- - test_objects/5.rb
164
- - test_objects/app.rb
165
- - test_objects/app2.rb
166
- - test_objects/config.ru
167
- - test_objects/index.html
168
- - test_objects/jquery.js
169
- - test_objects/rails_test/.gitignore
170
- - test_objects/rails_test/Gemfile
171
- - test_objects/rails_test/README
172
- - test_objects/rails_test/Rakefile
173
- - test_objects/rails_test/app/assets/images/rails.png
174
- - test_objects/rails_test/app/assets/javascripts/application.js
175
- - test_objects/rails_test/app/assets/stylesheets/application.css
176
- - test_objects/rails_test/app/assets/stylesheets/scaffolds.css.scss
177
- - test_objects/rails_test/app/mailers/.gitkeep
178
- - test_objects/rails_test/app/models/.gitkeep
179
- - test_objects/rails_test/app/views/layouts/application.html.erb
180
- - test_objects/rails_test/app/views/posts/_form.html.erb
181
- - test_objects/rails_test/app/views/posts/edit.html.erb
182
- - test_objects/rails_test/app/views/posts/index.html.erb
183
- - test_objects/rails_test/app/views/posts/new.html.erb
184
- - test_objects/rails_test/app/views/posts/show.html.erb
185
- - test_objects/rails_test/config.ru
186
- - test_objects/rails_test/config/database.yml
187
- - test_objects/rails_test/config/locales/en.yml
188
- - test_objects/rails_test/doc/README_FOR_APP
189
- - test_objects/rails_test/lib/assets/.gitkeep
190
- - test_objects/rails_test/lib/tasks/.gitkeep
191
- - test_objects/rails_test/log/.gitkeep
192
- - test_objects/rails_test/public/404.html
193
- - test_objects/rails_test/public/422.html
194
- - test_objects/rails_test/public/500.html
195
- - test_objects/rails_test/public/favicon.ico
196
- - test_objects/rails_test/public/robots.txt
197
- - test_objects/rails_test/script/rails
198
- - test_objects/rails_test/test/fixtures/.gitkeep
199
- - test_objects/rails_test/test/fixtures/posts.yml
200
- - test_objects/rails_test/test/functional/.gitkeep
201
- - test_objects/rails_test/test/integration/.gitkeep
202
- - test_objects/rails_test/test/unit/.gitkeep
203
- - test_objects/rails_test/vendor/assets/stylesheets/.gitkeep
204
- - test_objects/rails_test/vendor/plugins/.gitkeep
205
- - yarn.gemspec
117
+ - lib/yarn/error_page.rb
118
+ - lib/yarn/parser.rb
119
+ - lib/yarn/logging.rb
120
+ - lib/yarn/statuses.rb
121
+ - lib/yarn/directory_lister.rb
122
+ - lib/yarn/abstract_handler.rb
123
+ - lib/yarn/response.rb
124
+ - README.md
206
125
  homepage: https://github.com/thejspr/yarn
207
126
  licenses: []
208
127
  post_install_message:
data/.autotest DELETED
@@ -1,5 +0,0 @@
1
- # require 'test_notifier/runner/autotest'
2
- Autotest.add_hook :initialize do |at|
3
- at.add_exception(%r{^\./\.git})
4
- at.add_exception(%r{^\./coverage})
5
- end
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- tags
2
- coverage/*
3
- test_objects/rdoc/*
4
- *.gem
5
- .bundle
6
- Gemfile.lock
7
- pkg/*
8
- *.rbc
9
- doc/*
10
- .rvmrc
11
- .rbx/
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format documentation
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in threaded_server.gemspec
4
- gemspec
5
-
6
- gem 'autotest'
7
- gem 'pry'
data/LICENCE DELETED
@@ -1,22 +0,0 @@
1
- Portions copyright (c) 2011 Jesper Kjeldgaard
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/Rakefile DELETED
@@ -1,4 +0,0 @@
1
- require 'rspec/core/rake_task'
2
- RSpec::Core::RakeTask.new('spec')
3
-
4
- require 'bundler/gem_tasks'
@@ -1,3 +0,0 @@
1
- default: --color --format pretty
2
- autotest: --color --format pretty --tag @wip
3
- # autotest: --color --format pretty
@@ -1,13 +0,0 @@
1
- Feature: Concurrency
2
-
3
- As a developer
4
- I want to be able to serve multiple requests in parallel
5
- To increase server performance
6
-
7
- Scenario: Perform two requests in parallel
8
- Given the server is running
9
- And a client "A"
10
- And a client "B"
11
- When client "A" makes a "1" second request
12
- And client "B" makes a "0.1" second request
13
- Then client "B" receives a response before client "A"
@@ -1,18 +0,0 @@
1
- Feature: Dynamic request
2
-
3
- As a developer
4
- I want to be able to serve ruby files
5
- In order to provide dynamic content
6
-
7
- Background:
8
- Given the server is running
9
-
10
- Scenario: Serve a dynamic Ruby file
11
- Given the file "/app.rb" exist
12
- When I go to "/app.rb"
13
- Then the response should contain "Dynamic request complete"
14
-
15
- Scenario: Support POST data
16
- Given the file "/post_app.rb" exist
17
- When I post "field1" as "value1" to "/test_objects/post_app.rb"
18
- Then the response should be "Recieved field1=value1"
@@ -1,16 +0,0 @@
1
- Feature: Logger
2
-
3
- As a developer
4
- I want logging functionality
5
- To be able to debug and monitor server usage
6
-
7
- Background:
8
- Given the server is running
9
-
10
- Scenario: Log messages
11
- When I log "log message"
12
- Then I should see "log message"
13
-
14
- Scenario: Log debug messages
15
- When I debug "debug message"
16
- Then I should see "DEBUG: debug message"