森(@mori_dev)さんから報告頂いていたもうひとつの問題についてです。
http://gist.github.com/1168173
[以下抜粋]
> $ sekka-path
> NOTE: Gem.latest_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
> Gem.latest_load_paths called from /home/mori-k/.rvm/gems/ruby-1.9.2-p290/gems/sekka-0.8.8/bin/sekka-path:5.
> NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
> Gem.all_partials called from /home/mori-k/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:598.
> NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
> Gem.all_partials called from /home/mori-k/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:598.
> /home/mori-k/.rvm/gems/ruby-1.9.2-p290/gems/sekka-0.8.8
>
> このためドキュメント( http://oldtype.sumibi.org/show-page/Sekka.Setup )の以下の記述だと reuquire できない(もちろん僕は回避できます)。
>
> (when (= 0 (shell-command "sekka-path"))
> (push (concat (car (split-string (shell-command-to-string "sekka-path"))) "/emacs") load-path)
> (require 'sekka)
> ;;(setq sekka-sticky-shift t) ;; sticky-shiftを使用する場合、この行を有効にする
> (global-sekka-mode 1))
Rubygemsの廃止予定のメソッドを使っているのが原因のようです。
Rubygemsを使わない方法で回避してみました。
エラーが出ていたオリジナル版。
rubygemsのバージョンに依存します。
---[bin/sekka-path]---
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
arr = Gem.latest_load_paths.select { |x|
x.match( /\/sekka[-]/ )
}
if 0 == arr.size
STDERR.puts "Error: gem of sekka is not installed yet..."
exit( 1 )
else
puts arr[0].sub( /\/lib$/, "" )
end
rubygemsのバージョンに依存しない新しい方式。__FILE__を使います。
森さんに、twitterでrubygemsのバージョンを取得する方法を教えて頂いたので
すが、結局__FILE__を使うほうが、rubygemsのAPI変更に振りまわされずに済む
かなぁと思いまして…
---[bin/sekka-path]---
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'sekka/path'
puts SekkaPath.path
---[lib/sekka/path.rb]---
class SekkaPath
def self.path
libsekka = File.dirname( __FILE__ )
File.expand_path( libsekka + "/../.." )
end
end
姑息ですが、確実な気がしています。いかがでしょうか。
githubのmasterにマージ済みです。
--kiyoka