Class: Setup

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

Overview

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



835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# File 'lib/dev_commands.rb', line 835

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

  if(defined?(GIT_EXPORTS))
    GIT_EXPORTS.each{|k,v|
      directory = "#{Command.dev_root}/dep/#{k}"
      if(!File.exists?(directory))
        if(v.include?('@'))
          puts `git clone #{v.split('@')[0]} #{directory}`
          Dir.chdir(directory) do
            puts `git reset --hard #{v.split('@')[1]}`
          end
        else
          add "git clone #{v} #{directory}"
        end
      end
    }
  end
end