rabl-extend-compiler 0.1.2 → 0.1.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
  SHA1:
3
- metadata.gz: 4994a386fd78dadcbbc307abcbb14bd5a6a1fc0d
4
- data.tar.gz: d089c5a193034ea0a6abc4573efdfefb6e735f95
3
+ metadata.gz: f851b376d60d12de5dbdbb3e165280204e322990
4
+ data.tar.gz: 09cda6a887009c5e1c464c69e73ea1b6ed47cffe
5
5
  SHA512:
6
- metadata.gz: 3cf709c779108313ab6834ce4350ee00d6393c7d1ad35a09ccd357f25ace5bc017a046a27bafaddfeed2663eca5191fb02b95bb999bd2e6e14b09db45b555323
7
- data.tar.gz: 9180e79574ef28f561b34628d5c7be4f31986010ece269bba2ad86f2cbe4c9357ae2c15f08443bdc54a827ae457ec8452abca4e0c3c424d2af7fb4553f75d0c4
6
+ metadata.gz: 35cd663a9ff3ffb65a25295e910123c18b23680105ab1d00c5bfd6d00091f84f79470ec5826da79013b6c06113b8df71af2bacdfa4104d0099e5e0957a7287c0
7
+ data.tar.gz: 532c6f0d67c54dc069dd1527fbe5597c63eb0a5de0268917110a267457c6baec6b28c5c45484c1127ad145c5a5151f799e659d6b6c06fa3a64e78541f0681bc6
@@ -1,7 +1,7 @@
1
1
  module Rabl
2
2
  module Extend
3
3
  module Compiler
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
@@ -9,6 +9,7 @@ namespace :rabl do
9
9
  task :verify do
10
10
  ::Rake.application["environment"].invoke if ::Rake::Task.task_defined?("environment")
11
11
  view_paths = ::Rabl.configuration.view_paths
12
+ files_with_multiple_extensions = []
12
13
 
13
14
  view_paths.each do |view_path|
14
15
  ::Dir.glob("#{view_path}/**/*.rabl").each do |rabl_file|
@@ -21,13 +22,15 @@ namespace :rabl do
21
22
  #
22
23
  waiting = false
23
24
  waiting_hash = ""
25
+ files_with_multiple_extensions << rabl_file if file_contents.scan(/#[[:space:]]*rabl-extend-compiler[[:space:]]*extends/).size > 1
26
+
24
27
  file_contents.each_line do |file_line|
25
28
  if waiting
26
29
  waiting = !file_line.include?(waiting_hash) # if we are in a waiting state then we throw the line away
27
30
  next
28
31
  end
29
32
 
30
- if file_line.start_with?("# rabl-extend-compiler extends")
33
+ if file_line.strip.start_with?("# rabl-extend-compiler extends")
31
34
  extension_file = file_line.scan(/\A[[:space:]]*#[[:space:]]+rabl-extend-compiler[[:space:]]*extends[([:space:]]*['"]+([^"]*)['"]+/).flatten.first
32
35
  extension_filename = "#{view_path}/#{extension_file}.rabl"
33
36
  extension_file_digest = file_line.split("=>").last.gsub(/[[:space:]]/, "")
@@ -48,6 +51,17 @@ namespace :rabl do
48
51
  exit(1)
49
52
  end
50
53
  end
54
+
55
+ files_with_multiple_extensions.each do |file_with_multiple_extensions|
56
+ $stderr.puts <<~MULTIPLE_EXTENSIONS
57
+ rable-extend-compiler has found a view file with more than 1 extension
58
+ this can introduce odd behavior and should be manually verified that this
59
+ is the expected behavior for your situation
60
+
61
+ File: #{file_with_multiple_extensions}
62
+
63
+ MULTIPLE_EXTENSIONS
64
+ end
51
65
  end
52
66
  end
53
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabl-extend-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Dewitt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-25 00:00:00.000000000 Z
11
+ date: 2018-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rabl