jekyll-gh-pages 0.0.1 → 0.1.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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODg3OWI0N2VhZTRmNDUwOTdiYmU1ZDRmZTNjY2E4MmVkYTExY2MxMA==
5
- data.tar.gz: !binary |-
6
- ZGMzMjg5ZDZkNzBmMGZhMzRiYmVlMzdhZmJiZWNmMjEwMWVjOTBhNg==
2
+ SHA1:
3
+ metadata.gz: 79d95fcf9b08ce9796ce3e854d7e665fba3992f1
4
+ data.tar.gz: 7fcac1499a983e20bb498f23158155db0ea7dbd6
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- N2JjNDdlMjU0ZDMyODgxYTdmZjJiNWQ2YjMxNzY4N2QwYTdkYTkwYzY0NDY5
10
- ZGFlNGU1MzI1OWU5MGIzZjgzZDdmNjVlMGQ2YWFhZDAwYWI5YTRiMWM5NzA4
11
- MzdmNDViODlkN2UxYTI5Y2JjZDZhODVlMDBmYjI3ZjU5MTkzM2I=
12
- data.tar.gz: !binary |-
13
- NWZhNmZiNjBhMjJlYTlhOTU4YzU1MjMzNTFjN2FkYzc4ZWIyZDNhMWMzOTY0
14
- YzYzNDgwMWU3YWU3MzE0NzIxOTMxYjBmYTMyNmI4NzNjZDdlNGY3YjUxNGNj
15
- MDlhZjIzMzkyNzY4NmFmNmM5N2FmNjEyM2JlZWZlODQ4MTJhMzM=
6
+ metadata.gz: ac8482fe42af739ac8e54f13d091e1d64264ef98fecb44169086201ebfa2e62357a71798f2478b2b649b47f1bd3a2ba2aad1776bad07453860fa101013776a2f
7
+ data.tar.gz: 181b69791ccf3c4bd0b0305b8b2903243c53f6a22253f57f6fe6f8f455007a9be333f20c950242ecbffb328945374b4086a8e111cb76e41a617fb740d46a015b
@@ -1,10 +1,11 @@
1
1
  require 'fileutils'
2
2
 
3
3
  remote_name = ENV.fetch("REMOTE_NAME", "origin")
4
+ branch_name = ENV.fetch("BRANCH_NAME", "gh-pages")
4
5
 
5
6
  PROJECT_ROOT = `git rev-parse --show-toplevel`.strip
6
7
  BUILD_DIR = File.join(PROJECT_ROOT, "build")
7
- GH_PAGES_REF = File.join(BUILD_DIR, ".git/refs/remotes/#{remote_name}/gh-pages")
8
+ GH_PAGES_REF = File.join(BUILD_DIR, ".git/refs/remotes/#{remote_name}/#{branch_name}")
8
9
 
9
10
  directory BUILD_DIR
10
11
 
@@ -20,14 +21,14 @@ file GH_PAGES_REF => BUILD_DIR do
20
21
  sh "git remote add #{remote_name} #{repo_url}"
21
22
  sh "git fetch #{remote_name}"
22
23
 
23
- if `git branch -r` =~ /gh-pages/
24
- sh "git checkout gh-pages"
24
+ if `git branch -r` =~ /#{branch_name}/
25
+ sh "git checkout #{branch_name}"
25
26
  else
26
- sh "git checkout --orphan gh-pages"
27
+ sh "git checkout --orphan #{branch_name}"
27
28
  sh "touch index.html"
28
29
  sh "git add ."
29
- sh "git commit -m 'initial gh-pages commit'"
30
- sh "git push #{remote_name} gh-pages"
30
+ sh "git commit -m 'initial #{branch_name} commit'"
31
+ sh "git push #{remote_name} #{branch_name}"
31
32
  end
32
33
  end
33
34
  end
@@ -43,7 +44,11 @@ end
43
44
  desc "Build static files"
44
45
  task :build do
45
46
  cd PROJECT_ROOT do
46
- sh "bundle exec jekyll build --destination #{BUILD_DIR} --config _config.yml,_config_prod.yml"
47
+ if File.exist?('_config_prod.yml')
48
+ sh "bundle exec jekyll build --destination #{BUILD_DIR} --config _config.yml,_config_prod.yml"
49
+ else
50
+ sh "bundle exec jekyll build --destination #{BUILD_DIR}"
51
+ end
47
52
  end
48
53
  end
49
54
 
@@ -64,6 +69,6 @@ task :deploy => [:build] do
64
69
  else
65
70
  sh "git commit -m \"#{message}\""
66
71
  end
