Skip to content

Commit

Permalink
[NEW] flash and flex gestalts
Browse files Browse the repository at this point in the history
flash: any non-trivial use of actionscript, or
       a Java import from the flash.* namespace

flex: any non-trivial inclusion of MXML, or
      a Java import from the mx.* namespace
  • Loading branch information
Robin Luckey committed Aug 14, 2009
1 parent 3e2f621 commit 7a98efd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
20 changes: 20 additions & 0 deletions ruby/gestalt/definitions.rb
Expand Up @@ -57,6 +57,26 @@ module Gestalt
filenames 'jquery-\d.\d.\d.min.js'
end

define_platform 'flash' do
_or do
language :actionscript, :min_percent => 1
_and do
gestalt(:platform, 'Java')
java_import /^(flash)\..+/
end
end
end

define_platform 'flex' do
_or do
language :mxml, :min_percent => 1
_and do
gestalt(:platform, 'Java')
java_import /^(mx)\..+/
end
end
end

define_platform 'XWindows' do
c_headers 'Xlib.h', 'X11\/xpm.h', 'X11/Xlib.h'
end
Expand Down
7 changes: 0 additions & 7 deletions ruby/gestalt/java_definitions.rb
Expand Up @@ -168,13 +168,6 @@ module Gestalt
end
end

define_platform 'Flex' do
_and do
gestalt(:platform, 'Java')
java_import /^(mx|flash)\..+/
end
end

# Java Persistence Frameworks

define_platform 'Hibernate' do
Expand Down
16 changes: 16 additions & 0 deletions test/unit/ruby/gestalt/definitions_test.rb
Expand Up @@ -533,4 +533,20 @@ def test_jasper_ji
]
assert_equal expected_gestalts.sort, make.gestalts.sort
end

def test_flash
as = SourceFile.new("sample.as", :contents => 'greet.text = "Hello, world";')
expected_gestalts = [ Base.new(:platform, "flash") ]
assert_equal expected_gestalts.sort, as.gestalts.sort
end

def test_flex
as = SourceFile.new("sample.mxml", :contents => <<-MXML
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"></mx:Application>
MXML
)
expected_gestalts = [ Base.new(:platform, 'flex') ]
assert_equal expected_gestalts.sort, as.gestalts.sort
end
end

0 comments on commit 7a98efd

Please sign in to comment.