lager 0.2.0.5 → 0.2.0.6

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 +18 -125
  3. metadata +8 -8
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0.5
1
+ 0.2.0.6
data/rakefile.rb CHANGED
@@ -1,131 +1,24 @@
1
- require 'rubygems/package_task'
1
+ require 'buildar/tasks'
2
2
  require 'rake/testtask'
3
3
 
4
- Rake::TestTask.new :test do |t|
5
- t.pattern = 'test/*.rb'
6
- end
7
-
8
- PROJECT_ROOT = File.dirname(__FILE__)
9
- PROJECT_NAME = File.split(PROJECT_ROOT).last
10
- VERSION_FILE = File.join(PROJECT_ROOT, 'VERSION')
11
- MANIFEST_FILE = File.join(PROJECT_ROOT, 'MANIFEST.txt')
12
-
13
- def version
14
- File.read(VERSION_FILE).chomp
15
- end
16
-
17
- task :version do
18
- puts "#{PROJECT_NAME} #{version}"
19
- end
4
+ Buildar.conf(__FILE__) do |b|
5
+ b.name = 'lager'
6
+ b.use_version_file = true
7
+ b.version_filename = 'VERSION'
8
+ b.use_manifest_file = true
9
+ b.manifest_filename = 'MANIFEST.txt'
10
+ b.use_git = true
11
+ b.publish[:rubygems] = true
12
+ b.gemspec.summary = "Sane class-level logging"
13
+ b.gemspec.description = "Should you use it? Yes."
14
+ b.gemspec.authors = ["Rick Hull"]
15
+ b.gemspec.homepage = "http://github.com/rickhull/lager"
16
+ b.gemspec.licenses = ['LGPL']
20
17
 
21
- task :tag => [:test] do
22
- tagname = "v#{version}"
23
- sh "git tag -a #{tagname} -m 'auto-tagged #{tagname} by Rake'"
24
- sh "git push origin --tags"
18
+ b.gemspec.add_development_dependency "minitest", [">= 0"]
19
+ b.gemspec.add_development_dependency "buildar", ["~> 1.2"]
25
20
  end
26
21
 
27
- def manifest
28
- File.readlines(MANIFEST_FILE).map { |line| line.chomp }
29
- end
30
-
31
- task :manifest do
32
- puts manifest.join("\n")
33
- end
34
-
35
- task :build => [:test, :bump_build] do
36
- spec = Gem::Specification.new do |s|
37
- # Static assignments
38
- s.name = PROJECT_NAME
39
- s.summary = "Sane class-level logging"
40
- s.description = "Should you use it? Yes."
41
- s.authors = ["Rick Hull"]
42
- s.email = "rick@cloudscaling.com"
43
- s.homepage = "http://github.com/rickhull/lager"
44
- s.licenses = ['LGPL']
45
-
46
- # Dynamic assignments
47
- s.files = manifest
48
- s.version = version
49
- s.date = Time.now.strftime("%Y-%m-%d")
50
-
51
- # s.add_runtime_dependency "rest-client", ["~> 1"]
52
- # s.add_runtime_dependency "json", ["~> 1"]
53
- s.add_development_dependency "minitest", [">= 0"]
54
- s.add_development_dependency "rake", [">= 0"]
55
- end
56
-
57
- # we're definining the task at runtime, rather than requiretime
58
- # so that the gemspec will reflect any version bumping since requiretime
59
- #
60
- Gem::PackageTask.new(spec).define
61
- Rake::Task["package"].invoke
62
- end
63
-
64
- # e.g. bump(:minor, '1.2.3') #=> '1.3.0'
65
- # only works for integers delimited by periods (dots)
66
- #
67
- def bump(position, version)
68
- pos = [:major, :minor, :patch, :build].index(position) || position
69
- places = version.split('.')
70
- raise "bad position: #{pos} (for version #{version})" unless places[pos]
71
- places.map.with_index { |place, i|
72
- if i < pos
73
- place
74
- elsif i == pos
75
- place.to_i + 1
76
- else
77
- 0
78
- end
79
- }.join('.')
80
- end
81
-
82
- def write_version new_version
83
- File.open(VERSION_FILE, 'w') { |f| f.write(new_version) }
84
- end
85
-
86
- [:major, :minor, :patch, :build].each { |v|
87
- task "bump_#{v}" do
88
- old_version = version
89
- new_version = bump(v, old_version)
90
- puts "bumping #{old_version} to #{new_version}"
91
- write_version new_version
92
- sh "git add VERSION"
93
- sh "git commit -m 'rake bump_#{v}'"
94
- end
95
- }
96
- task :bump => [:bump_patch]
97
-
98
- task :verify_publish_credentials do
99
- creds = '~/.gem/credentials'
100
- fp = File.expand_path(creds)
101
- raise "#{creds} does not exist" unless File.exists?(fp)
102
- raise "can't read #{creds}" unless File.readable?(fp)
103
- end
104
-
105
- task :publish => [:verify_publish_credentials] do
106
- fragment = "-#{version}.gem"
107
- pkg_dir = File.join(PROJECT_ROOT, 'pkg')
108
- Dir.chdir(pkg_dir) {
109
- candidates = Dir.glob "*#{fragment}"
110
- case candidates.length
111
- when 0
112
- raise "could not find .gem matching #{fragment}"
113
- when 1
114
- sh "gem push #{candidates.first}"
115
- else
116
- raise "multiple candidates found matching #{fragment}"
117
- end
118
- }
119
- end
120
-
121
- task :gitpush do
122
- # may prompt
123
- sh "git push origin"
124
- # this kills the automation
125
- # consider a timeout?
22
+ Rake::TestTask.new :test do |t|
23
+ t.pattern = 'test/*.rb'
126
24
  end
127
-
128
- task :release => [:build, :tag, :publish, :gitpush]
129
- task :release_patch => [:bump_patch, :release]
130
- task :release_minor => [:bump_minor, :release]
131
- task :release_major => [:bump_major, :release]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.5
4
+ version: 0.2.0.6
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: 2013-07-05 00:00:00.000000000 Z
12
+ date: 2013-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -28,23 +28,23 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: rake
31
+ name: buildar
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: '1.2'
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: '1.2'
46
46
  description: Should you use it? Yes.
47
- email: rick@cloudscaling.com
47
+ email:
48
48
  executables: []
49
49
  extensions: []
50
50
  extra_rdoc_files: []