abide_dev_utils 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cb6febf04efd889f8fae16d58b7951a1e209c57aef125a03017ac3fdc5229a88
4
+ data.tar.gz: f133a75839ef09396eba54bb6f563567c9f5cf7057aab1a03a5ec09598600cd8
5
+ SHA512:
6
+ metadata.gz: 798de0252108b50dbe3486f1edceb916e985039087ccf23f2ff0c2a0f1f1f75e0478a45c4a78b634968e197a03628869f968cf55236ab8b7e4bd7e3f1f9f17e1
7
+ data.tar.gz: e41abc0cbcd7bdb8ac3b700beed14479baf9287ad10c1bc8405d22384afb75df7e8a0dee0f9914f99e2b81576dff2b5d8f10b06a3dfe66595858fa6967e71eb1
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,136 @@
1
+ inherit_from: .rubocop_todo.yml
2
+ require:
3
+ - rubocop/cop/internal_affairs
4
+ - rubocop-performance
5
+ - rubocop-rspec
6
+
7
+ AllCops:
8
+ NewCops: enable
9
+ Exclude:
10
+ - 'vendor/**/*'
11
+ - 'spec/fixtures/**/*'
12
+ - 'tmp/**/*'
13
+ - '.git/**/*'
14
+ - 'bin/*'
15
+ TargetRubyVersion: 2.5
16
+ SuggestExtensions: false
17
+
18
+ Naming/PredicateName:
19
+ # Method define macros for dynamically generated method.
20
+ MethodDefinitionMacros:
21
+ - define_method
22
+ - define_singleton_method
23
+ - def_node_matcher
24
+ - def_node_search
25
+
26
+ Style/AccessorGrouping:
27
+ Exclude:
28
+ - lib/rubocop/formatter/base_formatter.rb
29
+ - lib/rubocop/cop/offense.rb
30
+
31
+ Style/FormatStringToken:
32
+ # Because we parse a lot of source codes from strings. Percent arrays
33
+ # look like unannotated format string tokens to this cop.
34
+ Exclude:
35
+ - spec/**/*
36
+
37
+ Style/IpAddresses:
38
+ # The test for this cop includes strings that would cause offenses
39
+ Exclude:
40
+ - spec/rubocop/cop/style/ip_addresses_spec.rb
41
+
42
+ Layout/EndOfLine:
43
+ EnforcedStyle: lf
44
+
45
+ Layout/ClassStructure:
46
+ Enabled: true
47
+ Categories:
48
+ module_inclusion:
49
+ - include
50
+ - prepend
51
+ - extend
52
+ ExpectedOrder:
53
+ - module_inclusion
54
+ - constants
55
+ - public_class_methods
56
+ - initializer
57
+ - instance_methods
58
+ - protected_methods
59
+ - private_methods
60
+
61
+ Layout/TrailingWhitespace:
62
+ AllowInHeredoc: false
63
+
64
+ Lint/AmbiguousBlockAssociation:
65
+ Exclude:
66
+ - 'spec/**/*.rb'
67
+
68
+ Layout/HashAlignment:
69
+ EnforcedHashRocketStyle:
70
+ - key
71
+ - table
72
+ EnforcedColonStyle:
73
+ - key
74
+ - table
75
+
76
+ Layout/LineLength:
77
+ Max: 120
78
+ IgnoredPatterns:
79
+ - !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
80
+
81
+ Lint/InterpolationCheck:
82
+ Exclude:
83
+ - 'spec/**/*.rb'
84
+
85
+ Lint/UselessAccessModifier:
86
+ MethodCreatingMethods:
87
+ - 'def_matcher'
88
+ - 'def_node_matcher'
89
+
90
+ Lint/BooleanSymbol:
91
+ Enabled: false
92
+
93
+ Metrics/AbcSize:
94
+ Enabled: false
95
+
96
+ Metrics/MethodLength:
97
+ Enabled: false
98
+
99
+ Metrics/BlockLength:
100
+ Exclude:
101
+ - 'Rakefile'
102
+ - '**/*.rake'
103
+ - 'spec/**/*.rb'
104
+ - '**/*.gemspec'
105
+
106
+ Metrics/ClassLength:
107
+ Exclude:
108
+ - lib/rubocop/config_obsoletion.rb
109
+
110
+ Metrics/ModuleLength:
111
+ Exclude:
112
+ - 'spec/**/*.rb'
113
+
114
+ RSpec/FilePath:
115
+ Exclude:
116
+ - spec/rubocop/formatter/junit_formatter_spec.rb
117
+
118
+ RSpec/PredicateMatcher:
119
+ EnforcedStyle: explicit
120
+
121
+ RSpec/MessageSpies:
122
+ EnforcedStyle: receive
123
+
124
+ RSpec/NestedGroups:
125
+ Max: 7
126
+
127
+ RSpec/MultipleMemoizedHelpers:
128
+ Enabled: false
129
+
130
+ Performance/CollectionLiteralInLoop:
131
+ Exclude:
132
+ - 'Rakefile'
133
+ - 'spec/**/*.rb'
134
+
135
+ RSpec/StubbedMock:
136
+ Enabled: false
@@ -0,0 +1,49 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-01-15 17:47:56 UTC using RuboCop version 1.8.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 2
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/OrderedDependencies:
14
+ Exclude:
15
+ - 'abide_dev_utils.gemspec'
16
+
17
+ # Offense count: 1
18
+ # Cop supports --auto-correct.
19
+ # Configuration parameters: EnforcedStyle.
20
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
21
+ Layout/EmptyLinesAroundClassBody:
22
+ Exclude:
23
+ - 'lib/abide_dev_utils/xccdf/parser.rb'
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: AllowComments.
27
+ Lint/EmptyClass:
28
+ Exclude:
29
+ - 'lib/abide_dev_utils/xccdf/parser.rb'
30
+
31
+ # Offense count: 1
32
+ # Cop supports --auto-correct.
33
+ RSpec/ExpectActual:
34
+ Exclude:
35
+ - 'spec/routing/**/*'
36
+ - 'spec/abide_dev_utils_spec.rb'
37
+
38
+ # Offense count: 20
39
+ # Cop supports --auto-correct.
40
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
41
+ # SupportedStyles: single_quotes, double_quotes
42
+ Style/StringLiterals:
43
+ Exclude:
44
+ - 'Gemfile'
45
+ - 'Rakefile'
46
+ - 'abide_dev_utils.gemspec'
47
+ - 'lib/abide_dev_utils/version.rb'
48
+ - 'spec/abide_dev_utils_spec.rb'
49
+ - 'spec/spec_helper.rb'
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in abide_dev_utils.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Heston Snodgrass
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,45 @@
1
+ # AbideDevUtils
2
+
3
+ Helper library and CLI app for Abide development.
4
+
5
+ ## Installation
6
+
7
+ ### CLI app
8
+
9
+ ```sh
10
+ $ gem install abide_dev_utils
11
+ ...
12
+ $ abide -h
13
+ ```
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'abide_dev_utils'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ `$ bundle install`
24
+
25
+ Or install it yourself as:
26
+
27
+ `$ gem install abide_dev_utils`
28
+
29
+ ## Usage
30
+
31
+ Coming soon, in the mean time run `abide -h` and `abide [command] -h` for help.
32
+
33
+ ## Development
34
+
35
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+
37
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/hsnodgrass/abide_dev_utils.
42
+
43
+ ## License
44
+
45
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "abide_dev_utils/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "abide_dev_utils"
9
+ spec.version = AbideDevUtils::VERSION
10
+ spec.authors = ["Heston Snodgrass"]
11
+ spec.email = ["hsnodgrass3@gmail.com"]
12
+
13
+ spec.summary = "Helper utilities for developing Abide"
14
+ spec.description = "Provides a CLI with helpful utilities for developing Abide"
15
+ spec.homepage = "https://github.com/hsnodgrass/abide_dev_utils"
16
+ spec.license = "MIT"
17
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
18
+
19
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
20
+
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["source_code_uri"] = spec.homepage
23
+ spec.metadata["changelog_uri"] = spec.homepage
24
+
25
+ # Specify which files should be added to the gem when it is released.
26
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
29
+ end
30
+ spec.bindir = 'exe'
31
+ spec.executables = ['abide']
32
+ spec.require_paths = ['lib']
33
+
34
+ # Prod dependencies
35
+ spec.add_dependency 'bundler', '~> 2.0'
36
+ spec.add_dependency 'nokogiri', '~> 1.11'
37
+ spec.add_dependency 'cmdparse', '~> 3.0'
38
+ spec.add_dependency 'puppet', '<= 6.19'
39
+ spec.add_dependency 'jira-ruby', '~> 2.1'
40
+ spec.add_dependency 'ruby-progressbar', '~> 1.11'
41
+
42
+ # Dev dependencies
43
+ spec.add_development_dependency 'rspec', '~> 3.10'
44
+ spec.add_development_dependency 'rubocop', '~> 1.8'
45
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
46
+ spec.add_development_dependency 'rubocop-ast', '~> 1.4'
47
+ spec.add_development_dependency 'rubocop-performance', '~> 1.9'
48
+ spec.add_development_dependency 'rubocop-i18n', '~> 3.0'
49
+ spec.add_development_dependency 'fast_gettext', '~> 1.1'
50
+
51
+ # For more information and examples about making a new gem, checkout our
52
+ # guide at: https://bundler.io/guides/creating_gem.html
53
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'abide_dev_utils/cli'
5
+
6
+ Abide::CLI.execute
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "abide_dev_utils"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'abide_dev_utils/cli'
5
+
6
+ Abide::CLI.execute
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'abide_dev_utils/version'
4
+ require 'abide_dev_utils/xccdf'
5
+ require 'abide_dev_utils/utils'
6
+ require 'abide_dev_utils/errors'
7
+
8
+ # Just creates the namespace
9
+ module AbideDevUtils; end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cmdparse'
4
+ require 'abide_dev_utils/version'
5
+ require 'abide_dev_utils/constants'
6
+ require 'abide_dev_utils/cli/puppet'
7
+ require 'abide_dev_utils/cli/xccdf'
8
+ require 'abide_dev_utils/cli/test'
9
+ require 'abide_dev_utils/cli/jira'
10
+
11
+ module Abide
12
+ module CLI
13
+ include AbideDevUtils::CliConstants
14
+ ROOT_CMD_NAME = 'abide'
15
+ ROOT_CMD_BANNER = 'Developer tools for Abide'
16
+
17
+ def self.new_parser
18
+ parser = CmdParse::CommandParser.new(handle_exceptions: true)
19
+ parser.main_options.program_name = ROOT_CMD_NAME
20
+ parser.main_options.version = AbideDevUtils::VERSION
21
+ parser.main_options.banner = ROOT_CMD_BANNER
22
+ parser.add_command(CmdParse::HelpCommand.new, default: true)
23
+ parser.add_command(PuppetCommand.new)
24
+ parser.add_command(XccdfCommand.new)
25
+ parser.add_command(TestCommand.new)
26
+ parser.add_command(JiraCommand.new)
27
+ parser
28
+ end
29
+
30
+ def self.execute
31
+ parser = new_parser
32
+ parser.parse
33
+ end
34
+ end
35
+ end