Class: Middleman::GhPages::Deploy
- Inherits:
-
Object
- Object
- Middleman::GhPages::Deploy
- Defined in:
- lib/middleman/gh_pages/deploy.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Deploy
constructor
A new instance of Deploy.
Constructor Details
#initialize(options = {}) ⇒ Deploy
Returns a new instance of Deploy.
4 5 6 7 8 |
# File 'lib/middleman/gh_pages/deploy.rb', line 4 def initialize( = {}) @build_dir = .fetch(:build_dir) @remote = .fetch(:remote) @environment = .fetch(:environment) end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/middleman/gh_pages/deploy.rb', line 10 def call bundle.exec 'middleman', 'build', '-e', @environment Dir.chdir(@build_dir) do git.init git.remote 'add', 'origin', @remote git.add '.' git.commit '-m', "Deploy on #{Time.now}" git.checkout '-b', 'gh-pages' git.push '-f', 'origin', 'gh-pages' end end |