Class: R10K::Module::SVN
Instance Attribute Summary collapse
-
#expected_revision ⇒ Object
(also: #expected_version)
readonly
Returns the value of attribute expected_revision.
-
#full_path ⇒ Object
readonly
Returns the value of attribute full_path.
-
#svn_path ⇒ Object
readonly
Returns the value of attribute svn_path.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(name, basedir, args) ⇒ SVN
constructor
A new instance of SVN.
- #status ⇒ Object
- #sync ⇒ Object
Constructor Details
#initialize(name, basedir, args) ⇒ SVN
Returns a new instance of SVN.
26 27 28 29 30 31 32 33 34 |
# File 'lib/r10k/module/svn.rb', line 26 def initialize(name, basedir, args) @name = name @basedir = basedir (args) @full_path = Pathname.new(File.join(@basedir, @name)) @working_dir = R10K::SVN::WorkingDir.new(@full_path) end |
Instance Attribute Details
#expected_revision ⇒ Object (readonly) Also known as: expected_version
Returns the value of attribute expected_revision.
15 16 17 |
# File 'lib/r10k/module/svn.rb', line 15 def expected_revision @expected_revision end |
#full_path ⇒ Object (readonly)
Returns the value of attribute full_path.
24 25 26 |
# File 'lib/r10k/module/svn.rb', line 24 def full_path @full_path end |
#svn_path ⇒ Object (readonly)
Returns the value of attribute svn_path.
20 21 22 |
# File 'lib/r10k/module/svn.rb', line 20 def svn_path @svn_path end |
Class Method Details
.implement?(name, args) ⇒ Boolean
9 10 11 |
# File 'lib/r10k/module/svn.rb', line 9 def self.implement?(name, args) args.is_a? Hash and args.has_key? :svn end |
Instance Method Details
#exist? ⇒ Boolean
61 62 63 |
# File 'lib/r10k/module/svn.rb', line 61 def exist? @full_path.exist? end |
#status ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/r10k/module/svn.rb', line 36 def status if not self.exist? :absent elsif not @working_dir.is_svn? :mismatched elsif not @url == @working_dir.url :mismatched elsif not @expected_revision == @working_dir.revision :outdated else :insync end end |
#sync ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/r10k/module/svn.rb', line 50 def sync case status when :absent install when :mismatched reinstall when :outdated update end end |