airake 0.2.4 → 0.2.5
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/History.txt +8 -0
- data/Manifest.txt +4 -0
- data/air_generators/class/USAGE +8 -0
- data/air_generators/class/class_generator.rb +62 -0
- data/air_generators/class/templates/Class.as +11 -0
- data/app_generators/airake/airake_generator.rb +11 -3
- data/app_generators/browsair/browsair_generator.rb +9 -4
- data/bin/airake +2 -2
- data/bin/browsair +2 -2
- data/config/hoe.rb +2 -2
- data/lib/airake/commands/adl.rb +5 -1
- data/lib/airake/commands/adt.rb +6 -2
- data/lib/airake/commands/amxmlc.rb +5 -1
- data/lib/airake/version.rb +1 -1
- data/test/test_airake_generator.rb +3 -0
- data/test/test_browsair_generator.rb +3 -0
- data/test/test_class_generator.rb +43 -0
- metadata +10 -5
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.2.5 2007-10-17
|
2
|
+
|
3
|
+
* airake and browsair apps includes script/generate and script/destroy for rubigen scopes :air and :airake [drnic]
|
4
|
+
* airake @name and @app_name based on base_name not arguments [drnic]
|
5
|
+
* upgraded dependency rubigen 1.0.3 -> 1.0.4 [drnic]
|
6
|
+
* fixed bin/airake and browsair --version [gabe]
|
7
|
+
* added class generator [gabe]
|
8
|
+
|
1
9
|
== 0.2.4 2007-10-13
|
2
10
|
|
3
11
|
* Fixing custom icon specification
|
data/Manifest.txt
CHANGED
@@ -4,6 +4,9 @@ Manifest.txt
|
|
4
4
|
Notes.txt
|
5
5
|
README.txt
|
6
6
|
Rakefile
|
7
|
+
air_generators/class/USAGE
|
8
|
+
air_generators/class/class_generator.rb
|
9
|
+
air_generators/class/templates/Class.as
|
7
10
|
app_generators/airake/USAGE
|
8
11
|
app_generators/airake/airake_generator.rb
|
9
12
|
app_generators/airake/templates/README
|
@@ -49,5 +52,6 @@ tasks/website.rake
|
|
49
52
|
test/test_airake.rb
|
50
53
|
test/test_airake_generator.rb
|
51
54
|
test/test_browsair_generator.rb
|
55
|
+
test/test_class_generator.rb
|
52
56
|
test/test_generator_helper.rb
|
53
57
|
test/test_helper.rb
|
@@ -0,0 +1,62 @@
|
|
1
|
+
class ClassGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
attr_reader :name, :package, :class_name, :src_dir
|
4
|
+
|
5
|
+
def initialize(runtime_args, runtime_options = {})
|
6
|
+
super
|
7
|
+
usage if args.empty?
|
8
|
+
@name = args.shift
|
9
|
+
|
10
|
+
@src_dir = args.shift unless args.empty?
|
11
|
+
@src_dir ||= "src"
|
12
|
+
|
13
|
+
# Split com.foo.Bar into package ["com", "foo" ] and class_name "Bar"
|
14
|
+
if @name.rindex(".")
|
15
|
+
@package = @name[0...@name.rindex(".")]
|
16
|
+
@class_name = @name[@name.rindex(".")+1..-1]
|
17
|
+
else
|
18
|
+
@package = ""
|
19
|
+
@class_name = @name
|
20
|
+
end
|
21
|
+
|
22
|
+
extract_options
|
23
|
+
end
|
24
|
+
|
25
|
+
def manifest
|
26
|
+
record do |m|
|
27
|
+
# Ensure appropriate folder(s) exists
|
28
|
+
|
29
|
+
dir = src_dir
|
30
|
+
unless package.blank?
|
31
|
+
dir = File.join(src_dir, package.split("."))
|
32
|
+
m.directory dir
|
33
|
+
end
|
34
|
+
|
35
|
+
m.template "Class.as", File.join(dir, class_name + ".as")
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
protected
|
41
|
+
def banner
|
42
|
+
""
|
43
|
+
end
|
44
|
+
|
45
|
+
def add_options!(opts)
|
46
|
+
# opts.separator ''
|
47
|
+
# opts.separator 'Options:'
|
48
|
+
# For each option below, place the default
|
49
|
+
# at the top of the file next to "default_options"
|
50
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
51
|
+
# "Some comment about this option",
|
52
|
+
# "Default: none") { |options[:author]| }
|
53
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
54
|
+
end
|
55
|
+
|
56
|
+
def extract_options
|
57
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
58
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
59
|
+
# raw instance variable value.
|
60
|
+
# @author = options[:author]
|
61
|
+
end
|
62
|
+
end
|
@@ -1,11 +1,15 @@
|
|
1
1
|
class AirakeGenerator < RubiGen::Base
|
2
2
|
|
3
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
4
|
+
Config::CONFIG['ruby_install_name'])
|
5
|
+
|
3
6
|
attr_reader :name, :app_name, :title, :url, :description, :show_buttons
|
4
7
|
|
5
8
|
def initialize(runtime_args, runtime_options = {})
|
6
9
|
super
|
7
10
|
usage if args.empty? || args.size < 1
|
8
|
-
@
|
11
|
+
@destination_root = File.expand_path(args.shift)
|
12
|
+
@name = base_name
|
9
13
|
@app_name = @name.gsub(/\s+/, "").camelize
|
10
14
|
@title = @name
|
11
15
|
@url = "http://airake.rubyforge.org/resources.html"
|
@@ -13,11 +17,12 @@ class AirakeGenerator < RubiGen::Base
|
|
13
17
|
@show_buttons = true
|
14
18
|
extract_options
|
15
19
|
|
16
|
-
@destination_root = File.expand_path(@name)
|
17
20
|
@source_root = File.join(File.dirname(__FILE__), "..", "shared")
|
18
21
|
end
|
19
22
|
|
20
|
-
def manifest
|
23
|
+
def manifest
|
24
|
+
script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
|
25
|
+
|
21
26
|
record do |m|
|
22
27
|
# Ensure appropriate folder(s) exists
|
23
28
|
m.directory ''
|
@@ -44,6 +49,8 @@ class AirakeGenerator < RubiGen::Base
|
|
44
49
|
m.file "icons/Web.png", "src/assets/app_icons/icon_128.png"
|
45
50
|
m.file "icons/MouseRunnerDotComGraphicsLicense.txt", "src/assets/app_icons/MouseRunnerDotComGraphicsLicense.txt"
|
46
51
|
|
52
|
+
m.dependency "install_rubigen_scripts", [destination_root, "air", "airake"], :shebang => options[:shebang]
|
53
|
+
|
47
54
|
end
|
48
55
|
end
|
49
56
|
|
@@ -80,6 +87,7 @@ EOS
|
|
80
87
|
bin
|
81
88
|
lib
|
82
89
|
src
|
90
|
+
script
|
83
91
|
test
|
84
92
|
)
|
85
93
|
end
|
@@ -1,12 +1,15 @@
|
|
1
1
|
class BrowsairGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
4
|
+
Config::CONFIG['ruby_install_name'])
|
2
5
|
|
3
6
|
attr_reader :name, :app_name, :url, :title, :description, :icon_src_path, :show_buttons
|
4
7
|
|
5
8
|
def initialize(runtime_args, runtime_options = {})
|
6
9
|
super
|
7
10
|
usage if args.empty? || args.size < 2
|
8
|
-
@
|
9
|
-
@name =
|
11
|
+
@destination_root = File.expand_path(args.shift)
|
12
|
+
@name = base_name
|
10
13
|
@app_name = @name.gsub(/\s+/, "")
|
11
14
|
@url = args.shift
|
12
15
|
@title = "#{@name} - #{@url}"
|
@@ -14,7 +17,6 @@ class BrowsairGenerator < RubiGen::Base
|
|
14
17
|
@icon_src_path = File.expand_path(args.shift) unless args.empty?
|
15
18
|
extract_options
|
16
19
|
|
17
|
-
@destination_root = File.expand_path(@path)
|
18
20
|
@source_root = File.join(File.dirname(__FILE__), "..", "shared")
|
19
21
|
end
|
20
22
|
|
@@ -54,7 +56,10 @@ class BrowsairGenerator < RubiGen::Base
|
|
54
56
|
icon_dest_path = destination_path("src/assets/app_icons/icon_128.png")
|
55
57
|
FileUtils.mkdir_p(destination_path("src/assets/app_icons"))
|
56
58
|
FileUtils.cp(icon_src_path, icon_dest_path)
|
57
|
-
end
|
59
|
+
end
|
60
|
+
|
61
|
+
m.dependency "install_rubigen_scripts", [destination_root, "air", "browsair"], :shebang => options[:shebang]
|
62
|
+
|
58
63
|
|
59
64
|
end
|
60
65
|
end
|
data/bin/airake
CHANGED
@@ -2,8 +2,8 @@ require 'rubygems'
|
|
2
2
|
require 'rubigen'
|
3
3
|
|
4
4
|
if %w(-v --version).include? ARGV.first
|
5
|
-
require '
|
6
|
-
puts "#{File.basename($0)} #{
|
5
|
+
require 'airake/version'
|
6
|
+
puts "#{File.basename($0)} #{Airake::VERSION::STRING}"
|
7
7
|
exit(0)
|
8
8
|
end
|
9
9
|
|
data/bin/browsair
CHANGED
@@ -2,8 +2,8 @@ require 'rubygems'
|
|
2
2
|
require 'rubigen'
|
3
3
|
|
4
4
|
if %w(-v --version).include? ARGV.first
|
5
|
-
require '
|
6
|
-
puts "#{File.basename($0)} #{
|
5
|
+
require 'airake/version'
|
6
|
+
puts "#{File.basename($0)} #{Airake::VERSION::STRING}"
|
7
7
|
exit(0)
|
8
8
|
end
|
9
9
|
|
data/config/hoe.rb
CHANGED
@@ -2,7 +2,7 @@ require 'airake/version'
|
|
2
2
|
|
3
3
|
AUTHOR = 'Gabriel Handford, Min Kim'
|
4
4
|
EMAIL = "gabrielh@gmail.com"
|
5
|
-
DESCRIPTION = "
|
5
|
+
DESCRIPTION = "Tasks and generators for Adobe AIR apps"
|
6
6
|
GEM_NAME = 'airake'
|
7
7
|
RUBYFORGE_PROJECT = 'airake' # The unix name for your project
|
8
8
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
@@ -61,7 +61,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
61
61
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
|
62
62
|
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
63
63
|
p.extra_deps = [
|
64
|
-
['rubigen','>=1.0.
|
64
|
+
['rubigen','>=1.0.4']
|
65
65
|
]
|
66
66
|
|
67
67
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
data/lib/airake/commands/adl.rb
CHANGED
@@ -2,17 +2,21 @@ module Airake
|
|
2
2
|
|
3
3
|
module Commands
|
4
4
|
|
5
|
+
# ADL (Adobe Debug Lancher)
|
6
|
+
#
|
7
|
+
# http://livedocs.adobe.com/labs/air/1/devappsflex/help.html?content=CommandLineTools_4.html#1031914
|
5
8
|
class Adl < Base
|
6
9
|
|
7
10
|
attr_reader :project, :path, :extra_opts
|
8
11
|
|
12
|
+
# options:: :adl_path, adl_extra_opts
|
9
13
|
def initialize(project, options = {})
|
10
14
|
@project = project
|
11
15
|
@path = options[:adl_path] || "adl"
|
12
16
|
@extra_opts = options[:adl_extra_opts]
|
13
17
|
end
|
14
18
|
|
15
|
-
# Get the ADL command
|
19
|
+
# Get the ADL launch command
|
16
20
|
def launch
|
17
21
|
command = []
|
18
22
|
command << @path
|
data/lib/airake/commands/adt.rb
CHANGED
@@ -2,10 +2,14 @@ module Airake
|
|
2
2
|
|
3
3
|
module Commands
|
4
4
|
|
5
|
+
# ADT (Adobe Developer Tool)
|
6
|
+
#
|
7
|
+
# http://livedocs.adobe.com/labs/air/1/devappsflex/help.html?content=CommandLineTools_5.html
|
5
8
|
class Adt < Base
|
6
9
|
|
7
10
|
attr_reader :project, :path, :certificate, :extra_opts, :assets
|
8
11
|
|
12
|
+
# options:: :adt_path, :certificate, :adt_extra_opts, :assets
|
9
13
|
def initialize(project, options = {})
|
10
14
|
@project = project
|
11
15
|
@path = options[:adt_path] || "adt"
|
@@ -14,7 +18,7 @@ module Airake
|
|
14
18
|
@assets = options[:assets]
|
15
19
|
end
|
16
20
|
|
17
|
-
# Get the ADT command
|
21
|
+
# Get the ADT package command
|
18
22
|
def package
|
19
23
|
command = []
|
20
24
|
command << @path
|
@@ -28,7 +32,7 @@ module Airake
|
|
28
32
|
process(command)
|
29
33
|
end
|
30
34
|
|
31
|
-
#
|
35
|
+
# Get the ADT certificate command to generate a certificate
|
32
36
|
#
|
33
37
|
# cn:: Common name
|
34
38
|
# pfx_file:: Output certificate path
|
@@ -2,17 +2,21 @@ module Airake
|
|
2
2
|
|
3
3
|
module Commands
|
4
4
|
|
5
|
+
# AMXMLC (AIR MXML compiler)
|
6
|
+
#
|
7
|
+
# http://livedocs.adobe.com/labs/air/1/devappsflex/help.html?content=CommandLineTools_2.html#1032546
|
5
8
|
class Amxmlc < Base
|
6
9
|
|
7
10
|
attr_reader :project, :path, :extra_opts
|
8
11
|
|
12
|
+
# options:: :amxmlc_path, :amxmlc_extra_opts
|
9
13
|
def initialize(project, options = {})
|
10
14
|
@project = project
|
11
15
|
@path = options[:amxmlc_path] || "amxmlc"
|
12
16
|
@extra_opts = options[:amxmlc_extra_opts]
|
13
17
|
end
|
14
18
|
|
15
|
-
# Get the amxmlc command
|
19
|
+
# Get the amxmlc compile command
|
16
20
|
def compile
|
17
21
|
command = []
|
18
22
|
command << @path
|
data/lib/airake/version.rb
CHANGED
@@ -36,6 +36,9 @@ class TestAirakeGenerator < Test::Unit::TestCase
|
|
36
36
|
assert_directory_exists "lib"
|
37
37
|
assert_directory_exists "src"
|
38
38
|
assert_directory_exists "test"
|
39
|
+
assert_directory_exists "script"
|
40
|
+
assert_generated_file "script/generate"
|
41
|
+
assert_generated_file "script/destroy"
|
39
42
|
end
|
40
43
|
|
41
44
|
private
|
@@ -31,6 +31,9 @@ class TestBrowsairGenerator < Test::Unit::TestCase
|
|
31
31
|
assert_generated_file "README"
|
32
32
|
assert_directory_exists "bin"
|
33
33
|
assert_directory_exists "src"
|
34
|
+
assert_directory_exists "script"
|
35
|
+
assert_generated_file "script/generate"
|
36
|
+
assert_generated_file "script/destroy"
|
34
37
|
end
|
35
38
|
|
36
39
|
def test_generator_with_icon
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
class TestClassGenerator < Test::Unit::TestCase
|
4
|
+
include RubiGen::GeneratorTestHelper
|
5
|
+
|
6
|
+
def setup
|
7
|
+
bare_setup
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
bare_teardown
|
12
|
+
end
|
13
|
+
|
14
|
+
# Some generator-related assertions:
|
15
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
16
|
+
# assert_directory_exists(name)
|
17
|
+
# assert_generated_class(name, &block)
|
18
|
+
# assert_generated_module(name, &block)
|
19
|
+
# assert_generated_test_for(name, &block)
|
20
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
21
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
22
|
+
#
|
23
|
+
# Other helper methods are:
|
24
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
25
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
26
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
27
|
+
|
28
|
+
def test_generator_without_options
|
29
|
+
clazz = "foo.bar.TestClassName"
|
30
|
+
run_generator('class', [clazz], sources)
|
31
|
+
assert_generated_file("src/foo/bar/TestClassName.as")
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def sources
|
37
|
+
[ RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path)) ]
|
38
|
+
end
|
39
|
+
|
40
|
+
def generator_path
|
41
|
+
"air_generators"
|
42
|
+
end
|
43
|
+
end
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: airake
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-10-
|
8
|
-
summary:
|
6
|
+
version: 0.2.5
|
7
|
+
date: 2007-10-17 00:00:00 -04:00
|
8
|
+
summary: Tasks and generators for Adobe AIR apps
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: gabrielh@gmail.com
|
12
12
|
homepage: http://airake.rubyforge.org
|
13
13
|
rubyforge_project: airake
|
14
|
-
description:
|
14
|
+
description: Tasks and generators for Adobe AIR apps
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -35,6 +35,9 @@ files:
|
|
35
35
|
- Notes.txt
|
36
36
|
- README.txt
|
37
37
|
- Rakefile
|
38
|
+
- air_generators/class/USAGE
|
39
|
+
- air_generators/class/class_generator.rb
|
40
|
+
- air_generators/class/templates/Class.as
|
38
41
|
- app_generators/airake/USAGE
|
39
42
|
- app_generators/airake/airake_generator.rb
|
40
43
|
- app_generators/airake/templates/README
|
@@ -80,12 +83,14 @@ files:
|
|
80
83
|
- test/test_airake.rb
|
81
84
|
- test/test_airake_generator.rb
|
82
85
|
- test/test_browsair_generator.rb
|
86
|
+
- test/test_class_generator.rb
|
83
87
|
- test/test_generator_helper.rb
|
84
88
|
- test/test_helper.rb
|
85
89
|
test_files:
|
86
90
|
- test/test_airake.rb
|
87
91
|
- test/test_airake_generator.rb
|
88
92
|
- test/test_browsair_generator.rb
|
93
|
+
- test/test_class_generator.rb
|
89
94
|
- test/test_generator_helper.rb
|
90
95
|
- test/test_helper.rb
|
91
96
|
rdoc_options:
|
@@ -113,5 +118,5 @@ dependencies:
|
|
113
118
|
requirements:
|
114
119
|
- - ">="
|
115
120
|
- !ruby/object:Gem::Version
|
116
|
-
version: 1.0.
|
121
|
+
version: 1.0.4
|
117
122
|
version:
|