jekyll-staging 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6020ad38797b56d852844f8db29899e0fbd9ac34
4
- data.tar.gz: dde6e55d3ebe572ea2051df4c47ed24a14a85379
3
+ metadata.gz: c23f76237ed79c27e54b62139f2f165952b65ba3
4
+ data.tar.gz: 7f6c1370ae57a449e2784d67a100abf515ecce88
5
5
  SHA512:
6
- metadata.gz: f0a937a46f74e61e9129eef773355a6e061ad5d1c8e0f79ea5e509612a2744aefc7976e8d6c4743c2a98e494823c96b0d8cd815843902f2cacf56cd4714986a4
7
- data.tar.gz: bc5cb0143fa852b69340b80839879e26a9a14cb98dbf7654623dcf1d5f6a2dc3a3b7e11436feb505499ef4a64e2a9d1ba255bbb5bb38c512258ade0baa3ff91a
6
+ metadata.gz: 1234f61161c72ee84cd600b78f83bd1122e991f41aa00c30d63f0344ddf1cd67eda3d62dcae166c8ce38e47bfa730b965e902d4f9e839fc453394e6fa0a289d3
7
+ data.tar.gz: 32a38912fe54a5925a36c7e4e5637d1d33660b546435260226da0bef9598a6980d8bac926644d1fdb6c5a6ed20a1f406f5782497370e75a9318523b55188a96a
data/Gemfile.lock ADDED
@@ -0,0 +1,17 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jekyll-staging (1.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.4.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.7)
16
+ jekyll-staging!
17
+ rake (~> 10.0)
data/README.markdown CHANGED
@@ -15,7 +15,7 @@ All you need is Ruby. Grab it by running `gem install jekyll-staging` in your te
15
15
 
16
16
  ## What does it do?
17
17
 
18
- This script is for people who:
18
+ This gem is for people who:
19
19
 
20
20
  1. Use [Jekyll](http://jekyllrb.com) to build their static sites.
21
21
 
@@ -23,7 +23,7 @@ This script is for people who:
23
23
 
24
24
  3. Like to work on posts using Jekyll's built-in web server.
25
25
 
26
- If you have a lot of posts, Jekyll's rebuild process can take a while, so it can be handy to temporarily move all of your existing posts aside while you work on a draft. That's what this script does.
26
+ If you have a lot of posts, Jekyll's rebuild process can take a while, so it can be handy to temporarily move all of your existing posts aside while you work on a draft. That's what this gem does.
27
27
 
28
28
  It lets you specify a given draft post, and it'll move it into Jekyll's folder structure (appropriately prefixing its filename with today's date). Then, it moves all other posts aside temporarily. That way, Jekyll's build and regeneration process will be super-fast while you're working on the draft.
29
29
 
@@ -34,9 +34,9 @@ Note: It's assumed that your drafts' filenames _don't_ already have date-prefixe
34
34
 
35
35
  ## How do I use it?
36
36
 
37
- First, specify the two appropriate paths in the script's Configuration block, and check that the post file-extension ("markdown" by default) matches your posts and drafts.
37
+ Run the gem without any arguments to see usage instructions. Be sure to run the gem from your Jekyll site's root directory.
38
38
 
39
- Then, run the script without any arguments to see usage instructions.
39
+ On the first run (per site), you'll be asked three configuration questions. The appropriate options will be stored in a `.jekyll-stagingrc` file in your site's root.
40
40
 
41
41
  Basically:
42
42
 
data/bin/stage CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Staging/unstaging script for Jekyll blog posts.
3
+ # Staging/unstaging gem for Jekyll blog posts.
4
4
  #
5
5
  # by Matt Gemmell
6
6
  #
@@ -8,7 +8,7 @@
8
8
  # Twitter: http://twitter.com/mattgemmell
9
9
 
10
10
 
11
- # This script moves a specified draft post into Jekyll's folder structure,
11
+ # This gem moves a specified draft post into Jekyll's folder structure,
12
12
  # and temporarily stashes all other posts so the site will build quickly.
13
13
  #
14
14
  # This is for people who keep their drafts outside of Jekyll's folder structure.
@@ -21,7 +21,9 @@
21
21
  # Requirements: just Ruby itself.
22
22
 
23
23
 
24
- # Usage: Run the script with no arguments to see usage instructions.
24
+ # Usage: Run the stage command with no arguments to see usage instructions.
25
+ # Note: Run the command from your Jekyll site's root directory.
26
+ # You'll be asked three configuration questions (for each site) on the first run.
25
27
 
26
28
 
27
29
  # License: CC Attribution-ShareAlike
@@ -35,7 +37,16 @@
35
37
  # Load in configuration file, or ask and populate.
36
38
  def read_or_ask_for_configuration
37
39
  require 'yaml'
38
- conf_file = File.join(ENV['HOME'], '.jekyll-stagingrc')
40
+
41
+ # Check we're in a Jekyll root directory.
42
+ jekyll_conf_file = File.join(Dir.pwd, '_config.yml')
43
+ if !File.exist?(jekyll_conf_file)
44
+ puts "Please run the stage command from your Jekyll site's root directory."
45
+ exit
46
+ end
47
+
48
+ # Look for config file in the current working directory.
49
+ conf_file = File.join(Dir.pwd, '.jekyll-stagingrc')
39
50
  if File.exist?(conf_file)
40
51
  YAML.load_file(conf_file)
41
52
  else
@@ -239,7 +250,7 @@ end
239
250
 
240
251
 
241
252
  # Handle input
242
- $unstage_flag = "-u" # flag passed to the script to request unstaging
253
+ $unstage_flag = "-u" # flag passed to the command to request unstaging
243
254
  filename_glob = nil
244
255
  unstage = false
245
256
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-staging"
5
- spec.version = "1.0.0"
5
+ spec.version = "1.0.1"
6
6
  spec.authors = ["Matt Gemmell"]
7
7
  spec.email = ["matt@mattgemmell.com"]
8
8
  spec.summary = %q{Stage and unstage draft posts in Jekyll.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-staging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Gemmell
@@ -48,6 +48,7 @@ extra_rdoc_files: []
48
48
  files:
49
49
  - .gitignore
50
50
  - Gemfile
51
+ - Gemfile.lock
51
52
  - LICENSE.markdown
52
53
  - README.markdown
53
54
  - Rakefile