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.
27 28 29 30 31 32 33 34 35 |
# File 'lib/r10k/module/svn.rb', line 27 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.
16 17 18 |
# File 'lib/r10k/module/svn.rb', line 16 def expected_revision @expected_revision end |
#full_path ⇒ Object (readonly)
Returns the value of attribute full_path.
25 26 27 |
# File 'lib/r10k/module/svn.rb', line 25 def full_path @full_path end |
#svn_path ⇒ Object (readonly)
Returns the value of attribute svn_path.
21 22 23 |
# File 'lib/r10k/module/svn.rb', line 21 def svn_path @svn_path end |
Class Method Details
.implement?(name, args) ⇒ Boolean
10 11 12 |
# File 'lib/r10k/module/svn.rb', line 10 def self.implement?(name, args) args.is_a? Hash and args.has_key? :svn end |
Instance Method Details
#exist? ⇒ Boolean
62 63 64 |
# File 'lib/r10k/module/svn.rb', line 62 def exist? @full_path.exist? end |
#status ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/r10k/module/svn.rb', line 37 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
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/r10k/module/svn.rb', line 51 def sync case status when :absent install when :mismatched reinstall when :outdated update end end |