rufio 0.40.0 → 0.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43f35127859605406c89bc48a750bcf44fd6da3acd504c4b4c60d0f146727a05
4
- data.tar.gz: 758010fd28247577c139ae48a0442749059ed5296d1a78a8e2fd0aebb7a1cc8f
3
+ metadata.gz: 7961605c57b1bb4e31ac73107f636984fe654a9d7a2114b91776c2faf94493be
4
+ data.tar.gz: fb3ed53e99f7697c33d53ee6bffa42f3744442c7171dc914127e860fab310987
5
5
  SHA512:
6
- metadata.gz: da45c7f0744df6bcccf6cbee9459740bbd3ff5b6c5017a8583fd9a8f074ecbe3e02367ec1858a006f7e27a4008e183955b2dc39fe9c00309fc3e45fd6dd7c5ed
7
- data.tar.gz: 4dc6228def3e95730632b03a10585d5cffeb8e4a71e912d36bca74491bada17c259e28e2ed537d2252b0764fdd6f46d840bcab60aaa0ee85e5fba6d781887efd
6
+ metadata.gz: 6e50fb55d6ad7bceebe4d4df16c5afd0a398e8bfdd90957ed0dfc57db7eaa93210346ace773550ab9ad04aef496caa902229c4ccf917c26bf058d65637ec6a16
7
+ data.tar.gz: 29b9d79d0cd35cb897eb61d115aac5ad817cbdba003a80d9c5d21ad4370280be72bc8f228a5ab56bd25148649e5ba9ba13c245a669722161c639eb1dd96575d4
@@ -62,18 +62,19 @@ module Rufio
62
62
  truncated = false
63
63
  encoding = "UTF-8"
64
64
 
65
- File.open(file_path, "r:UTF-8") do |file|
65
+ # UTF-8で読み込み、不正なバイト列は置換文字に変換
66
+ File.open(file_path, "r:UTF-8:UTF-8", invalid: :replace, undef: :replace, replace: '�') do |file|
66
67
  file.each_line.with_index do |line, index|
67
68
  break if index >= max_lines
68
-
69
+
69
70
  # truncate too long lines
70
71
  if line.length > MAX_LINE_LENGTH
71
72
  line = line[0...MAX_LINE_LENGTH] + "..."
72
73
  end
73
-
74
+
74
75
  lines << line.chomp
75
76
  end
76
-
77
+
77
78
  # check if there are more lines to read
78
79
  truncated = !file.eof?
79
80
  end
@@ -83,11 +84,11 @@ module Rufio
83
84
  truncated: truncated,
84
85
  encoding: encoding
85
86
  }
86
- rescue Encoding::InvalidByteSequenceError
87
+ rescue Encoding::InvalidByteSequenceError, Encoding::CompatibilityError
87
88
  # try Shift_JIS if UTF-8 fails
88
89
  begin
89
90
  lines = []
90
- File.open(file_path, "r:Shift_JIS:UTF-8") do |file|
91
+ File.open(file_path, "r:Shift_JIS:UTF-8", invalid: :replace, undef: :replace, replace: '�') do |file|
91
92
  file.each_line.with_index do |line, index|
92
93
  break if index >= max_lines
93
94
  lines << line.chomp
data/lib/rufio/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rufio
4
- VERSION = '0.40.0'
4
+ VERSION = '0.40.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.40.0
4
+ version: 0.40.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - masisz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-11 00:00:00.000000000 Z
11
+ date: 2026-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: io-console
@@ -192,7 +192,6 @@ files:
192
192
  - lib_zig/rufio_native/build.zig
193
193
  - lib_zig/rufio_native/src/main.zig
194
194
  - lib_zig/rufio_native/src/main.zig.sync
195
- - publish_gem.zsh
196
195
  - retag.sh
197
196
  - test_delete/test1.txt
198
197
  - test_delete/test2.txt
