liquidscript 0.8.0 → 0.8.1

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: 20d97cd63491fe33e34d37dac00eab8bb7f5f7dd
4
- data.tar.gz: 8bed64d2660f46dd9f4de474e756d6325fbd1f95
3
+ metadata.gz: cd57b7e3788f3e3838b91d69ca49710df545e2bf
4
+ data.tar.gz: dba5646ea70ac23f0446f6e53b999ad9e5a5b25e
5
5
  SHA512:
6
- metadata.gz: b992528f87b397087159d786bf4b7fef4b23841413ab317e0d15e1079ceb75f94ea165cfef0bfa43cb17612641478321be5f5158e5f902ae2a56a92b563e1055
7
- data.tar.gz: 6092259df275c92ac0ffbf39acc0ac65bba66fd2c68d21eb11f39e562705f3ff4a1a82d8adcfe38ff5074d34c9e227e0f97cbe791363105d787dbf7687fa3e7e
6
+ metadata.gz: 7e9ba01f2751a769829aca0739329b7c7e3640578b5ef16de23fb464b61e3443dc6f802f7dc98f8c0054b55627d6a4261d1adc1850c1aa145c5ab3d25b5f1263
7
+ data.tar.gz: 0ca0d9af4cea6992522fceff910b93bc3561df457ee98927308ddef608114221bc26ccbbab894d7af346c5de9a32c7622f56312f3fe338bd9e5ddf33b06f6805
@@ -40,12 +40,16 @@ module Liquidscript
40
40
  " " * @indent
41
41
  end
42
42
 
43
+ alias_method :indent, :indent_level
44
+
43
45
  def indent!
44
46
  @indent += 1
47
+ indent
45
48
  end
46
49
 
47
50
  def unindent!
48
51
  @indent -= 1
52
+ indent
49
53
  end
50
54
 
51
55
  def insert_into(area, buffer)
@@ -38,13 +38,13 @@ module Liquidscript
38
38
  _context :name => code[1].value,
39
39
  :inherit => code[2],
40
40
  :parts => code[3],
41
- :inheritance => "%{name}.prototype.__proto__ = %{inherit};\n",
42
- :identifier => "%{name}.prototype.%{value} = %{replace};\n",
41
+ :inheritance => "%{name}.prototype.__proto__ = %{inherit};\n",
42
+ :identifier => "%{name}.prototype.%{value} = %{replace};\n",
43
43
  :istring => "%{name}.prototype[\"%{value}\"] = %{replace};\n",
44
- :property => "%{name}.%{value} = %{replace};\n",
45
- :head => "%{name} = %{name} || function %{name}() { " +
46
- "if(this.initialize) { this.initialize.apply(this, " +
47
- "arguments); } };\n"
44
+ :property => "%{name}.%{value} = %{replace};\n",
45
+ :head => "%{name} = %{name} || function %{name}() {\n#{indent!}" <<
46
+ "if(this.initialize) {\n#{indent!}this.initialize.apply(this, " +
47
+ "arguments);\n#{unindent!}}\n#{unindent!}};\n"
48
48
  end
49
49
 
50
50
  def generate_module(code)
@@ -1,5 +1,5 @@
1
1
  module Liquidscript
2
2
 
3
3
  # The current version of liquidscript.
4
- VERSION = "0.8.0".freeze
4
+ VERSION = "0.8.1".freeze
5
5
  end
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.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rodi