sprout 0.7.246 → 1.0.0.pre
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/CHANGELOG.md +10 -0
- data/Gemfile +28 -0
- data/MIT-LICENSE +3 -2
- data/POSTINSTALL.rdoc +28 -0
- data/README.textile +152 -0
- data/bin/sprout +1 -131
- data/bin/sprout-generator +10 -0
- data/bin/sprout-library +11 -0
- data/bin/sprout-tool +10 -0
- data/lib/sprout.rb +4 -500
- data/lib/sprout/archive_unpacker.rb +122 -206
- data/lib/sprout/base.rb +90 -0
- data/lib/sprout/concern.rb +30 -0
- data/lib/sprout/dir.rb +23 -0
- data/lib/sprout/errors.rb +94 -0
- data/lib/sprout/executable.rb +496 -0
- data/lib/sprout/executable/boolean.rb +35 -0
- data/lib/sprout/executable/collection_param.rb +53 -0
- data/lib/sprout/executable/file_param.rb +53 -0
- data/lib/sprout/executable/files.rb +26 -0
- data/lib/sprout/executable/number.rb +10 -0
- data/lib/sprout/executable/param.rb +222 -0
- data/lib/sprout/executable/parameter_factory.rb +28 -0
- data/lib/sprout/executable/path.rb +21 -0
- data/lib/sprout/executable/paths.rb +21 -0
- data/lib/sprout/executable/string_param.rb +15 -0
- data/lib/sprout/executable/strings.rb +11 -0
- data/lib/sprout/executable/url.rb +10 -0
- data/lib/sprout/executable/urls.rb +10 -0
- data/lib/sprout/file_target.rb +76 -0
- data/lib/sprout/generator/base.rb +233 -0
- data/lib/sprout/generator/command.rb +67 -0
- data/lib/sprout/generator/directory_manifest.rb +49 -0
- data/lib/sprout/generator/file_manifest.rb +55 -0
- data/lib/sprout/generator/manifest.rb +13 -0
- data/lib/sprout/generator/template_manifest.rb +13 -0
- data/lib/sprout/generators/generator/generator_generator.rb +48 -0
- data/lib/sprout/generators/generator/templates/generator_class.rb +17 -0
- data/lib/sprout/generators/generator/templates/generator_executable +9 -0
- data/lib/sprout/generators/generator/templates/generator_template +1 -0
- data/lib/sprout/generators/generator/templates/generator_test.rb +37 -0
- data/lib/sprout/generators/generator/templates/generator_test_helper.rb +16 -0
- data/lib/sprout/generators/library/library_generator.rb +20 -0
- data/lib/sprout/generators/library/templates/library.gemspec +19 -0
- data/lib/sprout/generators/library/templates/library.rb +15 -0
- data/lib/sprout/generators/ruby/ruby_generator.rb +59 -0
- data/lib/sprout/generators/ruby/templates/ruby_base.rb +10 -0
- data/lib/sprout/generators/ruby/templates/ruby_executable +6 -0
- data/lib/sprout/generators/ruby/templates/ruby_gemfile +4 -0
- data/lib/sprout/generators/ruby/templates/ruby_input.rb +7 -0
- data/lib/sprout/generators/tool/templates/Gemfile +4 -0
- data/lib/sprout/generators/tool/templates/tool.gemspec +22 -0
- data/lib/sprout/generators/tool/templates/tool.rb +38 -0
- data/lib/sprout/generators/tool/tool_generator.rb +36 -0
- data/lib/sprout/library.rb +111 -0
- data/lib/sprout/log.rb +1 -0
- data/lib/sprout/platform.rb +71 -0
- data/lib/sprout/process_runner.rb +80 -40
- data/lib/sprout/progress_bar.rb +341 -0
- data/lib/sprout/rdoc_parser.rb +91 -0
- data/lib/sprout/remote_file_loader.rb +72 -50
- data/lib/sprout/remote_file_target.rb +44 -152
- data/lib/sprout/ruby_feature.rb +167 -0
- data/lib/sprout/specification.rb +197 -0
- data/lib/sprout/string.rb +19 -0
- data/lib/sprout/system.rb +35 -0
- data/lib/sprout/system/base_system.rb +225 -0
- data/lib/sprout/system/java_system.rb +9 -0
- data/lib/sprout/system/osx_system.rb +26 -0
- data/lib/sprout/system/unix_system.rb +72 -0
- data/lib/sprout/system/vista_system.rb +16 -0
- data/lib/sprout/system/win_nix_system.rb +41 -0
- data/lib/sprout/system/win_system.rb +76 -0
- data/lib/sprout/test/sprout_test_case.rb +211 -0
- data/lib/sprout/version.rb +9 -4
- data/rakefile.rb +85 -144
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/sprout.gemspec +26 -0
- data/test/fixtures/archive_unpacker/copyable/some_file.exe +0 -0
- data/test/fixtures/archive_unpacker/copyable/some_file.rb +0 -0
- data/test/fixtures/archive_unpacker/copyable/some_file.swc +0 -0
- data/test/fixtures/archive_unpacker/tgz/some folder.tgz +0 -0
- data/test/fixtures/archive_unpacker/tgz/some_file.tgz +0 -0
- data/test/fixtures/archive_unpacker/zip/some folder.zip +0 -0
- data/test/fixtures/archive_unpacker/zip/some_file.zip +0 -0
- data/test/fixtures/examples/app_generator.rb +127 -0
- data/test/fixtures/examples/echo_inputs.rb +151 -0
- data/test/fixtures/executable/echochamber_gem/bin/echochamber +3 -0
- data/test/fixtures/executable/echochamber_gem/echo_chamber.rb +10 -0
- data/test/fixtures/executable/flex3sdk_gem/flex3sdk.rb +11 -0
- data/test/fixtures/executable/flex3sdk_gem/mxmlc +3 -0
- data/test/fixtures/executable/flex3sdk_gem/mxmlc.bat +3 -0
- data/test/fixtures/executable/mxmlc.rb +805 -0
- data/test/fixtures/executable/params/input.as +0 -0
- data/test/fixtures/executable/params/input2.as +0 -0
- data/test/fixtures/executable/params/input3.as +0 -0
- data/test/fixtures/executable/params/mxmlc +5 -0
- data/test/fixtures/executable/path with spaces/input.as b/data/test/fixtures/executable/path with → spaces/input.as +0 -0
- data/test/fixtures/executable/path with spaces/input2.as b/data/test/fixtures/executable/path with → spaces/input2.as +0 -0
- data/test/fixtures/executable/path with spaces/input3.as b/data/test/fixtures/executable/path with → spaces/input3.as +0 -0
- data/test/fixtures/executable/paths/folder1/file1 +0 -0
- data/test/fixtures/executable/paths/folder1/file2 +0 -0
- data/test/fixtures/executable/paths/folder1/file3 +0 -0
- data/test/fixtures/executable/paths/folder2/file4 +0 -0
- data/test/fixtures/executable/paths/folder2/file5 +0 -0
- data/test/fixtures/executable/paths/folder3/file6 +0 -0
- data/test/fixtures/executable/src/Main.as +0 -0
- data/test/fixtures/executable/windows_line_endings +47 -0
- data/test/fixtures/generators/song_generator.rb +11 -0
- data/test/fixtures/generators/song_subclass/least_favorite.rb +10 -0
- data/test/fixtures/generators/song_subclass/templates/Song.txt +3 -0
- data/test/fixtures/generators/temp_generator.rb +24 -0
- data/test/fixtures/generators/templates/Main.as +9 -0
- data/test/fixtures/generators/templates/OtherFileTemplate +1 -0
- data/test/fixtures/generators/templates/SomeFile +1 -0
- data/test/fixtures/generators/templates/SomeSubclassFile +2 -0
- data/test/fixtures/generators/templates/Song.txt +3 -0
- data/test/fixtures/generators/templates/destroy +0 -0
- data/test/fixtures/generators/templates/generate +0 -0
- data/test/fixtures/library/archive/Archive.swc +0 -0
- data/test/fixtures/library/sources/lib/a/A.as +0 -0
- data/test/fixtures/library/sources/lib/b/B.as +0 -0
- data/test/fixtures/library/sources/src/Source.as +0 -0
- data/test/fixtures/process_runner/chmod_script.sh +3 -0
- data/test/fixtures/process_runner/dir with spaces/chmod_script.sh +3 -0
- data/test/fixtures/process_runner/failure +5 -0
- data/test/fixtures/process_runner/success +4 -0
- data/test/fixtures/remote_file_loader/md5/echochamber-test.zip +0 -0
- data/test/fixtures/remote_file_loader/md5/file_with_known_md5 +0 -0
- data/test/fixtures/remote_file_target/bin/echochamber +3 -0
- data/test/fixtures/remote_file_target/bin/echochamber.bat +3 -0
- data/test/fixtures/remote_file_target/echochamber-test.zip +0 -0
- data/test/fixtures/specification/asunit4.rb +25 -0
- data/test/fixtures/specification/ext/AsUnit-4.1.pre.swc +0 -0
- data/test/fixtures/specification/flashplayer.rb +30 -0
- data/test/fixtures/specification/flex4sdk.rb +72 -0
- data/test/fixtures/specification/flexunit4.sproutspec +17 -0
- data/test/fixtures/specification/lib/as3reflection/Reflection.as +0 -0
- data/test/fixtures/specification/src/AsUnit.as +0 -0
- data/test/fixtures/user/mxmlc_crlf +3 -0
- data/test/unit/archive_unpacker_test.rb +108 -0
- data/test/unit/boolean_param_test.rb +38 -0
- data/test/unit/executable_option_parser_test.rb +142 -0
- data/test/unit/executable_param_test.rb +76 -0
- data/test/unit/executable_test.rb +237 -0
- data/test/unit/fake_executable_task.rb +22 -0
- data/test/unit/fake_other_executable.rb +20 -0
- data/test/unit/fake_process_runner.rb +29 -0
- data/test/unit/file_param_test.rb +61 -0
- data/test/unit/file_target_test.rb +42 -0
- data/test/unit/files_param_test.rb +72 -0
- data/test/unit/generator_generator_test.rb +85 -0
- data/test/unit/generator_test.rb +333 -0
- data/test/unit/library_generator_test.rb +41 -0
- data/test/unit/library_test.rb +88 -0
- data/test/unit/osx_system_test.rb +20 -0
- data/test/unit/path_param_test.rb +43 -0
- data/test/unit/paths_param_test.rb +53 -0
- data/test/unit/platform_test.rb +76 -0
- data/test/unit/process_runner_test.rb +104 -0
- data/test/unit/rdoc_parser_test.rb +15 -0
- data/test/unit/remote_file_loader_test.rb +34 -0
- data/test/unit/remote_file_target_test.rb +105 -0
- data/test/unit/ruby_feature_test.rb +108 -0
- data/test/unit/ruby_generator_test.rb +70 -0
- data/test/unit/specification_test.rb +73 -0
- data/test/unit/sprout_test.rb +170 -0
- data/test/unit/sprout_test_helper.rb +18 -0
- data/test/unit/string_param_test.rb +19 -0
- data/test/unit/string_test.rb +20 -0
- data/test/unit/strings_param_test.rb +27 -0
- data/test/unit/test_helper.rb +1 -0
- data/test/unit/tool_generator_test.rb +43 -0
- data/test/unit/unix_system_test.rb +52 -0
- data/test/unit/user_test.rb +147 -0
- data/test/unit/vista_system_test.rb +40 -0
- data/test/unit/win_nix_system_test.rb +26 -0
- data/test/unit/win_system_test.rb +61 -0
- metadata +318 -113
- data/doc/Bundle +0 -14
- data/doc/Generator +0 -35
- data/doc/Library +0 -63
- data/doc/Task +0 -21
- data/doc/Tool +0 -20
- data/lib/platform.rb +0 -113
- data/lib/progress_bar.rb +0 -354
- data/lib/sprout/builder.rb +0 -51
- data/lib/sprout/bundle_resolver.rb +0 -349
- data/lib/sprout/commands/generate.rb +0 -9
- data/lib/sprout/dynamic_accessors.rb +0 -40
- data/lib/sprout/general_tasks.rb +0 -6
- data/lib/sprout/generator.rb +0 -7
- data/lib/sprout/generator/base_mixins.rb +0 -186
- data/lib/sprout/generator/named_base.rb +0 -227
- data/lib/sprout/project_model.rb +0 -278
- data/lib/sprout/simple_resolver.rb +0 -88
- data/lib/sprout/tasks/erb_resolver.rb +0 -118
- data/lib/sprout/tasks/gem_wrap_task.rb +0 -214
- data/lib/sprout/tasks/git_task.rb +0 -134
- data/lib/sprout/tasks/library_task.rb +0 -118
- data/lib/sprout/tasks/sftp_task.rb +0 -248
- data/lib/sprout/tasks/ssh_task.rb +0 -153
- data/lib/sprout/tasks/tool_task.rb +0 -836
- data/lib/sprout/tasks/zip_task.rb +0 -158
- data/lib/sprout/tool_task_model.rb +0 -19
- data/lib/sprout/user.rb +0 -415
- data/lib/sprout/version_file.rb +0 -89
- data/lib/sprout/zip_util.rb +0 -61
- data/samples/gem_wrap/rakefile.rb +0 -17
data/lib/sprout/version_file.rb
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
module Sprout
|
2
|
-
|
3
|
-
# Used by the GitTask to load, parse and persist Version information
|
4
|
-
# related to a project.
|
5
|
-
# Expects a file with a 3 digit number, separated by periods like:
|
6
|
-
#
|
7
|
-
# 3.4.2
|
8
|
-
#
|
9
|
-
# Create with a path to the file like:
|
10
|
-
#
|
11
|
-
# version = VersionFile.new('path/Version.txt')
|
12
|
-
#
|
13
|
-
class VersionFile
|
14
|
-
|
15
|
-
def initialize(file_path)
|
16
|
-
@file_path = file_path
|
17
|
-
read_value
|
18
|
-
end
|
19
|
-
|
20
|
-
def value=(value)
|
21
|
-
@value = value
|
22
|
-
write_value
|
23
|
-
end
|
24
|
-
|
25
|
-
def value
|
26
|
-
@value
|
27
|
-
end
|
28
|
-
|
29
|
-
def major_version
|
30
|
-
@value.split('.').shift.to_i
|
31
|
-
end
|
32
|
-
|
33
|
-
def minor_version
|
34
|
-
@value.split('.')[1].to_i
|
35
|
-
end
|
36
|
-
|
37
|
-
def revision
|
38
|
-
@value.split('.').pop.to_i
|
39
|
-
end
|
40
|
-
|
41
|
-
def increment_revision
|
42
|
-
self.revision = self.revision + 1
|
43
|
-
end
|
44
|
-
|
45
|
-
def to_s
|
46
|
-
@value
|
47
|
-
end
|
48
|
-
|
49
|
-
def to_str
|
50
|
-
@value
|
51
|
-
end
|
52
|
-
|
53
|
-
def to_tag
|
54
|
-
parts = value.split('.')
|
55
|
-
parts[0] = add_leading_zeros(parts[0], 2)
|
56
|
-
parts[1] = add_leading_zeros(parts[1], 2)
|
57
|
-
parts[2] = add_leading_zeros(parts[2], 3)
|
58
|
-
return parts.join('.')
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|
62
|
-
|
63
|
-
def add_leading_zeros(str, digits)
|
64
|
-
(digits - str.size).times do
|
65
|
-
str = "0#{str}"
|
66
|
-
end
|
67
|
-
str
|
68
|
-
end
|
69
|
-
|
70
|
-
def read_value
|
71
|
-
File.open(@file_path, 'r') do |file|
|
72
|
-
@value = file.read.strip
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def write_value
|
77
|
-
File.open(@file_path, 'r+') do |file|
|
78
|
-
file.write @value
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def revision=(revision)
|
83
|
-
parts = @value.split('.')
|
84
|
-
parts[2] = revision
|
85
|
-
@value = parts.join('.')
|
86
|
-
write_value
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
data/lib/sprout/zip_util.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
|
2
|
-
module Sprout
|
3
|
-
class ZipUtil #:nodoc:
|
4
|
-
|
5
|
-
# Pack up an archive from a directory on disk
|
6
|
-
def self.pack(input, archive, excludes)
|
7
|
-
Zip::ZipFile.open(archive, Zip::ZipFile::CREATE) do |zip|
|
8
|
-
add_file_to_zip(zip, input, excludes)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
# Unpack an archive to a directory on disk
|
13
|
-
def self.unpack(archive, destination)
|
14
|
-
Zip::ZipFile.open(archive) do |zip|
|
15
|
-
unpack_file(zip, destination)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.unpack_file(zip, destination, path='')
|
20
|
-
if(zip.file.file?(path))
|
21
|
-
File.open(File.join(destination, path), 'w') do |dest|
|
22
|
-
zip.file.open(path) do |src|
|
23
|
-
dest.write src.read
|
24
|
-
end
|
25
|
-
end
|
26
|
-
else
|
27
|
-
Dir.mkdir(File.join(destination, path))
|
28
|
-
zip.dir.foreach(path) do |dir|
|
29
|
-
unpack_file(zip, destination, File.join(path, dir))
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.add_file_to_zip(zip, path, excludes)
|
35
|
-
if(File.directory?(path))
|
36
|
-
zip.dir.mkdir(path)
|
37
|
-
Dir.open(path).each do |child|
|
38
|
-
if(!excluded?(child, excludes))
|
39
|
-
add_file_to_zip(zip, File.join(path, child), excludes)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
else
|
43
|
-
File.open(path) do |src|
|
44
|
-
zip.file.open(path, 'w') do |dest|
|
45
|
-
dest.write src.read
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.excluded?(str, excludes)
|
52
|
-
excludes.each do |exc|
|
53
|
-
if(str == exc)
|
54
|
-
return true
|
55
|
-
end
|
56
|
-
end
|
57
|
-
return false
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'sprout'
|
2
|
-
|
3
|
-
desc "Wrap the asunit3 library in a rubygem"
|
4
|
-
gem_wrap :asunit3 do |t|
|
5
|
-
t.version = '3.2.0'
|
6
|
-
t.summary = "AsUnit3 is an ActionScript unit test framework for AIR, Flex 2/3 and ActionScript 3 projects"
|
7
|
-
t.author = "Luke Bayes and Ali Mills"
|
8
|
-
t.email = "projectsprouts@googlegroups.com"
|
9
|
-
t.homepage = "http://www.asunit.org"
|
10
|
-
t.sprout_spec =<<EOF
|
11
|
-
- !ruby/object:Sprout::RemoteFileTarget
|
12
|
-
platform: universal
|
13
|
-
url: http://projectsprouts.googlecode.com/files/asunit3-1.1.zip
|
14
|
-
source_path: ''
|
15
|
-
EOF
|
16
|
-
end
|
17
|
-
|