Sha256: 86d356c1bf5249d2d3ac474265ac6dcf8fb8c969b4e26e6583d747ab0e09b03f

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

module Logirel
  require 'semver'

  class Initer
  
	attr_accessor :root_path
	
	def initialize(root = '.')
	  @root_path = root
	end
  
    def get_commands
	  cmd ||= []
	  cmd << "gem update"
	  cmd << "bundle install"
	  cmd << "bin\NuGet.exe update"
	end
	
	def nuget_from_codeplex(cp_ver, gem_ver)
	  (cp_ver <=> gem_ver) > 0
	end
	
	def create_structure
	  # puts "making dir #{@root_path}"
	  ['buildscripts', 'src'].each do |d|
	    path = File.join(@root_path, d)
	    Dir.mkdir path unless Dir.exists? path
	  end
	end
	
	def parse_folders
	  src = File.join(@root_path, 'src', '*')
	  Dir.
	    glob(src).
	    keep_if{ |i| 
		  projs = File.join(i, "*.{csproj,vbproj,fsproj}")
		  File.directory? i and Dir.glob(projs).length > 0
		}.
		map{|x| File.basename(x) }
	end
	
	def init_rakefile
	  File.open(File.join(@root_path, "Rakefile.rb"), "w") do |f|
	    f.puts "require 'bundler'"
	  end
	end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logirel-0.0.6 lib/logirel/Initer.rb