gitgit 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. data/lib/gitgit/version.rb +1 -1
  2. data/lib/gitgit.rb +17 -0
  3. metadata +2 -2
@@ -1,3 +1,3 @@
1
1
  module Gitgit
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/gitgit.rb CHANGED
@@ -63,6 +63,23 @@ module Gitgit
63
63
  say "There was a problem pushing your work to github. :(", :red
64
64
  end
65
65
 
66
+ desc "publish", "Publish your site to GitHub pages"
67
+ def publish
68
+ g = get_git_repo || return
69
+
70
+ if g.remotes.empty?
71
+ say "Can't push as this repository has no remotes!", :red
72
+ say ""
73
+ say "You need to set up a repository on github and follow the instructions to connect it to this folder on your laptop."
74
+ return
75
+ end
76
+
77
+ g.push(g.remote('origin'), 'master:gh-pages', force: true)
78
+
79
+ say "Site pushed to the gh-pages branch on github!", :green
80
+ end
81
+
82
+
66
83
  no_commands do
67
84
  def show_status(g)
68
85
  if g.ls_files.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitgit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-25 00:00:00.000000000 Z
12
+ date: 2014-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor