• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

GAEなどでファイル数の多いライブラリを使うために、gemのパッケージから不要そうなファイルを消してjarファイルにまとめるために作ったスクリプトです。

   1  #!/usr/bin/env ruby
   2  
   3  def run(command)
   4    puts command
   5    system command
   6  end
   7  
   8  case ARGV[0]
   9  when 'install'
  10    run "jgem install -i ./gems --no-ri --no-rdoc #{ARGV[1]}"
  11  when 'uninstall'
  12    run "jgem uninstall -i ./gems #{ARGV[1]}"
  13  end
  14  
  15  Dir['gems/gems/*'].each do |dir|
  16    %w(
  17      Generaters TODO README.* README
  18      spec/**/* test/**/* examples/**/* tasks/**/*
  19      tutorial/**/* demo/**/* website/**/*
  20      CHANGES CHANGES.txt CHANGELOG
  21      LICENSE MIT-LICENSE Rakefile CONTRIBUTORS
  22      Manifest.txt History.txt install.rb setup.rb
  23    ).each do |pattern|
  24      Dir[File.join(dir, pattern)].each do |path|
  25        run "rm -rf #{path}"
  26      end
  27    end
  28  end
  29  
  30  Dir['gems/cache', 'gems/bin', 'gems/doc'].each do |path|
  31    run "rm -rf #{path}"
  32  end
  33  
  34  run "jar cf lib/merb.jar -C ./gems ."

posted by Png genki on Mon 7 Sep 2009 at 19:16 with 2 comments

Comments:

Face pdxpatzer almost 10 years ago.

genki any chance you will update your Copy-On-Select SIMBL plugin for Terminal.app so that it works with Snow Leopard and SIMBL 0.9.5b ? thank you very much ! Marino

Png 瀧内元気 almost 10 years ago.

I want to do it but I have not Snow Leopard yet. I will upgrade my Macbook soon after finishing current tasks. (It takes time a bit, but) Please wait for it :-)

or Preview
Social Bookmarks
  • Delicious
  • B_entry1601
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