To create a ruby gem using the gem tool, you have to create a gem specification file, next to your sources :
specification = Gem::::Specification.new do |s| s.name = "module_name" s.version = "0.0.1" s.author = "geo" s.homepage = "https://ssscripting.wordpress.com" s.has_rdoc = false s.files = ["script_file.rb"] s.summary = "this is your description" end
If you need a gem dependency, you can add some lines like the following :
where some_gem is the name of the gem ( like you would require it,ex: require “hpricot” ) and x and y are version numbers.
I think this is the minimum gem specification that works. To create the gem from the specification & sources, you need to run the gem command :
gem build gem_spec.spec
This will create a .gem file, that can be installed.
To install the gem, you run gem like this :
gem install gem_name.gem