kelredd-resourceful 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -56,26 +56,26 @@ module Resourceful
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
unless "".respond_to?(:
|
59
|
+
unless "".respond_to?(:resourceful_constantize)
|
60
60
|
if Module.method(:const_get).arity == 1
|
61
|
-
def
|
61
|
+
def resourceful_constantize #:nodoc:
|
62
62
|
names = self.split('::')
|
63
63
|
names.shift if names.empty? || names.first.empty?
|
64
64
|
|
65
65
|
constant = ::Object
|
66
66
|
names.each do |name|
|
67
|
-
constant = constant.const_defined?(name) ? constant.const_get(name) :
|
67
|
+
constant = constant.const_defined?(name) ? constant.const_get(name) : raise(NameError.new("uninitialized constant #{self}"))
|
68
68
|
end
|
69
69
|
constant
|
70
70
|
end
|
71
71
|
else # Ruby 1.9 version
|
72
|
-
def
|
72
|
+
def resourceful_constantize #:nodoc:
|
73
73
|
names = self.split('::')
|
74
74
|
names.shift if names.empty? || names.first.empty?
|
75
75
|
|
76
76
|
constant = ::Object
|
77
77
|
names.each do |name|
|
78
|
-
constant = constant.const_get(name, false) ||
|
78
|
+
constant = constant.const_get(name, false) || raise(NameError.new("uninitialized constant #{self}"))
|
79
79
|
end
|
80
80
|
constant
|
81
81
|
end
|
@@ -41,7 +41,7 @@ module Resourceful
|
|
41
41
|
|
42
42
|
def self.get_result_data(result, search)
|
43
43
|
hsh_keys = search.kind_of?(String) ? search.split(/\s+/) : nil
|
44
|
-
result_data = !hsh_keys.nil? && !hsh_keys.empty? && result.respond_to?(:get_value) ? result.get_value(hsh_keys) || result : result
|
44
|
+
result_data = !hsh_keys.nil? && !hsh_keys.empty? && result.respond_to?(:get_value) ? (result.get_value(hsh_keys) || result) : result
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.format
|
@@ -36,9 +36,9 @@ module Resourceful
|
|
36
36
|
|
37
37
|
protected
|
38
38
|
|
39
|
-
def push_data(verb, path, opts, data, search=
|
39
|
+
def push_data(verb, path, opts, data, search=nil)
|
40
40
|
result = super(verb, path, opts, data)
|
41
|
-
result.search(search) || result
|
41
|
+
search.nil? ? result : (result.search(search) || result)
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.format
|
data/lib/resourceful/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kelredd-resourceful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|