github-release 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +4 -0
  2. data/lib/github-release.rb +14 -4
  3. metadata +4 -4
data/Rakefile CHANGED
@@ -18,3 +18,7 @@ Rake::RDocTask.new do |rd|
18
18
  rd.title = 'github-release'
19
19
  rd.rdoc_files.include("README.md", "lib/**/*.rb")
20
20
  end
21
+
22
+ task :release do
23
+ sh "git release"
24
+ end
@@ -67,9 +67,9 @@ class GithubRelease
67
67
  @repo_name ||= begin
68
68
  case repo_url
69
69
  when %r{^https://github.com/([^/]+/[^/]+)}
70
- return $1.gsub(/\.git$/, '')
70
+ $1.gsub(/\.git$/, '')
71
71
  when %r{^(?:git@)?github\.com:([^/]+/[^/]+)}
72
- return $1.gsub(/\.git$/, '')
72
+ $1.gsub(/\.git$/, '')
73
73
  else
74
74
  raise RuntimeError,
75
75
  "I cannot recognise the format of the push URL for remote #{remote_name} (#{repo_url})"
@@ -91,10 +91,20 @@ class GithubRelease
91
91
  end
92
92
 
93
93
  def github_releases
94
- @github_releases ||= api.repo(repo_name).rels[:releases].get.data.map(&:tag_name)
94
+ @github_releases ||= api_repo_rels[:releases].get.data.map(&:tag_name)
95
95
  log_val(@github_releases)
96
96
  end
97
97
 
98
+ def api_repo
99
+ @api_repo ||= api.repo(repo_name)
100
+ log_val(@api_repo)
101
+ end
102
+
103
+ def api_repo_rels
104
+ @api_repo_rels ||= api_repo.rels
105
+ log_val(@api_repo_rels)
106
+ end
107
+
98
108
  def git_config(item, default = nil)
99
109
  @config_cache ||= {}
100
110
 
@@ -108,7 +118,7 @@ class GithubRelease
108
118
 
109
119
  def create_release(tag)
110
120
  print "Creating a release for #{tag}..."
111
- system("git push #{remote_name} tag #{tag} >/dev/null")
121
+ system("git push #{remote_name} tag #{tag} >/dev/null 2>&1")
112
122
 
113
123
  msg = `git tag -l -n1000 '#{tag}'`
114
124
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-05-06 00:00:00.000000000 Z
12
+ date: 2014-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: octokit
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  segments:
122
122
  - 0
123
- hash: -1742702825423313202
123
+ hash: -3701917324824354022
124
124
  required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  none: false
126
126
  requirements:
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  segments:
131
131
  - 0
132
- hash: -1742702825423313202
132
+ hash: -3701917324824354022
133
133
  requirements: []
134
134
  rubyforge_project:
135
135
  rubygems_version: 1.8.23