github_heroku_deployer 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  repos
19
+ .DS_Store
data/README.md CHANGED
@@ -5,7 +5,7 @@ Ruby gem to deploy public and private Github repos to Heroku
5
5
 
6
6
  ## Current Version
7
7
 
8
- 0.1.9
8
+ 0.2.0
9
9
 
10
10
 
11
11
  ## Requirements
@@ -73,6 +73,12 @@ Override defaults:
73
73
  GithubHerokuDeployer.deploy(github_repo: github_repo)
74
74
  ```
75
75
 
76
+ Manipulate Repo:
77
+
78
+ ```ruby
79
+ GithubHerokuDeployer.deploy(github_repo: github_repo) { |repo| repo.add "/path/to/file" }
80
+ ```
81
+
76
82
 
77
83
  ## Authors
78
84
 
@@ -12,10 +12,11 @@ module GithubHerokuDeployer
12
12
  @repo_dir = options[:repo_dir]
13
13
  end
14
14
 
15
- def push_app_to_heroku(remote="heroku", branch="master")
15
+ def push_app_to_heroku(remote="heroku", branch="master", &block)
16
16
  wrapper = ssh_wrapper
17
17
  run "cd #{repo.dir}; git remote rm #{remote}" if repo.remote(remote).url
18
18
  repo.add_remote(remote, @heroku_repo)
19
+ yield(repo) if block_given?
19
20
  @logger.info "deploying #{repo.dir} to #{repo.remote(remote).url} from branch #{branch}"
20
21
  run "cd #{repo.dir}; env #{wrapper.git_ssh} git push -f #{remote} #{branch}"
21
22
  ensure
@@ -1,3 +1,3 @@
1
1
  module GithubHerokuDeployer
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -36,11 +36,11 @@ module GithubHerokuDeployer
36
36
  yield(configuration)
37
37
  end
38
38
 
39
- def deploy(options={})
39
+ def deploy(options={}, &block)
40
40
  options = configuration.merge(options)
41
41
  validate_options(options)
42
42
  heroku_find_or_create_app(options)
43
- git_push_app_to_heroku(options)
43
+ git_push_app_to_heroku(options, &block)
44
44
  true
45
45
  end
46
46
 
@@ -82,8 +82,9 @@ module GithubHerokuDeployer
82
82
  Heroku.new(options).find_or_create_app
83
83
  end
84
84
 
85
- def git_push_app_to_heroku(options)
86
- Git.new(options).push_app_to_heroku
85
+ def git_push_app_to_heroku(options, &block)
86
+ repo = Git.new(options)
87
+ repo.push_app_to_heroku(&block)
87
88
  end
88
89
  end # class << self
89
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_heroku_deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
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: 2012-11-27 00:00:00.000000000 Z
12
+ date: 2012-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: heroku-api
@@ -160,18 +160,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  - - ! '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
- segments:
164
- - 0
165
- hash: 560189725800821505
166
163
  required_rubygems_version: !ruby/object:Gem::Requirement
167
164
  none: false
168
165
  requirements:
169
166
  - - ! '>='
170
167
  - !ruby/object:Gem::Version
171
168
  version: '0'
172
- segments:
173
- - 0
174
- hash: 560189725800821505
175
169
  requirements: []
176
170
  rubyforge_project:
177
171
  rubygems_version: 1.8.24