data/publish_gem.zsh DELETED
@@ -1,131 +0,0 @@
1
- #!/bin/zsh
2
-
3
- # Gem Build & Push Script
4
- # Usage: ./publish_gem.zsh [version]
5
-
6
- set -e # Exit on any error
7
-
8
- # Colors for output
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- BLUE='\033[0;34m'
13
- NC='\033[0m' # No Color
14
-
15
- # Function to print colored output
16
- print_status() {
17
- echo -e "${BLUE}[INFO]${NC} $1"
18
- }
19
-
20
- print_success() {
21
- echo -e "${GREEN}[SUCCESS]${NC} $1"
22
- }
23
-
24
- print_warning() {
25
- echo -e "${YELLOW}[WARNING]${NC} $1"
26
- }
27
-
28
- print_error() {
29
- echo -e "${RED}[ERROR]${NC} $1"
30
- }
31
-
32
- # Check if we're in the correct directory
33
- if [[ ! -f "rufio.gemspec" ]]; then
34
- print_error "rufio.gemspec not found. Please run this script from the project root directory."
35
- exit 1
36
- fi
37
-
38
- # Get current version from version.rb
39
- CURRENT_VERSION=$(ruby -r ./lib/rufio/version -e "puts Rufio::VERSION")
40
- print_status "Current version: $CURRENT_VERSION"
41
-
42
- # Use provided version or current version
43
- VERSION=${1:-$CURRENT_VERSION}
44
- print_status "Publishing version: $VERSION"
45
-
46
- # Confirm before proceeding
47
- echo
48
- read "REPLY?Do you want to proceed with publishing version $VERSION? (y/N): "
49
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
50
- print_warning "Aborted by user."
51
- exit 0
52
- fi
53
-
54
- echo
55
- print_status "Starting gem publication process..."
56
-
57
- # Step 1: Run tests
58
- print_status "Running tests..."
59
- if ! bundle exec rake test; then
60
- print_error "Tests failed. Aborting publication."
61
- exit 1
62
- fi
63
- print_success "All tests passed!"
64
-
65
- # Step 2: Clean up old gem files
66
- print_status "Cleaning up old gem files..."
67
- rm -f *.gem
68
- print_success "Cleanup completed."
69
-
70
- # Step 3: Build gem
71
- print_status "Building gem..."
72
- if ! bundle exec gem build rufio.gemspec; then
73
- print_error "Gem build failed."
74
- exit 1
75
- fi
76
-
77
- # Find the built gem file
78
- GEM_FILE=$(ls rufio-*.gem | head -n 1)
79
- if [[ -z "$GEM_FILE" ]]; then
80
- print_error "No gem file found after build."
81
- exit 1
82
- fi
83
-
84
- print_success "Gem built successfully: $GEM_FILE"
85
-
86
- # Step 4: Verify gem contents (optional)
87
- print_status "Gem contents:"
88
- gem contents $GEM_FILE | head -10
89
- echo "..."
90
-
91
- # Step 5: Final confirmation
92
- echo
93
- read "REPLY?Push $GEM_FILE to RubyGems? (y/N): "
94
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
95
- print_warning "Gem build completed but not published."
96
- print_status "You can manually push later with: gem push $GEM_FILE"
97
- exit 0
98
- fi
99
-
100
- # Step 6: Push to RubyGems
101
- print_status "Pushing gem to RubyGems..."
102
- if ! gem push $GEM_FILE; then
103
- print_error "Gem push failed."
104
- exit 1
105
- fi
106
-
107
- print_success "Gem published successfully!"
108
-
109
- # Step 7: Create git tag if version was provided
110
- if [[ -n "$1" ]]; then
111
- print_status "Creating git tag v$VERSION..."
112
- if git tag "v$VERSION" 2>/dev/null; then
113
- print_success "Tag v$VERSION created."
114
- read "REPLY?Push tag to remote? (y/N): "
115
- if [[ $REPLY =~ ^[Yy]$ ]]; then
116
- git push origin "v$VERSION"
117
- print_success "Tag pushed to remote."
118
- fi
119
- else
120
- print_warning "Tag v$VERSION already exists or failed to create."
121
- fi
122
- fi
123
-
124
- # Step 8: Cleanup
125
- print_status "Cleaning up gem file..."
126
- rm -f $GEM_FILE
127
-
128
- echo
129
- print_success "Publication completed!"
130
- print_status "Gem should be available at: https://rubygems.org/gems/rufio"
131
- print_status "Install with: gem install rufio"