view_tree 0.0.9 → 0.1.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWU4YzMwMzc1MmRkNjQyM2JlOWIzNWZjZmNjNmYzOGM0N2E3OTE2YQ==
4
+ OWE2YTUyNjk4MjViMWY5OWY3YmU5NzdjYWE3NmM2ZTAyMWVjODg4Mg==
5
5
  data.tar.gz: !binary |-
6
- NWQ1MDBjNjA3NWFjYzY1MzNkMmJhOWU4Zjc2M2VhMzU3M2E3MjBjOA==
6
+ YjU5MmIwZTg5N2RkOTFhMDM1YTIyZDVhNjhhMzU0MTE2YzgyY2RkMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MWJhZjMzMWUzMjQ3YzM0ZTdlMzljMjFkYTg5N2I1MTc3NTY3MWQ2MTI4Nzdh
10
- ZmE1NGUwN2M0YzMxNzcxNTgzODBjZGZhZGU2ZTk1ZjdhOWE2MGUyOGI4MDRk
11
- ZWZhNDlhYTI0NTdhYTk3YTAyNTg3MzE2ZmM4ZmRiYzE0ZmMxNmQ=
9
+ NWE5OGNlOTY5YWIyMDBhNzdhYTYwNDJlMTA1NjM3NWI1ZGRmZjdhN2E3YzJj
10
+ MmZmZjEyYjgzMjlmNmE4ZjFmZjQ0Yzc4MWVmY2VjMGMwMzY3MDMzYzkxNTJl
11
+ MjgyMTFjYzMwMWUxNGQ0OWQ0NTY0MGI0ZGE5ZjgzMzQ2YWIxOTA=
12
12
  data.tar.gz: !binary |-
13
- YzViZjkwNWMzNGUwZmUxZGE4OGYyYWJhMmM0OWI4NTY0OTllOGM2OTY4MWJl
14
- NTZhZWVkYzFkMzIyMTgxNWMzMGZmOWZmYTUyZTNlNTU4OGQwODQ5MmJiY2Q4
15
- ZWQyNzg1MzA5NWJiNjU4M2NmMWMyMDYyNmMxYzI2MGQ2ODlmODE=
13
+ MWVjNzdiYTViMDRjYzYxMjA4Y2ZmOGQ4YTM4ZWIzYWRkYjYxZWQ0NjFjNjQ1
14
+ MzAxMzI2ODk2ZjAxYjUzMzJmM2ZkZjEyOWYwYTcwN2I0MzEwZjViMDNlMTc2
15
+ MmJjMmU1MDQ2ZjgxMzA0MDg4ZWYwZmZhMjZlYjk5YTMwMTc4Y2Q=
data/README.md CHANGED
@@ -1,29 +1 @@
1
- # ViewTree
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
@@ -1,3 +1,3 @@
1
1
  module ViewTree
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
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
- File.readlines(file_name).each do |line|
36
- if !reg_partial_name.match(line).nil?
37
- partial_name = reg_partial_name.match(line)
38
- partial_name = partial_name.to_s.gsub!(/[\s'"]*/, "")
39
- if !partial_name[/spot_loader/].nil?
40
- partial_name = line[/(?<=spotpartial=>)\s*['"][a-zA-Z_\/-]+(?=['"])/].to_s.gsub!(/[\s'"]*/, "")
41
- else
42
- partial_name = File.basename(partial_name)
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.9
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-24 00:00:00.000000000 Z
11
+ date: 2013-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler