airake 0.2.3 → 0.2.4

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 CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.4 2007-10-13
2
+
3
+ * Fixing custom icon specification
4
+
1
5
  == 0.2.3 2007-10-12
2
6
 
3
7
  * Fixing default project layout bug
@@ -1,6 +1,6 @@
1
1
  class AirakeGenerator < RubiGen::Base
2
2
 
3
- attr_reader :name, :app_name, :title, :url, :description
3
+ attr_reader :name, :app_name, :title, :url, :description, :show_buttons
4
4
 
5
5
  def initialize(runtime_args, runtime_options = {})
6
6
  super
@@ -10,6 +10,7 @@ class AirakeGenerator < RubiGen::Base
10
10
  @title = @name
11
11
  @url = "http://airake.rubyforge.org/resources.html"
12
12
  @description = "Put description here"
13
+ @show_buttons = true
13
14
  extract_options
14
15
 
15
16
  @destination_root = File.expand_path(@name)
@@ -1,6 +1,6 @@
1
1
  class BrowsairGenerator < RubiGen::Base
2
2
 
3
- attr_reader :name, :app_name, :url, :title, :description, :icon_src_path
3
+ attr_reader :name, :app_name, :url, :title, :description, :icon_src_path, :show_buttons
4
4
 
5
5
  def initialize(runtime_args, runtime_options = {})
6
6
  super
@@ -20,34 +20,39 @@ class BrowsairGenerator < RubiGen::Base
20
20
 
21
21
  def manifest
22
22
  record do |m|
23
- # Ensure appropriate folder(s) exists
24
- m.directory ''
25
- BASEDIRS.each { |path| m.directory path }
23
+ m.directory ""
26
24
 
25
+ # Root
27
26
  m.file "../browsair/templates/README", "README"
27
+ m.template "Rakefile", "Rakefile"
28
+
29
+ # Bin
30
+ m.directory "bin"
28
31
 
29
32
  # Lib
33
+ m.directory "lib"
30
34
  m.file "lib/flexunit-08.30.2007.swc", "lib/flexunit-08.30.2007.swc"
31
35
 
32
36
  # Test
37
+ m.directory "test"
33
38
  m.file "test/Test-app.xml", "test/Test-app.xml"
34
39
  m.file "test/Test.mxml", "test/Test.mxml"
35
40
  m.directory "test/suite"
36
41
  m.file "test/suite/AllTests.as", "test/suite/AllTests.as"
37
42
 
38
- # Basic
39
- m.template "Rakefile", "Rakefile"
43
+ # Source
44
+ m.directory "src"
40
45
  m.template "descriptor.xml", "src/#{app_name}-app.xml"
41
46
  m.template "application.mxml", "src/#{app_name}.mxml"
42
-
47
+
43
48
  # Icons
44
- m.directory "src/assets/app_icons"
45
-
46
- if @icon_src_path.blank?
49
+ if icon_src_path.blank?
50
+ m.directory "src/assets/app_icons"
47
51
  m.file "icons/Web.png", "src/assets/app_icons/icon_128.png"
48
52
  m.file "icons/MouseRunnerDotComGraphicsLicense.txt", "src/assets/app_icons/MouseRunnerDotComGraphicsLicense.txt"
49
53
  else
50
54
  icon_dest_path = destination_path("src/assets/app_icons/icon_128.png")
55
+ FileUtils.mkdir_p(destination_path("src/assets/app_icons"))
51
56
  FileUtils.cp(icon_src_path, icon_dest_path)
52
57
  end
53
58
 
@@ -72,21 +77,13 @@ EOS
72
77
  # "Some comment about this option",
73
78
  # "Default: none") { |options[:author]| }
74
79
  opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
80
+ opts.on("-b", "--buttons", "Build with back/forward/home buttons")
75
81
  end
76
82
 
77
83
  def extract_options
78
84
  # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
79
85
  # Templates can access these value via the attr_reader-generated methods, but not the
80
86
  # raw instance variable value.
81
- # @author = options[:author]
87
+ @show_buttons = options[:buttons]
82
88
  end
83
-
84
- # Installation skeleton. Intermediate directories are automatically
85
- # created so don't sweat their absence here.
86
- BASEDIRS = %w(
87
- bin
88
- lib
89
- src
90
- test
91
- )
92
89
  end
@@ -3,6 +3,7 @@
3
3
 
4
4
  <mx:VBox width="100%" height="100%" backgroundColor="#FFFFFF" verticalGap="0">
5
5
 
6
+ <% if show_buttons %>
6
7
  <mx:HBox id="buttons" width="100%" paddingLeft="5" paddingTop="5"
7
8
  borderColor="#CCCCCC" borderSides="bottom" borderThickness="2" borderStyle="solid">
8
9
 
@@ -14,6 +15,7 @@
14
15
  <mx:Button label="Hide" click="buttons.height = 0" />
15
16
  </mx:HBox>
16
17
  </mx:HBox>
18
+ <% end %>
17
19
 
18
20
  <mx:VBox width="100%" height="100%">
19
21
  <mx:HTML id="html" width="100%" height="100%" location="<%= url %>" />
@@ -32,7 +32,7 @@ namespace :air do
32
32
  if File.exist?(pfx_file)
33
33
  raise <<-EOS
34
34
  Certificate file exists at '#{pfx_file}'. If you want to generate a new certificate, please delete it first.
35
- You can override the setting in the Rakefile, e.g.: rake air:certificate CERTIFICATE=path.pfx
35
+ You can override the setting in the Rakefile or on the command line: rake air:certificate CERTIFICATE=path.pfx
36
36
  EOS
37
37
 
38
38
  end
@@ -42,18 +42,20 @@ namespace :air do
42
42
  project = Airake::Project.new_from_rake(ENV)
43
43
  optionals = {}
44
44
 
45
- print "Specify common name (e.g. SelfSign, ADigitalID): "
45
+ print "Specify common name (e.g. SelfSign, ADigitalID) [SelfSign]: "
46
46
  cn = STDIN.gets.chomp!
47
+ cn = "SelfSign" if cn.blank?
47
48
 
48
- print "Key type (e.g. 1024-RSA, 2048-RSA): "
49
+ print "Key type (e.g. 1024-RSA, 2048-RSA) [1024-RSA]:"
49
50
  key_type = STDIN.gets.chomp!
51
+ key_type = "1024-RSA" if key_type.blank?
50
52
 
51
- print "Org unit (optional; e.g QE): "
52
- optionals[:ou] = STDIN.gets.chomp!
53
-
54
- print "Org name (optional; e.g Example - CO): "
53
+ print "Organization name (optional; e.g ducktyper.com): "
55
54
  input = STDIN.gets.chomp!
56
- optionals[:o] = "\"#{input}\"" unless input.blank?
55
+ optionals[:o] = "\"#{input}\"" unless input.blank?
56
+
57
+ print "Organization unit (optional; e.g QE): "
58
+ optionals[:ou] = STDIN.gets.chomp!
57
59
 
58
60
  print "Country (optional; e.g. US): "
59
61
  optionals[:c] = STDIN.gets.chomp!
@@ -2,7 +2,7 @@ module Airake #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -33,10 +33,15 @@ class TestBrowsairGenerator < Test::Unit::TestCase
33
33
  assert_directory_exists "src"
34
34
  end
35
35
 
36
+ def test_generator_with_icon
37
+ icon_path = File.join(File.dirname(__FILE__), "..", "app_generators", "shared", "icons", "Web.png")
38
+ run_generator('browsair', [ APP_ROOT, "http://facebook.com", icon_path ], sources)
39
+ end
40
+
36
41
  private
37
42
 
38
43
  def sources
39
- [ RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path)) ]
44
+ [ RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__), "..", generator_path)) ]
40
45
  end
41
46
 
42
47
  def generator_path
metadata CHANGED
@@ -3,8 +3,8 @@ 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.3
7
- date: 2007-10-12 00:00:00 -04:00
6
+ version: 0.2.4
7
+ date: 2007-10-13 00:00:00 -04:00
8
8
  summary: Adobe AIR generators and tasks
9
9
  require_paths:
10
10
  - lib