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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 568d13725a84d36df5372dbeddaee9d7dac100fc
4
- data.tar.gz: 166571e522f619f11c8867357e64fb1ebb4612c4
3
+ metadata.gz: 07173b2b6b89dcffb447ca36221fe509007c358a
4
+ data.tar.gz: a0a4ad7937dd644d29b2ccee57cae6e3bbba021f
5
5
  SHA512:
6
- metadata.gz: 1a9627b9c483e035dbe30ed562dc9cf2546b4b6953bd258865271138d487d14c2c9e0938a032cab800cb401c0362c844fa6486fd4685dcad86098517ba44fef7
7
- data.tar.gz: ee75d2d7079db75d76d652b06c20942b7f1f5ef05c4cf30315c699969b93ca4c50e18dc21bd19eaa4b3bf6b9a7c68bbed0105211ed902b448773f97dc2330696
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):
@@ -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 = ["cache", "cache/meta", "cache/body", "lib", "pages", "public", "tmp"]
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 == ""
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "1.6.5"
22
+ VERSION = "1.6.8"
23
23
  end
data/setup/site/Rakefile CHANGED
@@ -1,32 +1,5 @@
1
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
- 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
- # Setup default encoding:
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
@@ -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", "cache", "config.ru", "lib", "pages", "public", "tmp")
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", "cache", "config.ru", "lib", "pages", "public", "tmp")
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
@@ -30,7 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency 'samovar', '~> 1.1.0'
31
31
 
32
32
  spec.add_dependency 'rack', '~> 1.6'
33
- spec.add_dependency 'rack-cache', '~> 1.2.0'
34
33
 
35
34
  spec.add_dependency 'http-accept', '~> 1.4.0'
36
35
 
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.5
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-03 00:00:00.000000000 Z
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.