Sha256: 7750d90ac417dc1dd50f0268adf66380c16d9bfd77bf992834b98e1f91dd2e43

Contents?: true

Size: 603 Bytes

Versions: 3

Compression:

Stored size: 603 Bytes

Contents

module Vizres
  class SCM
    class << self
      
      def create_tmp_if_missing(tmp_directory)
        unless File.exists?(tmp_directory)
          FileUtils.mkdir_p(tmp_directory)
          
          if git?
            system("echo '\npublic/tmp/*' >> #{RAILS_ROOT}/.gitignore")
          elsif svn?
            system("svn propset svn:ignore tmp #{RAILS_ROOT}/public")
          end
        end
      end
      
      def git?
        File.directory? File.join(RAILS_ROOT, '.git')
      end
      
      def svn?
        File.file? File.join(RAILS_ROOT, '.svn')
      end
      
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-0.7.2 vendor/plugins/vizres/lib/vizres/scm.rb
radiant-0.7.0 vendor/plugins/vizres/lib/vizres/scm.rb
radiant-0.7.1 vendor/plugins/vizres/lib/vizres/scm.rb