gistory 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09f3c9251a676aa3fe78d5487e7cb60ee6c8348de21ae7ad4d91ee7a16623f69'
4
- data.tar.gz: bb6b913eb6a330dea5db7e8f8bdd4e1db87324ff72abdeb48c835c00c87ab0a3
3
+ metadata.gz: 3e8eab6d518dee70d3c57035306062a1d3d466fe9fdd468076bece37ea8f21d3
4
+ data.tar.gz: 384accb7f97bc56ca2adaaae3963520a1d60f9f96e1b8c9f418077f0a14f5055
5
5
  SHA512:
6
- metadata.gz: 5f0931cb9e7673d6e7d88e1eb80e892ae3f482b1c3c8e4feae59b1b28f20b45a37bb6c08d51e4d15ec0d7115b780c0cc2f4dc4c530739197c4e9c48975ef19db
7
- data.tar.gz: 137c0bb24fa19cea60221ab8a57994bc7a4e46c99aa4666c6b3d35b133aeb0559541b26090c9d3f92f71d87daacc471b5fe283e0824433d98d1b8af30c3b3223
6
+ metadata.gz: 2320727fc749c876387b075bf3a26e5e45a74fc688f06fc1d91acf132307f7a3cac6a94bac3b913073f3a61be25a7ee31ed6ad1e275f7890309f9b3cf64dd6f9
7
+ data.tar.gz: 2877f804af2ef087f87a6900b6b4cdc834e574015853022d8332896fabbf4a9f9f63c8cf61c38016c463b5c3127234dce41c423890da16b9e99892227de67d9b
@@ -31,6 +31,9 @@ Style/IfUnlessModifier:
31
31
  Style/FrozenStringLiteralComment:
32
32
  EnforcedStyle: always
33
33
 
34
+ Style/StringLiterals:
35
+ EnforcedStyle: double_quotes
36
+
34
37
  # rubocop-rspec
35
38
 
36
39
  RSpec/MultipleExpectations:
data/Gemfile CHANGED
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
7
  group :development, :test do
8
- gem 'byebug' # debugger
9
- gem 'pry' # better console
10
- gem 'pry-byebug' # pry integration for byebug
8
+ gem "byebug" # debugger
9
+ gem "pry" # better console
10
+ gem "pry-byebug" # pry integration for byebug
11
11
  end
12
12
 
13
13
  group :test do
14
- gem 'coveralls', require: false
15
- gem 'simplecov', require: false # code coverage
14
+ gem "coveralls", require: false
15
+ gem "simplecov", require: false # code coverage
16
16
  end
17
17
 
18
- local_gemfile = 'Gemfile.local'
18
+ local_gemfile = "Gemfile.local"
19
19
  eval_gemfile(local_gemfile) if File.exist?(local_gemfile)
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'gistory'
6
- require 'pry'
4
+ require "bundler/setup"
5
+ require "gistory"
6
+ require "pry"
7
7
 
8
8
  root_path = "#{File.dirname(__FILE__)}/.."
9
9
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- lib = File.expand_path('../lib', __dir__)
4
+ lib = File.expand_path("../lib", __dir__)
5
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
 
7
- require 'gistory'
7
+ require "gistory"
8
8
 
9
9
  Gistory::Cli::Main.new(repo_path: Dir.getwd, args: ARGV).run
@@ -1,36 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'gistory/version'
5
+ require "gistory/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'gistory'
8
+ spec.name = "gistory"
9
9
  spec.version = Gistory::VERSION
10
10
  spec.platform = Gem::Platform::RUBY
11
- spec.required_ruby_version = '>= 2.4'
12
- spec.authors = ['Sergio Medina']
13
- spec.email = ['medinasergio@gmail.com']
11
+ spec.required_ruby_version = ">= 2.4"
12
+ spec.authors = ["Sergio Medina"]
13
+ spec.email = ["medinasergio@gmail.com"]
14
14
 
15
- spec.summary = 'Gistory: Know exactly when a gem was updated in your Gemfile.lock'
16
- spec.description = 'Gistory: Know exactly when a gem was updated in your Gemfile.lock'
17
- spec.homepage = 'https://www.github.com/serch/gistory'
18
- spec.licenses = ['MIT']
15
+ spec.summary = "Gistory: Know exactly when a gem was updated in your Gemfile.lock"
16
+ spec.description = "Gistory: Know exactly when a gem was updated in your Gemfile.lock"
17
+ spec.homepage = "https://www.github.com/serch/gistory"
18
+ spec.licenses = ["MIT"]
19
19
 
