faster_support 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: aedf91070e24d432e8b5bfeb4dce46feff9cabef
4
- data.tar.gz: 91489df0237eb328164e158954528b7b9241d629
3
+ metadata.gz: f29a746b834d3774c9c7694b3c6fce2812565aa8
4
+ data.tar.gz: f9e79c98b7384b0bcf0f1f1c1f51aa98e5ec545a
5
5
  SHA512:
6
- metadata.gz: 86913895a2dab2767c8d7b261151f8b5d14bbceb654e3913f7f92ce225caf297e9e3f0755d7295a5910761bc801a7abee6a162f94328b69dd0ce6711b7eb292a
7
- data.tar.gz: 253b1689b7585d7e07f4db1a379adb198fa651718e8c5263eff8d74f9a658af54f611d617a14444bc9318536d106ef918b02defaedd4e1825e67617eead258bf
6
+ metadata.gz: 6f301dcd7261d65b8a9663faaeaf95cd28508ca060720768218735a6e183112b6dab4da1bd1c81495a5cdbe8aa632bfe6ce9a965770fd8fa8070fd137bc6452e
7
+ data.tar.gz: e70a5c789ed85a4e8cd5edb054bebfaa89480bd9415a10782dea47fc2b252486268f8c1a00b71e4aad0f1ddb0a217e980ba281a835aef89e16367a45871a98c9
@@ -41,9 +41,15 @@ flags = [
41
41
  '-I/Users/morgan/projects/coach/faster_support/ext/faster_support/.',
42
42
  '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/stage/lib/faster_support/.',
43
43
  '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/faster_support/2.4.0/.',
44
- '-I/Users/morgan/projects/coach/faster_support/ext/faster_support/object/blank/.',
45
- '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/stage/lib/faster_support/object/blank/.',
46
- '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/faster_support/2.4.0/object/blank/.',
44
+
45
+ '-I/Users/morgan/projects/coach/faster_support/ext/faster_support/core_ext/object/blank/.',
46
+ '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/stage/lib/faster_support/core_ext/object/.'
47
+ '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/faster_support/core_ext/object/blank/2.4.0/.',
48
+
49
+ '-I/Users/morgan/projects/coach/faster_support/ext/faster_support/core_ext/string/.',
50
+ '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/stage/lib/faster_support/core_ext/.',
51
+ '-I/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/faster_support/core_ext/string/2.4.0/.',
52
+
47
53
  '-I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/.',
48
54
  '-I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16/.',
49
55
  '-Wall',
data/Rakefile CHANGED
@@ -27,6 +27,12 @@ Rake::ExtensionTask.new('faster_support/core_ext/object/blank') do |ext|
27
27
  Tooling.add_task(ext: ext)
28
28
  end
29
29
 
30
+ Rake::ExtensionTask.new('faster_support/core_ext/string') do |ext|
31
+ ext.lib_dir = 'lib'
32
+ ext.source_pattern = '*.{c,cpp,m,mm}'
33
+ Tooling.add_task(ext: ext)
34
+ end
35
+
30
36
  Tooling.define(:tooling)
31
37
 
32
38
  task default: [:clobber, :compile, :tooling, :spec]
@@ -13,5 +13,10 @@
13
13
  "command": "cc -c -I. -I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../../../../ext/faster_support/core_ext/object/blank -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/Users/morgan/projects/coach/faster_support/ext/faster_support -fno-common -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -o string_blank.o ../../../../../../../ext/faster_support/core_ext/object/blank/string_blank.c",
14
14
  "directory": "/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/faster_support/core_ext/object/blank/2.4.0",
15
15
  "file": "/Users/morgan/projects/coach/faster_support/ext/faster_support/core_ext/object/blank/string_blank.c"
16
+ },
17
+ {
18
+ "command": "cc -c -I. -I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/morgan/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../../../ext/faster_support/core_ext/string -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/Users/morgan/projects/coach/faster_support/ext/faster_support -fno-common -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -o string.o ../../../../../../ext/faster_support/core_ext/string/string.c",
19
+ "directory": "/Users/morgan/projects/coach/faster_support/tmp/x86_64-darwin16/faster_support/core_ext/string/2.4.0",
20
+ "file": "/Users/morgan/projects/coach/faster_support/ext/faster_support/core_ext/string/string.c"
16
21
  }
