ropenlaszlo 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = Change Log
2
2
 
3
+ == Version 0.7 (2009-03-30)
4
+ * add method to create a symbolic from the OpenLaszlo directory
5
+
6
+
3
7
  == Version 0.6.3 (2009-03-23)
4
8
  * unquote html entities in errors and warnings
5
9
 
data/README.rdoc CHANGED
@@ -1,10 +1,12 @@
1
1
  = ROpenLaszlo: Interface to the OpenLaszlo compiler
2
2
 
3
- ROpenLaszo is a Ruby interface to the OpenLaszlo[openlaszlo.org] compiler. It allows you to compile Open<tt></tt>Laszlo programs from within Ruby, in order to integrate Open<tt></tt>Laszlo development into Rake or Rails applications.
3
+ ROpenLaszo is a Ruby interface to the OpenLaszlo[openlaszlo.org] compiler. It allows you to compile Open<tt></tt>Laszlo programs from within Ruby, in order to integrate Open<tt></tt>Laszlo development into Rake files or Rails applications.
4
4
 
5
- If you are using Open<tt></tt>Laszlo with Ruby on Rails, you probably want the {OpenLaszlo Rails plugin}[laszlo-plugin.rubyforge.org] as well.
5
+ If you are using Open<tt></tt>Laszlo with Ruby on Rails, you want the {OpenLaszlo Rails plugin}[laszlo-plugin.rubyforge.org] too. That page contains instructions for installing both the gem and the plugin; you can read those instructions instead of these.
6
6
 
7
- OpenLaszlo[openlaszlo.org] programs are written in XML with embedded JavaScript, and compiled into Flash (swf) binary files, or DHTML. (As of this writing, the DHTML target is in pre-beta form.) The APIs in this library make it easy for Ruby code to invoke the Open<tt></tt>Laszlo compiler. For example, if hello.lzx contains the following text:
7
+ == Overview
8
+
9
+ Open<tt></tt>Laszlo programs are written in XML with embedded JavaScript, and compiled into either Flash (swf) binary files, or DHTML. The APIs in this library make it easy for Ruby code to invoke the Open<tt></tt>Laszlo compiler. For example, if hello.lzx contains the following text:
8
10
  <canvas>
9
11
  <window>
10
12
  <button>Hello, World!</button>
@@ -37,37 +39,47 @@ The following includes such a task:
37
39
  0:: Download and install the {OpenLaszlo SDK}[openlaszlo.org]
38
40
 
39
41
  1: Install this gem
40
- $ gem install osteele-ropenlaszlo -s http://gems.github.com
42
+ $ sudo gem install ropenlaszlo
41
43
 
42
44
  2:: Set your +OPENLASZLO_HOME+ environment variable to the directory that contains the {OpenLaszlo SDK}[openlaszlo.org]. If the following prints something, you've got it right:
43
- grep Laszlo "$OPENLASZLO_HOME/README.txt"
45
+ $ grep Laszlo "$OPENLASZLO_HOME/README.txt"
44
46
 
45
47
  3:: (Optional) Set your +OPENLASZLO_URL+ environment variable to the web location of the Open<tt></tt>Laszlo server; for example, <tt>http</tt><tt>://localhost:8080/lps-3.1</tt>. If you omit this step, the module will use the command line compiler, which is slower but is not limited to compiling files inside of +OPENLASZLO_HOME+.
46
48
 