20
20
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
21
  f.match(%r{^(test|spec|features)/})
22
22
  end
23
- spec.bindir = 'exe'
23
+ spec.bindir = "exe"
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
- spec.require_paths = ['lib']
25
+ spec.require_paths = ["lib"]
26
26
 
27
- spec.add_dependency 'bundler', '~> 1.0'
28
- spec.add_dependency 'colorize'
27
+ spec.add_dependency "bundler", "~> 1.0"
28
+ spec.add_dependency "colorize"
29
29
 
30
- spec.add_development_dependency 'pry'
31
- spec.add_development_dependency 'pry-byebug'
32
- spec.add_development_dependency 'rake', '~> 13.0'
33
- spec.add_development_dependency 'rspec', '~> 3.9'
34
- spec.add_development_dependency 'rubocop'
35
- spec.add_development_dependency 'rubocop-rspec'
30
+ spec.add_development_dependency "pry"
31
+ spec.add_development_dependency "pry-byebug"
32
+ spec.add_development_dependency "rake", "~> 13.0"
33
+ spec.add_development_dependency "rspec", "~> 3.9"
34
+ spec.add_development_dependency "rubocop"
35
+ spec.add_development_dependency "rubocop-rspec"
36
36
  end
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'gistory/version'
3
+ require "gistory/version"
4
4
 
5
- require 'gistory/cli/main'
6
- require 'gistory/cli/arg_parser'
7
- require 'gistory/cli/io'
8
- require 'gistory/configuration'
5
+ require "gistory/cli/main"
6
+ require "gistory/cli/arg_parser"
7
+ require "gistory/cli/io"
8
+ require "gistory/configuration"
9
9
 
10
- require 'gistory/errors'
11
- require 'gistory/commit'
12
- require 'gistory/version_change'
13
- require 'gistory/git_repo'
14
- require 'gistory/lockfile_parser'
15
- require 'gistory/change_log'
10
+ require "gistory/errors"
11
+ require "gistory/commit"
12
+ require "gistory/version_change"
13
+ require "gistory/git_repo"
14
+ require "gistory/lockfile_parser"
15
+ require "gistory/change_log"
16
16
 
17
17
  module Gistory
18
18
  class << self
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Gistory
4
4
  class ChangeLog
5
- LOCKFILE = 'Gemfile.lock'
5
+ LOCKFILE = "Gemfile.lock"
6
6
 
7
7
  def initialize(repo:)
8
8
  @repo = repo
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'optparse'
3
+ require "optparse"
4
4
 
5
5
  module Gistory
6
6
  module Cli
@@ -30,13 +30,13 @@ module Gistory
30
30
 
31
31
  def parse_gem_name
32
32
  gem_name = @args.shift
33
- raise(Gistory::ParserError, 'No gem specified') unless gem_name
33
+ raise(Gistory::ParserError, "No gem specified") unless gem_name
34
34
  @config.gem_name = gem_name
35
35
  end
36
36
 
37
37
  def create_parser(config)
38
38
  parser = OptionParser.new
39
- parser.banner = 'Usage: gistory <gem_name> [options]'
39
+ parser.banner = "Usage: gistory <gem_name> [options]"
40
40
 
41
41
  add_options(parser, config)
42
42
 
@@ -44,8 +44,8 @@ module Gistory
44
44
  end
45
45
 
46
46
  def add_options(parser, config)
47
- parser.separator ''
48
- parser.separator 'Options:'
47
+ parser.separator ""
48
+ parser.separator "Options:"
49
49
 
50
50
  add_max_fetched_commits(parser, config)
51
51
  add_use_commits_from_all_branches(parser, config)
@@ -56,29 +56,29 @@ module Gistory
56
56
  def add_max_fetched_commits(parser, config)
57
57
  default = config.max_fetched_commits
58
58
  description = "max number of commits to be fetched (default #{default})"
59
- parser.on('-m', '--max-fetched-commits [Integer]', Integer, description) do |m|
60
- raise(Gistory::ParserError, 'argument --max-fetched-commits must be an integer') if m.nil?
59
+ parser.on("-m", "--max-fetched-commits [Integer]", Integer, description) do |m|
60
+ raise(Gistory::ParserError, "argument --max-fetched-commits must be an integer") if m.nil?
61
61
  config.max_fetched_commits = m
62
62
  end
63
63
  end
64
64
 
65
65
  def add_use_commits_from_all_branches(parser, config)
66
- description = 'use commits from all branches ' \
67
- '(by default it uses only commits made to the current branch)'
68
- parser.on('-a', '--all-branches', description) do |a|
66
+ description = "use commits from all branches " \
67
+ "(by default it uses only commits made to the current branch)"
68
+ parser.on("-a", "--all-branches", description) do |a|
69
69
  config.all_branches = a
70
70
  end
71
71
  end
72
72
 
73
73
  def add_help(parser)
74
- parser.on_tail('-h', '--help', 'Show this message') do
74
+ parser.on_tail("-h", "--help", "Show this message") do
75
75
  @io.puts parser
76
76
  exit
77
77
  end
78
78
  end
79
79
 
80
80
  def add_version(parser)
81
- parser.on_tail('--version', 'Show version') do
81
+ parser.on_tail("--version", "Show version") do
82
82
  @io.puts "gistory version #{Gistory::VERSION}"
83
83
  exit
84
84
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'colorize'
3
+ require "colorize"
4
4
 
5
5
  module Gistory
6
6
  module Cli
@@ -32,17 +32,17 @@ module Gistory
32
32
 
33
33
  @io.puts "Gem: #{gem_name}"
34
34
  @io.puts "Current version: #{changes.first.version}"
35
- @io.puts ''
35
+ @io.puts ""
36
36
 
37
37
  print_change_history(changes)
38
38
 
39
- @io.puts ''
39
+ @io.puts ""
40
40
 
41
41
  print_configuration_info
42
42
  end
43
43
 
44
44
  def print_change_history(changes)
45
- @io.puts 'Change history:'
45
+ @io.puts "Change history:"
46
46
  max_length = changes.map { |c| c.version.length }.max
47
47
 
48
48
  changes.each do |change|
@@ -59,7 +59,7 @@ module Gistory
59
59
  @io.puts "The last #{max} commits made to the current branch were fetched."
60
60
  end
61
61
 
62
- @io.puts 'To see farther in the past use the -m switch'
62
+ @io.puts "To see farther in the past use the -m switch"
63
63
  end
64
64
  end
65
65
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'date'
3
+ require "date"
4
4
 
5
5
  module Gistory
6
6
  class Commit
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'English'
3
+ require "English"
4
4
 
5
5
  module Gistory
6
6
  class GitRepo
7
7
  def initialize(path:)
8
- raise(Gistory::Error, 'This is not a valid git repository') unless Dir.exist?(File.join(path, '.git'))
9
- raise(Gistory::Error, 'git is not available, please install it') unless git_cli_available?
8
+ raise(Gistory::Error, "This is not a valid git repository") unless Dir.exist?(File.join(path, ".git"))
9
+ raise(Gistory::Error, "git is not available, please install it") unless git_cli_available?
10
10
  end
11
11
 
12
12
  def changes_to_file(filename)
@@ -27,24 +27,24 @@ module Gistory
27
27
  "--follow #{filename}"
28
28
  else
29
29
  # TODO: filter out commits that did not introduce changes to the lock file
30
- '--first-parent'
30
+ "--first-parent"
31
31
  end
32
32
  end
33
33
 
34
34
  def git_cli_available?
35
- system('which git > /dev/null 2>&1')
35
+ system("which git > /dev/null 2>&1")
36
36
  end
37
37
 
38
38
  def to_commits(hashes_and_dates)
39
39
  hashes_and_dates.map do |hash_and_date|
40
- commit_hash, date = hash_and_date.split('|')
40
+ commit_hash, date = hash_and_date.split("|")
41
41
  Commit.new(short_hash: commit_hash, date: date)
42
42
  end
43
43
  end
44
44
 
45
45
  def git(command)
46
46
  out = `git #{command}`
47
- raise 'Git CLI command failed' unless $CHILD_STATUS.success?
47
+ raise "Git CLI command failed" unless $CHILD_STATUS.success?
48
48
  out
49
49
  end
50
50
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler'
3
+ require "bundler"
4
4
 
5
5
  module Gistory
6
6
  class LockfileParser
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gistory
4
- VERSION = '0.2.0'
4
+ VERSION = "0.2.1"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'forwardable'
3
+ require "forwardable"
4
4
 
5
5
  module Gistory
6
6
  class VersionChange
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gistory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Medina