flooose-gemedit 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,10 +81,19 @@ class Gem::Commands::EditCommand < Gem::Command
81
81
  %Q{"#{spec.full_gem_path}"}
82
82
  end
83
83
  if options[:git]
84
- say "Initializing empty git repository in #{paths}" if Gem.configuration.verbose
85
- paths.each{|path| system('git init #{path}')}
86
- say "Creating initial commit" if Gem.configuration.verbose
87
- paths.each{|path| system("cd #{path} && git add ./ && git commit -m 'Gemedit generated commit'")}
84
+ paths.each do |path|
85
+ path.gsub!(/"/, '')
86
+ Dir.chdir("#{path}") do
87
+ unless File.exists?('.git')
88
+ say "Initializing empty git repository in #{path}" if Gem.configuration.verbose
89
+ system('git init')
90
+ say "Creating initial commit" if Gem.configuration.verbose
91
+ system("git add . && git commit -m 'Gemedit generated commit'")
92
+ else
93
+ say "There seems to already be a git repository for this gem. Not initializing"
94
+ end
95
+ end
96
+ end
88
97
  end
89
98
  cmd = "#{options[:editor]} #{paths.join(' ')}"
90
99
  say "Running `#{cmd}`" if Gem.configuration.verbose
@@ -1,3 +1,3 @@
1
1
  module Gemedit #:nodoc:
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flooose-gemedit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 10
9
- - 1
10
- version: 0.10.1
9
+ - 2
10
+ version: 0.10.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - !binary |