densify 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c86ab702fde5c5b4b6e1cb5f78ccc731b6934d9b
4
- data.tar.gz: 5d6160fb789cfc4430100dd7d4e83d521213ea59
3
+ metadata.gz: 1689aa4b192893aa5214e4d7274bf18770f07f78
4
+ data.tar.gz: 04a176aab40bc61cc22f0da0d6ccb87e5ad42e38
5
5
  SHA512:
6
- metadata.gz: 72792ee7c0b60449c08550eac6031ce92a3ff8db45b1ba1149369c4519176769f7ccfc8daf8029e8599248c653a0ef1e418884121a985f09f81f862e55e7c316
7
- data.tar.gz: f7e5666e486ce8be743ccff3f5bf8b3f3714ec180eeab823f4a2f44e18ffce1c4a88ab24da54f3bb4db30447e8cc568acbc23961dabe79890881567b8095479f
6
+ metadata.gz: 90c8b499261147a6ea928cb5eaf552202d73c7e72558e1e8447c01de67f92d5be4ca6f238eee62f23552c0a490a46f5fa5f70ced124839538c83232e6131acd3
7
+ data.tar.gz: 36962990e2f141d370546d8a73d79e809e982cf9b88a90702dad81662216026ff972aea5e4df93d203e6d6873958f6b4f43f03f46bf4fba1aec696eb672c9f4a
@@ -37,16 +37,13 @@ static VALUE densify(VALUE self) {
37
37
 
38
38
  switch (curr_char) {
39
39
  case '\n':
40
- // skip
41
- // just ignore this character
42
- break;
43
- case '\t':
44
- curr_char = ' ';
40
+ // ignore newlines
45
41
  break;
42
+ case '\t': // treat tabs like spaces
46
43
  case ' ':
47
44
  // If this is the first space, add the space
48
45
  if (is_in_spaces == 0) {
49
- minified[minified_index] = curr_char;
46
+ minified[minified_index] = ' ';
50
47
  minified_index++;
51
48
  }
52
49
 
@@ -61,5 +58,5 @@ static VALUE densify(VALUE self) {
61
58
  }
62
59
  }
63
60
  minified[minified_index] = '\0'; // don't add anything to the index because it will have been incremented after the last character is appended in the for loop
64
- return rb_str_new2(minified);
61
+ return rb_str_new(minified, minified_index+2);
65
62
  }
@@ -1,2 +1,5 @@
1
1
  require "mkmf"
2
+
3
+ $CFLAGS << " -std=c99 "
4
+
2
5
  create_makefile "densify"
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: densify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Symer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-05-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Densify is a general-purpose string minification gem written purely in
14
14
  C. It takes mere microseconds (literally) to minify thousands of lines of CSS to
15
- almost the size other minfiers acheive.
15
+ approximately the size other minfiers acheive.
16
16
  email: nate@ivytap.com
17
17
  executables: []
18
18
  extensions: