httparrot 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module HTTParrot
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -73,16 +73,22 @@ module HTTParrot
73
73
 
74
74
  def template_root_search
75
75
  self._class ||= self.class.to_s
76
+ search_file = self.template_file
76
77
 
77
78
  template_root = HTTParrot::Config.config[:template_root] || ".."
78
79
  template_root = template_root[0..-1] if template_root[-1] == "/"
79
- filename = self._class.gsub("Widget::", "")
80
- filename.gsub!("HTTParrot::", "")
81
- return "#{template_root}/**/#{filename.underscore}.erb"
80
+
81
+ if search_file.nil? || search_file.empty?
82
+ filename = self._class.gsub("Widget::", "")
83
+ filename.gsub!("HTTParrot::", "")
84
+ search_file = filename
85
+ end
86
+
87
+ return "#{template_root}/**/#{search_file.to_s.underscore}.erb"
82
88
  end
83
89
 
84
90
  def set_template_file
85
- if self.template_file.nil? || self.template_file.empty?
91
+ if self.template_file.nil? || self.template_file.empty? || self.template_file.is_a?(Symbol)
86
92
  self.template_file = Dir.glob(template_root_search).first
87
93
  end
88
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httparrot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-02-16 00:00:00.000000000Z
13
+ date: 2012-02-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &11870200 !ruby/object:Gem::Requirement
17
+ requirement: &16372540 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - =
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '2.7'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *11870200
25
+ version_requirements: *16372540
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rake
28
- requirement: &11868780 !ruby/object:Gem::Requirement
28
+ requirement: &16372000 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *11868780
36
+ version_requirements: *16372000
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rack
39
- requirement: &11867740 !ruby/object:Gem::Requirement
39
+ requirement: &16371260 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *11867740
47
+ version_requirements: *16371260
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: activesupport
50
- requirement: &11866680 !ruby/object:Gem::Requirement
50
+ requirement: &16370540 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *11866680
58
+ version_requirements: *16370540
59
59
  description: helps cut through the clutter of HTTP testing
60
60
  email:
61
61
  - brandonsdewitt+httparrot@gmail.com
@@ -97,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
97
  version: '0'
98
98
  segments:
99
99
  - 0
100
- hash: -2796158794864830420
100
+ hash: -208081161131242637
101
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  none: false
103
103
  requirements:
@@ -106,10 +106,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: -2796158794864830420
109
+ hash: -208081161131242637
110
110
  requirements: []
111
111
  rubyforge_project: httparrot
112
- rubygems_version: 1.8.10
112
+ rubygems_version: 1.8.16
113
113
  signing_key:
114
114
  specification_version: 3
115
115
  summary: Mock Server for testing HTTP anything!