extconf_compile_commands_json 0.0.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88de348e6640c23af1e07d9f0020a0ec522178b29582ceb9fea6d33688fd2724
4
- data.tar.gz: 2d13985b767102f8106fa060417292c68b254912b761b67c8559ded462cbd837
3
+ metadata.gz: 4ce6710866c4f07c500ab2585fd1fa1d40dcf7f5d8e00ecba008f8336de88dc4
4
+ data.tar.gz: 2ac4f1f733c16de18a0e255c42346fbc6ded34cff9af1addb7d5409790feb792
5
5
  SHA512:
6
- metadata.gz: c146378f481ad9479e117f95e8a6e3a0f2a8780740c10f2146ef65cbfef3ad2ff9489c58e5541df2dd51eea08a941492322341917f8c09ebaa60a59828684a8e
7
- data.tar.gz: 9e6375c68826300429d7849abc34c993577a7de0e2b9b1b7055ec3d1a0c1efbb5fe9b80b55d7854907c66fb7ba5d6e096ba603c95085a7035423625dfc4097c0
6
+ metadata.gz: 94e624a0c3922c37081847ab63d8f59fa355046bbdbee9c244db6e596b346eaabd417ab75b4106dd38efb36bf23d57861cddcd465eeb81353028f03473a15b94
7
+ data.tar.gz: 124ebd14ce40fa8ac4ec560611a08e2d687ecfa19be0e48af5952885e72436e3f63cf9f09f925676ee61ebe5d63ae141144d06d87c492a388933cede3604bb8d
@@ -6,16 +6,21 @@
6
6
  # scripts.
7
7
 
8
8
  require "mkmf"
9
- require "extconf_compile_commands_json"
9
+ # the require_relative looks stupid, but it ensures that you can load this patch
10
+ # simply by running adding -r/path/to/autoload.rb to your Ruby invocation without
11
+ # needing to muck about with $LOAD_PATH or Bundler.
12
+ require_relative "../extconf_compile_commands_json"
10
13
 
11
- module ExtconfCompileCommandsJson
12
- module AutoloadPatch
13
- def create_makefile(*args)
14
- super
15
- ExtconfCompileCommandsJson.generate!
16
- ExtconfCompileCommandsJson.symlink!
17
- end
14
+ # We have to patch MakeMakefile directly, rather than prepending to it, because
15
+ # requiring mkmf includes it into the toplevel main object straight away. So prepending
16
+ # here would be too late.
17
+
18
+ module MakeMakefile
19
+ alias_method :__extconfcc_orig_create_makefile, :create_makefile
20
+ def create_makefile(*args)
21
+ r = __extconfcc_orig_create_makefile(*args)
22
+ ExtconfCompileCommandsJson.generate!
23
+ ExtconfCompileCommandsJson.symlink!
24
+ r
18
25
  end
19
26
  end
20
-
21
- MakeMakefile.prepend ExtconfCompileCommandsJson::AutoloadPatch
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extconf_compile_commands_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - KJ Tsanaktsidis