67
- sh "git push #{remote_name} gh-pages"
72
+ sh "git push #{remote_name} #{branch_name}"
68
73
  end
69
74
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllGhPages
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-gh-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Chikazawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-31 00:00:00.000000000 Z
11
+ date: 2014-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>'
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>'
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.6'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Inspired by middleman-gh-pages, Jekyll Github Pages helps deploying Jekyll
@@ -63,9 +63,9 @@ executables: []
63
63
  extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
- - .gitignore
67
- - .rspec
68
- - .travis.yml
66
+ - ".gitignore"
67
+ - ".rspec"
68
+ - ".travis.yml"
69
69
  - Gemfile
70
70
  - Gemfile.lock
71
71
  - LICENSE.txt
@@ -73,7 +73,6 @@ files:
73
73
  - Rakefile
74
74
  - jekyll-gh-pages.gemspec
75
75
  - lib/jekyll-gh-pages.rb
76
- - lib/jekyll-gh-pages/tasks.rake
77
76
  - lib/jekyll-gh-pages/tasks/gh-pages.rake
78
77
  - lib/jekyll-gh-pages/version.rb
79
78
  - spec/jekyll-gh-pages_spec.rb
@@ -88,12 +87,12 @@ require_paths:
88
87
  - lib
89
88
  required_ruby_version: !ruby/object:Gem::Requirement
90
89
  requirements:
91
- - - ! '>='
90
+ - - ">="
92
91
  - !ruby/object:Gem::Version
93
92
  version: '0'
94
93
  required_rubygems_version: !ruby/object:Gem::Requirement
95
94
  requirements:
96
- - - ! '>='
95
+ - - ">="
97
96
  - !ruby/object:Gem::Version
98
97
  version: '0'
99
98
  requirements: []
@@ -105,3 +104,4 @@ summary: Deploy Jekyll sites to Github Pages easily
105
104
  test_files:
106
105
  - spec/jekyll-gh-pages_spec.rb
107
106
  - spec/spec_helper.rb
107
+ has_rdoc:
@@ -1,73 +0,0 @@
1
- require 'fileutils'
2
-
3
- remote_name = ENV.fetch("REMOTE_NAME", "origin")
4
-
5
- PROJECT_ROOT = `git rev-parse --show-toplevel`.strip
6
- BUILD_DIR = File.join(PROJECT_ROOT, "build")
7
- GH_PAGES_REF = File.join(BUILD_DIR, ".git/refs/remotes/#{remote_name}/gh-pages")
8
-
9
- directory BUILD_DIR
10
-
11
- file GH_PAGES_REF => BUILD_DIR do
12
- repo_url = nil
13
-
14
- cd PROJECT_ROOT do
15
- repo_url = `git config --get remote.#{remote_name}.url`.strip
16
- end
17
-
18
- cd BUILD_DIR do
19
- sh "git init"
20
- sh "git remote add #{remote_name} #{repo_url}"
21
- sh "git fetch #{remote_name}"
22
-
23
- if `git branch -r` =~ /gh-pages/
24
- sh "git checkout gh-pages"
25
- else
26
- sh "git checkout --orphan gh-pages"
27
- sh "touch index.html"
28
- sh "git add ."
29
- sh "git commit -m 'initial gh-pages commit'"
30
- sh "git push #{remote_name} gh-pages"
31
- end
32
- end
33
- end
34
-
35
- desc "Prepare for build"
36
- task :prepare => GH_PAGES_REF
37
-
38
- desc "Watch"
39
- task :watch do
40
- sh "bundle exec jekyll serve --watch"
41
- end
42
-
43
- desc "Build static files"
44
- task :build do
45
- cd PROJECT_ROOT do
46
- if File.exist?('_config_prod.yml')
47
- sh "bundle exec jekyll build --destination #{BUILD_DIR} --config _config.yml,_config_prod.yml"
48
- else
49
- sh "bundle exec jekyll build --destination #{BUILD_DIR}"
50
- end
51
- end
52
- end
53
-
54
- desc "Deploy static files to gh-pages branch"
55
- task :deploy => [:build] do
56
- message = nil
57
- suffix = ENV["COMMIT_MESSAGE_SUFFIX"]
58
-
59
- cd PROJECT_ROOT do
60
- head = `git log --pretty="%h" -n1`.strip
61
- message = ["Site updated to #{head}", suffix].compact.join("\n\n")
62
- end
63
-
64
- cd BUILD_DIR do
65
- sh 'git add --all'
66
- if /nothing to commit/ =~ `git status`
67
- puts "No changes to commit."
68
- else
69
- sh "git commit -m \"#{message}\""
70
- end
71
- sh "git push #{remote_name} gh-pages"
72
- end
73
- end