没有任何数据可供显示
| 开源项目社区 | 当前位置 : |
|
| www.trustie.net/open_source_projects | 主页 > 开源项目社区 > ruby-perl |
|
ruby-perl
|
| 0 | 0 | 0 |
| 贡献者 | 讨论 | 代码提交 |
概述
The library's primary aim is to make the wealth of libraries on CPAN available to Ruby. It should also serve as an easier approach to glue different-language software projects, or as a language migration path.
It is based on Yoshidam's Perl library, with some minor updates and fixes. It builds on that work by offloading a lot of meta-magic to a Ruby script which attempts to perform introspection on Perl classes (using Devel::Symdump), and creating classes in Ruby with appropriate methods.
It still needs a fair bit of work, but currently you can do this kind of thing (require hacking a la ruby-python):
require 'perl'
require 'perl/spreadsheet/parse_excel'
- put class in top-level namespace. Perl is currently a class so you can't include
Spreadsheet = Perl::Spreadsheet
- extend perl class in ruby
class Spreadsheet::ParseExcel
class Worksheet
def inspect # Worksheet is a blessed hash, "instance variables" are hash members
"#<#{self.class}:#{self['Name']}>"
end
end
end
- note that the array of worksheets is stored in this hash key:
p book['Worksheet'] - => [#]
创建时间:2014-05-12 08:11
标签:
