Skip to content

Commit 64b70e2

Browse files
committed
Move the gem's C extension into lib/yarp/
and change the require from "yarp.so" to "yarp/yarp", which is more aligned with existing community conventions for gems.
1 parent 29086ab commit 64b70e2

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
/build/
1414
/lib/yarp/yarp.*
15-
/lib/yarp.bundle
16-
/lib/yarp.so
1715
test.rb
1816
*.dSYM
1917
*~

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ or explicitly running the `compile` task:
2424

2525
``` sh
2626
bundle exec rake compile test
27+
# or to just compile the C extension ...
28+
bundle exec rake compile:yarp test
2729
```
2830

2931
## Documentation

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ task "compile:yarp" => ["configure", "templates"] # must be before the Extension
6464
Rake::ExtensionTask.new(:compile) do |ext|
6565
ext.name = "yarp"
6666
ext.ext_dir = "ext/yarp"
67-
ext.lib_dir = "lib"
67+
ext.lib_dir = "lib/yarp"
6868
ext.gem_spec = Gem::Specification.load("yarp.gemspec")
6969
end
7070

7171
# So `rake clobber` will delete generated files
7272
CLOBBER.concat(TEMPLATES)
7373
CLOBBER.concat(["configure", "Makefile", "build", "config.h.in", "include/yarp/config.h"])
74-
CLOBBER << "lib/yarp.#{RbConfig::CONFIG["DLEXT"]}"
74+
CLOBBER << "lib/yarp/yarp.#{RbConfig::CONFIG["DLEXT"]}"
7575

7676
TEMPLATES.each do |filepath|
7777
desc "Template #{filepath}"

ext/yarp/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def configure
1111
configure_c_extension
1212
configure_rubyparser
1313

14-
create_makefile("yarp")
14+
create_makefile("yarp/yarp")
1515
end
1616

1717
def configure_c_extension

lib/yarp.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,5 @@ def self.newlines(source)
240240
require_relative "yarp/ripper_compat"
241241
require_relative "yarp/serialize"
242242
require_relative "yarp/pack"
243-
require "yarp.so"
243+
244+
require "yarp/yarp"

tasks/check_manifest.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ task :check_manifest => [:templates, "configure"] do
3636
java/org/yarp/Loader.java
3737
java/org/yarp/Nodes.java
3838
java/org/yarp/Parser.java
39-
lib/yarp.{jar,so,bundle}
39+
lib/yarp/yarp.{so,bundle,jar}
4040
]
4141

4242
intended_directories = Dir.children(".")

0 commit comments

Comments
 (0)