sprout 0.5.29 → 0.7.153

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.

Files changed (48) hide show
  1. data/{MIT-LICENSE.txt → MIT-LICENSE} +0 -0
  2. data/TODO +12 -0
  3. data/bin/sprout +83 -140
  4. data/doc/Bundle +14 -0
  5. data/doc/Generator +35 -0
  6. data/doc/Library +63 -0
  7. data/doc/Task +21 -0
  8. data/doc/Tool +20 -0
  9. data/lib/platform.rb +2 -3
  10. data/lib/progress_bar.rb +39 -23
  11. data/lib/sprout/builder.rb +35 -0
  12. data/lib/sprout/commands/generate.rb +14 -0
  13. data/lib/sprout/general_tasks.rb +5 -0
  14. data/lib/sprout/generator/base_mixins.rb +132 -0
  15. data/lib/sprout/generator/named_base.rb +216 -0
  16. data/lib/sprout/generator.rb +6 -0
  17. data/lib/{log.rb → sprout/log.rb} +2 -2
  18. data/lib/sprout/process_runner.rb +46 -0
  19. data/lib/sprout/project_model.rb +114 -0
  20. data/lib/{remote_file_loader.rb → sprout/remote_file_loader.rb} +63 -36
  21. data/lib/sprout/remote_file_target.rb +96 -0
  22. data/lib/sprout/simple_resolver.rb +88 -0
  23. data/lib/sprout/tasks/gem_wrap_task.rb +192 -0
  24. data/lib/sprout/tasks/library_task.rb +103 -0
  25. data/lib/sprout/tasks/sftp_task.rb +245 -0
  26. data/lib/sprout/tasks/tool_task.rb +541 -0
  27. data/lib/sprout/tasks/zip_task.rb +158 -0
  28. data/lib/{template_resolver.rb → sprout/template_resolver.rb} +10 -7
  29. data/lib/{user.rb → sprout/user.rb} +84 -37
  30. data/lib/sprout/version.rb +4 -3
  31. data/lib/sprout/zip_util.rb +61 -0
  32. data/lib/sprout.rb +377 -285
  33. data/rakefile.rb +93 -119
  34. data/samples/gem_wrap/rakefile.rb +17 -0
  35. metadata +131 -96
  36. data/Manifest.txt +0 -9
  37. data/lib/command.rb +0 -29
  38. data/lib/file_target.rb +0 -8
  39. data/lib/generate.rb +0 -37
  40. data/lib/library.rb +0 -18
  41. data/lib/process_runner.rb +0 -27
  42. data/lib/project.rb +0 -10
  43. data/lib/project_model.rb +0 -59
  44. data/lib/remote_file_target.rb +0 -62
  45. data/lib/task.rb +0 -20
  46. data/lib/template.rb +0 -37
  47. data/lib/tool.rb +0 -18
  48. data/setup.rb +0 -1585
