# File lib/commands/plugin/rails_environment.rb, line 17 def self.default @default ||= find end
# File lib/commands/plugin/rails_environment.rb, line 21 def self.default=(rails_env) @default = rails_env end
# File lib/commands/plugin/rails_environment.rb, line 87 def add_plugin_to_svn(plugin_name) system("svn add #{root}/vendor/plugins/#{plugin_name}") end
# File lib/commands/plugin/rails_environment.rb, line 59 def best_install_method? return :http unless use_svn? case when use_externals? then :externals when use_checkout? then :checkout else :export end end
# File lib/commands/plugin/rails_environment.rb, line 68 def externals return [] unless use_externals? ext = `svn propget svn:externals "#{root}/vendor/plugins"` ext.reject{ |line| line.strip == '' }.map do |line| line.strip.split(/\s+/, 2) end end
# File lib/commands/plugin/rails_environment.rb, line 76 def externals=(items) unless items.is_a? String items = items.map{|name,uri| "#{name.ljust(29)} #{uri.chomp('/')}"}.join("\n") end Tempfile.open("svn-set-prop") do |file| file.write(items) file.flush system("svn propset -q svn:externals -F \"#{file.path}\" \"#{root}/vendor/plugins\"") end end
# File lib/commands/plugin/rails_environment.rb, line 25 def install(name_uri_or_plugin) if name_uri_or_plugin.is_a? String if name_uri_or_plugin =~ /:\/\// plugin = Plugin.new(name_uri_or_plugin) else plugin = Plugins[name_uri_or_plugin] end else plugin = name_uri_or_plugin end unless plugin.nil? plugin.install else puts "plugin not found: #{name_uri_or_plugin}" end end
# File lib/commands/plugin/rails_environment.rb, line 52 def use_checkout? # this is a bit of a guess. we assume that if the rails environment # is under subversion then they probably want the plugin checked out # instead of exported. This can be overridden on the command line File.directory?("#{root}/.svn") end
Generated with the Darkfish Rdoc Generator 2.