Sha256: 0aeb7f5152c41acbf299b884a99a413bec2a033fa60008d2fed8874b82f95848

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module DeployLog
  module Github
    class Deploys
      def initialize
        @github = Helper.new(ARGV.first)
      end

      def merged_between(start, finish = nil)
        return Notify.error 'Start (--start=) is a required argument' if start.nil?

        finish = Date.today.to_time + (24 * 60 * 60) - 1 if finish.nil?

        @github.pulls_in_timeframe(start, finish)
      end

      def merged_today
        start = Date.today.to_time # 12:00AM this morning
        finish = Date.today.to_time + (24 * 60 * 60) - 1 # 11:59PM tonight

        @github.pulls_in_timeframe(start, finish)
      end

      def merged_on(start)
        return Notify.error 'Start (--start=) is a required argument' if start.nil?

        finish = start + 24 * 60 * 60 - 1

        @github.pulls_in_timeframe(start, finish)
      end

      def pr_title(title)
        @github.search_pulls_by(title, :title)
      end

      def pr_for_branch(branch)
        @github.search_pulls_by(branch, :ref)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
deploy_log-0.1.8 lib/deploy_log/github/deploys.rb
deploy_log-0.1.8a lib/deploy_log/github/deploys.rb
deploy_log-0.1.7 lib/deploy_log/github/deploys.rb
deploy_log-0.1.6 lib/deploy_log/github/deploys.rb
deploy_log-0.1.5 lib/deploy_log/github/deploys.rb
deploy_log-0.1.4 lib/deploy_log/github/deploys.rb