Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kamipo committed Aug 11, 2021
1 parent 4cd3b31 commit 9c2c0db
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 39 deletions.
26 changes: 13 additions & 13 deletions CHANGELOG.md
Expand Up @@ -175,13 +175,13 @@ Remove license from code.

- Fixed issue #569. `:compat` mode not restricts the escape mode as indicated in the documentation.

- Fixed issue #570. In `:strict` mode number parsing follows the JSON specification more closely as indended.
- Fixed issue #570. In `:strict` mode number parsing follows the JSON specification more closely as intended.

- Added `:ignore_under` which when true will ignore attributes that begin with a `_` when dumping in `:object` or `:custom` mode.

## 3.9.2 - 2019-10-01

- Fixed wrong exception type when mimicing the JSON gem.
- Fixed wrong exception type when mimicking the JSON gem.

## 3.9.1 - 2019-08-31

Expand Down Expand Up @@ -225,7 +225,7 @@ Remove license from code.

- Return correct value in `create_opt` C function.

- Return `Oj::ParseError` if an invalid big decimal string is encounted instead of an argument error
- Return `Oj::ParseError` if an invalid big decimal string is encountered instead of an argument error

## 3.7.8 - 2019-01-21

Expand All @@ -251,11 +251,11 @@ Remove license from code.

## 3.7.5 - 2018-12-27

- Address issue #517 with a special escape table for mimicing the JSON gem.
- Address issue #517 with a special escape table for mimicking the JSON gem.

## 3.7.4 - 2018-11-29

- Allow `+` in front of numbers in parse as well as stream parse **EXCEPT** when mimicing the JSON gem.
- Allow `+` in front of numbers in parse as well as stream parse **EXCEPT** when mimicking the JSON gem.

## 3.7.3 - 2018-11-29

Expand Down Expand Up @@ -293,15 +293,15 @@ Remove license from code.

## 3.6.10 - 2018-09-13

- Additional occurances of `SYM2ID(sym)` replaced.
- Additional occurrences of `SYM2ID(sym)` replaced.

## 3.6.9 - 2018-09-12

- `SYM2ID(sym)` causes a memory leak. A work around is now used.

## 3.6.8 - 2018-09-08

- Stopped setting the default options when optimze rails is called as the documentaiton has indicated.
- Stopped setting the default options when optimize rails is called as the documentation has indicated.

- In custom mode `Date` and `DateTime` instances default to use the `:time_format` option is the `:create_additions` option is false.

Expand Down Expand Up @@ -479,7 +479,7 @@ Remove license from code.

- Float significant digits now match Ruby's unless optimized and then significant digits are set to 16.

- Rails Hash post merging of identical keys after calling as_json is preserved only for un-optimized Hashs.
- Rails Hash post merging of identical keys after calling as_json is preserved only for un-optimized Hashes.

- Raise an exception to match json gem behavior on invalid unicode.

Expand Down Expand Up @@ -526,7 +526,7 @@ Remove license from code.

## 3.0.0 - 2017-04-24

- Major changes focussed on json gem and Rails compatibility. A new :custom
- Major changes focused on json gem and Rails compatibility. A new :custom
mode was added as well. Starting with this release the json gem tests are
being used to test the :compat mode and the ActiveSupport 5 tests are being
used to test the :rails mode.
Expand Down Expand Up @@ -705,8 +705,8 @@ Remove license from code.

## 2.12.0 - 2015-03-06

- String formats for UTC time are now explitly UTC instead of offset of zero. This fixes a problem with pre-2.2.0 Rubies that automatically convert zero offset times to local times.
- Added :unix_zone time_format option for formating numeric time. This option is the same as the :unix time option but the UTC offset is included as an exponent to the number time value. A value of 86400 is an indication of UTC time.
- String formats for UTC time are now explicitly UTC instead of offset of zero. This fixes a problem with pre-2.2.0 Rubies that automatically convert zero offset times to local times.
- Added :unix_zone time_format option for formatting numeric time. This option is the same as the :unix time option but the UTC offset is included as an exponent to the number time value. A value of 86400 is an indication of UTC time.

## 2.11.5 - 2015-02-25

Expand Down Expand Up @@ -819,7 +819,7 @@ Remove license from code.

## 2.9.0 - 2014-05-01

- Added support for detection and handling of Strng, Array, and Hash subclasses.
- Added support for detection and handling of String, Array, and Hash subclasses.
- Oj.load() can now take a block which will be yielded to on every object parsed when used with a file or string with multiple JSON entries.

## 2.8.1 - 2014-04-21
Expand Down Expand Up @@ -1057,7 +1057,7 @@ Remove license from code.

## 1.4.4 - 2012-11-07

- Fixed bug in mimic that missed mimicing json_pure.
- Fixed bug in mimic that missed mimicking json_pure.

## 1.4.3 - 2012-10-19

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -53,7 +53,7 @@ For more details on options, modes, advanced features, and more follow these
links.

- [{file:Options.md}](pages/Options.md) for parse and dump options.
- [{file:Modes.md}](pages/Modes.md) for details on modes for strict JSON compliance, mimicing the JSON gem, and mimicing Rails and ActiveSupport behavior.
- [{file:Modes.md}](pages/Modes.md) for details on modes for strict JSON compliance, mimicking the JSON gem, and mimicking Rails and ActiveSupport behavior.
- [{file:JsonGem.md}](pages/JsonGem.md) includes more details on json gem compatibility and use.
- [{file:Rails.md}](pages/Rails.md) includes more details on Rails and ActiveSupport compatibility and use.
- [{file:Custom.md}](pages/Custom.md) includes more details on Custom mode.
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -28,7 +28,7 @@ task :test_all => [:clean, :compile] do
end
exitcode = 1 unless status

# Verifying that json gem tests work for native implemntation for Ruby 2.4.0
# Verifying that json gem tests work for native implementation for Ruby 2.4.0
# and above only. We know the older versions do not pass the 2.4.0 unit
# tests.
if RUBY_VERSION >= '2.4'
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/custom.c
Expand Up @@ -1032,7 +1032,7 @@ static void hash_set_num(struct _parseInfo *pi, Val kval, NumInfo ni) {
}
if (86400 == ni->exp) { // UTC time
parent->val = rb_time_nano_new(ni->i, (long)nsec);
// Since the ruby C routines alway create local time, the
// Since the ruby C routines always create local time, the
// offset and then a conversion to UTC keeps makes the time
// match the expected value.
parent->val = rb_funcall2(parent->val, oj_utc_id, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/fast.c
Expand Up @@ -1472,7 +1472,7 @@ static VALUE doc_move(VALUE self, VALUE str) {
* to the block on yield is the Doc instance after moving to the child
* location.
* @param [String] path if provided it identified the top of the branch to
* process the chilren of
* process the children of
* @yieldparam [Doc] Doc at the child location
* @example
* Oj::Doc.open('[3,[2,1]]') { |doc|
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/object.c
Expand Up @@ -301,7 +301,7 @@ static int hat_num(ParseInfo pi, Val parent, Val kval, NumInfo ni) {
}
if (86400 == ni->exp) { // UTC time
parent->val = rb_time_nano_new(ni->i, (long)nsec);
// Since the ruby C routines alway create local time, the
// Since the ruby C routines always create local time, the
// offset and then a conversion to UTC keeps makes the time
// match the expected value.
parent->val = rb_funcall2(parent->val, oj_utc_id, 0, 0);
Expand Down
6 changes: 3 additions & 3 deletions ext/oj/oj.c
Expand Up @@ -509,7 +509,7 @@ static VALUE get_def_opts(VALUE self) {
* Sets the default options for load and dump.
* - *opts* [_Hash_] options to change
* - *:indent* [_Fixnum_|_String_|_nil_] number of spaces to indent each element in a JSON
*document or the String to use for identation.
*document or the String to use for indentation.
* - :circular [_Boolean_|_nil_] support circular references while dumping.
* - *:auto_define* [_Boolean_|_nil_] automatically define classes if they do not exist.
* - *:symbol_keys* [_Boolean_|_nil_] convert hash keys to symbols.
Expand Down Expand Up @@ -1398,7 +1398,7 @@ static VALUE to_json(int argc, VALUE *argv, VALUE self) {
* Dumps an Object to the specified file.
* - *file* [_String_] _path file path to write the JSON document to
* - *obj* [_Object_] Object to serialize as an JSON document String
* - *options* [_Hash_] formating options
* - *options* [_Hash_] formatting options
* - *:indent* [_Fixnum_] format expected
* - *:circular* [_Boolean_] allow circular references, default: false
*/
Expand All @@ -1420,7 +1420,7 @@ static VALUE to_file(int argc, VALUE *argv, VALUE self) {
* Dumps an Object to the specified IO stream.
* - *io* [_IO_] IO stream to write the JSON document to
* - *obj* [_Object_] Object to serialize as an JSON document String
* - *options* [_Hash_] formating options
* - *options* [_Hash_] formatting options
* - *:indent* [_Fixnum_] format expected
* - *:circular* [_Boolean_] allow circular references, default: false
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/parse.c
Expand Up @@ -489,7 +489,7 @@ static void read_num(ParseInfo pi) {
if ('.' == *pi->cur) {
pi->cur++;
// A trailing . is not a valid decimal but if encountered allow it
// except when mimicing the JSON gem or in strict mode.
// except when mimicking the JSON gem or in strict mode.
if (StrictMode == pi->options.mode || CompatMode == pi->options.mode) {
int pos = (int)(pi->cur - ni.str);

Expand Down
2 changes: 1 addition & 1 deletion ext/oj/rxclass.c
Expand Up @@ -110,7 +110,7 @@ oj_rxclass_match(RxClass rc, const char *str, int len) {
}
} else if (len < (int)sizeof(buf)) {
#if !IS_WINDOWS
// string is not \0 terminated so copy and atempt a match
// string is not \0 terminated so copy and attempt a match
memcpy(buf, str, len);
buf[len] = '\0';
if (0 == regexec(&rxc->rx, buf, 0, NULL, 0)) { // match
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/saj.c
Expand Up @@ -628,7 +628,7 @@ static void saj_parse(VALUE handler, char *json) {
* @param [IO|String] io IO Object to read from
* @deprecated The sc_parse() method along with the ScHandler is the preferred
* callback parser. It is slightly faster and handles streams while the
* saj_parse() methos requires a complete read before parsing.
* saj_parse() method requires a complete read before parsing.
* @see sc_parse
*/
VALUE
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/sparse.c
Expand Up @@ -494,7 +494,7 @@ static void read_num(ParseInfo pi) {
if ('.' == c) {
c = reader_get(&pi->rd);
// A trailing . is not a valid decimal but if encountered allow it
// except when mimicing the JSON gem.
// except when mimicking the JSON gem.
if (CompatMode == pi->options.mode) {
if (c < '0' || '9' < c) {
oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "not a number");
Expand Down
2 changes: 1 addition & 1 deletion ext/oj/stream_writer.c
Expand Up @@ -67,7 +67,7 @@ static VALUE buffer_size_sym = Qundef;
* should be and also a hint on when to flush.
*
* - *io* [_IO_] stream to write to
* - *options* [_Hash_] formating options
* - *options* [_Hash_] formatting options
*/
static VALUE stream_writer_new(int argc, VALUE *argv, VALUE self) {
StreamWriterType type = STREAM_IO;
Expand Down
4 changes: 2 additions & 2 deletions ext/oj/string_writer.c
Expand Up @@ -248,7 +248,7 @@ static void str_writer_free(void *ptr) {
* should be.
*
* - *io* [_IO_] stream to write to
* - *options* [_Hash_] formating options
* - *options* [_Hash_] formatting options
*/
static VALUE str_writer_new(int argc, VALUE *argv, VALUE self) {
StrWriter sw = ALLOC(struct _strWriter);
Expand Down Expand Up @@ -466,7 +466,7 @@ static VALUE str_writer_as_json(VALUE self) {
* by pushing values into the document. Pushing an array or an object will
* create that element in the JSON document and subsequent pushes will add the
* elements to that array or object until a pop() is called. When complete
* calling to_s() will return the JSON document. Note tha calling to_s() before
* calling to_s() will return the JSON document. Note that calling to_s() before
* construction is complete will return the document in it's current state.
*/
void oj_string_writer_init() {
Expand Down
2 changes: 1 addition & 1 deletion lib/oj/error.rb
Expand Up @@ -16,7 +16,7 @@ module Oj
# An Exception that is raised if a file fails to load.
LoadError = Class.new(Error)

# An Exception that is raised if there is a conflict with mimicing JSON
# An Exception that is raised if there is a conflict with mimicking JSON
MimicError = Class.new(Error)

end # Oj
2 changes: 1 addition & 1 deletion notes
Expand Up @@ -77,7 +77,7 @@ Oj.optimize_rails
Oj.default_options = { mode: :rails, bigdecimal_as_decimal: true }

It does the job - Oj dumps BigDecimal as number.
If I later add bigdecimal_as_decimal: true explicitely in the dump it works for single number dump, but not for Hash.
If I later add bigdecimal_as_decimal: true explicitly in the dump it works for single number dump, but not for Hash.

Oj.dump(BigDecimal('1.2')) # => "1.2"
Oj.dump({a: BigDecimal('1.2')}) # => "{\"a\":1.2}"
Expand Down
2 changes: 1 addition & 1 deletion pages/Options.md
Expand Up @@ -268,7 +268,7 @@ Use symbols instead of strings for hash keys.
### :symbolize_names [Boolean]

Like :symbol_keys has keys are made into symbols but only when
mimicing the JSON gem and then only as the JSON gem honors it so
mimicking the JSON gem and then only as the JSON gem honors it so
JSON.parse honors the option but JSON.load does not.

### :trace
Expand Down
6 changes: 3 additions & 3 deletions pages/Parser.md
Expand Up @@ -42,12 +42,12 @@ bleed over to other instances.

## How

It's wonderfull to wish for a faster parser that solves all the
It's wonderful to wish for a faster parser that solves all the
annoyances of the previous parser but how was it done is a much more
interesting question to answer.

At the core, the API for parsing was changed. Instead of a sinle
global parser any number of parsers can be created and each is seprate
global parser any number of parsers can be created and each is separate
from the others. The parser itself is able to rip through a JSON
string, stream, or file and then make calls to a delegate to process
the JSON elements according to the delegate behavior. This is similar
Expand Down Expand Up @@ -206,7 +206,7 @@ in array creation.

For Hash the story is a little different. The bulk insert for Hash
alternates keys and values but there is a wrinkle to consider. Since
Ruby Object creation is triggered by the occurance of an element that
Ruby Object creation is triggered by the occurrence of an element that
matches a creation identifier the creation of a collection is not just
for Array and Hash but also Object. Setting Object attributes uses an
ID and not a VALUE. For that reason the keys should not be created as
Expand Down
4 changes: 2 additions & 2 deletions pages/Rails.md
Expand Up @@ -41,7 +41,7 @@ The globals that ActiveSupport uses for encoding are:

Those globals are aliased to also be accessed from the ActiveSupport module
directly so `ActiveSupport::JSON::Encoding.time_precision` can also be accessed
from `ActiveSupport.time_precision`. Oj makes use of these globals in mimicing
from `ActiveSupport.time_precision`. Oj makes use of these globals in mimicking
Rails after the `Oj::Rails.set_encode()` method is called. That also sets the
`ActiveSupport.json_encoder` to the `Oj::Rails::Encoder` class.

Expand Down Expand Up @@ -125,7 +125,7 @@ gem 'oj', '3.7.12'
Ruby which is used by the json gem and by Rails. Ruby varies the
significant digits which can be either 16 or 17 depending on the value.

2. Optimized Hashs do not collapse keys that become the same in the output. As
2. Optimized Hashes do not collapse keys that become the same in the output. As
an example, a non-String object that has a `to_s()` method will become the
return value of the `to_s()` method in the output without checking to see if
that has already been used. This could occur is a mix of String and Symbols
Expand Down
2 changes: 1 addition & 1 deletion samples/wrapexception.rb
Expand Up @@ -15,7 +15,7 @@
# Oj is not able to automatically deserialize all classes that are a subclass of
# a Ruby Exception. Only exception that take one required string argument in the
# initialize() method are supported. This is an example of how to write an
# Exception subclass that supports both a single string intializer and an
# Exception subclass that supports both a single string initializer and an
# Exception as an argument. Additional optional arguments can be added as well.
#
# The reason for this restriction has to do with a design decision on the part
Expand Down
2 changes: 1 addition & 1 deletion test/json_gem/json_generator_test.rb
Expand Up @@ -113,7 +113,7 @@ def test_own_state
end

# TBD Implement JSON.state to return state class.
# set state attibutes from defaults
# set state attributes from defaults
# implement methods
# circular should use circular in defaults or maybe always set to true, allow changes with [:check_circular]=
def test_states
Expand Down
2 changes: 1 addition & 1 deletion test/test_hash.rb
Expand Up @@ -5,7 +5,7 @@

require 'helper'

class Hashi < Minitest::Test
class HashTest < Minitest::Test

module TestModule
end
Expand Down

0 comments on commit 9c2c0db

Please sign in to comment.