sprout 0.7.193-x86-linux → 0.7.196-x86-linux
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.
- data/lib/sprout/generator/base_mixins.rb +57 -2
- data/lib/sprout/process_runner.rb +4 -0
- data/lib/sprout/project_model.rb +2 -0
- data/lib/sprout/remote_file_loader.rb +1 -1
- data/lib/sprout/remote_file_target.rb +1 -1
- data/lib/sprout/user.rb +12 -3
- data/lib/sprout/version.rb +1 -1
- data/lib/sprout.rb +6 -4
- metadata +3 -3
@@ -1,3 +1,58 @@
|
|
1
|
+
|
2
|
+
class Gem::SourceIndex
|
3
|
+
|
4
|
+
# This feature seems to be getting deprecated from the latest
|
5
|
+
# gems releases (1.3.x).
|
6
|
+
# We actually need it and don't want the nagging - so,
|
7
|
+
# copied sources from RubyGems SVN trunk, and mixing in...
|
8
|
+
# :-(
|
9
|
+
# There should be a more stable integration point with RubyGems
|
10
|
+
# Any ideas or contributions are welcome!
|
11
|
+
def sprout_search(gem_pattern, platform_only = false)
|
12
|
+
version_requirement = nil
|
13
|
+
only_platform = false
|
14
|
+
|
15
|
+
# unless Gem::Dependency === gem_pattern
|
16
|
+
# warn "#{Gem.location_of_caller.join ':'}:Warning: Gem::SourceIndex#search support for #{gem_pattern.class} patterns is deprecated"
|
17
|
+
# end
|
18
|
+
|
19
|
+
case gem_pattern
|
20
|
+
when Regexp then
|
21
|
+
version_requirement = platform_only || Gem::Requirement.default
|
22
|
+
when Gem::Dependency then
|
23
|
+
only_platform = platform_only
|
24
|
+
version_requirement = gem_pattern.version_requirements
|
25
|
+
gem_pattern = if Regexp === gem_pattern.name then
|
26
|
+
gem_pattern.name
|
27
|
+
elsif gem_pattern.name.empty? then
|
28
|
+
//
|
29
|
+
else
|
30
|
+
/^#{Regexp.escape gem_pattern.name}$/
|
31
|
+
end
|
32
|
+
else
|
33
|
+
version_requirement = platform_only || Gem::Requirement.default
|
34
|
+
gem_pattern = /#{gem_pattern}/i
|
35
|
+
end
|
36
|
+
|
37
|
+
unless Gem::Requirement === version_requirement then
|
38
|
+
version_requirement = Gem::Requirement.create version_requirement
|
39
|
+
end
|
40
|
+
|
41
|
+
specs = @gems.values.select do |spec|
|
42
|
+
spec.name =~ gem_pattern and
|
43
|
+
version_requirement.satisfied_by? spec.version
|
44
|
+
end
|
45
|
+
|
46
|
+
if only_platform then
|
47
|
+
specs = specs.select do |spec|
|
48
|
+
Gem::Platform.match spec.platform
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
specs.sort_by { |s| s.sort_obj }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
1
56
|
module RubiGen # :nodoc:[all]
|
2
57
|
|
3
58
|
class Base # :nodoc:[all]
|
@@ -37,7 +92,7 @@ module RubiGen # :nodoc:[all]
|
|
37
92
|
|
38
93
|
# Yield latest versions of generator gems.
|
39
94
|
def each
|
40
|
-
Gem::cache.
|
95
|
+
Gem::cache.sprout_search(/sprout-*#{@sprout_name}-bundle$/).inject({}) { |latest, gem|
|
41
96
|
hem = latest[gem.name]
|
42
97
|
latest[gem.name] = gem if hem.nil? or gem.version > hem.version
|
43
98
|
latest
|
@@ -47,7 +102,7 @@ module RubiGen # :nodoc:[all]
|
|
47
102
|
end
|
48
103
|
|
49
104
|
def each_sprout
|
50
|
-
Gem::cache.
|
105
|
+
Gem::cache.sprout_search(/^sprout-.*/).inject({}) { |latest, gem|
|
51
106
|
hem = latest[gem.name]
|
52
107
|
latest[gem.name] = gem if hem.nil? or gem.version > hem.version
|
53
108
|
latest
|
data/lib/sprout/project_model.rb
CHANGED
@@ -122,6 +122,8 @@ module Sprout
|
|
122
122
|
attr_accessor :test_height
|
123
123
|
# The test runner SWF width
|
124
124
|
attr_accessor :test_width
|
125
|
+
# Tasks that can, will use the Flex Compiler SHell.
|
126
|
+
attr_accessor :use_fcsh
|
125
127
|
# The default width of the SWF file
|
126
128
|
# _(This value is overridden when embedded in an HTML page)_
|
127
129
|
attr_accessor :width
|
@@ -183,7 +183,7 @@ module Sprout
|
|
183
183
|
# the command works fine!?
|
184
184
|
def unpack_dmg(dmg_file, dir)
|
185
185
|
# 1) Mount the dmg in place
|
186
|
-
# 2) Recursively Copy
|
186
|
+
# 2) Recursively Copy its contents to asproject_home
|
187
187
|
# 3) Unmount the dmg
|
188
188
|
if(mounted_path.nil?)
|
189
189
|
raise StandardError.new('DMG file downloaded, but the RemoteFileTask needs a mounted_path in order to mount it')
|
@@ -16,7 +16,7 @@ module Sprout
|
|
16
16
|
# be compared and if they differ, the installation process will break.
|
17
17
|
attr_accessor :md5
|
18
18
|
|
19
|
-
# Used for dmg archives. Absolute path to the mounted dmg (essentially
|
19
|
+
# Used for dmg archives. Absolute path to the mounted dmg (essentially its name)
|
20
20
|
attr_accessor :mount_path
|
21
21
|
|
22
22
|
# Which platform will this RemoteFileTarget support.
|
data/lib/sprout/user.rb
CHANGED
@@ -196,31 +196,40 @@ module Sprout
|
|
196
196
|
return Platform::IMPL
|
197
197
|
end
|
198
198
|
end
|
199
|
-
|
199
|
+
|
200
200
|
def get_process_runner(command)
|
201
201
|
return ProcessRunner.new(command)
|
202
202
|
end
|
203
203
|
|
204
|
+
# Creates a new process, executes the command
|
205
|
+
# and returns the result and throws if the process
|
206
|
+
# writes to stderr
|
204
207
|
def execute(tool, options='')
|
205
208
|
Log.puts(">> Execute: #{File.basename(tool)} #{options}")
|
206
209
|
tool = clean_path(tool)
|
207
210
|
runner = get_process_runner("#{tool} #{options}")
|
208
|
-
|
211
|
+
|
209
212
|
result = runner.read
|
210
213
|
error = runner.read_err
|
214
|
+
|
211
215
|
if(result.size > 0)
|
212
216
|
Log.puts result
|
213
217
|
end
|
218
|
+
|
214
219
|
if(error.size > 0)
|
215
220
|
raise ExecutionError.new("[ERROR] #{error}")
|
216
221
|
end
|
217
222
|
end
|
218
223
|
|
224
|
+
# Creates and returns the process without
|
225
|
+
# attempting to read or write to the stream.
|
226
|
+
# This is useful for interacting with
|
227
|
+
# long-lived CLI processes like FCSH or FDB.
|
219
228
|
def execute_silent(tool, options='')
|
220
229
|
tool = clean_path(tool)
|
221
230
|
return get_process_runner("#{tool} #{options}")
|
222
231
|
end
|
223
|
-
|
232
|
+
|
224
233
|
def execute_thread(tool, options='')
|
225
234
|
return Thread.new {
|
226
235
|
execute(tool, options)
|
data/lib/sprout/version.rb
CHANGED
data/lib/sprout.rb
CHANGED
@@ -33,6 +33,7 @@ require 'sprout/builder'
|
|
33
33
|
require 'sprout/version'
|
34
34
|
require 'sprout/tasks/tool_task'
|
35
35
|
require 'sprout/general_tasks'
|
36
|
+
require 'sprout/generator'
|
36
37
|
|
37
38
|
module Sprout
|
38
39
|
SUDO_INSTALL_GEMS = 'false' == ENV['SUDO_INSTALL_GEMS'] ? false : true
|
@@ -138,11 +139,12 @@ module Sprout
|
|
138
139
|
# For each sprout found, remove it!
|
139
140
|
RubiGen::GemGeneratorSource.new().each_sprout do |sprout|
|
140
141
|
count += 1
|
141
|
-
command = "#{get_gem_preamble} uninstall -x -a -
|
142
|
+
command = "#{get_gem_preamble} uninstall -x -a -q #{sprout.name}"
|
142
143
|
|
143
144
|
if(!confirmation)
|
144
145
|
break unless confirmation = remove_gems_confirmation
|
145
146
|
end
|
147
|
+
puts "executing #{command}"
|
146
148
|
raise ">> Exited with errors: #{$?}" unless system(command)
|
147
149
|
end
|
148
150
|
|
@@ -251,7 +253,7 @@ EOF
|
|
251
253
|
exe = target.archive_path
|
252
254
|
end
|
253
255
|
|
254
|
-
if(File.exists?(exe) && !File.directory?(exe) && File.stat(exe).
|
256
|
+
if(File.exists?(exe) && !File.directory?(exe) && File.stat(exe).executable?)
|
255
257
|
File.chmod 0755, exe
|
256
258
|
end
|
257
259
|
|
@@ -324,7 +326,7 @@ EOF
|
|
324
326
|
# This method will actually download and install the provided gem by +name+ and +requirements+ if
|
325
327
|
# it is not found locally on the system.
|
326
328
|
def self.find_gem_spec(name, requirements=nil, recursed=false)
|
327
|
-
specs = Gem::cache.
|
329
|
+
specs = Gem::cache.sprout_search(/.*#{name}$/).reverse # Found specs are returned in order from oldest to newest!?
|
328
330
|
requirement = nil
|
329
331
|
if(requirements)
|
330
332
|
requirement = Gem::Requirement.new(requirements)
|
@@ -344,7 +346,7 @@ EOF
|
|
344
346
|
else
|
345
347
|
msg = ">> Loading gem [#{name}]"
|
346
348
|
msg << " #{requirements}" if requirements
|
347
|
-
msg << " from #{gem_sources.join(', ')} with
|
349
|
+
msg << " from #{gem_sources.join(', ')} with its dependencies"
|
348
350
|
Log.puts msg
|
349
351
|
parts = [ 'ins', '-r', name ]
|
350
352
|
# This url should be removed once released, released gems should be hosted from the rubyforge
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.196
|
5
5
|
platform: x86-linux
|
6
6
|
authors:
|
7
7
|
- Luke Bayes
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-06 00:00:00 -08:00
|
13
13
|
default_executable: sprout
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
requirements: []
|
161
161
|
|
162
162
|
rubyforge_project: sprout
|
163
|
-
rubygems_version: 1.
|
163
|
+
rubygems_version: 1.3.1
|
164
164
|
signing_key:
|
165
165
|
specification_version: 2
|
166
166
|
summary: Sprouts is an open-source, cross-platform project generation, configuration and build tool.
|