nali 0.4.2 → 0.4.3
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.
- data/lib/client/javascripts/nali/application.js.coffee +4 -4
- data/lib/client/javascripts/nali/collection.js.coffee +53 -53
- data/lib/client/javascripts/nali/connection.js.coffee +39 -39
- data/lib/client/javascripts/nali/controller.js.coffee +12 -12
- data/lib/client/javascripts/nali/model.js.coffee +56 -57
- data/lib/client/javascripts/nali/nali.js.coffee +22 -22
- data/lib/client/javascripts/nali/notice.js.coffee +7 -6
- data/lib/client/javascripts/nali/router.js.coffee +11 -18
- data/lib/client/javascripts/nali/view.js.coffee +102 -93
- data/lib/nali/clients.rb +2 -2
- data/lib/nali/connection.rb +4 -4
- data/lib/nali/controller.rb +2 -2
- data/lib/nali/helpers.rb +1 -1
- data/lib/nali/model.rb +1 -1
- data/lib/nali/tasks.rb +3 -0
- data/lib/nali/version.rb +1 -1
- metadata +2 -2
data/lib/nali/clients.rb
CHANGED
@@ -18,9 +18,9 @@ module Nali
|
|
18
18
|
if message[ :nali_browser_id ]
|
19
19
|
client.browser_id = message[ :nali_browser_id ]
|
20
20
|
client_connected( client ) if respond_to?( :client_connected )
|
21
|
-
client.send_json action: :
|
21
|
+
client.send_json action: :_onOpen
|
22
22
|
elsif message[ :ping ]
|
23
|
-
client.send_json action: :
|
23
|
+
client.send_json action: :_pong
|
24
24
|
elsif message[ :controller ]
|
25
25
|
name = message[ :controller ].capitalize + 'Controller'
|
26
26
|
if Math.const_defined?( name ) and controller = Object.const_get( name )
|
data/lib/nali/connection.rb
CHANGED
@@ -70,7 +70,7 @@ module EventMachine
|
|
70
70
|
unless params.empty?
|
71
71
|
if model.destroyed? then unwatch( model ) else watch_time_up model end
|
72
72
|
relations.each { |relation| sync relation }
|
73
|
-
send_json action: :
|
73
|
+
send_json action: :_sync, params: params
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -79,12 +79,12 @@ module EventMachine
|
|
79
79
|
|
80
80
|
def call_method( method, model, params = nil )
|
81
81
|
model = "#{ model.class.name }.#{ model.id }" if model.is_a?( ActiveRecord::Base )
|
82
|
-
send_json action:
|
82
|
+
send_json action: :_callMethod, model: model, method: method, params: params
|
83
83
|
self
|
84
84
|
end
|
85
85
|
|
86
86
|
def notice( method, params = nil )
|
87
|
-
call_method method,
|
87
|
+
call_method method, :Notice, params
|
88
88
|
self
|
89
89
|
end
|
90
90
|
|
@@ -104,7 +104,7 @@ module EventMachine
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def app_run( method, params = nil )
|
107
|
-
send_json action:
|
107
|
+
send_json action: :_appRun, method: method, params: params
|
108
108
|
self
|
109
109
|
end
|
110
110
|
|
data/lib/nali/controller.rb
CHANGED
@@ -69,11 +69,11 @@ module Nali
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def trigger_success( params = nil )
|
72
|
-
client.send_json( { action:
|
72
|
+
client.send_json( { action: :_success, params: params, journal_id: @message[ :journal_id ] } )
|
73
73
|
end
|
74
74
|
|
75
75
|
def trigger_failure( params = nil )
|
76
|
-
client.send_json( { action:
|
76
|
+
client.send_json( { action: :_failure, params: params, journal_id: @message[ :journal_id ] } )
|
77
77
|
end
|
78
78
|
|
79
79
|
def before( &closure )
|
data/lib/nali/helpers.rb
CHANGED
@@ -8,7 +8,7 @@ module Sprockets
|
|
8
8
|
id = arr[1] + '_' + arr[0].split( '.' )[0]
|
9
9
|
asset = environment[ path ]
|
10
10
|
template = asset.body.force_encoding( 'UTF-8' ).strip.gsub( /\n\s*\n/, "\n" ).gsub( "\n", "\n " )
|
11
|
-
result += %Q(\n <script type
|
11
|
+
result += %Q(\n <script type="text/template" id="#{ id }">\n #{ template }\n </script>)
|
12
12
|
depend_on asset.pathname
|
13
13
|
end
|
14
14
|
result
|
data/lib/nali/model.rb
CHANGED
data/lib/nali/tasks.rb
CHANGED
@@ -63,6 +63,9 @@ module Nali
|
|
63
63
|
|
64
64
|
def sprockets_tasks
|
65
65
|
require 'rake/sprocketstask'
|
66
|
+
Sprockets::Helpers.configure do |config|
|
67
|
+
config.debug = false
|
68
|
+
end
|
66
69
|
Rake::SprocketsTask.new do |task|
|
67
70
|
task.environment = @settings.client
|
68
71
|
task.output = File.join( @settings.public_folder, 'client' )
|
data/lib/nali/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.3
|
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: 2015-01-
|
12
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thin
|