Skip to content

Commit

Permalink
Merge pull request #29 from mitre/updateCliHelp
Browse files Browse the repository at this point in the history
updateCLI_Help
  • Loading branch information
georgedias authored Jan 4, 2022
2 parents 7f153cf + bcddc27 commit 07395fd
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
name-template: '$NEXT_PATCH_VERSION'
tag-template: '$NEXT_PATCH_VERSION'
categories:
- title: 'Features'
labels:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
run: |
gem push --KEY rubygems --host https://rubygems.org *.gem
gem push --KEY rubygems --host https://rubygems.org emass_client/ruby_client/*.gem
- name: Publish to GPR
run: |
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} emass_client/ruby_client/*.gem
env:
OWNER: mitre
# - name: Publish to GPR
# run: |
# gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
# gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} emass_client/ruby_client/*.gem
# env:
# OWNER: mitre
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ PATH
specs:
emasser (1.0.1)
activesupport (~> 6.1.4)
colorize
dotenv
emass_client
rubyzip
thor
colorize (~> 0.8.1)
dotenv (~> 2.7.6)
emass_client (~> 1.0)
rubyzip (~> 2.3.2)
thor (~> 1.1.0)

PATH
remote: emass_client/ruby_client
Expand Down Expand Up @@ -36,7 +36,7 @@ GEM
dotenv (2.7.6)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.4)
ffi (1.15.4-x64-mingw32)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
json (2.6.1)
Expand Down Expand Up @@ -97,7 +97,7 @@ PLATFORMS
DEPENDENCIES
bundler (~> 2.1)
bundler-audit (~> 0.7)
byebug
byebug (~> 11.1.3)
emass_client!
emasser!
rake (~> 13.0)
Expand All @@ -109,4 +109,4 @@ DEPENDENCIES
yaml (~> 0.2.0)

BUNDLED WITH
2.2.32
2.3.4
4 changes: 0 additions & 4 deletions emass_client/config.json

This file was deleted.

5 changes: 5 additions & 0 deletions emass_client/swagger-codegen/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"gemName": "emass_client",
"gemVersion": "1.0.1",
"gemLicense": "Apache-2.0"
}
13 changes: 7 additions & 6 deletions emasser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
spec.version = Emasser::VERSION
spec.authors = ['Amndeep Singh Mann', 'George Dias', 'Kyle Fagan', 'Robert Clark', 'Aaron Lippold']
spec.email = ['[email protected]']
spec.licenses = ['Apache-2.0']

spec.summary = 'Provide an automated capability for invoving eMASS API endpoints'
spec.description = 'emasser can be used as a gem or used from the command line to access eMASS via thei API.'
Expand All @@ -22,15 +23,15 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

spec.add_runtime_dependency 'activesupport', '~> 6.1.4'
spec.add_runtime_dependency 'colorize'
spec.add_runtime_dependency 'dotenv'
spec.add_runtime_dependency 'rubyzip'
spec.add_runtime_dependency 'emass_client'
spec.add_runtime_dependency 'thor'
spec.add_runtime_dependency 'colorize', '~> 0.8.1'
spec.add_runtime_dependency 'dotenv', '~> 2.7.6'
spec.add_runtime_dependency 'rubyzip', '~> 2.3.2'
spec.add_runtime_dependency 'thor', '~> 1.1.0'
spec.add_runtime_dependency 'emass_client', '~> 1.0'

spec.add_development_dependency 'bundler', '~> 2.1'
spec.add_development_dependency 'bundler-audit', '~> 0.7'
spec.add_development_dependency 'byebug'
spec.add_development_dependency 'byebug', '~> 11.1.3'
spec.add_development_dependency 'rspec', '~>3.10.0'
spec.add_development_dependency 'yaml', '~>0.2.0'
spec.add_development_dependency 'rake', '~> 13.0'
Expand Down
8 changes: 8 additions & 0 deletions lib/emasser/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ class CLI < Thor
elsif ARGV[0].to_s.include? 'del'
require 'emasser/delete'
register(Emasser::Delete, 'delete', 'delete [RESOURCE]', 'Deletes resources')
elsif (ARGV[0].to_s.include? '-v') || (ARGV[0].to_s.include? '-V')
puts Emasser::VERSION.green
exit
end

def help
puts 'Emasser commands:'
puts ' emasser [get, put, post, delete, -v, or -V]'
end

def self.exit_on_failure?
Expand Down
15 changes: 10 additions & 5 deletions lib/emasser/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ class Configuration
def self.raise_unless_present(env)
ENV.fetch(env) { raise Emasser::ConfigurationMissingError.new(env) }
rescue Emasser::ConfigurationMissingError => e
puts e.message.red
puts 'See emasser environment variables requirements in emasser CLI Features'
if (ARGV[0].to_s.include? '-v') || (ARGV[0].to_s.include? '-V')
puts Emasser::VERSION.green
else
puts "\n", e.message.red
puts 'Create a .env file with the necessary variables, place it in the root directory where the emasser command'.yellow
puts 'is executed. See emasser environment variables requirements in emasser CLI Features for more information'.yellow, "\n"
end
exit
end
# rubocop: enable Style/RaiseArgs
Expand All @@ -24,9 +29,9 @@ def self.raise_unless_present(env)
config.key_file = raise_unless_present('EMASSER_KEY_FILE_PATH')
config.cert_file = raise_unless_present('EMASSER_CERT_FILE_PATH')
config.key_password = raise_unless_present('EMASSER_KEY_PASSWORD')
config.client_side_validation = (raise_unless_present('EMASSER_CLIENT_SIDE_VALIDATION') == 'false') ? false : true
config.verify_ssl = (raise_unless_present('EMASSER_VERIFY_SSL') == 'false') ? false : true
config.verify_ssl_host = (raise_unless_present('EMASSER_VERIFY_SSL_HOST') == 'false') ? false : true
config.client_side_validation = (ENV.fetch('EMASSER_CLIENT_SIDE_VALIDATION', false) == 'false') ? false : true
config.verify_ssl = (ENV.fetch('EMASSER_VERIFY_SSL', false) == 'false') ? false : true
config.verify_ssl_host = (ENV.fetch('EMASSER_VERIFY_SSL_HOST', false) == 'false') ? false : true
config.debugging = (ENV.fetch('EMASSER_DEBUGGING', false) == 'true') ? true : false
end
# rubocop: enable Style/TernaryParentheses, Style/IfWithBooleanLiteralBranches
Expand Down

0 comments on commit 07395fd

Please sign in to comment.