Module: PhotoCook
- Defined in:
- lib/photo-cook.rb,
lib/photo-cook/utils.rb,
lib/photo-cook/engine.rb,
lib/photo-cook/events.rb,
lib/photo-cook/logger.rb,
lib/photo-cook/pixels.rb,
lib/photo-cook/version.rb,
lib/photo-cook/resize/mode.rb,
lib/photo-cook/resize/__api__.rb,
lib/photo-cook/resize/command.rb,
lib/photo-cook/resize/resizer.rb,
lib/photo-cook/resize/assemble.rb,
lib/photo-cook/optimization/job.rb,
lib/photo-cook/resize/middleware.rb,
lib/photo-cook/device-pixel-ratio.rb,
lib/photo-cook/resize/carrierwave.rb,
lib/photo-cook/resize/calculations.rb,
lib/photo-cook/resize/magick-photo.rb,
lib/photo-cook/optimization/__api__.rb,
lib/photo-cook/device-pixel-ratio-spy.rb,
lib/photo-cook/optimization/carrierwave.rb,
lib/photo-cook/optimization/image-optim.rb
Defined Under Namespace
Modules: DevicePixelRatio, DevicePixelRatioSpy, Optimization, Pixels, Resize, Utils
Classes: Engine, LoggerEvaluator
Constant Summary
collapse
- VERSION =
'1.2.7'
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.logger ⇒ Object
Returns the value of attribute logger.
6
7
8
|
# File 'lib/photo-cook/logger.rb', line 6
def logger
@logger
end
|
.logger_evaluator ⇒ Object
Returns the value of attribute logger_evaluator.
7
8
9
|
# File 'lib/photo-cook/logger.rb', line 7
def logger_evaluator
@logger_evaluator
end
|
.public_dir ⇒ Object
Returns the value of attribute public_dir.
15
16
17
|
# File 'lib/photo-cook.rb', line 15
def public_dir
@public_dir
end
|
.root_path ⇒ Object
Returns the value of attribute root_path.
15
16
17
|
# File 'lib/photo-cook.rb', line 15
def root_path
@root_path
end
|
Class Method Details
.device_pixel_ratio ⇒ Object
61
62
63
|
# File 'lib/photo-cook/device-pixel-ratio.rb', line 61
def device_pixel_ratio
@device_pixel_ratio || DevicePixelRatio::DEFAULT
end
|
.device_pixel_ratio=(x) ⇒ Object
65
66
67
|
# File 'lib/photo-cook/device-pixel-ratio.rb', line 65
def device_pixel_ratio=(x)
@device_pixel_ratio = DevicePixelRatio.parse!(x)
end
|
.disable_logging! ⇒ Object
24
25
26
27
|
# File 'lib/photo-cook/logger.rb', line 24
def disable_logging!
@logging_enabled = false
nil
end
|
.enable_logging! ⇒ Object
19
20
21
22
|
# File 'lib/photo-cook/logger.rb', line 19
def enable_logging!
@logging_enabled = true
nil
end
|
.log(&block) ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/photo-cook/logger.rb', line 9
def log(&block)
logger_evaluator.instance_eval do
log "\n"
log '--- PhotoCook ---'
instance_eval(&block)
log '---'
end if @logging_enabled
nil
end
|
.notify(event, *params) ⇒ Object
6
7
8
9
10
|
# File 'lib/photo-cook/events.rb', line 6
def notify(event, *params)
blocks = @events && @events[event.to_s]
blocks && blocks.each { |blk| Utils.call_block_with_floating_arguments(blk, params) }
nil
end
|
.subscribe(event, &block) ⇒ Object
12
13
14
15
|
# File 'lib/photo-cook/events.rb', line 12
def subscribe(event, &block)
((@events ||= {})[event.to_s] ||= []) << block
nil
end
|