From 24f7cf258f6b96b432d8335402b4702e5ad49bb1 Mon Sep 17 00:00:00 2001 From: James Anthony Bruno Date: Sun, 7 Dec 2014 17:31:41 -0600 Subject: [PATCH] Really really minor stuff --- .gitignore | 1 + Gemfile.lock | 11 ++++++----- bin/pxlsrt | 0 lib/pxlsrt/colors.rb | 2 +- lib/pxlsrt/helpers.rb | 2 +- lib/pxlsrt/version.rb | 2 +- pxlsrt.gemspec | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) mode change 100644 => 100755 bin/pxlsrt diff --git a/.gitignore b/.gitignore index d385318..cd3c16b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.gem *.rbc +.DS_Store .bundle .config .yardoc diff --git a/Gemfile.lock b/Gemfile.lock index 49c402f..7e80ca7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,20 +1,21 @@ PATH remote: . specs: - pxlsrt (1.0.1) - oily_png (= 1.1.1) + pxlsrt (1.6.2) + oily_png (~> 1.1.2) thor (~> 0.18) GEM remote: https://rubygems.org/ specs: - chunky_png (1.3.1) - oily_png (1.1.1) - chunky_png (~> 1.3.0) + chunky_png (1.3.3) + oily_png (1.1.2) + chunky_png (~> 1.3.1) rake (10.3.2) thor (0.19.1) PLATFORMS + ruby x64-mingw32 DEPENDENCIES diff --git a/bin/pxlsrt b/bin/pxlsrt old mode 100644 new mode 100755 diff --git a/lib/pxlsrt/colors.rb b/lib/pxlsrt/colors.rb index 0129dd3..c18b323 100644 --- a/lib/pxlsrt/colors.rb +++ b/lib/pxlsrt/colors.rb @@ -12,7 +12,7 @@ def self.getRGBA(pxl) ## # Check if file is a PNG image. ChunkyPNG only works with PNG images. Eventually, I might use conversion tools to add support, but not right now. def self.isPNG?(path) - return File.read(path).bytes==[137, 80, 78, 71, 10] + return File.open(path, 'rb').read(9).include?('PNG') end ## # Converts an RGB-like array ([red, green, blue]) into an HSB-like array ([hue, saturation, brightness]). diff --git a/lib/pxlsrt/helpers.rb b/lib/pxlsrt/helpers.rb index 05c7dff..f45681e 100644 --- a/lib/pxlsrt/helpers.rb +++ b/lib/pxlsrt/helpers.rb @@ -5,7 +5,7 @@ class Helpers ## # Determines if a value has content. def self.contented(c) - return (c.class!=NilClass and ((defined? c)!="nil") and ((/(\S)/.match("#{c}"))!=nil)) + return c != nil end ## # Used to output a red string to the terminal. diff --git a/lib/pxlsrt/version.rb b/lib/pxlsrt/version.rb index fdda04d..70da50d 100644 --- a/lib/pxlsrt/version.rb +++ b/lib/pxlsrt/version.rb @@ -1,5 +1,5 @@ ## # The main module, your best friend. module Pxlsrt - VERSION = "1.6.1" + VERSION = "1.6.2" end diff --git a/pxlsrt.gemspec b/pxlsrt.gemspec index f596430..f7309e7 100644 --- a/pxlsrt.gemspec +++ b/pxlsrt.gemspec @@ -20,6 +20,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 10.2" - spec.add_dependency "oily_png", "1.1.1" + spec.add_dependency "oily_png", "~> 1.1.2" spec.add_dependency "thor", "~> 0.18" end