Class: Pod::Command::Dependency
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::Dependency
- Defined in:
- lib/cocoapods-dependency/command/dependency.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Dependency
constructor
A new instance of Dependency.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Dependency
Returns a new instance of Dependency.
16 17 18 19 |
# File 'lib/cocoapods-dependency/command/dependency.rb', line 16 def initialize(argv) @using_visual_output = argv.flag?('visual', false) super end |
Class Method Details
.options ⇒ Object
21 22 23 24 25 |
# File 'lib/cocoapods-dependency/command/dependency.rb', line 21 def self. [ ['--visual', 'Output the result using html'], ].concat(super) end |
Instance Method Details
#run ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cocoapods-dependency/command/dependency.rb', line 32 def run analyze_result = CocoapodsDependency::Analyzer.analyze_with_podfile(nil, config.podfile) if @using_visual_output helper = CocoapodsDependency::VisualOutHelper.new(analyze_result) final_path = Dir.tmpdir helper.write_json_to_file("#{final_path}/index.json") html_path = File.("../resources/index.html", __dir__) system "cp #{html_path} #{final_path}" final_html_path = "#{final_path}/index.html" puts "[CocoapodsDependency] ✅ html file generated at path #{final_html_path}" system "open #{final_html_path}" else pp result end end |
#validate! ⇒ Object
27 28 29 30 |
# File 'lib/cocoapods-dependency/command/dependency.rb', line 27 def validate! super verify_podfile_exists! end |