rasti-web 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/Gemfile +1 -3
- data/README.md +42 -6
- data/Rakefile +6 -0
- data/lib/rasti/web/request.rb +3 -1
- data/lib/rasti/web/version.rb +1 -1
- data/lib/rasti/web.rb +1 -0
- data/rasti-web.gemspec +15 -6
- data/spec/coverage_helper.rb +1 -4
- data/spec/minitest_helper.rb +1 -7
- metadata +89 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 831a4d1eeebc387c8e40196939035027bb83f63e
|
4
|
+
data.tar.gz: 2e0f0a273055f0d863d008744f2a22d48e885731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7316d529b5ac6595603cb9f26bec14dcf5e70ece674987f99a27bf7388fbd22dfeeb05e8d0c08c0d7bf37a7df02318eff0c6672858291c7761139d9ddad4930f
|
7
|
+
data.tar.gz: ff916df63a04677a72dab94f3f0cec2ef4ea5f0324f7461833ca93b0331da9df9e40c6b6be184cfe7a6f185d7ef53ec025b4bcf9584b32e52ad232dd82485af0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0
|
1
|
+
ruby-2.3.0
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Rasti::Web
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/rasti-web.
|
4
|
-
[![Build Status](https://travis-ci.org/gabynaiman/rasti-web.
|
5
|
-
[![Coverage Status](https://coveralls.io/repos/gabynaiman/rasti-web/badge.
|
6
|
-
[![Code Climate](https://codeclimate.com/github/gabynaiman/rasti-web.
|
7
|
-
[![Dependency Status](https://gemnasium.com/gabynaiman/rasti-web.
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rasti-web.svg)](https://rubygems.org/gems/rasti-web)
|
4
|
+
[![Build Status](https://travis-ci.org/gabynaiman/rasti-web.svg?branch=master)](https://travis-ci.org/gabynaiman/rasti-web)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/gabynaiman/rasti-web/badge.svg?branch=master)](https://coveralls.io/r/gabynaiman/rasti-web?branch=master)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/gabynaiman/rasti-web.svg)](https://codeclimate.com/github/gabynaiman/rasti-web)
|
7
|
+
[![Dependency Status](https://gemnasium.com/gabynaiman/rasti-web.svg)](https://gemnasium.com/gabynaiman/rasti-web)
|
8
8
|
|
9
9
|
Web blocks to build robust applications
|
10
10
|
|
@@ -24,7 +24,43 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
-
|
27
|
+
### Routing
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
# app.rb
|
31
|
+
class WebApp < Rasti::Web::Application
|
32
|
+
|
33
|
+
use SomeMiddleware
|
34
|
+
|
35
|
+
get '/hello' do |request, response, render|
|
36
|
+
render.text 'world'
|
37
|
+
end
|
38
|
+
|
39
|
+
put '/users/:id', UsersController >> :update
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
# configu.ru
|
44
|
+
require_relative 'app'
|
45
|
+
run WebApp
|
46
|
+
```
|
47
|
+
|
48
|
+
### Controllers
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
class UsersController < Rasti::Web::Controller
|
52
|
+
|
53
|
+
def update
|
54
|
+
user = User.find(params[:id])
|
55
|
+
if user.update_attributes(params[:user])
|
56
|
+
render.view 'users/list', users: User.all
|
57
|
+
else
|
58
|
+
render.view 'users/edit', user: user
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
```
|
28
64
|
|
29
65
|
## Contributing
|
30
66
|
|
data/Rakefile
CHANGED
@@ -5,6 +5,12 @@ Rake::TestTask.new(:spec) do |t|
|
|
5
5
|
t.libs << 'spec'
|
6
6
|
t.pattern = 'spec/**/*_spec.rb'
|
7
7
|
t.verbose = false
|
8
|
+
t.warning = false
|
9
|
+
t.loader = nil if ENV['TEST']
|
10
|
+
ENV['TEST'], ENV['LINE'] = ENV['TEST'].split(':') if ENV['TEST'] && !ENV['LINE']
|
11
|
+
t.options = ''
|
12
|
+
t.options << "--name=/#{ENV['NAME']}/ " if ENV['NAME']
|
13
|
+
t.options << "-l #{ENV['LINE']} " if ENV['LINE'] && ENV['TEST']
|
8
14
|
end
|
9
15
|
|
10
16
|
task default: :spec
|
data/lib/rasti/web/request.rb
CHANGED
data/lib/rasti/web/version.rb
CHANGED
data/lib/rasti/web.rb
CHANGED
data/rasti-web.gemspec
CHANGED
@@ -23,12 +23,21 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'mime-types', '~> 2.0'
|
24
24
|
spec.add_dependency 'class_config', '~> 0.0.2'
|
25
25
|
spec.add_dependency 'hash_ext', '~> 0.1'
|
26
|
+
spec.add_dependency 'content-type', '~> 0.0'
|
26
27
|
|
27
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
28
|
-
spec.add_development_dependency 'rake'
|
29
|
-
spec.add_development_dependency 'minitest', '~>
|
30
|
-
spec.add_development_dependency '
|
31
|
-
spec.add_development_dependency '
|
32
|
-
spec.add_development_dependency '
|
28
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
29
|
+
spec.add_development_dependency 'rake', '~> 11.0'
|
30
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
31
|
+
spec.add_development_dependency 'minitest-colorin', '~> 0.1'
|
32
|
+
spec.add_development_dependency 'minitest-line', '~> 0.6'
|
33
|
+
spec.add_development_dependency 'simplecov', '~> 0.12'
|
34
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
35
|
+
spec.add_development_dependency 'pry-nav', '~> 0.2'
|
33
36
|
spec.add_development_dependency 'rack-test'
|
37
|
+
|
38
|
+
if RUBY_VERSION < '2'
|
39
|
+
spec.add_development_dependency 'term-ansicolor', '~> 1.3.0'
|
40
|
+
spec.add_development_dependency 'tins', '~> 1.6.0'
|
41
|
+
spec.add_development_dependency 'json', '~> 1.8'
|
42
|
+
end
|
34
43
|
end
|
data/spec/coverage_helper.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
require 'simplecov'
|
2
2
|
require 'coveralls'
|
3
3
|
|
4
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
-
SimpleCov::Formatter::HTMLFormatter,
|
6
|
-
Coveralls::SimpleCov::Formatter
|
7
|
-
]
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
|
8
5
|
SimpleCov.start
|
data/spec/minitest_helper.rb
CHANGED
@@ -1,16 +1,10 @@
|
|
1
1
|
require 'coverage_helper'
|
2
2
|
require 'rasti-web'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require '
|
4
|
+
require 'minitest/colorin'
|
5
5
|
require 'rack/test'
|
6
6
|
require 'pry-nav'
|
7
7
|
|
8
|
-
Turn.config do |c|
|
9
|
-
c.format = :pretty
|
10
|
-
c.natural = true
|
11
|
-
c.ansi = true
|
12
|
-
end
|
13
|
-
|
14
8
|
module ContextMethodHelper
|
15
9
|
def page_header(text)
|
16
10
|
"<h1>#{text}</h1>"
|
metadata
CHANGED
@@ -1,181 +1,223 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasti-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tilt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mime-types
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: class_config
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.0.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.0.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: hash_ext
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: content-type
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: bundler
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- - ~>
|
101
|
+
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
103
|
+
version: '1.12'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- - ~>
|
108
|
+
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
110
|
+
version: '1.12'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
117
|
+
version: '11.0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
124
|
+
version: '11.0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: minitest
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- - ~>
|
129
|
+
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
131
|
+
version: '5.0'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- - ~>
|
136
|
+
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '5.0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
140
|
+
name: minitest-colorin
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- - ~>
|
143
|
+
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0.
|
145
|
+
version: '0.1'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- - ~>
|
150
|
+
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0.
|
152
|
+
version: '0.1'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: minitest-line
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.6'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.6'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: simplecov
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
|
-
- -
|
171
|
+
- - "~>"
|
144
172
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
173
|
+
version: '0.12'
|
146
174
|
type: :development
|
147
175
|
prerelease: false
|
148
176
|
version_requirements: !ruby/object:Gem::Requirement
|
149
177
|
requirements:
|
150
|
-
- -
|
178
|
+
- - "~>"
|
151
179
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
180
|
+
version: '0.12'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: coveralls
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0.8'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0.8'
|
153
195
|
- !ruby/object:Gem::Dependency
|
154
196
|
name: pry-nav
|
155
197
|
requirement: !ruby/object:Gem::Requirement
|
156
198
|
requirements:
|
157
|
-
- -
|
199
|
+
- - "~>"
|
158
200
|
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
201
|
+
version: '0.2'
|
160
202
|
type: :development
|
161
203
|
prerelease: false
|
162
204
|
version_requirements: !ruby/object:Gem::Requirement
|
163
205
|
requirements:
|
164
|
-
- -
|
206
|
+
- - "~>"
|
165
207
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
208
|
+
version: '0.2'
|
167
209
|
- !ruby/object:Gem::Dependency
|
168
210
|
name: rack-test
|
169
211
|
requirement: !ruby/object:Gem::Requirement
|
170
212
|
requirements:
|
171
|
-
- -
|
213
|
+
- - ">="
|
172
214
|
- !ruby/object:Gem::Version
|
173
215
|
version: '0'
|
174
216
|
type: :development
|
175
217
|
prerelease: false
|
176
218
|
version_requirements: !ruby/object:Gem::Requirement
|
177
219
|
requirements:
|
178
|
-
- -
|
220
|
+
- - ">="
|
179
221
|
- !ruby/object:Gem::Version
|
180
222
|
version: '0'
|
181
223
|
description: Web blocks to build robust applications
|
@@ -185,11 +227,11 @@ executables: []
|
|
185
227
|
extensions: []
|
186
228
|
extra_rdoc_files: []
|
187
229
|
files:
|
188
|
-
- .coveralls.yml
|
189
|
-
- .gitignore
|
190
|
-
- .ruby-gemset
|
191
|
-
- .ruby-version
|
192
|
-
- .travis.yml
|
230
|
+
- ".coveralls.yml"
|
231
|
+
- ".gitignore"
|
232
|
+
- ".ruby-gemset"
|
233
|
+
- ".ruby-version"
|
234
|
+
- ".travis.yml"
|
193
235
|
- Gemfile
|
194
236
|
- LICENSE.txt
|
195
237
|
- README.md
|
@@ -238,17 +280,17 @@ require_paths:
|
|
238
280
|
- lib
|
239
281
|
required_ruby_version: !ruby/object:Gem::Requirement
|
240
282
|
requirements:
|
241
|
-
- -
|
283
|
+
- - ">="
|
242
284
|
- !ruby/object:Gem::Version
|
243
285
|
version: '0'
|
244
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
287
|
requirements:
|
246
|
-
- -
|
288
|
+
- - ">="
|
247
289
|
- !ruby/object:Gem::Version
|
248
290
|
version: '0'
|
249
291
|
requirements: []
|
250
292
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.
|
293
|
+
rubygems_version: 2.5.1
|
252
294
|
signing_key:
|
253
295
|
specification_version: 4
|
254
296
|
summary: Web blocks to build robust applications
|