tzispa 0.7.3 → 0.7.4

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: ce38eca73b4e9cf4021f220361cb880eac3edb9d
4
- data.tar.gz: 50885d9e8efe83222542fe3d4f43bf7fa56d8aa1
3
+ metadata.gz: 30879555b79aeb8632bf06e8be4d195e9f12b0cd
4
+ data.tar.gz: 8f706c9e46ab36845c37c949442d1d574ba2a457
5
5
  SHA512:
6
- metadata.gz: 76df8fd7e703f513f37d9ec2af73f5bc467eadb9a6aa5bf5c901c93b5941906111b7e4668e4d6745f81a8d51a8134e345b3b72ae11211724acdad733a625989f
7
- data.tar.gz: ea96025a47e02b2a23582f7e6ded42d51249a4536b70a08b60e9d75ba730bf292d845a7ca8a4fd904bda93e816a65d40d62d851b427aa26ff5f74e125cf605ba
6
+ metadata.gz: 50100c061e878b8e0289badb3d230ce3e4eec7b3e1f8596065655732955f9cc310e424abee4607a2eedd33a9656d59f6b521e48f52bc6c1e9d3e681b21428ca7
7
+ data.tar.gz: f238512fe61344001901bb6c48687a8c0e0d35264e187444bffd80aa3b91a18e2ede6ba090a722170c72249acfd28cc219af42540bbde8ac62e2a13e5cd31e80
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ Tzispa
2
2
 
3
3
  General purpose web framework
4
4
 
5
+ ## v0.7.4
6
+ - changed repository load order in app
7
+ - tzispa commands bugs fix
8
+
5
9
  ## v0.7.3
6
10
  - bug fix in controllers base prepare_response method
7
11
 
data/README.md CHANGED
@@ -21,25 +21,38 @@ Tzispa is composed by these frameworks:
21
21
  ## Usage
22
22
 
23
23
  ```shell
24
- % tzispa generate project myproject
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 more apps
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 --host=www.mynewsite.com --mount=admin
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 of the rig templates
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
@@ -64,9 +64,9 @@ module Tzispa
64
64
  app.class.synchronize do
65
65
  logging
66
66
  load_locales
67
+ repository&.load!(domain)
67
68
  domain.setup
68
69
  routes.setup
69
- repository&.load!(domain)
70
70
  end
71
71
  end
72
72
  end
@@ -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
- stdout_redirect "\#{logs_dir}/puma.stdout", "\#{logs_dir}/puma.stderr"
39
- end
40
- workers 0
41
- # threads 0, 16
42
- if env.ssl?
43
- path_to_key = "\#{app_dir}/\#{env['TZISPA_SSL_KEY']}"
44
- path_to_cert = "\#{app_dir}/\#{env['TZISPA_SSL_CERT']}"
45
- bind "ssl://\#{env.server_host}:\#{env.server_port}?key=\#{path_to_key}&cert=\#{path_to_cert}"
46
- else
47
- bind "tcp://\#{env.server_host}:\#{env.server_port}"
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(en es))
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
@@ -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, mime_format = nil, options = nil)
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
- format: mime_format).create
22
+ content_type: :htm).create
24
23
  end
25
24
  end
26
25
 
@@ -47,7 +47,7 @@ module Tzispa
47
47
  log['enabled'] = true
48
48
  log['shift_age'] = 'daily'
49
49
  end
50
- cfg['sessions'] = {}.tap { |ses| ses['enabled'] = true }
50
+ cfg['sessions'] = {}.tap { |ses| ses['enabled'] = false }
51
51
  end
52
52
  Tzispa::Config::Yaml.save(hcfg, filename)
53
53
  load!
@@ -7,7 +7,7 @@ module Tzispa
7
7
 
8
8
  class Base < Struct
9
9
  def self.parametrize(params)
10
- new(*params.keys.map(&:to_sym)).new(*(params.values.map do |v|
10
+ new(*params&.keys&.map(&:to_sym)).new(*(params&.values&.map do |v|
11
11
  v.is_a?(Hash) ? parametrize(v) : v
12
12
  end))
13
13
  end
@@ -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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tzispa
4
- VERSION = '0.7.3'
4
+ VERSION = '0.7.4'
5
5
  FRAMEWORK_NAME = 'Tzispa'
6
6
  GEM_NAME = 'tzispa'
7
7
  end
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.3
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-03 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler