Commit graph

3524 commits

Author SHA1 Message Date
Ryan Davis
75ca4613c2 Extended to pick up our internal aws resources as well.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
4590fee51d Documented lib/inspec/resources.rb current usage.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
3b69967cc8 Fixed a bug in checking supports (strings vs symbols)
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
3f0f675364 Moved rspec/matchers require to somewhere more appropriate.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
2fc9ec3ec7 Refactor into Inspec::DSL.method_missing_resource
This way I can add aws lazy loading to only one place.

I don't actually care that this is in Inspec::DSL. There is probably a
better place for it. Suggestions welcome.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
ae88c3ddec Sped up inspec shell by avoiding pre-registering all reesources.
Now it tries to load a resource when `help xxx` is invoked or loads
all resources when `help resources` is invoked. Otherwise, it stays
lazy.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
e413cee6a4 I don't like this, but make chef shell require all resources.
I think there is probably a better way to do this, but my first
instinct was that I'd have to dig into hacking pry, and I don't want
to do that right now.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
b6bfeffd9e Make inspec much faster for most commands.
Removes pre-loading and registration of resources by adding
method_missing to a couple key areas.

This still drops the ball in some areas, but it is a start.
2019-09-04 15:44:26 -07:00
Chef Expeditor
d1ffce7278
Bump version to 4.16.2 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-03 20:24:54 +00:00
Chef Expeditor
8562397d78
Bump version to 4.16.1 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-30 20:20:21 +00:00
kekaichinose
d33870b635
Merge pull request #4214 from inspec/zenspider/fix_nil_file
Fixed file resource raising UndefinedMethod on source_path
2019-08-30 13:19:54 -07:00
Chef Expeditor
435747a2d2
Bump version to 4.16.0 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-28 19:41:38 +00:00
Clinton Wolfe
a6bd7ec4b5
Merge pull request #4401 from inspec/cw/input-from-cli
inputs: Accept bare input from the command line
2019-08-28 15:41:21 -04:00
Chef Expeditor
683170bd26
Bump version to 4.15.0 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-28 19:34:05 +00:00
Clinton Wolfe
edf335bbc9 Use plugin filter predicates to check plugin names
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:36:12 -04:00
Clinton Wolfe
82acec957e Add API for fetching plugin vconfig values.
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:25:49 -04:00
Clinton Wolfe
38f3469ee3 Validation for the plugins area of the config file
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:25:49 -04:00
Clinton Wolfe
c6d355e4f7 Accept version 1.2 for config file format
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:25:49 -04:00
Chef Expeditor
4a515e5010
Bump version to 4.14.3 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-28 17:14:05 +00:00
Clinton Wolfe
e346b16114 Tighten help listing assertion and adjust chomp
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:03:42 -04:00
Clinton Wolfe
296158c447 Implementation and functional tests for the --input CLI option
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:03:42 -04:00
Clinton Wolfe
512189a06b Add CLI option and check in help
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 12:53:27 -04:00
Clinton Wolfe
7c2e1dfce2 Add explanatory comment
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:43:35 -04:00
Clinton Wolfe
ac78ecd5ae Swap actual and expected in a test file
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
54f1011f7a Linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
d7750054c8 Move sindows skip lines to be below test execution per rdavis
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
9e4ace6799 Go ahead and refactor the fillter predicates
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
d1a42b8059 filter was introduced in ruby 2.6
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
f44c7bcdcd Convert the plugin name to a string only once when guessing at versions
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
1b7a8f3888 Make const in test file
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
28f747ebbb Interpolation
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
8d80c89e56 Make install types and labels constant
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
f962ef2662 Simplify sort for list output
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
3cd6eee016 Add valid_plugin_name? predicate and push exclusion list check into its own method
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
16fecbefb5 Return version number when listing plugins; correct UX coloration
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
e1031cc818 Correct newlines and duplicate output ins various UX messaging
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
cc758c7624 Linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
f0aa934ddc List tests pass again, adding filtering options
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
8cab0e862b Adopt the new UI style table, breaking most of the UI tests, which were already broken anyway
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
68329aa8e5 Linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:28:52 -04:00
Clinton Wolfe
e581245391 Plausible implementation of detect_system_plugins
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:28:52 -04:00
Clinton Wolfe
00b2d9480a Rename constant for user gem installs for clarity
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:28:52 -04:00
Clinton Wolfe
149663ba55 Updated messaging for user gem plugins
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:28:52 -04:00
Clinton Wolfe
4211d3eb7c Failing functional tests for listing plugin gems
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:26:49 -04:00
Clinton Wolfe
e90482e955 Refactor train plugin decoration
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:26:49 -04:00
Chef Expeditor
ba64d06ef7
Bump version to 4.14.2 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-28 00:03:34 +00:00
Clinton Wolfe
f90a4c633d
Merge pull request #4419 from inspec/cw/check-enforce-version
inspec check: warn if inspec_version is not supported by current inspec
2019-08-27 20:03:19 -04:00
Chef Expeditor
d2dd311561
Bump version to 4.14.1 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-27 23:54:27 +00:00
Chef Expeditor
9b84b7b5c1
Bump version to 4.14.0 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-08-27 20:35:09 +00:00
Clinton Wolfe
12c7c51fea Warn not error
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-26 23:29:19 -04:00