view_tree 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWE2YTUyNjk4MjViMWY5OWY3YmU5NzdjYWE3NmM2ZTAyMWVjODg4Mg==
4
+ NWJkOGZjYzMzODFkZTVkYzQxNDU4MzllM2UzYWQzMjVkYTQ2ZDdlYQ==
5
5
  data.tar.gz: !binary |-
6
- YjU5MmIwZTg5N2RkOTFhMDM1YTIyZDVhNjhhMzU0MTE2YzgyY2RkMA==
6
+ YTJhOWY0OTNjNTRhMWQzODk5ZmUxMTIwZTY3NmExYTU0ZDc4ZjI2ZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWE5OGNlOTY5YWIyMDBhNzdhYTYwNDJlMTA1NjM3NWI1ZGRmZjdhN2E3YzJj
10
- MmZmZjEyYjgzMjlmNmE4ZjFmZjQ0Yzc4MWVmY2VjMGMwMzY3MDMzYzkxNTJl
11
- MjgyMTFjYzMwMWUxNGQ0OWQ0NTY0MGI0ZGE5ZjgzMzQ2YWIxOTA=
9
+ OTllNDliZmQ0NjQ2MWQyOWY2NDI4MjExMDYyZjgwMDU0OWFiMmEzMmZiY2Jh
10
+ NmExMGM0YzY3ZDQyNDYxY2MwN2RlM2ZjMDI1YjY2ZmQxYWY2NmYwYTRkMDVi
11
+ Yzc5NGZhZWZmYzgxZTc2YzdlMjgwNjE5Njk0NmRkM2U3NGE3OTM=
12
12
  data.tar.gz: !binary |-
13
- MWVjNzdiYTViMDRjYzYxMjA4Y2ZmOGQ4YTM4ZWIzYWRkYjYxZWQ0NjFjNjQ1
14
- MzAxMzI2ODk2ZjAxYjUzMzJmM2ZkZjEyOWYwYTcwN2I0MzEwZjViMDNlMTc2
15
- MmJjMmU1MDQ2ZjgxMzA0MDg4ZWYwZmZhMjZlYjk5YTMwMTc4Y2Q=
13
+ ODU2NWM2YWYzNzc4NmViOWJmNzA4NjQxODkxMGMzMjQ0ODY3ZDQzMTZjMDE0
14
+ MzZjZGJiZmE0ZDhmNjMzYTU0YzA3MmUxZmFhMmE2Njc2N2ZhODc5NGFhY2Mz
15
+ YTBhZDNlODM3ZGViOTZhNGZhYjZlNTE0Nzk5NTA2NDEwNTljMzA=
data/bin/rel CHANGED
File without changes
@@ -1,3 +1,3 @@
1
1
  module ViewTree
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/view_tree.rb CHANGED
@@ -32,22 +32,17 @@ class Cb
32
32
 
33
33
  reg_partial_name = /(?<=(partial=>)|(render)|(spotpartial=>))\s*['"][a-zA-Z_\/-]+(?=['"])/
34
34
 
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" )
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)
46
43
  end
44
+ self.view_helper("_" + partial_name + ".html.erb" )
47
45
  end
48
- rescue
49
- puts "Please input correct controller and action name."
50
- exit
51
46
  end
52
47
 
53
48
  end
@@ -58,7 +53,7 @@ class Cb
58
53
  # Check that if user has input "bundle install --path vendor"
59
54
 
60
55
  if controller_action_name.size == 0
61
- puts "Please input controller and action name"
56
+ puts "Please input controller and action name."
62
57
  exit
63
58
  end
64
59
 
@@ -77,6 +72,14 @@ class Cb
77
72
 
78
73
  view_name = controller_action_name.gsub(/#/, "/")
79
74
 
75
+ begin
76
+ File.open(file_name)
77
+ rescue
78
+ puts "Please input correct controller and action name."
79
+ exit
80
+ end
81
+
82
+
80
83
  self.view_helper(view_name)
81
84
 
82
85
  if $file_queue.size == 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent