extconf_compile_commands_json 0.0.5 → 0.0.7

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: 4ce6710866c4f07c500ab2585fd1fa1d40dcf7f5d8e00ecba008f8336de88dc4
4
- data.tar.gz: 2ac4f1f733c16de18a0e255c42346fbc6ded34cff9af1addb7d5409790feb792
3
+ metadata.gz: ca21d9596efcc6e7e23cc53e72cd04fced0c801dd34671376d5fb56aa0eef564
4
+ data.tar.gz: 619368bdc5955ae38ab920ba179f4a5f531d0d6f48cdad281aa7a3a059c8a77b
5
5
  SHA512:
6
- metadata.gz: 94e624a0c3922c37081847ab63d8f59fa355046bbdbee9c244db6e596b346eaabd417ab75b4106dd38efb36bf23d57861cddcd465eeb81353028f03473a15b94
7
- data.tar.gz: 124ebd14ce40fa8ac4ec560611a08e2d687ecfa19be0e48af5952885e72436e3f63cf9f09f925676ee61ebe5d63ae141144d06d87c492a388933cede3604bb8d
6
+ metadata.gz: f6f2a5db6f56efc66a423c0f1b09648073c09d290916957f84cd77346b957ccfbc5476570076362c4daa89902508e232d8c4d2b157ab5a1091a912171672bfb1
7
+ data.tar.gz: 31b01677582f19919fa6731a3dae1bf0c01a0c1ad32ac18e0b36b7f139be722de0d565cf1285c2429d335ad13e323e6302c0d85656d4eed15e3d395fb282696f
@@ -17,8 +17,8 @@ require_relative "../extconf_compile_commands_json"
17
17
 
18
18
  module MakeMakefile
19
19
  alias_method :__extconfcc_orig_create_makefile, :create_makefile
20
- def create_makefile(*args)
21
- r = __extconfcc_orig_create_makefile(*args)
20
+ def create_makefile(...)
21
+ r = __extconfcc_orig_create_makefile(...)
22
22
  ExtconfCompileCommandsJson.generate!
23
23
  ExtconfCompileCommandsJson.symlink!
24
24
  r
@@ -7,15 +7,10 @@ require "fileutils"
7
7
 
8
8
  module ExtconfCompileCommandsJson
9
9
  def self.generate!
10
- mkmf_cflags = []
11
10
  # Start by expanding what's in our magic variables
12
- [$INCFLAGS, $CPPFLAGS, $CFLAGS, $COUTFLAGS].each do |v|
13
- next unless v
14
- mkmf_cflags.concat Shellwords.split(v)
15
- end
16
- # expand that with the contents of the ruby options
17
- mkmf_cflags.map! do |flag|
18
- flag
11
+ mkmf_cflags = [$INCFLAGS, $CPPFLAGS, $CFLAGS, $COUTFLAGS].map { |flag|
12
+ # expand that with the contents of the ruby options
13
+ (flag || "")
19
14
  .gsub("$(arch_hdrdir)", $arch_hdrdir || "")
20
15
  .gsub("$(hdrdir)", $hdrdir || "")
21
16
  .gsub("$(srcdir)", $srcdir || "")
@@ -27,8 +22,12 @@ module ExtconfCompileCommandsJson
27
22
  .gsub("$(debugflags)", RbConfig::CONFIG["debugflags"] || "")
28
23
  .gsub("$(warnflags)", RbConfig::CONFIG["warnflags"] || "")
29
24
  .gsub("$(empty)", "")
30
- end
31
- mkmf_cflags.reject! { |f| f.empty? }
25
+ }.flat_map { |flags|
26
+ # Need to shellwords expand them (_after_ doing the $() subst's)
27
+ Shellwords.split(flags)
28
+ }.reject { |flag|
29
+ flag.empty?
30
+ }
32
31
  # This makes sure that #include "extconf.h" works
33
32
  mkmf_cflags = ["-iquote#{File.realpath(Dir.pwd)}"] + mkmf_cflags
34
33
  compile_commands = $srcs.map do |src|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extconf_compile_commands_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - KJ Tsanaktsidis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2024-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.3.7
57
+ rubygems_version: 3.5.9
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: Generate clangd compile_commands.json files for gems