Module: Refinery::Images

Includes:
ActiveSupport::Configurable
Defined in:
images/lib/refinery/images.rb,
images/lib/refinery/images/engine.rb,
images/lib/refinery/images/dragonfly.rb,
images/lib/refinery/images/validators.rb,
images/lib/refinery/images/configuration.rb,
images/lib/refinery/images/validators/image_size_validator.rb,
images/lib/refinery/images/validators/image_update_validator.rb

Defined Under Namespace

Modules: Dragonfly, Validators Classes: Engine

Class Method Summary collapse

Class Method Details

.custom_backend?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'images/lib/refinery/images/configuration.rb', line 61

def custom_backend?
  config.custom_backend_class.nil? ? Core.dragonfly_custom_backend? : config.custom_backend_class.present?
end

.custom_backend_classObject



65
66
67
# File 'images/lib/refinery/images/configuration.rb', line 65

def custom_backend_class
  config.custom_backend_class.nil? ? Core.dragonfly_custom_backend_class : config.custom_backend_class.constantize
end

.custom_backend_optsObject



69
70
71
# File 'images/lib/refinery/images/configuration.rb', line 69

def custom_backend_opts
  config.custom_backend_opts.presence || Core.dragonfly_custom_backend_opts
end

.datastore_root_pathObject



37
38
39
# File 'images/lib/refinery/images/configuration.rb', line 37

def datastore_root_path
  config.datastore_root_path || (Rails.root.join('public', 'system', 'refinery', 'images').to_s if Rails.root)
end

.factory_pathsObject



19
20
21
# File 'images/lib/refinery/images.rb', line 19

def factory_paths
  @factory_paths ||= [ root.join("spec/factories").to_s ]
end

.rootObject



15
16
17
# File 'images/lib/refinery/images.rb', line 15

def root
  @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
end

.s3_access_key_idObject



49
50
51
# File 'images/lib/refinery/images/configuration.rb', line 49

def s3_access_key_id
  config.s3_access_key_id.presence || Core.s3_access_key_id
end

.s3_backendObject



41
42
43
# File 'images/lib/refinery/images/configuration.rb', line 41

def s3_backend
  config.s3_backend.presence || Core.s3_backend
end

.s3_bucket_nameObject



45
46
47
# File 'images/lib/refinery/images/configuration.rb', line 45

def s3_bucket_name
  config.s3_bucket_name.presence || Core.s3_bucket_name
end

.s3_regionObject



57
58
59
# File 'images/lib/refinery/images/configuration.rb', line 57

def s3_region
  config.s3_region.presence || Core.s3_region
end

.s3_secret_access_keyObject



53
54
55
# File 'images/lib/refinery/images/configuration.rb', line 53

def s3_secret_access_key
  config.s3_secret_access_key.presence || Core.s3_secret_access_key
end