sprout 0.5.19 → 0.5.23

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sprout might be problematic. Click here for more details.

@@ -125,6 +125,9 @@ module PatternPark
125
125
  end
126
126
 
127
127
  def unpack_targz(tgz_file, dir)
128
+ if(!File.exists?(dir))
129
+ FileUtils.makedirs(dir)
130
+ end
128
131
  tar = Zlib::GzipReader.new(File.open(tgz_file, 'rb'))
129
132
  Minitar.unpack(tar, dir)
130
133
  end
@@ -10,6 +10,7 @@ module PatternPark
10
10
  :install_path,
11
11
  :project_path,
12
12
  :post_install,
13
+ :executable,
13
14
  :mount_path
14
15
  attr_reader :downloaded_path,
15
16
  :file_name,
@@ -20,6 +21,11 @@ module PatternPark
20
21
  if(!file_name.nil?)
21
22
  return
22
23
  end
24
+
25
+ if(executable && User.in_path?(executable))
26
+ return
27
+ end
28
+
23
29
  if(url.nil? || url == '')
24
30
  @file_name = ''
25
31
  else
@@ -2,7 +2,7 @@ module Sprout #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 20
5
+ TINY = 24
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/sprout.rb CHANGED
@@ -313,6 +313,10 @@ module PatternPark
313
313
  def target
314
314
  return @target
315
315
  end
316
+
317
+ def executable
318
+ return target.executable
319
+ end
316
320
 
317
321
  def archive_path
318
322
  return File.join(install_path, target.archive_path)
data/lib/tool.rb CHANGED
@@ -10,7 +10,7 @@ module PatternPark
10
10
 
11
11
  def load_target
12
12
  super
13
- if(File.exists?(archive_path))
13
+ if(archive_path.size > 3 && File.exists?(archive_path))
14
14
  File.chmod(0755, archive_path)
15
15
  end
16
16
  end
data/lib/user.rb CHANGED
@@ -41,6 +41,10 @@ module PatternPark
41
41
  User.new().home = path
42
42
  end
43
43
 
44
+ def User.in_path?(executable)
45
+ User.new().in_path?(executable)
46
+ end
47
+
44
48
  def User.home
45
49
  User.new().home
46
50
  end
@@ -113,6 +117,24 @@ module PatternPark
113
117
  end
114
118
  end
115
119
 
120
+ def get_exe_path(executable)
121
+ paths = get_paths
122
+ paths.each do |path|
123
+ if(File.exists?(File.join(path, executable)))
124
+ return File.join(path, executable)
125
+ end
126
+ end
127
+ return nil
128
+ end
129
+
130
+ def in_path?(executable)
131
+ return !get_exe_path(executable).nil?
132
+ end
133
+
134
+ def get_paths
135
+ return ENV['PATH'].split(':')
136
+ end
137
+
116
138
  def library
117
139
  return home
118
140
  end
@@ -133,7 +155,11 @@ module PatternPark
133
155
 
134
156
  def execute(tool, options='')
135
157
  tool = Sprout.load(tool)
136
- target = tool.archive_path
158
+ if(tool.executable)
159
+ target = get_exe_path(tool.executable)
160
+ else
161
+ target = tool.archive_path
162
+ end
137
163
  Log.puts(">> Execute: #{File.basename(target)} #{options}")
138
164
  runner = get_process_runner("#{clean_path(target)} #{options}")
139
165
  result = runner.read
@@ -204,6 +230,10 @@ module PatternPark
204
230
  end
205
231
  return usr
206
232
  end
233
+
234
+ def get_paths
235
+ return ENV['PATH'].split(';')
236
+ end
207
237
 
208
238
  def library
209
239
  # For some reason, my homepath returns inside 'My Documents'...
data/rakefile.rb CHANGED
@@ -64,6 +64,7 @@ spec = Gem::Specification.new do |s|
64
64
  s.add_dependency('rake', '>= 0.7.1')
65
65
  s.add_dependency('rubyzip', '>= 0.9.1')
66
66
  s.add_dependency('archive-tar-minitar', '>= 0.5.1')
67
+ # s.add_dependency('win32-open3', '>= 0.2.5')
67
68
  s.rdoc_options << '--exclude' << '.'
68
69
  s.has_rdoc = false
69
70
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: sprout
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.19
7
- date: 2007-07-02 00:00:00 -07:00
6
+ version: 0.5.23
7
+ date: 2007-07-07 00:00:00 -07:00
8
8
  summary: "Sprouts is an open-source, cross-platform project generation and configuration
9
9
  tool."
10
10
  require_paths: