nali 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/lib/client/javascripts/nali/connection.js.coffee +10 -2
  2. data/lib/client/javascripts/nali/index.js +0 -1
  3. data/lib/generator/{Gemfile → application/Gemfile} +0 -0
  4. data/lib/generator/{Rakefile → application/Rakefile} +1 -1
  5. data/lib/generator/{app → application/app}/client/javascripts/application.js.coffee +0 -0
  6. data/lib/generator/{app → application/app}/client/javascripts/controllers/homes.js.coffee +0 -0
  7. data/lib/generator/{app → application/app}/client/javascripts/models/home.js.coffee +0 -0
  8. data/lib/generator/{app → application/app}/client/javascripts/views/home/index.js.coffee +0 -0
  9. data/lib/generator/{app → application/app}/client/stylesheets/application.css.sass +0 -0
  10. data/lib/generator/{app → application/app}/client/stylesheets/home/index.css.sass +0 -0
  11. data/lib/generator/{app → application/app}/client/stylesheets/notice/error.css.sass +0 -0
  12. data/lib/generator/{app → application/app}/client/stylesheets/notice/info.css.sass +0 -0
  13. data/lib/generator/{app → application/app}/client/stylesheets/notice/warning.css.sass +0 -0
  14. data/lib/generator/{app → application/app}/client/templates/application.html.erb +0 -0
  15. data/lib/generator/{app → application/app}/client/templates/home/index.html +0 -0
  16. data/lib/generator/{app → application/app}/client/templates/notice/error.html +0 -0
  17. data/lib/generator/{app → application/app}/client/templates/notice/info.html +0 -0
  18. data/lib/generator/{app → application/app}/client/templates/notice/warning.html +0 -0
  19. data/lib/generator/{app → application/app}/server/clients.rb +0 -0
  20. data/lib/generator/{app → application/app}/server/controllers/application_controller.rb +0 -0
  21. data/lib/generator/{app → application/app}/server/models/access.yml +0 -0
  22. data/lib/generator/{app → application/app}/server/routes.rb +0 -0
  23. data/lib/generator/application/config.ru +3 -0
  24. data/lib/generator/{config → application/config}/application.rb +2 -2
  25. data/lib/generator/{config → application/config}/database.yml +1 -1
  26. data/lib/generator/{config → application/config}/environments/development.rb +3 -3
  27. data/lib/generator/{config → application/config}/environments/production.rb +4 -4
  28. data/lib/generator/{config → application/config}/environments/test.rb +6 -6
  29. data/lib/generator/templates/client_controller.tpl +3 -0
  30. data/lib/generator/templates/client_model.tpl +3 -0
  31. data/lib/generator/templates/client_view.tpl +11 -0
  32. data/lib/generator/templates/client_view_styles.tpl +1 -0
  33. data/lib/generator/templates/server_controller.tpl +5 -0
  34. data/lib/generator/templates/server_model.tpl +9 -0
  35. data/lib/generator/templates/server_model_access.tpl +6 -0
  36. data/lib/nali/clients.rb +6 -3
  37. data/lib/nali/connection.rb +27 -0
  38. data/lib/nali/generator.rb +48 -102
  39. data/lib/nali/version.rb +1 -1
  40. metadata +35 -29
  41. data/lib/client/javascripts/nali/deferred.js.coffee +0 -16
  42. data/lib/generator/config.ru +0 -3
@@ -6,7 +6,7 @@ Nali.extend Connection:
6
6
 
7
7
  open: ->
8
8
  @dispatcher = new WebSocket @Application.wsServer
9
- @dispatcher.onopen = ( event ) => @onOpen event
9
+ @dispatcher.onopen = ( event ) => @identification()
10
10
  @dispatcher.onclose = ( event ) => @onClose event
11
11
  @dispatcher.onerror = ( event ) => @onError event
12
12
  @dispatcher.onmessage = ( event ) => @onMessage JSON.parse event.data
@@ -17,7 +17,7 @@ Nali.extend Connection:
17
17
  journal: []
18
18
  reconnectDelay: 0
19
19
 
20
- onOpen: ( event ) ->
20
+ onOpen: ->
21
21
  @reconnectDelay = 0
22
22
  @trigger 'open'
23
23
 
@@ -49,10 +49,18 @@ Nali.extend Connection:
49
49
  @keepAlive()
50
50
  @
51
51
 
52
+ identification: ->
53
+ @send nali_browser_id: @Cookie.get( 'nali_browser_id' ) or @Cookie.set 'nali_browser_id', @Model.guid()
54
+ @
55
+
52
56
  sync: ( message ) ->
53
57
  @Model.sync message.params
54
58
  @
55
59
 
60
+ appRun: ( { method, params } ) ->
61
+ @Application[ method ]? params
62
+ @
63
+
56
64
  callMethod: ( { model, method, params } ) ->
57
65
  if model is 'Notice' then @Notice[ method ] params
58
66
  else
@@ -2,7 +2,6 @@
2
2
  //= require ./form2js.min
3
3
  //= require ./extensions
4
4
  //= require ./nali
5
- //= require ./deferred
6
5
  //= require ./application
7
6
  //= require ./connection
8
7
  //= require ./router
@@ -1,3 +1,3 @@
1
1
  require './config/application'
2
2
 
3
- Nali::Application.tasks
3
+ Nali::Application.tasks
@@ -0,0 +1,3 @@
1
+ require './config/application'
2
+
3
+ run Nali::Application.initialize!
@@ -3,7 +3,7 @@ require 'bundler/setup'
3
3
  Bundler.require
4
4
 
5
5
  module Nali
6
-
6
+
7
7
  class Application
8
8
 
9
9
  configure do |config|
@@ -13,5 +13,5 @@ module Nali
13
13
  end
14
14
 
15
15
  end
16
-
16
+
17
17
  end
@@ -14,4 +14,4 @@ production:
14
14
  adapter: sqlite3
15
15
  database: db/production.sqlite3
16
16
  pool: 5
17
- timeout: 5000
17
+ timeout: 5000
@@ -1,7 +1,7 @@
1
1
  Nali::Application.configure :development do |config|
2
-
2
+
3
3
  config.client_debug = true
4
-
4
+
5
5
  ActiveRecord::Base.logger = false #Logger.new STDOUT
6
-
6
+
7
7
  end
@@ -1,11 +1,11 @@
1
1
  Nali::Application.configure :production do |config|
2
-
2
+
3
3
  ActiveRecord::Base.logger = false
4
-
4
+
5
5
  config.client_digest = true
6
-
6
+
7
7
  config.client.js_compressor = :uglify
8
8
 
9
9
  config.client.css_compressor = :scss
10
-
10
+
11
11
  end
@@ -1,13 +1,13 @@
1
1
  Nali::Application.configure :test do |config|
2
-
2
+
3
3
  # ActiveRecord::Base.logger = false
4
-
4
+
5
5
  # config.client_digest = true
6
-
6
+
7
7
  # config.client_debug = true
8
-
8
+
9
9
  # config.client.js_compressor = :uglify
10
-
10
+
11
11
  # config.client.css_compressor = :scss
12
-
12
+
13
13
  end
@@ -0,0 +1,3 @@
1
+ Nali.Controller.extend <%= classname %>s:
2
+
3
+ actions: {}
@@ -0,0 +1,3 @@
1
+ Nali.Model.extend <%= classname %>:
2
+
3
+ attributes: {}
@@ -0,0 +1,11 @@
1
+ Nali.View.extend <%= classname %>:
2
+
3
+ events: []
4
+
5
+ helpers: {}
6
+
7
+ onDraw: ->
8
+
9
+ onShow: ->
10
+
11
+ onHide: ->
@@ -0,0 +1 @@
1
+ .<%= classname %>
@@ -0,0 +1,5 @@
1
+ class <%= classname %>sController < ApplicationController
2
+
3
+ include Nali::Controller
4
+
5
+ end
@@ -0,0 +1,9 @@
1
+ class <%= classname %> < ActiveRecord::Base
2
+
3
+ include Nali::Model
4
+
5
+ def access_level( client )
6
+ :unknown
7
+ end
8
+
9
+ end
@@ -0,0 +1,6 @@
1
+
2
+ <%= classname %>:
3
+ create:
4
+ read:
5
+ update:
6
+ destroy:
@@ -12,13 +12,16 @@ module Nali
12
12
 
13
13
  def on_client_connected( client )
14
14
  clients << client
15
- client_connected( client ) if respond_to?( :client_connected )
16
15
  end
17
16
 
18
17
  def on_received_message( client, message )
19
- if message[ :ping ]
18
+ if message[ :nali_browser_id ]
19
+ client.browser_id = message[ :nali_browser_id ]
20
+ client_connected( client ) if respond_to?( :client_connected )
21
+ client.send_json action: :onOpen
22
+ elsif message[ :ping ]
20
23
  client.send_json action: :pong
21
- else
24
+ elsif message[ :controller ]
22
25
  name = message[ :controller ].capitalize + 'Controller'
23
26
  if Math.const_defined?( name ) and controller = Object.const_get( name )
24
27
  controller = controller.new( client, message )
@@ -2,9 +2,24 @@ module EventMachine
2
2
  module WebSocket
3
3
  class Connection
4
4
 
5
+ attr_accessor :browser_id
6
+
7
+ def all_tabs
8
+ Nali::Clients.list
9
+ .select { |client| client.browser_id == self.browser_id }
10
+ .each{ |client| yield( client ) if block_given? }
11
+ end
12
+
13
+ def other_tabs
14
+ Nali::Clients.list
15
+ .select { |client| client != self and client.browser_id == self.browser_id }
16
+ .each{ |client| yield( client ) if block_given? }
17
+ end
18
+
5
19
  def reset
6
20
  @storage = {}
7
21
  @watches = {}
22
+ self
8
23
  end
9
24
 
10
25
  def storage
@@ -45,6 +60,7 @@ module EventMachine
45
60
 
46
61
  def send_json( hash )
47
62
  send hash.to_json
63
+ self
48
64
  end
49
65
 
50
66
  def sync( *models )
@@ -56,27 +72,38 @@ module EventMachine
56
72
  send_json action: :sync, params: params
57
73
  end
58
74
  end
75
+ self
59
76
  end
60
77
 
61
78
  def call_method( method, model, params = nil )
62
79
  model = "#{ model.class.name }.#{ model.id }" if model.is_a?( ActiveRecord::Base )
63
80
  send_json action: 'callMethod', model: model, method: method, params: params
81
+ self
64
82
  end
65
83
 
66
84
  def notice( method, params = nil )
67
85
  call_method method, 'Notice', params
86
+ self
68
87
  end
69
88
 
70
89
  def info( params )
71
90
  notice :info, params
91
+ self
72
92
  end
73
93
 
74
94
  def warning( params )
75
95
  notice :warning, params
96
+ self
76
97
  end
77
98
 
78
99
  def error( params )
79
100
  notice :error, params
101
+ self
102
+ end
103
+
104
+ def app_run( method, params = nil )
105
+ send_json action: 'appRun', method: method, params: params
106
+ self
80
107
  end
81
108
 
82
109
  end
@@ -16,90 +16,55 @@ module Nali
16
16
  end
17
17
 
18
18
  def create_application( name )
19
- source_path = File.join( Nali.path, 'generator/.' )
20
- target_path = File.join( Dir.pwd, name )
21
- FileUtils.cp_r source_path, target_path
22
- dirs = []
23
- dirs << File.join( target_path, 'db' )
24
- dirs << File.join( target_path, 'db/migrate' )
25
- dirs << File.join( target_path, 'lib' )
26
- dirs << File.join( target_path, 'lib/client' )
27
- dirs << File.join( target_path, 'lib/client/javascripts' )
28
- dirs << File.join( target_path, 'lib/client/stylesheets' )
29
- dirs << File.join( target_path, 'public' )
30
- dirs << File.join( target_path, 'public/client' )
31
- dirs << File.join( target_path, 'tmp' )
32
- dirs << File.join( target_path, 'vendor' )
33
- dirs << File.join( target_path, 'vendor/client' )
34
- dirs << File.join( target_path, 'vendor/client/javascripts' )
35
- dirs << File.join( target_path, 'vendor/client/stylesheets' )
36
- dirs << File.join( target_path, 'config/initializers' )
37
- dirs.each { |path| Dir.mkdir( path ) unless Dir.exists?( path ) }
19
+ source = File.join Nali.path, 'generator/application/.'
20
+ target = File.join Dir.pwd, name
21
+ FileUtils.cp_r source, target
22
+ %w(
23
+ db
24
+ db/migrate
25
+ lib
26
+ lib/client
27
+ lib/client/javascripts
28
+ lib/client/stylesheets
29
+ public
30
+ public/client
31
+ tmp
32
+ vendor
33
+ vendor/client
34
+ vendor/client/javascripts
35
+ vendor/client/stylesheets
36
+ config/initializers
37
+ ).each { |dir| unless Dir.exists?( path = File.join( target, dir ) ) then Dir.mkdir( path ) end }
38
38
  puts "Application #{ name } created"
39
39
  end
40
+
41
+ def render( name, classname )
42
+ require 'erb'
43
+ ERB.new( File.read( File.join( Nali.path, 'generator/templates', "#{ name }.tpl" ) ) ).result binding
44
+ end
45
+
46
+ def write( path, content, mode = 'w' )
47
+ File.open( File.join( Dir.pwd, path ), mode ) { |file| file.write( content ) }
48
+ puts ( mode == 'a' ? 'Updated: ' : 'Created: ' ) + path
49
+ end
50
+
51
+ def clean_cache
52
+ FileUtils.rm_rf File.join( Dir.pwd, 'tmp/cache' )
53
+ end
40
54
 
41
55
  def create_model( name )
42
56
  if Dir.exists?( File.join( Dir.pwd, 'app' ) )
43
57
  if name.scan( '_' ).size > 0
44
58
  return puts 'Please don\'t use the underscore'
45
59
  end
60
+ clean_cache
46
61
  filename = name.downcase
47
62
  classname = name.camelize
48
- File.open( File.join( Dir.pwd, "app/client/javascripts/models/#{ filename }.js.coffee" ), 'w' ) do |f|
49
- f.write(
50
- "Nali.Model.extend #{ classname }:
51
-
52
- attributes: {}"
53
- )
54
- end
55
- File.open( File.join( Dir.pwd, "app/client/javascripts/controllers/#{ filename }s.js.coffee" ), 'w' ) do |f|
56
- f.write(
57
- "Nali.Controller.extend #{ classname }s:
58
-
59
- actions: {}"
60
- )
61
- end
62
- File.open( File.join( Dir.pwd, "app/server/models/#{ filename }.rb" ), 'w' ) do |f|
63
- f.write(
64
- "class #{ classname } < ActiveRecord::Base
65
-
66
- include Nali::Model
67
-
68
- def access_level( client )
69
- :unknown
70
- end
71
-
72
- end"
73
- )
74
- end
75
- File.open( File.join( Dir.pwd, "app/server/controllers/#{ filename }s_controller.rb" ), 'w' ) do |f|
76
- f.write(
77
- "class #{ classname }sController < ApplicationController
78
-
79
- include Nali::Controller
80
-
81
- end"
82
- )
83
- end
84
- File.open( File.join( Dir.pwd, "app/server/models/access.yml" ), 'a' ) do |f|
85
- f.write(
86
- "
87
-
88
- #{ classname }:
89
- create:
90
- read:
91
- update:
92
- destroy:
93
-
94
- "
95
- )
96
- end
97
- FileUtils.rm_rf( File.join( Dir.pwd, "tmp/cache" ) )
98
- puts "Created: app/client/javascripts/models/#{ filename }.js.coffee"
99
- puts "Created: app/client/javascripts/controllers/#{ filename }s.js.coffee"
100
- puts "Created: app/server/models/#{ filename }.rb"
101
- puts "Created: app/server/controllers/#{ filename }s_controller.rb"
102
- puts "Updated: app/server/models/access.yml"
63
+ write "app/client/javascripts/models/#{ filename }.js.coffee", render( 'client_model', classname )
64
+ write "app/client/javascripts/controllers/#{ filename }s.js.coffee", render( 'client_controller', classname )
65
+ write "app/server/models/#{ filename }.rb", render( 'server_model', classname )
66
+ write "app/server/controllers/#{ filename }s_controller.rb", render( 'server_controller', classname )
67
+ write "app/server/models/access.yml", render( 'server_model_access', classname ), 'a'
103
68
  else puts 'Please go to the application folder' end
