view_tree 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -29
- data/lib/view_tree/version.rb +1 -1
- data/lib/view_tree.rb +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWE2YTUyNjk4MjViMWY5OWY3YmU5NzdjYWE3NmM2ZTAyMWVjODg4Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjU5MmIwZTg5N2RkOTFhMDM1YTIyZDVhNjhhMzU0MTE2YzgyY2RkMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWE5OGNlOTY5YWIyMDBhNzdhYTYwNDJlMTA1NjM3NWI1ZGRmZjdhN2E3YzJj
|
10
|
+
MmZmZjEyYjgzMjlmNmE4ZjFmZjQ0Yzc4MWVmY2VjMGMwMzY3MDMzYzkxNTJl
|
11
|
+
MjgyMTFjYzMwMWUxNGQ0OWQ0NTY0MGI0ZGE5ZjgzMzQ2YWIxOTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWVjNzdiYTViMDRjYzYxMjA4Y2ZmOGQ4YTM4ZWIzYWRkYjYxZWQ0NjFjNjQ1
|
14
|
+
MzAxMzI2ODk2ZjAxYjUzMzJmM2ZkZjEyOWYwYTcwN2I0MzEwZjViMDNlMTc2
|
15
|
+
MmJjMmU1MDQ2ZjgxMzA0MDg4ZWYwZmZhMjZlYjk5YTMwMTc4Y2Q=
|
data/README.md
CHANGED
@@ -1,29 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
TODO: Write a gem description
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'view_tree'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install view_tree
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
1
|
+
view_tree
|
data/lib/view_tree/version.rb
CHANGED
data/lib/view_tree.rb
CHANGED
@@ -32,18 +32,24 @@ class Cb
|
|
32
32
|
|
33
33
|
reg_partial_name = /(?<=(partial=>)|(render)|(spotpartial=>))\s*['"][a-zA-Z_\/-]+(?=['"])/
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
partial_name
|
41
|
-
|
42
|
-
|
35
|
+
begin
|
36
|
+
File.readlines(file_name).each do |line|
|
37
|
+
if !reg_partial_name.match(line).nil?
|
38
|
+
partial_name = reg_partial_name.match(line)
|
39
|
+
partial_name = partial_name.to_s.gsub!(/[\s'"]*/, "")
|
40
|
+
if !partial_name[/spot_loader/].nil?
|
41
|
+
partial_name = line[/(?<=spotpartial=>)\s*['"][a-zA-Z_\/-]+(?=['"])/].to_s.gsub!(/[\s'"]*/, "")
|
42
|
+
else
|
43
|
+
partial_name = File.basename(partial_name)
|
44
|
+
end
|
45
|
+
self.view_helper("_" + partial_name + ".html.erb" )
|
43
46
|
end
|
44
|
-
self.view_helper("_" + partial_name + ".html.erb" )
|
45
47
|
end
|
48
|
+
rescue
|
49
|
+
puts "Please input correct controller and action name."
|
50
|
+
exit
|
46
51
|
end
|
52
|
+
|
47
53
|
end
|
48
54
|
|
49
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|