Project

gaf

0.0
No commit activity in last 3 years
No release in over 3 years
Create githook webhook and management pull request on worksheet
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.12.0
~> 3.0.7
 Project Readme

GAF

This is a Ruby library to read/write files/spreadsheets in Google Drive/Docs.

NOTE: This is NOT a library to create Google Drive App.

Add this line to your application's Gemfile:

gem 'gaf'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gaf

If you need system wide installation, execute below:

$ sudo gem install gaf

Authorization

Follow one of the options in Authorization to construct a session object. The example code below assumes "On behalf of you" option.

Configuration

  • First create gaf.rb on config/initializers/gaf.rb
  • Add config as below
Gaf.configure do |config|
  # See this document to learn how to create config.json:
  # https://github.com/gimite/google-drive-ruby/blob/master/doc/authorization.md
  config.google_application_credential = "config.json"
  config.title_worksheet = "Test" # spreadsheet's name
  config.array_main_branchs = ["staging", "master"] # main branch
end
  • Then, configure a route to receive the github webhook POST requests.
# config/routes.rb
namespace :api do
    namespace :v1, defaults: {format: :json} do
      post "/hook_githubs_test", to: "webhook_githubs#hook_event_github"
    end
  end
  • Then create a new controller:
# app/v1/controllers/webhook_githubs_controller.rb
class Api::V1::WebhookGithubsController < ApplicationController
  include Gaf::Processor
end

License

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

Author

https://github.com/Huyliver6793