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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11e639242f81d41c2083dbeb1a82ecdbaff2f9363468edb88e4149fc7656412d
4
- data.tar.gz: 605a7151c65abc1d9939aded3341fcedc9d900a47d828f9c932102223da516e9
3
+ metadata.gz: bd277fc3926801f9f6874672e98bcdf78584cf41e49a3e9417713415b9a29047
4
+ data.tar.gz: c18962c3c71fdb844fbbba265e866eccf5c433376bdd7a16a27f4689ba4446e6
5
5
  SHA512:
6
- metadata.gz: b38c2a4c86aef63bb3d5abb3e71befcf0e814076a96839649a3accc02ee1ae33a365aab8a642456aab9a964edfa3ad9bda4c098af6f8e841153eacd005e7100f
7
- data.tar.gz: 87b7c46d1a73ad2f0ee372c7a4efd4c4c346119c9cb26eafc3697667eaee3cd6be4ec0af0be515b83709c201c92074f3e086778aa51643e087cb94cef28b45a1
6
+ metadata.gz: 6f96e86a4081d7d07cbeaaec9fba87a5e4e7645ff0279358ded74537ce782248a0bd873dc8e0e506ef44c38517f3f614ab56fb086606e53028c2da8fba612da6
7
+ data.tar.gz: c2f0359906f2c0fb232cf0ba53b2239766375e52204717fc004dd641fd9d770ce965fa3294221d5441117e3da27c955c62f6216bef12409ba19f6e63a5d2a694
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --color
2
+ --warnings
3
+ --require spec_helper
4
+ --order random
data/Gemfile CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in bundler-viz.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
5
+ gem "rake"
6
+ gem "rspec"
7
+ gem "ruby-graphviz"
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 test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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 "rake/testtask"
4
+ require 'rspec/core/rake_task'
5
5
 
6
- Rake::TestTask.new(:test) do |t|
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: :test
8
+ task default: :spec
@@ -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 = Bundler::Graph::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 Graph
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 viz..."
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}"
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "bundler/plugin/api"
4
4
  require "optparse"
5
- require_relative "graph"
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].join(":").tr(" ", ":").split(":")
33
+ options[:without] = options[:without].tr(" ", ":").split(":")
34
34
  output_file = File.expand_path(options[:file])
35
35
 
36
- graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
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.1.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-08 00:00:00.000000000 Z
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/graph.rb
29
+ - lib/bundler/dep_graph.rb
29
30
  - lib/bundler/graph/version.rb
30
31
  - lib/bundler/graph_cli.rb
31
32
  - plugins.rb