Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clean up more unused stuff moving towards minimagick

  • Loading branch information...
commit 16a18d0a39676f2b2711e6e353b67aa870d795e0 1 parent 9ccf021
@mroth authored
View
1  Gemfile
@@ -1,5 +1,4 @@
source "http://rubygems.org"
-gem 'image_sorcery', :github => 'mroth/image_sorcery', :branch => 'annotate'
# Specify your gem's dependencies in lolcommits.gemspec
gemspec
View
2  lib/lolcommits.rb
@@ -1,9 +1,7 @@
$:.unshift File.expand_path('.')
require 'core_ext/class'
-require 'RMagick'
require 'mini_magick'
-require 'image_sorcery'
require 'fileutils'
require 'git'
require 'open3'
View
34 lib/lolcommits/plugins/loltext.rb
@@ -1,6 +1,5 @@
module Lolcommits
class Loltext < Plugin
- # include Magick
def initialize(runner)
super
@@ -13,36 +12,6 @@ def run
mm_run
end
- # use imagesorcery wrapper
- # will work once my patches are accepted if i want to go this route
- def is_run
- font_location = File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
-
- image = Sorcery.new(self.runner.main_image)
- image.convert(self.runner.main_image, {
- :gravity => 'SouthWest',
- :fill => 'white',
- :stroke => 'black',
- :strokewidth => '2',
- :pointsize => '48',
- :'interline-spacing' => '-9',
- :font => font_location,
- :annotate => "0 \"#{word_wrap self.runner.message}\""
- })
-
- image = Sorcery.new(self.runner.main_image)
- image.convert(self.runner.main_image, {
- :gravity => 'NorthEast',
- :fill => 'white',
- :stroke => 'black',
- :strokewidth => '2',
- :pointsize => '32',
- :font => font_location,
- :annotate => "0 \"#{self.runner.sha}\""
- })
-
- end
-
# use minimagick wrapper
def mm_run
font_location = File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
@@ -59,20 +28,17 @@ def mm_run
c.annotate '0', word_wrap(self.runner.message)
end
- # image = Sorcery.new(self.runner.main_image)
image.combine_options do |c|
c.gravity 'NorthEast'
c.fill 'white'
c.stroke 'black'
c.strokewidth '2'
c.pointsize '32'
- # c.interline_spacing '-9'
c.font font_location
c.annotate '0', self.runner.sha
end
image.write self.runner.main_image
-
end
# use Rmagick wrapper (deprecated, no longer works in IM6.10+)
View
6 lib/lolcommits/runner.rb
@@ -1,6 +1,5 @@
module Lolcommits
PLUGINS = Lolcommits::Plugin.subclasses
- include Magick
class Runner
attr_accessor :capture_delay, :capture_device, :message, :sha,
@@ -61,11 +60,6 @@ def die_if_rebasing!
end
def resize_snapshot!
- # if (image.dimensions[:x].to_i > 640 || image.dimensions[:y].to_i > 480)
- # # canvas.resize_to_fill!(640,480)
- # # Remember this requires IM v6.3.8-3 or greater to make use of it. Otherwise use the older Resizing to Fill a Given Space technique below.
- # image.convert(self.snapshot_loc, { :resize => '640x480^', :gravity => 'center', :extent => '640x480'})
- # end
image = MiniMagick::Image.open(self.snapshot_loc)
if (image[:width] > 640 || image[:height] > 480)
#this is ghetto resize-to-fill
View
8 lolcommits.gemspec
@@ -19,9 +19,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
# core gem dependencies
- s.add_runtime_dependency('rmagick', '~> 2.13.1')
s.add_runtime_dependency('mini_magick', '~> 3.4')
- # s.add_runtime_dependency('image_sorcery', '~> 1.0.7')
s.add_runtime_dependency('git', '~> 1.2.5')
s.add_runtime_dependency('choice', '~> 0.1.6')
s.add_runtime_dependency('launchy', '~> 2.1.1')
@@ -37,9 +35,9 @@ Gem::Specification.new do |s|
# plugin dependencies
s.add_runtime_dependency("twitter") #twitter
- s.add_runtime_dependency("oauth")
- s.add_runtime_dependency("rest-client")
+ s.add_runtime_dependency("oauth") #twitter
+ s.add_runtime_dependency("rest-client") #uploldz
s.add_runtime_dependency('httmultiparty') #dot_com
- s.add_runtime_dependency('statsd-ruby')
+ s.add_runtime_dependency('statsd-ruby') #statsd
end
Please sign in to comment.
Something went wrong with that request. Please try again.