photish 0.3.11 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.pryrc +2 -0
- data/README.md +73 -12
- data/TODO.md +8 -8
- data/bin/console +2 -10
- data/bin/setup +0 -2
- data/lib/photish/assets/example/photos/Big Dogs/Custom Template Page.slim +5 -0
- data/lib/photish/assets/example/site/_plugins/footer_links.rb +2 -1
- data/lib/photish/assets/example/site/_plugins/tmpdir_deploy.rb +2 -2
- data/lib/photish/assets/example/site/_plugins/yell_loud.rb +2 -1
- data/lib/photish/assets/example/site/_templates/album.slim +4 -0
- data/lib/photish/cache/db_file.rb +40 -0
- data/lib/photish/cache/manifest.rb +20 -18
- data/lib/photish/cache/repository.rb +42 -0
- data/lib/photish/cli/interface.rb +4 -0
- data/lib/photish/command/base.rb +6 -2
- data/lib/photish/command/deploy.rb +4 -8
- data/lib/photish/command/generate.rb +10 -26
- data/lib/photish/command/host.rb +8 -7
- data/lib/photish/command/init.rb +1 -1
- data/lib/photish/command/worker.rb +5 -17
- data/lib/photish/config/default_config.rb +5 -3
- data/lib/photish/config/file_config.rb +19 -5
- data/lib/photish/config/settings.rb +59 -0
- data/lib/photish/gallery/album.rb +27 -14
- data/lib/photish/gallery/collection.rb +27 -13
- data/lib/photish/gallery/image.rb +5 -12
- data/lib/photish/gallery/page.rb +40 -0
- data/lib/photish/gallery/photo.rb +7 -10
- data/lib/photish/gallery/traits/albumable.rb +9 -3
- data/lib/photish/gallery/traits/fileable.rb +30 -0
- data/lib/photish/gallery/traits/urlable.rb +12 -7
- data/lib/photish/log/io.rb +20 -0
- data/lib/photish/log/loggable.rb +1 -1
- data/lib/photish/log/{log_setup.rb → setup.rb} +1 -1
- data/lib/photish/{gallery/traits/breadcrumbable.rb → plugin/core/breadcrumb.rb} +12 -3
- data/lib/photish/plugin/core/build_url.rb +26 -0
- data/lib/photish/plugin/core/exifable.rb +15 -0
- data/lib/photish/plugin/core/metadatable.rb +27 -0
- data/lib/photish/plugin/repository.rb +3 -7
- data/lib/photish/plugin/type.rb +1 -0
- data/lib/photish/render/{image_conversion.rb → image.rb} +34 -18
- data/lib/photish/render/{site_worker.rb → model.rb} +13 -12
- data/lib/photish/render/page.rb +13 -24
- data/lib/photish/render/site.rb +3 -3
- data/lib/photish/render/template.rb +59 -0
- data/lib/photish/version.rb +1 -1
- data/lib/photish.rb +14 -11
- data/photish.gemspec +1 -0
- metadata +32 -14
- data/lib/photish/cache/manifest_db_file.rb +0 -36
- data/lib/photish/config/app_settings.rb +0 -57
- data/lib/photish/config/file_config_location.rb +0 -27
- data/lib/photish/config/image_extension.rb +0 -8
- data/lib/photish/core_plugin/breadcrumb.rb +0 -35
- data/lib/photish/core_plugin/build_url.rb +0 -20
- data/lib/photish/gallery/traits/metadatable.rb +0 -30
- data/lib/photish/log/access_log.rb +0 -11
@@ -1,27 +0,0 @@
|
|
1
|
-
module Photish
|
2
|
-
module Config
|
3
|
-
class FileConfigLocation
|
4
|
-
FILE_NAME = 'config.yml'
|
5
|
-
|
6
|
-
def initialize(config_dir)
|
7
|
-
@config_dir = config_dir
|
8
|
-
end
|
9
|
-
|
10
|
-
def path
|
11
|
-
File.join(directory, config_file_name)
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
attr_reader :config_dir
|
17
|
-
|
18
|
-
def directory
|
19
|
-
config_dir || Dir.pwd
|
20
|
-
end
|
21
|
-
|
22
|
-
def config_file_name
|
23
|
-
FILE_NAME
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
module Photish
|
2
|
-
module Config
|
3
|
-
module ImageExtension
|
4
|
-
# Taken from 'convert -list format'
|
5
|
-
IMAGE_MAGICK = ['aai', 'art', 'avs', 'bgr', 'bgra', 'bgro', 'bmp', 'bmp2', 'bmp3', 'brf', 'cal', 'cals', 'canvas', 'caption', 'cin', 'cip', 'clip', 'cmyk', 'cmyka', 'cur', 'cut', 'data', 'dcm', 'dcx', 'dds', 'dfont', 'dpx', 'dxt1', 'dxt5', 'eps2', 'eps3', 'fax', 'fits', 'fractal', 'fts', 'g3', 'gif', 'gif87', 'gradient', 'gray', 'group4', 'h', 'hald', 'hdr', 'histogram', 'hrz', 'htm', 'html', 'icb', 'ico', 'icon', 'inline', 'ipl', 'isobrl', 'isobrl6', 'jng', 'jnx', 'jpe', 'jpeg', 'jpg', 'jps', 'label', 'mac', 'magick', 'map', 'mask', 'matte', 'miff', 'mng', 'mono', 'mpc', 'msl', 'mtv', 'mvg', 'null', 'otb', 'otf', 'pal', 'palm', 'pam', 'pango', 'pattern', 'pbm', 'pcd', 'pcds', 'pct', 'pcx', 'pdb', 'pes', 'pfa', 'pfb', 'pfm', 'pgm', 'picon', 'pict', 'pix', 'pjpeg', 'plasma', 'png', 'png00', 'png24', 'png32', 'png48', 'png64', 'png8', 'pnm', 'ppm', 'preview', 'ps2', 'ps3', 'psb', 'psd', 'ptif', 'pwp', 'radial-gradient', 'ras', 'rgb', 'rgba', 'rgbo', 'rgf', 'rla', 'rle', 'scr', 'sct', 'sfw', 'sgi', 'shtml', 'six', 'sixel', 'sparse-color', 'stegano', 'sun', 'text', 'tga', 'thumbnail', 'tiff', 'tiff64', 'tile', 'tim', 'ttc', 'ttf', 'txt', 'ubrl', 'ubrl6', 'uil', 'uyvy', 'vda', 'vicar', 'vid', 'viff', 'vips', 'vst', 'wbmp', 'wpg', 'xbm', 'xc', 'xcf', 'xpm', 'xv', 'ycbcr', 'ycbcra', 'yuv']
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Photish::Plugin::Breadcrumb
|
2
|
-
def self.is_for?(type)
|
3
|
-
[
|
4
|
-
Photish::Plugin::Type::Collection,
|
5
|
-
Photish::Plugin::Type::Album,
|
6
|
-
Photish::Plugin::Type::Photo
|
7
|
-
].include?(type)
|
8
|
-
end
|
9
|
-
|
10
|
-
def breadcrumbs
|
11
|
-
html = "<ul class=\"breadcrumbs\">"
|
12
|
-
parents_and_me.each_with_index do |level, index|
|
13
|
-
html << "<li class=\"" << crumb_class(index) << "\">"
|
14
|
-
html << "<a href=\"" << level.url << "\">" << level.name << "</a>"
|
15
|
-
html << "</li>"
|
16
|
-
end
|
17
|
-
html << "</ul>"
|
18
|
-
end
|
19
|
-
|
20
|
-
def parents_and_me
|
21
|
-
@parents_and_me ||= [parent.try(:parents_and_me),
|
22
|
-
self].flatten.compact
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def crumb_class(index)
|
28
|
-
crumb_class = 'breadcrumb'
|
29
|
-
crumb_class << ' crumb-' << index.to_s
|
30
|
-
crumb_class << ' crumb-first' if index == 0
|
31
|
-
crumb_class << ' crumb-last' if index == (parents_and_me.count - 1)
|
32
|
-
crumb_class << ' crumb-only' if parents_and_me.count == 1
|
33
|
-
crumb_class
|
34
|
-
end
|
35
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Photish::Plugin::BuildUrl
|
2
|
-
def self.is_for?(type)
|
3
|
-
[
|
4
|
-
Photish::Plugin::Type::Collection,
|
5
|
-
Photish::Plugin::Type::Album,
|
6
|
-
Photish::Plugin::Type::Photo
|
7
|
-
].include?(type)
|
8
|
-
end
|
9
|
-
|
10
|
-
def build_url(*pieces)
|
11
|
-
url_pieces = []
|
12
|
-
url_pieces << host
|
13
|
-
url_pieces << url_info.base
|
14
|
-
url_pieces << pieces
|
15
|
-
url_pieces.flatten
|
16
|
-
.compact
|
17
|
-
.join('/')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Photish
|
2
|
-
module Gallery
|
3
|
-
module Traits
|
4
|
-
module Metadatable
|
5
|
-
def metadata
|
6
|
-
return unless File.exist?(metadata_file)
|
7
|
-
@metadata ||= RecursiveOpenStruct.new(YAML.load_file(metadata_file))
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def basename
|
13
|
-
File.basename(path, extname)
|
14
|
-
end
|
15
|
-
|
16
|
-
def extname
|
17
|
-
File.extname(path)
|
18
|
-
end
|
19
|
-
|
20
|
-
def dirname
|
21
|
-
File.dirname(path)
|
22
|
-
end
|
23
|
-
|
24
|
-
def metadata_file
|
25
|
-
File.join(dirname, basename + '.yml')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|