rango 0.1.1.2.4 → 0.1.1.2.5
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/rango.rb +6 -0
- data/lib/rango/settings.rb +2 -1
- data/lib/rango/settings/haml.rb +3 -2
- data/lib/rango/templates/template.rb +1 -1
- data/lib/rango/version.rb +1 -1
- metadata +1 -1
data/lib/rango.rb
CHANGED
@@ -78,6 +78,12 @@ module Rango
|
|
78
78
|
self.bootloaders[name] = block
|
79
79
|
end
|
80
80
|
|
81
|
+
# Rango.loaded?("environments.rb")
|
82
|
+
def loaded?(relative_path) # would work just with Kernel#require, not with Kernel#load, I know that the name may be misleading, but better than required?
|
83
|
+
full_path = File.expand_path(File.join(File.dirname(__FILE__), relative_path))
|
84
|
+
$LOADED_FEATURES.any? { |file| file == full_path }
|
85
|
+
end
|
86
|
+
|
81
87
|
# Start IRB interactive session
|
82
88
|
# @since 0.0.1
|
83
89
|
def interactive
|
data/lib/rango/settings.rb
CHANGED
@@ -20,7 +20,8 @@ module Rango
|
|
20
20
|
# @return [Hash] Hash of settings attributes.
|
21
21
|
# TODO: maybe it should returns Rango::Settings?
|
22
22
|
def merge(another)
|
23
|
-
|
23
|
+
hattributes = another.is_a?(Hash) ? another : another.hattributes
|
24
|
+
self.hattributes.merge(hattributes)
|
24
25
|
end
|
25
26
|
|
26
27
|
# @since 0.0.1
|
data/lib/rango/settings/haml.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require "rango" # Rango.loaded?
|
3
4
|
require "rango/settings"
|
4
5
|
|
5
6
|
module Rango
|
@@ -11,7 +12,7 @@ module Rango
|
|
11
12
|
|
12
13
|
# @since 0.0.2
|
13
14
|
# Sets whether or not to escape HTML-sensitive characters in script. If this is true, = behaves like &=; otherwise, it behaves like !=. Note that if this is set, != should be used for yielding to subtemplates and rendering partials. Defaults to false.
|
14
|
-
hattribute :escape_html,
|
15
|
+
hattribute :escape_html, false
|
15
16
|
|
16
17
|
# @since 0.0.2
|
17
18
|
# Whether or not attribute hashes and Ruby scripts designated by = or ~ should be evaluated. If this is true, said scripts are rendered as empty strings. Defaults to false.
|
@@ -35,7 +36,7 @@ module Rango
|
|
35
36
|
|
36
37
|
# @since 0.0.7
|
37
38
|
# Haml now has an :ugly option, thanks to Wincent Colaiuta. This option forgoes pretty output formatting in favor of speed increases, which show up in particular when rendering deeply nested partials
|
38
|
-
hattribute :ugly, lambda {
|
39
|
+
hattribute :ugly, lambda { Rango.loaded?("environments.rb") ? !Rango.development? : false }
|
39
40
|
|
40
41
|
# @since 0.1.1
|
41
42
|
# You don't have to explicitly specify attributes which are same for all the tags of same
|
data/lib/rango/version.rb
CHANGED