snippr 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/snippr/snippr_path.rb +4 -5
  2. metadata +2 -2
@@ -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
- (JavaLang::System.get_property(JVMProperty) rescue @path) || ""
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Harrington