git-si 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/git/si/version.rb +1 -1
  3. data/lib/git/si.rb +27 -13
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2885ccf96954518937e9ec898c075081f098655c
4
- data.tar.gz: 4853b379d09f6360f1b4582e589f75a9d95e43b6
3
+ metadata.gz: 37dde5ac525eb3b802d3fa5b03b08a2e7765ae22
4
+ data.tar.gz: 500f725cea23eb47729ec7ea5dd498057601e83a
5
5
  SHA512:
6
- metadata.gz: c77d7b7a5b4ae1efce186b13b016b4362fc7d77a0f82c7754fca2f596a4b99db3a3f4e6966c22c15e85ba23f37bc05884f904b3a0027f2c4b27b32ed28703827
7
- data.tar.gz: ce7c31528eca1fb2ab5c7db72423ba6e5d531ec26b68be2dde507aa0aea2cda8566806668834b364ed2b9351e9c3e1d6c089c3f60dabb1fc7a3406b26f964a4f
6
+ metadata.gz: b1b9ae5573ebbf80e2c82d8d1645732c905f8b558558ed278da948c569208fb113b24140c5661d85e02dcc1babaa9ab6b953ca352ba79c6f6f549e120f5f53c2
7
+ data.tar.gz: 238e6bfded56e3d2f42d22e1d95464ced6dd731b991eda462572c8e33edd0ca26f27f0449e97f13cd057eb1c1822980c919feba4d939e1833dfcb4bf68300089
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Si
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
data/lib/git/si.rb CHANGED
@@ -199,25 +199,29 @@ continue, it's wise to reset the master branch afterward."
199
199
  svn_status = `#{command}`
200
200
  raise SvnError.new("Failed to get the svn status. I'm not sure why. Check for any errors above.") if ! $?.success?
201
201
  files_to_add = []
202
- svn_status.each_line do |line|
203
- case line.strip!
204
- when /^X/, /\.git/, /\.swp$/
205
- when /^\?\s+(\S.+)/
206
- filename = $1
207
- file_in_git = `git ls-files #{filename}`
208
- raise GitError.new("Failed to list git files. I'm not sure why. Check for any errors above.") unless $?.success?
209
- files_to_add << filename if file_in_git
210
- say filename
202
+ using_stderr do
203
+ svn_status.each_line do |line|
204
+ case line.strip!
205
+ when /^X/, /\.git/, /\.swp$/
206
+ when /^\?\s+(\S.+)/
207
+ filename = $1
208
+ file_in_git = `git ls-files #{filename}`
209
+ raise GitError.new("Failed to list git files. I'm not sure why. Check for any errors above.") unless $?.success?
210
+ files_to_add << filename if file_in_git
211
+ say filename
212
+ end
211
213
  end
212
214
  end
213
215
  if files_to_add.empty?
214
216
  notice_message "There are no files to add."
215
217
  return
216
218
  end
217
- if yes? "Do you want to add the above files to svn? [y/N] ", :green
218
- command = "svn add " + files_to_add.join(' ')
219
- run_command(command)
220
- success_message "Added files to svn that had been added to git."
219
+ using_stderr do
220
+ if yes? "Do you want to add the above files to svn? [y/N] ", :green
221
+ command = "svn add " + files_to_add.join(' ')
222
+ run_command(command)
223
+ success_message "Added files to svn that had been added to git."
224
+ end
221
225
  end
222
226
  end
223
227
  end
@@ -330,6 +334,16 @@ continue, it's wise to reset the master branch afterward."
330
334
  end
331
335
  end
332
336
 
337
+ def using_stderr(&block)
338
+ old_stdout = $stdout
339
+ $stdout = $stderr
340
+ begin
341
+ yield
342
+ ensure
343
+ $stdout = old_stdout
344
+ end
345
+ end
346
+
333
347
  def success_message(message)
334
348
  $stderr.puts set_color message, :green
335
349
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-si
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Payton Swick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-20 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler