compass-magick 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE.md CHANGED
File without changes
data/README.md CHANGED
@@ -44,6 +44,16 @@ APIs
44
44
 
45
45
  RDoc is also [available for the entire project](http://rubydoc.info/gems/compass-magick/frames).
46
46
 
47
+ Similar Projects
48
+ ----------------
49
+
50
+ [compass-canvas](http://StanAngeloff.github.com/compass-canvas/) is a Compass plugin that provides a drawing surface similar to the `<canvas>` element in JavaScript and [Turtle graphics][turtle] in other programming languages.
51
+ It uses [Cairo][cairo] as a back-end to perform all graphics operations.
52
+ The project supports anti-aliasing, vector graphics, gradients, masks, clipping, complex operations like drop shadow and many more.
53
+
54
+ [turtle]: http://en.wikipedia.org/wiki/Turtle_graphics
55
+ [cairo]: http://en.wikipedia.org/wiki/Cairo_(graphics)
56
+
47
57
  Contribute
48
58
  ----------
49
59
 
data/extras/magick.js CHANGED
@@ -1,57 +1,51 @@
1
1
  #!/usr/bin/env phantomjs
2
- if (phantom.state.length === 0) {
3
- var width = parseInt(phantom.args[0], 10),
4
- height = parseInt(phantom.args[1], 10),
5
- padding = Math.max(width, height),
6
- head, body, i, styles, j, length, instruction;
7
- if (isNaN(width) || isNaN(height) || phantom.args.length < 4) {
8
- console.error('Usage: magick.js width height styles [styles […]] filename');
9
- phantom.exit();
10
- } else {
11
- head = []; body = [];
12
- for (i = 2; i < phantom.args.length - 1; i ++) {
13
- styles = phantom.args[i].split(';');
14
- for (j = 0, length = styles.length; j < length; j ++) {
15
- instruction = styles[j].replace(/^\s+|\s+$/g, '');
16
- if (instruction.indexOf(':') > 0) {
17
- styles.push('-webkit-' + instruction);
18
- }
2
+ var width = parseInt(phantom.args[0], 10),
3
+ height = parseInt(phantom.args[1], 10),
4
+ padding = Math.max(width, height),
5
+ page = require('webpage').create(),
6
+ head, body, i, styles, j, length, instruction;
7
+ if (isNaN(width) || isNaN(height) || phantom.args.length < 4) {
8
+ console.error('Usage: magick.js width height styles [styles […]] filename');
9
+ phantom.exit();
10
+ } else {
11
+ head = []; body = [];
12
+ for (i = 2; i < phantom.args.length - 1; i ++) {
13
+ styles = phantom.args[i].split(';');
14
+ for (j = 0, length = styles.length; j < length; j ++) {
15
+ instruction = styles[j].replace(/^\s+|\s+$/g, '');
16
+ if (instruction.indexOf(':') > 0) {
17
+ styles.push('-webkit-' + instruction);
19
18
  }
20
- head.push('#element-' + i + ' { ' +
21
- 'width: ' + width + 'px; ' +
22
- 'height: ' + height + 'px; ' +
23
- 'box-sizing: border-box; ' +
24
- '-webkit-box-sizing: border-box; ' +
25
- styles.join('; ') + '; ' +
26
- '}');
27
- body.push('<div id="element-' + i + '"></div>');
28
- }
29
- try {
30
- phantom.state = 1;
31
- phantom.viewportSize = {
32
- width: width + padding * 2,
33
- height: height + padding * 2
34
- };
35
- phantom.content =
36
- '<html>' +
37
- '<head>' +
38
- '<style>' +
39
- head.join('\n') +
40
- '</style>' +
41
- '</head>' +
42
- '<body style="background: transparent; margin: ' + padding + 'px ' + padding + 'px; padding: 0;">' +
43
- body.join('\n') +
44
- '</body>' +
45
- '</html>';
46
- } catch (e) {
47
- phantom.exit();
48
- throw e;
49
19
  }
20
+ head.push('#element-' + i + ' { ' +
21
+ 'width: ' + width + 'px; ' +
22
+ 'height: ' + height + 'px; ' +
23
+ 'box-sizing: border-box; ' +
24
+ '-webkit-box-sizing: border-box; ' +
25
+ styles.join('; ') + '; ' +
26
+ '}');
27
+ body.push('<div id="element-' + i + '"></div>');
50
28
  }
51
- } else {
52
29
  try {
53
- phantom.render(phantom.args[phantom.args.length - 1]);
54
- } finally {
30
+ page.viewportSize = {
31
+ width: width + padding * 2,
32
+ height: height + padding * 2
33
+ };
34
+ page.content =
35
+ '<html>' +
36
+ '<head>' +
37
+ '<style>' +
38
+ head.join('\n') +
39
+ '</style>' +
40
+ '</head>' +
41
+ '<body style="background: transparent; margin: ' + padding + 'px ' + padding + 'px; padding: 0;">' +
42
+ body.join('\n') +
43
+ '</body>' +
44
+ '</html>';
45
+ page.render(phantom.args[phantom.args.length - 1]);
46
+ phantom.exit();
47
+ } catch (e) {
55
48
  phantom.exit();
49
+ throw e;
56
50
  }
57
- }
51
+ }
data/lib/magick.rb CHANGED
@@ -32,7 +32,7 @@ module Compass::Magick
32
32
  # The current version of Compass Magick. This value is updated manually on
33
33
  # release. If you are using a Git clone, the version will always end with
34
34
  # '.git'.
35
- VERSION = '0.1.4.git'
35
+ VERSION = '0.1.5.git'
36
36
 
37
37
  # The locations where plug-ins are located. These paths are scanned for
38
38
  # *.rb files and loaded in order.
data/lib/magick/canvas.rb CHANGED
@@ -73,6 +73,11 @@ module Compass::Magick
73
73
 
74
74
  alias :to_s :to_data_uri
75
75
 
76
+ # @return [Boolean] `true` (the Ruby boolean value)
77
+ def to_bool
78
+ true
79
+ end
80
+
76
81
  # Tile the Canvas to fill the region defined by `width` and `height`.
77
82
  #
78
83
  # @return {Canvas} A new Canvas instance that fills the given region.
File without changes
File without changes
data/lib/magick/effect.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/magick/shapes.rb CHANGED
File without changes
data/lib/magick/types.rb CHANGED
File without changes
File without changes
File without changes
data/lib/magick/utils.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/canvas_spec.rb CHANGED
File without changes
data/spec/helpers.rb CHANGED
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compass-magick
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stan Angeloff
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-12 00:00:00 Z
18
+ date: 2012-04-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: compass
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ~>
27
27
  - !ruby/object:Gem::Version
28
- hash: 62196225
28
+ hash: -3478083476
29
29
  segments:
30
30
  - 0
31
31
  - 11
@@ -77,34 +77,34 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - README.md
79
79
  - LICENSE.md
80
- - lib/magick/canvas.rb
81
- - lib/magick/command.rb
82
- - lib/magick/configuration.rb
83
- - lib/magick/effect.rb
80
+ - lib/magick.rb
81
+ - lib/plugins/corners.rb
82
+ - lib/plugins/pattern.rb
83
+ - lib/plugins/phantom.rb
84
+ - lib/stylesheets/_magick.sass
85
+ - lib/magick/types/gradients.rb
86
+ - lib/magick/types/solid.rb
87
+ - lib/magick/functions/operations.rb
88
+ - lib/magick/functions/sprites.rb
84
89
  - lib/magick/functions/canvas.rb
85
90
  - lib/magick/functions/drawing.rb
86
91
  - lib/magick/functions/operations/effects.rb
87
- - lib/magick/functions/operations.rb
88
- - lib/magick/functions/sprites.rb
89
92
  - lib/magick/functions/types.rb
90
93
  - lib/magick/functions.rb
91
- - lib/magick/plugins.rb
94
+ - lib/magick/canvas.rb
95
+ - lib/magick/utils.rb
96
+ - lib/magick/configuration.rb
92
97
  - lib/magick/scriptable.rb
98
+ - lib/magick/plugins.rb
99
+ - lib/magick/command.rb
93
100
  - lib/magick/shapes.rb
94
- - lib/magick/types/gradients.rb
95
- - lib/magick/types/solid.rb
96
101
  - lib/magick/types.rb
97
- - lib/magick/utils.rb
98
- - lib/magick.rb
99
- - lib/plugins/corners.rb
100
- - lib/plugins/pattern.rb
101
- - lib/plugins/phantom.rb
102
- - lib/stylesheets/_magick.sass
102
+ - lib/magick/effect.rb
103
103
  - extras/magick.js
104
- - spec/canvas_spec.rb
105
- - spec/helpers.rb
106
104
  - spec/types/gradients_spec.rb
107
105
  - spec/types/solid_spec.rb
106
+ - spec/canvas_spec.rb
107
+ - spec/helpers.rb
108
108
  homepage: https://github.com/StanAngeloff/compass-magick
109
109
  licenses: []
110
110
 
@@ -134,13 +134,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  requirements: []
135
135
 
136
136
  rubyforge_project:
137
- rubygems_version: 1.7.2
137
+ rubygems_version: 1.8.15
138
138
  signing_key:
139
139
  specification_version: 3
140
140
  summary: Dynamic image generation for Compass using ChunkyPNG/PhantomJS.
141
141
  test_files:
142
- - spec/canvas_spec.rb
143
- - spec/helpers.rb
144
142
  - spec/types/gradients_spec.rb
145
143
  - spec/types/solid_spec.rb
144
+ - spec/canvas_spec.rb
145
+ - spec/helpers.rb
146
146
  has_rdoc: true