class BuPr::Configuration
Constants
- ATTRS
Public Class Methods
new(opts = {})
click to toggle source
@param opts [Hash] @option opts [String] :branch Base branch name @option opts [String] :title pull-request title @option opts [String] :token GitHub access token @option opts [String] :repo GitHub repository name
# File lib/bu_pr/configuration.rb, line 19 def initialize opts = {} @branch = opts.fetch(:branch) { ENV.fetch("BUPR_BRANCH") { "master" } } @title = opts.fetch(:title) { ENV.fetch("BUPR_TITLE") { default_title } } @token = opts.fetch(:token) { ENV["BUPR_TOKEN"] } @repo = opts.fetch(:repo) { ENV["BUPR_REPO"] } end
Public Instance Methods
valid?()
click to toggle source
@return [Boolean]
# File lib/bu_pr/configuration.rb, line 28 def valid? token? && branch? && title? && repo? end
Private Instance Methods
default_title()
click to toggle source
@private @return [String]
# File lib/bu_pr/configuration.rb, line 45 def default_title "Bundle update #{Time.now.strftime('%F')}" end