inspecstyle 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/config/default.yml +7 -0
  3. data/doc/RuboCop.html +3 -3
  4. data/doc/RuboCop/Cop.html +3 -3
  5. data/doc/RuboCop/Cop/InSpecStyle.html +4 -4
  6. data/doc/RuboCop/Cop/InSpecStyle/Apache.html +306 -0
  7. data/doc/RuboCop/Cop/InSpecStyle/AwsIamUserProperty.html +358 -0
  8. data/doc/RuboCop/Cop/InSpecStyle/AzureGenericResource.html +6 -5
  9. data/doc/RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html +3 -2
  10. data/doc/RuboCop/Cop/InSpecStyle/DeprecatedAttributes1.html +311 -0
  11. data/doc/RuboCop/Cop/InSpecStyle/FileBeMounted.html +250 -0
  12. data/doc/RuboCop/Cop/InSpecStyle/FileSize.html +315 -0
  13. data/doc/RuboCop/Cop/InSpecStyle/HostProto.html +315 -0
  14. data/doc/RuboCop/Cop/InSpecStyle/IisWebsite.html +294 -0
  15. data/doc/RuboCop/Cop/InSpecStyle/LinuxKernelParameter.html +296 -0
  16. data/doc/RuboCop/Cop/InSpecStyle/MSSQLSessionPass.html +319 -0
  17. data/doc/RuboCop/Cop/InSpecStyle/OracleDbSessionPass.html +319 -0
  18. data/doc/RuboCop/Cop/InSpecStyle/PPAResource.html +294 -0
  19. data/doc/RuboCop/Cop/InSpecStyle/ProcessesList.html +315 -0
  20. data/doc/RuboCop/Cop/InSpecStyle/ScriptResource.html +298 -0
  21. data/doc/RuboCop/Cop/InSpecStyle/ShadowProperties.html +334 -0
  22. data/doc/RuboCop/Cop/InSpecStyle/UsersResourceMatchers.html +357 -0
  23. data/doc/RuboCop/Cop/InSpecStyle/WindowsRegistryKey.html +294 -0
  24. data/doc/RuboCop/Cop/InSpecStyle/WmiWmisClass.html +294 -0
  25. data/doc/RuboCop/InSpecStyle.html +2 -2
  26. data/doc/RuboCop/InSpecStyle/Error.html +1 -1
  27. data/doc/RuboCop/InSpecStyle/Inject.html +1 -1
  28. data/doc/_index.html +181 -2
  29. data/doc/class_list.html +1 -1
  30. data/doc/file.README.html +24 -2
  31. data/doc/index.html +24 -2
  32. data/doc/method_list.html +254 -6
  33. data/doc/top-level-namespace.html +1 -1
  34. data/lib/rubocop/cop/inspecstyle/deprecated_attributes1.rb +52 -0
  35. data/lib/rubocop/cop/inspecstyle_cops.rb +2 -1
  36. data/lib/rubocop/inspecstyle/version.rb +1 -1
  37. metadata +20 -2
@@ -43,7 +43,7 @@
43
43
 
44
44
  <ul id="full_list" class="class">
45
45
  <li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
46
- <li id='object_RuboCop' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop.html" title="RuboCop (module)">RuboCop</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_RuboCop::Cop' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop/Cop.html" title="RuboCop::Cop (module)">Cop</a></span><small class='search_info'>RuboCop</small></div><ul><li id='object_RuboCop::Cop::InSpecStyle' class='collapsed'><div class='item' style='padding-left:60px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop/Cop/InSpecStyle.html" title="RuboCop::Cop::InSpecStyle (module)">InSpecStyle</a></span><small class='search_info'>RuboCop::Cop</small></div><ul><li id='object_RuboCop::Cop::InSpecStyle::AzureGenericResource' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/AzureGenericResource.html" title="RuboCop::Cop::InSpecStyle::AzureGenericResource (class)">AzureGenericResource</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::DeprecatedAttributes' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes (class)">DeprecatedAttributes</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::FirstCop' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FirstCop.html" title="RuboCop::Cop::InSpecStyle::FirstCop (class)">FirstCop</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li></ul></li></ul></li><li id='object_RuboCop::InSpecStyle' class='collapsed even'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop/InSpecStyle.html" title="RuboCop::InSpecStyle (module)">InSpecStyle</a></span><small class='search_info'>RuboCop</small></div><ul><li id='object_RuboCop::InSpecStyle::Error' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="RuboCop/InSpecStyle/Error.html" title="RuboCop::InSpecStyle::Error (class)">Error</a></span> &lt; StandardError<small class='search_info'>RuboCop::InSpecStyle</small></div></li><li id='object_RuboCop::InSpecStyle::Inject' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="RuboCop/InSpecStyle/Inject.html" title="RuboCop::InSpecStyle::Inject (module)">Inject</a></span><small class='search_info'>RuboCop::InSpecStyle</small></div></li></ul></li></ul></li>
46
+ <li id='object_RuboCop' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop.html" title="RuboCop (module)">RuboCop</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_RuboCop::Cop' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop/Cop.html" title="RuboCop::Cop (module)">Cop</a></span><small class='search_info'>RuboCop</small></div><ul><li id='object_RuboCop::Cop::InSpecStyle' class='collapsed'><div class='item' style='padding-left:60px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop/Cop/InSpecStyle.html" title="RuboCop::Cop::InSpecStyle (module)">InSpecStyle</a></span><small class='search_info'>RuboCop::Cop</small></div><ul><li id='object_RuboCop::Cop::InSpecStyle::Apache' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/Apache.html" title="RuboCop::Cop::InSpecStyle::Apache (class)">Apache</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::AwsIamUserProperty' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/AwsIamUserProperty.html" title="RuboCop::Cop::InSpecStyle::AwsIamUserProperty (class)">AwsIamUserProperty</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::AzureGenericResource' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/AzureGenericResource.html" title="RuboCop::Cop::InSpecStyle::AzureGenericResource (class)">AzureGenericResource</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::DeprecatedAttributes' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes (class)">DeprecatedAttributes</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::DeprecatedAttributes1' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes1.html" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes1 (class)">DeprecatedAttributes1</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::FileBeMounted' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FileBeMounted.html" title="RuboCop::Cop::InSpecStyle::FileBeMounted (class)">FileBeMounted</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::FileSize' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FileSize.html" title="RuboCop::Cop::InSpecStyle::FileSize (class)">FileSize</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::HostProto' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/HostProto.html" title="RuboCop::Cop::InSpecStyle::HostProto (class)">HostProto</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::IisWebsite' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/IisWebsite.html" title="RuboCop::Cop::InSpecStyle::IisWebsite (class)">IisWebsite</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::LinuxKernelParameter' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/LinuxKernelParameter.html" title="RuboCop::Cop::InSpecStyle::LinuxKernelParameter (class)">LinuxKernelParameter</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::MSSQLSessionPass' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/MSSQLSessionPass.html" title="RuboCop::Cop::InSpecStyle::MSSQLSessionPass (class)">MSSQLSessionPass</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::OracleDbSessionPass' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/OracleDbSessionPass.html" title="RuboCop::Cop::InSpecStyle::OracleDbSessionPass (class)">OracleDbSessionPass</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::PPAResource' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/PPAResource.html" title="RuboCop::Cop::InSpecStyle::PPAResource (class)">PPAResource</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::ProcessesList' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ProcessesList.html" title="RuboCop::Cop::InSpecStyle::ProcessesList (class)">ProcessesList</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::ScriptResource' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ScriptResource.html" title="RuboCop::Cop::InSpecStyle::ScriptResource (class)">ScriptResource</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::ShadowProperties' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ShadowProperties.html" title="RuboCop::Cop::InSpecStyle::ShadowProperties (class)">ShadowProperties</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::UsersResourceMatchers' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/UsersResourceMatchers.html" title="RuboCop::Cop::InSpecStyle::UsersResourceMatchers (class)">UsersResourceMatchers</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::WindowsRegistryKey' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/WindowsRegistryKey.html" title="RuboCop::Cop::InSpecStyle::WindowsRegistryKey (class)">WindowsRegistryKey</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li><li id='object_RuboCop::Cop::InSpecStyle::WmiWmisClass' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="RuboCop/Cop/InSpecStyle/WmiWmisClass.html" title="RuboCop::Cop::InSpecStyle::WmiWmisClass (class)">WmiWmisClass</a></span> &lt; Cop<small class='search_info'>RuboCop::Cop::InSpecStyle</small></div></li></ul></li></ul></li><li id='object_RuboCop::InSpecStyle' class='collapsed even'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="RuboCop/InSpecStyle.html" title="RuboCop::InSpecStyle (module)">InSpecStyle</a></span><small class='search_info'>RuboCop</small></div><ul><li id='object_RuboCop::InSpecStyle::Error' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="RuboCop/InSpecStyle/Error.html" title="RuboCop::InSpecStyle::Error (class)">Error</a></span> &lt; StandardError<small class='search_info'>RuboCop::InSpecStyle</small></div></li><li id='object_RuboCop::InSpecStyle::Inject' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="RuboCop/InSpecStyle/Inject.html" title="RuboCop::InSpecStyle::Inject (module)">Inject</a></span><small class='search_info'>RuboCop::InSpecStyle</small></div></li></ul></li></ul></li>
47
47
 
48
48
  </ul>
49
49
  </div>
@@ -58,11 +58,15 @@
58
58
  </div>
59
59
 
60
60
  <div id="content"><div id='filecontents'>
61
+ <h1 id="label-WIP-3A+This+gem+is+not+live-2C+but+we+would+love+your+help+and+input-21+Core+issue+here-3A+https-3A-2F-2Fgithub.com-2Finspec-2Finspec-2Fissues-2F5095">WIP: This gem is <strong>not</strong> live, but we would love your help and input! Core issue here: <a href="https://github.com/inspec/inspec/issues/5095">github.com/inspec/inspec/issues/5095</a></h1>
62
+
61
63
  <h1 id="label-InSpecStyle">InSpecStyle</h1>
62
64
 
63
65
  <p>Welcome to your new gem! In this directory, you&#39;ll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file <code>lib/rubocop/inspecstyle</code>. To experiment with that code, run <code>bin/console</code> for an interactive prompt.</p>
64
66
 
65
- <p>TODO: Delete this and the text above, and describe your gem</p>
67
+ <h2 id="label-Full+Documentation">Full Documentation</h2>
68
+
69
+ <p><a href="https://rubydoc.info/gems/inspecstyle">rubydoc.info/gems/inspecstyle</a></p>
66
70
 
67
71
  <h2 id="label-Installation">Installation</h2>
68
72
 
@@ -99,8 +103,26 @@ require:
99
103
  <h2 id="label-TODO-3A">TODO:</h2>
100
104
  <ul><li>
101
105
  <p>Instead of referencing issues in the cops, point to a general <code>inspecstyle.guide</code></p>
106
+ </li><li>
107
+ <p>Known issue, resources that work on manual runs but not in <code>atom</code> package: [</p>
108
+ </li><li>
109
+ <p>AzureGenericResource ]</p>
110
+ </li><li>
111
+ <p>Cop ideas: “<code> its(&#39;minimum_days_between_password_change&#39;) { should eq 0 } becomes &#39;mindays&#39; its(&#39;maximum_days_between_password_change&#39;) { should eq 0 } becomes &#39;maxdays&#39; Inspec.deprecate(:resource_user_serverspec_compat, &quot;The user resource</code>has_home_directory?<code>matcher is deprecated. Please use</code>its(&#39;home&#39;)<code>.&quot;) Inspec.deprecate(:resource_user_serverspec_compat, &quot;The user resource</code>has_authorized_key?` matcher is deprecated. There is no currently implemented alternative“)</p>
102
112
  </li></ul>
103
113
 
114
+ <p>shadow resource deprecations (e.g.) describe shadow(&#39;/etc/my-custom-place/shadow&#39;) do its(&#39;count&#39;) { should eq 32 } end</p>
115
+
116
+ <p>property deprecations:</p>
117
+
118
+ <p>user -&gt; users password -&gt; passwords last_change -&gt; last_changes expiry_date -&gt; expiry_dates lines (no replacement)</p>
119
+
120
+ <p>e.g.</p>
121
+
122
+ <p>sql = oracledb_session(user: &#39;my_user&#39;, pass: &#39;password&#39;) describe sql.query(&quot;SELECT UPPER(VALUE) AS VALUE FROM V$PARAMETER WHERE UPPER(NAME)=&#39;AUDIT_SYS_OPERATIONS&#39;&quot;).row(0).column(&#39;value&#39;) do its(&#39;value&#39;) { should eq &#39;TRUE&#39; } end</p>
123
+
124
+ <p>oracledb_session deprecated <code>pass</code>, use <code>password</code> instead “`</p>
125
+
104
126
  <h2 id="label-Development">Development</h2>
105
127
 
106
128
  <p>After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run <code>rake test</code> to run the tests. You can also run <code>bin/console</code> for an interactive prompt that will allow you to experiment.</p>
@@ -121,7 +143,7 @@ require:
121
143
  </div></div>
122
144
 
123
145
  <div id="footer">
124
- Generated on Thu Jun 11 11:57:48 2020 by
146
+ Generated on Thu Jul 2 15:33:00 2020 by
125
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
148
  0.9.25 (ruby-2.6.6).
127
149
  </div>
@@ -58,11 +58,15 @@
58
58
  </div>
59
59
 
60
60
  <div id="content"><div id='filecontents'>
61
+ <h1 id="label-WIP-3A+This+gem+is+not+live-2C+but+we+would+love+your+help+and+input-21+Core+issue+here-3A+https-3A-2F-2Fgithub.com-2Finspec-2Finspec-2Fissues-2F5095">WIP: This gem is <strong>not</strong> live, but we would love your help and input! Core issue here: <a href="https://github.com/inspec/inspec/issues/5095">github.com/inspec/inspec/issues/5095</a></h1>
62
+
61
63
  <h1 id="label-InSpecStyle">InSpecStyle</h1>
62
64
 
63
65
  <p>Welcome to your new gem! In this directory, you&#39;ll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file <code>lib/rubocop/inspecstyle</code>. To experiment with that code, run <code>bin/console</code> for an interactive prompt.</p>
64
66
 
65
- <p>TODO: Delete this and the text above, and describe your gem</p>
67
+ <h2 id="label-Full+Documentation">Full Documentation</h2>
68
+
69
+ <p><a href="https://rubydoc.info/gems/inspecstyle">rubydoc.info/gems/inspecstyle</a></p>
66
70
 
67
71
  <h2 id="label-Installation">Installation</h2>
68
72
 
@@ -99,8 +103,26 @@ require:
99
103
  <h2 id="label-TODO-3A">TODO:</h2>
100
104
  <ul><li>
101
105
  <p>Instead of referencing issues in the cops, point to a general <code>inspecstyle.guide</code></p>
106
+ </li><li>
107
+ <p>Known issue, resources that work on manual runs but not in <code>atom</code> package: [</p>
108
+ </li><li>
109
+ <p>AzureGenericResource ]</p>
110
+ </li><li>
111
+ <p>Cop ideas: “<code> its(&#39;minimum_days_between_password_change&#39;) { should eq 0 } becomes &#39;mindays&#39; its(&#39;maximum_days_between_password_change&#39;) { should eq 0 } becomes &#39;maxdays&#39; Inspec.deprecate(:resource_user_serverspec_compat, &quot;The user resource</code>has_home_directory?<code>matcher is deprecated. Please use</code>its(&#39;home&#39;)<code>.&quot;) Inspec.deprecate(:resource_user_serverspec_compat, &quot;The user resource</code>has_authorized_key?` matcher is deprecated. There is no currently implemented alternative“)</p>
102
112
  </li></ul>
103
113
 
114
+ <p>shadow resource deprecations (e.g.) describe shadow(&#39;/etc/my-custom-place/shadow&#39;) do its(&#39;count&#39;) { should eq 32 } end</p>
115
+
116
+ <p>property deprecations:</p>
117
+
118
+ <p>user -&gt; users password -&gt; passwords last_change -&gt; last_changes expiry_date -&gt; expiry_dates lines (no replacement)</p>
119
+
120
+ <p>e.g.</p>
121
+
122
+ <p>sql = oracledb_session(user: &#39;my_user&#39;, pass: &#39;password&#39;) describe sql.query(&quot;SELECT UPPER(VALUE) AS VALUE FROM V$PARAMETER WHERE UPPER(NAME)=&#39;AUDIT_SYS_OPERATIONS&#39;&quot;).row(0).column(&#39;value&#39;) do its(&#39;value&#39;) { should eq &#39;TRUE&#39; } end</p>
123
+
124
+ <p>oracledb_session deprecated <code>pass</code>, use <code>password</code> instead “`</p>
125
+
104
126
  <h2 id="label-Development">Development</h2>
105
127
 
106
128
  <p>After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run <code>rake test</code> to run the tests. You can also run <code>bin/console</code> for an interactive prompt that will allow you to experiment.</p>
@@ -121,7 +143,7 @@ require:
121
143
  </div></div>
122
144
 
123
145
  <div id="footer">
124
- Generated on Thu Jun 11 11:57:48 2020 by
146
+ Generated on Thu Jul 2 15:33:00 2020 by
125
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
148
  0.9.25 (ruby-2.6.6).
127
149
  </div>
@@ -46,8 +46,72 @@
46
46
 
47
47
  <li class="odd ">
48
48
  <div class="item">
49
- <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FirstCop.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::FirstCop#autocorrect (method)">#autocorrect</a></span>
50
- <small>RuboCop::Cop::InSpecStyle::FirstCop</small>
49
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ShadowProperties.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::ShadowProperties#autocorrect (method)">#autocorrect</a></span>
50
+ <small>RuboCop::Cop::InSpecStyle::ShadowProperties</small>
51
+ </div>
52
+ </li>
53
+
54
+
55
+ <li class="even ">
56
+ <div class="item">
57
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/UsersResourceMatchers.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::UsersResourceMatchers#autocorrect (method)">#autocorrect</a></span>
58
+ <small>RuboCop::Cop::InSpecStyle::UsersResourceMatchers</small>
59
+ </div>
60
+ </li>
61
+
62
+
63
+ <li class="odd ">
64
+ <div class="item">
65
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/Apache.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::Apache#autocorrect (method)">#autocorrect</a></span>
66
+ <small>RuboCop::Cop::InSpecStyle::Apache</small>
67
+ </div>
68
+ </li>
69
+
70
+
71
+ <li class="even ">
72
+ <div class="item">
73
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/OracleDbSessionPass.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::OracleDbSessionPass#autocorrect (method)">#autocorrect</a></span>
74
+ <small>RuboCop::Cop::InSpecStyle::OracleDbSessionPass</small>
75
+ </div>
76
+ </li>
77
+
78
+
79
+ <li class="odd ">
80
+ <div class="item">
81
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FileSize.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::FileSize#autocorrect (method)">#autocorrect</a></span>
82
+ <small>RuboCop::Cop::InSpecStyle::FileSize</small>
83
+ </div>
84
+ </li>
85
+
86
+
87
+ <li class="even ">
88
+ <div class="item">
89
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/LinuxKernelParameter.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::LinuxKernelParameter#autocorrect (method)">#autocorrect</a></span>
90
+ <small>RuboCop::Cop::InSpecStyle::LinuxKernelParameter</small>
91
+ </div>
92
+ </li>
93
+
94
+
95
+ <li class="odd ">
96
+ <div class="item">
97
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/HostProto.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::HostProto#autocorrect (method)">#autocorrect</a></span>
98
+ <small>RuboCop::Cop::InSpecStyle::HostProto</small>
99
+ </div>
100
+ </li>
101
+
102
+
103
+ <li class="even ">
104
+ <div class="item">
105
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes1.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes1#autocorrect (method)">#autocorrect</a></span>
106
+ <small>RuboCop::Cop::InSpecStyle::DeprecatedAttributes1</small>
107
+ </div>
108
+ </li>
109
+
110
+
111
+ <li class="odd ">
112
+ <div class="item">
113
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/IisWebsite.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::IisWebsite#autocorrect (method)">#autocorrect</a></span>
114
+ <small>RuboCop::Cop::InSpecStyle::IisWebsite</small>
51
115
  </div>
52
116
  </li>
53
117
 
@@ -61,6 +125,62 @@
61
125
 
62
126
 
63
127
  <li class="odd ">
128
+ <div class="item">
129
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/PPAResource.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::PPAResource#autocorrect (method)">#autocorrect</a></span>
130
+ <small>RuboCop::Cop::InSpecStyle::PPAResource</small>
131
+ </div>
132
+ </li>
133
+
134
+
135
+ <li class="even ">
136
+ <div class="item">
137
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/AwsIamUserProperty.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::AwsIamUserProperty#autocorrect (method)">#autocorrect</a></span>
138
+ <small>RuboCop::Cop::InSpecStyle::AwsIamUserProperty</small>
139
+ </div>
140
+ </li>
141
+
142
+
143
+ <li class="odd ">
144
+ <div class="item">
145
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ProcessesList.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::ProcessesList#autocorrect (method)">#autocorrect</a></span>
146
+ <small>RuboCop::Cop::InSpecStyle::ProcessesList</small>
147
+ </div>
148
+ </li>
149
+
150
+
151
+ <li class="even ">
152
+ <div class="item">
153
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/WindowsRegistryKey.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::WindowsRegistryKey#autocorrect (method)">#autocorrect</a></span>
154
+ <small>RuboCop::Cop::InSpecStyle::WindowsRegistryKey</small>
155
+ </div>
156
+ </li>
157
+
158
+
159
+ <li class="odd ">
160
+ <div class="item">
161
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/WmiWmisClass.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::WmiWmisClass#autocorrect (method)">#autocorrect</a></span>
162
+ <small>RuboCop::Cop::InSpecStyle::WmiWmisClass</small>
163
+ </div>
164
+ </li>
165
+
166
+
167
+ <li class="even ">
168
+ <div class="item">
169
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/MSSQLSessionPass.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::MSSQLSessionPass#autocorrect (method)">#autocorrect</a></span>
170
+ <small>RuboCop::Cop::InSpecStyle::MSSQLSessionPass</small>
171
+ </div>
172
+ </li>
173
+
174
+
175
+ <li class="odd ">
176
+ <div class="item">
177
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ScriptResource.html#autocorrect-instance_method" title="RuboCop::Cop::InSpecStyle::ScriptResource#autocorrect (method)">#autocorrect</a></span>
178
+ <small>RuboCop::Cop::InSpecStyle::ScriptResource</small>
179
+ </div>
180
+ </li>
181
+
182
+
183
+ <li class="even ">
64
184
  <div class="item">
65
185
  <span class='object_link'><a href="RuboCop/InSpecStyle/Inject.html#defaults!-class_method" title="RuboCop::InSpecStyle::Inject.defaults! (method)">defaults!</a></span>
66
186
  <small>RuboCop::InSpecStyle::Inject</small>
@@ -68,18 +188,58 @@
68
188
  </li>
69
189
 
70
190
 
191
+ <li class="odd ">
192
+ <div class="item">
193
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/AwsIamUserProperty.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::AwsIamUserProperty#on_block (method)">#on_block</a></span>
194
+ <small>RuboCop::Cop::InSpecStyle::AwsIamUserProperty</small>
195
+ </div>
196
+ </li>
197
+
198
+
71
199
  <li class="even ">
72
200
  <div class="item">
73
- <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FirstCop.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::FirstCop#on_send (method)">#on_send</a></span>
74
- <small>RuboCop::Cop::InSpecStyle::FirstCop</small>
201
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ProcessesList.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::ProcessesList#on_block (method)">#on_block</a></span>
202
+ <small>RuboCop::Cop::InSpecStyle::ProcessesList</small>
75
203
  </div>
76
204
  </li>
77
205
 
78
206
 
79
207
  <li class="odd ">
80
208
  <div class="item">
81
- <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes#on_send (method)">#on_send</a></span>
82
- <small>RuboCop::Cop::InSpecStyle::DeprecatedAttributes</small>
209
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/HostProto.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::HostProto#on_block (method)">#on_block</a></span>
210
+ <small>RuboCop::Cop::InSpecStyle::HostProto</small>
211
+ </div>
212
+ </li>
213
+
214
+
215
+ <li class="even ">
216
+ <div class="item">
217
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FileBeMounted.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::FileBeMounted#on_block (method)">#on_block</a></span>
218
+ <small>RuboCop::Cop::InSpecStyle::FileBeMounted</small>
219
+ </div>
220
+ </li>
221
+
222
+
223
+ <li class="odd ">
224
+ <div class="item">
225
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/FileSize.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::FileSize#on_block (method)">#on_block</a></span>
226
+ <small>RuboCop::Cop::InSpecStyle::FileSize</small>
227
+ </div>
228
+ </li>
229
+
230
+
231
+ <li class="even ">
232
+ <div class="item">
233
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/UsersResourceMatchers.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::UsersResourceMatchers#on_block (method)">#on_block</a></span>
234
+ <small>RuboCop::Cop::InSpecStyle::UsersResourceMatchers</small>
235
+ </div>
236
+ </li>
237
+
238
+
239
+ <li class="odd ">
240
+ <div class="item">
241
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ShadowProperties.html#on_block-instance_method" title="RuboCop::Cop::InSpecStyle::ShadowProperties#on_block (method)">#on_block</a></span>
242
+ <small>RuboCop::Cop::InSpecStyle::ShadowProperties</small>
83
243
  </div>
84
244
  </li>
85
245
 
@@ -92,6 +252,94 @@
92
252
  </li>
93
253
 
94
254
 
255
+ <li class="odd ">
256
+ <div class="item">
257
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes1.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes1#on_send (method)">#on_send</a></span>
258
+ <small>RuboCop::Cop::InSpecStyle::DeprecatedAttributes1</small>
259
+ </div>
260
+ </li>
261
+
262
+
263
+ <li class="even ">
264
+ <div class="item">
265
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/IisWebsite.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::IisWebsite#on_send (method)">#on_send</a></span>
266
+ <small>RuboCop::Cop::InSpecStyle::IisWebsite</small>
267
+ </div>
268
+ </li>
269
+
270
+
271
+ <li class="odd ">
272
+ <div class="item">
273
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/LinuxKernelParameter.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::LinuxKernelParameter#on_send (method)">#on_send</a></span>
274
+ <small>RuboCop::Cop::InSpecStyle::LinuxKernelParameter</small>
275
+ </div>
276
+ </li>
277
+
278
+
279
+ <li class="even ">
280
+ <div class="item">
281
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/OracleDbSessionPass.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::OracleDbSessionPass#on_send (method)">#on_send</a></span>
282
+ <small>RuboCop::Cop::InSpecStyle::OracleDbSessionPass</small>
283
+ </div>
284
+ </li>
285
+
286
+
287
+ <li class="odd ">
288
+ <div class="item">
289
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/Apache.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::Apache#on_send (method)">#on_send</a></span>
290
+ <small>RuboCop::Cop::InSpecStyle::Apache</small>
291
+ </div>
292
+ </li>
293
+
294
+
295
+ <li class="even ">
296
+ <div class="item">
297
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/ScriptResource.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::ScriptResource#on_send (method)">#on_send</a></span>
298
+ <small>RuboCop::Cop::InSpecStyle::ScriptResource</small>
299
+ </div>
300
+ </li>
301
+
302
+
303
+ <li class="odd ">
304
+ <div class="item">
305
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/MSSQLSessionPass.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::MSSQLSessionPass#on_send (method)">#on_send</a></span>
306
+ <small>RuboCop::Cop::InSpecStyle::MSSQLSessionPass</small>
307
+ </div>
308
+ </li>
309
+
310
+
311
+ <li class="even ">
312
+ <div class="item">
313
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/WindowsRegistryKey.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::WindowsRegistryKey#on_send (method)">#on_send</a></span>
314
+ <small>RuboCop::Cop::InSpecStyle::WindowsRegistryKey</small>
315
+ </div>
316
+ </li>
317
+
318
+
319
+ <li class="odd ">
320
+ <div class="item">
321
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/WmiWmisClass.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::WmiWmisClass#on_send (method)">#on_send</a></span>
322
+ <small>RuboCop::Cop::InSpecStyle::WmiWmisClass</small>
323
+ </div>
324
+ </li>
325
+
326
+
327
+ <li class="even ">
328
+ <div class="item">
329
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes#on_send (method)">#on_send</a></span>
330
+ <small>RuboCop::Cop::InSpecStyle::DeprecatedAttributes</small>
331
+ </div>
332
+ </li>
333
+
334
+
335
+ <li class="odd ">
336
+ <div class="item">
337
+ <span class='object_link'><a href="RuboCop/Cop/InSpecStyle/PPAResource.html#on_send-instance_method" title="RuboCop::Cop::InSpecStyle::PPAResource#on_send (method)">#on_send</a></span>
338
+ <small>RuboCop::Cop::InSpecStyle::PPAResource</small>
339
+ </div>
340
+ </li>
341
+
342
+
95
343
 
96
344
  </ul>
97
345
  </div>
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Thu Jun 11 11:57:48 2020 by
103
+ Generated on Thu Jul 2 15:33:00 2020 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.25 (ruby-2.6.6).
106
106
  </div>
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module InSpecStyle
6
+ # Checks if deprecated method attribute1 is used.
7
+ #
8
+ # @example EnforcedStyle: InSpecStyle (default)
9
+ # # Attributes have been deprecated for inputs
10
+ # # https://github.com/inspec/inspec/issues/3802
11
+ #
12
+ # # bad
13
+ # attribute1('my_element', value: 10)
14
+ #
15
+ # # good
16
+ # input('my_element', value: 10)
17
+ #
18
+ class DeprecatedAttributes1 < Cop
19
+ include RangeHelp
20
+
21
+ MSG = 'Use `#input` instead of `#attribute1`. This will be removed in '\
22
+ 'InSpec 5'
23
+
24
+ def_node_matcher :attribute1?, <<~PATTERN
25
+ (send nil? :attribute1 ...)
26
+ PATTERN
27
+
28
+ def on_send(node)
29
+ return unless attribute1?(node)
30
+
31
+ add_offense(node, location: node.loc.selector)
32
+ end
33
+
34
+ def autocorrect(node)
35
+ lambda do |corrector|
36
+ corrector.replace(offense_range(node), preferred_replacement)
37
+ end
38
+ end
39
+
40
+ private
41
+
42
+ def offense_range(node)
43
+ node.loc.selector
44
+ end
45
+
46
+ def preferred_replacement
47
+ cop_config.fetch('PreferredReplacement')
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end