Class: Setup

Inherits:
Array show all
Defined in:
lib/setup.rb

Overview

use the SVN_EXPORTS hash to define svn exports destined for DEV_ROOT/dep

SVN_EXPORT={ ‘System.Data.SQLite/1.0.93.0’ => ‘third-party.googlecode.com/svn/trunk/System.Data.SQLite/1.0.93.0’ }

Instance Method Summary collapse

Methods inherited from Array

#add, #execute, #to_html

Instance Method Details

#updateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/setup.rb', line 7

def update
  add 'bundle install' if(File.exists?('Gemfile'))

  Dir.glob('*.gemspec').each{|gemspec_file|
    add "<%Gemspec.update('#{gemspec_file}')%>"
  }

  if(defined?(SVN_EXPORTS))
    SVN_EXPORTS.each{|k,v|
      if(!File.exists?("#{Command.dev_root}/dep/#{k}"))
          FileUtils.mkdir_p(File.dirname("#{Command.dev_root}/dep/#{k}")) if !File.exists?("#{Command.dev_root}/dep/#{k}")
        dest="#{Command.dev_root}/dep/#{k}"
          add "svn export #{v} #{Command.dev_root}/dep/#{k}" if !dest.include?("@")
        add "svn export #{v} #{Command.dev_root}/dep/#{k}@" if dest.include?("@")
          end
    }
  end
end