image_sorcery 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,8 +21,15 @@ image.manipulate!(scale: "50%") # => true
21
21
  image.dimensions # => { x: 250, y: 250 }
22
22
  image.convert("thumbnail.jpg", quality: 80, crop: "100x100>") # => true
23
23
  ```
24
+ # Using GraphicsMagick
25
+ Assuming you have GraphicsMagick installed on your box:
26
+
27
+ ```ruby
28
+ image = Sorcery.gm("image.png")
29
+ # use as normal
30
+ ```
24
31
 
25
32
  ## Todo
26
33
 
27
- * More unit tests
28
- * A few more convenience methods (like "dimensions").
34
+ * Some more unit tests
35
+ * A few more convenience methods (like "dimensions").
@@ -0,0 +1,15 @@
1
+ module GmSupport
2
+ def prefix command
3
+ "gm #{command}"
4
+ end
5
+ end
6
+
7
+ class Sorcery
8
+ class << self
9
+ def gm file
10
+ instance = new(file)
11
+ instance.extend GmSupport
12
+ instance
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,5 @@
1
1
  require 'subexec'
2
+ require 'gm_support'
2
3
 
3
4
  class Sorcery
4
5
  def initialize(file)
@@ -53,6 +54,7 @@ class Sorcery
53
54
  private
54
55
 
55
56
  def convert_to_command(tokens)
57
+ tokens[0] = prefix(tokens[0]) if respond_to? :prefix
56
58
  tokens.flatten.join("")
57
59
  end
58
60
 
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_sorcery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Eric Rafaloff
9
+ - Guy Boertje
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2012-06-29 00:00:00.000000000Z
13
+ date: 2012-07-31 00:00:00.000000000Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: subexec
16
- requirement: &70232743491660 !ruby/object:Gem::Requirement
17
+ requirement: &70316901429800 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ! '>='
@@ -21,17 +22,19 @@ dependencies:
21
22
  version: '0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *70232743491660
25
+ version_requirements: *70316901429800
25
26
  description: A ruby ImageMagick library that doesn't suck
26
27
  email:
27
28
  - hello@ericrafaloff.com
29
+ - guy@musicglue.com
28
30
  executables: []
29
31
  extensions: []
30
32
  extra_rdoc_files: []
31
33
  files:
34
+ - lib/gm_support.rb
32
35
  - lib/image_sorcery.rb
33
36
  - README.markdown
34
- homepage: https://github.com/ericr/image_sorcery
37
+ homepage: https://github.com/musicglue/image_sorcery
35
38
  licenses: []
36
39
  post_install_message:
37
40
  rdoc_options: []
@@ -50,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
53
  - !ruby/object:Gem::Version
51
54
  version: '0'
52
55
  requirements:
53
- - ImageMagick
56
+ - ImageMagick or GraphicsMagick
54
57
  rubyforge_project:
55
58
  rubygems_version: 1.8.10
56
59
  signing_key: