<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby-gems/hashie.git/lib/hashie/extensions/strict_key_access.rb, branch master</title>
<subtitle>github.com: intridea/hashie
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/hashie.git/'/>
<entry>
<title>Change rubocop to allow 100 character lines.</title>
<updated>2019-10-18T03:55:45+00:00</updated>
<author>
<name>Bobby McDonald</name>
<email>bobbymcwho@gmail.com</email>
</author>
<published>2019-10-18T03:51:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/hashie.git/commit/?id=6a965273845f64605e0e951ac113a4383f7e8af5'/>
<id>6a965273845f64605e0e951ac113a4383f7e8af5</id>
<content type='text'>
For accessibility reasons, we should limit our lines to 100 chars max.
https://github.com/slack-ruby/slack-ruby-client/pull/293#discussion_r309472083
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For accessibility reasons, we should limit our lines to 100 chars max.
https://github.com/slack-ruby/slack-ruby-client/pull/293#discussion_r309472083
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubocop] Improve our RuboCop setup</title>
<updated>2018-09-30T19:59:58+00:00</updated>
<author>
<name>Michael Herold</name>
<email>opensource@michaeljherold.com</email>
</author>
<published>2018-09-30T19:07:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/hashie.git/commit/?id=5b5ed2119d63295fb180ecf1872b9e70e389c831'/>
<id>5b5ed2119d63295fb180ecf1872b9e70e389c831</id>
<content type='text'>
Disable Metrics/BlockLength in specs because the length of a block in
the test suite isn't something we want to lint. We want the tests to be
as long as they need to be.

Set an explicit line length metric instead of continually updating this
as we go. Let's pick a max line length that we want to see and stick
with it. This metric should only ever decrease: we don't want to see it
ever increase again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Disable Metrics/BlockLength in specs because the length of a block in
the test suite isn't something we want to lint. We want the tests to be
as long as they need to be.

Set an explicit line length metric instead of continually updating this
as we go. Let's pick a max line length that we want to see and stick
with it. This metric should only ever decrease: we don't want to see it
ever increase again.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update Rubocop and address the addressable todos</title>
<updated>2018-06-17T16:04:56+00:00</updated>
<author>
<name>Michael Herold</name>
<email>michael.j.herold@gmail.com</email>
</author>
<published>2018-02-03T16:23:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/hashie.git/commit/?id=5a6ffc7e2df076c266c322ae9272b098b3ab40ed'/>
<id>5a6ffc7e2df076c266c322ae9272b098b3ab40ed</id>
<content type='text'>
This is a big step forward in our Rubocop setup. I addressed all of the todos
from the current version of Rubocop that made sense to. The only things that
remain are metrics and one cop that relies on the line length metric to work.

I made some judgment calls on disabling a few cops:

1. The `Layout/IndentHeredoc` cop wants you to either use the squiggly heredoc
   from Ruby 2.3 or introduce a library. Since we are a low-level library that
   is used as a transitive dependency, we cannot introduce another library as a
   dependence, so that option is out. Also, we support Rubies back to 2.0
   currently, so using the squiggly heredoc isn't an option. Once we remove
   support for Rubies older than 2.3, we can switch to the squiggly heredoc cop.
2. The `Naming/FileName` cop was reporting false positives for a few files in
   the repository, so I disabled it on those files.
3. The `Style/DoubleNegation` cop reports lints on a few cases where we use
   double negation. Given the very generic nature of Hashie, the double-negation
   is the easiest, clearest way to express that we want an item to be a Boolean.
   I disabled the cop because we exist in the gray area where this makes sense.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a big step forward in our Rubocop setup. I addressed all of the todos
from the current version of Rubocop that made sense to. The only things that
remain are metrics and one cop that relies on the line length metric to work.

I made some judgment calls on disabling a few cops:

1. The `Layout/IndentHeredoc` cop wants you to either use the squiggly heredoc
   from Ruby 2.3 or introduce a library. Since we are a low-level library that
   is used as a transitive dependency, we cannot introduce another library as a
   dependence, so that option is out. Also, we support Rubies back to 2.0
   currently, so using the squiggly heredoc isn't an option. Once we remove
   support for Rubies older than 2.3, we can switch to the squiggly heredoc cop.
2. The `Naming/FileName` cop was reporting false positives for a few files in
   the repository, so I disabled it on those files.
3. The `Style/DoubleNegation` cop reports lints on a few cases where we use
   double negation. Given the very generic nature of Hashie, the double-negation
   is the easiest, clearest way to express that we want an item to be a Boolean.
   I disabled the cop because we exist in the gray area where this makes sense.
</pre>
</div>
</content>
</entry>
<entry>
<title>- Removed `Hashie::Extensions::MergeInitializer` from `StrictKeyAccess` Extension</title>
<updated>2015-10-24T21:42:11+00:00</updated>
<author>
<name>Peter Boling</name>
<email>peter.boling@gmail.com</email>
</author>
<published>2015-10-24T20:00:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/hashie.git/commit/?id=164c31fb5bd90cdab35b004b2cdcb35e810b0451'/>
<id>164c31fb5bd90cdab35b004b2cdcb35e810b0451</id>
<content type='text'>
- Updated, and enhanced specs
- Improved documentation
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Updated, and enhanced specs
- Improved documentation
</pre>
</div>
</content>
</entry>
<entry>
<title>SRP: The StrictKeyAccess extension will raise an error whenever a key is accessed that does not exist in the hash.</title>
<updated>2015-10-23T16:53:42+00:00</updated>
<author>
<name>Peter Boling</name>
<email>peter.boling@gmail.com</email>
</author>
<published>2015-10-23T16:53:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/hashie.git/commit/?id=61b76fab81f9b876a3bdd7239b8509d2b69dd625'/>
<id>61b76fab81f9b876a3bdd7239b8509d2b69dd625</id>
<content type='text'>
In Python a "Hash" is called a "Dictionary", and ...

&gt; "It is an error to extract a value using a non-existent key."

See: https://docs.python.org/2/tutorial/datastructures.html#dictionaries

EXAMPLE:

    class StrictHash &lt; Hash
      include Hashie::Extensions::StrictKeyAccess
    end
    &gt;&gt; hash = StrictHash[foo: "bar"]
    =&gt; {:foo=&gt;"bar"}
    &gt;&gt; hash[:foo]
    =&gt; "bar"
    &gt;&gt; hash[:cow]
      KeyError: key not found: :cow
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Python a "Hash" is called a "Dictionary", and ...

&gt; "It is an error to extract a value using a non-existent key."

See: https://docs.python.org/2/tutorial/datastructures.html#dictionaries

EXAMPLE:

    class StrictHash &lt; Hash
      include Hashie::Extensions::StrictKeyAccess
    end
    &gt;&gt; hash = StrictHash[foo: "bar"]
    =&gt; {:foo=&gt;"bar"}
    &gt;&gt; hash[:foo]
    =&gt; "bar"
    &gt;&gt; hash[:cow]
      KeyError: key not found: :cow
</pre>
</div>
</content>
</entry>
</feed>
