pufferfish 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pufferfish.rb +12 -4
  3. metadata +16 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c23b78cec13deaf002496287f1302a75d49f0bcf8916b11bf0ebaf6cfe05f753
4
- data.tar.gz: 248b77373342bddceca181ed68294a9ee31858f703dd96118f6542badebfc1ad
3
+ metadata.gz: 3c6171ea46968c30932ea2edc7677c842ee53cddabb2cfc7896f339b23563374
4
+ data.tar.gz: e94261473e22923a9869aeea1316f9b14961810e2b948bd51c44b5a16c855063
5
5
  SHA512:
6
- metadata.gz: 8683b990de9fa3af6c9b3227f71b2559f9dd485d8eb05f92eae3538b75b0732f745a6af51275d7acc2edd18eed541c6cfacd31a91259255bd7b81bd081204927
7
- data.tar.gz: 46bced3ad600485d5e77747494a9546b056c2227db69a37c8958948588aebb522f436fbe3778d3304283e7320a23feb5fa1749958046a4cac27c2192e5474d96
6
+ metadata.gz: f501a43cad8b8b1099ff0b0c39304fdc37f6d574c5f7d08bd5e442b3445503ccbd6afeb65904106ea824619b53db271f8febeb99fc0753fedc47631bf4b42f78
7
+ data.tar.gz: e308f3c2c4843069c0e84cf55484bb48e2b3a2866b50808d5467b5df487309fe6fe87d8e2ecc25b096ca28048ac3e6b64087adbaf2ebeea3f8c3ea2d85725c6e
data/lib/pufferfish.rb CHANGED
@@ -9,14 +9,20 @@ module Pufferfish
9
9
  contents = File.read(file)
10
10
 
11
11
  # ^\\ -> don't count escape characters \%
12
- contents = contents.gsub(/%(.*[^\\])%/) { |_|
12
+ # ? -> smallest possible match
13
+ contents = contents.gsub(/%(.*?[^\\])%/) { |_|
13
14
  match = Regexp.last_match.captures
14
15
  file = match[0]
15
- if not (file =~ /.*\..*/)
16
- file.concat(".html")
16
+ file = file
17
+ if file != ""
18
+ # Append file extension (TODO: set in config)
19
+ if not (file =~ /.*\..*/)
20
+ file.concat(".html")
21
+ end
22
+
17
23
  # Parse base dir
18
24
  if not base_dir.nil?
19
- if file =~ /\A\/.*\z/
25
+ if file =~ /\A\/.*\z/ # ?
20
26
  parse_file(file, base_dir)
21
27
  elsif base_dir =~ /\A.*\/\z/
22
28
  parse_file("#{base_dir}#{file}", base_dir)
@@ -26,6 +32,8 @@ module Pufferfish
26
32
  else
27
33
  parse_file(file, base_dir)
28
34
  end
35
+ else
36
+ STDERR.puts "found empty template identifier %%. If this is intential, consider escaping: \\%\\%"
29
37
  end
30
38
  }
31
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pufferfish
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
- - Jonas everaert
8
- autorequire:
7
+ - Jonas Everaert
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlbeautifier
@@ -24,8 +24,12 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.4.1
27
- description: Pufferfish is a templating language for html. It generates raw html,
28
- meaning that it will not affect load times.
27
+ description: |-
28
+ Pufferfish is an extensible html templating engine that generates raw html, meaning that it will not affect load times of websites.
29
+
30
+ A full-blown javascript framework is sometimes a bit overkill for a static website. Pufferfish adds some simple templating to html so you don't have to use such a framework for small projects or for pages that require fast loading. Pufferfish will compile your files to raw html.
31
+
32
+ For more information on its usage, see Pufferfish's GitHub page.
29
33
  email:
30
34
  - info@jonaseveraert.be
31
35
  executables:
@@ -41,23 +45,23 @@ homepage: https://github.com/jomy10/pufferfish
41
45
  licenses:
42
46
  - MIT
43
47
  metadata: {}
44
- post_install_message:
48
+ post_install_message:
45
49
  rdoc_options: []
46
50
  require_paths:
47
51
  - lib
48
52
  required_ruby_version: !ruby/object:Gem::Requirement
49
53
  requirements:
50
- - - ">="
54
+ - - '='
51
55
  - !ruby/object:Gem::Version
52
- version: '0'
56
+ version: 2.6.0
53
57
  required_rubygems_version: !ruby/object:Gem::Requirement
54
58
  requirements:
55
59
  - - ">="
56
60
  - !ruby/object:Gem::Version
57
61
  version: '0'
58
62
  requirements: []
59
- rubygems_version: 3.3.3
60
- signing_key:
63
+ rubygems_version: 3.0.3.1
64
+ signing_key:
61
65
  specification_version: 4
62
- summary: An html templating engine that generates static html.
66
+ summary: An extensible html templating engine that generates static html.
63
67
  test_files: []