mill 0.6 → 0.7.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/bin/mill +6 -0
- data/lib/mill/site.rb +35 -0
- data/lib/mill/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2071162c8fa862cb11079e3f87e3c517ba873e484b322fd2d573af6b813ecbce
|
4
|
+
data.tar.gz: a776c55eb3ff29224b3d1c2b31da8f9cd302c3a45e41e7d951fc8532e1afe701
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b964938ede46f1572de1a58b4b28bdd2d908c09fc5978d3c51efe209c0d3e9efe052c547174b205c1789226cbee780186e85d2a9afda1472ef6273751dae60de
|
7
|
+
data.tar.gz: 9c218bfd77bdb621ddc8fa9d59a8ee4939fa076626899f0c20c7104593951c9c429a25cc05c1a84c569fa0c2c3e0e9ca43dc427a4880d632ea2cfad8b9f78597
|
data/bin/mill
CHANGED
data/lib/mill/site.rb
CHANGED
@@ -4,6 +4,7 @@ module Mill
|
|
4
4
|
|
5
5
|
attr_accessor :input_dir
|
6
6
|
attr_accessor :output_dir
|
7
|
+
attr_accessor :site_rsync
|
7
8
|
attr_accessor :site_title
|
8
9
|
attr_accessor :site_uri
|
9
10
|
attr_accessor :site_email
|
@@ -27,6 +28,7 @@ module Mill
|
|
27
28
|
|
28
29
|
def initialize(input_dir: 'content',
|
29
30
|
output_dir: 'public_html',
|
31
|
+
site_rsync: nil,
|
30
32
|
site_title: nil,
|
31
33
|
site_uri: 'http://localhost',
|
32
34
|
site_email: nil,
|
@@ -45,6 +47,7 @@ module Mill
|
|
45
47
|
|
46
48
|
@input_dir = Path.new(input_dir)
|
47
49
|
@output_dir = Path.new(output_dir)
|
50
|
+
@site_rsync = site_rsync
|
48
51
|
@site_title = site_title
|
49
52
|
@site_uri = Addressable::URI.parse(site_uri)
|
50
53
|
@site_email = Addressable::URI.parse(site_email) if site_email
|
@@ -211,6 +214,38 @@ module Mill
|
|
211
214
|
checker = WebChecker.new(site_uri: @site_uri, site_dir: @output_dir)
|
212
215
|
end
|
213
216
|
|
217
|
+
def snapshot
|
218
|
+
@output_dir.chdir do
|
219
|
+
system('git',
|
220
|
+
'add',
|
221
|
+
'.')
|
222
|
+
system('git',
|
223
|
+
'commit',
|
224
|
+
'-a',
|
225
|
+
'-m',
|
226
|
+
'Update.')
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
def diff
|
231
|
+
@output_dir.chdir do
|
232
|
+
system('git',
|
233
|
+
'diff')
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
def upload
|
238
|
+
raise "site_rsync not defined" unless @site_rsync
|
239
|
+
system('rsync',
|
240
|
+
'--progress',
|
241
|
+
'--verbose',
|
242
|
+
'--archive',
|
243
|
+
'--exclude=.git',
|
244
|
+
'--delete-after',
|
245
|
+
@output_dir.to_s,
|
246
|
+
@site_rsync)
|
247
|
+
end
|
248
|
+
|
214
249
|
def on_each_resource(&block)
|
215
250
|
@resources.each do |resource|
|
216
251
|
old_uri = resource.uri.dup
|
data/lib/mill/version.rb
CHANGED