eucalypt 0.2.0 → 0.2.1
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 +4 -4
- data/lib/eucalypt/eucalypt-blog/namespaces/blog/cli/blog.rb +3 -3
- data/lib/eucalypt/eucalypt-core/templates/eucalypt/Procfile +1 -1
- data/lib/eucalypt/eucalypt-core/templates/eucalypt/app.rb +7 -18
- data/lib/eucalypt/eucalypt-core/templates/eucalypt/config/asset_pipeline.rb +8 -8
- data/lib/eucalypt/eucalypt-core/templates/eucalypt/config/logging.rb +4 -6
- data/lib/eucalypt/eucalypt-migration/namespaces/migration-drop/cli/drop-index.rb +1 -1
- data/lib/eucalypt/root.rb +21 -0
- data/lib/eucalypt/version.rb +2 -2
- data/lib/eucalypt.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dd8989666dd4b95e017bc50fcb59257a2d1137239fa285c4c91bdd90e9b15a8
|
4
|
+
data.tar.gz: 6758de1df95de41ef8aafdb3c904bbd2c86555b1c9b02ac49d5d0c850e6f7045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d38e7bfe7f9e53011b7fb4955b6509a45f08fdbc52b2294b17838c15f88095415f700d64ab34a7dc4a7f8feb27e68348fad6f4ec4e37d9be725bfd10cfa6708
|
7
|
+
data.tar.gz: 3d1a8a905f2beec4298c9c2767bc3b0b688e42becc33f36dc7092f2316ee39a1c6b5623309cde3301cb7e99bc4b18e950d0f00df18f4a10ce4c938123a032a6b
|
@@ -33,13 +33,13 @@ module Eucalypt
|
|
33
33
|
asset_pipeline_file = File.join(directory, 'config', 'asset_pipeline.rb')
|
34
34
|
|
35
35
|
File.open(asset_pipeline_file) do |f|
|
36
|
-
return if f.read.include? "
|
36
|
+
return if f.read.include? "assets.append_path Eucalypt.path 'app', 'assets', 'blog'"
|
37
37
|
end
|
38
38
|
|
39
39
|
insert_into_file(
|
40
40
|
asset_pipeline_file,
|
41
|
-
"\
|
42
|
-
after: "set :
|
41
|
+
"\tassets.append_path Eucalypt.path 'app', 'assets', 'blog'\n",
|
42
|
+
after: "set :assets, Sprockets::Environment.new\n"
|
43
43
|
)
|
44
44
|
else
|
45
45
|
Eucalypt::Error.wrong_directory
|
@@ -1 +1 @@
|
|
1
|
-
web: bundle exec
|
1
|
+
web: bundle exec eucalypt launch production -p $PORT
|
@@ -1,17 +1,6 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
Bundler.require :default
|
3
|
-
|
4
|
-
Eucalypt::ROOT = __dir__.freeze
|
5
|
-
|
6
|
-
module Eucalypt
|
7
|
-
class << self
|
8
|
-
def root() ROOT end
|
9
|
-
def path(*args) File.join(ROOT, *args) end
|
10
|
-
def glob(*args, &block) Dir.glob(self.path(*args), &block) end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
Eucalypt.glob 'config', 'initializers', '*.rb', &method(:require)
|
3
|
+
Eucalypt.set_root __dir__
|
15
4
|
|
16
5
|
Static = Eucalypt::Static.new(Eucalypt.path('app', 'static'), symbolize: true).freeze
|
17
6
|
|
@@ -31,12 +20,12 @@ class ApplicationController < Sinatra::Base
|
|
31
20
|
# Set default ERB template
|
32
21
|
set :erb, layout: :'layouts/main'
|
33
22
|
|
34
|
-
# Set Hanami asset helpers
|
23
|
+
# Set Hanami HTML and asset helpers
|
35
24
|
helpers Hanami::Helpers, Hanami::Assets::Helpers
|
36
25
|
end
|
37
26
|
|
38
|
-
|
39
|
-
Eucalypt.
|
40
|
-
Eucalypt.
|
41
|
-
|
42
|
-
Eucalypt.
|
27
|
+
Eucalypt.require 'config', '*.rb'
|
28
|
+
Eucalypt.require 'config', 'initializers', '*.rb'
|
29
|
+
Eucalypt.require 'app', 'helpers', '{application_helper.rb}'
|
30
|
+
Eucalypt.require 'app', 'controllers', 'application_controller.rb'
|
31
|
+
Eucalypt.require 'app', '{models,policies,helpers,controllers}', '*.rb'
|
@@ -1,15 +1,15 @@
|
|
1
1
|
class ApplicationController < Sinatra::Base
|
2
|
-
set :
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
set :assets, Sprockets::Environment.new
|
3
|
+
assets.append_path Eucalypt.path 'app', 'assets', 'stylesheets'
|
4
|
+
assets.append_path Eucalypt.path 'app', 'assets', 'scripts'
|
5
|
+
assets.append_path Eucalypt.path 'app', 'assets', 'images'
|
6
|
+
assets.append_path Eucalypt.path 'app', 'assets', 'fonts'
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
assets.css_compressor = :scss
|
9
|
+
assets.js_compressor = :uglify
|
10
10
|
|
11
11
|
get '/assets/*' do
|
12
12
|
env["PATH_INFO"].sub! '/assets', ''
|
13
|
-
settings.
|
13
|
+
settings.assets.call env
|
14
14
|
end
|
15
15
|
end
|
@@ -2,21 +2,19 @@ class ApplicationController < Sinatra::Base
|
|
2
2
|
set :logger, Lumberjack::Logger.new
|
3
3
|
|
4
4
|
require 'fileutils'
|
5
|
-
%i[production test].each do |
|
6
|
-
configure
|
5
|
+
%i[production test].each do |e|
|
6
|
+
configure e do
|
7
7
|
use Rack::CommonLogger, $stdout
|
8
8
|
|
9
9
|
log_path = Eucalypt.path 'log', Time.now.strftime("%Y-%m-%dT%H-%M-%S_%z").sub(/_\+/, ?p).sub(/_\-/, ?m)
|
10
10
|
FileUtils.mkdir_p log_path
|
11
11
|
|
12
12
|
# STDERR logger
|
13
|
-
|
14
|
-
$stderr.reopen stderr_log
|
13
|
+
$stderr.reopen File.new(File.join(log_path, "#{e}.stderr.log"), 'a+')
|
15
14
|
$stderr.sync = true
|
16
15
|
|
17
16
|
# STDOUT logger
|
18
|
-
|
19
|
-
$stdout.reopen stdout_log
|
17
|
+
$stdout.reopen File.new(File.join(log_path, "#{e}.stdout.log"), 'a+')
|
20
18
|
$stdout.sync = true
|
21
19
|
end
|
22
20
|
end
|
@@ -8,7 +8,7 @@ module Eucalypt
|
|
8
8
|
include Eucalypt::Helpers
|
9
9
|
using Colorize
|
10
10
|
option :name, aliases: '-n', type: :string, desc: "Index name"
|
11
|
-
desc "index [TABLE] [
|
11
|
+
desc "index [TABLE] *[COLUMNS]", "Removes an index from a table".colorize(:grey)
|
12
12
|
def index(table, *columns)
|
13
13
|
directory = File.expand_path('.')
|
14
14
|
if Eucalypt.app? directory
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Eucalypt
|
2
|
+
def self.set_root(root)
|
3
|
+
const_set :ROOT, root.freeze
|
4
|
+
|
5
|
+
define_singleton_method :root do
|
6
|
+
const_get :ROOT
|
7
|
+
end
|
8
|
+
|
9
|
+
define_singleton_method :path do |*args|
|
10
|
+
File.join self.root, *args
|
11
|
+
end
|
12
|
+
|
13
|
+
define_singleton_method :glob do |*args, &block|
|
14
|
+
Dir.glob self.path(*args), &block
|
15
|
+
end
|
16
|
+
|
17
|
+
define_singleton_method :require do |*args|
|
18
|
+
self.glob *args, &Kernel.method(:require)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/eucalypt/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Eucalypt
|
2
|
-
VERSION = '0.2.
|
3
|
-
end
|
2
|
+
VERSION = '0.2.1'
|
3
|
+
end
|
data/lib/eucalypt.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eucalypt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edwin Onuonga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -342,6 +342,7 @@ files:
|
|
342
342
|
- lib/eucalypt/helpers/migration.rb
|
343
343
|
- lib/eucalypt/helpers/numeric.rb
|
344
344
|
- lib/eucalypt/list.rb
|
345
|
+
- lib/eucalypt/root.rb
|
345
346
|
- lib/eucalypt/static.rb
|
346
347
|
- lib/eucalypt/version.rb
|
347
348
|
homepage: https://eucalypt.gitbook.io/eucalypt
|