104
69
  end
105
70
 
@@ -109,34 +74,15 @@ end"
109
74
  filename = filename.join( '_' )
110
75
  classname = name.underscore.camelize
111
76
  if not dirname.empty? and not filename.empty? and not classname.empty?
112
- dirs = []
113
- dirs << File.join( Dir.pwd, "app/client/javascripts/views/#{ dirname }" )
114
- dirs << File.join( Dir.pwd, "app/client/stylesheets/#{ dirname }" )
115
- dirs << File.join( Dir.pwd, "app/client/templates/#{ dirname }" )
116
- dirs.each { |path| Dir.mkdir( path ) unless Dir.exists?( path ) }
117
- File.open( File.join( Dir.pwd, "app/client/javascripts/views/#{ dirname }/#{ filename }.js.coffee" ), 'w' ) do |f|
118
- f.write(
119
- "Nali.View.extend #{ classname }:
120
-
121
- events: []
122
-
123
- helpers: {}
124
-
125
- onDraw: ->
126
-
127
- onShow: ->
128
-
129
- onHide: ->"
130
- )
131
- end
132
- File.open( File.join( Dir.pwd, "app/client/stylesheets/#{ dirname }/#{ filename }.css.sass" ), 'w' ) do |f|
133
- f.write( ".#{ classname }" )
134
- end
135
- File.open( File.join( Dir.pwd, "app/client/templates/#{ dirname }/#{ filename }.html" ), 'w' ) {}
136
- FileUtils.rm_rf( File.join( Dir.pwd, "tmp/cache" ) )
137
- puts "Created: app/client/javascripts/views/#{ dirname }/#{ filename }.js.coffee"
138
- puts "Created: app/client/stylesheets/#{ dirname }/#{ filename }.css.sass"
139
- puts "Created: app/client/templates/#{ dirname }/#{ filename }.html"
77
+ clean_cache
78
+ [
79
+ "app/client/javascripts/views/#{ dirname }",
80
+ "app/client/stylesheets/#{ dirname }",
81
+ "app/client/templates/#{ dirname }"
82
+ ].each { |dir| unless Dir.exists?( path = File.join( Dir.pwd, dir ) ) then Dir.mkdir( path ) end }
83
+ write "app/client/javascripts/views/#{ dirname }/#{ filename }.js.coffee", render( 'client_view', classname )
84
+ write "app/client/stylesheets/#{ dirname }/#{ filename }.css.sass", render( 'client_view_styles', classname )
85
+ write "app/client/templates/#{ dirname }/#{ filename }.html", ''
140
86
  else puts 'Invalid view name' end
141
87
  else puts 'Please go to the application folder' end
142
88
  end
@@ -1,5 +1,5 @@
1
1
  module Nali
2
2
 
3
- VERSION = '0.3.5'
3
+ VERSION = '0.3.6'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nali
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-10 00:00:00.000000000 Z
12
+ date: 2014-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thin
@@ -198,7 +198,6 @@ files:
198
198
  - lib/client/javascripts/nali/view.js.coffee
199
199
  - lib/client/javascripts/nali/cookie.js.coffee
200
200
  - lib/client/javascripts/nali/nali.js.coffee
201
- - lib/client/javascripts/nali/deferred.js.coffee
202
201
  - lib/client/javascripts/nali/notice.js.coffee
203
202
  - lib/client/javascripts/nali/controller.js.coffee
204
203
  - lib/client/javascripts/nali/jbone.min.js
@@ -222,32 +221,39 @@ files:
222
221
  - lib/nali/helpers.rb
223
222
  - lib/nali/path.rb
224
223
  - lib/nali/application.rb
