gems_comparator 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
- SHA1:
3
- metadata.gz: 9e1ad35cc8264e7009fc523e90035da20e27c109
4
- data.tar.gz: cacc6b6b2a3d8494d6b5b1feab9a231c56040f39
2
+ SHA256:
3
+ metadata.gz: 8efacdcbe2ff9dca410cb592060fef4889ad8886f94d74601c57eb144ef807b5
4
+ data.tar.gz: da528c27afb29a7f6ae30fc8a6ce10ef3393e7b595e549c6fe3c11ffc60fcf48
5
5
  SHA512:
6
- metadata.gz: ac653a211c7e4a10aebed8cf4ae7f2326eecbcc4ad4a4e03ec8a6b8e7f327a817422388c28888558fff0d8b8be8b745f7fe2b21517ad44ffd49147abdbbb7662
7
- data.tar.gz: 2b2af7ced60050c30b98152d8f92635bc15fc2ba299d79af474ce3e3543c39bc3a06f679d624e50e953b4cea247a5a4f1cc0ab9510e7dc02e25c9fe23ef80716
6
+ metadata.gz: ebd3dc71d9979700c2482a83b34ea002e6e3ac61645ac1801092ac72c3d2fdf1ef8281768e96099fd747e214557586dd32bb05cc6925c65ea5a206fb814d2c4e
7
+ data.tar.gz: ab1ed0f251464dc24a6ddfa707ea2fa96da8ebba12fe37a0059a77a08716fc69090a590b73996ff9301931d5d49a027aa36c35462aa676862d279efffe4b30f7
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.5
3
3
  DisplayCopNames: true
4
4
  DisplayStyleGuide: true
5
5
  ExtraDetails: true
data/.travis.yml CHANGED
@@ -1,10 +1,21 @@
1
1
  sudo: false
2
2
  language: ruby
3
+
3
4
  rvm:
4
- - 2.3.3
5
- - 2.4.0
5
+ - 2.3.7
6
+ - 2.4.4
7
+ - 2.5.1
8
+ - ruby-head
9
+
6
10
  before_install:
7
11
  - gem update --system
8
12
  - gem install bundler
13
+
14
+ cache: bundler
15
+
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: ruby-head
19
+
9
20
  notifications:
10
21
  email: false
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source 'https://rubygems.org'
3
4
 
4
5
  # Specify your gem's dependencies in gems_comparator.gemspec
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Build Status](https://travis-ci.org/sinsoku/gems_comparator.svg?branch=master)](https://travis-ci.org/sinsoku/gems_comparator)
5
5
  [![codecov](https://codecov.io/gh/sinsoku/gems_comparator/branch/master/graph/badge.svg)](https://codecov.io/gh/sinsoku/gems_comparator)
6
6
 
7
- GemsComparator generates GitHub's compare view urls from `Gemfile.lock`
7
+ GemsComparator generates GitHub's compare view urls from the difference between two `Gemfile.lock`.
8
8
 
9
9
  ## Installation
10
10
 
@@ -31,9 +31,37 @@ before_lockfile = File.read('before_Gemfile.lock')
31
31
  after_lockfile = File.read('after_Gemfile.lock')
32
32
 
33
33
  GemsComparator.compare(before_lockfile, after_lockfile)
34
- #=> [{:name=>"rake", :before=>"11.3.0", :after=>"12.0.0", :homepage=>"https://github.com/ruby/rake", :github_url=>"https://github.com/ruby/rake", :compare_url=>"https://github.com/ruby/rake/compare/v11.3.0...v12.0.0"}, ...]
35
34
  ```
36
35
 
36
+ Here's an example that the `compare` method return:
37
+
38
+ ```rb
39
+ [{
40
+ :name=>"rake",
41
+ :before=>"11.3.0",
42
+ :after=>"12.0.0",
43
+ :homepage=>"https://github.com/ruby/rake",
44
+ :github_url=>"https://github.com/ruby/rake",
45
+ :compare_url=>"https://github.com/ruby/rake/compare/v11.3.0...v12.0.0"
46
+ }, {
47
+ ...
48
+ }]
49
+ ```
50
+
51
+ ## Configuring
52
+
53
+ To use an access token, set your token to `ENV['GITHUB_TOKEN']`. Or you can also set a token through the `configure` method.
54
+
55
+ ```rb
56
+ GemsComparator.configure do |config|
57
+ config.client = Octokit::Client.new(access_token: '<your 40 char token>')
58
+ end
59
+ ```
60
+
61
+ ## Parallel Support
62
+
63
+ If you are using a [parallel](https://github.com/grosser/parallel) gem, GemsComparator automatically works as parallel processing.
64
+
37
65
  ## Development
38
66
 
39
67
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'bundler/gem_tasks'
3
4
  require 'rspec/core/rake_task'
4
5
 
@@ -7,4 +8,4 @@ RSpec::Core::RakeTask.new(:spec)
7
8
  require 'rubocop/rake_task'
8
9
  RuboCop::RakeTask.new
9
10
 
10
- task default: [:rubocop, :spec]
11
+ task default: %i[rubocop spec]
data/data/github_urls.yml CHANGED
@@ -20,11 +20,14 @@ diff-lcs: halostatue/diff-lcs
20
20
  docile: ms-ati/docile
21
21
  erubis: kwatch/erubis
22
22
  eventmachine: eventmachine/eventmachine
23
+ geocoder: alexreisner/geocoder
23
24
  globalid: rails/globalid
24
25
  guard: guard/guard
25
26
  guard-compat: guard/guard-compat
27
+ haml: haml/haml
26
28
  hirb: cldwalker/hirb
27
29
  hirb-unicode: miaout17/hirb-unicode
30
+ i18n-js: fnando/i18n-js
28
31
  io-console: nobu/io-console
29
32
  json: flori/json
30
33
  logging: TwP/logging
@@ -38,13 +41,17 @@ pry: pry/pry
38
41
  puma: puma/puma
39
42
  rack: rack/rack
40
43
  rack-mini-profiler: MiniProfiler/rack-mini-profiler
44
+ rack-proxy: ncr/rack-proxy
41
45
  rails: rails/rails
42
46
  rails_best_practices: railsbp/rails_best_practices
43
47
  railties: rails/rails
48
+ rb-fsevent: thibaudgg/rb-fsevent
44
49
  rdoc: rdoc/rdoc
45
50
  rspec: rspec/rspec
51
+ ruby_parser: seattlerb/ruby_parser
46
52
  sass: sass/sass
47
53
  serverspec: mizzy/serverspec
54
+ sexp_processor: seattlerb/sexp_processor
48
55
  shellany: guard/shellany
49
56
  sidekiq: mperham/sidekiq
50
57
  term-ansicolor: flori/term-ansicolor
@@ -1,6 +1,6 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
- lib = File.expand_path('../lib', __FILE__)
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'gems_comparator/version'
6
6
 
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'octokit'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.13'
26
+ spec.add_development_dependency 'parallel', '~> 1.10.0'
26
27
  spec.add_development_dependency 'rake', '~> 10.0'
27
28
  spec.add_development_dependency 'rspec', '~> 3.0'
28
- spec.add_development_dependency 'rubocop', '0.47.1'
29
+ spec.add_development_dependency 'rubocop', '0.56.0'
29
30
  spec.add_development_dependency 'webmock', '~> 2.3.2'
30
- spec.add_development_dependency 'parallel', '~> 1.10.0'
31
31
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'bundler'
3
4
  require 'octokit'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module GemsComparator
3
4
  class Comparator
4
5
  def self.convert(gems)
@@ -40,8 +41,8 @@ module GemsComparator
40
41
  end
41
42
 
42
43
  def change_gems
43
- names = before_gems.keys.select do |name|
44
- before_gems[name] != after_gems[name]
44
+ names = before_gems.keys.reject do |name|
45
+ before_gems[name] == after_gems[name]
45
46
  end
46
47
  names.map { |name| new_geminfo(name) }
47
48
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module GemsComparator
3
4
  class Config
4
5
  attr_accessor :client
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'yaml'
3
4
 
4
5
  module GemsComparator
@@ -18,7 +19,7 @@ module GemsComparator
18
19
 
19
20
  repo = GithubRepository.new(github_url)
20
21
  repo.compare(before, after)
21
- rescue => e
22
+ rescue StandardError => e
22
23
  e.inspect
23
24
  end
24
25
 
@@ -35,7 +36,7 @@ module GemsComparator
35
36
  end
36
37
 
37
38
  def to_h
38
- attr_names = %i(name before after homepage github_url compare_url)
39
+ attr_names = %i[name before after homepage github_url compare_url]
39
40
  attr_names.map { |m| [m, send(m)] }.to_h
40
41
  end
41
42
 
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module GemsComparator
3
4
  class GithubRepository
4
5
  def self.repo?(url)
5
6
  Octokit::Repository.from_url(url)
6
7
  true
7
- rescue
8
+ rescue StandardError
8
9
  false
9
10
  end
10
11
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module GemsComparator
3
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gems_comparator
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
  - sinsoku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-20 00:00:00.000000000 Z
11
+ date: 2018-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.13'
41
+ - !ruby/object:Gem::Dependency
42
+ name: parallel
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.10.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.10.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +86,14 @@ dependencies:
72
86
  requirements:
73
87
  - - '='
74
88
  - !ruby/object:Gem::Version
75
- version: 0.47.1
89
+ version: 0.56.0
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - '='
81
95
  - !ruby/object:Gem::Version
82
- version: 0.47.1
96
+ version: 0.56.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: webmock
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -94,20 +108,6 @@ dependencies:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
110
  version: 2.3.2
97
- - !ruby/object:Gem::Dependency
98
- name: parallel
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 1.10.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 1.10.0
111
111
  description: A comparator for Gemfile.lock that generate the GitHub's compare view
112
112
  urls
113
113
  email:
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.6.8
159
+ rubygems_version: 2.7.6
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: A comparator for Gemfile.lock that generate the GitHub's compare view urls