Skip to content

Commit a7ed134

Browse files
committed
Rename sm2_crypto to sm2-crypto to fix rails autoload
1 parent ea0c1e3 commit a7ed134

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## [Unreleased]
22

3+
## [0.3] - 2025-09-03
4+
5+
- Breaking change: rename `sm2_crypto` to `sm2-crypto` to fix rails autoload
6+
37
## [0.2.2] - 2025-03-26
48

59
- Add ASN.1 DER format for sm2 sign and verify

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $ gem install sm2-crypto
3333
### Encrypt and Decrypt
3434

3535
```ruby
36-
require 'sm2_crypto'
36+
require 'sm2-crypto'
3737

3838
# Generate key pair
3939
keypair = OpenSSL::PKey::EC.generate("SM2")

bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# frozen_string_literal: true
33

44
require "bundler/setup"
5-
require "sm2_crypto"
5+
require "sm2-crypto"
66

77
require "irb"
88
IRB.start(__FILE__)

lib/sm2_crypto.rb renamed to lib/sm2-crypto.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require "openssl"
44

55
module SM2Crypto
6+
VERSION = "0.3.0"
7+
68
module_function
79

810
# Key Derived Function

sm2-crypto.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# frozen_string_literal: true
2+
require_relative "lib/sm2-crypto"
23

34
Gem::Specification.new do |spec|
45
spec.name = "sm2-crypto"
5-
spec.version = "0.2.2"
6+
spec.version = SM2Crypto::VERSION
67
spec.authors = ["Seekr"]
78
spec.email = ["wzhao23@gmail.com"]
89

test/test_sm2_crypto.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require "minitest/autorun"
4-
require "sm2_crypto"
4+
require "sm2-crypto"
55
require "base64"
66
require "securerandom"
77

0 commit comments

Comments
 (0)