dependency_revealer 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dependency_revealer.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Franck Verrot
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,45 @@
1
+ # DependencyRevealer
2
+
3
+ Extract dependencies info from a Gemfile and a Gemfile.lock.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'dependency_revealer'
10
+
11
+ or
12
+
13
+ gem 'dependency_revealer', github: 'franckverrot/dependency_revealer'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install dependency_revealer
22
+
23
+ ## Usage
24
+
25
+ You can extract dependencies info by running
26
+
27
+ reveal
28
+
29
+ You might need to either `rehash` or `bundle exec` before executing the command,
30
+ but you might also want to install the `binstubs` (`bundle install --binstubs`)
31
+ and run `reveal` from the `bin` folder (`bin/reveal`).
32
+
33
+ You can pass options to `reveal`:
34
+
35
+ * `reveal Gemfile`
36
+ * `reveal Gemfile Gemfile.lock`
37
+ * `reveal Gemfile Gemfile.lock name,description,bindir,homepage`: Gets the required set of info from the gemspecs.
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'dependency_revealer'
4
+
5
+ if ARGV.length > 3
6
+ $stderr.puts DependencyRevealer::CLI.banner
7
+ exit 1
8
+ else
9
+ gemfile = ARGV[0] || 'Gemfile'
10
+ gemfile_lock = ARGV[1] || 'Gemfile.lock'
11
+ attributes = ARGV[2] || 'name,summary,homepage'
12
+ DependencyRevealer::CLI.new(gemfile, gemfile_lock).describe(attributes)
13
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "dependency_revealer"
7
+ gem.version = "1.0.0"
8
+ gem.authors = ["Franck Verrot"]
9
+ gem.email = ["franck@verrot.fr"]
10
+ gem.description = %q{Reveals all the dependencies given a Gemfile}
11
+ gem.summary = %q{Reveals all the dependencies given a Gemfile}
12
+ gem.homepage = "http://github.com/franckverrot/dependency_revealer"
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
+ gem.test_files = gem.files.grep(%r{^(test)/})
17
+
18
+ gem.add_dependency 'bundler'
19
+ end
@@ -0,0 +1,5 @@
1
+ require 'bundler'
2
+ require 'dependency_revealer/cli'
3
+
4
+ module DependencyRevealer
5
+ end
@@ -0,0 +1,35 @@
1
+ module DependencyRevealer
2
+ class CLI
3
+ def initialize(gemfile, gemfile_lock, out = $stdout, err = $stderr)
4
+ @out, @err = out, err
5
+
6
+ [gemfile, gemfile_lock].map do |file|
7
+ if !File.exists?(file)
8
+ @out.puts self.class.banner
9
+ @out.puts "#{file} not found"
10
+ @out.puts "Quitting..."
11
+ exit 1
12
+ end
13
+ end
14
+ @gemfile, @gemfile_lock = gemfile, gemfile_lock
15
+ end
16
+
17
+ def describe(attributes)
18
+ attrs = attributes.split(',')
19
+ definition = Bundler::Definition.build(@gemfile, @gemfile_lock, nil)
20
+ definition.specs.map do |spec|
21
+ @out.puts attrs.map { |attr| spec.send(attr) }.join(', ')
22
+ end
23
+ end
24
+
25
+ def self.banner
26
+ <<-EOBANNER
27
+ ######################################
28
+
29
+ Usage: reveal [Gemfile [Gemfile.lock]]
30
+
31
+ ######################################
32
+ EOBANNER
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,42 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', github: 'rails/rails', branch: 'feature/controller_instantiation'
4
+ gem 'journey', github: 'rails/journey', branch: 'master'
5
+ gem 'arel', github: 'rails/arel', branch: 'master'
6
+ gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders'
7
+
8
+ gem 'sqlite3'
9
+ gem 'jazz_hands'
10
+
11
+ # Gems used only for assets and not required
12
+ # in production environments by default.
13
+ group :assets do
14
+ gem 'sprockets-rails', github: 'rails/sprockets-rails'
15
+ gem 'sass-rails', github: 'rails/sass-rails'
16
+ gem 'coffee-rails', github: 'rails/coffee-rails'
17
+
18
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
19
+ # gem 'therubyracer', platforms: :ruby
20
+
21
+ gem 'uglifier', '>= 1.0.3'
22
+ end
23
+
24
+ gem 'jquery-rails'
25
+
26
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
27
+ gem 'turbolinks'
28
+
29
+ # To use ActiveModel has_secure_password
30
+ # gem 'bcrypt-ruby', '~> 3.0.0'
31
+
32
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
33
+ # gem 'jbuilder'
34
+
35
+ # Use unicorn as the app server
36
+ # gem 'unicorn'
37
+
38
+ # Deploy with Capistrano
39
+ # gem 'capistrano', group: :development
40
+
41
+ # To use debugger
42
+ # gem 'debugger'
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dependency_revealer
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Franck Verrot
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Reveals all the dependencies given a Gemfile
31
+ email:
32
+ - franck@verrot.fr
33
+ executables:
34
+ - reveal
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - .gitignore
39
+ - Gemfile
40
+ - LICENSE.txt
41
+ - README.md
42
+ - Rakefile
43
+ - bin/reveal
44
+ - dependency_revealer.gemspec
45
+ - lib/dependency_revealer.rb
46
+ - lib/dependency_revealer/cli.rb
47
+ - test/fixtures/Gemfile
48
+ homepage: http://github.com/franckverrot/dependency_revealer
49
+ licenses: []
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project:
68
+ rubygems_version: 1.8.23
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: Reveals all the dependencies given a Gemfile
72
+ test_files:
73
+ - test/fixtures/Gemfile
74
+ has_rdoc: