debride-erb 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d1550c0b031fd0a7fad139d4198a4b428962722f
4
+ data.tar.gz: e1c6c7783037cdb58910b2e4dd3f586aa2e819b4
5
+ SHA512:
6
+ metadata.gz: f297d9c6be6db4c8b914905d0ff037e840466c83dc3f7c56d0fee9ef025d6fa7103117a9cb2324ad4b876c7edddfde3dbc67f238b3f3b9496bc841556a710b35
7
+ data.tar.gz: dcf02bcb21ea46ae7d42accde3a308b5cbbc71fa51c29879bb9316f916f469d84d72aaf157ca4fe5354500e5c140d027cd5b1fa7c603bcd0d3aeeb11060c321b
@@ -0,0 +1 @@
1
+ p骫T�s����/"X^\0tC)��`t���e�y��.nh��W�H�$�n!���!��9:Po��8��������S��U4��H�_�,$(X�M��'ww0���V8��#��\c#�5�>:��!������$������oilm�I�Q6Q=ko��$�AN|`��!";�˟�����0N��ß���$u�p(q���Gj���0_4�l���Z��R1_4DU���l��؇&FΤp���)j��t
Binary file
@@ -0,0 +1,26 @@
1
+ # -*- ruby -*-
2
+
3
+ require "autotest/restart"
4
+
5
+ Autotest.add_hook :initialize do |at|
6
+ at.testlib = "minitest/autorun"
7
+ at.add_exception "tmp"
8
+
9
+ # at.extra_files << "../some/external/dependency.rb"
10
+ #
11
+ # at.libs << ":../some/external"
12
+ #
13
+ # at.add_exception "vendor"
14
+ #
15
+ # at.add_mapping(/dependency.rb/) do |f, _|
16
+ # at.files_matching(/test_.*rb$/)
17
+ # end
18
+ #
19
+ # %w(TestA TestB).each do |klass|
20
+ # at.extra_class_map[klass] = "test/test_misc.rb"
21
+ # end
22
+ end
23
+
24
+ # Autotest.add_hook :run_command do |at|
25
+ # system "rake build"
26
+ # end
File without changes
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2015-03-26
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
@@ -0,0 +1,7 @@
1
+ .autotest
2
+ History.rdoc
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/debride_erb.rb
7
+ test/test_debride_erb.rb
@@ -0,0 +1,54 @@
1
+ = debride-erb
2
+
3
+ home :: https://github.com/seattlerb/debride-erb
4
+ rdoc :: http://docs.seattlerb.org/debride-erb
5
+
6
+ == DESCRIPTION:
7
+
8
+ Extends debride to analyze erb files (erubis ala rails, actually).
9
+
10
+ == FEATURES/PROBLEMS:
11
+
12
+ * Plugs into debride to offer the ability to process .erb files.
13
+ * Includes rails' monkeypatches to extend erubis for <%= block forms.
14
+
15
+ == SYNOPSIS:
16
+
17
+ # none, really...
18
+ % gem install debride-erb
19
+ % debride app lib
20
+ ...
21
+
22
+ == REQUIREMENTS:
23
+
24
+ * debride 1.2.0 and up
25
+ * erubis
26
+
27
+ == INSTALL:
28
+
29
+ * sudo gem install debride-erb
30
+
31
+ == LICENSE:
32
+
33
+ (The MIT License)
34
+
35
+ Copyright (c) Ryan Davis, seattle.rb
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining
38
+ a copy of this software and associated documentation files (the
39
+ 'Software'), to deal in the Software without restriction, including
40
+ without limitation the rights to use, copy, modify, merge, publish,
41
+ distribute, sublicense, and/or sell copies of the Software, and to
42
+ permit persons to whom the Software is furnished to do so, subject to
43
+ the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be
46
+ included in all copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
49
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
51
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
53
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
54
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ # -*- ruby -*-
2
+
3
+ require "rubygems"
4
+ require "hoe"
5
+
6
+ Hoe.plugin :isolate
7
+ Hoe.plugin :seattlerb
8
+ Hoe.plugin :rdoc
9
+
10
+ Hoe.spec "debride-erb" do
11
+ developer "Ryan Davis", "ryand-ruby@zenspider.com"
12
+
13
+ license "MIT"
14
+
15
+ dependency "debride", "~> 1.2"
16
+ dependency "erubis", "~> 2.7.0"
17
+ end
18
+
19
+ # vim: syntax=ruby
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require "debride"
4
+ require "erb"
5
+ require "erubis"
6
+
7
+ class Debride
8
+ module Erb
9
+ VERSION = "1.0.0"
10
+ end
11
+
12
+ ##
13
+ # Process erb and parse the result. Returns the sexp of the parsed
14
+ # ruby.
15
+
16
+ def process_erb file
17
+ erb = File.read file
18
+
19
+ ruby = Erubis.new(erb).src
20
+
21
+ begin
22
+ RubyParser.new.process ruby, file
23
+ rescue => e
24
+ warn ruby if option[:verbose]
25
+ raise e
26
+ end
27
+ end
28
+
29
+ class Erubis < ::Erubis::Eruby # :nodoc:
30
+ BLOCK_EXPR = /\s+(do|\{)(\s*\|[^|]*\|)?\s*\Z/
31
+
32
+ def add_expr_literal(src, code)
33
+ if code =~ BLOCK_EXPR
34
+ src << '@output_buffer.append= ' << code
35
+ else
36
+ src << '@output_buffer.append=(' << code << ');'
37
+ end
38
+ end
39
+
40
+ def add_expr_escaped(src, code)
41
+ if code =~ BLOCK_EXPR
42
+ src << "@output_buffer.safe_append= " << code
43
+ else
44
+ src << "@output_buffer.safe_append=(" << code << ");"
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,17 @@
1
+ require "minitest/autorun"
2
+ require "debride_erb"
3
+
4
+ module TestDebride; end
5
+
6
+ class TestDebride::TestErb < Minitest::Test
7
+ def test_process_erb
8
+ sexp = Debride.new.process_erb "test/file.erb"
9
+
10
+ exp = s(:block,
11
+ s(:lasgn, :_buf, s(:str, "")),
12
+ s(:call, s(:lvar, :_buf), :<<, s(:str, "woot")),
13
+ s(:call, s(:lvar, :_buf), :to_s))
14
+
15
+ assert_equal exp, sexp
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,148 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: debride-erb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDPjCCAiagAwIBAgIBAjANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
14
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
+ GRYDY29tMB4XDTE0MDkxNzIzMDcwN1oXDTE1MDkxNzIzMDcwN1owRTETMBEGA1UE
16
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
19
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
20
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
21
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
22
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
25
+ AQAFoDJRokCQdxFfOrmsKX41KOFlU/zjrbDVM9hgB/Ur999M6OXGSi8FitXNtMwY
26
+ FVjsiAPeU7HaWVVcZkj6IhINelTkXsxgGz/qCzjHy3iUMuZWw36cS0fiWJ5rvH+e
27
+ hD7uXxJSFuyf1riDGI1aeWbQ74WMwvNstOxLUMiV5a1fzBhlxPqb537ubDjq/M/h
28
+ zPUFPVYeL5KjDHLCqI2FwIk2sEMOQgjpXHzl+3NlD2LUgUhHDMevmgVua0e2GT1B
29
+ xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
30
+ VpzF30vNaJK6ZT7xlIsIlwmH
31
+ -----END CERTIFICATE-----
32
+ date: 2015-03-27 00:00:00.000000000 Z
33
+ dependencies:
34
+ - !ruby/object:Gem::Dependency
35
+ name: debride
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.2'
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.2'
48
+ - !ruby/object:Gem::Dependency
49
+ name: erubis
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 2.7.0
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.7.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: minitest
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '5.5'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '5.5'
76
+ - !ruby/object:Gem::Dependency
77
+ name: rdoc
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '4.0'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '4.0'
90
+ - !ruby/object:Gem::Dependency
91
+ name: hoe
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '3.13'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '3.13'
104
+ description: Extends debride to analyze erb files (erubis ala rails, actually).
105
+ email:
106
+ - ryand-ruby@zenspider.com
107
+ executables: []
108
+ extensions: []
109
+ extra_rdoc_files:
110
+ - History.rdoc
111
+ - Manifest.txt
112
+ - README.rdoc
113
+ files:
114
+ - .autotest
115
+ - .gemtest
116
+ - History.rdoc
117
+ - Manifest.txt
118
+ - README.rdoc
119
+ - Rakefile
120
+ - lib/debride_erb.rb
121
+ - test/test_debride_erb.rb
122
+ homepage: https://github.com/seattlerb/debride-erb
123
+ licenses:
124
+ - MIT
125
+ metadata: {}
126
+ post_install_message:
127
+ rdoc_options:
128
+ - --main
129
+ - README.rdoc
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ requirements: []
143
+ rubyforge_project:
144
+ rubygems_version: 2.4.5
145
+ signing_key:
146
+ specification_version: 4
147
+ summary: Extends debride to analyze erb files (erubis ala rails, actually).
148
+ test_files: []
Binary file