subwrap 0.3.6 → 0.3.7
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.
- data/ProjectInfo.rb +1 -1
- data/lib/subwrap/subversion.rb +10 -6
- metadata +1 -1
data/ProjectInfo.rb
CHANGED
@@ -5,7 +5,7 @@ module Project
|
|
5
5
|
PrettyName = "Subwrap: Enhanced Subversion Command"
|
6
6
|
Name = "subwrap"
|
7
7
|
RubyForgeName = "subwrap"
|
8
|
-
Version = "0.3.
|
8
|
+
Version = "0.3.7"
|
9
9
|
Specification = Gem::Specification.new do |s|
|
10
10
|
s.name = Project::Name
|
11
11
|
s.summary = "A nifty wrapper command for Subversion's command-line svn client"
|
data/lib/subwrap/subversion.rb
CHANGED
@@ -6,15 +6,18 @@ require 'rexml/document'
|
|
6
6
|
require 'rexml/xpath'
|
7
7
|
require 'rubygems'
|
8
8
|
|
9
|
-
gem 'facets'
|
9
|
+
gem 'facets'
|
10
10
|
require 'facets/core/kernel/require_local'
|
11
11
|
require 'facets/core/enumerable/uniq_by'
|
12
12
|
require 'facets/core/kernel/silence_stream'
|
13
13
|
require 'facets/core/module/initializer'
|
14
|
+
require 'facets/core/fileutils/which'
|
15
|
+
require 'facets/core/fileutils/whereis'
|
14
16
|
|
15
|
-
gem 'quality_extensions'
|
17
|
+
gem 'quality_extensions'
|
16
18
|
require 'quality_extensions/kernel/windows_platform'
|
17
19
|
|
20
|
+
|
18
21
|
# Had a lot of trouble getting ActiveSupport to load without giving errors! Eventually gave up on that idea since I only needed it for mattr_accessor and Facets supplies that.
|
19
22
|
#gem 'activesupport' # mattr_accessor
|
20
23
|
#require 'active_support'
|
@@ -398,12 +401,13 @@ module Subversion
|
|
398
401
|
end
|
399
402
|
|
400
403
|
# The location of the executable to be used
|
401
|
-
# to do:
|
404
|
+
# to do: Is there a smarter/faster way to do this? (Could cache this result in .subwrap or somewhere, so we don't have to do all this work on every invocation...)
|
402
405
|
def self.executable
|
406
|
+
# FileUtils.which('svn') would return our Ruby *wrapper* script for svn. We actually want to return here the binary/executable that we are
|
407
|
+
# *wrapping* so we have to use whereis and then use the first one that is ''not'' a Ruby script.
|
403
408
|
@@executable ||=
|
404
|
-
|
405
|
-
|
406
|
-
if File.exist?(executable) and !self.ruby_script?(executable) # We want to wrap the svn binary provided by Subversion, not our custom replacement for that.
|
409
|
+
FileUtils.whereis('svn') do |executable|
|
410
|
+
if !self.ruby_script?(executable) # We want to wrap the svn binary provided by Subversion, not our custom replacement for that.
|
407
411
|
return windows_platform? ? %{"#{executable}"} : executable
|
408
412
|
end
|
409
413
|
end
|
metadata
CHANGED