trenni 1.4.3 → 1.4.4

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: 7b7bbd098228bcbec7f60dd080ae58a1fce57092
4
- data.tar.gz: a759d347ef7d1aea336874e6659ecc09a125d665
3
+ metadata.gz: 216efe70504b121ea181eb3de5e24978db147f7e
4
+ data.tar.gz: fe495f4698096e743427e8b1860cf214ba8d5ce8
5
5
  SHA512:
6
- metadata.gz: 3fa46a62bfeab0e19d5bc798f1eed8189f81a1d03563251ebed0a17900a7c509c5349d3bfe5d8fd9f9b34fc5958b167aac86612d6e053fdf51e4a52b5befa03e
7
- data.tar.gz: 4441c66c6e044736268b1f73e73dd2c7104e6f161d6282a6b566a4211b2fce3201360036c82679511f1b73ef80e38a835a2285d991518a28a5fb039335c39a47
6
+ metadata.gz: f18a0a7bc9a13a81289d6f14188812759e645a5cdea3f9d4a8ecaa6dcfad2da6f71679f032482b176b8ff494396e0914b8b84326f470daa1aebefe91160de918
7
+ data.tar.gz: dc5079d20186b3800de81560c6932a6a0ff23b5f084e0ea0d2f3e958742859390fa040be47560521e3cbbf0f0d3648833914929a4c61b0b5323cdb86c9bdf0bb
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --color
2
+ --format documentation
3
+ --backtrace
4
+ --warnings
data/README.md CHANGED
@@ -32,11 +32,11 @@ Or install it yourself as:
32
32
  Trenni templates work essentially the same way as all other templating systems:
33
33
 
34
34
  template = Trenni::Template.new('<?r items.each do |item| ?>#{item}<?r end ?>')
35
-
35
+
36
36
  items = 1..4
37
-
37
+
38
38
  template.to_string(binding) # => "1234"
39
-
39
+
40
40
  The code above demonstrate the only two constructs, `<?r expression ?>` and `#{output}`.
41
41
 
42
42
  Trenni provides a slightly higher performance API using objects rather than bindings. If you provide an object instance, `instance_eval` would be used instead.
@@ -58,6 +58,10 @@ Trenni can help construct XML/HTML using a simple DSL:
58
58
  end
59
59
  # => "<p><strong>Hello</strong> World</p>\n<script type=\"text/html\">\n\tconsole.log(\"Hello World\")\n</script>"
60
60
 
61
+ ### Integration
62
+
63
+ There is a [language-trenni](https://atom.io/packages/language-trenni) package for the [Atom text editor](https://atom.io). It provides syntax highlighting and integration when Trenni is used with the [utopia web framework](https://github.com/ioquatix/utopia).
64
+
61
65
  ## Contributing
62
66
 
63
67
  1. Fork it
@@ -31,7 +31,7 @@ module Trenni
31
31
  out = eval(OUT, block.binding)
32
32
  top = out.size
33
33
 
34
- block.call *args
34
+ block.call(*args)
35
35
 
36
36
  return out.pop(out.size - top).join
37
37
  end
@@ -65,7 +65,7 @@ module Trenni
65
65
  def code
66
66
  parts = ["#{OUT} = [] ; "] + @parts + ["#{OUT}"]
67
67
 
68
- code = parts.join
68
+ return parts.join
69
69
  end
70
70
  end
71
71
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Trenni
22
- VERSION = "1.4.3"
22
+ VERSION = "1.4.4"
23
23
  end
@@ -29,8 +29,9 @@ module Trenni::TemplateSpec
29
29
  describe Trenni::Template do
30
30
  it "should process list of items" do
31
31
  template = Trenni::Template.new('<?r items.each do |item| ?>#{item}<?r end ?>')
32
-
32
+
33
33
  items = 1..4
34
+
34
35
  expect(template.to_string(binding)).to be == "1234"
35
36
  end
36
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trenni
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-01 00:00:00.000000000 Z
11
+ date: 2016-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -63,6 +63,7 @@ extensions: []
63
63
  extra_rdoc_files: []
64
64
  files:
65
65
  - ".gitignore"
66
+ - ".rspec"
66
67
  - ".simplecov"
67
68
  - ".travis.yml"
68
69
  - Gemfile