Class: Star::Dlp::CLI
- Inherits:
-
Thor
- Object
- Thor
- Star::Dlp::CLI
- Defined in:
- lib/star/dlp/cli.rb
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/star/dlp/cli.rb', line 75 def config config = Config.load # Override config with command line options config.github_token = [:token] if [:token] config.output_dir = [:output_dir] if [:output_dir] config.json_dir = [:json_dir] if [:json_dir] config.markdown_dir = [:markdown_dir] if [:markdown_dir] # Save config for future use config.save puts "Configuration saved successfully!" puts "GitHub Token: #{config.github_token || 'Not set'}" puts "Output Directory: #{config.output_dir}" puts "JSON Directory: #{config.json_dir}" puts "Markdown Directory: #{config.markdown_dir}" end |
#download(username) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/star/dlp/cli.rb', line 22 def download(username) config = Config.load # Override config with command line options config.github_token = [:token] if [:token] config.output_dir = [:output_dir] if [:output_dir] config.json_dir = [:json_dir] if [:json_dir] config.markdown_dir = [:markdown_dir] if [:markdown_dir] # Save config for future use config.save downloader = Downloader.new( config, username, thread_count: [:threads], skip_readme: [:skip_readme], retry_count: [:retry_count], retry_delay: [:retry_delay] ) downloader.download end |
#download_readme ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/star/dlp/cli.rb', line 50 def download_readme config = Config.load # Create a downloader instance downloader = Downloader.new( config, "readme_downloader", # Placeholder username thread_count: [:threads], retry_count: [:retry_count], retry_delay: [:retry_delay] ) # Call the download_readmes method in the Downloader class result = downloader.download_readmes(force: [:force]) puts "README download completed!" puts "Successfully downloaded: #{result[:success]}" puts "Failed or not found: #{result[:failed]}" end |
#version ⇒ Object
95 96 97 |
# File 'lib/star/dlp/cli.rb', line 95 def version puts "star-dlp version #{VERSION}" end |