gems_comparator 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ae4eb8f35d7d5b84f16ef2fadd7f6a587ec9e56
4
- data.tar.gz: 3c97d4111242418b934a963e4c2bbfe37af65c6d
3
+ metadata.gz: 9e1ad35cc8264e7009fc523e90035da20e27c109
4
+ data.tar.gz: cacc6b6b2a3d8494d6b5b1feab9a231c56040f39
5
5
  SHA512:
6
- metadata.gz: dbab2f48016b0cbdd1ade9922ed21cd3a40b9ff3e8aadf0bd2a87696e88b1aaf7cb3f73643bc46b7b2684332ad9d6a7f1dd0fd86df6c333da9075c10b4c4304a
7
- data.tar.gz: 31b87e416dfcc7ed597479bad0800c0c333352b4f3dd1da1d39ea9ae103e1edce7575a214ae030103b60fce951d2dd164c0250c701c085398f0127d393396035
6
+ metadata.gz: ac653a211c7e4a10aebed8cf4ae7f2326eecbcc4ad4a4e03ec8a6b8e7f327a817422388c28888558fff0d8b8be8b745f7fe2b21517ad44ffd49147abdbbb7662
7
+ data.tar.gz: 2b2af7ced60050c30b98152d8f92635bc15fc2ba299d79af474ce3e3543c39bc3a06f679d624e50e953b4cea247a5a4f1cc0ab9510e7dc02e25c9fe23ef80716
data/bin/search_urls ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'gems_comparator'
6
+
7
+ def github_urls
8
+ @github_urls ||= YAML.load_file(GemsComparator::GemInfo::GITHUB_URLS_PATH)
9
+ end
10
+
11
+ def github_url?(spec)
12
+ GemsComparator::GithubRepository.repo?(spec.homepage) ||
13
+ github_urls.key?(spec.name)
14
+ end
15
+
16
+ spec_paths = Dir["#{Bundler.specs_path}/**/*.gemspec"]
17
+ specs = spec_paths.map { |path| Gem::Specification.load(path) }
18
+ specs.reject { |spec| github_url?(spec) }.each do |spec|
19
+ puts "#{spec.name}: #{spec.homepage}"
20
+ end
data/data/github_urls.yml CHANGED
@@ -1,18 +1,57 @@
1
1
  action_args: asakusarb/action_args
2
+ actioncable: rails/rails
3
+ actionmailer: rails/rails
4
+ actionpack: rails/rails
5
+ actionview: rails/rails
6
+ activejob: rails/rails
7
+ activemodel: rails/rails
8
+ activerecord: rails/rails
9
+ activesupport: rails/rails
2
10
  airbrake: airbrake/airbrake
11
+ ast: whitequark/ast
12
+ builder: jimweirich/builder
13
+ bundler: bundler/bundler
3
14
  capistrano: capistrano/capistrano
4
15
  coderay: rubychan/coderay
5
16
  coffee-script-source: jessedoyle/coffee-script-source
6
17
  concurrent-ruby: ruby-concurrency/concurrent-ruby
18
+ coveralls: lemurheavy/coveralls-ruby
19
+ diff-lcs: halostatue/diff-lcs
20
+ docile: ms-ati/docile
21
+ erubis: kwatch/erubis
7
22
  eventmachine: eventmachine/eventmachine
23
+ globalid: rails/globalid
24
+ guard: guard/guard
25
+ guard-compat: guard/guard-compat
26
+ hirb: cldwalker/hirb
27
+ hirb-unicode: miaout17/hirb-unicode
28
+ io-console: nobu/io-console
29
+ json: flori/json
8
30
  logging: TwP/logging
31
+ method_source: banister/method_source
32
+ mime-types: mime-types/ruby-mime-types
33
+ net-http-persistent: drbrain/net-http-persistent
34
+ net-http-pipeline: drbrain/net-http-pipeline
9
35
  nokogiri: sparklemotion/nokogiri
36
+ openssl: ruby/openssl
37
+ pry: pry/pry
10
38
  puma: puma/puma
39
+ rack: rack/rack
11
40
  rack-mini-profiler: MiniProfiler/rack-mini-profiler
41
+ rails: rails/rails
12
42
  rails_best_practices: railsbp/rails_best_practices
43
+ railties: rails/rails
44
+ rdoc: rdoc/rdoc
45
+ rspec: rspec/rspec
13
46
  sass: sass/sass
47
+ serverspec: mizzy/serverspec
48
+ shellany: guard/shellany
14
49
  sidekiq: mperham/sidekiq
50
+ term-ansicolor: flori/term-ansicolor
51
+ test-unit: test-unit/test-unit
15
52
  thin: macournoyer/thin
16
53
  thor: erikhuda/thor
54
+ tzinfo: tzinfo/tzinfo
17
55
  unicorn: defunkt/unicorn
18
56
  uniform_notifier: flyerhzm/uniform_notifier
57
+ yard: lsegal/yard
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'rubocop', '0.47.1'
29
29
  spec.add_development_dependency 'webmock', '~> 2.3.2'
30
+ spec.add_development_dependency 'parallel', '~> 1.10.0'
30
31
  end
@@ -1,6 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
  module GemsComparator
3
3
  class Comparator
4
+ def self.convert(gems)
5
+ if defined?(Parallel)
6
+ Parallel.map(gems, &:to_h)
7
+ else
8
+ gems.map(&:to_h)
9
+ end
10
+ end
11
+
4
12
  def initialize(before_lockfile, after_lockfile)
5
13
  @before_lockfile = before_lockfile
6
14
  @after_lockfile = after_lockfile
@@ -8,7 +16,7 @@ module GemsComparator
8
16
 
9
17
  def compare
10
18
  gems = addition_gems + change_gems + deletion_gems
11
- gems.sort_by(&:name).map(&:to_h)
19
+ Comparator.convert(gems.sort_by(&:name))
12
20
  end
13
21
 
14
22
  private
@@ -4,7 +4,7 @@ module GemsComparator
4
4
  attr_accessor :client
5
5
 
6
6
  def initialize
7
- @client = Octokit::Client.new
7
+ @client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
8
8
  end
9
9
  end
10
10
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GemsComparator
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  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.1.1
4
+ version: 0.2.0
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-19 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  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
97
111
  description: A comparator for Gemfile.lock that generate the GitHub's compare view
98
112
  urls
99
113
  email:
@@ -112,6 +126,7 @@ files:
112
126
  - README.md
113
127
  - Rakefile
114
128
  - bin/console
129
+ - bin/search_urls
115
130
  - bin/setup
116
131
  - data/github_urls.yml
117
132
  - gems_comparator.gemspec