gem-dependent 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 76d1c8a7b57dff62734b101590114e3688b84c31
4
+ data.tar.gz: f323379453098a3b9bce4111f54838c6cd077450
5
+ SHA512:
6
+ metadata.gz: 6f4c1516e80a38f78602b832af2b3670c4fda33b0f2435c2b004e329eec74fbe52b95326a3d986ffecc124d407998c3d496ac2990def4441daf0dd9a0edf5d7f
7
+ data.tar.gz: d98c1d0668e04ebc308004898f1c164fe09deb005bc938135b11ffce1074b014285c376187acede225ded1c4700d39210bae103e75820f456b90dd7c42ec9e1b
checksums.yaml.gz.sig ADDED
Binary file
@@ -1,5 +1,5 @@
1
1
  module Gem
2
2
  class Dependent
3
- VERSION = Version = '0.2.2'
3
+ VERSION = Version = '0.2.3'
4
4
  end
5
5
  end
@@ -32,7 +32,11 @@ module Gem
32
32
  parallel = (options[:parallel] || 15)
33
33
  Gem::Dependent::Parallel.map(specs_and_sources, :in_processes => parallel) do |spec, source|
34
34
  yield if block_given?
35
- name, version = spec[0,2]
35
+ name, version = if RUBY_VERSION > "2"
36
+ [spec.name, spec.version]
37
+ else
38
+ spec[0,2]
39
+ end
36
40
  dependencies = fetch_dependencies(spec, source, options)
37
41
  [name, version, dependencies]
38
42
  end
@@ -41,7 +45,11 @@ module Gem
41
45
  def self.fetch_dependencies(spec, source, options={})
42
46
  begin
43
47
  fetcher = Gem::SpecFetcher.fetcher
44
- fetcher.fetch_spec(spec, URI.parse(source)).dependencies
48
+ if RUBY_VERSION > "2"
49
+ source.fetch_spec(spec).dependencies
50
+ else
51
+ fetcher.fetch_spec(spec, URI.parse(source)).dependencies
52
+ end
45
53
  rescue Object => e
46
54
  $stderr.puts e unless options[:all_versions]
47
55
  []
@@ -67,12 +75,16 @@ module Gem
67
75
  matching_platform = false
68
76
  prerelease = false
