mojo_magick 0.5.7 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30925f12cdcc0bbe8f6626d1f68266f00be28abe536a4c925522d8cbb99750dc
4
- data.tar.gz: 1bf5dbdb09fa28ec7e5c0167d32c153f740d00c7541685840ce720d83f53c0fe
3
+ metadata.gz: 177811722037322ee39c9c1fe8b164a3ec5e5b138079879aa94e899763f1c195
4
+ data.tar.gz: 36ecfdae665f75a651cc9aca57d91f6cbb8e945ab0252d675fec87051dfc609c
5
5
  SHA512:
6
- metadata.gz: 29735844a173bc70ded217d142c8c11af8b78880f1396d4678837182d27c57f18e79b17c673d0174ab328e08f47a33aecb522e704701539c44f8723493bc8bab
7
- data.tar.gz: 93907724a1c2822532e6009aef4a65b59db0e0197abbe214196b202dfbad337ab95ced02d38576ab68c420692403da1963e8d940637c99b627053afb9be7eb99
6
+ metadata.gz: c74521f1ce50257577906ef53ab838fb85a50bc3c8a8d5f2b54917aa0eac091cab3b8e9fc15f477edd6bf6f8f91245e1424177dfdb5fb49e9a81fe893376777a
7
+ data.tar.gz: a0a203c7e3458b750bdc4bfb341385f7ffdb8f48c7752c4533aa5df75cc347d00067e7a37b561838ddd0c3d8ac6a5f1e01bc5cb24cd877986301c09d1ebfab5f
@@ -0,0 +1,25 @@
1
+ version: 2.1
2
+ orbs:
3
+ ruby: circleci/ruby@1.1.2
4
+
5
+ jobs:
6
+ build:
7
+ docker:
8
+ - image: circleci/ruby:2.6.6-browsers
9
+ executor: ruby/default
10
+ steps:
11
+ - checkout
12
+ - run:
13
+ name: Which bundler?
14
+ command: bundle -v
15
+ - ruby/install-deps
16
+ - run:
17
+ name: install imagemagick
18
+ command: sudo apt-get install imagemagick ghostscript
19
+ - run:
20
+ name: tests
21
+ command: bundle exec rake
22
+ - run:
23
+ name: audit
24
+ command: bundle exec bundle-audit update && bundle exec bundle-audit check
25
+ - ruby/rubocop-check
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: monthly
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
@@ -0,0 +1,99 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ DisplayCopNames: true
4
+ DisplayStyleGuide: true
5
+ Exclude:
6
+ - "bin/*"
7
+ - "db/schema.rb"
8
+ - "lib/templates/**/*"
9
+ - "**/node_modules/**/*"
10
+ - "tmp/**/*"
11
+ - "vendor/**/*"
12
+ - "log/**/*"
13
+
14
+ Layout/CaseIndentation:
15
+ Enabled: false
16
+
17
+ Layout/FirstArrayElementIndentation:
18
+ EnforcedStyle: consistent
19
+
20
+ Layout/HashAlignment:
21
+ Enabled: false
22
+
23
+ Layout/LineLength:
24
+ Max: 120
25
+
26
+ Layout/MultilineMethodCallIndentation:
27
+ EnforcedStyle: indented
28
+
29
+ Lint/AmbiguousBlockAssociation:
30
+ Enabled: false
31
+
32
+ Lint/ScriptPermission:
33
+ Exclude:
34
+ - "Rakefile"
35
+
36
+ Metrics/AbcSize:
37
+ Max: 35
38
+ Exclude:
39
+ - "spec/**/*"
40
+
41
+ Metrics/BlockLength:
42
+ CountComments: false
43
+ Max: 50
44
+ Exclude:
45
+ - "config/**/*"
46
+ - "spec/**/*"
47
+
48
+ Metrics/ClassLength:
49
+ Max: 250
50
+ Exclude:
51
+ - "spec/**/*"
52
+
53
+ Metrics/MethodLength:
54
+ Max: 25
55
+ Exclude:
56
+ - "db/migrate/*"
57
+ - "spec/**/*"
58
+
59
+ Naming/PredicateName:
60
+ Enabled: false
61
+
62
+ Security/YAMLLoad:
63
+ Enabled: false
64
+
65
+ Style/BarePercentLiterals:
66
+ EnforcedStyle: percent_q
67
+
68
+ Style/BlockDelimiters:
69
+ EnforcedStyle: braces_for_chaining
70
+
71
+ Style/Documentation:
72
+ Enabled: false
73
+
74
+ Style/EmptyMethod:
75
+ EnforcedStyle: expanded
76
+
77
+ Style/FrozenStringLiteralComment:
78
+ EnforcedStyle: never
79
+
80
+ Style/Lambda:
81
+ EnforcedStyle: literal
82
+
83
+ Style/ModuleFunction:
84
+ EnforcedStyle: extend_self
85
+
86
+ Style/MutableConstant:
87
+ Enabled: false
88
+
89
+ Style/PreferredHashMethods:
90
+ Enabled: false
91
+
92
+ Style/StringLiterals:
93
+ EnforcedStyle: double_quotes
94
+
95
+ Style/StringLiteralsInInterpolation:
96
+ EnforcedStyle: double_quotes
97
+
98
+ Style/TernaryParentheses:
99
+ EnforcedStyle: require_parentheses_when_complex
@@ -0,0 +1,2 @@
1
+ Performance/Casecmp:
2
+ Enabled: false
data/.rubocop.yml ADDED
@@ -0,0 +1,11 @@
1
+ require:
2
+ - rubocop-performance
3
+
4
+ inherit_from:
5
+ - ./.rubocop-common.yml
6
+ - ./.rubocop-performance.yml
7
+
8
+ Metrics/CyclomaticComplexity:
9
+ Max: 10
10
+ Metrics/PerceivedComplexity:
11
+ Max: 10
data/Gemfile CHANGED
@@ -1,3 +1,8 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
+
3
+ group :test, :development do
4
+ gem "irb", require: false
5
+ gem "simplecov", require: false
6
+ end
2
7
 
