Sha256: 9ed3099d0b946098ddd88530735593ec889ec9cf08d564dc3084a500ba5a92b5
Contents?: true
Size: 1.55 KB
Versions: 2
Compression:
Stored size: 1.55 KB
Contents
#!/usr/bin/env ruby # # Print a report on our Gemfile # Why not just use `bundle outdated`? It doesn't give us the information we care about (and it fails). # at_exit do require "optparse" require "ten_years_rails" options = {} option_parser = OptionParser.new do |opts| opts.banner = <<-EOS Usage: #{$0} [report-type] [options] report-type There are two report types available: `outdated` and `compatibility` Examples: #{$0} compatibility --rails-version 5.0 #{$0} outdated EOS opts.separator "" opts.separator "Options:" opts.on("--rails-version [STRING]", "Rails version to check compatibility against (defaults to 5.0)") do |rails_version| options[:rails_version] = rails_version end opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do options[:include_rails_gems] = true end opts.on_tail("-h", "--help", "Show this message") do puts opts exit end end begin option_parser.parse! rescue OptionParser::ParseError => e STDERR.puts Rainbow(e.message).red puts option_parser exit 1 end report_type = ARGV.first case report_type when "outdated" then TenYearsRails::BundleReport.outdated else TenYearsRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false)) end end # Needs to happen first require "bundler/setup" require "action_view" require "active_support/core_ext/object/acts_like"
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ten_years_rails-1.0.2 | exe/bundle_report |
ten_years_rails-1.0.1 | exe/bundle_report |