Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.12.1] - 2026-03-24

### Fixed
- Require `fileutils` from the gem entrypoint and call `::FileUtils.rm_f` so `OpenApiImport.from` does not raise `uninitialized constant OpenApiImport::FileUtils` when nothing else has loaded the stdlib first

## [0.12.0] - 2026-03-17

### Added
Expand Down
2 changes: 2 additions & 0 deletions lib/open_api_import.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "fileutils"

require_relative "open_api_import/utils"
require_relative "open_api_import/filter"
require_relative "open_api_import/pretty_hash_symbolized"
Expand Down
4 changes: 2 additions & 2 deletions lib/open_api_import/open_api_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class OpenApiImport
class ParseError < StandardError; end

VERSION = "0.12.0"
VERSION = "0.12.1"

extend LibOpenApiImport

Expand Down Expand Up @@ -53,7 +53,7 @@ def self.from(swagger_file, create_method_name: :operation_id, include_responses
end

file_errors = "#{file_to_convert}.errors.log"
FileUtils.rm_f(file_errors)
::FileUtils.rm_f(file_errors)
import_errors = ""
required_constants = []

Expand Down
2 changes: 1 addition & 1 deletion open_api_import.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = "open_api_import"
s.version = "0.12.0"
s.version = "0.12.1"
s.summary = "OpenApiImport -- Import a Swagger or Open API file and create a Ruby Request Hash file including all requests and responses with all the examples. The file can be in JSON or YAML"
s.description = "OpenApiImport -- Import a Swagger or Open API file and create a Ruby Request Hash file including all requests and responses with all the examples. The file can be in JSON or YAML"
s.authors = ["Mario Ruiz"]
Expand Down
9 changes: 9 additions & 0 deletions spec/open_api_import/fileutils_require_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

require "open_api_import"

RSpec.describe "OpenApiImport stdlib dependencies" do
it "loads FileUtils when requiring the gem (regression for OpenApiImport.from)" do
expect(defined?(FileUtils)).to eq("constant")
end
end
Loading