utopia 2.10.0 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/README.md +1 -1
- data/lib/utopia/command/site.rb +1 -1
- data/lib/utopia/content/node.rb +4 -4
- data/lib/utopia/controller/actions.rb +1 -1
- data/lib/utopia/version.rb +1 -1
- data/setup/site/.gitignore +3 -0
- data/setup/site/Gemfile +15 -12
- data/setup/site/spec/website_context.rb +40 -0
- data/setup/site/spec/website_spec.rb +16 -6
- data/spec/utopia/command_spec.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a3620d1dd5c80d45d17ae55a53306107c006ae3a4ca1fe2a25a8140ebdd4f0
|
4
|
+
data.tar.gz: c9196d6b9c9914b7bed4b137a0d0a8fa9cae0a4cacb49b59d6d06002c4f75253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ec96e1c2634b3a68090d1e5dd0323cfb591ebf72b6a7119999948d3b6607eb3e0bed7e5935d0fd246054f306437cda0c4e5d3fa692ed30b1368d9aa84ab470
|
7
|
+
data.tar.gz: 755d8d885cbf838c4a90b7b416e7c4e75776ccdb1131938b4fa03504522ecc56d61bf1617c79e786cd4d6fd6257bcf7377ea131562daea9330be6a862066e51f
|
data/.travis.yml
CHANGED
@@ -2,7 +2,8 @@ language: ruby
|
|
2
2
|
cache: bundler
|
3
3
|
|
4
4
|
before_install:
|
5
|
-
|
5
|
+
# Install all dependencies:
|
6
|
+
- gem install utopia
|
6
7
|
# For testing purposes:
|
7
8
|
- git config --global user.email "samuel@oriontransfer.net"
|
8
9
|
- git config --global user.name "Samuel Williams"
|
@@ -17,6 +18,7 @@ matrix:
|
|
17
18
|
env: COVERAGE=BriefSummary,Coveralls
|
18
19
|
- rvm: 2.6
|
19
20
|
os: osx
|
21
|
+
- rvm: 2.7
|
20
22
|
- rvm: ruby-head
|
21
23
|
- rvm: jruby-head
|
22
24
|
- rvm: truffleruby
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Utopia is a website generation framework which provides a robust set of tools to build highly complex dynamic websites. It uses the filesystem heavily for content and provides functions for interacting with files and directories as structure representing the website.
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://travis-ci.com/socketry/utopia.svg?branch=master)](http://travis-ci.com/socketry/utopia)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/ioquatix/utopia.svg)](https://codeclimate.com/github/ioquatix/utopia)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/ioquatix/utopia/badge.svg)](https://coveralls.io/r/ioquatix/utopia)
|
8
8
|
|
data/lib/utopia/command/site.rb
CHANGED
@@ -31,7 +31,7 @@ module Utopia
|
|
31
31
|
# Local site setup commands.
|
32
32
|
class Site < Samovar::Command
|
33
33
|
# Configuration files which should be installed/updated:
|
34
|
-
CONFIGURATION_FILES = ['.yarnrc', '.gitignore', 'config.ru', 'config/environment.rb', 'falcon.rb', 'Gemfile', 'Guardfile', 'Rakefile', 'tasks/yarn.rake', 'tasks/deploy.rake', 'tasks/development.rake', 'tasks/environment.rake', 'tasks/log.rake']
|
34
|
+
CONFIGURATION_FILES = ['.yarnrc', '.gitignore', 'config.ru', 'config/environment.rb', 'falcon.rb', 'Gemfile', 'Guardfile', 'Rakefile', 'tasks/yarn.rake', 'tasks/deploy.rake', 'tasks/development.rake', 'tasks/environment.rake', 'tasks/log.rake', 'spec/spec_helper.rb', 'spec/website_context.rb', 'spec/website_spec.rb']
|
35
35
|
|
36
36
|
# Directories that should exist:
|
37
37
|
DIRECTORIES = ["config", "lib", "pages", "public", "tasks"]
|
data/lib/utopia/content/node.rb
CHANGED
@@ -79,7 +79,7 @@ module Utopia
|
|
79
79
|
|
80
80
|
def links(path = '.', **options, &block)
|
81
81
|
path = uri_path.dirname + Path[path]
|
82
|
-
links = Links.index(@controller.root, path, options)
|
82
|
+
links = Links.index(@controller.root, path, **options)
|
83
83
|
|
84
84
|
if block_given?
|
85
85
|
links.each(&block)
|
@@ -103,7 +103,7 @@ module Utopia
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def sibling_links(**options)
|
106
|
-
return Links.index(@controller.root, siblings_path, options)
|
106
|
+
return Links.index(@controller.root, siblings_path, **options)
|
107
107
|
end
|
108
108
|
|
109
109
|
# Lookup the given tag which is being rendered within the given node. Invoked by {Document}.
|
@@ -181,8 +181,8 @@ module Utopia
|
|
181
181
|
document.first
|
182
182
|
end
|
183
183
|
|
184
|
-
def links(*arguments, &block)
|
185
|
-
state.node.links(*arguments, &block)
|
184
|
+
def links(*arguments, **options, &block)
|
185
|
+
state.node.links(*arguments, **options, &block)
|
186
186
|
end
|
187
187
|
end
|
188
188
|
end
|
data/lib/utopia/version.rb
CHANGED
data/setup/site/.gitignore
CHANGED
data/setup/site/Gemfile
CHANGED
@@ -1,25 +1,28 @@
|
|
1
1
|
|
2
|
-
source
|
2
|
+
source 'https://rubygems.org'
|
3
3
|
|
4
|
-
gem
|
5
|
-
# gem
|
6
|
-
# gem
|
4
|
+
gem 'utopia', '~> $UTOPIA_VERSION'
|
5
|
+
# gem 'utopia-gallery'
|
6
|
+
# gem 'utopia-analytics'
|
7
7
|
|
8
|
-
gem
|
9
|
-
gem
|
8
|
+
gem 'rake'
|
9
|
+
gem 'bundler'
|
10
10
|
|
11
|
-
gem
|
11
|
+
gem 'rack-freeze', '~> 1.2'
|
12
12
|
|
13
13
|
group :development do
|
14
14
|
# For `rake server`:
|
15
|
-
gem
|
15
|
+
gem 'guard-falcon', require: false
|
16
16
|
gem 'guard-rspec', require: false
|
17
17
|
|
18
18
|
# For `rake console`:
|
19
|
-
gem
|
20
|
-
gem
|
19
|
+
gem 'pry'
|
20
|
+
gem 'rack-test'
|
21
21
|
|
22
22
|
# For `rspec` testing:
|
23
|
-
gem
|
24
|
-
gem
|
23
|
+
gem 'rspec'
|
24
|
+
gem 'covered'
|
25
|
+
|
26
|
+
gem 'async-rspec'
|
27
|
+
gem 'benchmark-http'
|
25
28
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
require 'rack/test'
|
3
|
+
require 'async/rspec/reactor'
|
3
4
|
|
4
5
|
RSpec.shared_context "website" do
|
5
6
|
include Rack::Test::Methods
|
@@ -9,3 +10,42 @@ RSpec.shared_context "website" do
|
|
9
10
|
|
10
11
|
let(:app) {Rack::Builder.parse_file(rackup_path).first}
|
11
12
|
end
|
13
|
+
|
14
|
+
RSpec.shared_examples_for "valid page" do |path|
|
15
|
+
it "can access #{path}" do
|
16
|
+
get path
|
17
|
+
|
18
|
+
while last_response.redirect?
|
19
|
+
follow_redirect!
|
20
|
+
end
|
21
|
+
|
22
|
+
expect(last_response.status).to be == 200
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
RSpec.shared_context "server" do
|
27
|
+
include_context "website"
|
28
|
+
include_context Async::RSpec::Reactor
|
29
|
+
|
30
|
+
before(:all) do
|
31
|
+
require 'falcon/server'
|
32
|
+
require 'async/io/unix_endpoint'
|
33
|
+
require 'benchmark/http/spider'
|
34
|
+
end
|
35
|
+
|
36
|
+
let(:endpoint) {Async::HTTP::Endpoint.parse("http://localhost", Async::IO::Endpoint.unix("server.ipc"))}
|
37
|
+
|
38
|
+
let!(:server_task) do
|
39
|
+
reactor.async do
|
40
|
+
middleware = Falcon::Server.middleware(app)
|
41
|
+
|
42
|
+
server = Falcon::Server.new(middleware, endpoint)
|
43
|
+
|
44
|
+
server.run
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
after do
|
49
|
+
server_task.stop
|
50
|
+
end
|
51
|
+
end
|
@@ -2,14 +2,24 @@
|
|
2
2
|
require_relative 'website_context'
|
3
3
|
|
4
4
|
# Learn about best practice specs from http://betterspecs.org
|
5
|
-
RSpec.describe "
|
6
|
-
include_context "
|
5
|
+
RSpec.describe "website", timeout: 120 do
|
6
|
+
include_context "server"
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
let(:spider) {Benchmark::HTTP::Spider.new(depth: 128)}
|
9
|
+
let(:statistics) {Benchmark::HTTP::Statistics.new}
|
10
|
+
|
11
|
+
it "should be responsive" do
|
12
|
+
Async::HTTP::Client.open(endpoint, connection_limit: 8) do |client|
|
13
|
+
spider.fetch(statistics, client, endpoint.url) do |method, uri, response|
|
14
|
+
#if response.failure?
|
15
|
+
Async.logger.error{"#{method} #{uri} -> #{response.status}"}
|
16
|
+
#end
|
17
|
+
end.wait
|
18
|
+
end
|
10
19
|
|
11
|
-
|
20
|
+
statistics.print
|
12
21
|
|
13
|
-
expect(
|
22
|
+
expect(statistics.samples).to be_any
|
23
|
+
expect(statistics.failed).to be_zero
|
14
24
|
end
|
15
25
|
end
|
data/spec/utopia/command_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -792,7 +792,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
792
792
|
- !ruby/object:Gem::Version
|
793
793
|
version: '0'
|
794
794
|
requirements: []
|
795
|
-
rubygems_version: 3.
|
795
|
+
rubygems_version: 3.1.2
|
796
796
|
signing_key:
|
797
797
|
specification_version: 4
|
798
798
|
summary: Utopia is a framework for building dynamic content-driven websites.
|