tzispa 0.7.3 → 0.7.4
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/CHANGELOG.md +4 -0
- data/README.md +20 -7
- data/lib/tzispa/app.rb +1 -1
- data/lib/tzispa/commands/helpers/project.rb +68 -33
- data/lib/tzispa/commands/project.rb +15 -1
- data/lib/tzispa/commands/rig.rb +2 -3
- data/lib/tzispa/config/app_config.rb +1 -1
- data/lib/tzispa/config/base.rb +1 -1
- data/lib/tzispa/config/db_config.rb +3 -3
- data/lib/tzispa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30879555b79aeb8632bf06e8be4d195e9f12b0cd
|
4
|
+
data.tar.gz: 8f706c9e46ab36845c37c949442d1d574ba2a457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50100c061e878b8e0289badb3d230ce3e4eec7b3e1f8596065655732955f9cc310e424abee4607a2eedd33a9656d59f6b521e48f52bc6c1e9d3e681b21428ca7
|
7
|
+
data.tar.gz: f238512fe61344001901bb6c48687a8c0e0d35264e187444bffd80aa3b91a18e2ede6ba090a722170c72249acfd28cc219af42540bbde8ac62e2a13e5cd31e80
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -21,25 +21,38 @@ Tzispa is composed by these frameworks:
|
|
21
21
|
## Usage
|
22
22
|
|
23
23
|
```shell
|
24
|
-
% tzispa
|
25
|
-
% cd myproject
|
26
|
-
% tzispa generate app mainapp --host=www.mynewsite.com
|
27
|
-
% puma start.ru
|
24
|
+
% tzispa new myproject
|
28
25
|
```
|
29
26
|
|
30
|
-
## Adding
|
27
|
+
## Adding apps
|
28
|
+
|
29
|
+
```shell
|
30
|
+
% cd myproject
|
31
|
+
% tzispa generate app mainapp
|
32
|
+
```
|
31
33
|
|
32
34
|
Tzispa support multi-app projects. Each app must have a unique mount path
|
33
35
|
|
34
36
|
```shell
|
35
|
-
% tzispa generate app adminapp --
|
37
|
+
% tzispa generate app adminapp --mount=admin
|
38
|
+
```
|
39
|
+
|
40
|
+
## Launch
|
41
|
+
|
42
|
+
```shell
|
43
|
+
% tzispa server
|
44
|
+
```
|
45
|
+
Starting app server daemonizing
|
46
|
+
|
47
|
+
```shell
|
48
|
+
% tzispa server --daemonize
|
36
49
|
```
|
37
50
|
|
38
51
|
## Adding templates
|
39
52
|
|
40
53
|
There are 3 template types: layout, static and block:
|
41
54
|
|
42
|
-
* layout: these are the skeleton entry points
|
55
|
+
* layout: these are the skeleton entry points in the rig template engine
|
43
56
|
* static: these are "light" templates that are a included without any processing as plain text
|
44
57
|
* block: the true core of the rig templates, each block template file has an associated ruby file with the template binder class
|
45
58
|
|
data/lib/tzispa/app.rb
CHANGED
@@ -11,8 +11,12 @@ module Tzispa
|
|
11
11
|
'public/js', 'repository', 'scripts', 'tmp'
|
12
12
|
].freeze
|
13
13
|
|
14
|
+
GEMFILE = 'Gemfile'
|
15
|
+
|
14
16
|
PUMA_CONFIG_FILE = 'puma.rb'
|
15
17
|
|
18
|
+
BOOT_CONFIG_FILE = 'boot.rb'
|
19
|
+
|
16
20
|
BOOT_FILE = 'boot.rb'
|
17
21
|
|
18
22
|
DEFAULT_MOUNT_PATH = '/'
|
@@ -25,44 +29,75 @@ module Tzispa
|
|
25
29
|
].freeze
|
26
30
|
|
27
31
|
PUMA_CONFIG = <<-PUMACONFIG
|
28
|
-
#!/usr/bin/env puma
|
29
|
-
env = Tzispa::Environment.instance
|
30
|
-
app_dir = env.root.to_s
|
31
|
-
tmp_dir = "\#{app_dir}/tmp"
|
32
|
-
logs_dir = "\#{app_dir}/logs"
|
33
|
-
environment env.environment
|
34
|
-
daemonize env.daemonize?
|
35
|
-
pidfile "\#{tmp_dir}/puma.pid"
|
36
|
-
state_path "\#{tmp_dir}/puma.state"
|
37
|
-
if env.daemonize?
|
38
|
-
|
39
|
-
end
|
40
|
-
workers 0
|
41
|
-
# threads 0, 16
|
42
|
-
if env.ssl?
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
else
|
47
|
-
|
48
|
-
end
|
49
|
-
tag '%s'
|
50
|
-
worker_timeout 90
|
32
|
+
#!/usr/bin/env puma
|
33
|
+
env = Tzispa::Environment.instance
|
34
|
+
app_dir = env.root.to_s
|
35
|
+
tmp_dir = "\#{app_dir}/tmp"
|
36
|
+
logs_dir = "\#{app_dir}/logs"
|
37
|
+
environment env.environment
|
38
|
+
daemonize env.daemonize?
|
39
|
+
pidfile "\#{tmp_dir}/puma.pid"
|
40
|
+
state_path "\#{tmp_dir}/puma.state"
|
41
|
+
if env.daemonize?
|
42
|
+
stdout_redirect "\#{logs_dir}/puma.stdout", "\#{logs_dir}/puma.stderr"
|
43
|
+
end
|
44
|
+
workers 0
|
45
|
+
# threads 0, 16
|
46
|
+
if env.ssl?
|
47
|
+
path_to_key = "\#{app_dir}/\#{env['TZISPA_SSL_KEY']}"
|
48
|
+
path_to_cert = "\#{app_dir}/\#{env['TZISPA_SSL_CERT']}"
|
49
|
+
bind "ssl://\#{env.server_host}:\#{env.server_port}?key=\#{path_to_key}&cert=\#{path_to_cert}"
|
50
|
+
else
|
51
|
+
bind "tcp://\#{env.server_host}:\#{env.server_port}"
|
52
|
+
end
|
53
|
+
tag '%s'
|
54
|
+
worker_timeout 90
|
55
|
+
|
51
56
|
PUMACONFIG
|
52
57
|
|
53
58
|
ENVC_DEFAULTS = <<-ENVCDEFAULTS
|
54
|
-
# Define ENV variables
|
55
|
-
WEB_SESSIONS_SECRET="%s"
|
56
|
-
WEB_SESSIONS_TIMEOUT=2400
|
57
|
-
TZISPA_HOST=localhost
|
58
|
-
TZISPA_SERVER_HOST=0.0.0.0
|
59
|
-
# TZISPA_PORT = 9412
|
60
|
-
# TZISPA_SERVER_PORT = 9412
|
61
|
-
TZISPA_SSL=no
|
62
|
-
# TZISPA_SSL_KEY=.ssl.key
|
63
|
-
# TZISPA_SSL_CERT=.ssl.cer
|
59
|
+
# Define ENV variables
|
60
|
+
WEB_SESSIONS_SECRET="%s"
|
61
|
+
WEB_SESSIONS_TIMEOUT=2400
|
62
|
+
TZISPA_HOST=localhost
|
63
|
+
TZISPA_SERVER_HOST=0.0.0.0
|
64
|
+
# TZISPA_PORT = 9412
|
65
|
+
# TZISPA_SERVER_PORT = 9412
|
66
|
+
TZISPA_SSL=no
|
67
|
+
# TZISPA_SSL_KEY=.ssl.key
|
68
|
+
# TZISPA_SSL_CERT=.ssl.cer
|
69
|
+
|
64
70
|
ENVCDEFAULTS
|
65
71
|
|
72
|
+
BOOT_CONFIG = <<-BOOTCONFIG
|
73
|
+
# frozen_string_literal: true
|
74
|
+
|
75
|
+
require 'bundler'
|
76
|
+
|
77
|
+
Bundler.require(*Tzispa::Environment.instance.bundler_groups)
|
78
|
+
|
79
|
+
BOOTCONFIG
|
80
|
+
|
81
|
+
GEMFILE_CONTENT = <<-GEMFILECONTENT
|
82
|
+
# frozen_string_literal: true
|
83
|
+
|
84
|
+
source 'https://rubygems.org'
|
85
|
+
|
86
|
+
gem 'dalli'
|
87
|
+
gem 'i18n'
|
88
|
+
gem 'puma'
|
89
|
+
gem 'redis'
|
90
|
+
gem 'sequel'
|
91
|
+
gem 'tzispa'
|
92
|
+
|
93
|
+
group :development do
|
94
|
+
# Code reloading
|
95
|
+
# See: http://hanamirb.org/guides/projects/code-reloading
|
96
|
+
gem 'shotgun'
|
97
|
+
end
|
98
|
+
|
99
|
+
GEMFILECONTENT
|
100
|
+
|
66
101
|
end
|
67
102
|
end
|
68
103
|
end
|
@@ -31,9 +31,11 @@ module Tzispa
|
|
31
31
|
generate_projectrc
|
32
32
|
generate_environment
|
33
33
|
generate_rackup
|
34
|
+
generate_gemfile
|
34
35
|
generate_puma_config
|
36
|
+
generate_boot_config
|
35
37
|
generate_gitignore
|
36
|
-
generate_i18n(%w
|
38
|
+
generate_i18n(%w[en es])
|
37
39
|
generate_database_config
|
38
40
|
end
|
39
41
|
|
@@ -71,12 +73,24 @@ module Tzispa
|
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
76
|
+
def generate_gemfile
|
77
|
+
File.open("#{name}/#{GEMFILE}", 'w') do |file|
|
78
|
+
file.puts GEMFILE_CONTENT
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
74
82
|
def generate_puma_config
|
75
83
|
File.open("#{name}/config/#{PUMA_CONFIG_FILE}", 'w') do |f|
|
76
84
|
f.puts PUMA_CONFIG % name
|
77
85
|
end
|
78
86
|
end
|
79
87
|
|
88
|
+
def generate_boot_config
|
89
|
+
File.open("#{name}/config/#{BOOT_CONFIG_FILE}", 'w') do |f|
|
90
|
+
f.puts BOOT_CONFIG
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
80
94
|
def generate_database_config
|
81
95
|
Tzispa::Config::DbConfig.create_default name
|
82
96
|
end
|
data/lib/tzispa/commands/rig.rb
CHANGED
@@ -8,19 +8,18 @@ module Tzispa
|
|
8
8
|
class Rig < Command
|
9
9
|
attr_reader :name, :domain, :type, :mime_format
|
10
10
|
|
11
|
-
def initialize(name, app, type,
|
11
|
+
def initialize(name, app, type, options = nil)
|
12
12
|
super(options)
|
13
13
|
@domain = Tzispa::Domain.new app
|
14
14
|
@type = type.to_sym
|
15
15
|
@name = name
|
16
|
-
@mime_format = mime_format
|
17
16
|
end
|
18
17
|
|
19
18
|
def generate
|
20
19
|
Tzispa::Rig::Template.new(name: name,
|
21
20
|
type: type,
|
22
21
|
domain: domain,
|
23
|
-
|
22
|
+
content_type: :htm).create
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
data/lib/tzispa/config/base.rb
CHANGED
@@ -41,9 +41,9 @@ module Tzispa
|
|
41
41
|
|
42
42
|
def create_default(path)
|
43
43
|
hcfg = {}.tap do |cfg|
|
44
|
-
cfg['development'] =
|
45
|
-
cfg['deployment'] =
|
46
|
-
cfg['test'] =
|
44
|
+
cfg['development'] = ''
|
45
|
+
cfg['deployment'] = ''
|
46
|
+
cfg['test'] = ''
|
47
47
|
end
|
48
48
|
Yaml.save(hcfg, File.join(path, filename))
|
49
49
|
end
|
data/lib/tzispa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tzispa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Antonio Piñero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|