Module: TeamCity::Client::VCSRoots
- Included in:
- TeamCity::Client
- Defined in:
- lib/teamcity/client/vcs_roots.rb
Constant Summary collapse
- VCS_TYPES =
{ 'git' => 'jetbrains.git' }
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
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/teamcity/client/vcs_roots.rb', line 38 def create_vcs_root( = {}, &block) attributes = { :name => .fetch(:vcs_name), :vcsName => VCS_TYPES[.fetch(:vcs_type)] || .fetch(:vcs_type), :projectLocator => .fetch(:project_id) } builder = TeamCity::ElementBuilder.new(attributes, &block) post("vcs-roots", :content_type => :json) do |req| req.body = builder.to_request_body end end |
#vcs_root_details(vcs_root_id) ⇒ Hashie::Mash
Get VCS Root details
19 20 21 |
# File 'lib/teamcity/client/vcs_roots.rb', line 19 def vcs_root_details(vcs_root_id) get("vcs-roots/id:#{vcs_root_id}") end |
#vcs_roots ⇒ Array<Hashie::Mash>?
List of VCS Roots
10 11 12 13 |
# File 'lib/teamcity/client/vcs_roots.rb', line 10 def vcs_roots response = get('vcs-roots') response['vcs-root'] end |