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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 473bc20c3cb5a2b2b0bc08830a5b34ac5519f60fbc97453292da59671a857c6f
4
- data.tar.gz: 1c78fb9a0d685502b675ac1351eaa465c4140317ad0aa1fbd323632822b5d84f
3
+ metadata.gz: 38a3620d1dd5c80d45d17ae55a53306107c006ae3a4ca1fe2a25a8140ebdd4f0
4
+ data.tar.gz: c9196d6b9c9914b7bed4b137a0d0a8fa9cae0a4cacb49b59d6d06002c4f75253
5
5
  SHA512:
6
- metadata.gz: 2b2d06006aff49f81104a7fa0bf7b03167e1b92d3afe2412409032b22f652b3493a6fccef5b578aa7dcb9b14c10797248db6e5e5d24e088f122af7957bffe1a3
7
- data.tar.gz: 001e36314faf87ab21c25b047d2ad532c7e96990d9f365fa4b407e04e2fe61cc2ffaa35c1ce883fa91501c6e192164d50223581ad52bec6b6fc58d5a6da490ce
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
- - gem install utopia # Install all dependencies.
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://secure.travis-ci.org/ioquatix/utopia.svg)](http://travis-ci.org/ioquatix/utopia)
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
 
@@ -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"]
@@ -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
@@ -139,7 +139,7 @@ module Utopia
139
139
  first = ['**', first.to_s]
140
140
  end
141
141
 
142
- actions.define(Path.split(first) + path, options, &block)
142
+ actions.define(Path.split(first) + path, **options, &block)
143
143
  end
144
144
 
145
145
  def otherwise(&block)
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "2.10.0"
22
+ VERSION = "2.11.0"
23
23
  end
@@ -7,3 +7,6 @@ tmp/
7
7
 
8
8
  # This file should only ever exist on production, and may contain sensitive information:
9
9
  config/environment.yaml
10
+
11
+ # Ignore resized gallery photos:
12
+ public/_gallery/
data/setup/site/Gemfile CHANGED
@@ -1,25 +1,28 @@
1
1
 
2
- source "https://rubygems.org"
2
+ source 'https://rubygems.org'
3
3
 
4
- gem "utopia", "~> $UTOPIA_VERSION"
5
- # gem "utopia-gallery"
6
- # gem "utopia-analytics"
4
+ gem 'utopia', '~> $UTOPIA_VERSION'
5
+ # gem 'utopia-gallery'
6
+ # gem 'utopia-analytics'
7
7
 
8
- gem "rake"
9
- gem "bundler"
8
+ gem 'rake'
9
+ gem 'bundler'
10
10
 
11
- gem "rack-freeze", "~> 1.2"
11
+ gem 'rack-freeze', '~> 1.2'
12
12
 
13
13
  group :development do
14
14
  # For `rake server`:
15
- gem "guard-falcon", require: false
15
+ gem 'guard-falcon', require: false
16
16
  gem 'guard-rspec', require: false
17
17
 
18
18
  # For `rake console`:
19
- gem "pry"
20
- gem "rack-test"
19
+ gem 'pry'
20
+ gem 'rack-test'
21
21
 
22
22
  # For `rspec` testing:
23
- gem "rspec"
24
- gem "covered"
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 "my website" do
6
- include_context "website"
5
+ RSpec.describe "website", timeout: 120 do
6
+ include_context "server"
7
7
 
8
- it "should have an accessible front page" do
9
- get "/"
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
- follow_redirect!
20
+ statistics.print
12
21
 
13
- expect(last_response.status).to be == 200
22
+ expect(statistics.samples).to be_any
23
+ expect(statistics.failed).to be_zero
14
24
  end
15
25
  end
@@ -23,6 +23,7 @@ require 'tmpdir'
23
23
  require 'yaml'
24
24
 
25
25
  require 'open3'
26
+ require 'bundler'
26
27
 
27
28
  RSpec.describe "utopia command" do
28
29
  let(:utopia) {File.expand_path("../../bin/utopia", __dir__)}
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.10.0
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: 2019-12-10 00:00:00.000000000 Z
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.0.6
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.