wordpress_client 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07d49e4293481ae704072d12288a60a97d1182ec
4
- data.tar.gz: be101dbc5a42658d3b9639bf0cc6d1753f246d00
3
+ metadata.gz: 3bd8f4433a29ac4f20d54d6da4927412cead3fb1
4
+ data.tar.gz: 757a924fa15dcc666a24c672858076027cdae856
5
5
  SHA512:
6
- metadata.gz: 8cec642f556f04ff4f5c418dda5c560956b7a1c1d3cd17184a2312a0a9d35daf5c9fb60834055375d3b27b0c1623d74b3b9bf860adb9334bc476d2c22b13f87a
7
- data.tar.gz: d149bb98f48f1f164aef95cbad14d60669b553abd78f2968ccae16be2e0582d887d2af3b1e81f8dda8fa29e69958530a95dfe37168020ac04b40a3a8ba73f709
6
+ metadata.gz: 7fe40c7cda920e86de18cffd8f6c717de65576b07ee14db1ef5a264677a1bf1403c3e494a5ef05ae17160e83833d50fc2f2843e25738f48d4f634c0b5a488eca
7
+ data.tar.gz: 2c1a4c7d51dabdbdedcda5c1824a6a6a3bec1ccb228e1d5efd7e0c5d28adeacae8ecca45b7d1ace6fd9adcfa6eea7203b5cafd1fc1d7863ede7ad0b24701729e
data/.codeclimate.yml CHANGED
@@ -1,14 +1,23 @@
1
- ---
2
1
  engines:
3
- rubocop:
2
+ duplication:
4
3
  enabled: true
5
- bundler-audit:
4
+ config:
5
+ languages:
6
+ - ruby
7
+ rubocop:
6
8
  enabled: true
7
9
  fixme:
8
10
  enabled: true
11
+ config:
12
+ strings:
13
+ - FIXME
14
+ - TODO
9
15
  ratings:
10
16
  paths:
11
- - lib/**/*.rb
17
+ - Gemfile.lock
18
+ - lib/**
19
+ - "**.rb"
12
20
  exclude_paths:
13
- - spec/**/*
14
- - ".*"
21
+ - doc/**/*
22
+ - spec/**/*
23
+ - tmp/**/*
data/.rubocop.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.2
2
3
  Include:
3
4
  - "**/*.gemspec"
4
5
  - "**/*.podspec"
@@ -15,12 +16,10 @@ AllCops:
15
16
  - "**/Berksfile"
16
17
  - "**/Cheffile"
17
18
  - "**/Vagabondfile"
18
- Exclude:
19
- - "vendor/**/*"
20
- - "db/schema.rb"
21
- RunRailsCops: false
22
19
  DisplayCopNames: false
23
20
  StyleGuideCopsOnly: false
21
+ Rails:
22
+ Enabled: false
24
23
  Style/AccessModifierIndentation:
25
24
  Description: Check indentation of private/protected visibility modifiers.
26
25
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
@@ -275,7 +274,7 @@ Style/MultilineOperationIndentation:
275
274
  Style/NumericLiterals:
276
275
  Description: Add underscores to large numeric literals to improve their readability.
277
276
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
278
- Enabled: false
277
+ Enabled: true
279
278
  MinDigits: 5
280
279
  Style/ParenthesesAroundCondition:
281
280
  Description: Don't use parentheses around the condition of an if/unless/while.
@@ -432,14 +431,14 @@ Style/TrailingBlankLines:
432
431
  SupportedStyles:
433
432
  - final_newline
434
433
  - final_blank_line
435
- Style/TrailingComma:
436
- Description: Checks for trailing comma in parameter lists and literals.
437
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
434
+ Style/TrailingCommaInArguments:
435
+ Description: 'Checks for trailing comma in argument lists.'
436
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
437
+ Enabled: false
438
+ Style/TrailingCommaInLiteral:
439
+ Description: 'Checks for trailing comma in array and hash literals.'
440
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
438
441
  Enabled: false
439
- EnforcedStyleForMultiline: no_comma
440
- SupportedStyles:
441
- - comma
442
- - no_comma
443
442
  Style/TrivialAccessors:
444
443
  Description: Prefer attr_* methods to trivial readers/writers.
445
444
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
@@ -558,11 +557,6 @@ Rails/ActionFilter:
558
557
  - filter
559
558
  Include:
560
559
  - app/controllers/**/*.rb
561
- Rails/DefaultScope:
562
- Description: Checks if the argument passed to default_scope is a block.
563
- Enabled: true
564
- Include:
565
- - app/models/**/*.rb
566
560
  Rails/HasAndBelongsToMany:
567
561
  Description: Prefer has_many :through to has_and_belongs_to_many.
568
562
  Enabled: true
@@ -576,6 +570,11 @@ Rails/Output:
576
570
  - config/**/*.rb
577
571
  - db/**/*.rb
578
572
  - lib/**/*.rb
573
+ Exclude:
574
+ - lib/capistrano/**/*.rb
575
+ - config/deploy.rb
576
+ - config/deploy/**/*.rb
577
+ - lib/tasks/**/*.rb
579
578
  Rails/ReadWriteAttribute:
580
579
  Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
581
580
  Enabled: true
@@ -744,6 +743,7 @@ Style/IndentationConsistency:
744
743
  Style/IndentArray:
745
744
  Description: Checks the indentation of the first element in an array literal.
746
745
  Enabled: true
746
+ EnforcedStyle: consistent
747
747
  Style/InfiniteLoop:
748
748
  Description: Use Kernel#loop for infinite loops.
749
749
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
@@ -840,9 +840,10 @@ Style/SelfAssignment:
840
840
  used.
841
841
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
842
842
  Enabled: false
843
- Style/SingleSpaceBeforeFirstArg:
844
- Description: Checks that exactly one space is used between a method name and the
845
- first argument for method calls without parentheses.
843
+ Style/SpaceBeforeFirstArg:
844
+ Description: >-
845
+ Checks that exactly one space is used between a method name
846
+ and the first argument for method calls without parentheses.
846
847
  Enabled: true
847
848
  Style/SpaceAfterColon:
848
849
  Description: Use spaces after colons.
@@ -852,8 +853,8 @@ Style/SpaceAfterComma:
852
853
  Description: Use spaces after commas.
853
854
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
854
855
  Enabled: true
855
- Style/SpaceAfterControlKeyword:
856
- Description: Use spaces after if/elsif/unless/while/until/case/when.
856
+ Style/SpaceAroundKeyword:
857
+ Description: 'Use a space around keywords if appropriate.'
857
858
  Enabled: true
858
859
  Style/SpaceAfterMethodName:
859
860
  Description: Do not put a space between a method name and the opening parenthesis
@@ -881,9 +882,6 @@ Style/SpaceAroundOperators:
881
882
  Description: Use spaces around operators.
882
883
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
883
884
  Enabled: true
884
- Style/SpaceBeforeModifierKeyword:
885
- Description: Put a space before the modifier keyword.
886
- Enabled: true
887
885
  Style/SpaceInsideBrackets:
888
886
  Description: No spaces after [ or before ].
889
887
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
@@ -940,6 +938,11 @@ Style/WhileUntilDo:
940
938
  Description: Checks for redundant do after while or until.
941
939
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
942
940
  Enabled: true
941
+ Style/MultilineMethodCallIndentation:
942
+ Description: Checks the indentation of the method name part in method calls that span more than one line.
943
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
944
+ Enabled: true
945
+ EnforcedStyle: indented
943
946
  Lint/AmbiguousOperator:
944
947
  Description: Checks for ambiguous operators in the first argument of a method invocation
945
948
  without parentheses.
@@ -1019,10 +1022,6 @@ Lint/ShadowingOuterLocalVariable:
1019
1022
  Description: Do not use the same name as outer local variable for block arguments
1020
1023
  or block local variables.
1021
1024
  Enabled: true
1022
- Lint/SpaceBeforeFirstArg:
1023
- Description: Put a space between a method name and the first argument in a method
1024
- call without parentheses.
1025
- Enabled: true
1026
1025
  Lint/StringConversionInInterpolation:
1027
1026
  Description: Checks for Object#to_s usage in string interpolation.
1028
1027
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
@@ -1063,3 +1062,6 @@ Lint/Void:
1063
1062
  Rails/Delegate:
1064
1063
  Description: Prefer delegate method for delegations.
1065
1064
  Enabled: false
1065
+ Rails/TimeZone:
1066
+ Enabled: true
1067
+ EnforcedStyle: flexible
data/Changelog.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.0.1
2
+
3
+ * Bugfixes for latest Wordpress
4
+ * Security update changed the API responses completely for metadata and taxonomy.
5
+
1
6
  # 1.0.0
2
7
 
3
8
  * Initial release
data/Gemfile CHANGED
@@ -5,7 +5,12 @@ gemspec
5
5
 
6
6
  gem "codeclimate-test-reporter", group: :test, require: nil
7
7
 
8
- group :development do
8
+ group :development, :test do
9
+ gem 'pry'
10
+ gem 'pry-byebug', require: true
11
+ end
12
+
13
+ group :guard do
9
14
  gem 'guard', '~> 2.13'
10
15
  gem 'guard-rspec', '~> 4.6'
11
16
  end
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  WordpressClient is a very simple client for the Wordpress [WP REST API plugin][api] (version 2 beta 8.0).
4
4
 
5
- [![Circle CI](https://circleci.com/gh/hemnet/wordpress_client.svg?style=svg)](https://circleci.com/gh/hemnet/wordpress_client) [![Code Climate](https://codeclimate.com/repos/5645938269568041da00cded/badges/5e870b57428f23c1f2ff/gpa.svg)](https://codeclimate.com/repos/5645938269568041da00cded/feed) [![Test Coverage](https://codeclimate.com/repos/5645938269568041da00cded/badges/5e870b57428f23c1f2ff/coverage.svg)](https://codeclimate.com/repos/5645938269568041da00cded/coverage) [![Gem Version](https://badge.fury.io/rb/wordpress_client.svg)](https://badge.fury.io/rb/wordpress_client)
5
+ [![Circle CI](https://circleci.com/gh/hemnet/wordpress_client.svg?style=svg)](https://circleci.com/gh/hemnet/wordpress_client) [![Code Climate](https://codeclimate.com/repos/5645938269568041da00cded/badges/5e870b57428f23c1f2ff/gpa.svg)](https://codeclimate.com/repos/5645938269568041da00cded/feed) [![Test Coverage](https://codeclimate.com/repos/5645938269568041da00cded/badges/5e870b57428f23c1f2ff/coverage.svg)](https://codeclimate.com/repos/5645938269568041da00cded/coverage) [![Gem Version](https://badge.fury.io/rb/wordpress_client.svg)](https://badge.fury.io/rb/wordpress_client)[![Dependency Status](https://gemnasium.com/hemnet/wordpress_client.svg)](https://gemnasium.com/hemnet/wordpress_client)
6
6
 
7
7
  ## Usage
8
8
 
data/circle.yml CHANGED
@@ -1,3 +1,6 @@
1
1
  machine:
2
2
  services:
3
3
  - docker
4
+ dependencies:
5
+ bundler:
6
+ without: [guard]
@@ -63,7 +63,7 @@ module WordpressClient
63
63
  def assign_featured_image(post)
64
64
  featured_id = data["featured_image"]
65
65
  if featured_id
66
- features = (embedded["https://api.w.org/featuredmedia"] || []).flatten
66
+ features = (embedded["wp:featuredmedia"] || []).flatten
67
67
  media = features.detect { |feature| feature["id"] == featured_id }
68
68
  if media
69
69
  post.featured_image = Media.parse(media)
@@ -72,7 +72,7 @@ module WordpressClient
72
72
  end
73
73
 
74
74
  def parse_metadata
75
- embedded_metadata = (embedded["https://api.w.org/meta"] || []).flatten
75
+ embedded_metadata = (embedded["wp:meta"] || []).flatten
76
76
  validate_embedded_metadata(embedded_metadata)
77
77
 
78
78
  meta = {}
@@ -87,7 +87,7 @@ module WordpressClient
87
87
  end
88
88
 
89
89
  def embedded_terms(type)
90
- term_collections = embedded["https://api.w.org/term"] || []
90
+ term_collections = embedded["wp:term"] || embedded["https://api.w.org/term"] || []
91
91
 
92
92
  # term_collections is an array of arrays with terms in them. We can see
93
93
  # the type of the "collection" by inspecting the first child's taxonomy.
@@ -3,5 +3,5 @@ module WordpressClient
3
3
  #
4
4
  # @note This only applies if using a released version. A development build
5
5
  # would not correspond to this constant.
6
- VERSION = "1.0.0"
6
+ VERSION = "1.0.1"
7
7
  end
@@ -6,7 +6,7 @@ module WordpressClient
6
6
  Connection.new(url: "http://example.com/", username: "jane", password: "doe")
7
7
  }
8
8
 
9
- let(:base_url) { "http://jane:doe@example.com/wp/v2" }
9
+ let(:base_url) { "http://example.com/wp/v2" }
10
10
  let(:model) { class_double(Post, parse: model_instance) }
11
11
  let(:model_instance) { instance_double(Post) }
12
12
 
@@ -235,11 +235,12 @@ module WordpressClient
235
235
  headers = {"content-type" => "#{content_type}; charset=utf-8"}
236
236
  headers["X-WP-Total"] = total.to_s if total
237
237
 
238
- stub_request(:get, path).to_return(status: status, body: body, headers: headers)
238
+ stub_request(:get, path).with(basic_auth: ['jane', 'doe']).to_return(status: status, body: body, headers: headers)
239
239
  end
240
240
 
241
241
  def stub_successful_post_with_redirect(path, data, redirects_to:)
242
242
  stub_request(:post, path).with(
243
+ basic_auth: ['jane', 'doe'],
243
244
  headers: {"content-type" => "application/json; charset=#{"".encoding}"},
244
245
  body: data.to_json,
245
246
  ).to_return(
@@ -249,7 +250,9 @@ module WordpressClient
249
250
  end
250
251
 
251
252
  def stub_failing_post(path, returns:, status:)
252
- stub_request(:post, path).to_return(
253
+ stub_request(:post, path).with(
254
+ basic_auth: ['jane', 'doe']
255
+ ).to_return(
253
256
  status: status,
254
257
  body: returns.to_json,
255
258
  headers: {"content-type" => "application/json; charset=utf-8"},
@@ -258,6 +261,7 @@ module WordpressClient
258
261
 
259
262
  def stub_patch(path, data, returns:, status: 200)
260
263
  stub_request(:patch, path).with(
264
+ basic_auth: ['jane', 'doe'],
261
265
  headers: {"content-type" => "application/json; charset=#{"".encoding}"},
262
266
  body: data.to_json,
263
267
  ).to_return(
@@ -1,5 +1,14 @@
1
1
  FROM appcontainers/wordpress
2
2
 
3
+ # Wordpress latest isn't actually the lastest we want to be on the bleeding edge
4
+ RUN rm -rf /var/www/html/
5
+ RUN wget -P /var/www/html/ https://wordpress.org/latest.zip && \
6
+ unzip /var/www/html/latest.zip -d /var/www/html/ && \
7
+ rm -fr /var/www/html/latest.zip
8
+
9
+ # Copy the WP-Config file
10
+ RUN cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php
11
+
3
12
  # base image only contains American timezones
4
13
  RUN yum install -y tzdata
5
14
 
@@ -38,3 +47,12 @@ RUN curl -SL -o /tmp/rest-api.zip https://downloads.wordpress.org/plugin/rest-ap
38
47
  RUN curl -SL https://github.com/WP-API/Basic-Auth/archive/master.tar.gz \
39
48
  | tar -xzC /var/www/html/wordpress/wp-content/plugins/ \
40
49
  && mv /var/www/html/wordpress/wp-content/plugins/Basic-Auth* /var/www/html/wordpress/wp-content/plugins/basic-auth
50
+
51
+ # The appcontainer will run apache in the foreground after running their setup
52
+ # script. The setup script will unset all the env variables with passwords and
53
+ # other important information so they aren't exposed to the foregrounded apache
54
+ # process, so for this reason we cannot just append our DB restore to that
55
+ # script.
56
+ # The container used to just run bash, and by switching back to that we get
57
+ # everything working again.
58
+ CMD /bin/bash
@@ -1 +1 @@
1
- {"id":4,"date":null,"guid":{"rendered":"http:\/\/192.168.99.100:8181\/?p=4"},"modified":null,"modified_gmt":null,"slug":"","type":"post","link":"http:\/\/192.168.99.100:8181\/?p=4","title":{"rendered":"Metadata creation"},"content":{"rendered":""},"excerpt":{"rendered":""},"author":1,"featured_image":0,"comment_status":"open","ping_status":"open","sticky":false,"format":"standard","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts"}],"author":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments?post_id=4"}],"version-history":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"https:\/\/api.w.org\/attachment":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/media?post_parent=4"}],"https:\/\/api.w.org\/term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/category"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/tag"},{"taxonomy":"post_format","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/post_format"}],"https:\/\/api.w.org\/meta":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/meta"}]},"_embedded":{"author":[{"avatar_urls":{"24":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=24&d=mm&r=g","48":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=96&d=mm&r=g"},"description":"","id":1,"link":"http:\/\/192.168.99.100:8181\/author\/test\/","name":"test","url":"","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users"}]}}],"replies":[[{"id":1,"parent":0,"author":0,"author_name":"Mr WordPress","author_url":"https:\/\/wordpress.org\/","author_avatar_urls":{"24":"http:\/\/1.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/1.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"date":"2015-11-03T07:47:41","content":{"rendered":"<p>Hi, this is a comment.<br \/>\nTo delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.<\/p>\n"},"link":"http:\/\/192.168.99.100:8181\/2015\/11\/03\/hello-world\/#comment-1","type":"comment","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/1"}]}}]],"https:\/\/api.w.org\/term":[[{"id":1,"link":"http:\/\/192.168.99.100:8181\/category\/uncategorized\/","name":"Uncategorized","slug":"uncategorized","taxonomy":"category","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category"}]}}],[],[{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}]],"https:\/\/api.w.org\/meta":[[{"code":"rest_forbidden","message":"Sorry, you cannot view the meta for this post.","data":{"status":403}}]]}}
1
+ {"id":4,"date":null,"guid":{"rendered":"http:\/\/192.168.99.100:8181\/?p=4"},"modified":null,"modified_gmt":null,"slug":"","type":"post","link":"http:\/\/192.168.99.100:8181\/?p=4","title":{"rendered":"Metadata creation"},"content":{"rendered":""},"excerpt":{"rendered":""},"author":1,"featured_image":0,"comment_status":"open","ping_status":"open","sticky":false,"format":"standard","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts"}],"author":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments?post_id=4"}],"version-history":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"https:\/\/api.w.org\/attachment":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/media?post_parent=4"}],"https:\/\/api.w.org\/term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/category"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/tag"},{"taxonomy":"post_format","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/post_format"}],"wp:meta":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/meta"}]},"_embedded":{"author":[{"avatar_urls":{"24":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=24&d=mm&r=g","48":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=96&d=mm&r=g"},"description":"","id":1,"link":"http:\/\/192.168.99.100:8181\/author\/test\/","name":"test","url":"","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users"}]}}],"replies":[[{"id":1,"parent":0,"author":0,"author_name":"Mr WordPress","author_url":"https:\/\/wordpress.org\/","author_avatar_urls":{"24":"http:\/\/1.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/1.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"date":"2015-11-03T07:47:41","content":{"rendered":"<p>Hi, this is a comment.<br \/>\nTo delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.<\/p>\n"},"link":"http:\/\/192.168.99.100:8181\/2015\/11\/03\/hello-world\/#comment-1","type":"comment","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/1"}]}}]],"https:\/\/api.w.org\/term":[[{"id":1,"link":"http:\/\/192.168.99.100:8181\/category\/uncategorized\/","name":"Uncategorized","slug":"uncategorized","taxonomy":"category","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category"}]}}],[],[{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}]],"wp:meta":[[{"code":"rest_forbidden","message":"Sorry, you cannot view the meta for this post.","data":{"status":403}}]]}}
@@ -1 +1 @@
1
- {"id":4,"date":null,"guid":{"rendered":"http:\/\/192.168.99.100:8181\/?p=4"},"modified":null,"modified_gmt":null,"slug":"","type":"post","link":"http:\/\/192.168.99.100:8181\/?p=4","title":{"rendered":"Metadata creation"},"content":{"rendered":""},"excerpt":{"rendered":""},"author":1,"featured_image":0,"comment_status":"open","ping_status":"open","sticky":false,"format":"standard","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts"}],"author":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments?post_id=4"}],"version-history":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"https:\/\/api.w.org\/attachment":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/media?post_parent=4"}],"https:\/\/api.w.org\/term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/category"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/tag"},{"taxonomy":"post_format","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/post_format"}],"https:\/\/api.w.org\/meta":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/meta"}]},"_embedded":{"author":[{"avatar_urls":{"24":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=24&d=mm&r=g","48":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=96&d=mm&r=g"},"description":"","id":1,"link":"http:\/\/192.168.99.100:8181\/author\/test\/","name":"test","url":"","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users"}]}}],"replies":[[{"id":1,"parent":0,"author":0,"author_name":"Mr WordPress","author_url":"https:\/\/wordpress.org\/","author_avatar_urls":{"24":"http:\/\/1.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/1.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"date":"2015-11-03T07:47:41","content":{"rendered":"<p>Hi, this is a comment.<br \/>\nTo delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.<\/p>\n"},"link":"http:\/\/192.168.99.100:8181\/2015\/11\/03\/hello-world\/#comment-1","type":"comment","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/1"}]}}]],"https:\/\/api.w.org\/term":[[{"id":1,"link":"http:\/\/192.168.99.100:8181\/category\/uncategorized\/","name":"Uncategorized","slug":"uncategorized","taxonomy":"category","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category"}]}}],[],[{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}]],"https:\/\/api.w.org\/meta":[[{"id":2,"key":"foo","value":"bar","_links":{"about":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/posts\/4"}]}}]]}}
1
+ {"id":4,"date":null,"guid":{"rendered":"http:\/\/192.168.99.100:8181\/?p=4"},"modified":null,"modified_gmt":null,"slug":"","type":"post","link":"http:\/\/192.168.99.100:8181\/?p=4","title":{"rendered":"Metadata creation"},"content":{"rendered":""},"excerpt":{"rendered":""},"author":1,"featured_image":0,"comment_status":"open","ping_status":"open","sticky":false,"format":"standard","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts"}],"author":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments?post_id=4"}],"version-history":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"https:\/\/api.w.org\/attachment":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/media?post_parent=4"}],"https:\/\/api.w.org\/term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/category"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/tag"},{"taxonomy":"post_format","embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/terms\/post_format"}],"wp:meta":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/4\/meta"}]},"_embedded":{"author":[{"avatar_urls":{"24":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=24&d=mm&r=g","48":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/55502f40dc8b7c769880b10874abc9d0?s=96&d=mm&r=g"},"description":"","id":1,"link":"http:\/\/192.168.99.100:8181\/author\/test\/","name":"test","url":"","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/users"}]}}],"replies":[[{"id":1,"parent":0,"author":0,"author_name":"Mr WordPress","author_url":"https:\/\/wordpress.org\/","author_avatar_urls":{"24":"http:\/\/1.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/1.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"date":"2015-11-03T07:47:41","content":{"rendered":"<p>Hi, this is a comment.<br \/>\nTo delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.<\/p>\n"},"link":"http:\/\/192.168.99.100:8181\/2015\/11\/03\/hello-world\/#comment-1","type":"comment","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/posts\/1"}]}}]],"https:\/\/api.w.org\/term":[[{"id":1,"link":"http:\/\/192.168.99.100:8181\/category\/uncategorized\/","name":"Uncategorized","slug":"uncategorized","taxonomy":"category","_links":{"self":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category\/1"}],"collection":[{"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/v2\/terms\/category"}]}}],[],[{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}]],"wp:meta":[[{"id":2,"key":"foo","value":"bar","_links":{"about":[{"embeddable":true,"href":"http:\/\/192.168.99.100:8181\/wp-json\/wp\/posts\/4"}]}}]]}}
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,7 @@ if ENV['CODECLIMATE_REPO_TOKEN']
4
4
  end
5
5
 
6
6
  require "webmock/rspec"
7
+ require "pry"
7
8
 
8
9
  require_relative "support/wordpress_server"
9
10
  require_relative "support/fixtures"
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.7"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "rspec", "~> 3.3"
26
- spec.add_development_dependency "webmock", "~> 1.22"
26
+ spec.add_development_dependency "webmock", "~> 2.0"
27
27
  spec.add_development_dependency "yard", "~> 0.8.7"
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordpress_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Bergmark
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-16 00:00:00.000000000 Z
12
+ date: 2016-05-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '1.22'
76
+ version: '2.0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '1.22'
83
+ version: '2.0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: yard
86
86
  requirement: !ruby/object:Gem::Requirement