tzispa 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/tzispa/app.rb +2 -2
- data/lib/tzispa/app_config.rb +39 -40
- data/lib/tzispa/commands/app.rb +1 -1
- data/lib/tzispa/version.rb +1 -1
- data/tzispa.gemspec +3 -4
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20fcf7aca3feb0b1bd1fb53a7ebd553335880e6f889215360587744ddca5041a
|
4
|
+
data.tar.gz: b9530bfbfb0de6d4939b095ac4ab50538e3e99ac477b7041ca21c62532cac6fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a98802a90b294996ec0342ca779ca414422372bd591e5b339a4f18b433114fe627f378cbcce72a5451757b5ee45ab3e7f0f984d7a00c8e5c487fe14be35d7cce
|
7
|
+
data.tar.gz: 33a65c9da8f2d137fc86972b899535875fb749f9076fdf94e137e08556a307fb88459dd5101f72c6e93178ce62aa997c3dee733e1a572e9e2bfe63d4835e5944
|
data/CHANGELOG.md
CHANGED
data/lib/tzispa/app.rb
CHANGED
@@ -4,7 +4,7 @@ require 'forwardable'
|
|
4
4
|
require 'logger'
|
5
5
|
require 'i18n'
|
6
6
|
require 'tzispa/domain'
|
7
|
-
require 'tzispa/
|
7
|
+
require 'tzispa/app_config'
|
8
8
|
require 'tzispa/engine'
|
9
9
|
require 'tzispa_data'
|
10
10
|
|
@@ -90,7 +90,7 @@ module Tzispa
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def config
|
93
|
-
@config ||=
|
93
|
+
@config ||= AppConfig.new(@domain).load!
|
94
94
|
end
|
95
95
|
|
96
96
|
private
|
data/lib/tzispa/app_config.rb
CHANGED
@@ -4,55 +4,54 @@ require 'tzispa/config/yaml'
|
|
4
4
|
require 'tzispa_helpers'
|
5
5
|
|
6
6
|
module Tzispa
|
7
|
-
module Config
|
8
|
-
class AppConfig
|
9
|
-
include Tzispa::Helpers::Security
|
10
7
|
|
11
|
-
|
8
|
+
class AppConfig
|
9
|
+
include Tzispa::Helpers::Security
|
12
10
|
|
13
|
-
|
11
|
+
CONFIG_FILENAME = :appconfig
|
14
12
|
|
15
|
-
|
16
|
-
@domain = domain
|
17
|
-
@cftime = nil
|
18
|
-
end
|
13
|
+
attr_reader :domain, :cfname
|
19
14
|
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
def initialize(domain)
|
16
|
+
@domain = domain
|
17
|
+
@cftime = nil
|
18
|
+
end
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
20
|
+
def filename
|
21
|
+
@filename ||= "config/#{domain.name}.yml"
|
22
|
+
end
|
23
|
+
|
24
|
+
def load!
|
25
|
+
if @cftime.nil?
|
26
|
+
@cftime = File.ctime(filename)
|
27
|
+
elsif @cftime != File.ctime(filename)
|
28
|
+
@config = nil
|
29
|
+
@cftime = File.ctime(filename)
|
32
30
|
end
|
31
|
+
@config ||= Tzispa::Config::Yaml.load(filename)
|
32
|
+
end
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
cfg['sessions'] = {}.tap { |ses| ses['enabled'] = false }
|
34
|
+
def create_default(default_layout, locale)
|
35
|
+
hcfg = {}.tap do |cfg|
|
36
|
+
cfg['default_layout'] = default_layout
|
37
|
+
cfg['default_format'] = 'htm'
|
38
|
+
cfg['default_encoding'] = 'utf-8'
|
39
|
+
cfg['absolute_redirects'] = true
|
40
|
+
cfg['salt'] = secret(24)
|
41
|
+
cfg['secret'] = secret(36)
|
42
|
+
cfg['locales'] = {}.tap do |loc|
|
43
|
+
loc['preload'] = true
|
44
|
+
loc['default'] = locale
|
45
|
+
end
|
46
|
+
cfg['logging'] = {}.tap do |log|
|
47
|
+
log['enabled'] = true
|
48
|
+
log['shift_age'] = 'daily'
|
51
49
|
end
|
52
|
-
|
53
|
-
load!
|
50
|
+
cfg['sessions'] = {}.tap { |ses| ses['enabled'] = false }
|
54
51
|
end
|
52
|
+
Tzispa::Config::Yaml.save(hcfg, filename)
|
53
|
+
load!
|
55
54
|
end
|
56
|
-
|
57
55
|
end
|
56
|
+
|
58
57
|
end
|
data/lib/tzispa/commands/app.rb
CHANGED
data/lib/tzispa/version.rb
CHANGED
data/tzispa.gemspec
CHANGED
@@ -16,14 +16,13 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.required_ruby_version = '~> 2.4'
|
18
18
|
|
19
|
-
s.add_dependency 'bundler', '~> 1.14'
|
20
19
|
s.add_dependency 'dotenv', '~> 2.2'
|
21
20
|
s.add_dependency 'http_router', '~> 0.11.2'
|
22
|
-
s.add_dependency 'i18n', '~> 0.
|
21
|
+
s.add_dependency 'i18n', '~> 0.9.0'
|
23
22
|
s.add_dependency 'rack', '~> 2.0', '>= 2.0.1'
|
24
|
-
s.add_dependency 'thor', '~> 0.
|
23
|
+
s.add_dependency 'thor', '~> 0.20.0'
|
25
24
|
s.add_dependency 'tzispa_config', '~> 0.1.0'
|
26
|
-
s.add_dependency 'tzispa_data', '~> 0.
|
25
|
+
s.add_dependency 'tzispa_data', '~> 0.6.0'
|
27
26
|
s.add_dependency 'tzispa_helpers', '~> 0.3.6'
|
28
27
|
s.add_dependency 'tzispa_rig', '~> 0.5.10'
|
29
28
|
s.add_dependency 'tzispa_utils', '~> 0.3.6'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tzispa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Antonio Piñero
|
@@ -10,20 +10,6 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.14'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.14'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: dotenv
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +44,14 @@ dependencies:
|
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
47
|
+
version: 0.9.0
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
54
|
+
version: 0.9.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rack
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,14 +78,14 @@ dependencies:
|
|
92
78
|
requirements:
|
93
79
|
- - "~>"
|
94
80
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
81
|
+
version: 0.20.0
|
96
82
|
type: :runtime
|
97
83
|
prerelease: false
|
98
84
|
version_requirements: !ruby/object:Gem::Requirement
|
99
85
|
requirements:
|
100
86
|
- - "~>"
|
101
87
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
88
|
+
version: 0.20.0
|
103
89
|
- !ruby/object:Gem::Dependency
|
104
90
|
name: tzispa_config
|
105
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +106,14 @@ dependencies:
|
|
120
106
|
requirements:
|
121
107
|
- - "~>"
|
122
108
|
- !ruby/object:Gem::Version
|
123
|
-
version: 0.
|
109
|
+
version: 0.6.0
|
124
110
|
type: :runtime
|
125
111
|
prerelease: false
|
126
112
|
version_requirements: !ruby/object:Gem::Requirement
|
127
113
|
requirements:
|
128
114
|
- - "~>"
|
129
115
|
- !ruby/object:Gem::Version
|
130
|
-
version: 0.
|
116
|
+
version: 0.6.0
|
131
117
|
- !ruby/object:Gem::Dependency
|
132
118
|
name: tzispa_helpers
|
133
119
|
requirement: !ruby/object:Gem::Requirement
|