Module: Skeptick
- Includes:
- ResizedImage, RoundedCornersImage, TornPaperImage
- Defined in:
- lib/skeptick/core.rb,
lib/skeptick/error.rb,
lib/skeptick/command.rb,
lib/skeptick/convert.rb,
lib/skeptick/railtie.rb,
lib/skeptick/version.rb,
lib/skeptick/sugar/draw.rb,
lib/skeptick/sugar/font.rb,
lib/skeptick/sugar/swap.rb,
lib/skeptick/sugar/text.rb,
lib/skeptick/dsl_context.rb,
lib/skeptick/sugar/clone.rb,
lib/skeptick/sugar/write.rb,
lib/skeptick/sugar/canvas.rb,
lib/skeptick/sugar/delete.rb,
lib/skeptick/sugar/format.rb,
lib/skeptick/sugar/compose.rb,
lib/skeptick/sugar/geometry.rb,
lib/skeptick/sugar/resized_image.rb,
lib/skeptick/sugar/torn_paper_image.rb,
lib/skeptick/sugar/rounded_corners_image.rb
Defined Under Namespace
Modules: ResizedImage, RoundedCornersImage, TornPaperImage Classes: Command, Compose, Convert, DslContext, ImageMagickError, Railtie
Constant Summary collapse
- VERSION =
'0.2.1'
Class Attribute Summary collapse
-
.cd_path ⇒ Object
Returns the value of attribute cd_path.
-
.debug_mode ⇒ Object
writeonly
Sets the attribute debug_mode.
-
.logger ⇒ Object
writeonly
Sets the attribute logger.
-
.logger_method ⇒ Object
writeonly
Sets the attribute logger_method.
-
.timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
Instance Method Summary collapse
- #compose(blending, *args, &blk) ⇒ Object
- #convert(*args, &blk) ⇒ Object
- #geometry(options = {}) ⇒ Object
- #image(*args, &blk) ⇒ Object
Methods included from RoundedCornersImage
Methods included from TornPaperImage
Methods included from ResizedImage
Class Attribute Details
.cd_path ⇒ Object
Returns the value of attribute cd_path.
11 12 13 |
# File 'lib/skeptick/core.rb', line 11 def cd_path @cd_path end |
.debug_mode=(value) ⇒ Object (writeonly)
Sets the attribute debug_mode
7 8 9 |
# File 'lib/skeptick/core.rb', line 7 def debug_mode=(value) @debug_mode = value end |
.logger=(value) ⇒ Object (writeonly)
Sets the attribute logger
7 8 9 |
# File 'lib/skeptick/core.rb', line 7 def logger=(value) @logger = value end |
.logger_method=(value) ⇒ Object (writeonly)
Sets the attribute logger_method
7 8 9 |
# File 'lib/skeptick/core.rb', line 7 def logger_method=(value) @logger_method = value end |
.timeout ⇒ Object
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/skeptick/core.rb', line 11 def timeout @timeout end |
Class Method Details
.debug_mode? ⇒ Boolean
25 26 27 |
# File 'lib/skeptick/core.rb', line 25 def debug_mode? @debug_mode end |
.log(message) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/skeptick/core.rb', line 13 def log() @logger ||= ::STDOUT @logger_method ||= if @logger.respond_to?(:debug); :debug elsif @logger.respond_to?(:puts); :puts else :write end @logger.public_send(@logger_method, ) end |
Instance Method Details
#compose(blending, *args, &blk) ⇒ Object
47 48 49 |
# File 'lib/skeptick/sugar/compose.rb', line 47 def compose(blending, *args, &blk) Compose.new(self, blending, *args, &blk) end |
#convert(*args, &blk) ⇒ Object
30 31 32 |
# File 'lib/skeptick/core.rb', line 30 def convert(*args, &blk) Skeptick::Convert.new(self, *args, &blk) end |
#geometry(options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/skeptick/sugar/geometry.rb', line 2 def geometry( = {}) result = '' result << if [:size] [:size] else if [:width] && [:height] "#{[:width]}x#{[:height]}" elsif [:width] "#{[:width]}x" elsif [:height] "x#{[:height]}" else '' end end if [:left] || [:top] left = '%+d' % ([:left] || 0) top = '%+d' % ([:top] || 0) result << "#{left}#{top}" end result << '%' if [:percentage] result << '!' if [:exact] result << '<' if [:expand_only] result << '>' if [:shrink_only] result end |