bundler-graph 0.1.0 → 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 +4 -4
- data/.rspec +4 -0
- data/Gemfile +3 -6
- data/README.md +1 -1
- data/Rakefile +3 -7
- data/bundler-graph.gemspec +1 -3
- data/lib/bundler/{graph.rb → dep_graph.rb} +2 -2
- data/lib/bundler/graph_cli.rb +7 -7
- metadata +4 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: bd277fc3926801f9f6874672e98bcdf78584cf41e49a3e9417713415b9a29047
         | 
| 4 | 
            +
              data.tar.gz: c18962c3c71fdb844fbbba265e866eccf5c433376bdd7a16a27f4689ba4446e6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6f96e86a4081d7d07cbeaaec9fba87a5e4e7645ff0279358ded74537ce782248a0bd873dc8e0e506ef44c38517f3f614ab56fb086606e53028c2da8fba612da6
         | 
| 7 | 
            +
              data.tar.gz: c2f0359906f2c0fb232cf0ba53b2239766375e52204717fc004dd641fd9d770ce965fa3294221d5441117e3da27c955c62f6216bef12409ba19f6e63a5d2a694
         | 
    
        data/.rspec
    ADDED
    
    
    
        data/Gemfile
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -29,7 +29,7 @@ bundle graph [--file=FILE] | |
| 29 29 |  | 
| 30 30 | 
             
            ## Development
         | 
| 31 31 |  | 
| 32 | 
            -
            After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake  | 
| 32 | 
            +
            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.
         | 
| 33 33 |  | 
| 34 34 | 
             
            To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
         | 
| 35 35 |  | 
    
        data/Rakefile
    CHANGED
    
    | @@ -1,12 +1,8 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 3 | 
             
            require "bundler/gem_tasks"
         | 
| 4 | 
            -
            require  | 
| 4 | 
            +
            require 'rspec/core/rake_task'
         | 
| 5 5 |  | 
| 6 | 
            -
             | 
| 7 | 
            -
              t.libs << "test"
         | 
| 8 | 
            -
              t.libs << "lib"
         | 
| 9 | 
            -
              t.test_files = FileList["test/**/*_test.rb"]
         | 
| 10 | 
            -
            end
         | 
| 6 | 
            +
            RSpec::Core::RakeTask.new(:spec)
         | 
| 11 7 |  | 
| 12 | 
            -
            task default: : | 
| 8 | 
            +
            task default: :spec
         | 
    
        data/bundler-graph.gemspec
    CHANGED
    
    | @@ -1,10 +1,8 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
            require_relative "lib/bundler/graph/version"
         | 
| 4 | 
            -
             | 
| 5 3 | 
             
            Gem::Specification.new do |spec|
         | 
| 6 4 | 
             
              spec.name          = "bundler-graph"
         | 
| 7 | 
            -
              spec.version       =  | 
| 5 | 
            +
              spec.version       = "0.2.0"
         | 
| 8 6 | 
             
              spec.authors       = ["Hiroshi SHIBATA"]
         | 
| 9 7 | 
             
              spec.email         = ["hsbt@ruby-lang.org"]
         | 
| 10 8 |  | 
| @@ -2,7 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            require "set"
         | 
| 4 4 | 
             
            module Bundler
         | 
| 5 | 
            -
              class  | 
| 5 | 
            +
              class DepGraph
         | 
| 6 6 | 
             
                GRAPH_NAME = :Gemfile
         | 
| 7 7 |  | 
| 8 8 | 
             
                def initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png", without = [])
         | 
| @@ -136,7 +136,7 @@ module Bundler | |
| 136 136 |  | 
| 137 137 | 
             
                    if @output_format.to_s == "debug"
         | 
| 138 138 | 
             
                      $stdout.puts g.output :none => String
         | 
| 139 | 
            -
                      Bundler.ui.info "debugging bundle  | 
| 139 | 
            +
                      Bundler.ui.info "debugging bundle graph..."
         | 
| 140 140 | 
             
                    else
         | 
| 141 141 | 
             
                      begin
         | 
| 142 142 | 
             
                        g.output @output_format.to_sym => "#{@output_file}.#{@output_format}"
         | 
    
        data/lib/bundler/graph_cli.rb
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            require "bundler/plugin/api"
         | 
