Rakefile in how_is-18.0.5 vs Rakefile in how_is-18.1.0
- old
+ new
@@ -1,11 +1,10 @@
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "timecop"
-require "./spec/vcr_helper.rb"
require "how_is"
RSpec::Core::RakeTask.new(:spec) do |t|
# Warning.warn() was added in Ruby 2.4.0, so don't use -w on older versions.
t.ruby_opts = "-w -r./spec/capture_warnings.rb" if RUBY_VERSION >= "2.4.0"
@@ -25,10 +24,12 @@
yield
end
end
def self.generate_report(repository, format)
+ require "./spec/vcr_helper.rb"
+
freeze_time do
report = nil
options = {
repository: repository,
@@ -69,18 +70,20 @@
task :all => [:html, :json]
end
desc "List new contributors. Lists committers with no earlier commits then "\
- "given since_date (as %Y-%m-%d). Defaults to first of current month."
-task :new_contributors, [:user, :repo, :since_date] => [] do |_t, args|
+ "given start_date (as %Y-%m-%d). Defaults to first of current month."
+task :new_contributors, [:user, :repo, :start_date] => [] do |_t, args|
require "how_is/contributions"
user = args[:user] || "how-is"
repo = args[:repo] || "how_is"
- since_date = args[:since_date] || Time.now.strftime("%Y-%m-01")
+ start_date = args[:start_date] || Time.now.strftime("%Y-%m-01")
+ contributions = HowIs::Contributions.new(start_date: start_date,
+ user: user,
+ repo: repo)
+
puts "New committers:"
- puts Contributions.new(github: Github.new(auto_pagination: true),
- since_date: since_date,
- user: user,
- repo: repo).new_contributors
+ puts contributions.summary
+ puts contributions.new_contributors
end