Skip to content

Commit 84c8b43

Browse files
committed
fix: require statements
1 parent c5a80cc commit 84c8b43

8 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ gem install lingodotdev
3636
## Quick start
3737

3838
```ruby
39-
require 'sdk/ruby'
39+
require 'lingodotdev'
4040

4141
# Create an engine instance
4242
engine = LingoDotDev::Engine.new(api_key: 'your-api-key')

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 "sdk/ruby"
5+
require "lingodotdev"
66

77
# You can add fixtures and/or initialization code here to make experimenting
88
# with your gem easier. You can also use a different console, if you like.

examples/ruby-on-rails/app/controllers/translate_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# frozen_string_literal: true
22

3-
require 'sdk/ruby'
3+
require 'lingodotdev'
44

55
class TranslateController < ApplicationController
66
def translate
77
api_key = ENV['LINGODOTDEV_API_KEY'] || 'your-api-key-here'
88

9-
engine = LingoDotDev::Engine.new(api_key: api_key)
10-
translated = engine.localize_text('Hello world', target_locale: 'es')
11-
engine.close
9+
translated = LingoDotDev::Engine.open(api_key: api_key) do |engine|
10+
engine.localize_text('Hello world', target_locale: 'es')
11+
end
1212

1313
render json: {
1414
original: 'Hello world',

lib/sdk/ruby.rb renamed to lib/lingodotdev.rb

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

3-
require_relative "ruby/version"
3+
require_relative "lingodotdev/version"
44
require 'net/http'
55
require 'uri'
66
require 'json'
@@ -539,3 +539,4 @@ def handle_response(response)
539539
end
540540
end
541541
end
542+

lib/lingodotdev/version.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
module LingoDotDev
4+
VERSION = "0.1.0"
5+
end
6+

lib/sdk/ruby/version.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

sdk-ruby.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

3-
require_relative "lib/sdk/ruby/version"
3+
require_relative "lib/lingodotdev/version"
44

55
Gem::Specification.new do |spec|
66
spec.name = "lingodotdev"
7-
spec.version = Sdk::Ruby::VERSION
7+
spec.version = LingoDotDev::VERSION
88
spec.authors = ["David Turnbull"]
99
spec.email = ["david@lingo.dev"]
1010

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'bundler/setup'
44
require 'dotenv/load'
55
require 'rspec'
6-
require 'sdk/ruby'
6+
require 'lingodotdev'
77

88
# Require all spec support files
99
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }

0 commit comments

Comments
 (0)