69
77
  matcher = without_deprecation_warning { Gem::Dependency.new(//, Gem::Requirement.default) } # any name, any version
70
- specs_and_sources = fetcher.find_matching matcher, all, matching_platform, prerelease
78
+ specs_and_sources = if RUBY_VERSION > "2"
79
+ fetcher.search_for_dependency(matcher, matching_platform).first
80
+ else
81
+ fetcher.find_matching matcher, all, matching_platform, prerelease
82
+ end
71
83
 
72
84
  if options[:all_versions]
73
85
  specs_and_sources
74
86
  else
75
- uniq_by(specs_and_sources){|a| a.first.first }
87
+ uniq_by(specs_and_sources){|a| RUBY_VERSION > "2" ? a.first.name : a.first.first }
76
88
  end
77
89
  end
78
90
 
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,77 +1,69 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gem-dependent
3
- version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.3
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Michael Grosser
14
8
  autorequire:
15
9
  bindir: bin
16
- cert_chain: []
17
-
18
- date: 2012-07-15 00:00:00 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MRAwDgYDVQQDDAdtaWNo
14
+ YWVsMRcwFQYKCZImiZPyLGQBGRYHZ3Jvc3NlcjESMBAGCgmSJomT8ixkARkWAml0
15
+ MB4XDTEzMDIwMzE4MTMxMVoXDTE0MDIwMzE4MTMxMVowPzEQMA4GA1UEAwwHbWlj
16
+ aGFlbDEXMBUGCgmSJomT8ixkARkWB2dyb3NzZXIxEjAQBgoJkiaJk/IsZAEZFgJp
17
+ dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMorXo/hgbUq97+kII9H
18
+ MsQcLdC/7wQ1ZP2OshVHPkeP0qH8MBHGg6eYisOX2ubNagF9YTCZWnhrdKrwpLOO
19
+ cPLaZbjUjljJ3cQR3B8Yn1veV5IhG86QseTBjymzJWsLpqJ1UZGpfB9tXcsFtuxO
20
+ 6vHvcIHdzvc/OUkICttLbH+1qb6rsHUceqh+JrH4GrsJ5H4hAfIdyS2XMK7YRKbh
21
+ h+IBu6dFWJJByzFsYmV1PDXln3UBmgAt65cmCu4qPfThioCGDzbSJrGDGLmw/pFX
22
+ FPpVCm1zgYSb1v6Qnf3cgXa2f2wYGm17+zAVyIDpwryFru9yF/jJxE38z/DRsd9R
23
+ /88CAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUsiNnXHtKeMYYcr4yJVmQ
24
+ WONL+IwwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQAlyN7kKo/NQCQ0
25
+ AOzZLZ3WAePvStkCFIJ53tsv5Kyo4pMAllv+BgPzzBt7qi605mFSL6zBd9uLou+W
26
+ Co3s48p1dy7CjjAfVQdmVNHF3MwXtfC2OEyvSQPi4xKR8iba8wa3xp9LVo1PuLpw
27
+ /6DsrChWw74HfsJN6qJOK684hJeT8lBYAUfiC3wD0owoPSg+XtyAAddisR+KV5Y1
28
+ NmVHuLtQcNTZy+gRht3ahJRMuC6QyLmkTsf+6MaenwAMkAgHdswGsJztOnNnBa3F
29
+ y0kCSWmK6D+x/SbfS6r7Ke07MRqziJdB9GuE1+0cIRuFh8EQ+LN6HXCKM5pon/GU
30
+ ycwMXfl0
31
+ -----END CERTIFICATE-----
32
+ date: 2013-09-07 00:00:00.000000000 Z
19
33
  dependencies: []
20
-
21
34
  description:
22
35
  email: michael@grosser.it
23
36
  executables: []
24
-
25
37
  extensions: []
26
-
27
38
  extra_rdoc_files: []
28
-
29
- files:
30
- - Gemfile
31
- - Gemfile.lock
32
- - Rakefile
33
- - Readme.md
34
- - VERSION
35
- - gem-dependent.gemspec
39
+ files:
36
40
  - lib/rubygems/commands/dependent_command.rb
37
41
  - lib/rubygems/dependent.rb
38
42
  - lib/rubygems/dependent/parallel.rb
39
43
  - lib/rubygems/dependent/version.rb
40
44
  - lib/rubygems_plugin.rb
41
- - spec/dependent_spec.rb
42
- - spec/fixtures/gemcutter_specs.yml
43
- homepage: http://github.com/grosser/gem-dependent
44
- licenses:
45
+ homepage: https://github.com/grosser/gem-dependent
46
+ licenses:
45
47
  - MIT
48
+ metadata: {}
46
49
  post_install_message:
47
50
  rdoc_options: []
48
-
49
- require_paths:
51
+ require_paths:
50
52
  - lib
51
- required_ruby_version: !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- required_rubygems_version: !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- hash: 3
66
- segments:
67
- - 0
68
- version: "0"
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
69
63
  requirements: []
70
-
71
64
  rubyforge_project:
72
- rubygems_version: 1.8.24
65
+ rubygems_version: 2.0.6
73
66
  signing_key:
74
- specification_version: 3
67
+ specification_version: 4
75
68
  summary: See which gems depend on your gems
76
69
  test_files: []
77
-
metadata.gz.sig ADDED
@@ -0,0 +1 @@
1
+ UM+�O��rQ�Q�Q�뉵�i$�9��io߂b� ���fO��9U���%�����-�g�(n�%�� AV�5�$�_~L�!��" �Q\�d(6W�ϰ�J��i�΅?�� ��t�f����՟��<�=4CI�ډn�mď� #Wg�6R c)8=�KQ �����1�Q���ǐS
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- source :rubygems
2
- gemspec
3
-
4
- gem 'rake'
5
- gem 'rspec', '~>2'
data/Gemfile.lock DELETED
@@ -1,28 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- gem-dependent (0.2.2)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- diff-lcs (1.1.2)
10
- rake (0.8.7)
11
- rspec (2.0.1)
12
- rspec-core (~> 2.0.1)
13
- rspec-expectations (~> 2.0.1)
14
- rspec-mocks (~> 2.0.1)
15
- rspec-core (2.0.1)
16
- rspec-expectations (2.0.1)
17
- diff-lcs (>= 1.1.2)
18
- rspec-mocks (2.0.1)
19
- rspec-core (~> 2.0.1)
20
- rspec-expectations (~> 2.0.1)
21
-
22
- PLATFORMS
23
- ruby
24
-
25
- DEPENDENCIES
26
- gem-dependent!
27
- rake
28
- rspec (~> 2)
data/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- task :default do
4
- sh "rspec spec/"
5
- end
6
-
7
- # extracted from https://github.com/grosser/project_template
8
- rule /^version:bump:.*/ do |t|
9
- sh "git status | grep 'nothing to commit'" # ensure we are not dirty
10
- index = ['major', 'minor','patch'].index(t.name.split(':').last)
11
- file = 'lib/rubygems/dependent/version.rb'
12
-
13
- version_file = File.read(file)
14
- old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
15
- version_parts[index] = version_parts[index].to_i + 1
16
- version_parts[2] = 0 if index < 2 # remove patch for minor
17
- version_parts[1] = 0 if index < 1 # remove minor for major
18
- new_version = version_parts * '.'
19
- File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
20
-
21
- sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
22
- end
data/Readme.md DELETED
@@ -1,53 +0,0 @@
1
- Install
2
- =======
3
- sudo gem install gem-dependent
4
-
5
- Usage
6
- =====
7
- The first run can take looooong, but after the caches are filled, its pretty fast. Checking all versions will take significantly longer.
8
-
9
- gem dependent my_gem
10
-
11
- --source URL Query this source (e.g. http://rubygems.org)
12
- --no-progress Do not show progress
13
- --fetch-limit N Fetch specs for max N gems (for fast debugging)
14
- --parallel N Make N requests in parallel
15
- --all-versions Check against all versions of gems
16
-
17
-
18
- Output
19
- ======
20
-
21
- gem dependent my_gem --source http://rubygems.org
22
- other_gem >= 1.2.1
23
- even_more = 0.0.1
24
-
25
- gem dependent XXX --source http://rubygems.org --no-progress | wc -l
26
-
27
- # Fun-facts from 2010-11-03
28
- bundler: 263
29
- activesupport: 983
30
- activerecord: 566
31
-
32
- hoe: 1454
33
- jeweler: 234
34
- echoe: 85
35
-
36
- nokogiri: 516
37
- hpricot: 297
38
-
39
- TODO
40
- =====
41
- - include nested dependencies (a > b > c --> a = [b,c])
42
- - add tests for cli interface
43
- - add `--type development` support
44
-
45
- Authors
46
- =======
47
-
48
- ### [Contributors](https://github.com/grosser/gem-dependent/contributors)
49
- - [Christopher Patuzzo](https://github.com/cpatuzzo)
50
-
51
- [Michael Grosser](http://grosser.it)<br/>
52
- michael@grosse.it<br/>
53
- License: MIT
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.7
@@ -1,11 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2
- require "rubygems/dependent/version"
3
-
4
- Gem::Specification.new "gem-dependent", Gem::Dependent::VERSION do |s|
5
- s.summary = "See which gems depend on your gems"
6
- s.authors = ["Michael Grosser"]
7
- s.email = "michael@grosser.it"
8
- s.homepage = "http://github.com/grosser/#{s.name}"
9
- s.files = `git ls-files`.split("\n")
10
- s.license = "MIT"
11
- end
@@ -1,71 +0,0 @@
1
- # normal require does not work once gem is installed, because its loaded via rubygems
2
- $LOAD_PATH.unshift File.expand_path('..', File.dirname(__FILE__))
3
- require 'lib/rubygems/dependent'
4
-
5
- describe Gem::Dependent do
6
- before do
7
- Gem::SpecFetcher.fetcher = nil # reset cache
8
- end
9
-
10
- let(:fixture){ YAML.load(File.read('spec/fixtures/gemcutter_specs.yml')) }
11
- let(:hoe_gems){
12
- [
13
- ["_", ["hoe"]],
14
- ["1234567890_", ["hoe"]],
15
- ["actionmailer-javamail", ["hoe"]],
16
- ["ActiveExcel", ["hoe"]],
17
- ["activefacts", ["hoe"]],
18
- ["activeldap", ["hoe"]],
19
- ["active_mac", ["hoe"]],
20
- ["activemdb", ["hoe"]],
21
- ["activerdf_rules", ["hoe"]],
22
- ["activerecord-jdbc-adapter", ["hoe"]]
23
- ]
24
- }
25
-
26
- def simplify_gem_results(dependencies)
27
- dependencies.map{|name, version, deps| [name, deps.map{|d| d.name}] }
28
- end
29
-
30
- def stub_source(options={})
31
- gem_source = options[:source] || 'http://gemcutter.org'
32
- if !options[:live]
33
- Gem::SpecFetcher.fetcher.should_receive(:load_specs).with(URI.parse(gem_source), 'specs').and_return(fixture)
34
- end
35
- Gem.sources = [gem_source]
36
- end
37
-
38
- it 'finds dependencies for given gem' do
39
- stub_source
40
- dependencies = simplify_gem_results(Gem::Dependent.find('hoe'))
41
- dependencies.should == hoe_gems
42
- end
43
-
44
- it "obeys fetch-limit" do
45
- stub_source
46
- dependencies = simplify_gem_results(Gem::Dependent.find('hoe', :fetch_limit => 100))
47
- dependencies.should == hoe_gems.first(3)
48
- end
49
-
50
- it "can use given source" do
51
- source = 'http://rubygems.org'
52
- stub_source(:source => source)
53
- Gem::Dependent.find('hoe', :source => source)
54
- end
55
-
56
- it "obeys parallel option" do
57
- stub_source
58
- Gem::Dependent::Parallel.should_receive(:map).with(anything, :in_processes => 3).and_return []
59
- Gem::Dependent.find('hoe', :parallel => 3)
60
- end
61
-
62
- it "obeys all versions option" do
63
- stub_source :live => true
64
- Gem::Dependent.should_receive(:all_specs_and_sources).with(:all_versions => true)
65
- Gem::Dependent.find('hoe', :all_versions => true)
66
- end
67
-
68
- it "has a VERSION" do
69
- Gem::Dependent::VERSION.should =~ /^\d+\.\d+\.\d+$/
70
- end
71
- end