airake 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,13 +7,14 @@ module Airake #:nodoc:
7
7
 
8
8
  attr_reader :asdoc_path, :asdoc_extra_opts, :src_dirs, :lib_dir, :output_dir
9
9
 
10
- # Build with options.
10
+ # Create ASDOC command.
11
11
  #
12
- # asdoc_path: Path to asdoc, defaults to 'asdoc'
13
- # src_dirs: Paths to source (array), defaults to [ 'src' ]
14
- # lib_dir: Path to lib directory.
15
- # output_dir: Path to output directory, defaults to "doc/asdoc"
16
- # asdoc_extra_opts: Extra options for command line
12
+ # ==== Options
13
+ # +asdoc_path+:: Path to asdoc, defaults to 'asdoc'
14
+ # +src_dirs+:: Paths to source (array), defaults to [ 'src' ]
15
+ # +lib_dir+:: Path to lib directory.
16
+ # +output_dir+:: Path to output directory, defaults to "doc/asdoc"
17
+ # +asdoc_extra_opts+:: Extra options for command line
17
18
  #
18
19
  def initialize(options = {})
19
20
  with_options(options, { :asdoc_path => "asdoc", :output_dir => "doc/asdoc" })
@@ -51,6 +51,13 @@ module Airake #:nodoc:
51
51
  end
52
52
  end
53
53
 
54
+ def assert_not_blank(*instance_vars)
55
+ instance_vars.each do |var|
56
+ instance = instance_variable_get("@#{var}")
57
+ raise ArgumentError, "#{var} can't be blank" if instance.blank?
58
+ end
59
+ end
60
+
54
61
  def library_paths(lib_dir)
55
62
  if lib_dir and File.directory?(lib_dir)
56
63
  Dir["#{lib_dir}/*"].collect { |f| escape(f) if File.directory?(f) }.compact
@@ -0,0 +1,25 @@
1
+ module Airake #:nodoc:
2
+
3
+ module Commands #:nodoc:
4
+
5
+ # Flex compiler shell.
6
+ #
7
+ # In progress, untested.
8
+ #
9
+ class FCSH < Base
10
+
11
+ def initialize(options = {})
12
+
13
+ end
14
+
15
+ def generate
16
+ command = []
17
+ command << @swf_path
18
+ process(command)
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1,34 @@
1
+ module Airake #:nodoc:
2
+
3
+ module Commands #:nodoc:
4
+
5
+ # Flash Player (standalone)
6
+ #
7
+ # In progress, untested.
8
+ #
9
+ class FlashPlayer < Base
10
+
11
+ attr_reader :swf_path
12
+
13
+ # Create Flash Player command.
14
+ #
15
+ # ==== Options
16
+ # +flash_player+:: Path to flash player, defaults to '/Applications/Flash Player.app/Contents/MacOS/Flash Player'
17
+ # +swf_path+:: Path to swf
18
+ #
19
+ def initialize(options = {})
20
+ with_options(options, { :flash_player => "/Applications/Flash Player.app/Contents/MacOS/Flash Player" })
21
+ end
22
+
23
+ # The flash player command
24
+ def generate
25
+ command = []
26
+ command << @swf_path
27
+ process(command)
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
@@ -8,15 +8,16 @@ module Airake #:nodoc:
8
8
  attr_reader :mxmlc_path, :mxmlc_extra_opts, :swf_path, :mxml_path, :lib_dir, :src_dirs, :debug
9
9
  attr_reader :config_name
10
10
 
11
- # Build with options:
11
+ # Create MXMLC command.
12
12
  #
13
- # mxmlc_path: Path to flex compiler, defaults to 'mxmlc'
14
- # swf_path: Path to generated swf (required)
15
- # mxml_path: Path to mxml (required)
16
- # lib_dir: Path to lib directory. Will load swc files from here or source directories
17
- # src_dirs: Path to source directories (required)
18
- # config_name: Config name, like 'air'
19
- # mxmlc_extra_opts: Extra options to pass to compiler
13
+ # ==== Options
14
+ # +mxmlc_path+:: Path to flex compiler, defaults to 'mxmlc'
15
+ # +swf_path+:: Path to generated swf (required)
16
+ # +mxml_path+:: Path to mxml (required)
17
+ # +lib_dir+:: Path to lib directory. Will load swc files from here or source directories
18
+ # +src_dirs+:: Path to source directories (required)
19
+ # +config_name+:: Config name, like 'air'
20
+ # +mxmlc_extra_opts+:: Extra options to pass to compiler
20
21
  #
21
22
  def initialize(options = {})
22
23
  assert_required(options, [ :swf_path, :mxml_path, :src_dirs ])
@@ -1,6 +1,5 @@
1
1
  module Airake
2
2
 
3
- #
4
3
  # Project for AIR application
5
4
  #
6
5
  class Project
@@ -9,23 +8,31 @@ module Airake
9
8
  attr_reader :mxml_path, :appxml_path, :air_path, :swf_path
10
9
  attr_reader :debug, :assets, :certificate
11
10
 
12
- # Build project:
11
+ # Create project.
13
12
  #
14
- # env: development, test
15
- # base_dir: Base (project) directory, if nil, AirakeRoot is used
16
- # options: If nil, loaded from airake.yml in root. (All paths relative to base directory)
17
- # mxml_path: Path to the ProjectName.mxml
18
- # appxml_path: Path to application descriptor
19
- # src_dirs: Paths to source
20
- # lib_dir: Path to lib directory
21
- # air_path: Path to AIR file
22
- # swf_path: Path to SWF file
23
- # debug: "true" or "false"
24
- # assets: Path to assets
25
- # certificate: Path to certificate
13
+ # ==== Options:
14
+ # +env+: Environment, such as development, test, production. Defaults to ENV["AIRAKE_ENV"].
15
+ # +base_dir+: Base (project) directory. Defaults to ENV["AIRAKE_ROOT"]
16
+ # +options+: If nil, options are loaded from airake.yml in root. (All paths relative to base directory)
17
+ # - +mxml_path+: Path to the ProjectName.mxml
18
+ # - +appxml_path+: Path to application descriptor
19
+ # - +src_dirs+: Paths to source
20
+ # - +lib_dir+: Path to lib directory
21
+ # - +air_path+: Path to AIR file
22
+ # - +swf_path+: Path to SWF file
23
+ # - +debug+: "true" or "false"
24
+ # - +assets+: Path to assets
25
+ # - +certificate+: Path to certificate
26
26
  #
27
- # Other options:
28
- # mxmlc_path, adt_path, adl_path, asdoc_path, mxmlc_extra_opts, adt_extra_opts, adl_extra_opts, asdoc_extra_opts
27
+ # ==== More options:
28
+ # * mxmlc_path
29
+ # * adt_path
30
+ # * adl_path
31
+ # * asdoc_path
32
+ # * mxmlc_extra_opts
33
+ # * adt_extra_opts
34
+ # * adl_extra_opts
35
+ # * asdoc_extra_opts
29
36
  #
30
37
  def initialize(env = nil, base_dir = nil, options = nil)
31
38
 
@@ -96,7 +103,7 @@ module Airake
96
103
  # ADT command for this project
97
104
  def adt
98
105
  options = { :air_path => @air_path, :appxml_path => @appxml_path, :swf_path => @swf_path,
99
- :base_dir => @base_dir, :assets => @assets, :certificate => @certificate, :adt_extra_opts => @adt_extra_opts,
106
+ :base_dir => @base_dir, :assets => @assets, :cert => @certificate, :adt_extra_opts => @adt_extra_opts,
100
107
  :adt_path => @adt_path }
101
108
  Airake::Commands::Adt.new(options)
102
109
  end
@@ -71,7 +71,7 @@ namespace :air do
71
71
  print "Password: "
72
72
  password = STDIN.gets.chomp!
