el_finder 1.1.7 → 1.1.8

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.
@@ -42,8 +42,8 @@ module ElFinder
42
42
  def initialize(options)
43
43
  @options = DEFAULT_OPTIONS.merge(options)
44
44
 
45
- raise(ArgumentError, "Missing required :url option") unless @options.key?(:url)
46
- raise(ArgumentError, "Missing required :root option") unless @options.key?(:root)
45
+ raise(ArgumentError, "Missing required :url option") unless @options.key?(:url)
46
+ raise(ArgumentError, "Missing required :root option") unless @options.key?(:root)
47
47
  raise(ArgumentError, "Mime Handler is invalid") unless mime_handler.respond_to?(:for)
48
48
  raise(ArgumentError, "Image Handler is invalid") unless image_handler.nil? || ([:size, :resize, :thumbnail].all?{|m| image_handler.respond_to?(m)})
49
49
 
@@ -40,6 +40,7 @@ module ElFinder
40
40
  'py' => 'text/x-python',
41
41
  'java' => 'text/x-java-source',
42
42
  'rb' => 'text/x-ruby',
43
+ 'erb' => 'text/x-ruby',
43
44
  'sh' => 'text/x-shellscript',
44
45
  'pl' => 'text/x-perl',
45
46
  'sql' => 'text/x-sql',
@@ -10,7 +10,7 @@ module ElFinder
10
10
  def initialize(root, path = '.')
11
11
  @root = root.is_a?(ElFinder::Pathname) ? root.root : ::Pathname.new(root)
12
12
 
13
- @path = ::Pathname.new(path)
13
+ @path = ::Pathname.new(path)
14
14
  @path = path.is_a?(ElFinder::Pathname) ? path.path : ::Pathname.new(path)
15
15
  if absolute?
16
16
  if @path.cleanpath.to_s.start_with?(@root.to_s)
@@ -18,13 +18,13 @@ module ElFinder
18
18
  elsif @path.cleanpath.to_s.start_with?(@root.realpath.to_s)
19
19
  @path = ::Pathname.new @path.to_s.slice((@root.realpath.to_s.length + 1)..-1)
20
20
  else
21
- raise SecurityError, "Absolute paths are not allowed"
21
+ raise SecurityError, "Absolute paths are not allowed"
22
22
  end
23
23
  end
24
24
  raise SecurityError, "Paths outside the root are not allowed" if outside_of_root?
25
25
 
26
26
  end # of initialize
27
-
27
+
28
28
  #
29
29
  def +(other)
30
30
  if other.is_a? ::ElFinder::Pathname
@@ -118,7 +118,7 @@ module ElFinder
118
118
  def relative_to(other)
119
119
  @path.relative_path_from(other)
120
120
  end
121
-
121
+
122
122
  #
123
123
  def unique
124
124
  return self.dup unless self.file?
@@ -1,5 +1,5 @@
1
1
  # Represents ElFinder namespace.
2
2
  module ElFinder
3
3
  # Gem version.
4
- VERSION = '1.1.7'
5
- end
4
+ VERSION = '1.1.8'
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: el_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-02 00:00:00.000000000 Z
12
+ date: 2013-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: image_size