# File lib/commands/plugin.rb, line 397 def self.each(&block) self.instance.each(&block) end
# File lib/commands/plugin.rb, line 325 def add(uri) unless find{|repo| repo.uri == uri } @repositories.push(Repository.new(uri)).last end end
# File lib/commands/plugin.rb, line 369 def defaults http://dev.rubyonrails.com/svn/rails/plugins/ end
# File lib/commands/plugin.rb, line 321 def each(&block) @repositories.each(&block) end
# File lib/commands/plugin.rb, line 335 def exist?(uri) @repositories.detect{|repo| repo.uri == uri } end
# File lib/commands/plugin.rb, line 375 def find_home ['HOME', 'USERPROFILE'].each do |homekey| return ENV[homekey] if ENV[homekey] end if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}" end begin File.expand_path("~") rescue StandardError => ex if File::ALT_SEPARATOR "C:/" else "/" end end end
# File lib/commands/plugin.rb, line 343 def find_plugin(name) @repositories.each do |repo| repo.each do |plugin| return plugin if plugin.name == name end end return nil end
# File lib/commands/plugin.rb, line 352 def load! contents = File.exist?(@cache_file) ? File.read(@cache_file) : defaults contents = defaults if contents.empty? @repositories = contents.split(/\n/).reject do |line| line =~ /^\s*#/ or line =~ /^\s*$/ end.map { |source| Repository.new(source.strip) } end
Generated with the Darkfish Rdoc Generator 2.