Gemfury | クラウドパッケージリポジトリ Gemfury の登録、疎通確認まで #gemfury


Gemfury | クラウドパッケージリポジトリ Gemfury の登録、疎通確認まで

概要

クラウドパッケージリポジトリ Gemfury の登録、疎通確認までについて。

Gemfury => Gem + fury だろうか?
fury => 狂乱、猛威、激怒、激高、憤激、激憤

アイコンが、ドラゴンボールみたいにオーラをまとって飛んでいる Ruby 風なので
滾っている様を表しているのか?

用途

RubyGems に公開できないが、 geminabox など自前の gem server を構築・運用する手間を省きたい。
そんなケースで クラウドパッケージリポジトリ Gemfury の利用が考えられます。
14日の無料お試し期間付。

お試し以降の価格については、下記参照
gemfury pricing

Gemfury は RubyGems 以外にも、

  • PHP Composer
  • Node.js npm
  • Python PyPI
  • NuGet
  • apt / deb
  • yum / rpm

などにも対応している。
今回は RubyGems の話。

手順

gottani gem を対象とします。

  • pricing の画面から Create a Free Acount のボタンを押下

  • アカウント作成画面に Username, Email, Password を登録して Create New Account

  • ログインが成功し、 Get Start ページが表示されます

  • gem remote のリポジトリを登録します

$ git remote add fury https://[email protected]/your_account/<package-name>.git
$ git push fury master
  • 登録されたことを確認します

  • 登録した gem をインストールしてみます

    • Repos メニューでリポジトリのURLを取得できます
    • URLはシークレットトークンを含んでおり、ユーザーごとに異なります
    • ※外部公開するリポジトリの Gemfile などから呼び出す場合はトークン部分を環境変数に設定すること
  • Gemfile

source 'https://[email protected]/your_account/'
# 外部公開する Gemfile の場合はハードコードせずに環境変数経由で設定
# source "https://#{ENV['GEMSPEC_KEY']}@gem.fury.io/your_account/"

gem 'gottani'
  • インストール実行
$ bundle install
  • インストール確認
$ gem list | grep gottani
gottani (0.0.2)
  • gottani を呼び出す rb を作成・実行してみます
require 'gottani_core'

text =<<-EOS
root
    child1
        child1_1
            child1_1_1
            child1_1_2
        child1_2
    child2
        child2_1
    child3
EOS

gottani_core = Gottani::Core.new :space4, text
print gottani_core.to_markdown

出力

# root
## child1
### child1_1
#### child1_1_1
#### child1_1_2
### child1_2
## child2
### child2_1
## child3

参照