rack-server-pages 0.0.6 → 0.1.0
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.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +96 -0
- data/.travis.yml +10 -4
- data/CHANGES.md +20 -1
- data/Gemfile +32 -46
- data/Guardfile +2 -2
- data/LICENSE.md +22 -0
- data/README.md +263 -187
- data/Rakefile +7 -6
- data/config.ru +3 -3
- data/lib/rack-server-pages/version.rb +1 -1
- data/lib/rack/server_pages.rb +37 -49
- data/lib/rack/server_pages/php_helper.rb +1 -1
- data/public/_layout.html.erb +1 -1
- data/public/rack_logo.png +0 -0
- data/public/rack_logo@2x.png +0 -0
- data/rack-server-pages.gemspec +13 -12
- data/spec/integration_spec.rb +34 -0
- data/spec/lib/rack/server_pages_spec.rb +17 -11
- data/spec/spec_helper.rb +26 -7
- data/views/examples/_layout.html.erb +1 -1
- data/views/examples/builder.xml.builder +2 -0
- data/views/examples/nokogiri.xml.nokogiri +1 -0
- data/views/examples/robots.txt +1 -0
- data/views/examples/source.html.slim +1 -1
- metadata +31 -21
data/spec/spec_helper.rb
CHANGED
@@ -1,40 +1,59 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
require 'rack/test'
|
3
|
+
require 'rspec/its'
|
3
4
|
require 'tapp'
|
4
5
|
require 'simplecov'
|
5
6
|
require 'rack-server-pages'
|
6
|
-
|
7
|
+
require 'capybara/rspec'
|
8
|
+
|
9
|
+
# SimpleCov.start
|
7
10
|
|
8
11
|
RSpec.configure do |conf|
|
9
12
|
conf.include Rack::Test::Methods
|
13
|
+
conf.include Capybara::DSL
|
14
|
+
conf.raise_errors_for_deprecations!
|
10
15
|
end
|
11
16
|
|
12
17
|
require 'tilt'
|
13
18
|
require 'slim'
|
14
19
|
Tilt.register Tilt::ERBTemplate, 'php'
|
15
20
|
|
21
|
+
require 'sass'
|
22
|
+
require 'rdiscount'
|
23
|
+
require 'rdoc'
|
24
|
+
require 'liquid'
|
25
|
+
require 'radius'
|
26
|
+
# require 'less'
|
27
|
+
require 'haml'
|
28
|
+
# require 'markaby'
|
29
|
+
# require 'builder'
|
30
|
+
require 'coffee_script'
|
31
|
+
require 'redcloth'
|
32
|
+
# require 'wikicloth'
|
33
|
+
require 'yajl'
|
34
|
+
|
16
35
|
def app
|
17
|
-
@app ||=Rack::Builder.app do
|
36
|
+
@app ||= Rack::Builder.app do
|
18
37
|
run Rack::ServerPages
|
19
38
|
end
|
20
39
|
end
|
21
40
|
|
22
41
|
def mock_app(&block)
|
23
|
-
@app
|
42
|
+
@app ||= Rack::Builder.app(&block)
|
24
43
|
end
|
25
44
|
|
26
45
|
def should_be_ok(path)
|
27
46
|
context "GET #{path}" do
|
28
47
|
let(:path_info) { path }
|
29
|
-
it {
|
30
|
-
its(:content_type) { should match
|
48
|
+
it { is_expected.to be_ok }
|
49
|
+
its(:content_type) { should match /\b#{content_type}\b/ }
|
31
50
|
end
|
32
51
|
end
|
33
52
|
|
34
53
|
def should_be_not_found(path)
|
35
54
|
context "GET #{path}" do
|
36
55
|
let(:path_info) { path }
|
37
|
-
it {
|
38
|
-
#its(:content_type) { should eq 'text/plain' }
|
56
|
+
it { is_expected.to be_not_found }
|
57
|
+
# its(:content_type) { should eq 'text/plain' }
|
39
58
|
end
|
40
59
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<body>
|
7
7
|
<h1>rack-server-pages examples</h1>
|
8
8
|
<%= partial 'views/examples/_time.html' %>
|
9
|
-
<%= yield %>
|
9
|
+
<%= yield if block_given? %>
|
10
10
|
<% unless request.path =~ %r!/examples/(index(\.html)?)?$! %>
|
11
11
|
<a href="<%=url('/examples/')%>">List examples</a>
|
12
12
|
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
xml.root
|
@@ -0,0 +1 @@
|
|
1
|
+
Deny *
|
@@ -1,6 +1,6 @@
|
|
1
1
|
ruby:
|
2
2
|
layout 'views/examples/_layout.html'
|
3
|
-
src = params['src'][/(\w+\.)?(\w+)$/, 0]
|
3
|
+
src = params['src'] ? params['src'][/(\w+\.)?(\w+)$/, 0] : "source.html"
|
4
4
|
h2 source
|
5
5
|
code = file = Dir["views/examples/#{src}.*"].first
|
6
6
|
pre style="background-color:#122831;color:#B3B3B3;padding:1em;" =IO.read(file)
|
metadata
CHANGED
@@ -1,42 +1,48 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-server-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Masato Igarashi
|
8
|
+
- Daniel Doubrovkine
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
requirement:
|
17
|
-
none: false
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
requirements:
|
19
|
-
- -
|
18
|
+
- - ">="
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: '0'
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
description: |-
|
29
|
+
Rack middleware and appilcation for serving dynamic pages in very simple way.
|
30
|
+
There are no controllers and no models, just only views like a asp, jsp and php!
|
28
31
|
email:
|
29
32
|
- m@igrs.jp
|
30
33
|
executables: []
|
31
34
|
extensions: []
|
32
35
|
extra_rdoc_files: []
|
33
36
|
files:
|
34
|
-
- .gitignore
|
35
|
-
- .
|
37
|
+
- ".gitignore"
|
38
|
+
- ".rspec"
|
39
|
+
- ".rubocop.yml"
|
40
|
+
- ".rubocop_todo.yml"
|
41
|
+
- ".travis.yml"
|
36
42
|
- CHANGES.md
|
37
43
|
- Gemfile
|
38
|
-
- Gemfile.lock
|
39
44
|
- Guardfile
|
45
|
+
- LICENSE.md
|
40
46
|
- README.md
|
41
47
|
- Rakefile
|
42
48
|
- config.ru
|
@@ -49,9 +55,12 @@ files:
|
|
49
55
|
- public/_layout.html.erb
|
50
56
|
- public/index.html
|
51
57
|
- public/info.php
|
58
|
+
- public/rack_logo.png
|
59
|
+
- public/rack_logo@2x.png
|
52
60
|
- public/sample.erb
|
53
61
|
- public/style.css.sass
|
54
62
|
- rack-server-pages.gemspec
|
63
|
+
- spec/integration_spec.rb
|
55
64
|
- spec/lib/rack/server_pages_spec.rb
|
56
65
|
- spec/spec_helper.rb
|
57
66
|
- views/about.html.slim
|
@@ -73,6 +82,7 @@ files:
|
|
73
82
|
- views/examples/nokogiri.xml.nokogiri
|
74
83
|
- views/examples/radius.html.radius
|
75
84
|
- views/examples/rdoc.html.rdoc
|
85
|
+
- views/examples/robots.txt
|
76
86
|
- views/examples/sass.css.sass
|
77
87
|
- views/examples/scss.css.scss
|
78
88
|
- views/examples/slim.html.slim
|
@@ -82,31 +92,31 @@ files:
|
|
82
92
|
- views/examples/yajl.json.yajl
|
83
93
|
- views/script.js.coffee
|
84
94
|
homepage: http://github.com/migrs/rack-server-pages
|
85
|
-
licenses:
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
86
98
|
post_install_message:
|
87
99
|
rdoc_options: []
|
88
100
|
require_paths:
|
89
101
|
- lib
|
90
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
103
|
requirements:
|
93
|
-
- -
|
104
|
+
- - ">="
|
94
105
|
- !ruby/object:Gem::Version
|
95
106
|
version: '0'
|
96
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
108
|
requirements:
|
99
|
-
- -
|
109
|
+
- - ">="
|
100
110
|
- !ruby/object:Gem::Version
|
101
111
|
version: '0'
|
102
112
|
requirements: []
|
103
113
|
rubyforge_project:
|
104
|
-
rubygems_version:
|
114
|
+
rubygems_version: 2.6.8
|
105
115
|
signing_key:
|
106
|
-
specification_version:
|
116
|
+
specification_version: 4
|
107
117
|
summary: Rack middleware and appilcation for serving dynamic pages in very simple
|
108
118
|
way.
|
109
119
|
test_files:
|
120
|
+
- spec/integration_spec.rb
|
110
121
|
- spec/lib/rack/server_pages_spec.rb
|
111
122
|
- spec/spec_helper.rb
|
112
|
-
has_rdoc:
|