cocoapods-graph 1.0.0 → 1.0.1

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: 6d00b5c1eced22d283334372175b45d6a166c71261dcada2731d9581a86facc9
4
- data.tar.gz: 6c11214289c0328e13214292758d3757bcafa6f70367b9f84effa7b17e7b038b
3
+ metadata.gz: c72d2d884702cb1fddd70b6656d43a4eb6e8870a855647113fb41c2c703ac6e3
4
+ data.tar.gz: ecebd44a97afd21cebbb4b1a8b966113546a2b05834e860a5e60d391c036f8c3
5
5
  SHA512:
6
- metadata.gz: 1477ae702985ad56ff75ad3c134b41fdc85a216d0616399cdd4660b64613f84b588f30c0e56f0e2d1496bbee637f39687da166045d352ed927e02f46d2b205b9
7
- data.tar.gz: edc4c0d543bd6ee201d84496041e0476c95b89a50db097a5746eb4efa2d5964f98fc734ddb2ad7467aa60f82cf32d9deec338b8fe47bf04cf12e54c8c872ab84
6
+ metadata.gz: 6a200503671283029f9faff63e00beaad6fcee2c93e51560bee947b179796fb4fd11882853af645097fc4d3393acc59bf35cbfb54c718fc059df825758bbcf3e
7
+ data.tar.gz: 59b30136c85c63d777cc341b333a358402f4fa37575c149da6925129e2715d4bb7a7325480e384839c94e96c428e55a01b5c102fbf4f42585db85c0633a9a9c2
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  end
32
32
 
33
33
  spec.bindir = "exe"
34
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
34
+ spec.executables = ["cocoapods-graph"]
35
35
  spec.require_paths = ["lib"]
36
36
 
37
37
  # Runtime dependencies
data/exe/cocoapods-graph CHANGED
@@ -1,26 +1,37 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ # Print version immediately if requested
4
+ if ARGV.include?("-v") || ARGV.include?("--version")
5
+ require_relative '../lib/cocoapods_graph/version'
6
+ puts CocoaPodsGraph::VERSION
7
+ exit
8
+ end
2
9
  # frozen_string_literal: true
3
10
 
4
11
  require 'optparse'
5
- require_relative '../lib/cocoapods_graph'
12
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
13
+ require 'cocoapods_graph'
6
14
 
7
15
  module CocoaPodsGraph
8
16
  class CLI
9
17
  VERSION = CocoaPodsGraph::VERSION
10
18
 
11
19
  def self.run
12
- options = {}
20
+ puts '[DEBUG] Entered CLI.run'
21
+ options = {}
13
22
 
23
+ # Print version immediately if requested
24
+ if ARGV.include?('-v') || ARGV.include?('--version')
25
+ puts VERSION
26
+ exit
27
+ end
28
+
14
29
  parser = OptionParser.new do |parser|
15
30
  parser.banner = 'Usage: cocoapods-graph [options]'
16
31
  parser.on('-f', '--file FILE', 'Specify Podfile.lock file path') { |f| options[:file] = f }
17
32
  parser.on('--show', 'Print dependencies on console') { options[:show] = true }
18
33
  parser.on('--json', 'Save dependencies to JSON file') { options[:json] = true }
19
34
  parser.on('--html', 'Save dependencies to interactive HTML wheel graph') { options[:html] = true }
20
- parser.on('-v', '--version', 'Show version') do
21
- puts VERSION
22
- exit
23
- end
24
35
  parser.on('-h', '--help', 'Show this help message') do
25
36
  puts parser
26
37
  puts "\nExamples:"
@@ -48,11 +59,6 @@ module CocoaPodsGraph
48
59
  end
49
60
 
50
61
  if options[:file] && !options[:file].empty?
51
- unless options[:show] || options[:json] || options[:html]
52
- puts 'You must select an output option (--show | --json | --html)'
53
- exit(1)
54
- end
55
-
56
62
  # Add .lock extension if not present
57
63
  options[:file] += '.lock' unless options[:file].include?('.lock')
58
64
 
@@ -61,24 +67,37 @@ module CocoaPodsGraph
61
67
  exit(1)
62
68
  end
63
69
 
64
- result = CocoaPodsGraph::Generator.parse_lock_file(options[:file])
70
+ result = CocoaPodsGraph::Generator.parse_lock_file(options[:file])
71
+ puts "[DEBUG] Parsed result: #{result.inspect}"
65
72
 
73
+ any_output = false
66
74
  if options[:show]
75
+ puts '[DEBUG] --show option triggered'
67
76
  puts 'Printing dependencies...'
68
77
  result.each(&:print_object)
78
+ any_output = true
69
79
  end
70
80
 
71
81
  if options[:json]
82
+ puts '[DEBUG] --json option triggered'
72
83
  puts 'Saving JSON file...'
73
84
  CocoaPodsGraph::Generator.save_json_file(result, options[:file])
85
+ any_output = true
74
86
  end
75
87
 
76
88
  if options[:html]
89
+ puts '[DEBUG] --html option triggered'
77
90
  puts 'Saving HTML file...'
78
91
  CocoaPodsGraph::Generator.save_html_wheel_file(result, options[:file])
92
+ any_output = true
79
93
  end
80
94
 
81
- puts 'Done!'
95
+ if any_output
96
+ puts '[DEBUG] Done!'
97
+ else
98
+ puts 'You must select an output option (--show | --json | --html)'
99
+ exit(1)
100
+ end
82
101
  else
83
102
  puts 'Error: Please specify a Podfile.lock file with -f option'
84
103
  exit(1)
@@ -87,4 +106,4 @@ module CocoaPodsGraph
87
106
  end
88
107
  end
89
108
 
90
- CocoaPodsGraph::CLI.run if __FILE__ == $PROGRAM_NAME
109
+ CocoaPodsGraph::CLI.run
@@ -1,3 +1,3 @@
1
1
  module CocoaPodsGraph
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erick Jung