Sha256: 581e4922c2b74dea9b7f971bb4b78ea9807b81a0ec38b21cf87d55c7629b9789

Contents?: true

Size: 1.37 KB

Versions: 120

Compression:

Stored size: 1.37 KB

Contents

#!/bin/bash

#/ NAME
#/     publish-gem -- publish a gem to a local, remote rubygems, geminabox repository
#/
#/ SYNOPSIS
#/     publish gem [--public | --private | --local]

# figure out the project root under which bin, lib live
shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"

# load a jason bourne library
source "$shome/libexec/_treadstone"

# define command line options:
DEFINE_boolean "private" "$FLAGS_TRUE" "push to a local, private geminabox"
DEFINE_boolean "shared" "$FLAGS_FALSE" "push to a shared, private geminabox"
DEFINE_boolean "public" "$FLAGS_FALSE" "push to rubygems.org"

# entry point
function main {
  if [[ "$FLAGS_public" = "$FLAGS_TRUE" ]]; then
    push_gem "$@"
  elif [[ "$FLAGS_private" = "$FLAGS_TRUE" ]]; then
    push_gem_private
  else
    logger_fatal "must specify --public to confirm a gem push to rubygems.org"
    exit 1
  fi
}

# push a gem locally 
function push_gem_private {
  if [[ "$#" = 0 ]]; then
    set +f
    local latest_gem="$(ls -td *.gem 2>&- | head -1)"
    push_gem_private "$latest_gem"
    set -f
  else
    gem inabox -g http://localhost:9292 "$@"
  fi
}

# push the latest gem to rubygems.org
function push_gem {
  set +f
  local latest_gem="$(ls -td *.gem 2>&- | head -1)"
  set -f
  
  if [[ -z "$latest_gem" ]]; then
    logger_fatal "no gems found"
    exit 1
  fi

  gem push "$latest_gem"
}

require sub "$BASH_SOURCE" "$@"

Version data entries

120 entries across 60 versions & 1 rubygems

Version Path
alpha_omega-1.4.0 libexec/publish-gem
alpha_omega-1.4.0 libexec/publish
alpha_omega-1.3.9 libexec/publish-gem
alpha_omega-1.3.9 libexec/publish
alpha_omega-1.3.8 libexec/publish-gem
alpha_omega-1.3.8 libexec/publish
alpha_omega-1.3.7 libexec/publish
alpha_omega-1.3.7 libexec/publish-gem
alpha_omega-1.3.6 libexec/publish-gem
alpha_omega-1.3.6 libexec/publish
alpha_omega-1.3.5 libexec/publish-gem
alpha_omega-1.3.5 libexec/publish
alpha_omega-1.3.4 libexec/publish
alpha_omega-1.3.4 libexec/publish-gem
alpha_omega-1.3.3 libexec/publish
alpha_omega-1.3.3 libexec/publish-gem
alpha_omega-1.3.2 libexec/publish
alpha_omega-1.3.2 libexec/publish-gem
alpha_omega-1.3.1 libexec/publish
alpha_omega-1.3.1 libexec/publish-gem