data/lib/project_model.rb DELETED
@@ -1,59 +0,0 @@
1
-
2
- module PatternPark
3
- class ProjectModel
4
- include Singleton
5
-
6
- attr_accessor :project_name,
7
- :src_dir,
8
- :lib_dir,
9
- :bin_dir,
10
- :test_dir,
11
- :asset_dir,
12
- :skin_dir,
13
- :model_dir,
14
- :view_dir,
15
- :controller_dir,
16
- :language
17
-
18
- def initialize
19
- @project_name = 'Project'
20
- @src_dir = 'src'
21
- @lib_dir = 'lib'
22
- @bin_dir = 'bin'
23
- @test_dir = 'test'
24
- @asset_dir = 'assets'
25
- @skin_dir = File.join(@asset_dir, 'img', 'skins')
26
-
27
- @language = 'as2'
28
-
29
- @model_dir = nil
30
- @view_dir = nil
31
- @controller_dir = nil
32
- end
33
-
34
- def project_path
35
- return Sprout.project_path
36
- end
37
-
38
- def model_dir
39
- if(@model_dir.nil?)
40
- @model_dir = File.join(src_dir, project_name.downcase, 'models')
41
- end
42
- return @model_dir
43
- end
44
-
45
- def view_dir
46
- if(@view_dir.nil?)
47
- @view_dir = File.join(src_dir, project_name.downcase, 'views')
48
- end
49
- return @view_dir
50
- end
51
-
52
- def controller_dir
53
- if(@controller_dir.nil?)
54
- @controller_dir = File.join(src_dir, project_name.downcase, 'controllers')
55
- end
56
- return @controller_dir
57
- end
58
- end
59
- end
@@ -1,62 +0,0 @@
1
-
2
- module PatternPark
3
-
4
- class RemoteFileTarget < FileTarget
5
- attr_accessor :url,
6
- :type,
7
- :sprout,
8
- :archive_type,
9
- :archive_path,
10
- :install_path,
11
- :project_path,
12
- :post_install,
13
- :executable,
14
- :mount_path
15
- attr_reader :downloaded_path,
16
- :file_name,
17
- :copy_path
18
-
19
- def resolve
20
- # already run once, don't run again in this session
21
- if(!file_name.nil?)
22
- return
23
- end
24
-
25
- if(executable && User.in_path?(executable))
26
- return
27
- end
28
-
29
- if(url.nil? || url == '')
30
- @file_name = ''
31
- else
32
- @file_name = url.split('/').pop
33
- @downloaded_path = File.join(Sprout.cache, type, install_path, file_name)
34
- end
35
- if(archive_type == 'txt' || archive_type == 'exe')
36
- @install_path = File.join(Sprout.cache, type, install_path)
37
- else
38
- @install_path = File.join(Sprout.cache, type, install_path, archive_type)
39
- end
40
- @copy_path = File.join(install_path, archive_path)
41
-
42
- if(url.nil? || url == '')
43
- return
44
- end
45
-
46
- loader = RemoteFileLoader.new
47
-
48
- if(Sprout.update || !File.exists?(downloaded_path))
49
- # retrieve from the network
50
- loader.get_remote_file(url, downloaded_path)
51
- end
52
-
53
- if(Sprout.update || !File.exists?(install_path))
54
- # unpack into install path
55
- loader.unpack_downloaded_file(downloaded_path, install_path)
56
- if(post_install)
57
- eval(post_install)
58
- end
59
- end
60
- end
61
- end
62
- end
data/lib/task.rb DELETED
@@ -1,20 +0,0 @@
1
-
2
- module PatternPark
3
-
4
- class Task < Sprout
5
-
6
- def type
7
- return 'task'
8
- end
9
-
10
- def execute
11
- super
12
- if(target.project_path != '')
13
- from = target.install_path
14
- to = File.join(Sprout.project_path, target.project_path)
15
- FileUtils.makedirs(to)
16
- TemplateResolver.instance.copy_files(from, to, render)
17
- end
18
- end
19
- end
20
- end
data/lib/template.rb DELETED
@@ -1,37 +0,0 @@
1
-
2
- module PatternPark
3
- require 'find'
4
-
5
- class Template < Sprout
6
-
7
- def type
8
- return 'template'
9
- end
10
-
11
- def execute
12
- if(target)
13
- proj_path = File.join(Sprout.project_path, target.project_path)
14
- from = target.install_path
15
- to = proj_path
16
- FileUtils.makedirs(to)
17
- TemplateResolver.instance.copy_files(from, to, render)
18
-
19
- # This code will change the Sprout.project path
20
- # to the first rakefile found in the template
21
- # I'm not convinced this is a good idea -
22
- # seems like other utils may need to know about
23
- # the structure of a project, but most of them
24
- # need to load the nearest rakefile and use
25
- # the paths identified in them....
26
- Find.find(proj_path) do |path|
27
- Sprout.default_rakefiles.each do |rakefile|
28
- if(File.basename(path) == rakefile)
29
- Sprout.project_path = File.dirname(path)
30
- end
31
- end
32
- end
33
- end
34
- super
35
- end
36
- end
37
- end
data/lib/tool.rb DELETED
@@ -1,18 +0,0 @@
1
-
2
- module PatternPark
3
-
4
- class Tool < Sprout
5
- attr_accessor :executable_path
6
-
7
- def type
8
- return 'tool'
9
- end
10
-
11
- def load_target
12
- super
13
- if(archive_path.size > 3 && File.exists?(archive_path))
14
- File.chmod(0755, archive_path)
15
- end
16
- end
17
- end
18
- end