17
22
  ]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'mkmf'
4
- # rubocop:disable all
4
+ # rubocop:disable Style/GlobalVars
5
5
  $CPPFLAGS += "-I#{File.expand_path('../../../../', __FILE__)}"
6
6
  create_makefile('faster_support/core_ext/object/blank')
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mkmf'
4
+ # rubocop:disable Style/GlobalVars
5
+ $CPPFLAGS += "-I#{File.expand_path('../../../', __FILE__)}"
6
+ create_makefile('faster_support/core_ext/string')
@@ -0,0 +1,38 @@
1
+ /* String core extensions */
2
+
3
+ #include "string.h"
4
+
5
+ static rb_encoding *ascii_8bit_enc;
6
+
7
+ static VALUE rb_str_to_ascii8bit(VALUE str)
8
+ {
9
+ rb_encoding *enc;
10
+ VALUE new_str;
11
+
12
+ enc = STR_ENC_GET(str);
13
+
14
+ if (enc == ascii_8bit_enc) {
15
+ return str;
16
+ }
17
+
18
+ if (OBJ_FROZEN(str)) {
19
+ new_str = rb_obj_dup(str);
20
+ }
21
+ else {
22
+ new_str = str;
23
+ }
24
+
25
+ rb_check_frozen(new_str);
26
+ rb_enc_associate(new_str, ascii_8bit_enc);
27
+ ENC_CODERANGE_CLEAR(new_str);
28
+
29
+ return new_str;
30
+ }
31
+
32
+ void Init_string(void)
33
+ {
34
+ ascii_8bit_enc = rb_ascii8bit_encoding();
35
+ rb_define_method(rb_cString, "ascii_8bit", rb_str_to_ascii8bit, 0);
36
+ rb_define_alias(rb_cString, "as_ascii_8bit", "ascii_8bit");
37
+ rb_define_alias(rb_cString, "as_8bit_ascii", "ascii_8bit");
38
+ }
@@ -0,0 +1,10 @@
1
+ #ifndef FASTER_SUPPORT_STRING_H
2
+ #define FASTER_SUPPORT_STRING_H 1
3
+
4
+ #include "ruby.h"
5
+ #include "ruby/encoding.h"
6
+ #include "ruby/re.h"
7
+
8
+ #define STR_ENC_GET(str) rb_enc_from_index(ENCODING_GET(str))
9
+
10
+ #endif /* ifndef FASTER_SUPPORT_STRING_H */
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
  spec.extensions = ['ext/faster_support/extconf.rb',
25
- 'ext/faster_support/core_ext/object/blank/extconf.rb']
25
+ 'ext/faster_support/core_ext/object/blank/extconf.rb',
26
+ 'ext/faster_support/core_ext/string/extconf.rb']
26
27
 
27
28
  spec.add_development_dependency 'bundler', '~> 1.13'
28
29
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'faster_support/core_ext/object'
4
+ require 'faster_support/core_ext/string'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FasterSupport
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faster_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - J. Morgan Lieberthal
@@ -73,6 +73,7 @@ executables: []
73
73
  extensions:
74
74
  - ext/faster_support/extconf.rb
75
75
  - ext/faster_support/core_ext/object/blank/extconf.rb
76
+ - ext/faster_support/core_ext/string/extconf.rb
76
77
  extra_rdoc_files: []
77
78
  files:
78
79
  - ".clang-format"
@@ -96,6 +97,9 @@ files:
96
97
  - ext/faster_support/core_ext/object/blank/extconf.rb
97
98
  - ext/faster_support/core_ext/object/blank/object_blank.c
98
99
  - ext/faster_support/core_ext/object/blank/string_blank.c
100
+ - ext/faster_support/core_ext/string/extconf.rb
101
+ - ext/faster_support/core_ext/string/string.c
102
+ - ext/faster_support/core_ext/string/string.h
99
103
  - ext/faster_support/extconf.rb
100
104
  - ext/faster_support/faster_support.c
101
105
  - ext/faster_support/faster_support.h