Changeset 38

Show
Ignore:
Timestamp:
03/31/08 22:44:42 (5 months ago)
Author:
tonttu
Message:

Support for gem, fixes #1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/malline

    • Property svn:ignore set to
      pkg
  • trunk/malline/README

    r36 r38  
    1 Malline 1.0.1 
     1Malline 1.0.2 
    22============= 
    33 
  • trunk/malline/Rakefile

    r29 r38  
    2121  rdoc.rdoc_files.include('lib/**/*.rb') 
    2222end 
     23 
     24summary = <<-EOF 
     25        Malline is a full-featured pure Ruby template system designed to be 
     26        a replacement for ERB views in Rails or any other framework. See 
     27        http://www.malline.org/ for more info. 
     28EOF 
     29 
     30desc = <<-EOF 
     31        Malline is a full-featured template system designed to be 
     32        a replacement for ERB views in Rails or any other framework. 
     33        It also includes standalone bin/malline to compile Malline 
     34        templates to XML in commandline. All Malline templates are 
     35        pure Ruby, see http://www.malline.org/ for more info. 
     36EOF 
     37 
     38begin 
     39        require 'rubygems' 
     40        require 'rake/gempackagetask' 
     41        PKG_FILES = FileList['lib/**/*.rb', 'bin/*', 'COPYING*', 'README', 'scripts/*rb', 'test/*', 'test/examples/*'] 
     42        PKG_VERSION = File.read('README').scan(/^Malline (\d+\.\d+\.\d+)/).first.first 
     43        spec = Gem::Specification.new do |s| 
     44                s.author = 'Riku Palomäki' 
     45                s.autorequire = 'malline' 
     46                s.email = 'riku@palomaki.fi' 
     47                s.executables = ['malline'] 
     48                s.extra_rdoc_files = ['README'] 
     49                s.files = PKG_FILES.to_a 
     50                s.homepage = 'http://www.malline.org/' 
     51                s.name = 'malline' 
     52                s.rubyforge_project = 'malline' 
     53                s.summary = summary 
     54                s.test_file = 'test/malline_test.rb' 
     55                s.version = PKG_VERSION 
     56                s.description = desc 
     57        end 
     58 
     59        Rake::GemPackageTask.new(spec) do |pkg| 
     60                pkg.need_zip = true 
     61                pkg.need_tar = true 
     62        end 
     63rescue LoadError => e 
     64        warn e.message 
     65        warn 'Warning: Package building is disabled because of missing libs' 
     66end 
  • trunk/malline/init.rb

    r29 r38  
     1# This file is required by Rails if using a Malline plugin 
    12require 'malline' 
    2 ActionView::Base.register_template_handler 'mn', Malline::Base 
     3require 'malline/rails' 
  • trunk/malline/lib/malline.rb

    r35 r38  
    1919require 'malline/view_wrapper.rb' 
    2020require 'malline/view_xhtml.rb' 
    21 require 'malline/rails.rb' 
    2221require 'malline/erb_out.rb' 
    2322require 'malline/form_builder.rb' 
     
    2524 
    2625module Malline 
     26        VERSION = '1.0.2' 
     27 
    2728        # Template-handler class that is registered to ActionView and initialized by it. 
    2829        class Base 
  • trunk/malline/lib/malline/rails.rb

    r35 r38  
    1515# You should have received a copy of the GNU Lesser General Public License 
    1616# along with Malline.  If not, see <http://www.gnu.org/licenses/>. 
     17 
     18require 'malline' unless Kernel.const_defined?('Malline') 
     19 
     20ActionView::Base.register_template_handler 'mn', Malline::Base 
    1721 
    1822module ActionView 
     
    3842                        tmp 
    3943                end 
    40         end if const_defined?('Base') 
     44        end 
    4145end