buildar 0.0.4.1 → 0.1.0.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/VERSION +1 -1
  2. data/rakefile.rb +36 -23
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4.1
1
+ 0.1.0.1
@@ -10,6 +10,11 @@ PROJECT_ROOT = File.dirname(__FILE__)
10
10
  PROJECT_NAME = File.split(PROJECT_ROOT).last
11
11
  VERSION_FILE = File.join(PROJECT_ROOT, 'VERSION')
12
12
  MANIFEST_FILE = File.join(PROJECT_ROOT, 'MANIFEST.txt')
13
+ USE_GIT = true
14
+ GIT_COMMIT_VERSION = true # commit version bump automatically
15
+ PUBLISH = {
16
+ rubygems: true, # publish .gem to http://rubygems.org/
17
+ }
13
18
 
14
19
  def version
15
20
  File.read(VERSION_FILE).chomp
@@ -20,9 +25,11 @@ task :version do
20
25
  end
21
26
 
22
27
  task :tag => [:test] do
23
- tagname = "v#{version}"
24
- sh "git tag -a #{tagname} -m 'auto-tagged #{tagname} by Rake'"
25
- sh "git push origin --tags"
28
+ if USE_GIT
29
+ tagname = "v#{version}"
30
+ sh "git tag -a #{tagname} -m 'auto-tagged #{tagname} by Rake'"
31
+ sh "git push origin --tags"
32
+ end
26
33
  end
27
34
 
28
35
  def manifest
@@ -90,38 +97,44 @@ end
90
97
  new_version = bump(v, old_version)
91
98
  puts "bumping #{old_version} to #{new_version}"
92
99
  write_version new_version
93
- sh "git add VERSION"
94
- sh "git commit -m 'rake bump_#{v}'"
100
+ if USE_GIT and GIT_COMMIT_VERSION
101
+ sh "git add VERSION"
102
+ sh "git commit -m 'rake bump_#{v}'"
103
+ end
95
104
  end
96
105
  }
97
106
  task :bump => [:bump_patch]
98
107
 
99
108
  task :verify_publish_credentials do
100
- creds = '~/.gem/credentials'
101
- fp = File.expand_path(creds)
102
- raise "#{creds} does not exist" unless File.exists?(fp)
103
- raise "can't read #{creds}" unless File.readable?(fp)
109
+ if PUBLISH[:rubygems]
110
+ creds = '~/.gem/credentials'
111
+ fp = File.expand_path(creds)
112
+ raise "#{creds} does not exist" unless File.exists?(fp)
113
+ raise "can't read #{creds}" unless File.readable?(fp)
114
+ end
104
115
  end
105
116
 
106
117
  task :publish => [:verify_publish_credentials] do
107
- fragment = "-#{version}.gem"
108
- pkg_dir = File.join(PROJECT_ROOT, 'pkg')
109
- Dir.chdir(pkg_dir) {
110
- candidates = Dir.glob "*#{fragment}"
111
- case candidates.length
112
- when 0
113
- raise "could not find .gem matching #{fragment}"
114
- when 1
115
- sh "gem push #{candidates.first}"
116
- else
117
- raise "multiple candidates found matching #{fragment}"
118
- end
119
- }
118
+ if PUBLISH[:rubygems]
119
+ fragment = "-#{version}.gem"
120
+ pkg_dir = File.join(PROJECT_ROOT, 'pkg')
121
+ Dir.chdir(pkg_dir) {
122
+ candidates = Dir.glob "*#{fragment}"
123
+ case candidates.length
124
+ when 0
125
+ raise "could not find .gem matching #{fragment}"
126
+ when 1
127
+ sh "gem push #{candidates.first}"
128
+ else
129
+ raise "multiple candidates found matching #{fragment}"
130
+ end
131
+ }
132
+ end
120
133
  end
121
134
 
122
135
  task :gitpush do
123
136
  # may prompt
124
- sh "git push origin"
137
+ sh "git push origin" if USE_GIT
125
138
  # this kills the automation
126
139
  # use key-based auth?
127
140
  # consider a timeout?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.1
4
+ version: 0.1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: