Module: Sprout

Defined in:
sprout/lib/sprout.rb,
sprout/lib/sprout/errors.rb,
sprout/lib/sprout/system.rb,
sprout/lib/sprout/version.rb,
sprout/lib/sprout/concern.rb,
sprout/lib/sprout/library.rb,
sprout/lib/sprout/platform.rb,
sprout/lib/sprout/generator.rb,
sprout/lib/sprout/executable.rb,
sprout/lib/sprout/file_target.rb,
sprout/lib/sprout/rdoc_parser.rb,
sprout/lib/sprout/progress_bar.rb,
sprout/lib/sprout/command_line.rb,
sprout/lib/sprout/ruby_feature.rb,
sprout/lib/sprout/specification.rb,
sprout/lib/sprout/output_buffer.rb,
sprout/lib/sprout/process_runner.rb,
sprout/lib/sprout/executable/url.rb,
sprout/lib/sprout/generator/base.rb,
sprout/lib/sprout/executable/path.rb,
sprout/lib/sprout/executable/base.rb,
sprout/lib/sprout/executable/urls.rb,
sprout/lib/sprout/executable/paths.rb,
sprout/lib/sprout/executable/param.rb,
sprout/lib/sprout/executable/files.rb,
sprout/lib/sprout/executable/number.rb,
sprout/lib/sprout/remote_file_target.rb,
sprout/lib/sprout/remote_file_loader.rb,
sprout/lib/sprout/executable/boolean.rb,
sprout/lib/sprout/executable/strings.rb,
flashsdk/lib/flashplayer/system_mixins.rb,
sprout/lib/sprout/executable/file_param.rb,
sprout/lib/sprout/executable/string_param.rb,
sprout/lib/sprout/executable/collection_param.rb,
sprout/lib/sprout/generators/ruby/ruby_generator.rb,
sprout/lib/sprout/generators/tool/tool_generator.rb,
sprout/lib/sprout/generators/library/library_generator.rb,
sprout/lib/sprout/generators/generator/generator_generator.rb

Defined Under Namespace

Modules: Concern, Errors, Executable, Generator, RubyFeature, System, TestHelper, VERSION Classes: ArchiveUnpacker, CommandLine, FileTarget, GeneratorGenerator, Library, LibraryGenerator, OutputBuffer, Platform, ProcessRunner, ProgressBar, ProgressBarImpl, ProgressBarManager, ProgressBarOutputStream, RDocParser, RemoteFileLoader, RemoteFileTarget, ReversedProgressBar, RubyGenerator, Specification, ToolGenerator

Constant Summary

NAME =
'sprout'

Class Method Summary (collapse)

Class Method Details

+ (Dir) cache

where Sprouts will look for downloaded archives.

puts ">> Sprout Cache: #{Sprout.cache}"

Returns:

  • (Dir)

    The system-specific path to the writeable cache directory



63
64
65
# File 'sprout/lib/sprout.rb', line 63

def cache
  File.join(home, 'cache')
end

+ (Sprout::System) current_system

determine features like the cache path and how external processes are executed.

system = Sprout.current_system
puts ">> System: #{system.inspect}"

Returns:



95
96
97
# File 'sprout/lib/sprout.rb', line 95

def current_system
  Sprout::System.create
end

+ (File) file_from_caller(caller_string)

a Ruby exception.

Note: It's a real bummer that this string is colon delimited - The value on Windows often includes a colon... Once again, Windows is dissed by fundamental Ruby decisions.

Returns:

  • (File)

    Path to the file from the 'caller' property of



122
123
124
125
126
127
128
129
# File 'sprout/lib/sprout.rb', line 122

def file_from_caller caller_string
  parts = caller_string.split(':')
  str   = parts.shift
  while(parts.size > 0 && !File.exists?(str))
    str << ":#{parts.shift}"
  end
  str
end

+ (Dir) generator_cache

templates.

puts ">> Generator Cache: #{Sprout.generator_cache}"

Returns:

  • (Dir)

    The location where Sprouts will look for generators and their



83
84
85
# File 'sprout/lib/sprout.rb', line 83

def generator_cache
  File.join cache, 'generators'
end

+ (Dir) home

will write files and generators and their templates.

puts ">> Sprout home: #{Sprout.home}"

Returns:

  • (Dir)

    The location where the currently-running version of Sprouts



73
74
75
# File 'sprout/lib/sprout.rb', line 73

def home
  File.join(current_system.application_home('sprouts'), Sprout::VERSION::MAJOR_MINOR)
end

+ (Object) stderr



111
112
113
# File 'sprout/lib/sprout.rb', line 111

def stderr
  @stderr ||= $stderr
end

+ (Object) stderr=(err)



107
108
109
# File 'sprout/lib/sprout.rb', line 107

def stderr=(err)
  @stderr = err
end

+ (Object) stdout



103
104
105
# File 'sprout/lib/sprout.rb', line 103

def stdout
  @stdout ||= $stdout
end

+ (Object) stdout=(out)



99
100
101
# File 'sprout/lib/sprout.rb', line 99

def stdout=(out)
  @stdout = out
end