Skip to content

Commit 03408e5

Browse files
committed
example: Use Oj gem to test if native extension bundling works
1 parent cd34d96 commit 03408e5

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

example/app/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'nokogiri'
3+
gem 'oj'
44

55
group :test do
66
gem 'minitest'

example/app/Gemfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
mini_portile2 (2.4.0)
5-
minitest (5.14.2)
6-
nokogiri (1.10.10)
7-
mini_portile2 (~> 2.4.0)
4+
bigdecimal (3.1.5)
5+
minitest (5.20.0)
6+
oj (3.16.3)
7+
bigdecimal (>= 3.0)
88

99
PLATFORMS
1010
ruby
1111

1212
DEPENDENCIES
1313
minitest
14-
nokogiri
14+
oj
1515

1616
BUNDLED WITH
1717
2.3.7

example/app/main.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
require 'nokogiri'
1+
p Dir.pwd
22

3-
def handler(*)
4-
{
5-
libxml: Nokogiri::LIBXML_VERSION,
6-
}
7-
end
3+
require 'bundler/setup'
4+
require 'oj'
85

9-
def handler2(*)
10-
"hi!"
6+
def handler(*)
7+
# This handler ensures the gem with a native extension is bundled properly
8+
Oj.dump({greeting: 'hi!'})
119
end

0 commit comments

Comments
 (0)