lock_diff 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -3
- data/README.md +1 -0
- data/Rakefile +1 -1
- data/exe/lock_diff_for_tachikoma +0 -0
- data/lib/lock_diff/cli/option_parser.rb +1 -1
- data/lib/lock_diff/diff_info.rb +3 -3
- data/lib/lock_diff/formatter/github_markdown.rb +0 -1
- data/lib/lock_diff/gem/lockfile_comparator.rb +2 -2
- data/lib/lock_diff/gem/package.rb +1 -1
- data/lib/lock_diff/gem/ruby_gem.rb +1 -5
- data/lib/lock_diff/gem/spec.rb +10 -5
- data/lib/lock_diff/github/repository_name_detector.rb +3 -3
- data/lib/lock_diff/github/tag_finder.rb +1 -1
- data/lib/lock_diff/github/url_detector.rb +1 -1
- data/lib/lock_diff/lockfile_comparator.rb +1 -1
- data/lib/lock_diff/version.rb +1 -1
- data/lock_diff.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be2e92ea138be9c068f1c4a90a4a62d0684643de
|
4
|
+
data.tar.gz: f1717a0ec899c42cbc9d33697e065c9ee63d23a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b91f6b0a99c4382817b63de18d26a446ba644204b6994b5df522336f12581197bf3c5ed47f3941624845c62da56d67b4bc69e7627ba8dd89025a705cbe5de3e2
|
7
|
+
data.tar.gz: 58b34be40b17940180f05e3930255a00047c32830622581f51885f2a1788380ca7e8acc4c287bbbaf78f822b83719cd3de15c6cb412b73d208c448dafb31b4f6
|
data/.travis.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
4
|
-
|
3
|
+
- 2.3.4
|
4
|
+
- 2.4.1
|
5
5
|
script:
|
6
|
-
|
6
|
+
- bundle exec rspec
|
7
|
+
notifications:
|
8
|
+
slack:
|
9
|
+
secure: DKSdr5uEtNXGpAARGV+Q694eNv9IGi30RjSIjk8lRZrmLxE0WJbk/17FkmjgVF2w1onO/knFWgCiPBoIncihy4hh6nfAJZDaRI8AwXqYGGi10KeUBu4309r/7SL60KnFUFsQ9o47tar09TY6HS55IesNjN2/mKIEJlpw2c7McPz58rIzlFizTW5OPShsfWQnuLAz9iUYjknZfrntirav+mwkqVKqDZoMM7MRzedk1KjlkRbun/EVrgMEYPqsbpmhfYV0DZkcymorhH6d/FBsrWeqB7QMT6KwROMBHDZGeGzYgaN3KgjZV35gw6pK2VlsETm7E/Fk9Imrjalq87Q28aqX5nq/MR6Llo9yfE4J7PkGOTxcvZlXqp/W+2xT/8Ne6Dy29gb/7TeJY9K4nmkbkrmkanKBBmvIjbhwT46BOPjn1Sz4kbceoZNgihI2hMMPypH61+U6v0eUcGLuxRyDaUsyrgRnBEDHFZHMpfZ1eE7uXnCO9IvqGm5Tn4goP0s67H98CFhP+j3cIM2HKdns6ZyGsAHVakw7bnB90mKc9bIaaPSKEyZZD4MpkJxnMxR453OlSwJZIXesIkbBJMZA4wdOAsPQSBaSCY2w566LsUs4izRVLpdeILa/NOaxb+l1OvmejGyiihUjSUfH7fiIhoD5E0+SgOsDIdd0TV17rb4=
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/lock_diff.svg)](https://badge.fury.io/rb/lock_diff)
|
4
4
|
[![GitHub tag](https://img.shields.io/github/tag/vividmuimui/lock_diff.svg)](https://github.com/vividmuimui/lock_diff/tags)
|
5
5
|
[![Build Status](https://travis-ci.org/vividmuimui/lock_diff.svg?branch=master)](https://travis-ci.org/vividmuimui/lock_diff)
|
6
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d05b439bc5064e30ad84ecfa8e57b448)](https://www.codacy.com/app/vividmuimui/lock_diff?utm_source=github.com&utm_medium=referral&utm_content=vividmuimui/lock_diff&utm_campaign=badger)
|
6
7
|
[![Dependency Status](https://gemnasium.com/badges/github.com/vividmuimui/lock_diff.svg)](https://gemnasium.com/github.com/vividmuimui/lock_diff)
|
7
8
|
[![Code Climate](https://codeclimate.com/github/vividmuimui/lock_diff/badges/gpa.svg)](https://codeclimate.com/github/vividmuimui/lock_diff)
|
8
9
|
[![Issue Count](https://codeclimate.com/github/vividmuimui/lock_diff/badges/issue_count.svg)](https://codeclimate.com/github/vividmuimui/lock_diff)
|
data/Rakefile
CHANGED
data/exe/lock_diff_for_tachikoma
CHANGED
File without changes
|
data/lib/lock_diff/diff_info.rb
CHANGED
@@ -23,7 +23,7 @@ module LockDiff
|
|
23
23
|
def status
|
24
24
|
case
|
25
25
|
when @old_package.version && @new_package.version
|
26
|
-
if @old_package.version
|
26
|
+
if @old_package.version <= @new_package.version
|
27
27
|
UPGRADE
|
28
28
|
else
|
29
29
|
DOWNGRADE
|
@@ -83,7 +83,7 @@ module LockDiff
|
|
83
83
|
return unless package.repository_url
|
84
84
|
old_ref = @old_package.ref
|
85
85
|
new_ref = @new_package.ref
|
86
|
-
|
86
|
+
compare_path =
|
87
87
|
case status
|
88
88
|
when UPGRADE
|
89
89
|
"compare/#{old_ref}...#{new_ref}" if old_ref && new_ref
|
@@ -95,7 +95,7 @@ module LockDiff
|
|
95
95
|
"commits/#{new_ref}" if new_ref
|
96
96
|
end
|
97
97
|
|
98
|
-
"#{package.repository_url}/#{
|
98
|
+
"#{package.repository_url}/#{compare_path}" if compare_path
|
99
99
|
end
|
100
100
|
|
101
101
|
def commits_url_text
|
@@ -7,8 +7,8 @@ module LockDiff
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call
|
10
|
-
old_specs_by_name = Spec.
|
11
|
-
new_specs_by_name = Spec.
|
10
|
+
old_specs_by_name = Spec.parse(@old_lockfile).map { |spec| [spec.name, spec] }.to_h
|
11
|
+
new_specs_by_name = Spec.parse(@new_lockfile).map { |spec| [spec.name, spec] }.to_h
|
12
12
|
names = (old_specs_by_name.keys + new_specs_by_name.keys).uniq
|
13
13
|
|
14
14
|
names.map { |name|
|
@@ -13,11 +13,7 @@ module LockDiff
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def repository_url
|
16
|
-
@repository_url ||= Github::UrlDetector.new([source_code_url,
|
17
|
-
end
|
18
|
-
|
19
|
-
def homepage_url
|
20
|
-
@ruby_gem.homepage_uri
|
16
|
+
@repository_url ||= Github::UrlDetector.new([source_code_url, @ruby_gem.homepage_uri]).call
|
21
17
|
end
|
22
18
|
|
23
19
|
def url
|
data/lib/lock_diff/gem/spec.rb
CHANGED
@@ -4,8 +4,8 @@ module LockDiff
|
|
4
4
|
module Spec
|
5
5
|
class UnSupportSource < StandardError; end
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
class << self
|
8
|
+
def new(lazy_specification)
|
9
9
|
case lazy_specification.source
|
10
10
|
when Bundler::Source::Rubygems
|
11
11
|
RubyGemSpec.new(lazy_specification)
|
@@ -17,6 +17,13 @@ module LockDiff
|
|
17
17
|
raise UnSupportSource, "#{lazy_specification.source.class} source by #{lazy_specification.name} is not supported"
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
def parse(lockfile)
|
22
|
+
Bundler::LockfileParser.new(lockfile).specs.map do |lazy_specification|
|
23
|
+
new(lazy_specification)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
20
27
|
end
|
21
28
|
|
22
29
|
class Base
|
@@ -37,12 +44,11 @@ module LockDiff
|
|
37
44
|
end
|
38
45
|
|
39
46
|
def repository_url; end
|
40
|
-
def homepage_url; end
|
41
47
|
def ruby_gem_url; end
|
42
48
|
end
|
43
49
|
|
44
50
|
class RubyGemSpec < Base
|
45
|
-
def_delegators :ruby_gem, :repository_url
|
51
|
+
def_delegators :ruby_gem, :repository_url
|
46
52
|
def_delegator :ruby_gem, :url, :ruby_gem_url
|
47
53
|
|
48
54
|
private
|
@@ -77,7 +83,6 @@ module LockDiff
|
|
77
83
|
end
|
78
84
|
|
79
85
|
def repository_url; end
|
80
|
-
def homepage_url; end
|
81
86
|
def ruby_gem_url; end
|
82
87
|
|
83
88
|
def to_package
|
@@ -40,7 +40,7 @@ module LockDiff
|
|
40
40
|
def find(repo_name, options = {})
|
41
41
|
key = "#{repo_name}-#{options[:page]}"
|
42
42
|
ruby_gem = repository[key]
|
43
|
-
return ruby_gem if repository.
|
43
|
+
return ruby_gem if repository.key?(key)
|
44
44
|
repository[key] = fetch(repo_name, options)
|
45
45
|
end
|
46
46
|
|
@@ -3,7 +3,7 @@ module LockDiff
|
|
3
3
|
class << self
|
4
4
|
def compare_by(pull_request)
|
5
5
|
file_path = pull_request.find_content_path(lockfile_name)
|
6
|
-
raise NotChangedLockfile
|
6
|
+
raise NotChangedLockfile if file_path.nil?
|
7
7
|
|
8
8
|
LockDiff.config.strategy.lockfile_comparator.new(
|
9
9
|
old_lockfile: pull_request.base_file(file_path),
|
data/lib/lock_diff/version.rb
CHANGED
data/lock_diff.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lock_diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vividmuimui
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: codacy-coverage
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: This gem detects changes to your package manager (e.g. Gemfile) and generates
|
112
126
|
a Markdown-formatted diff.
|
113
127
|
email:
|