73
73
 
74
- Airake::Runner.run(project.adt, :generate_certificate, cn, pfx_file, key_type, password, optionals)
74
+ Airake::Runner.run(project.adt, :certificate, cn, pfx_file, key_type, password, optionals)
75
75
  end
76
76
 
77
77
  # Check certificate configuration for package task
@@ -94,7 +94,18 @@ namespace :air do
94
94
  end
95
95
 
96
96
  desc "Package"
97
- task :package => [ :check_certificate, :compile, :package_only ] do; end
97
+ task :package => [ :check_certificate, :compile, :package_only ] do
98
+
99
+ if ENV["AIRAKE_ENV"] != "production"
100
+ puts <<-EOS
101
+
102
+ You packaged under the environment: #{ENV["AIRAKE_ENV"]}.
103
+
104
+ You might want to package by: AIRAKE_ENV=production rake air:package
105
+
106
+ EOS
107
+ end
108
+ end
98
109
 
99
110
  desc "Package only"
100
111
  task :package_only do
@@ -2,7 +2,7 @@ module Airake #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 4
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/test/test_airake.rb CHANGED
@@ -6,26 +6,22 @@ class TestAirake < Test::Unit::TestCase
6
6
  end
7
7
 
8
8
  def teardown
9
- FileUtils.rm_rf("#{test_dir}/bin/*", :verbose => true)
10
- FileUtils.rm_rf("#{test_dir}/doc", :verbose => true)
11
- end
12
-
13
- def test_dir
14
- File.dirname(__FILE__) + "/Test\\ App"
9
+ FileUtils.rm_rf("#{run_task_dir}/bin/*", :verbose => true)
10
+ FileUtils.rm_rf("#{run_task_dir}/doc", :verbose => true)
15
11
  end
16
12
 
17
13
  def run_task(run)
18
- system("cd #{test_dir}; rake #{run}") || fail
19
- end
14
+ system("cd #{run_task_dir}; rake #{run} --trace") || fail
15
+ end
20
16
 
17
+ def run_task_dir
18
+ File.dirname(__FILE__) + "/Test\\ App"
19
+ end
20
+
21
21
  def test_adl
22
22
  run_task("adl")
23
23
  end
24
24
 
25
- def test_acompc
26
- run_task("acompc SOURCE=src OUTPUT=bin/Foo.swc PACKAGES=\"com.test\"")
27
- end
28
-
29
25
  def test_compile
30
26
  run_task("compile")
31
27
  end
@@ -38,6 +34,14 @@ class TestAirake < Test::Unit::TestCase
38
34
  run_task("clean")
39
35
  end
40
36
 
37
+ def test_docs
38
+ run_task("docs")
39
+ end
40
+
41
+ def test_acompc
42
+ run_task("acompc SOURCE=src OUTPUT=bin/Foo.swc PACKAGES=\"com.test\"")
43
+ end
44
+
41
45
  def test_package
42
46
  puts <<-EOS
43
47
 
@@ -47,7 +51,5 @@ class TestAirake < Test::Unit::TestCase
47
51
  run_task("package")
48
52
  end
49
53
 
50
- def test_docs
51
- run_task("docs")
52
- end
54
+
53
55
  end
@@ -0,0 +1,17 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestRunner < Test::Unit::TestCase
4
+
5
+
6
+ def test_run
7
+
8
+ adt = Airake::Commands::Adt.new
9
+
10
+ cert = adt.certificate("cm", "test.pfx", "1024-RSA", "pass")
11
+
12
+ Airake::Runner.new(cert).run
13
+
14
+ end
15
+
16
+
17
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
5
- platform: ""
4
+ version: 0.4.2
5
+ platform: ruby
6
6
  authors:
7
7
  - Gabriel Handford, Min Kim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-24 00:00:00 -05:00
12
+ date: 2008-02-29 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -34,7 +34,6 @@ description: Tasks and generators for Adobe AIR apps
34
34
  email: gabrielh@gmail.com
