Changeset 456

Show
Ignore:
Timestamp:
08/30/07 21:29:06 (1 year ago)
Author:
iv..@gweezlebur.com
Message:

rubigen is needed to build from source

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/README

    r453 r456  
    1515Then you can build the merb gem from svn trunk like so: 
    1616 
    17   $ sudo gem install mongrel erubis json mime-types archive-tar-minitar rspec activerecord --include-dependencies 
     17  $ sudo gem install mongrel erubis json mime-types archive-tar-minitar rspec activerecord rubigen --include-dependencies 
    1818  $ svn co http://svn.devjavu.com/merb/trunk merb 
    1919  $ cd merb 
  • trunk/lib/merb/plugins.rb

    r443 r456  
    8989      # Run the installation code in the gem. 
    9090      def run_install_script 
    91         require "#{gem_name}/install" 
    92       rescue LoadError 
    93         output.puts "No install script for #{gem_name}" 
     91        begin 
     92          require "#{gem_name}/merb_install" 
     93        rescue LoadError 
     94          begin 
     95            require "#{gem_name}/install" 
     96          rescue LoadError 
     97            output.puts "No install script for #{gem_name}" 
     98          end 
     99        end 
    94100      end 
    95101     
     
    187193      def remove 
    188194        begin 
    189           require "#{gem_name}/uninstall" 
     195          require "#{gem_name}/merb_uninstall" 
    190196        rescue LoadError 
     197          begin 
     198            require "#{gem_name}/uninstall" 
     199          rescue LoadError 
     200            output.puts "No uninstall script for #{gem_name}" 
     201          end 
    191202        end 
    192203       
  • trunk/specs/merb/merb_plugins_spec.rb

    r448 r456  
    4646  end 
    4747 
    48   it "should install a local gem (mocked)" #do 
    49     # pending "Can't get the mocks to do what I want" 
    50     # @mgr.gem_name = "merb-fake-plugin" 
    51     # @mgr.plugin_installed?.should_not be_true 
    52     #  
    53     # version = mock("version") 
    54     # version.should_receive(:version).and_return("1.2.3") 
    55     # gemspec = mock("Gem::Specification") 
    56     # gemspec.should_receive(:version).and_return(version) 
    57     # gemspec.should_receive(:loaded_from). 
    58     #   and_return("/usr/local/lib/ruby/gems/1.8/specifications/merb-fake-plugin-1.2.3.gemspec") 
    59     #  
    60     # require 'rubygems/installer' 
    61     # installer = mock("Gem::Installer") 
    62     # installer.should_receive(:install).with(anything, anything).and_return(gemspec) 
    63     # Gem::Installer.stub!(:new).and_return(installer) 
    64     #  
    65     # installed_gems = mock("SourceIndex") 
    66     # installed_gems.should_receive(:search).twice.with("merb-fake-plugin").and_return([], [gemspec]) 
    67     # Gem::SourceIndex.stub!(:from_installed_gems).and_return(installed_gems) 
    68     #  
    69     # @mgr.action("install", "merb-fake-plugin") 
    70     # p @mgr.output.string 
    71     # @mgr.output.string.should match(/Can't find gem...installing./) 
    72     # @mgr.output.string.should match(/Attempting local install.../) 
    73     # @mgr.output.string.should match(/No install script for merb-fake-plugin/) 
    74     # @mgr.output.string.should match(/No Rakefile to copy for merb-fake-plugin/) 
    75     #  
    76     # @mgr.plugin_installed?.should be_true 
    77     # File.read(PLUGIN_MANIFEST_FILE).should match(/merb-fake-plugin/) 
    78   # end 
     48  it "should install a local gem (mocked)" do 
     49    pending "Can't get the mocks to do what I want" 
     50    @mgr.gem_name = "merb-fake-plugin" 
     51    @mgr.plugin_installed?.should_not be_true 
     52     
     53    version = mock("version") 
     54    version.should_receive(:version).and_return("1.2.3") 
     55    gemspec = mock("Gem::Specification") 
     56    gemspec.should_receive(:version).and_return(version) 
     57    gemspec.should_receive(:loaded_from). 
     58      and_return("/usr/local/lib/ruby/gems/1.8/specifications/merb-fake-plugin-1.2.3.gemspec") 
     59     
     60    require 'rubygems/installer' 
     61    installer = mock("Gem::Installer") 
     62    installer.should_receive(:install).with(anything, anything).and_return(gemspec) 
     63    Gem::Installer.stub!(:new).and_return(installer) 
     64     
     65    installed_gems = mock("SourceIndex") 
     66    installed_gems.should_receive(:search).twice.with("merb-fake-plugin").and_return([], [gemspec]) 
     67    Gem::SourceIndex.stub!(:from_installed_gems).and_return(installed_gems) 
     68     
     69    @mgr.action("install", "merb-fake-plugin") 
     70    p @mgr.output.string 
     71    @mgr.output.string.should match(/Can't find gem...installing./) 
     72    @mgr.output.string.should match(/Attempting local install.../) 
     73    @mgr.output.string.should match(/No install script for merb-fake-plugin/) 
     74    @mgr.output.string.should match(/No Rakefile to copy for merb-fake-plugin/) 
     75     
     76    @mgr.plugin_installed?.should be_true 
     77    File.read(PLUGIN_MANIFEST_FILE).should match(/merb-fake-plugin/) 
     78  end 
    7979   
    8080  it "should uninstall a remote gem (Mock?)"