47
49
  <b>Note:</b> The command-line compiler is broken in the Windows version of Open<tt></tt>Laszlo 3.1.1. If you are running Windows, step (3) is required. ({OpenLaszlo bug 1428}[http://www.openlaszlo.org/jira/browse/LPP-1428])
48
50
 
49
- == Additional Resources
51
+ == Tips
50
52
 
51
- * The {OpenLaszlo web site}[openlaszlo.org] is a rich source of information about the Open<tt></tt>Laszlo platform. It includes links to the wiki, mailing lists, and forums.
53
+ The Ruby front end to the compiler uses two compilation methods. If OPENLASZLO_URL is set, and the source file is in a subdirectory of the OpenLaszlo servlet directory, then the compiler will request the URL that corresponds to the source location. Otherwise, the OpenLaszlo command-line compiler is used.
54
+
55
+ If the compiler is going to be invoked more than once (because several files are being compiled, or because the compiler is being used in an edit/compile/run cycle), the compile server is faster.
56
+
57
+ You can place a symbolic link to a source directory in the OpenLaszlo servlet directory thus:
58
+ require 'openlaszlo/utils'
59
+ OpenLaszlo::symlink_to '.'
52
60
 
53
- * The {Laszlo on Rails}[groups.google.com/group/laszlo-on-rails] news group discusses the integration of Open<tt></tt>Laszlo with Ruby on Rails.
54
61
 
55
- * The {OpenLaszlo Rails plugin}[laszlo-plugin.rubyforge.org] provides generators and scaffolding for using Open<tt></tt>Laszlo with Ruby on Rails.
62
+ == Additional Resources
63
+
64
+ * The {OpenLaszlo Rails plugin}[laszlo-plugin.rubyforge.org] provides generators, view tasks, and rake tasks for using Open<tt></tt>Laszlo with Ruby on Rails.
65
+
66
+ * The {OpenLaszlo web site}[openlaszlo.org] is a rich source of information about the Open<tt></tt>Laszlo platform. It includes links to the wiki, mailing lists, and forums.
56
67
 
57
68
  * {This OpenLaszlo Blog entry}[weblog.openlaszlo.org/archives/2006/01/deploying-openlaszlo-applications-with-rake/] has additional information and some examples of using ROpenLaszlo in a Rakefile.
58
69
 
59
- * The RubyForge project page is here[http://rubyforge.org/projects/ropenlaszlo/].
70
+ * {ROpenLaszlo RubyForge project page}[http://rubyforge.org/projects/ropenlaszlo/]
71
+
72
+ * {ROpenLaszlo git repository}[http://github.com/osteele/ropenlaszlo]
60
73
 
61
74
 
62
75
  == Author
63
76
 
64
- Oliver Steele
65
- steele@osteele.com
77
+ Oliver Steele <steele@osteele.com>
66
78
 
67
79
 
68
80
  == License
69
81
 
70
- ROpenLaszlo is copyright (c) 2006 - 2009 by Oliver Steele. It is
82
+ ROpenLaszlo is copyright (C) 2006 - 2009 by Oliver Steele. It is
71
83
  open-source software, and may be redistributed under the terms of the
72
- MIT license. The text of this licence is included in the ROpenLaszlo
84
+ MIT license. The text of this license is included in the ROpenLaszlo
73
85
  distribution.
@@ -1,6 +1,3 @@
1
- # Author:: Oliver Steele
2
- # Copyright:: Copyright (c) 2005-2008 Oliver Steele. All rights reserved.
3
- # License:: MIT License
4
1
  module OpenLaszlo
5
2
  class Applet
6
3
  attr_reader :source
@@ -16,13 +13,13 @@ module OpenLaszlo
16
13
 
17
14
  def compile(target=nil, options={})
18
15
  target ||= source + '.swf'
19
- return if up2date?(target) unless options[:force]
16
+ return if uptodate?(target) unless options[:force]
20
17
 
21
18
  puts "Compiling #{source} -> #{target}" if options[:verbose]
22
19
  OpenLaszlo::compile(source, options)
23
20
  end
24
21
 
25
- def up2date?(target=nil)
22
+ def uptodate?(target=nil)
26
23
  target ||= source + '.swf'
27
24
  return false unless File.exists?(target)
28
25
  sources = Dir["#{source_dir}/**/*"].reject { |fname| fname =~ /\.lzx\.swf/ } -
@@ -0,0 +1,21 @@
1
+ module OpenLaszlo
2
+ # Create a symbolic link to +source+ from the OpenLaszlo directory, so that
3
+ # (if allowLinks[http://wiki.github.com/osteele/openlaszlo-plugin/using-the-compile-server]
4
+ # is enabled) the server compiler can be used on files in this directory.
5
+ # The link will have the same name as the source directory, if +name+ is nil.
6
+ def self.symlink_to(source, name=nil)
7
+ home = ENV['OPENLASZLO_HOME']
8
+ raise "OPENLASZLO_HOME isn't set" unless home
9
+ source = File.expand_path(source)
10
+ name ||= File.basename(source)
11
+ target_dir = Dir[File.join(home, 'Server', 'lps-*')][0]
12
+ raise "Can't find LPS subdirectory in #{home}" unless File.directory?(target_dir)
13
+ target = File.join(target_dir, name)
14
+ if File.exists?(target)
15
+ return if File.ftype(target) == 'link' and File.readlink(target) == source
16
+ raise "#{target} already exists"
17
+ end
18
+ File.symlink source, target
19
+ return target
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ropenlaszlo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Steele
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-23 00:00:00 -04:00
12
+ date: 2009-03-30 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -28,6 +28,7 @@ files:
28
28
  - lib/openlaszlo
29
29
  - lib/openlaszlo/applet.rb
30
30
  - lib/openlaszlo/compiler.rb
31
+ - lib/openlaszlo/utils.rb
31
32
  - lib/openlaszlo.rb
32
33
  - lib/ropenlaszlo.rb
33
34
  - lib/tasks
@@ -53,6 +54,8 @@ rdoc_options:
53
54
  - "ROpenLaszlo: Ruby interface to the OpenLaszlo compiler"
54
55
  - --exclude
55
56
  - test/.*
57
+ - --main
58
+ - README.rdoc
56
59
  - --inline-source
57
60
  - --charset=UTF-8
58
61
  require_paths: