pieces 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/original/app/views/layouts/layout.html.mustache +1 -1
- data/lib/pieces/builder.rb +7 -0
- data/lib/pieces/listener.rb +8 -5
- data/lib/pieces/server.rb +3 -1
- data/lib/pieces/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f0c78f26ae344a81c5411d901d551640d01f82f
|
4
|
+
data.tar.gz: d152e4834db8415e043ff06dcb7209a58529d556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f29b7ed87aa9b7e673a84496ba7b67167da61db87119fd22c0879be2124633310c2ed5ca3ab50a5699c3b53534cb8fe2fc1964fbd89a609b3217bbfe58fb95c
|
7
|
+
data.tar.gz: fe0bc48abc9d6bdee5746af430a56d33f7ec16b7ec7d68afcd8f6bed5b8e44502c97082d29783c1cab24877df0b199aa90583220fb3c8dec321aa6dfcc6416a7
|
data/lib/pieces/builder.rb
CHANGED
@@ -16,6 +16,13 @@ module Pieces
|
|
16
16
|
|
17
17
|
def initialize(config)
|
18
18
|
@path = config[:path]
|
19
|
+
|
20
|
+
unless File.exists?("#{path}/config/pieces.yml")
|
21
|
+
puts "We could not find pieces.yml in #{path}/config/"
|
22
|
+
puts 'Sorry about that!'
|
23
|
+
exit(1)
|
24
|
+
end
|
25
|
+
|
19
26
|
@route_config ||= YAML.load_file("#{path}/config/pieces.yml")
|
20
27
|
end
|
21
28
|
|
data/lib/pieces/listener.rb
CHANGED
@@ -27,7 +27,7 @@ module Pieces
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def rebuild_pieces
|
30
|
-
print "\
|
30
|
+
print "\nRebuilding #{File.basename(path)}... "
|
31
31
|
Pieces::Builder.new(path: path).send(build_method)
|
32
32
|
puts 'done.'
|
33
33
|
rescue => e
|
@@ -37,15 +37,18 @@ module Pieces
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def output_backtrace(exception)
|
40
|
-
puts "
|
41
|
-
puts '
|
40
|
+
puts "Exception<#{exception.class.name}>: #{exception.message}"
|
41
|
+
puts ''
|
42
42
|
|
43
43
|
if defined?(::Rails)
|
44
44
|
trace = ::Rails.backtrace_cleaner.clean(exception.backtrace)
|
45
|
-
puts trace.map { |line| "[pieces]: #{line}" }
|
46
45
|
else
|
47
|
-
|
46
|
+
trace = exception.backtrace
|
47
|
+
.delete_if { |line| !line.include?(path) }
|
48
|
+
.map { |line| line.sub("#{path}/", '') }
|
48
49
|
end
|
50
|
+
|
51
|
+
puts trace.map { |line| " #{line}" }
|
49
52
|
end
|
50
53
|
end
|
51
54
|
end
|
data/lib/pieces/server.rb
CHANGED
@@ -21,17 +21,19 @@ module Pieces
|
|
21
21
|
Sprockets::Environment.new.tap do |env|
|
22
22
|
env.append_path 'app/assets/javascripts'
|
23
23
|
env.append_path 'app/assets/stylesheets'
|
24
|
+
env.append_path 'app/views'
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
27
28
|
def app
|
28
29
|
urls = files_to_serve(path)
|
29
30
|
build_path = "#{path}/build"
|
31
|
+
assets_app = sprockets_env
|
30
32
|
|
31
33
|
Rack::Builder.app do
|
32
34
|
use Rack::Reloader
|
33
35
|
use Rack::Static, urls: urls, root: build_path, index: 'index.html'
|
34
|
-
map('/assets') { run
|
36
|
+
map('/assets') { run assets_app } unless defined? ::Rails
|
35
37
|
run Proc.new { |env| [404, {}, ['Not found']] }
|
36
38
|
end
|
37
39
|
end
|
data/lib/pieces/version.rb
CHANGED