Sha256: ec78a7b8543c26ae8eb8639cf2f00f17beb1b95374ed5e8df05391f7d1eff286

Contents?: true

Size: 1.12 KB

Versions: 14

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby

# resolve bin path, ignoring symlinks
require "pathname"
bin_file = Pathname.new(__FILE__).realpath

# add self to libpath
$:.unshift File.expand_path("../../lib", bin_file)

# Fixes https://github.com/rubygems/rubygems/issues/1420
require "rubygems/specification"

module Gem
  class Specification
    def this; self; end
  end
end

require "bundler/setup"
require "stepmod/utils/changes_extractor"
require "optparse"

def log(message)
  puts "[stepmod-utils] #{message}"
end

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: #{$0} [options]"

  opts.on(
    "-p",
    "--path STEPMOD_DATA_PATH",
    String,
    "Path to STEPmod data directory",
  ) do |path|
    options[:stepmod_dir] = path
  end

  opts.on_tail("-h", "--help", "Show this message") do
    puts opts
    exit
  end
end.parse!

stepmod_dir = options[:stepmod_dir]
if stepmod_dir.nil?
  raise StandardError.new("STEPmod data path not set, set with the `-p` option")
else
  log "STEPmod data path: `#{stepmod_dir}`"
end

changes = Stepmod::Utils::ChangesExtractor.call(
  stepmod_dir: Pathname.new(stepmod_dir).realpath,
)

changes.save_to_files

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
stepmod-utils-0.4.0 exe/stepmod-extract-changes
stepmod-utils-0.3.37 exe/stepmod-extract-changes
stepmod-utils-0.3.36 exe/stepmod-extract-changes
stepmod-utils-0.3.35 exe/stepmod-extract-changes
stepmod-utils-0.3.34 exe/stepmod-extract-changes
stepmod-utils-0.3.33 exe/stepmod-extract-changes
stepmod-utils-0.3.32 exe/stepmod-extract-changes
stepmod-utils-0.3.31 exe/stepmod-extract-changes
stepmod-utils-0.3.30 exe/stepmod-extract-changes
stepmod-utils-0.3.29 exe/stepmod-extract-changes
stepmod-utils-0.3.28 exe/stepmod-extract-changes
stepmod-utils-0.3.27 exe/stepmod-extract-changes
stepmod-utils-0.3.26 exe/stepmod-extract-changes
stepmod-utils-0.3.25 exe/stepmod-extract-changes