wordtriez 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ext/extconf.rb +8 -2
  3. data/ext/hat-trie/text.c +2 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cf93aec498957ae648674251b2051ab4a08381c
4
- data.tar.gz: 8fe39195a015704d6afee86762d304f84d485456
3
+ metadata.gz: c086defc8f9d26af3174ab0fe8f6abeec00add65
4
+ data.tar.gz: 1093097d455ed7b082c7da626c923a221e41853d
5
5
  SHA512:
6
- metadata.gz: 23f5c58246dec87b35d3c11476c4e8d82c6fdc013b1f534eaa8dc47881608c74a33b002dae5a2d744a223b38de59233eddf50fef8ac239a07f9fff64d03559f3
7
- data.tar.gz: 1033906d59479f13f251af341905315ae637e34663cee293a785614299baf0e883715d9d61d0bab3b3e2f68e945e298c50b2861f6191c2918fd6cf308605218d
6
+ metadata.gz: 09bbe2b50bda31e775d17906b4a448e505e8f676bfb84e37d36186afaba706d6e3de0567e49f0ab37440eabcfa6a44176c1ee3a6ba173287022849901a1adeef
7
+ data.tar.gz: 46f914ec077291c2f5d7b749799f0179ab42208894622da5fcb4dde360c992082faa747faec6a56a949d735bfbd78f0c6c21ec7e653c253832479ec5b9ec724a
data/ext/extconf.rb CHANGED
@@ -23,8 +23,14 @@ build_dir = File.dirname(__FILE__) + '/build'
23
23
  mkdir_p build_dir
24
24
  cd build_dir
25
25
  unless File.exist?('libtries.a')
26
- cc = ENV['CC'] || RbConfig::CONFIG['CC']
27
- cc = [cc, '-O3', '-std=c99', '-Wall', '-pedantic', '-fPIC', '-c']
26
+ cc = [ENV['CC'] || RbConfig::CONFIG['CC']]
27
+ if enable_config('debug')
28
+ CONFIG['debugflags'] << ' -ggdb3 -O0'
29
+ cc += ['-O0', '-ggdb3']
30
+ else
31
+ cc += ['-O3']
32
+ end
33
+ cc += ['-std=c99', '-Wall', '-pedantic', '-fPIC', '-c']
28
34
  ar = RbConfig::CONFIG['AR']
29
35
  ar = 'ar' unless File.exist?(ar)
30
36
  sh *cc, '-I..', *Dir.glob("../hat-trie/*.c")
data/ext/hat-trie/text.c CHANGED
@@ -17,6 +17,8 @@
17
17
  */
18
18
  size_t text_clean(char* text)
19
19
  {
20
+ if (*text == '\0') return 0;
21
+
20
22
  char* read;
21
23
  char* write = text;
22
24
  uint8_t join_lines = false,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordtriez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zete Lui