summaryrefslogtreecommitdiffstats
path: root/app/models/svn_repos.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-08 15:49:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-08 15:49:20 +0000
commit8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b (patch)
tree983e866e4ec21a84783a9063059957728f4d0d43 /app/models/svn_repos.rb
parentdf0a49ff14474dd2230a823f57e95aa9d3b1cd71 (diff)
downloadredmine-8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b.tar.gz
redmine-8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b.zip
Text files can now be viewed online when browsing the repository.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@521 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/svn_repos.rb')
-rw-r--r--app/models/svn_repos.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/svn_repos.rb b/app/models/svn_repos.rb
index 3fe698e38..b4503ce5f 100644
--- a/app/models/svn_repos.rb
+++ b/app/models/svn_repos.rb
@@ -174,6 +174,7 @@ module SvnRepos
cmd << " --username #{@login} --password #{@password}" if @login
cat = nil
shellout(cmd) do |io|
+ io.binmode
cat = io.read
end
return nil if $? && $?.exitstatus != 0
@@ -248,6 +249,10 @@ module SvnRepos
def is_dir?
'dir' == self.kind
end
+
+ def is_text?
+ Redmine::MimeType.is_type?('text', name)
+ end
end
class Revisions < Array