Sha256: e8adb4733217c8e5a99696525de130639740d1556519467b15754889aba7850b

Contents?: true

Size: 965 Bytes

Versions: 5

Compression:

Stored size: 965 Bytes

Contents

puts __FILE__ if defined?(DEBUG)

desc 'performs publish commands'
task :publish do Tasks.execute_task :publish; end


class Publish < Array
	def update
		if(Internet.available?)
			if(File.exists?('.git'))
				if(`git branch`.include?('* master'))
					Dir.glob('*.gemspec').each{|gemspec_file|
						add "gem push #{Gemspec.gemfile(gemspec_file)}" if !Gemspec.published? gemspec_file
					}
				end
			end
			if(File.exists?('.svn'))
				if(`svn info`.include?('/trunk'))
					Dir.glob('*.gemspec').each{|gemspec_file|
						add "gem push #{Gemspec.gemfile(gemspec_file)}" if !Gemspec.published? gemspec_file
					}
				end
			end
		end
		Dir.glob('**/*.nupkg').each{|nupkg|
			dest="#{Environment.dev_root}/publish/#{File.basename(nupkg)}"
			FileUtils.mkdir_p("#{Environment.dev_root}/publish") if !File.exists?("#{Environment.dev_root}/publish")
			add "<%FileUtils.cp('#{nupkg}','#{dest}')%>" if(!File.exists?(dest))
		}
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dev-2.0.174 lib/tasks/publish.rb
dev-2.0.173 lib/tasks/publish.rb
dev-2.0.172 lib/tasks/publish.rb
dev-2.0.171 lib/tasks/publish.rb
dev-2.0.170 lib/tasks/publish.rb