gem-release 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,8 @@ module GemRelease
5
5
  def initialize(options = {})
6
6
  super
7
7
 
8
- @authors ||= [`git config --get user.name`.strip]
9
- @email ||= `git config --get user.email`.strip
8
+ @authors ||= [user_name]
9
+ @email ||= user_email
10
10
  @homepage ||= "http://github.com/#{github_user}/#{name}" || "[your github name]"
11
11
 
12
12
  @summary ||= '[summary]'
@@ -23,6 +23,10 @@ module GemRelease
23
23
  end
24
24
  end
25
25
 
26
+ def exists?
27
+ File.exists?(filename)
28
+ end
29
+
26
30
  def filename
27
31
  "#{name}.gemspec"
28
32
  end
@@ -2,6 +2,14 @@ require 'core_ext/string/camelize'
2
2
 
3
3
  module GemRelease
4
4
  module Helpers
5
+ def user_name
6
+ `git config --get user.name`.strip
7
+ end
8
+
9
+ def user_email
10
+ `git config --get user.email`.strip
11
+ end
12
+
5
13
  def github_user
6
14
  @github_user ||= `git config --get github.user`.strip
7
15
  end
@@ -1,5 +1,5 @@
1
1
  module GemRelease
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
 
4
4
  class Version < Template
5
5
  attr_reader :version
@@ -1,3 +1,5 @@
1
+ require 'core_ext/kernel/silence'
2
+
1
3
  module GemRelease
2
4
  class VersionFile
3
5
  include GemRelease::Helpers
@@ -13,6 +15,11 @@ module GemRelease
13
15
 
14
16
  def bump!
15
17
  File.open(filename, 'w+') { |f| f.write(bumped_content) }
18
+ force_load!
19
+ end
20
+
21
+ def force_load!
22
+ silence { load(filename) }
16
23
  end
17
24
 
18
25
  def new_number
@@ -38,12 +38,19 @@ class Gem::Commands::BootstrapCommand < Gem::Command
38
38
 
39
39
  def write_version
40
40
  version = Version.new(options)
41
- say "Creating #{version.filename}"
42
- version.write
41
+ if File.exists?("#{version.filename}")
42
+ say "Skipping #{version.filename}: already exists"
43
+ else
44
+ say "Creating #{version.filename}"
45
+ version.write
46
+ end
43
47
  end
44
48
 
45
49
  def write_rakefile
46
- rakefile = <<RAKEFILE
50
+ if File.exists?('Rakefile')
51
+ say "Skipping Rakefile: already exists"
52
+ else
53
+ rakefile = <<RAKEFILE
47
54
  require 'rake'
48
55
  require 'rake/testtask'
49
56
 
@@ -55,7 +62,8 @@ end
55
62
 
56
63
  task :default => :test
57
64
  RAKEFILE
58
- File.open('Rakefile', 'w').write(rakefile)
65
+ File.open('Rakefile', 'w').write(rakefile)
66
+ end
59
67
  end
60
68
 
61
69
  def create_repo
@@ -14,7 +14,11 @@ class Gem::Commands::GemspecCommand < Gem::Command
14
14
 
15
15
  def execute
16
16
  gemspec = Gemspec.new(options)
17
- say "Creating #{gemspec.filename}"
18
- gemspec.write
17
+ if gemspec.exists?
18
+ say "Skipping #{gemspec.filename}: already exists"
19
+ else
20
+ say "Creating #{gemspec.filename}"
21
+ gemspec.write
22
+ end
19
23
  end
20
24
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-release
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-12 00:00:00 +02:00
18
+ date: 2010-10-27 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency