Skip to content

Releases: Ishotihadus/usamin

ナナの未来もまだ広がってます。次はどんな色になるか、楽しみです♪

07 Jun 13:59
Compare
Choose a tag to compare

v7.7.11

08 Jun 16:59
Compare
Choose a tag to compare

Fix ‘ruby_nonempty_memcpy’ is not a member of ‘std’ error on Ruby 2.7 and glibc.

I think this is because of a Ruby's ugly bug...

ウサミミ、今夜はちょっとだけお休みです。だって…お姫様、ですから

25 Dec 13:25
Compare
Choose a tag to compare

Add support for pattern matching in Ruby 2.7

json = <<JSON
{
  "maekawa": "miku",
  "osaki": ["tenka", "amana"],
  "hisakawa": {"hayate": "haa", "nagi": "naa"}
}
JSON
data = Usamin.load(json)
#=> {"maekawa"=>"miku", "osaki"=>[...], "hisakawa"=>{...}}

case data
in maekawa:, hisakawa: {**sisters}
    p maekawa
    p sisters
end
# "miku"
# {:hayate=>"haa", :nagi=>"naa"}

Add useful methods

  • Hash#invert
  • Hash#to_proc

Add :symbolize_names option

  • Usamin::parse
  • UsaminValue#eval
  • UsaminValue#eval_r
  • JSON::parse, JSON::load (in overwriting module)

Fix methods' behaviors

  • Usamin::Hash#fetch
  • Usamin::Hash#merge
  • Usamin::Array#[]
  • Usamin::Array#fetch
  • Usamin::Array#index

Set rapidjson::kParseIterativeFlag as default (for security)

Set :recursive option to disable the flag.
This can cause fatal and unexpected problems.

Usamin.parse('[' * 1000000)
# Usamin::ParserError (Invalid value. Offset: 1000000)

Usamin.parse('[' * 1000000, recursive: true)
# SystemStackError (stack level too deep)

Usamin.parse('[' * 1000000, recursive: true)
# zsh: illegal hardware instruction  bundle console

ウサミン星まで、魔法でワープできたらいいのにな…電車じゃなくて

03 Aug 12:08
Compare
Choose a tag to compare

Implement comparison methods in UsaminValue

Now you can make comparison of UsaminValues and use Hash with UsaminValue keys.

  • ==, ===
  • eql?, hash
[0, 1, 2] == Usamin.load('[0, 1, 2.0]')
#=> true
[0, 1, 2] == Usamin.load('[0, 1, 2]')
#=> true
[0, 1, 2] == Usamin.load('[1, 2, 3]')
#=> false

hash = {Usamin.load('[0, 1]') => 'hoge'}
hash[Usamin.load('[0, 1]')]
#=> "hoge"

Add some useful methods

  • inspect = to_s
  • dig
  • flatten
  • reverse, rotate, rindex (UsaminArray)

Fix bugs

  • #2
  • behavior of overwritten JSON#load with proc

サンタメイドアイドルです!ちょっと、足し算しすぎですかね?えへへ

25 Dec 14:41
Compare
Choose a tag to compare

Add merge to UsaminHash

Usamin.load('{"a": 3, "b": 4}').merge({'a' => 5, 'c' => 7})
#=> {"a"=>5, "b"=>4, "c"=>7}

Support to_h with a block on Ruby 2.6

json = '[{"name": "miku maekawa", "age": 15}, {"name": "nana abe", "age": 17}]'
Usamin.load(json).to_h{|e| [e['name'], e['age']]}
#=> {"miku maekawa"=>15, "nana abe"=>17}

Support SIMD operations

If available, -march=native, and -msse4.2 or -msse2 options are used on compilation.

Improve memory performance

v7.7.7

20 Jun 11:32
Compare
Choose a tag to compare

Improve memory management

ポンコツウサミン、かわいがってくださいねっ!

05 Jun 02:21
Compare
Choose a tag to compare

v7.7.5

04 Jun 11:09
Compare
Choose a tag to compare

Fix double free bug

愛するプロデューサーさん!ずっとずっと、ナナを励まして、応援してくださいっ!10 年後も、その先も!

03 Jun 09:46
Compare
Choose a tag to compare

Nana Abe was elected as the 7th Cinderella Girl

The name of "Usamin" is derived from her.

Add some methods to UsaminValue

  • Hash methods
    • has_value? = value?
    • key = index
    • rassoc
    • reject
    • slice
    • to_a
    • transform_keys
    • transform_values
    • values_at
  • Array methods
    • compact
    • include?

Fix some methods

  • Array methods
    • find_index = index

Symbols are also accepted as indexers of Hash

data = Usamin.load('{"a": 3, "b": 5}')
data[:a]
#=> 3

data.key?(:b)
#=> true

Improve Memory Management

あのとき感じた気持ちは、今でもハッキリ覚えています!そうじゃなかったら、ナナはステージに立っていないから。

26 Feb 07:06
Compare
Choose a tag to compare

Add some methods to UsaminValue

  • Hash#fetch
  • Hash#select
  • Array#at
  • Array#fetch
  • Array#last
  • Array#slice

Implement overwriter of default JSON module