| 4 4 | 
             
            require "optparse"
         | 
| 5 | 
            -
            require_relative " | 
| 5 | 
            +
            require_relative "dep_graph"
         | 
| 6 6 |  | 
| 7 7 | 
             
            module Bundler
         | 
| 8 8 | 
             
              class GraphCLI < Plugin::API
         | 
| @@ -20,20 +20,20 @@ module Bundler | |
| 20 20 | 
             
                    format: "png",
         | 
| 21 21 | 
             
                    requirements: false,
         | 
| 22 22 | 
             
                    version: false,
         | 
| 23 | 
            -
                    without:  | 
| 23 | 
            +
                    without: ""
         | 
| 24 24 | 
             
                  }
         | 
| 25 25 | 
             
                  opt = OptionParser.new
         | 
| 26 | 
            -
                  opt.on('-f', '--file', 'The name to use for the generated file. See `--format` option') {|v| options[:file] = v }
         | 
| 27 | 
            -
                  opt.on('-F', '--format', 'This is output format option. Supported format is png, jpg, svg, dot ...') {|v| options[:format] = v }
         | 
| 26 | 
            +
                  opt.on('-f', '--file FILE', 'The name to use for the generated file. See `--format` option') {|v| options[:file] = v }
         | 
| 27 | 
            +
                  opt.on('-F', '--format FORMAT', 'This is output format option. Supported format is png, jpg, svg, dot ...') {|v| options[:format] = v }
         | 
| 28 28 | 
             
                  opt.on('-R', '--requirements', 'Set to show the version of each required dependency.') {|v| options[:requirements] = true }
         | 
| 29 29 | 
             
                  opt.on('-v', '--version', 'Set to show each gem version.') {|v| options[:version] = true }
         | 
| 30 | 
            -
                  opt.on('-W', '--without', 'Exclude gems that are part of the specified named group.') {|v| options[:without] = v }
         | 
| 30 | 
            +
                  opt.on('-W', '--without GROUP[:GROUP...]', 'Exclude gems that are part of the specified named group.') {|v| options[:without] = v }
         | 
| 31 31 | 
             
                  opt.parse!(argv)
         | 
| 32 32 |  | 
| 33 | 
            -
                  options[:without] = options[:without]. | 
| 33 | 
            +
                  options[:without] = options[:without].tr(" ", ":").split(":")
         | 
| 34 34 | 
             
                  output_file = File.expand_path(options[:file])
         | 
| 35 35 |  | 
| 36 | 
            -
                  graph =  | 
| 36 | 
            +
                  graph = DepGraph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
         | 
| 37 37 | 
             
                  graph.viz
         | 
| 38 38 | 
             
                rescue LoadError => e
         | 
| 39 39 | 
             
                  Bundler.ui.error e.inspect
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: bundler-graph
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Hiroshi SHIBATA
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021-11- | 
| 11 | 
            +
            date: 2021-11-11 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: "`graph` generates a PNG file of the current `Gemfile(5)` as a dependency
         | 
| 14 14 | 
             
              graph."
         | 
| @@ -18,6 +18,7 @@ executables: [] | |
| 18 18 | 
             
            extensions: []
         | 
| 19 19 | 
             
            extra_rdoc_files: []
         | 
| 20 20 | 
             
            files:
         | 
| 21 | 
            +
            - ".rspec"
         | 
| 21 22 | 
             
            - Gemfile
         | 
| 22 23 | 
             
            - LICENSE.txt
         | 
| 23 24 | 
             
            - README.md
         | 
| @@ -25,7 +26,7 @@ files: | |
| 25 26 | 
             
            - bin/console
         | 
| 26 27 | 
             
            - bin/setup
         | 
| 27 28 | 
             
            - bundler-graph.gemspec
         | 
| 28 | 
            -
            - lib/bundler/ | 
| 29 | 
            +
            - lib/bundler/dep_graph.rb
         | 
| 29 30 | 
             
            - lib/bundler/graph/version.rb
         | 
| 30 31 | 
             
            - lib/bundler/graph_cli.rb
         | 
| 31 32 | 
             
            - plugins.rb
         |