Class: R10K::Module::SVN
- Includes:
- Util::Setopts
- Defined in:
- lib/r10k/module/svn.rb
Constant Summary collapse
- INITIALIZE_OPTS =
{ :svn => :url, :rev => :expected_revision, :revision => :expected_revision, :username => :self, :password => :self }
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.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#working_dir ⇒ Object
readonly
Returns the value of attribute working_dir.
Attributes inherited from Base
#dirname, #name, #owner, #path, #title
Class Method Summary collapse
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(name, dirname, opts) ⇒ SVN
constructor
A new instance of SVN.
- #properties ⇒ Object
- #status ⇒ Object
- #sync ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(name, dirname, opts) ⇒ SVN
Returns a new instance of SVN.
48 49 50 51 52 |
# File 'lib/r10k/module/svn.rb', line 48 def initialize(name, dirname, opts) super setopts(opts, INITIALIZE_OPTS) @working_dir = R10K::SVN::WorkingDir.new(@path, :username => @username, :password => @password) 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.
21 22 23 |
# File 'lib/r10k/module/svn.rb', line 21 def full_path @full_path end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
31 32 33 |
# File 'lib/r10k/module/svn.rb', line 31 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
26 27 28 |
# File 'lib/r10k/module/svn.rb', line 26 def username @username end |
#working_dir ⇒ Object (readonly)
Returns the value of attribute working_dir.
36 37 38 |
# File 'lib/r10k/module/svn.rb', line 36 def working_dir @working_dir 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
79 80 81 |
# File 'lib/r10k/module/svn.rb', line 79 def exist? path.exist? end |
#properties ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/r10k/module/svn.rb', line 83 def properties { :expected => expected_revision, :actual => (@working_dir.revision rescue "(unresolvable)"), :type => :svn, } end |
#status ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/r10k/module/svn.rb', line 54 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
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/r10k/module/svn.rb', line 68 def sync case status when :absent install when :mismatched reinstall when :outdated update end end |