flit 0.3.pre → 0.3.1.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.pre
1
+ 0.3.1.pre
@@ -1,10 +1,27 @@
1
1
  module Flit
2
2
  module Commands
3
3
  class Version
4
- DESC = "Mark the current commit as a new version"
4
+ DESC = "Mark the current commit as a new version. Creates a new annotated tag."
5
+ USAGE = "VERSION [MESSAGE]"
6
+ OPTIONS = {
7
+ :version => "Should be a version string in the form X.Y.Z",
8
+ :message => "An optional message to add to the tag. Defaults to 'Bump to X.Y.Z'"
9
+ }
5
10
 
6
11
  def run(args)
12
+ # Gatekeepers
13
+ fatal "directory isn't a flit repository" unless is_flit?
14
+ show_help unless args.count >= 1
7
15
 
16
+ Hooks.fire :didStartCommand__version
17
+
18
+ config = open_config
19
+ version, message = args
20
+ message ||= "Bump to #{config[:tags][:version_prefix]}#{version}"
21
+
22
+ `git tag -a #{config[:tags][:version_prefix]}#{version} -m "#{message}"`
23
+
24
+ Hooks.fire :didFinishCommand__version
8
25
  end
9
26
 
10
27
  end
@@ -27,7 +27,7 @@ module Flit
27
27
  end
28
28
 
29
29
  def fire(e, args = {})
30
- unless @hooks[e].nil?
30
+ unless @hooks.nil? || @hooks[e].nil?
31
31
  @hooks[e].each do |hook|
32
32
  hook.call args
33
33
  end
@@ -1,5 +1,5 @@
1
1
  module Flit
2
2
  module Version
3
- STRING = "0.3.pre"
3
+ STRING = "0.3.1.pre"
4
4
  end
5
5
  end
metadata CHANGED
@@ -5,8 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
+ - 1
8
9
  - pre
9
- version: 0.3.pre
10
+ version: 0.3.1.pre
10
11
  platform: ruby
11
12
  authors:
12
13
  - Matt Kirman
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-08-29 00:00:00 +01:00
18
+ date: 2010-09-03 00:00:00 +01:00
18
19
  default_executable: flit
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency