Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add travis-ci support

  • Loading branch information...
commit cd979b3700c9e18ac6a0bba128a900ff23e730a9 1 parent bb783ac
@avalanche123 authored
Showing with 46 additions and 34 deletions.
  1. +5 −0 .travis.yml
  2. +3 −1 README.md
  3. +38 −33 Rakefile
View
5 .travis.yml
@@ -0,0 +1,5 @@
+language: php
+php:
+ - 5.3
+ - 5.4
+script: rake test
View
4 README.md
@@ -1,4 +1,6 @@
-#Imagine![project status](http://stillmaintained.com/avalanche123/Imagine.png)#
+#Imagine
+[![project status](http://stillmaintained.com/avalanche123/Imagine.png)](http://stillmaintained.com/avalanche123/Imagine)
+[![Build Status](https://secure.travis-ci.org/avalanche123/Imagine.png)](http://travis-ci.org/avalanche123/Imagine)
Image manipulation library for PHP 5.3 inspired by Python's PIL and other image
libraries.
View
71 Rakefile
@@ -1,8 +1,6 @@
require 'date'
-require 'nokogiri'
require 'digest/md5'
require 'fileutils'
-require 'json'
class String
def underscore
@@ -51,7 +49,43 @@ task :phar, :version do |t, args|
end
task :test do
+ if ENV["TRAVIS"] == 'true'
+ puts "Travis CI"
+ system "sudo apt-get install -y imagemagick libmagick9-dev"
+ system "pyrus install pecl/imagick"
+
+ system "sudo apt-get install -y graphicsmagick libgraphicsmagick1-dev"
+ system "pyrus install pecl/gmagick-beta"
+ end
+
+ ini_file = Hash[`php --ini`.split("\n").map {|l| l.split(/:\s+/)}]["Loaded Configuration File"]
+ original_ini_contents = File.read(ini_file)
+
+ puts "testing with gmagick enabled"
+
+ File.open(ini_file, "w") do |f|
+ f.write(original_ini_contents)
+ f.write(<<-INI.unindent)
+ extension=gmagick.so
+ INI
+ end
+
+ system "phpunit tests/"
+
+ puts "testing with imagick enabled"
+
+ File.open(ini_file, "w") do |f|
+ f.write(original_ini_contents)
+ f.write(<<-INI.unindent)
+ extension=imagick.so
+ INI
+ end
+
system "phpunit tests/"
+
+ File.open(ini_file, "w") do |f|
+ f.write(original_ini_contents)
+ end
end
task :sphinx do
@@ -68,6 +102,8 @@ task :clean do
end
task :pear, :version do |t, args|
+ require 'nokogiri'
+
Dir.chdir("lib")
version = args[:version]
now = DateTime.now
@@ -136,32 +172,6 @@ task :pear, :version do |t, args|
FileUtils.mv("Imagine-#{version}.tgz", "../")
end
-task :composer, :version do |t, args|
- version = args[:version]
- File.open("composer.json", "w") do |f|
- f.write(JSON.pretty_generate(
- "name" => "imagine/Imagine",
- "description" => "Image processing for PHP 5.3",
- "keywords" => ["image manipulation","image processing", "drawing", "graphics"],
- "homepage" => "http://imagine.readthedocs.org/",
- "license" => "MIT",
- "authors" => [
- {
- "name" => "Bulat Shakirzyanov",
- "email" => "mallluhuct@gmail.com",
- "homepage" => "http://avalanche123.com"
- }
- ],
- "require" => {
- "php" => ">=5.3.2"
- },
- "autoload" => {
- "psr-0" => { "Imagine" => "lib/" }
- }
- ))
- end
-end
-
task :release, :version do |t, args|
version = args[:version]
@@ -172,11 +182,6 @@ task :release, :version do |t, args|
system "git add docs/api"
system "git commit -m \"updated api docs for release #{version}\""
- Rake::Task["composer"].invoke(version)
-
- system "git add composer.json"
- system "git commit -m \"updated composer.json for #{version} release\""
-
Rake::Task["pear"].invoke(version)
Rake::Task["phar"].invoke(version)
Please sign in to comment.
Something went wrong with that request. Please try again.