snippr 0.1.6 → 0.1.7
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/snippr/snippr_path.rb +4 -5
- metadata +2 -2
data/lib/snippr/snippr_path.rb
CHANGED
@@ -7,16 +7,15 @@ module SnipprPath
|
|
7
7
|
# The snippr path JVM property.
|
8
8
|
JVMProperty = "cms.snippet.path"
|
9
9
|
|
10
|
-
# Returns the snippr path from JVM properties.
|
10
|
+
# Returns the snippr path (from JVM properties if available).
|
11
11
|
def path
|
12
|
-
|
12
|
+
@path ||= JavaLang::System.get_property(JVMProperty) || "" if jruby?
|
13
|
+
@path ||= ""
|
13
14
|
end
|
14
15
|
|
15
16
|
# Sets the snippr path as a JVM property.
|
16
17
|
def path=(path)
|
17
|
-
path = path.to_s
|
18
|
-
raise ArgumentError, "Invalid path: #{path}" unless File.directory? path
|
19
|
-
@path = path
|
18
|
+
@path = path.to_s
|
20
19
|
end
|
21
20
|
|
22
21
|
private
|