jekyll-staging 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.markdown +3 -3
- data/bin/stage +33 -3
- data/jekyll-staging.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d74d3f0315b7ebb1a323c30803583d65e7d86350
|
4
|
+
data.tar.gz: 376e454356e4352d0940aba35412539e77a82d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24c7e96adf27cbc5e50b78ebb33818cb8b2bc987caeefc858176aeda19386815e3767e69fe8f03a49ee7f4906c18f129c697fe50d8ec2ad03d8aede12409b153
|
7
|
+
data.tar.gz: a3e1e1c4c019c7db2a2e41324bd3dfa69ea26fc5d7c4a70bdefc57f362c113c6285fa46ec67eb83176f34542d79f7fa10bc8913c2a2c17c068d81f8f631b14eb
|
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -46,11 +46,11 @@ Basically:
|
|
46
46
|
|
47
47
|
You don't need to specify full paths, because it'll be looking in your drafts folder anyway. Feel free to use partial filenames, and shell glob patterns. If there's more than one match, it'll use the first one, and it'll output the full list of matches as well as the filename it chose.
|
48
48
|
|
49
|
-
Let's say you had a draft whose filename was `
|
49
|
+
Let's say you had a draft whose filename was `my-new-iphone.markdown`. A typical workflow would be as follows. It assumes you're already in your Jekyll site's root directory.
|
50
50
|
|
51
51
|
1. **`stage iphone`** (stage the draft for Jekyll)
|
52
52
|
|
53
|
-
2. **`jekyll serve`** (start the built-in web server
|
53
|
+
2. **`jekyll serve`** (start the built-in web server)
|
54
54
|
|
55
55
|
3. Edit your post as you see fit, and view it in your browser. When you're done, kill Jekyll's web server.
|
56
56
|
|
@@ -61,7 +61,7 @@ You can then decide whether to publish the post, and build and deploy your site
|
|
61
61
|
|
62
62
|
## Where does it temporarily put my other posts?
|
63
63
|
|
64
|
-
In a directory called "`_stash`", in your Jekyll site's local root directory. The directory will be created if necessary.
|
64
|
+
In a directory called "`_stash`", in your Jekyll site's local root directory. The directory will be created if necessary.
|
65
65
|
|
66
66
|
|
67
67
|
## Should I run it on my server?
|
data/bin/stage
CHANGED
@@ -239,10 +239,27 @@ def unstage_file(the_filename_glob)
|
|
239
239
|
end
|
240
240
|
|
241
241
|
|
242
|
+
def staging_in_progress()
|
243
|
+
# Try to determine if file(s) are already staged.
|
244
|
+
|
245
|
+
in_progress = false
|
246
|
+
if directory_exists($stash_dir)
|
247
|
+
Dir.chdir($stash_dir)
|
248
|
+
matches = Dir.glob("*.#{$file_extension}")
|
249
|
+
if matches.count > 0
|
250
|
+
# Posts are in the stash directory. We're probably staging.
|
251
|
+
in_progress = true
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
return in_progress
|
256
|
+
end
|
257
|
+
|
258
|
+
|
242
259
|
def show_help()
|
243
|
-
puts "
|
244
|
-
puts "
|
245
|
-
puts "
|
260
|
+
puts "`stage FILENAME_GLOB` stages the first matching draft."
|
261
|
+
puts "`stage #{$unstage_flag}` unstages the first staged post."
|
262
|
+
puts "`stage #{$unstage_flag} FILENAME_GLOB` unstages the first matching staged post."
|
246
263
|
end
|
247
264
|
|
248
265
|
|
@@ -310,6 +327,19 @@ if directory_exists($stash_dir) == false
|
|
310
327
|
end
|
311
328
|
end
|
312
329
|
|
330
|
+
# Check whether we should proceed.
|
331
|
+
if !unstage and staging_in_progress()
|
332
|
+
puts "It looks like files are already staged. You should unstage them first (stage #{$unstage_flag})."
|
333
|
+
puts "Do you want to proceed anyway? (y/n) [n]"
|
334
|
+
proceed = STDIN.gets.strip.downcase.slice(0,1)
|
335
|
+
if !proceed or proceed != "y"
|
336
|
+
puts "Aborting."
|
337
|
+
exit
|
338
|
+
else
|
339
|
+
puts "Proceeding anyway."
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
313
343
|
# Get the job done. It's a bit anticlimactic, really.
|
314
344
|
if unstage
|
315
345
|
unstage_file(filename_glob)
|
data/jekyll-staging.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-staging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Gemmell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|