rphp 0.0.2.2 → 0.0.2.3

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
  SHA256:
3
- metadata.gz: 967e41a59c5dc6bda57e6b2a7818821610ede79cb257ff969487e7d57751f296
4
- data.tar.gz: ae17f4513ac40aa25b06606e26c149c98469929091451cc39612bc048112986f
3
+ metadata.gz: 033fdad6bd4f20e9fa947a980144858170b9dc51630b3a27a074608fb73b8f90
4
+ data.tar.gz: 3f0153a34c47aba4d9c41703370321bdebda8b1fda268647d30de87a614d0034
5
5
  SHA512:
6
- metadata.gz: 141c3dd3670a768f4fcdcd3983c6f637fb9d735f5211791ff1d16fa38518acd1a7e9399a1699f11b1bc4bae1950cca18c82803c1322ac5de329d42a9b66571d5
7
- data.tar.gz: 813899cf4641ce3990b92cee4db5483192ba7fae1f398ce119e8a57aef37f5305c1a3841671def45b0198b40399503dc71c28bb45f58af922e88ba2f5d7a8262
6
+ metadata.gz: ba9d9b6af50298d510163b9ee138440c5036615a8582df17872292c972908d2fa407ee94c70db47f71b900467f3317ad44561103b756f3397d6d7f5d8713865f
7
+ data.tar.gz: 51db2a7ba47a05587db655072c1d721878922ed092dd0e5da10c0466e8fe3b8db6001ad86fe12e4194b89a025a518730daf95fdfbadf99eb76d0f7d41fafafab
data/lib/rphp/server.rb CHANGED
@@ -23,9 +23,18 @@ class Rphp::Server
23
23
  end
24
24
 
25
25
  def parse_file (input,output)
26
- output = output.split('/')[1..-1].join('/')
27
- .split('.')[0..-2].join('.')
28
- content = Tilt.new(input).render
26
+ if output.split('/') == 3
27
+ output = output.split('/')[1..-1]
28
+ .join('/')
29
+ .split('.')[0..-2]
30
+ .join('.')
31
+ end
32
+
33
+ if Tilt.templates_for(input).any?
34
+ content = Tilt.new(input).render
35
+ else
36
+ content = File.read(input)
37
+ end
29
38
  File.write(output,content)
30
39
  end
31
40
 
@@ -35,12 +44,6 @@ class Rphp::Server
35
44
  listen
36
45
  end
37
46
 
38
- def teste
39
- FileUtils.rm_rf(@output)
40
- generate_initial_files
41
- parse_folder "./#{@input}/*"
42
- end
43
-
44
47
  def parse_folder folder_name
45
48
  Dir["#{folder_name}"].each do |file|
46
49
  filename = file.split('/')[2..-1].join('/')
@@ -59,6 +62,8 @@ class Rphp::Server
59
62
  end
60
63
 
61
64
  def listen
65
+ FileUtils.rm_rf(@output)
66
+ generate_initial_files
62
67
  parse_folder "./#{@input}/*"
63
68
  listener = Listen.to(@input) do |modified, added, removed|
64
69
  parse_folder "./#{@input}/*"
data/lib/rphp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rphp
2
- VERSION = "0.0.2.2"
2
+ VERSION = "0.0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rphp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.2
4
+ version: 0.0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Walter Melo