photish 0.3.0 → 0.3.1
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/.simplecov +19 -0
- data/README.md +7 -7
- data/Rakefile +1 -1
- data/TODO.md +6 -7
- data/exe/photish +0 -2
- data/lib/photish.rb +2 -0
- data/lib/photish/assets/Gemfile +3 -0
- data/lib/photish/assets/barebones/site/_templates/collection.slim +10 -0
- data/lib/photish/assets/barebones/site/_templates/layout.slim +7 -0
- data/lib/photish/assets/barebones/site/styles/basic.css +4 -0
- data/lib/photish/assets/config.yml +0 -10
- data/lib/photish/assets/photos/Big Dogs/Tired Dogs.jpg b/data/lib/photish/assets/example/photos/Big Dogs/Tired → Dogs.jpg +0 -0
- data/lib/photish/assets/photos/Big Dogs/Winking Dog.jpg b/data/lib/photish/assets/example/photos/Big Dogs/Winking → Dog.jpg +0 -0
- data/lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Exhausted Dogs.jpg b/data/lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Exhausted → Dogs.jpg +0 -0
- data/lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Exhausted Dogs.yml b/data/lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Exhausted → Dogs.yml +0 -0
- data/lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Many Dogs.jpg b/data/lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Many → Dogs.jpg +0 -0
- data/lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Many Dogs.yml b/data/lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Many → Dogs.yml +0 -0
- data/lib/photish/assets/photos/Small Dogs/Sleepy Dog.jpg b/data/lib/photish/assets/example/photos/Small Dogs/Sleepy → Dog.jpg +0 -0
- data/lib/photish/assets/photos/Small Dogs/Sleepy Dog.yml b/data/lib/photish/assets/example/photos/Small Dogs/Sleepy → Dog.yml +0 -0
- data/lib/photish/assets/photos/Small Dogs/Squishy Dogs/Big Ear Dog.jpg b/data/lib/photish/assets/example/photos/Small Dogs/Squishy Dogs/Big Ear → Dog.jpg +0 -0
- data/lib/photish/assets/{site → example/site}/_plugins/footer_links.rb +0 -6
- data/lib/photish/assets/{site → example/site}/_plugins/tmpdir_deploy.rb +0 -0
- data/lib/photish/assets/{site → example/site}/_plugins/yell_loud.rb +0 -0
- data/lib/photish/assets/{site → example/site}/_templates/album.slim +1 -1
- data/lib/photish/assets/{site → example/site}/_templates/collection.slim +1 -1
- data/lib/photish/assets/{site → example/site}/_templates/layout.slim +0 -0
- data/lib/photish/assets/{site → example/site}/_templates/photo.slim +0 -0
- data/lib/photish/assets/{site → example/site}/custom.html +0 -0
- data/lib/photish/assets/{site → example/site}/images/crumbs.gif +0 -0
- data/lib/photish/assets/{site → example/site}/styles/basic.css +0 -0
- data/lib/photish/cli/interface.rb +1 -0
- data/lib/photish/command/base.rb +1 -1
- data/lib/photish/command/generate.rb +3 -1
- data/lib/photish/command/host.rb +1 -1
- data/lib/photish/command/init.rb +33 -8
- data/lib/photish/config/default_config.rb +1 -0
- data/lib/photish/log/logger.rb +8 -3
- data/lib/photish/render/change_manifest.rb +53 -0
- data/lib/photish/render/image_conversion.rb +57 -11
- data/lib/photish/render/page.rb +15 -6
- data/lib/photish/render/site.rb +5 -3
- data/lib/photish/version.rb +1 -1
- data/photish.gemspec +3 -2
- metadata +57 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8a0b8f1e4161d340f6021e13870235e33f6023
|
4
|
+
data.tar.gz: 957653b7e8c8c17beafbc7dfebf6dd6e1ed6fde6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47e2ba13affb3eb5598f1c5d88f4d593ebb9282aaed27b45e195ebf611fa38a12d8b7c5d9720e3c215371814fc9ee2a6c22a51d75fa0925f896003e2f24cb3ae
|
7
|
+
data.tar.gz: 876a3d8d56247e9e210c9f91cc43f275c71215d24d7c83b869ec815c9bcaf5972b09c21211c46e002cad079a021d1de053c7ec371fc63fede584232a96a20e1e
|
data/.simplecov
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'codeclimate-test-reporter'
|
2
|
+
|
3
|
+
SimpleCov.start(CodeClimate::TestReporter.configuration.profile) do
|
4
|
+
filters.clear
|
5
|
+
|
6
|
+
add_filter do |src|
|
7
|
+
!(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /photish/
|
8
|
+
end
|
9
|
+
|
10
|
+
add_filter '/bin/'
|
11
|
+
add_filter '/coverage/'
|
12
|
+
add_filter '/exe/'
|
13
|
+
add_filter '/log/'
|
14
|
+
add_filter '/pkg/'
|
15
|
+
|
16
|
+
add_group 'Library', 'lib'
|
17
|
+
add_group 'Specs', 'spec'
|
18
|
+
add_group 'Features', ['features', 'tmp/aruba']
|
19
|
+
end
|
data/README.md
CHANGED
@@ -288,22 +288,22 @@ The meanings and purpose of each field is defined below:
|
|
288
288
|
|
289
289
|
Field | Purpose
|
290
290
|
---------------------- | -------
|
291
|
-
`port` | the port number that the `photish host` command will bind to
|
291
|
+
`port` | the port number that the `photish host` command will bind to, default is `9876`
|
292
292
|
`qualities` | an array of `name` and `params` fields for **Images**
|
293
293
|
`qualities[]/name` | the name of the **Image** quality
|
294
294
|
`qualities[]/params` | the parameters to be provided to the ImageMagick `convert` utility for the **Image** file quality
|
295
295
|
`templates` | a listing of the various template files
|
296
|
-
`templates/layout` | the layout template file in the `site/_templates` folder
|
297
|
-
`templates/collection` | the collection template file in the `site/_templates` folder
|
298
|
-
`templates/album` | the album template file in the `site/_templates` folder
|
299
|
-
`templates/photo` | the photo template file in the `site/_templates` folder
|
296
|
+
`templates/layout` | the layout template file in the `site/_templates` folder, must be overridden if using a different template engine
|
297
|
+
`templates/collection` | the collection template file in the `site/_templates` folder, must be overridden if using a different template engine
|
298
|
+
`templates/album` | the album template file in the `site/_templates` folder, must be overridden if using a different template engine
|
299
|
+
`templates/photo` | the photo template file in the `site/_templates` folder, must be overridden if using a different template engine
|
300
300
|
`logging` | a listing of the various logging options
|
301
301
|
`logging/colorize` | when outputting to `STDOUT`, `true` to use color, `false` for none
|
302
302
|
`logging/level` | the default logging level, it is advised to keep this at `info`
|
303
303
|
`logging/output` | the appenders for the logger, `stdout` goes to `STDOUT`, `file` goes to `log/photish.log`
|
304
304
|
`url` | a listing of the various url options
|
305
|
-
`url/host` |
|
306
|
-
`url/base` |
|
305
|
+
`url/host` | if you would like URLs generated with a specific host prefix, you can define it here, otherwise leave it as '/' or do not set this configuration at all
|
306
|
+
`url/base` | if your website will be hosted in a sub folder and will not be accessible at the root of the host, you can specify the sub folder(s) here, this will also mean your website will be hosted in a sub folder when ran using `photish host`
|
307
307
|
|
308
308
|
#### Customizing Templates
|
309
309
|
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'photish/rake/task'
|
|
7
7
|
RSpec::Core::RakeTask.new(:spec)
|
8
8
|
|
9
9
|
Cucumber::Rake::Task.new(:features) do |t|
|
10
|
-
t.cucumber_opts = "features --format pretty"
|
10
|
+
t.cucumber_opts = "features --format pretty --tags ~@wip"
|
11
11
|
end
|
12
12
|
|
13
13
|
desc 'Gather code climate results'
|
data/TODO.md
CHANGED
@@ -2,18 +2,17 @@
|
|
2
2
|
|
3
3
|
## In Progress
|
4
4
|
|
5
|
-
1.
|
6
|
-
1. URL customization, relative, absolute with or without hostname URLs (for
|
7
|
-
different host envs)
|
5
|
+
1. Add feature test for change and regenerate
|
8
6
|
|
9
7
|
## Backlog
|
10
8
|
|
9
|
+
1. Plugin as a gem to deploy to github pages, netlify, amazon s3
|
11
10
|
1. Custom template rendering outside of `_templates` folder using `page.{type}`
|
12
11
|
1. Proper asset pipeline for CSS
|
13
12
|
1. A sitemap helper plugin for use in custom templates for example
|
14
13
|
`sitemap.xml`
|
15
14
|
1. Share on RubyWebToolkit, StaticGen, etc
|
16
|
-
1. RDoc documentation for classes
|
17
|
-
1.
|
18
|
-
|
19
|
-
1.
|
15
|
+
1. RDoc documentation for classes, perhaps use the badge too
|
16
|
+
1. Provide generic way to override config from arguments to allow for host name
|
17
|
+
override on deploy etc.
|
18
|
+
1. Video transcoding and template rendering
|
data/exe/photish
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
if ENV['COVERAGE']
|
3
3
|
require 'simplecov'
|
4
|
-
require 'codeclimate-test-reporter'
|
5
4
|
|
6
5
|
SimpleCov.command_name "photish-binary-#{Process.pid}"
|
7
6
|
SimpleCov.root(File.join(File.expand_path(File.dirname(__FILE__)), '..'))
|
8
|
-
SimpleCov.start CodeClimate::TestReporter.configuration.profile
|
9
7
|
end
|
10
8
|
|
11
9
|
require 'photish'
|
data/lib/photish.rb
CHANGED
@@ -13,6 +13,7 @@ require 'thor'
|
|
13
13
|
require 'filemagic'
|
14
14
|
require 'recursive_open_struct'
|
15
15
|
require 'cgi'
|
16
|
+
require 'facter'
|
16
17
|
|
17
18
|
# Photish
|
18
19
|
require 'photish/plugin/type'
|
@@ -43,6 +44,7 @@ require 'photish/gallery/collection'
|
|
43
44
|
require 'photish/render/page'
|
44
45
|
require 'photish/render/site'
|
45
46
|
require 'photish/render/image_conversion'
|
47
|
+
require 'photish/render/change_manifest'
|
46
48
|
require 'photish/rake/task'
|
47
49
|
require 'photish/version'
|
48
50
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
h2 Welcome
|
2
|
+
p This is a barebones Photish site with only the collection template.
|
3
|
+
p Run `photish init --example` for an example site.
|
4
|
+
|
5
|
+
h3 Getting started
|
6
|
+
ol
|
7
|
+
li Read the documentation on Github
|
8
|
+
li Copy your photos to the `./photos` directory
|
9
|
+
li Create templates for the different models in `./site/_templates`
|
10
|
+
|
@@ -1,16 +1,6 @@
|
|
1
1
|
---
|
2
|
-
port: 9876
|
3
2
|
qualities:
|
4
3
|
- name: Original
|
5
4
|
params: []
|
6
5
|
- name: Low
|
7
6
|
params: ['-resize', '200x200']
|
8
|
-
templates:
|
9
|
-
layout: layout.slim
|
10
|
-
collection: collection.slim
|
11
|
-
album: album.slim
|
12
|
-
photo: photo.slim
|
13
|
-
logging:
|
14
|
-
colorize: true
|
15
|
-
level: 'info'
|
16
|
-
output: ['stdout', 'file']
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -6,7 +6,7 @@ div.album
|
|
6
6
|
- photos.each do |photo|
|
7
7
|
div.album-photo
|
8
8
|
a href=photo.url title=photo.name
|
9
|
-
img src=photo.images.find{|i|i.quality_name=='Low'}.url alt=photo.name
|
9
|
+
img src=photo.images.find{ |i|i.quality_name=='Low' }.url alt=photo.name
|
10
10
|
|
11
11
|
div.sub-albums
|
12
12
|
- albums.each do |album|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/photish/command/base.rb
CHANGED
@@ -17,6 +17,7 @@ module Photish
|
|
17
17
|
:qualities,
|
18
18
|
:templates,
|
19
19
|
:url,
|
20
|
+
:max_workers,
|
20
21
|
to: :config
|
21
22
|
|
22
23
|
def load_all_plugins
|
@@ -39,7 +40,8 @@ module Photish
|
|
39
40
|
def render_whole_site
|
40
41
|
Photish::Render::Site.new(templates,
|
41
42
|
site_dir,
|
42
|
-
output_dir
|
43
|
+
output_dir,
|
44
|
+
max_workers)
|
43
45
|
.all_for(collection)
|
44
46
|
end
|
45
47
|
|
data/lib/photish/command/host.rb
CHANGED
data/lib/photish/command/init.rb
CHANGED
@@ -2,15 +2,36 @@ module Photish
|
|
2
2
|
module Command
|
3
3
|
class Init < Base
|
4
4
|
def run
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
if runtime_config.example
|
6
|
+
init_example
|
7
|
+
else
|
8
|
+
init_barebones
|
9
|
+
end
|
9
10
|
log.info "Photish site initiated successfully"
|
10
11
|
end
|
11
12
|
|
12
13
|
private
|
13
14
|
|
15
|
+
def init_barebones
|
16
|
+
FileUtils.cp_r(config_file, Dir.pwd)
|
17
|
+
FileUtils.cp_r(gemfile_file, Dir.pwd)
|
18
|
+
FileUtils.cp_r(gitignore_file, File.join(Dir.pwd, '.gitignore'))
|
19
|
+
FileUtils.mkdir_p('photos')
|
20
|
+
FileUtils.cp_r(barebones_site_dir, Dir.pwd)
|
21
|
+
end
|
22
|
+
|
23
|
+
def init_example
|
24
|
+
FileUtils.cp_r(config_file, Dir.pwd)
|
25
|
+
FileUtils.cp_r(gemfile_file, Dir.pwd)
|
26
|
+
FileUtils.cp_r(gitignore_file, File.join(Dir.pwd, '.gitignore'))
|
27
|
+
FileUtils.cp_r(example_photo_dir, Dir.pwd)
|
28
|
+
FileUtils.cp_r(example_site_dir, Dir.pwd)
|
29
|
+
end
|
30
|
+
|
31
|
+
def gemfile_file
|
32
|
+
asset_path('Gemfile')
|
33
|
+
end
|
34
|
+
|
14
35
|
def config_file
|
15
36
|
asset_path('config.yml')
|
16
37
|
end
|
@@ -19,12 +40,16 @@ module Photish
|
|
19
40
|
asset_path('gitignore')
|
20
41
|
end
|
21
42
|
|
22
|
-
def
|
23
|
-
asset_path('photos')
|
43
|
+
def example_photo_dir
|
44
|
+
asset_path('example', 'photos')
|
45
|
+
end
|
46
|
+
|
47
|
+
def barebones_site_dir
|
48
|
+
asset_path('barebones', 'site')
|
24
49
|
end
|
25
50
|
|
26
|
-
def
|
27
|
-
asset_path('site')
|
51
|
+
def example_site_dir
|
52
|
+
asset_path('example', 'site')
|
28
53
|
end
|
29
54
|
|
30
55
|
def asset_path(*path)
|
data/lib/photish/log/logger.rb
CHANGED
@@ -52,19 +52,24 @@ module Photish
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def setup_stdout_output
|
55
|
-
Logging.appenders.stdout(
|
55
|
+
stdout_appender = Logging.appenders.stdout(
|
56
56
|
'stdout',
|
57
57
|
layout: Logging.layouts.pattern(
|
58
58
|
pattern: '[%d] %-5l %c: %m\n',
|
59
59
|
color_scheme: 'bright'
|
60
60
|
)
|
61
61
|
)
|
62
|
-
Logging.logger.root.add_appenders(
|
62
|
+
Logging.logger.root.add_appenders(stdout_appender)
|
63
63
|
end
|
64
64
|
|
65
65
|
def setup_file_output
|
66
66
|
FileUtils.mkdir_p('log')
|
67
|
-
file_appender = Logging.appenders.file(
|
67
|
+
file_appender = Logging.appenders.file(
|
68
|
+
'log/photish.log',
|
69
|
+
layout: Logging.layouts.pattern(
|
70
|
+
pattern: '[%d] %-5l %c: %m\n',
|
71
|
+
)
|
72
|
+
)
|
68
73
|
Logging.logger.root.add_appenders(file_appender)
|
69
74
|
end
|
70
75
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Photish
|
2
|
+
module Render
|
3
|
+
class ChangeManifest
|
4
|
+
def initialize(output_dir)
|
5
|
+
@output_dir = output_dir
|
6
|
+
end
|
7
|
+
|
8
|
+
def record(key, file_path = nil)
|
9
|
+
update do |db|
|
10
|
+
db[key] = md5_of_file(file_path || key)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def changed?(key, file_path = nil)
|
15
|
+
md5_of_file(file_path || key) != old_md5_of_file(key)
|
16
|
+
end
|
17
|
+
|
18
|
+
def flush_to_disk
|
19
|
+
File.open(db_file, 'w') { |f| f.write((@db || {}).to_yaml) }
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
attr_reader :output_dir
|
25
|
+
|
26
|
+
def md5_of_file(file_path)
|
27
|
+
Digest::MD5.file(file_path).hexdigest
|
28
|
+
end
|
29
|
+
|
30
|
+
def old_md5_of_file(file_path)
|
31
|
+
read_from_file[file_path]
|
32
|
+
end
|
33
|
+
|
34
|
+
def update
|
35
|
+
db = read_from_file
|
36
|
+
yield(db)
|
37
|
+
write_to_file(db)
|
38
|
+
end
|
39
|
+
|
40
|
+
def read_from_file
|
41
|
+
@db ||= File.exist?(db_file) ? YAML.load_file(db_file) : {}
|
42
|
+
end
|
43
|
+
|
44
|
+
def write_to_file(db)
|
45
|
+
@db = db
|
46
|
+
end
|
47
|
+
|
48
|
+
def db_file
|
49
|
+
File.join(output_dir, '.changes.yml')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -1,29 +1,75 @@
|
|
1
1
|
module Photish
|
2
2
|
module Render
|
3
3
|
class ImageConversion
|
4
|
-
def initialize(output_dir)
|
4
|
+
def initialize(output_dir, max_workers)
|
5
5
|
@output_dir = output_dir
|
6
|
+
@max_workers = max_workers
|
6
7
|
@log = Logging.logger[self]
|
7
8
|
end
|
8
9
|
|
9
10
|
def render(images)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
image_queue = to_queue(images)
|
12
|
+
|
13
|
+
log.info "Rendering #{images.count} across #{max_workers} threads"
|
14
|
+
|
15
|
+
workers = (0...max_workers).map do
|
16
|
+
Thread.new do
|
17
|
+
begin
|
18
|
+
while image = image_queue.pop(true)
|
19
|
+
convert(image) if changed?(output_path(image), image.path)
|
20
|
+
end
|
21
|
+
rescue ThreadError => e
|
22
|
+
log.info "Expected exception, queue is empty #{e.class} \"#{e.message}\" #{e.backtrace.join("\n")}"
|
23
|
+
end
|
19
24
|
end
|
20
25
|
end
|
26
|
+
workers.map(&:join)
|
27
|
+
flush_to_disk
|
21
28
|
end
|
22
29
|
|
23
30
|
private
|
24
31
|
|
25
32
|
attr_reader :output_dir,
|
26
|
-
:log
|
33
|
+
:log,
|
34
|
+
:max_workers
|
35
|
+
|
36
|
+
delegate :record,
|
37
|
+
:changed?,
|
38
|
+
:flush_to_disk,
|
39
|
+
to: :change_manifest
|
40
|
+
|
41
|
+
def to_queue(images)
|
42
|
+
image_queue = Queue.new
|
43
|
+
Array(images).each { |image| image_queue << image }
|
44
|
+
image_queue
|
45
|
+
end
|
46
|
+
|
47
|
+
def convert(image)
|
48
|
+
create_parent_directories(image)
|
49
|
+
convert_with_imagemagick(image)
|
50
|
+
record(output_path(image), image.path)
|
51
|
+
end
|
52
|
+
|
53
|
+
def convert_with_imagemagick(image)
|
54
|
+
MiniMagick::Tool::Convert.new do |convert|
|
55
|
+
convert << image.path
|
56
|
+
convert.merge!(image.quality_params)
|
57
|
+
convert << output_path(image)
|
58
|
+
log.info "Performing image conversion #{convert.command}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def output_path(image)
|
63
|
+
File.join(output_dir, image.url_parts)
|
64
|
+
end
|
65
|
+
|
66
|
+
def create_parent_directories(image)
|
67
|
+
FileUtils.mkdir_p(File.join(output_dir, image.base_url_parts))
|
68
|
+
end
|
69
|
+
|
70
|
+
def change_manifest
|
71
|
+
@change_manifest ||= ChangeManifest.new(output_dir)
|
72
|
+
end
|
27
73
|
end
|
28
74
|
end
|
29
75
|
end
|
data/lib/photish/render/page.rb
CHANGED
@@ -9,6 +9,18 @@ module Photish
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def render(models)
|
12
|
+
return template_missing unless File.exist?(template_file)
|
13
|
+
render_all(models)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
attr_reader :template_file,
|
19
|
+
:layout_file,
|
20
|
+
:output_dir,
|
21
|
+
:log
|
22
|
+
|
23
|
+
def render_all(models)
|
12
24
|
Array(models).each do |model|
|
13
25
|
rendered_model = render_template_and_layout(model)
|
14
26
|
output_model_file = relative_to_output_dir(model.url_parts)
|
@@ -21,12 +33,9 @@ module Photish
|
|
21
33
|
end
|
22
34
|
end
|
23
35
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
:layout_file,
|
28
|
-
:output_dir,
|
29
|
-
:log
|
36
|
+
def template_missing
|
37
|
+
log.info "Template not found #{template_file}, skipping rendering"
|
38
|
+
end
|
30
39
|
|
31
40
|
def relative_to_output_dir(url_parts)
|
32
41
|
File.join(output_dir, url_parts)
|
data/lib/photish/render/site.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module Photish
|
2
2
|
module Render
|
3
3
|
class Site
|
4
|
-
def initialize(templates, site_dir, output_dir)
|
4
|
+
def initialize(templates, site_dir, output_dir, max_workers)
|
5
5
|
@templates = templates
|
6
6
|
@site_dir = site_dir
|
7
7
|
@output_dir = output_dir
|
8
|
+
@max_workers = max_workers
|
8
9
|
end
|
9
10
|
|
10
11
|
def all_for(collection)
|
@@ -21,7 +22,8 @@ module Photish
|
|
21
22
|
|
22
23
|
attr_reader :templates,
|
23
24
|
:site_dir,
|
24
|
-
:output_dir
|
25
|
+
:output_dir,
|
26
|
+
:max_workers
|
25
27
|
|
26
28
|
def move_non_ignored_site_contents
|
27
29
|
FileUtils.mkdir_p(output_dir)
|
@@ -29,7 +31,7 @@ module Photish
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def image_conversion
|
32
|
-
Photish::Render::ImageConversion.new(output_dir)
|
34
|
+
Photish::Render::ImageConversion.new(output_dir, max_workers)
|
33
35
|
end
|
34
36
|
|
35
37
|
def album_template
|
data/lib/photish/version.rb
CHANGED
data/photish.gemspec
CHANGED
@@ -28,13 +28,14 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "tilt", "~> 2.0"
|
29
29
|
spec.add_dependency "mini_magick", "~> 4.3"
|
30
30
|
spec.add_dependency "ruby-filemagic", "~> 0.7"
|
31
|
-
spec.add_dependency "anemone", "~> 0.7"
|
32
31
|
spec.add_dependency "mini_exiftool", "~> 2.5"
|
33
|
-
spec.add_dependency "recursive-open-struct", "~> 0
|
32
|
+
spec.add_dependency "recursive-open-struct", "~> 1.0"
|
34
33
|
spec.add_dependency "nokogiri", "~> 1.6"
|
35
34
|
spec.add_dependency "logging", "~> 2.0"
|
36
35
|
spec.add_dependency "listen", "~> 3.0"
|
36
|
+
spec.add_dependency "facter", "~> 2.4"
|
37
37
|
|
38
|
+
spec.add_development_dependency "anemone", "~> 0.7"
|
38
39
|
spec.add_development_dependency "bundler", "~> 1.10"
|
39
40
|
spec.add_development_dependency "rake", "~> 10.0"
|
40
41
|
spec.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: photish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Lawson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.7'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: anemone
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.7'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0.7'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: mini_exiftool
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +114,14 @@ dependencies:
|
|
128
114
|
requirements:
|
129
115
|
- - "~>"
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0
|
117
|
+
version: '1.0'
|
132
118
|
type: :runtime
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - "~>"
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0
|
124
|
+
version: '1.0'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: nokogiri
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +164,34 @@ dependencies:
|
|
178
164
|
- - "~>"
|
179
165
|
- !ruby/object:Gem::Version
|
180
166
|
version: '3.0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: facter
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '2.4'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '2.4'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: anemone
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0.7'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0.7'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: bundler
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -305,6 +319,7 @@ files:
|
|
305
319
|
- ".gitignore"
|
306
320
|
- ".rspec"
|
307
321
|
- ".rubocop.yml"
|
322
|
+
- ".simplecov"
|
308
323
|
- ".travis.yml"
|
309
324
|
- CODE_OF_CONDUCT.md
|
310
325
|
- Gemfile
|
@@ -316,27 +331,31 @@ files:
|
|
316
331
|
- bin/setup
|
317
332
|
- exe/photish
|
318
333
|
- lib/photish.rb
|
334
|
+
- lib/photish/assets/Gemfile
|
335
|
+
- lib/photish/assets/barebones/site/_templates/collection.slim
|
336
|
+
- lib/photish/assets/barebones/site/_templates/layout.slim
|
337
|
+
- lib/photish/assets/barebones/site/styles/basic.css
|
319
338
|
- lib/photish/assets/config.yml
|
339
|
+
- lib/photish/assets/example/photos/Big Dogs/Tired Dogs.jpg
|
340
|
+
- lib/photish/assets/example/photos/Big Dogs/Winking Dog.jpg
|
341
|
+
- lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Exhausted Dogs.jpg
|
342
|
+
- lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Exhausted Dogs.yml
|
343
|
+
- lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Many Dogs.jpg
|
344
|
+
- lib/photish/assets/example/photos/Small Dogs/Fluffy Dogs/Many Dogs.yml
|
345
|
+
- lib/photish/assets/example/photos/Small Dogs/Sleepy Dog.jpg
|
346
|
+
- lib/photish/assets/example/photos/Small Dogs/Sleepy Dog.yml
|
347
|
+
- lib/photish/assets/example/photos/Small Dogs/Squishy Dogs/Big Ear Dog.jpg
|
348
|
+
- lib/photish/assets/example/site/_plugins/footer_links.rb
|
349
|
+
- lib/photish/assets/example/site/_plugins/tmpdir_deploy.rb
|
350
|
+
- lib/photish/assets/example/site/_plugins/yell_loud.rb
|
351
|
+
- lib/photish/assets/example/site/_templates/album.slim
|
352
|
+
- lib/photish/assets/example/site/_templates/collection.slim
|
353
|
+
- lib/photish/assets/example/site/_templates/layout.slim
|
354
|
+
- lib/photish/assets/example/site/_templates/photo.slim
|
355
|
+
- lib/photish/assets/example/site/custom.html
|
356
|
+
- lib/photish/assets/example/site/images/crumbs.gif
|
357
|
+
- lib/photish/assets/example/site/styles/basic.css
|
320
358
|
- lib/photish/assets/gitignore
|
321
|
-
- lib/photish/assets/photos/Big Dogs/Tired Dogs.jpg
|
322
|
-
- lib/photish/assets/photos/Big Dogs/Winking Dog.jpg
|
323
|
-
- lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Exhausted Dogs.jpg
|
324
|
-
- lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Exhausted Dogs.yml
|
325
|
-
- lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Many Dogs.jpg
|
326
|
-
- lib/photish/assets/photos/Small Dogs/Fluffy Dogs/Many Dogs.yml
|
327
|
-
- lib/photish/assets/photos/Small Dogs/Sleepy Dog.jpg
|
328
|
-
- lib/photish/assets/photos/Small Dogs/Sleepy Dog.yml
|
329
|
-
- lib/photish/assets/photos/Small Dogs/Squishy Dogs/Big Ear Dog.jpg
|
330
|
-
- lib/photish/assets/site/_plugins/footer_links.rb
|
331
|
-
- lib/photish/assets/site/_plugins/tmpdir_deploy.rb
|
332
|
-
- lib/photish/assets/site/_plugins/yell_loud.rb
|
333
|
-
- lib/photish/assets/site/_templates/album.slim
|
334
|
-
- lib/photish/assets/site/_templates/collection.slim
|
335
|
-
- lib/photish/assets/site/_templates/layout.slim
|
336
|
-
- lib/photish/assets/site/_templates/photo.slim
|
337
|
-
- lib/photish/assets/site/custom.html
|
338
|
-
- lib/photish/assets/site/images/crumbs.gif
|
339
|
-
- lib/photish/assets/site/styles/basic.css
|
340
359
|
- lib/photish/cli/interface.rb
|
341
360
|
- lib/photish/command/base.rb
|
342
361
|
- lib/photish/command/deploy.rb
|
@@ -361,6 +380,7 @@ files:
|
|
361
380
|
- lib/photish/plugin/repository.rb
|
362
381
|
- lib/photish/plugin/type.rb
|
363
382
|
- lib/photish/rake/task.rb
|
383
|
+
- lib/photish/render/change_manifest.rb
|
364
384
|
- lib/photish/render/image_conversion.rb
|
365
385
|
- lib/photish/render/page.rb
|
366
386
|
- lib/photish/render/site.rb
|