1 # meta.rb contains <tt>Twitter::Meta</tt> and related classes that
2 # help define the metadata of the <tt>Twitter4R</tt> project.
7 class Twitter::Meta #:nodoc:
8 attr_accessor :root_dir
9 attr_reader :gem_spec, :project_files, :spec_files
11 # Initializer for Twitter::Meta class. Takes <tt>root_dir</tt> as parameter.
12 def initialize(root_dir)
16 # Returns package information defined in <tt>root_dir</tt>/pkg-info.yml
18 yaml_file = File.join(@root_dir, 'pkg-info.yml')
19 ryaml = ERB.new(File.read(yaml_file), 0)
20 s = ryaml.result(binding)
24 # Returns RubyGems spec information
26 self.pkg_info['spec'] if self.pkg_info
29 # Returns list of project files
31 @project_files ||= Dir.glob(File.join(@root_dir, 'lib/**/*.rb'))
35 # Returns list of specification files
37 @spec_files ||= Dir.glob(File.join(@root_dir, 'spec/**/*.rb'))
41 # Returns RubyGem specification for Twitter4R project
43 @gem_spec ||= Gem::Specification.new do |spec|
44 self.spec_info.each do |key, val|
50 spec.send("#{key}=", val)