collapstring 0.1.0 → 0.1.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: fc45012860694f408de5cb72005462292eed86df
4
- data.tar.gz: c6fd4d29cbc2900f6fe2d3a53da1825c633d36a7
3
+ metadata.gz: 03a8814bc6af917198c2393d569e98a552d6910c
4
+ data.tar.gz: b96b78aa478999d80459f5133c593b71eba45d3a
5
5
  SHA512:
6
- metadata.gz: aa73236ac7c45e13861d1c1a130c0109468cc3519415de19308a86a51cf14b541331875d0edec53aaa1d1c95bcdf65cf7624658cc5634ab5cfd3e4732e6e888c
7
- data.tar.gz: 2b777d32c8628b4ee77288354beb7c19d8fb7508cf867cc6592b9d802d8a89d857d2d8c276c15d3e47fbb46796f658b0b7f4551e633ae160b40d9770c23a2e24
6
+ metadata.gz: 623cf4ca0cb67345252ef94145f99ace9e0d1f3a8d7b930591c5ce256313ad18678a7248acb80f69da7c24a6cc03997844ad7570c20ead83b516b236f40255d7
7
+ data.tar.gz: ce496dc563b643cf92270eb1ec575edee2de758181343452859b91332c919b89a40b4e6c47d12647a261e6f2b6695f26e92f816d2ebf6e90c75bc3eadec0c474
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 1.8.7
5
+ - 1.9.2
6
+ - 1.9.3
7
+ - 2.0.0
8
+ - 2.1.0
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/airbnb/collapstring.png?branch=master)](https://travis-ci.org/airbnb/collapstring)
2
+
1
3
  # Collapstring
2
4
 
3
5
  Collapse quoted strings in strings. Does not support JRuby.
data/collapstring.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'collapstring'
7
- spec.version = '0.1.0'
7
+ spec.version = '0.1.1'
8
8
  spec.authors = ['Pierre Carrier']
9
9
  spec.email = ['pierre@gcarrier.fr']
10
10
  spec.description = 'Collapse quoted strings in strings'
@@ -1,5 +1,6 @@
1
1
  #include <assert.h>
2
2
  #include <ruby.h>
3
+ #include <stddef.h>
3
4
 
4
5
  typedef enum {
5
6
  C_S_OUT,
@@ -17,10 +18,10 @@ static VALUE collapstring_collapse_bang(VALUE self, VALUE src)
17
18
  char *str = RSTRING_PTR(src);
18
19
  const size_t len = RSTRING_LEN(src);
19
20
 
20
- size_t dst_idx = 0;
21
+ size_t dst_idx = 0, src_idx = 0;
21
22
  collapse_state state = C_S_OUT;
22
23
 
23
- for (size_t src_idx = 0; src_idx < len; src_idx++) {
24
+ for (; src_idx < len; src_idx++) {
24
25
  const char cur = str[src_idx];
25
26
  switch (cur) {
26
27
  case '\"':
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collapstring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Carrier
@@ -60,6 +60,7 @@ extensions:
60
60
  - ext/collapstring/extconf.rb
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - .travis.yml
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md