225
- - lib/generator/app/client/javascripts/models/home.js.coffee
226
- - lib/generator/app/client/javascripts/views/home/index.js.coffee
227
- - lib/generator/app/client/javascripts/controllers/homes.js.coffee
228
- - lib/generator/app/client/javascripts/application.js.coffee
229
- - lib/generator/app/client/templates/application.html.erb
230
- - lib/generator/app/client/templates/notice/error.html
231
- - lib/generator/app/client/templates/notice/warning.html
232
- - lib/generator/app/client/templates/notice/info.html
233
- - lib/generator/app/client/templates/home/index.html
234
- - lib/generator/app/client/stylesheets/notice/info.css.sass
235
- - lib/generator/app/client/stylesheets/notice/error.css.sass
236
- - lib/generator/app/client/stylesheets/notice/warning.css.sass
237
- - lib/generator/app/client/stylesheets/home/index.css.sass
238
- - lib/generator/app/client/stylesheets/application.css.sass
239
- - lib/generator/app/server/models/access.yml
240
- - lib/generator/app/server/routes.rb
241
- - lib/generator/app/server/clients.rb
242
- - lib/generator/app/server/controllers/application_controller.rb
243
- - lib/generator/Rakefile
244
- - lib/generator/config.ru
245
- - lib/generator/config/environments/development.rb
246
- - lib/generator/config/environments/test.rb
247
- - lib/generator/config/environments/production.rb
248
- - lib/generator/config/database.yml
249
- - lib/generator/config/application.rb
250
- - lib/generator/Gemfile
224
+ - lib/generator/templates/server_model.tpl
225
+ - lib/generator/templates/client_model.tpl
226
+ - lib/generator/templates/client_view.tpl
227
+ - lib/generator/templates/client_view_styles.tpl
228
+ - lib/generator/templates/server_controller.tpl
229
+ - lib/generator/templates/server_model_access.tpl
230
+ - lib/generator/templates/client_controller.tpl
231
+ - lib/generator/application/app/client/javascripts/models/home.js.coffee
232
+ - lib/generator/application/app/client/javascripts/views/home/index.js.coffee
233
+ - lib/generator/application/app/client/javascripts/controllers/homes.js.coffee
234
+ - lib/generator/application/app/client/javascripts/application.js.coffee
235
+ - lib/generator/application/app/client/templates/application.html.erb
236
+ - lib/generator/application/app/client/templates/notice/error.html
237
+ - lib/generator/application/app/client/templates/notice/warning.html
238
+ - lib/generator/application/app/client/templates/notice/info.html
239
+ - lib/generator/application/app/client/templates/home/index.html
240
+ - lib/generator/application/app/client/stylesheets/notice/info.css.sass
241
+ - lib/generator/application/app/client/stylesheets/notice/error.css.sass
242
+ - lib/generator/application/app/client/stylesheets/notice/warning.css.sass
243
+ - lib/generator/application/app/client/stylesheets/home/index.css.sass
244
+ - lib/generator/application/app/client/stylesheets/application.css.sass
245
+ - lib/generator/application/app/server/models/access.yml
246
+ - lib/generator/application/app/server/routes.rb
247
+ - lib/generator/application/app/server/clients.rb
248
+ - lib/generator/application/app/server/controllers/application_controller.rb
249
+ - lib/generator/application/Rakefile
250
+ - lib/generator/application/config.ru
251
+ - lib/generator/application/config/environments/development.rb
252
+ - lib/generator/application/config/environments/test.rb
253
+ - lib/generator/application/config/environments/production.rb
254
+ - lib/generator/application/config/database.yml
255
+ - lib/generator/application/config/application.rb
256
+ - lib/generator/application/Gemfile
251
257
  - bin/nali
252
258
  - LICENSE.txt
253
259
  - Rakefile
@@ -1,16 +0,0 @@
1
- #Nali.extend Deferred:
2
- #
3
- # new: ( callback ) ->
4
- # obj = Object.create @
5
- # obj.defer = callback
6
- # obj.awaits = []
7
- # obj.results = []
8
- # obj
9
- #
10
- # await: ( callback ) ->
11
- # wrapper = ( args... ) =>
12
- # @results.push callback args...
13
- # @awaits.splice @awaits.indexOf( wrapper ), 1
14
- # @defer @results unless @awaits.length
15
- # @awaits.push wrapper
16
- # wrapper
@@ -1,3 +0,0 @@
1
- require './config/application'
2
-
3
- run Nali::Application.initialize!