jader 0.0.9 → 0.0.10
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.
- checksums.yaml +8 -8
- data/README.md +3 -0
- data/lib/jader.rb +3 -1
- data/lib/jader/configuration.rb +2 -1
- data/lib/jader/engine.rb +8 -5
- data/lib/jader/version.rb +1 -1
- data/spec/dummy/config/initializers/jader.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzNjZWU5MTA0ZWY5MmU4MjZlZDQwNDM4M2MwZGIxODA3ZThhMTVhNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGNjOTc3N2U1Mzk1N2JlMjFkNDA4ODJhY2JhYTM0YzMxYzFlYzE1MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDk4NTJjMjRiOGJlMDlmN2JlODU0YmYxMWFhNzQ1NGIwZGEzOWQ4ZDZmODlj
|
10
|
+
YzUwNWZiNDBhNzY1ZjkzNGFmZDg1MjJjNjliYzg5Y2Y5YTMxNWFlOTJkZWNk
|
11
|
+
NjIzYjJkZDgxNzA4NWIzMDdjZTk3ZTY4YzllZjc2MGJmNDEyOTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTQ3YzRlNjA3M2M2Y2NjMzE2YTg1OTY1ZjQzZWMwZDA0YzY3MTk1N2VjZjUy
|
14
|
+
NmE5ZDNjZDEyMTc3YTJmNjQyZTY5M2I0OTg5NTFjYzUxYjRjM2Q0OGJiNTJm
|
15
|
+
ZGE4YWE2YjQ4N2JmMzQzNjUwOTRiNWViZWQxMjMzZGNhY2JmYWQ=
|
data/README.md
CHANGED
@@ -306,6 +306,9 @@ Jader.configure do |config|
|
|
306
306
|
config.views_path = Rails.root.join('app','assets','javascripts','views')
|
307
307
|
# Use some javascript from a file that's not available in the asset pipeline
|
308
308
|
config.includes << IO.read(Rails.root.join('app','assets','javascripts','includes','util.js'))
|
309
|
+
# In Rails 3 applications, prepend views_path using a controller before filter.
|
310
|
+
# This is set to false by default
|
311
|
+
config.prepend_view_path = true
|
309
312
|
# wait for assets to be ready
|
310
313
|
Rails.application.config.after_initialize do
|
311
314
|
# include javascripts available only from asset pipeline
|
data/lib/jader.rb
CHANGED
@@ -7,4 +7,6 @@ require 'jader/serialize'
|
|
7
7
|
require 'jader/engine' if defined?(::Rails)
|
8
8
|
|
9
9
|
ActionView::Template.register_template_handler :jade, Jader::Renderer
|
10
|
-
ActionView::Template.register_template_handler 'jst.jade', Jader::Renderer
|
10
|
+
ActionView::Template.register_template_handler 'jst.jade', Jader::Renderer
|
11
|
+
|
12
|
+
Jader.configure do |config|; end
|
data/lib/jader/configuration.rb
CHANGED
@@ -18,13 +18,14 @@ module Jader
|
|
18
18
|
|
19
19
|
# Jader configuration class
|
20
20
|
class Configuration
|
21
|
-
attr_accessor :mixins_path, :views_path, :includes
|
21
|
+
attr_accessor :mixins_path, :views_path, :includes, :prepend_view_path
|
22
22
|
|
23
23
|
# Initialize Jader::Configuration class with default values
|
24
24
|
def initialize
|
25
25
|
@mixins_path = nil
|
26
26
|
@views_path = nil
|
27
27
|
@includes = []
|
28
|
+
@prepend_view_path = false
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
data/lib/jader/engine.rb
CHANGED
@@ -4,15 +4,18 @@ require 'sprockets/engines'
|
|
4
4
|
module Jader
|
5
5
|
class Engine < Rails::Engine
|
6
6
|
initializer "jade.configure_rails_initialization", :before => 'sprockets.environment', :group => :all do |app|
|
7
|
-
|
8
|
-
|
7
|
+
sprockets_env = app.assets || Sprockets
|
8
|
+
sprockets_env.register_engine '.jade', ::Jader::Template
|
9
9
|
end
|
10
10
|
|
11
11
|
initializer 'jader.prepend_views_path', :after => :add_view_paths do |app|
|
12
12
|
next if Jader::configuration.nil? or Jader::configuration.views_path.nil?
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
app.config.paths['app/views'].unshift(Jader::configuration.views_path)
|
14
|
+
if Jader::configuration.prepend_view_path
|
15
|
+
ActionController::Base.class_eval do
|
16
|
+
before_filter do |controller|
|
17
|
+
prepend_view_path Jader::configuration.views_path
|
18
|
+
end
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
data/lib/jader/version.rb
CHANGED
@@ -2,4 +2,5 @@ Jader.configure do |config|
|
|
2
2
|
config.mixins_path = Rails.root.join('app','assets','javascripts','mixins')
|
3
3
|
config.views_path = Rails.root.join('app','assets','javascripts','views')
|
4
4
|
config.includes << IO.read(Rails.root.join('app','assets','javascripts','includes','util.js'))
|
5
|
+
config.prepend_view_path = true
|
5
6
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zohar Arad
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: libv8
|