nali 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,14 @@ module Nali
6
6
 
7
7
  class Application
8
8
 
9
+ configure do |config|
10
+
11
+ # Your configure settings
12
+ # config.client.append_path 'public/client/images'
13
+ # Add folder to sprockets
14
+
15
+ end
16
+
9
17
  end
10
18
 
11
- end
19
+ end
@@ -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, 'client/application.html'
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
@@ -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] = 'application'
29
+ filename[0] = 'index'
27
30
  filename = filename.join '.'
28
- File.rename file, File.join( compiled_path, filename )
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
- FileUtils.rm_rf File.join( @settings.public_folder, 'client' )
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
@@ -1,5 +1,5 @@
1
1
  module Nali
2
2
 
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.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.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: