compare_linker_wrapper 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rubocop.yml +17 -0
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +101 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/conventional-changelog +18 -0
- data/bin/setup +7 -0
- data/compare_linker_wrapper.gemspec +41 -0
- data/example/Gemfile.lock +56 -0
- data/exe/compare-linker-wrapper +5 -0
- data/lib/compare_linker_wrapper/cli.rb +70 -0
- data/lib/compare_linker_wrapper/error.rb +3 -0
- data/lib/compare_linker_wrapper/formatter.rb +18 -0
- data/lib/compare_linker_wrapper/linker.rb +79 -0
- data/lib/compare_linker_wrapper/version.rb +3 -0
- data/lib/compare_linker_wrapper.rb +29 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2f5bd7dc04bc0c911f44ed397e5bbb35ec0f91b6
|
4
|
+
data.tar.gz: 469f53e2f39ec94971922239d122988d63708e94
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4004fcbe9bc1c122790a97ccccdfeefde415b8b92d908d98d4b0838a9a48d1721d1f5f69fe8a27e0ddb030165d9974cef53b8b915be05a86d1a72dcbe1a2aa25
|
7
|
+
data.tar.gz: 023b8b6faa6385fc26424cfbfb4e996576a5e5583f56521b07fae5915bb4e9b2204474ae76197cda2abb64ea3e3063b99a50481a3e322871c855d8cb8b3542ff
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
## 0.1.0 (2015-03-16)
|
2
|
+
|
3
|
+
|
4
|
+
#### Bug Fixes
|
5
|
+
|
6
|
+
* **linker:**
|
7
|
+
* fix method ([28d93a93](https://github.com/packsaddle/ruby-compare_linker_wrapper/commit/28d93a937d21f0d7a754d1d2fec2f93ef6876d46))
|
8
|
+
* fix params ([be78378f](https://github.com/packsaddle/ruby-compare_linker_wrapper/commit/be78378f3ab10adb3fb051450acb37f4e20d2c0b))
|
9
|
+
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 sanemat
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
# CompareLinkerWrapper
|
2
|
+
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/compare_linker_wrapper.svg?style=flat)](http://badge.fury.io/rb/compare_linker_wrapper)
|
4
|
+
[![Build Status](http://img.shields.io/travis/packsaddle/ruby-compare_linker_wrapper/master.svg?style=flat)](https://travis-ci.org/packsaddle/ruby-compare_linker_wrapper)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'compare_linker_wrapper'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install compare_linker_wrapper
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
```text
|
25
|
+
compare-linker-wrapper 'example/Gemfile.lock' \
|
26
|
+
--base origin/master \
|
27
|
+
--formatter CompareLinker::Formatter::Markdown
|
28
|
+
|
29
|
+
* [octokit](https://github.com/octokit/octokit.rb): 3.8.0 => 3.8.1
|
30
|
+
|
31
|
+
compare-linker-wrapper 'example/Gemfile.lock' \
|
32
|
+
--base origin/master \
|
33
|
+
--formatter CompareLinker::Formatter::Text
|
34
|
+
|
35
|
+
octokit: https://github.com/octokit/octokit.rb 3.8.0 => 3.8.1
|
36
|
+
```
|
37
|
+
|
38
|
+
## Useful Usage on CI
|
39
|
+
|
40
|
+
```
|
41
|
+
git diff --name-only origin/master \
|
42
|
+
| grep ".*[gG]emfile.lock$" || RETURN_CODE=$?
|
43
|
+
|
44
|
+
case "$RETURN_CODE" in
|
45
|
+
"" ) echo "found" ;;
|
46
|
+
"1" )
|
47
|
+
echo "not found"
|
48
|
+
exit 0 ;;
|
49
|
+
* )
|
50
|
+
echo "Error"
|
51
|
+
exit $RETURN_CODE ;;
|
52
|
+
esac
|
53
|
+
|
54
|
+
git diff --name-only origin/master \
|
55
|
+
| grep ".*[gG]emfile.lock$" \
|
56
|
+
| xargs compare-linker-wrapper --base origin/master \
|
57
|
+
--formatter CompareLinker::Formatter::Markdown \
|
58
|
+
| text-to-checkstyle \
|
59
|
+
| saddler report \
|
60
|
+
--require saddler/reporter/github \
|
61
|
+
--reporter Saddler::Reporter::Github::PullRequestComment
|
62
|
+
```
|
63
|
+
|
64
|
+
## Command
|
65
|
+
|
66
|
+
```text
|
67
|
+
Commands:
|
68
|
+
compare-linker-wrapper compare # compare gemfile.lock
|
69
|
+
compare-linker-wrapper help [COMMAND] # Describe available commands or one specific command
|
70
|
+
compare-linker-wrapper version # Show the CompareLinkerWrapper version
|
71
|
+
|
72
|
+
Usage:
|
73
|
+
compare-linker-wrapper compare
|
74
|
+
|
75
|
+
Options:
|
76
|
+
[--debug], [--no-debug]
|
77
|
+
[--verbose], [--no-verbose]
|
78
|
+
[--base=BASE]
|
79
|
+
# Default: origin/master
|
80
|
+
[--head=HEAD]
|
81
|
+
# Default: HEAD
|
82
|
+
[--file=one two three]
|
83
|
+
[--formatter=FORMATTER]
|
84
|
+
# Default: CompareLinker::Formatter::Text
|
85
|
+
|
86
|
+
compare gemfile.lock
|
87
|
+
```
|
88
|
+
|
89
|
+
## Development
|
90
|
+
|
91
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec compare_linker_wrapper` to use the code located in this directory, ignoring other installed copies of this gem.
|
92
|
+
|
93
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
94
|
+
|
95
|
+
## Contributing
|
96
|
+
|
97
|
+
1. Fork it ( https://github.com/packsaddle/ruby-compare_linker_wrapper/fork )
|
98
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
99
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
100
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
101
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'compare_linker_wrapper'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
var fs = require('fs');
|
4
|
+
var execSync = require('child_process').execSync;
|
5
|
+
var conventionalChangelog = require('conventional-changelog');
|
6
|
+
|
7
|
+
var version = "" + execSync('ruby -e \'require "./lib/compare_linker_wrapper/version"; print CompareLinkerWrapper::VERSION\'');
|
8
|
+
|
9
|
+
conventionalChangelog({
|
10
|
+
repository: 'https://github.com/packsaddle/ruby-compare_linker_wrapper',
|
11
|
+
version: version,
|
12
|
+
file: 'CHANGELOG.md'
|
13
|
+
}, function(err, log) {
|
14
|
+
fs.writeFile('CHANGELOG.md', log, function(err){
|
15
|
+
console.log(err);
|
16
|
+
});
|
17
|
+
console.log('Here is your changelog!', log);
|
18
|
+
});
|
data/bin/setup
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'compare_linker_wrapper/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'compare_linker_wrapper'
|
8
|
+
spec.version = CompareLinkerWrapper::VERSION
|
9
|
+
spec.authors = ['sanemat']
|
10
|
+
spec.email = ['o.gata.ken@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'CompareLinker CLI wrapper.'
|
13
|
+
spec.description = 'CompareLinker CLI wrapper.'
|
14
|
+
spec.homepage = 'https://github.com/packsaddle/ruby-compare_linker_wrapper'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = \
|
18
|
+
`git ls-files -z`
|
19
|
+
.split("\x0")
|
20
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
.reject do |f|
|
22
|
+
[
|
23
|
+
'.travis.yml',
|
24
|
+
'circle.yml',
|
25
|
+
'.tachikoma.yml',
|
26
|
+
'package.json'
|
27
|
+
].include?(f)
|
28
|
+
end
|
29
|
+
spec.bindir = 'exe'
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ['lib']
|
32
|
+
|
33
|
+
spec.add_runtime_dependency 'thor', '>= 0'
|
34
|
+
spec.add_runtime_dependency 'git', '>= 0'
|
35
|
+
spec.add_runtime_dependency 'bundler', '>= 0'
|
36
|
+
spec.add_runtime_dependency 'octokit', '>= 0'
|
37
|
+
spec.add_runtime_dependency 'compare_linker', '>= 0'
|
38
|
+
|
39
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
40
|
+
spec.add_development_dependency 'test-unit', '>= 0'
|
41
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
compare_linker_wrapper (0.1.0)
|
5
|
+
bundler
|
6
|
+
compare_linker
|
7
|
+
git
|
8
|
+
octokit
|
9
|
+
thor
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
addressable (2.3.7)
|
15
|
+
byebug (3.5.1)
|
16
|
+
columnize (~> 0.8)
|
17
|
+
debugger-linecache (~> 1.2)
|
18
|
+
slop (~> 3.6)
|
19
|
+
coderay (1.1.0)
|
20
|
+
columnize (0.9.0)
|
21
|
+
compare_linker (1.1.2)
|
22
|
+
httpclient
|
23
|
+
octokit
|
24
|
+
debugger-linecache (1.2.0)
|
25
|
+
faraday (0.9.1)
|
26
|
+
multipart-post (>= 1.2, < 3)
|
27
|
+
git (1.2.9.1)
|
28
|
+
httpclient (2.6.0.1)
|
29
|
+
method_source (0.8.2)
|
30
|
+
multipart-post (2.0.0)
|
31
|
+
octokit (3.8.2)
|
32
|
+
sawyer (~> 0.6.0, >= 0.5.3)
|
33
|
+
power_assert (0.2.3)
|
34
|
+
pry (0.10.1)
|
35
|
+
coderay (~> 1.1.0)
|
36
|
+
method_source (~> 0.8.1)
|
37
|
+
slop (~> 3.4)
|
38
|
+
rake (10.4.2)
|
39
|
+
sawyer (0.6.0)
|
40
|
+
addressable (~> 2.3.5)
|
41
|
+
faraday (~> 0.8, < 0.10)
|
42
|
+
slop (3.6.0)
|
43
|
+
test-unit (3.0.9)
|
44
|
+
power_assert
|
45
|
+
thor (0.19.1)
|
46
|
+
|
47
|
+
PLATFORMS
|
48
|
+
ruby
|
49
|
+
|
50
|
+
DEPENDENCIES
|
51
|
+
bundler (~> 1.8)
|
52
|
+
byebug
|
53
|
+
compare_linker_wrapper!
|
54
|
+
pry
|
55
|
+
rake (~> 10.0)
|
56
|
+
test-unit
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module CompareLinkerWrapper
|
4
|
+
class CLI < Thor
|
5
|
+
def self.exit_on_failure?
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'version', 'Show the CompareLinkerWrapper version'
|
10
|
+
map %w(-v --version) => :version
|
11
|
+
|
12
|
+
def version
|
13
|
+
puts "CompareLinkerWrapper version #{::CompareLinkerWrapper::VERSION}"
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'compare', 'compare gemfile.lock'
|
17
|
+
option :debug, type: :boolean, default: false
|
18
|
+
option :verbose, type: :boolean, default: false
|
19
|
+
option :base, type: :string, default: 'origin/master'
|
20
|
+
option :head, type: :string, default: 'HEAD'
|
21
|
+
option :file, type: :array
|
22
|
+
option :formatter, type: :string, default: 'CompareLinker::Formatter::Text'
|
23
|
+
|
24
|
+
def compare(*args)
|
25
|
+
setup_logger(options)
|
26
|
+
params = {
|
27
|
+
head: options[:head],
|
28
|
+
base: options[:base],
|
29
|
+
formatter: options[:formatter]
|
30
|
+
}
|
31
|
+
if options[:file]
|
32
|
+
params[:file] = options[:file]
|
33
|
+
else
|
34
|
+
params[:file] = args
|
35
|
+
end
|
36
|
+
puts Linker.new('.').link(params)
|
37
|
+
rescue StandardError => e
|
38
|
+
suggest_messages(options)
|
39
|
+
raise e
|
40
|
+
end
|
41
|
+
default_command :compare
|
42
|
+
|
43
|
+
no_commands do
|
44
|
+
def logger
|
45
|
+
::CompareLinkerWrapper.logger
|
46
|
+
end
|
47
|
+
|
48
|
+
def setup_logger(options)
|
49
|
+
if options[:debug]
|
50
|
+
logger.level = Logger::DEBUG
|
51
|
+
elsif options[:verbose]
|
52
|
+
logger.level = Logger::INFO
|
53
|
+
end
|
54
|
+
logger.debug(options)
|
55
|
+
end
|
56
|
+
|
57
|
+
def suggest_messages(options)
|
58
|
+
logger.error 'Have a question? Please ask us:'
|
59
|
+
logger.error ISSUE_URL
|
60
|
+
logger.error 'options:'
|
61
|
+
logger.error options
|
62
|
+
end
|
63
|
+
|
64
|
+
# http://stackoverflow.com/a/23955971/104080
|
65
|
+
def method_missing(method, *args)
|
66
|
+
self.class.start([self.class.default_command, method.to_s] + args)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module CompareLinkerWrapper
|
2
|
+
module Formatter
|
3
|
+
def self.add_formatter(formatter_type, _output = nil)
|
4
|
+
formatter = custom_formatter_class(formatter_type)
|
5
|
+
formatter.new
|
6
|
+
end
|
7
|
+
|
8
|
+
# Copy from rubocop:
|
9
|
+
# lib/rubocop/formatter/formatter_set.rb
|
10
|
+
def self.custom_formatter_class(specified_class_name)
|
11
|
+
constant_names = specified_class_name.split('::')
|
12
|
+
constant_names.shift if constant_names.first.empty?
|
13
|
+
constant_names.reduce(Object) do |namespace, constant_name|
|
14
|
+
namespace.const_get(constant_name, false)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module CompareLinkerWrapper
|
2
|
+
class Linker
|
3
|
+
attr_accessor :git_path, :git_options
|
4
|
+
def initialize(git_path = '.', git_options = {})
|
5
|
+
@git_path = git_path
|
6
|
+
@git_options = git_options
|
7
|
+
end
|
8
|
+
|
9
|
+
def access_token
|
10
|
+
ENV['OCTOKIT_ACCESS_TOKEN'] || ENV['GITHUB_ACCESS_TOKEN']
|
11
|
+
end
|
12
|
+
|
13
|
+
def client
|
14
|
+
@client ||= ::Octokit::Client.new(access_token: access_token)
|
15
|
+
end
|
16
|
+
|
17
|
+
def git
|
18
|
+
@git ||= Git.open(@git_path, @git_options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def link(params)
|
22
|
+
formatter = add_formatter(params[:formatter])
|
23
|
+
comments = []
|
24
|
+
|
25
|
+
params[:file].each do |gemfile_lock|
|
26
|
+
old_lockfile = parse(git.show(params[:base], gemfile_lock))
|
27
|
+
new_lockfile = parse(git.show(params[:head], gemfile_lock))
|
28
|
+
|
29
|
+
comparator = ::CompareLinker::LockfileComparator.new
|
30
|
+
comparator.compare(old_lockfile, new_lockfile)
|
31
|
+
compare_links = comparator.updated_gems.map do |gem_name, gem_info|
|
32
|
+
if gem_info[:owner].nil?
|
33
|
+
finder = ::CompareLinker::GithubLinkFinder.new(client)
|
34
|
+
finder.find(gem_name)
|
35
|
+
if finder.repo_owner.nil?
|
36
|
+
gem_info[:homepage_uri] = finder.homepage_uri
|
37
|
+
formatter.format(gem_info)
|
38
|
+
else
|
39
|
+
gem_info[:repo_owner] = finder.repo_owner
|
40
|
+
gem_info[:repo_name] = finder.repo_name
|
41
|
+
|
42
|
+
tag_finder = ::CompareLinker::GithubTagFinder.new(client)
|
43
|
+
old_tag = tag_finder.find(finder.repo_full_name, gem_info[:old_ver])
|
44
|
+
new_tag = tag_finder.find(finder.repo_full_name, gem_info[:new_ver])
|
45
|
+
|
46
|
+
if old_tag && new_tag
|
47
|
+
gem_info[:old_tag] = old_tag.name
|
48
|
+
gem_info[:new_tag] = new_tag.name
|
49
|
+
formatter.format(gem_info)
|
50
|
+
else
|
51
|
+
formatter.format(gem_info)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
else
|
55
|
+
formatter.format(gem_info)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
comments << compare_links
|
59
|
+
end
|
60
|
+
comments
|
61
|
+
end
|
62
|
+
|
63
|
+
def add_formatter(formatter_class)
|
64
|
+
formatter = Formatter.add_formatter(formatter_class) if formatter_class
|
65
|
+
fail NoFormatterError unless formatter
|
66
|
+
logger.info('use formatter')
|
67
|
+
logger.info(formatter)
|
68
|
+
formatter
|
69
|
+
end
|
70
|
+
|
71
|
+
def logger
|
72
|
+
::CompareLinkerWrapper.logger
|
73
|
+
end
|
74
|
+
|
75
|
+
def parse(lock_file)
|
76
|
+
Bundler::LockfileParser.new(lock_file)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'logger'
|
2
|
+
require 'git'
|
3
|
+
require 'bundler'
|
4
|
+
require 'octokit'
|
5
|
+
require 'compare_linker'
|
6
|
+
|
7
|
+
require 'compare_linker_wrapper/error'
|
8
|
+
require 'compare_linker_wrapper/formatter'
|
9
|
+
require 'compare_linker_wrapper/linker'
|
10
|
+
require 'compare_linker_wrapper/version'
|
11
|
+
|
12
|
+
module CompareLinkerWrapper
|
13
|
+
ISSUE_URL = 'https://github.com/packsaddle/ruby-compare_linker_wrapper/issues/new'
|
14
|
+
def self.default_logger
|
15
|
+
logger = Logger.new(STDERR)
|
16
|
+
logger.progname = "CompareLinkerWrapper/#{VERSION}"
|
17
|
+
logger.level = Logger::WARN
|
18
|
+
logger
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.logger
|
22
|
+
return @logger if @logger
|
23
|
+
@logger = default_logger
|
24
|
+
end
|
25
|
+
|
26
|
+
class << self
|
27
|
+
attr_writer :logger
|
28
|
+
end
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: compare_linker_wrapper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- sanemat
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: git
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: octokit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: compare_linker
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: test-unit
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: CompareLinker CLI wrapper.
|
112
|
+
email:
|
113
|
+
- o.gata.ken@gmail.com
|
114
|
+
executables:
|
115
|
+
- compare-linker-wrapper
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- CHANGELOG.md
|
122
|
+
- CODE_OF_CONDUCT.md
|
123
|
+
- Gemfile
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/console
|
128
|
+
- bin/conventional-changelog
|
129
|
+
- bin/setup
|
130
|
+
- compare_linker_wrapper.gemspec
|
131
|
+
- example/Gemfile.lock
|
132
|
+
- exe/compare-linker-wrapper
|
133
|
+
- lib/compare_linker_wrapper.rb
|
134
|
+
- lib/compare_linker_wrapper/cli.rb
|
135
|
+
- lib/compare_linker_wrapper/error.rb
|
136
|
+
- lib/compare_linker_wrapper/formatter.rb
|
137
|
+
- lib/compare_linker_wrapper/linker.rb
|
138
|
+
- lib/compare_linker_wrapper/version.rb
|
139
|
+
homepage: https://github.com/packsaddle/ruby-compare_linker_wrapper
|
140
|
+
licenses:
|
141
|
+
- MIT
|
142
|
+
metadata: {}
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options: []
|
145
|
+
require_paths:
|
146
|
+
- lib
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements: []
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 2.4.5
|
160
|
+
signing_key:
|
161
|
+
specification_version: 4
|
162
|
+
summary: CompareLinker CLI wrapper.
|
163
|
+
test_files: []
|