3
8
  gemspec
data/Gemfile.lock CHANGED
@@ -1,34 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mojo_magick (0.5.7)
4
+ mojo_magick (0.6.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.3)
10
- docile (1.3.2)
11
- json (2.2.0)
12
- minitest (5.14.2)
13
- rake (12.3.3)
14
- rspec-expectations (3.9.0)
15
- diff-lcs (>= 1.2.0, < 2.0)
16
- rspec-support (~> 3.9.0)
17
- rspec-support (3.9.0)
18
- simplecov (0.17.0)
9
+ ast (2.4.2)
10
+ bundle-audit (0.1.0)
11
+ bundler-audit
12
+ bundler-audit (0.8.0)
13
+ bundler (>= 1.2.0, < 3)
14
+ thor (~> 1.0)
15
+ docile (1.3.5)
16
+ io-console (0.5.9)
17
+ irb (1.3.5)
18
+ reline (>= 0.1.5)
19
+ minitest (5.14.4)
20
+ parallel (1.20.1)
21
+ parser (3.0.1.0)
22
+ ast (~> 2.4.1)
23
+ rainbow (3.0.0)
24
+ rake (13.0.3)
25
+ regexp_parser (2.1.1)
26
+ reline (0.2.5)
27
+ io-console (~> 0.5)
28
+ rexml (3.2.5)
29
+ rubocop (1.13.0)
30
+ parallel (~> 1.10)
31
+ parser (>= 3.0.0.0)
32
+ rainbow (>= 2.2.2, < 4.0)
33
+ regexp_parser (>= 1.8, < 3.0)
34
+ rexml
35
+ rubocop-ast (>= 1.2.0, < 2.0)
36
+ ruby-progressbar (~> 1.7)
37
+ unicode-display_width (>= 1.4.0, < 3.0)
38
+ rubocop-ast (1.4.1)
39
+ parser (>= 2.7.1.5)
40
+ rubocop-performance (1.11.0)
41
+ rubocop (>= 1.7.0, < 2.0)
42
+ rubocop-ast (>= 0.4.0)
43
+ ruby-progressbar (1.11.0)
44
+ simplecov (0.21.2)
19
45
  docile (~> 1.1)
20
- json (>= 1.8, < 3)
21
- simplecov-html (~> 0.10.0)
22
- simplecov-html (0.10.2)
46
+ simplecov-html (~> 0.11)
47
+ simplecov_json_formatter (~> 0.1)
48
+ simplecov-html (0.12.3)
49
+ simplecov_json_formatter (0.1.2)
50
+ thor (1.1.0)
51
+ unicode-display_width (2.0.0)
23
52
 
24
53
  PLATFORMS
25
54
  ruby
26
55
 
27
56
  DEPENDENCIES
57
+ bundle-audit
58
+ bundler
59
+ irb
28
60
  minitest
29
61
  mojo_magick!
30
62
  rake
31
- rspec-expectations
63
+ rubocop
64
+ rubocop-performance
32
65
  simplecov
33
66
 
34
67
  BUNDLED WITH
data/README.md CHANGED
@@ -18,11 +18,11 @@ Using it
18
18
  Add to your Gemfile
19
19
 
20
20
  gem 'mojo_magick'
21
-
21
+
22
22
  Require it in your ruby code
23
23
 
24
24
  require 'mojo_magick'
25
-
25
+
26
26
  Go to town! Check out a couple of simple [examples, here](examples/)
27
27
 
28
28
  Examples
@@ -139,7 +139,7 @@ complex commands.
139
139
 
140
140
  ### Get a list of available fonts
141
141
 
142
- fonts = MojoMagick::get_fonts
142
+ fonts = MojoMagick::available_fonts
143
143
 
144
144
  fonts.first
145
145
  => #<MojoMagick::Font:0x000001015a8b90 @name="AvantGarde-Book", @family="AvantGarde", @style="Normal", @stretch="Normal", @weight="400", @glyphs="/usr/local/share/ghostscript/fonts/a010013l.pfb">
@@ -197,7 +197,7 @@ Availablility
197
197
  Contributions
198
198
  =============
199
199
 
200
- Got a fix? Got a feature?
200
+ Got a fix? Got a feature?
201
201
 
202
202
  * fork it
203
203
  * make a branch (named appropriately)
@@ -211,6 +211,42 @@ in the new code
211
211
 
212
212
  Recent Changes
213
213
  ==============
