liquidscript 0.10.1 → 0.10.2

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: 15d7e4ab32600ce2b30102ede1e2872f5cc907c4
4
- data.tar.gz: 92ab44730d63bacbb9585caa95b58b9bb9366ff2
3
+ metadata.gz: d86b163ef0293732b6aca713fccb309af5239f05
4
+ data.tar.gz: 15b8b68dceba0eafbda48be35f3dd1b0b71d13a8
5
5
  SHA512:
6
- metadata.gz: dc621cd96f8dcc4e4258294fd6faaca57e94aa4d0b7f43802ed3f9191d4286d6bb95b1a7e0bbab1ce1335f24d926ea79de11e2e8e4a68567a0c273843d8f83ef
7
- data.tar.gz: 8bbdd4a09b1f4474b98b5f457c42bc3e7c3027e82c0875c8932295916188dd2c574a88beb3b7cbac6b39de82760b0b920fe64b7219d9eb0a3f18a16d5b856ea3
6
+ metadata.gz: ee42e06c937b2243f25e2db3618533cb58179581459d61cf174733549398b2a353c56d1c33ebb1f0baaea47ac41efac7e9d60b751ba687b25371d0230bbe6509
7
+ data.tar.gz: 676fe68eb8b5a2af88b8d8bd25a1fd2a14dfd44e79e8284ffbef9c4e49117d36841858d82337c7f68123a5cf41a2b49f53f6428938ae782a31e748de38a0b7dc
@@ -28,11 +28,16 @@ module Liquidscript
28
28
  def generate_range(code)
29
29
  out = buffer
30
30
  out << "(function(a, b) {\n" <<
31
- indent! << "var out, i;\n" <<
31
+ indent! << "var out, i, t;\n" <<
32
+ indent << "out = [];\n" <<
33
+ indent << "if(a > b) {\n" <<
34
+ indent! << "t = a; a = b; b = t;\n" <<
35
+ unindent! << "}\n" <<
32
36
  indent << "for(i = a; i <= b; i++) {\n" <<
33
37
  indent! << "out.push(i);\n" <<
34
38
  unindent! << "};\n" <<
35
- indent << "return out;\n" <<
39
+ indent << "return t === undefined ?" <<
40
+ "out : out.reverse();\n" <<
36
41
  unindent! << "})(" << replace(code[1]) << ", " <<
37
42
  replace(code[2]) << ")"
38
43
  out
@@ -1,5 +1,5 @@
1
1
  module Liquidscript
2
2
 
3
3
  # The current version of liquidscript.
4
- VERSION = "0.10.1".freeze
4
+ VERSION = "0.10.2".freeze
5
5
  end
@@ -13,10 +13,14 @@ compiled: |
13
13
  var test;
14
14
  console = 3;
15
15
  test = (function(a, b) {
16
- var out, i;
16
+ var out, i, t;
17
+ out = [];
18
+ if(a > b) {
19
+ t = a; a = b; b = t;
20
+ }
17
21
  for(i = a; i <= b; i++) {
18
22
  out.push(i);
19
23
  };
20
- return out;
24
+ return t === undefined ? out : out.reverse();
21
25
  })(0, console);
22
26
  };
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquidscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rodi