where-are-my-dependencies 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 471ff51bc5ee559939233714c5c32f127a07fa34
4
+ data.tar.gz: 3c5e55c7c33ecdcf38f8900d08f1335f2950083d
5
+ SHA512:
6
+ metadata.gz: 941fc69dae0ec6d721ca155facf4c304bb0ffab62efa22d0d205c25cb7ee4508dc40d185198e1edb87516ad7fecf4c5b442ad05a2a8b8f7529ad911fc0731fbc
7
+ data.tar.gz: 44a2ff3c04959cabe993203edf4d0f6cfb93f3ae16ee267b189c3bb97ccd84a8c40df2bfa4059e83ba04097284796a95336d93840cea0a40be22895295bbf63b
@@ -0,0 +1,28 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /vendor/bundle
26
+ /lib/bundler/man/
27
+
28
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,8 @@
1
+ # Where Are My Dependencies?
2
+
3
+ A small ruby script that will look up all the gems in a given Gemfile.lock and print out where the source code (or home page) is for those gems.
4
+
5
+ The main purpose of this script is to track down which dependencies may be hosted somewhere less-than-reliable (say, code.google.com) and might need to be mirrored
6
+
7
+ Usage: where-are-my-dependencies.rb [path to application or Gemfile.lock]
8
+
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'json'
4
+ require 'bundler'
5
+ require 'faraday'
6
+ require 'optparse'
7
+ require 'gems'
8
+
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: where-are-my-dependencies.rb [options]"
11
+ end.parse!
12
+
13
+ path = ARGV.first || "."
14
+
15
+ if File.exists? File.join(path, "Gemfile.lock")
16
+ path = File.join(path, "Gemfile.lock")
17
+ end
18
+
19
+
20
+ lockfile = Bundler::LockfileParser.new(Bundler.read_file(path))
21
+
22
+ lockfile.specs.map do |gem|
23
+ info = Gems.info(gem.name)
24
+ if info.is_a? Hash
25
+ if info['source_code_uri']
26
+ puts "#{gem.name} is hosted at #{info['source_code_uri']}"
27
+ else
28
+ puts "#{gem.name} home page is at #{info['homepage_uri']}"
29
+ end
30
+ else
31
+ puts info
32
+ end
33
+ end
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "where-are-my-dependencies"
5
+ spec.version = "0.0.1"
6
+ spec.authors = ["Chris Beer"]
7
+ spec.email = ["chris@cbeer.info"]
8
+ spec.summary = %q{Simple ruby script to take a Gemfile.lock file and determine where dependencies are hosted.}
9
+ spec.homepage = ""
10
+
11
+ spec.files = `git ls-files -z`.split("\x0")
12
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
13
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
14
+ spec.require_paths = ["lib"]
15
+
16
+ spec.add_dependency 'faraday'
17
+ spec.add_dependency 'gems'
18
+
19
+ spec.add_dependency "bundler", "~> 1.7"
20
+ spec.add_development_dependency "rake", "~> 10.0"
21
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: where-are-my-dependencies
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Beer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
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: gems
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: '1.7'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description:
70
+ email:
71
+ - chris@cbeer.info
72
+ executables:
73
+ - where-are-my-dependencies
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - Gemfile
79
+ - README.md
80
+ - Rakefile
81
+ - bin/where-are-my-dependencies
82
+ - where-are-my-dependencies.gemspec
83
+ homepage: ''
84
+ licenses: []
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.4.5
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Simple ruby script to take a Gemfile.lock file and determine where dependencies
106
+ are hosted.
107
+ test_files: []