sprout-developer-bundle 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sprout/developer.rb +4 -0
- data/lib/sprout/developer/version.rb +12 -0
- data/lib/sprout/generators/tool/templates/binary.rb +11 -0
- data/lib/sprout/generators/tool/templates/rakefile.rb +13 -0
- data/lib/sprout/generators/tool/templates/sprout.spec +1 -0
- data/lib/sprout/generators/tool/templates/version.rb +12 -0
- data/lib/sprout/generators/tool/tool_generator.rb +103 -0
- data/rakefile.rb +54 -0
- metadata +78 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# Created by Pattern Park, Inc.
|
|
4
|
+
# Copyright (c) 2007. All rights reserved.
|
|
5
|
+
|
|
6
|
+
require 'rubygems'
|
|
7
|
+
require 'sprout'
|
|
8
|
+
require 'sprout/<%= tool_name %>/version'
|
|
9
|
+
|
|
10
|
+
exe = Sprout::Sprout.get_executable('sprout-<%= tool_name %>-tool', '<%= binary %>', Sprout::<%= class_name %>::VERSION::STRING)
|
|
11
|
+
exec("#{exe} #{ARGV.join(' ')}")
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
gem_wrap 'sprout-<%= tool_name %>-tool' do |t|
|
|
3
|
+
t.version = '<%= gem_version %>'
|
|
4
|
+
t.summary = 'ActionScript 3.0 API for Flickr'
|
|
5
|
+
t.author = 'Charles Bihis, Mike Potter, Darron Schall and Mike Chambers'
|
|
6
|
+
t.homepage = 'http://actionscript3libraries.riaforge.org/'
|
|
7
|
+
t.sprout_spec =<<EOF
|
|
8
|
+
- !ruby/object:Sprout::RemoteFileTarget
|
|
9
|
+
platform: universal
|
|
10
|
+
url: http://as3flickrlib.googlecode.com/files/flickr-.87.zip
|
|
11
|
+
archive_path: flickr-.87/src
|
|
12
|
+
EOF
|
|
13
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= sprout_spec %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Sprout
|
|
2
|
+
class <%= class_name %>
|
|
3
|
+
module VERSION #:nodoc:
|
|
4
|
+
MAJOR = <%= major_version %>
|
|
5
|
+
MINOR = <%= minor_version %>
|
|
6
|
+
TINY = <%= tiny_version %>
|
|
7
|
+
|
|
8
|
+
STRING = [MAJOR, MINOR, TINY].join('.')
|
|
9
|
+
MAJOR_MINOR = [MAJOR, MINOR].join('.')
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
|
|
2
|
+
class ToolGeneratorError < StandardError #:nodoc:
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
# Generate a new Sprout tool project.
|
|
6
|
+
# This generator can be executed as follows:
|
|
7
|
+
#
|
|
8
|
+
# sprout -n developer Flex3SDK
|
|
9
|
+
#
|
|
10
|
+
class ToolGenerator < Sprout::Generator::NamedBase
|
|
11
|
+
|
|
12
|
+
def manifest
|
|
13
|
+
record do |m|
|
|
14
|
+
# Create outer directory
|
|
15
|
+
m.directory tool_name
|
|
16
|
+
m.directory File.join(tool_name, 'bin') unless executables.size == 0
|
|
17
|
+
|
|
18
|
+
# Create rakefile
|
|
19
|
+
m.template 'rakefile.rb', File.join(tool_name, 'rakefile.rb')
|
|
20
|
+
|
|
21
|
+
# Create version.rb file
|
|
22
|
+
version_path = File.join(tool_name, 'lib', 'sprout', tool_name)
|
|
23
|
+
m.directory version_path
|
|
24
|
+
m.template 'version.rb', File.join(version_path, 'version.rb')
|
|
25
|
+
|
|
26
|
+
# Copy sprout.spec to new project
|
|
27
|
+
new_spec = File.join(tool_name, 'sprout.spec')
|
|
28
|
+
m.template 'sprout.spec', new_spec
|
|
29
|
+
|
|
30
|
+
# Create rubygem binaries for each executable
|
|
31
|
+
executables.each do |binary|
|
|
32
|
+
target = File.join(tool_name, 'bin', File.basename(binary))
|
|
33
|
+
m.template 'binary.rb', target, :assigns => { :binary => binary }
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def gem_version
|
|
39
|
+
options[:gem_version]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def executables
|
|
43
|
+
options[:executables]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def sprout_spec
|
|
47
|
+
options[:sprout_spec]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def major_version
|
|
51
|
+
gem_version.split('.')[0]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def minor_version
|
|
55
|
+
gem_version.split('.')[1]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def tiny_version
|
|
59
|
+
gem_version.split('.')[2]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def tool_name
|
|
63
|
+
@tool_name ||= class_name.downcase
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
protected
|
|
67
|
+
# Override with your own usage banner.
|
|
68
|
+
def banner
|
|
69
|
+
"Usage: #{$0} tool toolname --exe path_to_exe [--version gem_version, --exe path_to_another_exe]"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def options
|
|
73
|
+
options ||= default_options
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def add_options!(opt)
|
|
77
|
+
super
|
|
78
|
+
options[:gem_version] = '0.0.0'
|
|
79
|
+
options[:executables] = []
|
|
80
|
+
options[:sprout_spec] = ''
|
|
81
|
+
|
|
82
|
+
opt.separator ''
|
|
83
|
+
opt.separator 'Options:'
|
|
84
|
+
opt.on("-g", "--gem-version=VERSION", String,
|
|
85
|
+
"The version of the tool (e.g., 1.0.0)"
|
|
86
|
+
) do |version|
|
|
87
|
+
options[:gem_version] = version
|
|
88
|
+
end
|
|
89
|
+
opt.on("-e", "--exe=EXECUTABLE", String,
|
|
90
|
+
"Add the relative path, from the archive root, to an executable (e.g., --exe bin/mxmlc --exe bin/asdoc --exe bin/fdb)"
|
|
91
|
+
) do |exe|
|
|
92
|
+
options[:executables] << exe
|
|
93
|
+
end
|
|
94
|
+
opt.on("-s", "--sprout-spec=SPEC", String,
|
|
95
|
+
"Path to sprout.spec file"
|
|
96
|
+
) do |spec|
|
|
97
|
+
spec = File.expand_path(spec)
|
|
98
|
+
raise ToolGeneratorError.new("Provided spec file does not exist #{spec}") unless File.exists?(spec)
|
|
99
|
+
options[:sprout_spec] = File.open(spec, 'r').read
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|
data/rakefile.rb
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
require 'rake/gempackagetask'
|
|
3
|
+
require 'rake/clean'
|
|
4
|
+
require 'rake/testtask'
|
|
5
|
+
require 'lib/sprout/developer/version'
|
|
6
|
+
|
|
7
|
+
SPROUT_HOME = ENV['SPROUT_HOME']
|
|
8
|
+
|
|
9
|
+
PROJECT = 'sprout'
|
|
10
|
+
NAME = 'sprout-developer-bundle'
|
|
11
|
+
SUMMARY = 'Project and Code Generators for Sprout development'
|
|
12
|
+
GEM_VERSION = Sprout::Developer::VERSION::STRING
|
|
13
|
+
AUTHOR = 'Pattern Park'
|
|
14
|
+
EMAIL = 'projectsprouts@googlegroups.com'
|
|
15
|
+
HOMEPAGE = 'http://www.projectsprouts.org'
|
|
16
|
+
DESCRIPTION = "Project and Code Generators for Sprout development"
|
|
17
|
+
HOMEPATH = "http://#{PROJECT}.rubyforge.org"
|
|
18
|
+
RELEASE_TYPES = ["gem"]
|
|
19
|
+
PKG_LIST = FileList['[a-zA-Z]*',
|
|
20
|
+
'lib/**/*'
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
PKG_LIST.exclude('.svn')
|
|
24
|
+
PKG_LIST.exclude('artifacts')
|
|
25
|
+
PKG_LIST.each do |file|
|
|
26
|
+
task :package => file
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
spec = Gem::Specification.new do |s|
|
|
30
|
+
s.platform = Gem::Platform::RUBY
|
|
31
|
+
s.summary = SUMMARY
|
|
32
|
+
s.description = DESCRIPTION
|
|
33
|
+
s.name = NAME
|
|
34
|
+
s.version = GEM_VERSION
|
|
35
|
+
s.author = AUTHOR
|
|
36
|
+
s.email = EMAIL
|
|
37
|
+
s.homepage = HOMEPAGE
|
|
38
|
+
s.rubyforge_project = PROJECT
|
|
39
|
+
s.require_path = 'lib'
|
|
40
|
+
s.autorequire = 'sprout/as3'
|
|
41
|
+
s.has_rdoc = false
|
|
42
|
+
s.files = PKG_LIST.to_a
|
|
43
|
+
|
|
44
|
+
s.add_dependency('sprout', '>= 0.7.1')
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
Rake::GemPackageTask.new(spec) do |p|
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
require File.join(SPROUT_HOME, 'sprout/script/build_helpers')
|
|
51
|
+
|
|
52
|
+
# Each task that wants this feature, needs to set this up
|
|
53
|
+
# because the flexsdks shouldn't get it...
|
|
54
|
+
#task :release => :increment_revision
|
metadata
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: sprout-developer-bundle
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Pattern Park
|
|
8
|
+
autorequire: sprout/as3
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2008-02-10 00:00:00 -08:00
|
|
13
|
+
default_executable:
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: sprout
|
|
17
|
+
version_requirement:
|
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
19
|
+
requirements:
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 0.7.1
|
|
23
|
+
version:
|
|
24
|
+
description: Project and Code Generators for Sprout development
|
|
25
|
+
email: projectsprouts@googlegroups.com
|
|
26
|
+
executables: []
|
|
27
|
+
|
|
28
|
+
extensions: []
|
|
29
|
+
|
|
30
|
+
extra_rdoc_files: []
|
|
31
|
+
|
|
32
|
+
files:
|
|
33
|
+
- lib
|
|
34
|
+
- pkg
|
|
35
|
+
- rakefile.rb
|
|
36
|
+
- test
|
|
37
|
+
- lib/sprout
|
|
38
|
+
- lib/sprout/developer
|
|
39
|
+
- lib/sprout/developer/version.rb
|
|
40
|
+
- lib/sprout/developer.rb
|
|
41
|
+
- lib/sprout/generators
|
|
42
|
+
- lib/sprout/generators/bundle
|
|
43
|
+
- lib/sprout/generators/library
|
|
44
|
+
- lib/sprout/generators/tool
|
|
45
|
+
- lib/sprout/generators/tool/templates
|
|
46
|
+
- lib/sprout/generators/tool/templates/binary.rb
|
|
47
|
+
- lib/sprout/generators/tool/templates/rakefile.rb
|
|
48
|
+
- lib/sprout/generators/tool/templates/sprout.spec
|
|
49
|
+
- lib/sprout/generators/tool/templates/version.rb
|
|
50
|
+
- lib/sprout/generators/tool/tool_generator.rb
|
|
51
|
+
has_rdoc: false
|
|
52
|
+
homepage: http://www.projectsprouts.org
|
|
53
|
+
post_install_message:
|
|
54
|
+
rdoc_options: []
|
|
55
|
+
|
|
56
|
+
require_paths:
|
|
57
|
+
- lib
|
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: "0"
|
|
63
|
+
version:
|
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: "0"
|
|
69
|
+
version:
|
|
70
|
+
requirements: []
|
|
71
|
+
|
|
72
|
+
rubyforge_project: sprout
|
|
73
|
+
rubygems_version: 1.0.1
|
|
74
|
+
signing_key:
|
|
75
|
+
specification_version: 2
|
|
76
|
+
summary: Project and Code Generators for Sprout development
|
|
77
|
+
test_files: []
|
|
78
|
+
|