diff --git a/.travis.yml b/.travis.yml index 4447af5..7c282d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: ruby rvm: - - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 diff --git a/README.textile b/README.textile index 1a56440..b7523e8 100644 --- a/README.textile +++ b/README.textile @@ -67,6 +67,12 @@ FastImage.new("http://stephensykes.com/images/ExifOrientation3.jpg").orientation h2. Installation +h4. Required Ruby version + +FastImage version 2.0.0 and above work with Ruby 1.9.2 and above. + +FastImage version 1.9.0 was the last version that supported Ruby 1.8.7. + h4. Gem bc. gem install fastimage diff --git a/fastimage.gemspec b/fastimage.gemspec index bfd1f35..e63191c 100644 --- a/fastimage.gemspec +++ b/fastimage.gemspec @@ -1,10 +1,10 @@ Gem::Specification.new do |s| s.name = %q{fastimage} - s.version = "1.9.0" + s.version = "2.0.0" - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.required_ruby_version = '>= 1.9.2' s.authors = ["Stephen Sykes"] - s.date = %q{2016-02-13} + s.date = %q{2016-03-24} s.description = %q{FastImage finds the size or type of an image given its uri by fetching as little as needed.} s.email = %q{sdsykes@gmail.com} s.extra_rdoc_files = [ @@ -14,7 +14,6 @@ Gem::Specification.new do |s| "MIT-LICENSE", "README.textile", "lib/fastimage.rb", - "lib/fastimage/fbr.rb", ] s.homepage = %q{http://github.com/sdsykes/fastimage} s.rdoc_options = ["--charset=UTF-8"] diff --git a/lib/fastimage.rb b/lib/fastimage.rb index 1096dfa..aa65911 100644 --- a/lib/fastimage.rb +++ b/lib/fastimage.rb @@ -57,7 +57,6 @@ require 'net/https' require 'addressable/uri' -require 'fastimage/fbr.rb' require 'delegate' require 'pathname' require 'zlib' diff --git a/lib/fastimage/fbr.rb b/lib/fastimage/fbr.rb deleted file mode 100644 index 12d5673..0000000 --- a/lib/fastimage/fbr.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Poor Man's Fiber (API compatible Thread based Fiber implementation for Ruby 1.8) -# (c) 2008 Aman Gupta (tmm1) - -unless defined? Fiber - require 'thread' - - class FiberError < StandardError; # :nodoc: - end - - class Fiber # :nodoc: - def initialize - raise ArgumentError, 'new Fiber requires a block' unless block_given? - - @yield = Queue.new - @resume = Queue.new - - @thread = Thread.new{ @yield.push [yield(*@resume.pop)] } - @thread.abort_on_exception = true - @thread[:fiber] = self - end - attr_reader :thread - - def resume *args - raise FiberError, 'dead fiber called' unless @thread.alive? - @resume.push(args) - result = @yield.pop - result.size > 1 ? result : result.first - end - - def yield *args - @yield.push(args) - result = @resume.pop - result.size > 1 ? result : result.first - end - - def self.yield *args - if fiber = Thread.current[:fiber] - fiber.yield(*args) - else - raise FiberError, 'not inside a fiber' - end - end - - def self.current - if Thread.current == Thread.main - return Thread.main[:fiber] ||= RootFiber.new - end - - Thread.current[:fiber] or raise FiberError, 'not inside a fiber' - end - - def inspect - "#<#{self.class}:0x#{self.object_id.to_s(16)}>" - end - end - - class RootFiber < Fiber # :nodoc: - def initialize - # XXX: what is a root fiber anyway? - end - - def self.yield *args - raise FiberError, "can't yield from root fiber" - end - end -end