nali 0.2.5 → 0.2.6
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/generator/config/application.rb +9 -1
- data/lib/nali/application.rb +2 -2
- data/lib/nali/generator.rb +1 -0
- data/lib/nali/tasks.rb +11 -3
- data/lib/nali/version.rb +1 -1
- metadata +1 -1
data/lib/nali/application.rb
CHANGED
@@ -25,7 +25,7 @@ module Nali
|
|
25
25
|
client.append_path File.join( Nali.path, 'client/javascripts' )
|
26
26
|
|
27
27
|
%w( app/client/templates app/client/stylesheets app/client/javascripts lib/client/stylesheets
|
28
|
-
lib/client/javascripts vendor/client/stylesheets vendor/client/javascripts
|
28
|
+
lib/client/javascripts public/client vendor/client/stylesheets vendor/client/javascripts
|
29
29
|
).each { |path| client.append_path File.join( root, path ) }
|
30
30
|
|
31
31
|
Sprockets::Helpers.configure do |config|
|
@@ -49,7 +49,7 @@ module Nali
|
|
49
49
|
|
50
50
|
get '/*' do
|
51
51
|
if !request.websocket?
|
52
|
-
compiled_path = File.join settings.public_folder, '
|
52
|
+
compiled_path = File.join settings.public_folder, 'index.html'
|
53
53
|
if settings.environment != :development and File.exists?( compiled_path )
|
54
54
|
send_file compiled_path
|
55
55
|
else
|
data/lib/nali/generator.rb
CHANGED
@@ -24,6 +24,7 @@ module Nali
|
|
24
24
|
dirs << File.join( target_path, 'db/migrate' )
|
25
25
|
dirs << File.join( target_path, 'lib' )
|
26
26
|
dirs << File.join( target_path, 'public' )
|
27
|
+
dirs << File.join( target_path, 'public/client' )
|
27
28
|
dirs << File.join( target_path, 'tmp' )
|
28
29
|
dirs << File.join( target_path, 'vendor' )
|
29
30
|
dirs << File.join( target_path, 'config/initializers' )
|
data/lib/nali/tasks.rb
CHANGED
@@ -20,19 +20,27 @@ module Nali
|
|
20
20
|
|
21
21
|
compiled_path = File.join @settings.public_folder, 'client'
|
22
22
|
Dir[ compiled_path + '/*' ]
|
23
|
+
.select { |file| file =~ /.*?\.gz/ }
|
24
|
+
.each { |file| File.delete file }
|
25
|
+
Dir[ compiled_path + '/*' ]
|
23
26
|
.select { |file| file =~ /application.*?\.html/ }
|
24
27
|
.each do |file|
|
25
28
|
filename = File.basename( file ).split '.'
|
26
|
-
filename[0] = '
|
29
|
+
filename[0] = 'index'
|
27
30
|
filename = filename.join '.'
|
28
|
-
File.rename file, File.join(
|
31
|
+
File.rename file, File.join( @settings.public_folder, filename )
|
29
32
|
end
|
30
33
|
puts 'Client files compiled'
|
31
34
|
end
|
32
35
|
|
33
36
|
desc 'Remove compiled client files'
|
34
37
|
task :clean do
|
35
|
-
|
38
|
+
compiled_path = File.join @settings.public_folder, 'client'
|
39
|
+
Dir[ compiled_path + '/*' ]
|
40
|
+
.select { |file| file =~ /(application|manifest).*?\.(js|css|json)/ }
|
41
|
+
.each { |file| File.delete file }
|
42
|
+
index = File.join( @settings.public_folder, 'index.html' )
|
43
|
+
File.delete( index ) if File.exists?( index )
|
36
44
|
puts 'Compiled client files removed'
|
37
45
|
end
|
38
46
|
|
data/lib/nali/version.rb
CHANGED