Module: TeamCity::Client::VCSRoots
- Included in:
- TeamCity::Client
- Defined in:
- lib/teamcity/client/vcs_roots.rb
Instance Method Summary collapse
-
#create_vcs_root(options = {}) {|Hash| ... } ⇒ Hashie::Mash
Create VCS Root.
-
#vcs_root_details(vcs_root_id) ⇒ Hashie::Mash
Get VCS Root details.
-
#vcs_roots ⇒ Array<Hashie::Mash>?
List of VCS Roots.
Instance Method Details
#create_vcs_root(options = {}) {|Hash| ... } ⇒ Hashie::Mash
Create VCS Root
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/teamcity/client/vcs_roots.rb', line 36 def create_vcs_root( = {}, &block) attributes = { :name => .fetch(:vcs_name), :vcsName => "jetbrains.#{.fetch(:vcs_type)}", :projectLocator => .fetch(:project_id) } builder = Builder::XmlMarkup.new builder.tag!('vcs-root'.to_sym, attributes) do |node| node.properties do |p| if block_given? properties = {} yield(properties) properties.each do |name, value| p.property(:name => name, :value => value) end end end end post("vcs-roots", :content_type => :xml) do |req| req.body = builder.target! end end |
#vcs_root_details(vcs_root_id) ⇒ Hashie::Mash
Get VCS Root details
17 18 19 |
# File 'lib/teamcity/client/vcs_roots.rb', line 17 def vcs_root_details(vcs_root_id) get("vcs-roots/id:#{vcs_root_id}") end |
#vcs_roots ⇒ Array<Hashie::Mash>?
List of VCS Roots
8 9 10 11 |
# File 'lib/teamcity/client/vcs_roots.rb', line 8 def vcs_roots response = get('vcs-roots') response['vcs-root'] end |