- B
- D
- E
- F
- I
- N
- U
[R] | root |
Source: show
# File rails/railties/lib/commands/plugin.rb, line 73 def self.default @default ||= find end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 77 def self.default=(rails_env) @default = rails_env end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 65 def self.find(dir=nil) dir ||= pwd while dir.length > 1 return new(dir) if File.exist?(File.join(dir, 'config', 'environment.rb')) dir = File.dirname(dir) end end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 61 def initialize(dir) @root = dir end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 115 def best_install_method return :http unless use_svn? case when use_externals? then :externals when use_checkout? then :checkout else :export end end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 124 def externals return [] unless use_externals? ext = %xsvn propget svn:externals "#{root}/vendor/plugins"` ext.reject{ |line| line.strip == '' }.map do |line| line.strip.split(%r\s+/, 2) end end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 132 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
Source: show
# File rails/railties/lib/commands/plugin.rb, line 81 def install(name_uri_or_plugin) if name_uri_or_plugin.is_a? String if name_uri_or_plugin =~ %r:\/\// 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
Source: show
# File rails/railties/lib/commands/plugin.rb, line 108 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
Source: show
# File rails/railties/lib/commands/plugin.rb, line 104 def use_externals? use_svn? && File.directory?("#{root}/vendor/plugins/.svn") end
Source: show
# File rails/railties/lib/commands/plugin.rb, line 98 def use_svn? require 'active_support/core_ext/kernel' silence_stderr {%xsvn --version` rescue nil} !$?.nil? && $?.success? end