用ruby写了一个生成xpcom组件模板的小工具

写xpcom组件我们经常copy paste,因为xpcom组件的与业务无关的注册、QueryInterface代码都是基本固定的,
写了一个自动生成xpcom组件的template,这样就可以只关心核心业务,避免书写样板式的代码。

=begin
NOTICE:
Before use the code:
You should use command "gem install uuid" to install uuid gem for ruby
Once installed, create a uuid.state file by running command "uuid-setup"
=end

require 'uuid'

puts "please input the component interface name:"
component_interface_name = gets.chomp

puts "please input the component class name:"
class_name = gets.chomp
cid = "{#{UUID.new}}";

template = <

 生成idl文件:

=begin
NOTICE:
Before use the code:
You should use command "gem install uuid" to install uuid gem for ruby
Once installed, create a uuid.state file by running command "uuid-setup"
=end

require 'uuid'

puts "please input the component interface name:"
component_interface_name = gets.chomp

template = <

 

你可能感兴趣的:(Firefox,plugin/XPCOM)