wp-api 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wp/api/endpoints.rb +8 -0
- data/lib/wp/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9193dd33f9bcafef0988ac30e3db1e6602963ce6
|
4
|
+
data.tar.gz: 3a87c0d792c37e040e87314af9ae727b52709df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83166ac0a474b0fb258b4ca799249acfe4078830f92fe8c5476375281f573eddd6c21cab4ef7a8f59fe5c35eb8a3fc44efaa5f2adb42da88c31f06e6bc2f395d
|
7
|
+
data.tar.gz: 325aa081fe6b7f479ce202263078e9421840b7d7413516eba2a1433d15ab5977fee9073dd6c0d42ac44fa3e348919fbb56ac535d6ff56b7936e64267f59975dc
|
data/lib/wp/api/endpoints.rb
CHANGED
@@ -29,6 +29,14 @@ module WP::API
|
|
29
29
|
resource_named('pages', slug)
|
30
30
|
end
|
31
31
|
|
32
|
+
def item_named(slug)
|
33
|
+
begin
|
34
|
+
item = resource_named('posts', slug)
|
35
|
+
rescue WP::API::ResourceNotFoundError
|
36
|
+
item = resource_named('pages', slug)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
32
40
|
private
|
33
41
|
|
34
42
|
def resources(res, query = {})
|
data/lib/wp/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wp-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Young
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|