rim 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.0 New tasks: git:tag and check_version
2
+
3
+ 1.0.2 Fix typo in email
4
+
1
5
  1.0.1 First working public release
2
6
 
3
7
  1.0.0 First public release (yanked, because defect)
@@ -0,0 +1,19 @@
1
+ # -- encoding: utf-8 --
2
+ require 'rim/release'
3
+ Rim.after_setup do
4
+ changelog = filelist(/^Changelog/).first
5
+ desc "Check version in #{changelog} with Rim#version."
6
+ task :check_version do
7
+ line = File.open(changelog) do |f|
8
+ f.readline
9
+ end
10
+ if line =~ /^(\d+\.\d+(?:\.\d+)+)/
11
+ if $1 != version
12
+ raise "Version error (#{changelog}: #$1, setup: #{version})"
13
+ end
14
+ else
15
+ raise "No version information in #{changelog}"
16
+ end
17
+ end
18
+ task :release => :check_version
19
+ end
data/lib/rim/gem.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # -- encoding: utf-8 --
2
+ require 'rim/release'
2
3
  class Rim
3
4
  # Gem version
4
5
  attr_accessor :version
@@ -50,12 +51,15 @@ Rim.after_setup do
50
51
  task_object = klass.new(spec) do |pkg|
51
52
  end
52
53
 
53
- desc 'Push the gem to rubygems.org'
54
- task :release => [:test, :gem] do
55
- gem_filename = format('%s/%s.gem', task_object.package_dir, task_object.name)
56
- puts "Push #{gem_filename} to rubygems.org"
57
- system "gem push #{gem_filename}"
54
+ namespace :gem do
55
+ desc 'Push the gem to rubygems.org'
56
+ task :push => [:clean, :test, :gem] do
57
+ gem_filename = format('%s/%s.gem', task_object.package_dir, task_object.name)
58
+ puts "Push #{gem_filename} to rubygems.org"
59
+ sh "gem push #{gem_filename}"
60
+ end
58
61
  end
62
+ task :release => :gem
59
63
  end
60
64
 
61
65
  end
data/lib/rim/git.rb CHANGED
@@ -1,14 +1,19 @@
1
1
  # -- encoding: utf-8 --
2
- require 'rim'
2
+ require 'rim/release'
3
3
 
4
4
  Rim.after_setup do
5
5
  if Dir.exist?('.git')
6
+ tag_name = "v#{version}"
6
7
  namespace :git do
7
- desc 'tag version'
8
+ desc "Create git tag #{tag_name}"
8
9
  tag_task = task :tag do
9
- puts "git tag v#{version}"
10
+ cmd = "git tag #{tag_name}"
11
+ puts cmd
12
+ sh cmd
10
13
  end
11
14
  end
12
- task :post_release => 'git:tag'
15
+ task :release do
16
+ invoke 'git:tag'
17
+ end
13
18
  end
14
19
  end
@@ -0,0 +1,7 @@
1
+ Rim.after_setup do
2
+ task :release
3
+ desc "Release version #{version}"
4
+ task :release => [:clean, :test] do
5
+ invoke 'gem:push'
6
+ end
7
+ end
data/lib/rim.rb CHANGED
@@ -6,6 +6,8 @@ require 'singleton'
6
6
  # Rim a super simple ruby project / gem manager
7
7
  class Rim
8
8
 
9
+ VERSION = '1.1.0'
10
+
9
11
  begin
10
12
  require 'rake/dsl_definition'
11
13
  include Rake::DSL
@@ -32,6 +34,11 @@ class Rim
32
34
  @definitions << blk
33
35
  end
34
36
 
37
+ # Invoke task +name+ if defined raise an error otherwise.
38
+ def invoke name
39
+ Rake::Task[name].invoke
40
+ end
41
+
35
42
  # Helper method to generate Rake::FileList objects.
36
43
  # Main difference between Rake::FileList.new and this method is
37
44
  # the possibility to use Regexp objects as parameters.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -21,12 +21,14 @@ files:
21
21
  - README.rdoc
22
22
  - Changelog
23
23
  - LICENSE
24
+ - lib/rim/check_version.rb
24
25
  - lib/rim/core.rb
25
26
  - lib/rim/gem.rb
26
27
  - lib/rim/git.rb
27
28
  - lib/rim/info.rb
28
29
  - lib/rim/irb.rb
29
30
  - lib/rim/rdoc.rb
31
+ - lib/rim/release.rb
30
32
  - lib/rim/test.rb
31
33
  - lib/rim.rb
32
34
  - test/test_helper_methods.rb