0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Updates your Gist files defined in YAML. For example, it's useful for syncing GitHub and Gist in CI.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 12.3
~> 3.7
~> 0.52.1
~> 3.3
~> 0.9

Runtime

~> 4.0
~> 0.19.1
 Project Readme

GistUpdater

Travis Status License Gem

Description

Updates your Gist files defined in YAML

https://masutaka.net/chalow/2016-09-29-1.html (In Japanese)

Installation

Add this line to your application's Gemfile:

gem 'gist_updater'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gist_updater

Usage

CLI

gist_updater commands:
  gist_updater help [COMMAND]  # Describe available commands or one specific command
  gist_updater update          # Update your Gist files (default)
  gist_updater version         # Display version

Options:
  y, [--yaml=YAML]            # User definition YAML file
                              # Default: gist_updater.yml
  u, [--user=USER]            # GitHub username
  t, [--token=TOKEN]          # GitHub personal access token
  d, [--debug], [--no-debug]  # Debug mode

Script

require 'gist_updater'

GistUpdater::Updater.new(
  yaml:  'User definition YAML file',
  user:  'GitHub usename',               # or $GISTUPDATER_USER
  token: 'GitHub personal access token', # or $GISTUPDATER_ACCESS_TOKEN
  debug: 'true or false'
).update
#=> Array<Sawyer::Resource>

YAML format

-
  - 'gist_id_1'
  - 'path to file_1'
-
  - 'gist_id_2'
  - 'path to file_2a'
  - 'path to file_2b'

For example,

-
  # https://gist.github.com/masutaka/8177244
  - 8177244
  - .emacs.d/init.el
-
  # https://gist.github.com/masutaka/f7ce8b3c71e995c20e48
  - f7ce8b3c71e995c20e48
  - circle.yml
  - tasks/pushover.rake

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/masutaka/gist_updater. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.