github_pages_rake_tasks 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 6f5181c4939021a22323f28d9a43a510b258022aaddbee9d8964d18761a77861
4
- data.tar.gz: 9940d4e543957c847f8f3fe17adb4410e948f4de06977c50334e18b5d8512f3c
3
+ metadata.gz: 61d5c837a9f07564a26362d8dd182c44556ce40fdf2aed4b47142a8ab09c897c
4
+ data.tar.gz: a20eaccf3e952cc502b5deaecdfaf9cef387a19d0b4dd78647a34a51e29f1f1f
5
5
  SHA512:
6
- metadata.gz: c1f66b20a8ec1c0a51d6c8aa5ae4121122b3d3c99a8425293bc8921718e3b1e7dc1c76d93694d8f9c8c78d5d94e3b69f7db8bba02af2aea79772d6dd870e53a8
7
- data.tar.gz: 3bd71f7b52b01ffcedd1befdd9ece9f9d91540be3a0ac7163ea8bcc589eac38c7bbe1d3924122e6bc40620a4123ebfaa17e0e282743ab85b7b10d0143aed1b88
6
+ metadata.gz: 6eb3c7ed5d02e97f41d713796602f1ca5bee2bd4490f058c0e7b3ba4bf7271caf5401e47ff23f18c752af860964b7d934dbf9b101d0a91de1161ff6acad33181
7
+ data.tar.gz: e72f830a3ceb8baab32ec41f186b277589ad9a9d6e2977625947eb86e5e885771200597838dd01ac1e57f89ee3fd95ea3561f4586cc2d597cc5036d72398a512
@@ -8,7 +8,7 @@ before_install: gem install bundler -v 2.0.1
8
8
  deploy:
9
9
  - provider: pages
10
10
  skip_cleanup: true
11
- github_token: "$GITHUB_TOKEN"
11
+ github_token: $GITHUB_TOKEN
12
12
  local_dir: doc
13
13
  verbose: true
14
14
  on:
@@ -35,7 +35,7 @@ module GithubPagesRakeTasks
35
35
  class Interface
36
36
  extend Forwardable
37
37
 
38
- def_delegators :@file_utils, :chdir, :rm_rf, :cp_r, :sh, :verbose
38
+ def_delegators :@file_utils, :chdir, :cp_r, :mkdir_p, :rm_rf, :sh, :verbose
39
39
  def_delegators :@dir, :mktmpdir
40
40
  def_delegator :@dir, :exist?, :dir_exist?
41
41
  def_delegators :@file, :expand_path
@@ -97,9 +97,12 @@ module GithubPagesRakeTasks
97
97
 
98
98
  def publish
99
99
  interface.verbose(verbose) do
100
- initialize_staging_dir
101
- copy_doc_dir_to_staging_dir
102
- commit_and_push_staging_dir
100
+ interface.mkdir_p(staging_dir)
101
+ interface.chdir(staging_dir) do
102
+ initialize_staging_dir
103
+ copy_doc_dir_to_staging_dir
104
+ commit_and_push_staging_dir
105
+ end
103
106
  clean_staging_dir
104
107
  end
105
108
  end
@@ -126,15 +129,8 @@ module GithubPagesRakeTasks
126
129
  end
127
130
 
128
131
  def initialize_git
129
- interface.chdir staging_dir do
130
- interface.sh('git init')
131
- interface.sh("git remote add '#{remote_name}' '#{repo_url}'")
132
- end
133
- end
134
-
135
- def initialize_staging_repo
136
- interface.mkdir_p(staging_dir) unless interface.dir_exist?(staging_dir)
137
- initialize_git
132
+ interface.sh('git init')
133
+ interface.sh("git remote add '#{remote_name}' '#{repo_url}'")
138
134
  end
139
135
 
140
136
  # Creates `staging_dir` (if needed), clones the remote repository to it, and checks
@@ -143,7 +139,7 @@ module GithubPagesRakeTasks
143
139
  # Finally, removes all files using git rm
144
140
  #
145
141
  def initialize_staging_dir
146
- initialize_staging_repo
142
+ initialize_git
147
143
  if remote_branch_exists?
148
144
  checkout_existing_branch
149
145
  else
@@ -165,10 +161,8 @@ module GithubPagesRakeTasks
165
161
  end
166
162
 
167
163
  def remove_staging_files
168
- interface.chdir staging_dir do
169
- interface.sh('git rm -r .') do
170
- # ignore failure
171
- end
164
+ interface.sh('git rm -r .') do
165
+ # ignore failure
172
166
  end
173
167
  end
174
168
 
@@ -177,10 +171,9 @@ module GithubPagesRakeTasks
177
171
  end
178
172
 
179
173
  def commit_and_push_staging_dir
180
- interface.chdir staging_dir do
181
- interface.sh('git add .')
182
- interface.sh("git commit -m '#{commit_message}'")
183
- interface.sh("git push --set-upstream #{remote_name} #{branch_name}")
174
+ interface.sh('git add .')
175
+ interface.sh("git commit -m '#{commit_message}'") do |commit_successful, _process_status|
176
+ interface.sh("git push --set-upstream #{remote_name} #{branch_name}") if commit_successful
184
177
  end
185
178
  end
186
179
  end
@@ -3,5 +3,5 @@
3
3
 
4
4
  module GithubPagesRakeTasks
5
5
  # Version of this module
6
- VERSION = '0.1.3'
6
+ VERSION = '0.1.4'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_pages_rake_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Couball