214
+
215
+ #### Version 0.6.4
216
+
217
+ * Fix issue with `identity -list font` returning exit code 1 on some systems (Ubuntu) with PR #https://github.com/rcode5/mojo_magick/pull/35
218
+ 35
219
+
220
+ #### Version 0.6.3
221
+
222
+ * Major cleanup and refactor (https://github.com/rcode5/mojo_magick/pull/33)
223
+ * Deprecated `MojoMagick.get_fonts` in favor of `MojoMagick.available_fonts`
224
+ * Moved `raw_command` and `execute` and `execute!` methods into their own module (and added deprecation warnings)
225
+ * Renamed `Util::Parser` to `Util::FontParser` because that's what it does
226
+ * Overall rubocop and ruby clean up
227
+
228
+ #### Version 0.6.2
229
+
230
+ * fix `annotate` option. Now it takes keyword arguments for geometry.
231
+
232
+ #### Version 0.6.1
233
+
234
+ * pushed and yanked - defunct version
235
+
236
+ #### Version 0.6.0
237
+
238
+ * general cleanup and update gems - ready for ImageMagick 7
239
+ * dumped resource limit handling
240
+ * PR #29, #30
241
+
242
+ #### Version 0.5.6
243
+
244
+ * add `get_format` method to help with quoted source file
245
+
246
+ #### Version 0.5.5
247
+
248
+ * Refactor raw_command into execute! and execute methods so that for cases where we don't care about exit status, it can be easily ignored
249
+
214
250
  #### Version 0.5.4
215
251
 
216
252
  * Include image magick commandline failure from raw_command (on failure)
data/Rakefile CHANGED
@@ -1,13 +1,22 @@
1
- require 'rubygems'
2
- require 'rake/testtask'
1
+ require "rubygems"
2
+ require "simplecov"
3
+ require "rake/testtask"
3
4
 
4
- task default: 'test'
5
- Rake::TestTask.new do |task|
6
- task.pattern = 'test/*_test.rb'
5
+ task default: [:test]
6
+
7
+ Rake::TestTask.new do |t|
8
+ t.libs = ["minitest"]
9
+ t.test_files = Dir.glob(File.join(File.dirname(__FILE__), "test/*_test.rb"))
10
+ t.verbose = true
7
11
  end
8
12
 
9
- desc 'Build gem'
13
+ desc "Build gem"
10
14
  task :build do
11
15
  `rm mojo_magick-*.gem`
12
16
  puts `gem build mojo_magick.gemspec`
13
17
  end
18
+
19
+ desc "Release"
20
+ task release: :build do
21
+ puts `gem push mojo_magick-*.gem`
22
+ end
@@ -1,21 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
- #
2
+ require "mojo_magick"
3
3
 
4
- require 'mojo_magick'
5
-
6
- MojoMagick.convert(nil, 'animated.gif') do |c|
7
- c.size '200x200'
4
+ MojoMagick.convert(nil, "animated.gif") do |c|
5
+ c.size "200x200"
8
6
  c.delay 100
9
7
  c.image_block do # first layer
10
- c.background 'blue'
11
- c.fill 'white'
12
- c.gravity 'northwest'
13
- c.label 'NW'
8
+ c.background "blue"
9
+ c.fill "white"
10
+ c.gravity "northwest"
11
+ c.label "NW"
14
12
  end
15
13
  c.image_block do # second layer
16
- c.background 'transparent'
17
- c.fill 'red'
18
- c.gravity 'southeast'
19
- c.label 'SE'
14
+ c.background "transparent"
15
+ c.fill "red"
16
+ c.gravity "southeast"
17
+ c.label "SE"
20
18
  end
21
19
  end
@@ -1,22 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
- #
2
+ require "mojo_magick"
3
3
 
4
- require 'mojo_magick'
5
-
6
- MojoMagick.convert(nil, 'composite_out.png') do |c|
7
- c.size '200x200'
4
+ MojoMagick.convert(nil, "composite_out.png") do |c|
5
+ c.size "200x200"
8
6
  c.delay 100
9
7
  c.image_block do # first layer
10
- c.background 'blue'
11
- c.fill 'white'
12
- c.gravity 'northwest'
13
- c.label 'NW'
8
+ c.background "blue"
9
+ c.fill "white"
10
+ c.gravity "northwest"
11
+ c.label "NW"
14
12
  end
15
13
  c.image_block do # second layer
16
- c.background 'transparent'
17
- c.fill 'red'
18
- c.gravity 'southeast'
19
- c.label 'SE'
14
+ c.background "transparent"
15
+ c.fill "red"
16
+ c.gravity "southeast"
17
+ c.label "SE"
20
18
  end
21
19
  c.composite
22
20
  end
data/init.rb CHANGED
@@ -1 +1 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'mojo_magick'))
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "lib", "mojo_magick"))
@@ -1,15 +1,8 @@
1
1
  module ImageMagick
2
- module Fonts
3
- def get_fonts
4
- @parser ||= MojoMagick::Util::Parser.new
5
- raw_fonts = begin
6
- raw_command('identify', '-list font')
7
- rescue Exception => e
8
- puts e
9
- puts 'Failed to execute font list with raw_command - trying straight up execute'
10
- `convert -list font`
11
- end
12
- @parser.parse_fonts(raw_fonts)
2
+ class Fonts
3
+ def self.all
4
+ raw_fonts = MojoMagick::Commands.send(:execute, "identify", "-list", "font").return_value
5
+ MojoMagick::Util::FontParser.new(raw_fonts).parse
13
6
  end
14
7
  end
15
8
  end