Class: PoolParty::Plugin::SvnRepos
- Inherits:
-
PoolParty::Plugin
- Object
- PoolParty::Plugin
- PoolParty::Plugin::SvnRepos
- Defined in:
- lib/poolparty/plugins/svn.rb
Instance Method Summary collapse
- #at(dir) ⇒ Object
-
#class_type_name ⇒ Object
Since svn is not a native type, we have to say which core resource it is using to be able to require it.
- #creates_dir ⇒ Object
- #has_svn_repository ⇒ Object
- #loaded(opts = {}, &block) ⇒ Object
- #svn_repos(src) ⇒ Object
- #to(dir) ⇒ Object
Methods included from PoolParty::Plugin
Instance Method Details
#at(dir) ⇒ Object
46 47 48 |
# File 'lib/poolparty/plugins/svn.rb', line 46 def at(dir) working_dir dir end |
#class_type_name ⇒ Object
Since svn is not a native type, we have to say which core resource it is using to be able to require it
60 61 62 |
# File 'lib/poolparty/plugins/svn.rb', line 60 def class_type_name "exec" end |
#creates_dir ⇒ Object
54 55 56 |
# File 'lib/poolparty/plugins/svn.rb', line 54 def creates_dir "#{::File.join( working_dir, ::File.basename(source, ::File.extname(source)) )}/.svn" end |
#has_svn_repository ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/poolparty/plugins/svn.rb', line 21 def has_svn_repository has_directory(::File.dirname(working_dir)) has_directory(:name => "#{working_dir}", :requires => get_directory("#{::File.dirname(working_dir)}")) has_exec(:name => "svn-#{name}", :requires => [get_directory("#{working_dir}"), get_package("subversion")] ) do cwd working_dir svn_cmd = if parent.requires_user? "svn co #{source} --username #{requires_user} --password #{requires_password}" else "svn co #{source}" end command svn_cmd creates creates_dir end has_exec(:name => "update-#{name}", :cwd => ::File.dirname( creates_dir )) do command "svn up" # If the parent has after_update_svn set on it, then run it runs parent.after_update_svn if parent.after_update_svn? end end |
#loaded(opts = {}, &block) ⇒ Object
16 17 18 19 |
# File 'lib/poolparty/plugins/svn.rb', line 16 def loaded(opts={}, &block) has_package("subversion") has_svn_repository end |
#svn_repos(src) ⇒ Object
42 43 44 |
# File 'lib/poolparty/plugins/svn.rb', line 42 def svn_repos(src) source src end |
#to(dir) ⇒ Object
50 51 52 |
# File 'lib/poolparty/plugins/svn.rb', line 50 def to(dir) at(dir) end |