utopia 1.6.5 → 1.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/utopia/command.rb +4 -4
- data/lib/utopia/version.rb +1 -1
- data/setup/site/Rakefile +2 -29
- data/setup/site/config/README.md +7 -0
- data/setup/site/config/environment.rb +20 -0
- data/setup/site/config.ru +1 -20
- data/setup/site/tasks/utopia.rake +30 -0
- data/spec/utopia/setup_spec.rb +2 -2
- data/utopia.gemspec +0 -1
- metadata +5 -18
- data/setup/site/cache/head/readme.txt +0 -1
- data/setup/site/cache/meta/readme.txt +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07173b2b6b89dcffb447ca36221fe509007c358a
|
4
|
+
data.tar.gz: a0a4ad7937dd644d29b2ccee57cae6e3bbba021f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f720ad9e13832f308b4a3185245fbba666301054aa62a82963d9307c4b7289a151e6d996046f19cfb0be2ebb07f5ecb22ed977873adaeb1a65cb241d35b4937e
|
7
|
+
data.tar.gz: d62721a3a5f24ca6476230919cbe797bea4f6ebe099171639ae5c297d3338f9c63f9f6196d7dca94993fa331beac8fabb88d6fadfbe1ab6ad01374b2cc446a2e
|
data/README.md
CHANGED
@@ -74,6 +74,13 @@ Then, Nginx is configured like so:
|
|
74
74
|
rewrite ^ http://www.example.com$uri permanent;
|
75
75
|
}
|
76
76
|
|
77
|
+
### Arch Linux
|
78
|
+
|
79
|
+
Packages for deploying Passenger+Nginx on Arch are available in the AUR. There are issues with the official packages so please avoid them.
|
80
|
+
|
81
|
+
- [nginx-mainline-passenger](https://aur.archlinux.org/packages/nginx-mainline-passenger/)
|
82
|
+
- [passenger-nginx-module](https://aur.archlinux.org/packages/passenger-nginx-module/)
|
83
|
+
|
77
84
|
#### Compression
|
78
85
|
|
79
86
|
We suggest [enabling gzip compression](https://zoompf.com/blog/2012/02/lose-the-wait-http-compression):
|
data/lib/utopia/command.rb
CHANGED
@@ -32,13 +32,13 @@ module Utopia
|
|
32
32
|
BASE = File.expand_path("../../setup", __dir__)
|
33
33
|
|
34
34
|
module Site
|
35
|
-
CONFIGURATION_FILES = ['config.ru', 'Gemfile', 'Rakefile']
|
35
|
+
CONFIGURATION_FILES = ['config.ru', 'config/environment.rb', 'Gemfile', 'Rakefile', 'tasks/utopia.rake']
|
36
36
|
|
37
|
-
DIRECTORIES = ["
|
37
|
+
DIRECTORIES = ["config", "lib", "pages", "public", "tasks", "tmp"]
|
38
38
|
SYMLINKS = {"public/_static" => "../pages/_static"}
|
39
39
|
|
40
40
|
# Removed during upgrade process
|
41
|
-
OLD_DIRECTORIES = ["access_log"]
|
41
|
+
OLD_DIRECTORIES = ["access_log", "cache"]
|
42
42
|
|
43
43
|
ROOT = File.join(BASE, 'site')
|
44
44
|
end
|
@@ -127,7 +127,7 @@ module Utopia
|
|
127
127
|
|
128
128
|
if `which bundle`.strip != ''
|
129
129
|
puts "Generating initial package list with bundle..."
|
130
|
-
system("bundle", "install")
|
130
|
+
system("bundle", "install", "--binstubs")
|
131
131
|
end
|
132
132
|
|
133
133
|
if `which git`.strip == ""
|
data/lib/utopia/version.rb
CHANGED
data/setup/site/Rakefile
CHANGED
@@ -1,32 +1,5 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
# This task is typiclly run after the site is updated but before the server is restarted.
|
5
|
-
end
|
6
|
-
|
7
|
-
desc 'Set up the environment for running your web application'
|
8
|
-
task :environment do
|
9
|
-
RACK_ENV = (ENV['RACK_ENV'] ||= 'development').to_sym
|
10
|
-
end
|
11
|
-
|
12
|
-
desc 'Run a server for testing your web application'
|
13
|
-
task :server => :environment do
|
14
|
-
port = ENV.fetch('SERVER_PORT', 9292).to_s
|
15
|
-
exec('puma', '-v', '-p', port)
|
16
|
-
end
|
17
|
-
|
18
|
-
desc 'Start an interactive console for your web application'
|
19
|
-
task :console => :environment do
|
20
|
-
require 'pry'
|
21
|
-
require 'rack/test'
|
22
|
-
|
23
|
-
include Rack::Test::Methods
|
24
|
-
|
25
|
-
def app
|
26
|
-
@app ||= Rack::Builder.parse_file(File.expand_path("config.ru", __dir__)).first
|
27
|
-
end
|
28
|
-
|
29
|
-
Pry.start
|
30
|
-
end
|
2
|
+
# Load all rake tasks:
|
3
|
+
import(*Dir.glob('tasks/*.rake'))
|
31
4
|
|
32
5
|
task :default => :server
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Utopia Config
|
2
|
+
|
3
|
+
This directory contains `environment.rb` which is used to initialize the running environment for tasks and servers.
|
4
|
+
|
5
|
+
## Setting Environment Variables
|
6
|
+
|
7
|
+
If you wish to set environment variables on a per-deployment basis, you can do so by creating an `config/environment.yaml` and populating it with key-value pairs.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
# Setup default encoding:
|
3
|
+
Encoding.default_external = Encoding::UTF_8
|
4
|
+
Encoding.default_internal = Encoding::UTF_8
|
5
|
+
|
6
|
+
# Load environment variables:
|
7
|
+
environment_path = File.expand_path('environment.yaml', __dir__)
|
8
|
+
if File.exist? environment_path
|
9
|
+
require 'yaml'
|
10
|
+
ENV.update(YAML.load_file(environment_path))
|
11
|
+
end
|
12
|
+
|
13
|
+
# Setup the server environment:
|
14
|
+
RACK_ENV = ENV.fetch('RACK_ENV', :development).to_sym unless defined?(RACK_ENV)
|
15
|
+
|
16
|
+
# Allow loading library code from lib directory:
|
17
|
+
$LOAD_PATH << File.expand_path('../lib', __dir__)
|
18
|
+
|
19
|
+
# Load utopia framework:
|
20
|
+
require 'utopia'
|
data/setup/site/config.ru
CHANGED
@@ -1,17 +1,6 @@
|
|
1
1
|
#!/usr/bin/env rackup
|
2
2
|
|
3
|
-
|
4
|
-
Encoding.default_external = Encoding::UTF_8
|
5
|
-
Encoding.default_internal = Encoding::UTF_8
|
6
|
-
|
7
|
-
# Setup the server environment:
|
8
|
-
RACK_ENV = ENV.fetch('RACK_ENV', :development).to_sym unless defined?(RACK_ENV)
|
9
|
-
|
10
|
-
# Allow loading library code from lib directory:
|
11
|
-
$LOAD_PATH << File.expand_path("lib", __dir__)
|
12
|
-
|
13
|
-
require 'utopia'
|
14
|
-
require 'rack/cache'
|
3
|
+
require_relative 'config/environment'
|
15
4
|
|
16
5
|
if RACK_ENV == :production
|
17
6
|
# Handle exceptions in production with a error page and send an email notification:
|
@@ -27,14 +16,6 @@ end
|
|
27
16
|
|
28
17
|
use Rack::Sendfile
|
29
18
|
|
30
|
-
if RACK_ENV == :production
|
31
|
-
# Cache dynamically generated content where possible:
|
32
|
-
use Rack::Cache,
|
33
|
-
metastore: "file:#{Utopia::default_root("cache/meta")}",
|
34
|
-
entitystore: "file:#{Utopia::default_root("cache/body")}",
|
35
|
-
verbose: RACK_ENV == :development
|
36
|
-
end
|
37
|
-
|
38
19
|
use Utopia::ContentLength
|
39
20
|
|
40
21
|
use Utopia::Redirection::Rewrite,
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
desc 'Run by git post-update hook when deployed to a web server'
|
3
|
+
task :deploy do
|
4
|
+
# This task is typiclly run after the site is updated but before the server is restarted.
|
5
|
+
end
|
6
|
+
|
7
|
+
desc 'Set up the environment for running your web application'
|
8
|
+
task :environment do
|
9
|
+
require_relative '../config/environment'
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Run a server for testing your web application'
|
13
|
+
task :server => :environment do
|
14
|
+
port = ENV.fetch('SERVER_PORT', 9292).to_s
|
15
|
+
exec('puma', '-v', '-p', port)
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'Start an interactive console for your web application'
|
19
|
+
task :console => :environment do
|
20
|
+
require 'pry'
|
21
|
+
require 'rack/test'
|
22
|
+
|
23
|
+
include Rack::Test::Methods
|
24
|
+
|
25
|
+
def app
|
26
|
+
@app ||= Rack::Builder.parse_file(File.expand_path("config.ru", __dir__)).first
|
27
|
+
end
|
28
|
+
|
29
|
+
Pry.start
|
30
|
+
end
|
data/spec/utopia/setup_spec.rb
CHANGED
@@ -56,7 +56,7 @@ RSpec.describe "utopia executable" do
|
|
56
56
|
result = sh(utopia, "--in", dir, "site", "create")
|
57
57
|
expect(result).to be == 0
|
58
58
|
|
59
|
-
expect(Dir.entries(dir)).to include(".bowerrc", ".git", "Gemfile", "Gemfile.lock", "README.md", "Rakefile", "
|
59
|
+
expect(Dir.entries(dir)).to include(".bowerrc", ".git", "Gemfile", "Gemfile.lock", "README.md", "Rakefile", "config.ru", "lib", "pages", "public", "tmp")
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -90,7 +90,7 @@ RSpec.describe "utopia executable" do
|
|
90
90
|
expect(result).to be == 0
|
91
91
|
end
|
92
92
|
|
93
|
-
expect(Dir.entries(server_path)).to include(".bowerrc", ".git", "Gemfile", "README.md", "Rakefile", "
|
93
|
+
expect(Dir.entries(server_path)).to include(".bowerrc", ".git", "Gemfile", "README.md", "Rakefile", "config.ru", "lib", "pages", "public", "tmp")
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
data/utopia.gemspec
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: 1.6.
|
4
|
+
version: 1.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -72,20 +72,6 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '1.6'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: rack-cache
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: 1.2.0
|
82
|
-
type: :runtime
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: 1.2.0
|
89
75
|
- !ruby/object:Gem::Dependency
|
90
76
|
name: http-accept
|
91
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -253,9 +239,9 @@ files:
|
|
253
239
|
- setup/site/Gemfile
|
254
240
|
- setup/site/README.md
|
255
241
|
- setup/site/Rakefile
|
256
|
-
- setup/site/cache/head/readme.txt
|
257
|
-
- setup/site/cache/meta/readme.txt
|
258
242
|
- setup/site/config.ru
|
243
|
+
- setup/site/config/README.md
|
244
|
+
- setup/site/config/environment.rb
|
259
245
|
- setup/site/lib/readme.txt
|
260
246
|
- setup/site/pages/_heading.xnode
|
261
247
|
- setup/site/pages/_page.xnode
|
@@ -268,6 +254,7 @@ files:
|
|
268
254
|
- setup/site/public/_static/utopia-background.svg
|
269
255
|
- setup/site/public/_static/utopia.svg
|
270
256
|
- setup/site/public/readme.txt
|
257
|
+
- setup/site/tasks/utopia.rake
|
271
258
|
- setup/site/tmp/readme.txt
|
272
259
|
- spec/utopia/content/link_spec.rb
|
273
260
|
- spec/utopia/content/links/foo/index.xnode
|
@@ -1 +0,0 @@
|
|
1
|
-
This is a place-holder file so that this directory is created correctly.
|
@@ -1 +0,0 @@
|
|
1
|
-
This is a place-holder file so that this directory is created correctly.
|