GithubHelp home page GithubHelp logo

stash_core_api's Introduction

stash_core_api

Build Status

Description

Make basic auth requests to Stash Core REST API.

Features

  • Provides client to make requests to Stash

Examples

require 'stash_core_api'

Using client to get commit and pull request info

require 'stash_core_api'
stash_client = StashCoreAPI::Client.new(
  user: user,
  pass: pass,
  project: project,
  repository: stash_repo,
  stash_url: stash_url,
)

# commits
stash_client.commits(since: sha1, until_: sha2)

# pull requests
stash_client.info(pull_request_id)
stash_client.can_merge?(pull_request_id)

Implementing More Endpoints

This gem only implements a few of the many ones that Stash Core REST API offers, which can be seen here.

Note: filenames in this gem are pulled from the following pattern: rest/api/1.0/projects/{projectKey}/repos/{respositorySlug}/<file-name>, which corresponds to the file lib/stash_core_api/file_name.rb in this gem.

Add method to an existing endpoint

Implementing watch pull requests:

  1. Implement method watch in lib/stash_core_api/pull_requests.rb

Using the stash client above, you can now call this method:

stash_client.watch(pull_request_id)

Add new endpoint

Implementing branches:

  1. Create file lib/stash_core_api/branches.rb
  2. Implement method branches in lib/stash_core_api/pull_requests.rb
  3. Include StashCoreAPI::Branches in lib/stash_core_api/api.rb

Using the stash client above, you can now call this method:

stash_client.branches

Install

$ gem install stash_core_api

License

Copyright 2015 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

stash_core_api's People

Contributors

alyssa avatar nerdrew avatar prashantjois avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.