35
35
  executables:
36
36
  - airake
37
- - browsair
38
37
  extensions: []
39
38
 
40
39
  extra_rdoc_files:
@@ -43,10 +42,10 @@ extra_rdoc_files:
43
42
  - Manifest.txt
44
43
  - Notes.txt
45
44
  - README.txt
46
- - app_generators/shared/icons/MouseRunnerDotComGraphicsLicense.txt
47
45
  files:
48
46
  - History.txt
49
47
  - License.txt
48
+ - MIT-LICENSE
50
49
  - Manifest.txt
51
50
  - Notes.txt
52
51
  - README.txt
@@ -57,15 +56,12 @@ files:
57
56
  - app_generators/airake/USAGE
58
57
  - app_generators/airake/airake_generator.rb
59
58
  - app_generators/airake/templates/README
60
- - app_generators/browsair/USAGE
61
- - app_generators/browsair/browsair_generator.rb
62
- - app_generators/browsair/templates/README
63
59
  - app_generators/shared/Rakefile
64
60
  - app_generators/shared/airake.yml
65
61
  - app_generators/shared/application.mxml
62
+ - app_generators/shared/descriptor_1.xml
66
63
  - app_generators/shared/descriptor_M5.xml
67
64
  - app_generators/shared/descriptor_M6.xml
68
- - app_generators/shared/icons/MouseRunnerDotComGraphicsLicense.txt
69
65
  - app_generators/shared/icons/Web.png
70
66
  - app_generators/shared/lib/corelib-08.30.2007.swc
71
67
  - app_generators/shared/lib/flexunit-08.30.2007.swc
@@ -73,15 +69,23 @@ files:
73
69
  - app_generators/shared/test/Test.mxml
74
70
  - app_generators/shared/test/suite/AllTests.as
75
71
  - bin/airake
76
- - bin/browsair
77
72
  - config/hoe.rb
78
73
  - config/requirements.rb
74
+ - html/app_generators.html
75
+ - html/component_generators.html
76
+ - html/copy_to_rubyforge.sh
77
+ - html/index.html
78
+ - html/resources.html
79
+ - html/screen.css
80
+ - html/tasks.html
79
81
  - lib/airake.rb
80
82
  - lib/airake/commands/acompc.rb
81
83
  - lib/airake/commands/adl.rb
82
84
  - lib/airake/commands/adt.rb
83
85
  - lib/airake/commands/asdoc.rb
84
86
  - lib/airake/commands/base.rb
87
+ - lib/airake/commands/fcsh.rb
88
+ - lib/airake/commands/flash_player.rb
85
89
  - lib/airake/commands/mxmlc.rb
86
90
  - lib/airake/core_ext/blank.rb
87
91
  - lib/airake/daemonize.rb
@@ -102,11 +106,10 @@ files:
102
106
  - tasks/website.rake
103
107
  - test/test_airake.rb
104
108
  - test/test_airake_generator.rb
105
- - test/test_browsair_generator.rb
106
109
  - test/test_class_generator.rb
107
110
  - test/test_generator_helper.rb
108
111
  - test/test_helper.rb
109
- - MIT-LICENSE
112
+ - test/test_runner.rb
110
113
  has_rdoc: true
111
114
  homepage: http://airake.rubyforge.org
112
115
  post_install_message:
@@ -130,14 +133,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
133
  requirements: []
131
134
 
132
135
  rubyforge_project: airake
133
- rubygems_version: 0.9.5
136
+ rubygems_version: 1.0.1
134
137
  signing_key:
135
138
  specification_version: 2
136
139
  summary: Tasks and generators for Adobe AIR apps
137
140
  test_files:
138
141
  - test/test_airake.rb
139
142
  - test/test_airake_generator.rb
140
- - test/test_browsair_generator.rb
141
143
  - test/test_class_generator.rb
142
144
  - test/test_generator_helper.rb
143
145
  - test/test_helper.rb
146
+ - test/test_runner.rb
@@ -1,5 +0,0 @@
1
- Description:
2
- Create an AIR browser for a specific URL.
3
-
4
- Usage:
5
- browsair [path/to/Project] [http://the.url] [path/to/icon_128.png (optional)]
@@ -1,95 +0,0 @@
1
- class BrowsairGenerator < RubiGen::Base
2
-
3
- DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
4
- Config::CONFIG['ruby_install_name'])
5
-
6
- attr_reader :name, :app_name, :url, :title, :description, :icon_src_path, :show_buttons
7
-
8
- def initialize(runtime_args, runtime_options = {})
9
- super
10
- usage if args.empty? || args.size < 2
11
- @destination_root = File.expand_path(args.shift)
12
- @name = base_name
13
- @app_name = @name.gsub(/\s+/, "")
14
- @url = args.shift
15
- @title = "#{@name} - #{@url}"
16
- @description = "AIR Browser for #{@url}"
17
- @icon_src_path = File.expand_path(args.shift) unless args.empty?
18
- extract_options
19
-
20
- @source_root = File.join(File.dirname(__FILE__), "..", "shared")
21
- end
22
-
23
- def manifest
24
- record do |m|
25
- m.directory ""
26
-
27
- # Root
28
- m.file "../browsair/templates/README", "README"
29
- m.template "Rakefile", "Rakefile"
30
-
31
- # Bin
32
- m.directory "bin"
33
-
34
- # Lib
35
- m.directory "lib"
36
- m.file "lib/flexunit-08.30.2007.swc", "lib/flexunit-08.30.2007.swc"
37
-
38
- # Test
39
- m.directory "test"
40
- m.file "test/Test-app.xml", "test/Test-app.xml"
41
- m.file "test/Test.mxml", "test/Test.mxml"
42
- m.directory "test/suite"
43
- m.file "test/suite/AllTests.as", "test/suite/AllTests.as"
44
-
45
- # Source
46
- m.directory "src"
47
- m.template "descriptor_M6.xml", "src/#{app_name}-app.xml"
48
- m.template "application.mxml", "src/#{app_name}.mxml"
49
- m.template "airake.yml", "airake.yml"
50
-
51
- # Icons
52
- if icon_src_path.blank?
53
- m.directory "src/assets/app_icons"
54
- m.file "icons/Web.png", "src/assets/app_icons/icon_128.png"
55
- m.file "icons/MouseRunnerDotComGraphicsLicense.txt", "src/assets/app_icons/MouseRunnerDotComGraphicsLicense.txt"
56
- else
57
- icon_dest_path = destination_path("src/assets/app_icons/icon_128.png")
58
- FileUtils.mkdir_p(destination_path("src/assets/app_icons"))
59
- FileUtils.cp(icon_src_path, icon_dest_path)
60
- end
61
-
62
- m.dependency "install_rubigen_scripts", [destination_root, "air", "browsair"], :shebang => options[:shebang]
63
-
64
-
65
- end
66
- end
67
-
68
- protected
69
- def banner
70
- <<-EOS
71
- Create an AIR browser for a specific URL.
72
-
73
- USAGE: #{spec.name} [path/to/Project] [http://the.url] [path/to/icon_128.png (optional)]
74
- EOS
75
- end
76
-
77
- def add_options!(opts)
78
- opts.separator ''
79
- opts.separator 'Options:'
80
- # For each option below, place the default
81
- # at the top of the file next to "default_options"
82
- # opts.on("-a", "--author=\"Your Name\"", String,
83
- # "Some comment about this option",
84
- # "Default: none") { |options[:author]| }
85
- opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
86
- opts.on("-b", "--buttons", "Build with back/forward/home buttons")
87
- end
88
-
89
- def extract_options
90
- # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
91
- # Templates can access these value via the attr_reader-generated methods, but not the
92
- # raw instance variable value.
93
- @show_buttons = options[:buttons]
94
- end
95
- end