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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RoundedCornersImage

#rounded_corners_image

Methods included from TornPaperImage

#torn_paper_image

Methods included from ResizedImage

#resized_image

Class Attribute Details

.cd_pathObject

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

Parameters:

  • value

    the value to set the attribute debug_mode to.



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

Parameters:

  • value

    the value to set the attribute logger to.



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

Parameters:

  • value

    the value to set the attribute logger_method to.



7
8
9
# File 'lib/skeptick/core.rb', line 7

def logger_method=(value)
  @logger_method = value
end

.timeoutObject

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

Returns:

  • (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(message)
  @logger ||= ::STDOUT

  @logger_method ||=
    if    @logger.respond_to?(:debug); :debug
    elsif @logger.respond_to?(:puts);  :puts
    else  :write
    end

  @logger.public_send(@logger_method, message)
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(options = {})
  result = ''

  result << if options[:size]
    options[:size]
  else
    if options[:width] && options[:height]
      "#{options[:width]}x#{options[:height]}"
    elsif options[:width]
      "#{options[:width]}x"
    elsif options[:height]
      "x#{options[:height]}"
    else
      ''
    end
  end

  if options[:left] || options[:top]
    left = '%+d' % (options[:left] || 0)
    top  = '%+d' % (options[:top]  || 0)
    result << "#{left}#{top}"
  end

  result << '%' if options[:percentage]
  result << '!' if options[:exact]
  result << '<' if options[:expand_only]
  result << '>' if options[:shrink_only]

  result
end

#image(*args, &blk) ⇒ Object



34
35
36
# File 'lib/skeptick/core.rb', line 34

def image(*args, &blk)
  Skeptick::Convert.new(self, *args, &blk)
end