wordpress_client 0.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +30 -0
  3. data/.codeclimate.yml +23 -0
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +147 -90
  6. data/.yardopts +1 -0
  7. data/Changelog.md +16 -0
  8. data/Gemfile +6 -1
  9. data/README.md +48 -14
  10. data/Rakefile +37 -0
  11. data/lib/wordpress_client/category.rb +2 -0
  12. data/lib/wordpress_client/client.rb +235 -79
  13. data/lib/wordpress_client/connection.rb +10 -10
  14. data/lib/wordpress_client/errors.rb +41 -6
  15. data/lib/wordpress_client/media.rb +49 -1
  16. data/lib/wordpress_client/media_parser.rb +3 -0
  17. data/lib/wordpress_client/paginated_collection.rb +61 -4
  18. data/lib/wordpress_client/post.rb +63 -16
  19. data/lib/wordpress_client/post_parser.rb +12 -39
  20. data/lib/wordpress_client/rest_parser.rb +4 -0
  21. data/lib/wordpress_client/tag.rb +2 -0
  22. data/lib/wordpress_client/term.rb +30 -0
  23. data/lib/wordpress_client/version.rb +5 -1
  24. data/lib/wordpress_client.rb +21 -5
  25. data/spec/client_spec.rb +17 -181
  26. data/spec/connection_spec.rb +15 -14
  27. data/spec/docker/Dockerfile +35 -10
  28. data/spec/docker/README.md +53 -16
  29. data/spec/docker/dbdump.sql.gz +0 -0
  30. data/spec/docker/restore-dbdump.sh +2 -2
  31. data/spec/docker/yum.repos.d/CentOS-Base.repo +25 -0
  32. data/spec/fixtures/image-media.json +1 -1
  33. data/spec/fixtures/post-with-metadata.json +99 -1
  34. data/spec/fixtures/simple-post.json +324 -1
  35. data/spec/integration/attachments_crud_spec.rb +1 -1
  36. data/spec/integration/posts_crud_spec.rb +1 -1
  37. data/spec/integration/posts_finding_spec.rb +0 -69
  38. data/spec/integration/posts_metadata_spec.rb +11 -11
  39. data/spec/integration/posts_with_attachments_spec.rb +20 -6
  40. data/spec/media_spec.rb +14 -0
  41. data/spec/post_spec.rb +5 -31
  42. data/spec/spec_helper.rb +1 -0
  43. data/spec/support/docker_runner.rb +33 -13
  44. data/spec/support/wordpress_server.rb +112 -74
  45. data/wordpress_client.gemspec +17 -17
  46. metadata +43 -31
  47. data/.hound.yml +0 -2
  48. data/.ruby-version +0 -1
  49. data/circle.yml +0 -3
  50. data/lib/wordpress_client/replace_metadata.rb +0 -81
  51. data/lib/wordpress_client/replace_terms.rb +0 -62
  52. data/spec/fixtures/post-with-forbidden-metadata.json +0 -1
  53. data/spec/integration/category_assignment_spec.rb +0 -29
  54. data/spec/integration/tag_assignment_spec.rb +0 -29
  55. data/spec/replace_metadata_spec.rb +0 -56
  56. data/spec/replace_terms_spec.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: db9e904a3d97870c4ca1077dd350b7466ed63716
4
- data.tar.gz: a40076833498ef6f90faa6a592da1cb4898d6972
2
+ SHA256:
3
+ metadata.gz: 164f4faf3691154981a640128736ad8d21e4bf1943be4ceffe19b07d9e386a0e
4
+ data.tar.gz: b04736bae22da05d4dc76695bf06c811e38c22a82a7265bd8102bed7315677b4
5
5
  SHA512:
6
- metadata.gz: 539fb8ba5bceeb76a86b32336792a79ffd7df4c8a2a0abb1a2632fdf64aac1d0a4fe8720c3036697f0248746e00e9f30742b9efcc30c43e61ee8b8bed29341ff
7
- data.tar.gz: c456230269ebcac532ca2d4b7e141134822243240f620b4d3cb06f5067a29a3c05b16246ad5cd38cbe19ca1484863e57c4bd20e46b534da27adb49143a279ac6
6
+ metadata.gz: c228109e84f115ec5a2eb8e5e8a316efb24cc1b030118b13a0d6bdea12c66a86d82859ac660564aa630c8d40d7f19d8cb8697e287ed07963d7443ee1a6b408c0
7
+ data.tar.gz: ae29c6b66f3e1722f9524f612f30d8618550c284a5902183d074f029c8904da5efe9bac2d131c09ff1542458c838ef5e2896798c6d7d1a546edec4d9b654d79e
@@ -0,0 +1,30 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/ruby:2.4
6
+ - image: hemnet/wordpress_client_test:latest
7
+ name: wordpress
8
+ environment:
9
+ WORDPRESS_HOST: wordpress
10
+ environment:
11
+ - CI: "true"
12
+ steps:
13
+ - checkout
14
+ - run:
15
+ name: Update Bundler
16
+ command: gem install bundler
17
+ - restore_cache:
18
+ keys:
19
+ - wordpress_client-bundle-{{ checksum "Gemfile" }}-{{ checksum "wordpress_client.gemspec" }}
20
+ - wordpress_client-bundle-
21
+ - run:
22
+ name: Bundle install
23
+ command: bundle check || bundle install --without "guard"
24
+ - save_cache:
25
+ key: wordpress_client-bundle-{{ checksum "Gemfile" }}-{{ checksum "wordpress_client.gemspec" }}
26
+ paths:
27
+ - vendor/bundle
28
+ - run:
29
+ name: RSpec
30
+ command: bundle exec rspec
data/.codeclimate.yml ADDED
@@ -0,0 +1,23 @@
1
+ engines:
2
+ duplication:
3
+ enabled: true
4
+ config:
5
+ languages:
6
+ - ruby
7
+ rubocop:
8
+ enabled: true
9
+ fixme:
10
+ enabled: true
11
+ config:
12
+ strings:
13
+ - FIXME
14
+ - TODO
15
+ ratings:
16
+ paths:
17
+ - Gemfile.lock
18
+ - lib/**
19
+ - "**.rb"
20
+ exclude_paths:
21
+ - doc/**/*
22
+ - spec/**/*
23
+ - tmp/**/*
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ /.ruby-version
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.2
3
+ TargetRailsVersion: 4.2
2
4
  Include:
3
5
  - "**/*.gemspec"
4
6
  - "**/*.podspec"
@@ -18,10 +20,13 @@ AllCops:
18
20
  Exclude:
19
21
  - "vendor/**/*"
20
22
  - "db/schema.rb"
21
- RunRailsCops: false
22
- DisplayCopNames: false
23
+ - "tmp/**/*"
24
+ DisplayCopNames: true
23
25
  StyleGuideCopsOnly: false
24
- Style/AccessModifierIndentation:
26
+ require: rubocop-rspec
27
+ Rails:
28
+ Enabled: true
29
+ Layout/AccessModifierIndentation:
25
30
  Description: Check indentation of private/protected visibility modifiers.
26
31
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
27
32
  Enabled: true
@@ -29,7 +34,7 @@ Style/AccessModifierIndentation:
29
34
  SupportedStyles:
30
35
  - outdent
31
36
  - indent
32
- Style/AlignHash:
37
+ Layout/AlignHash:
33
38
  Description: Align the elements of a hash literal if they span more than one line.
34
39
  Enabled: true
35
40
  EnforcedHashRocketStyle: key
@@ -40,7 +45,7 @@ Style/AlignHash:
40
45
  - always_ignore
41
46
  - ignore_implicit
42
47
  - ignore_explicit
43
- Style/AlignParameters:
48
+ Layout/AlignParameters:
44
49
  Description: Align the parameters of a method call if they span more than one line.
45
50
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
46
51
  Enabled: true
@@ -72,11 +77,11 @@ Style/BracesAroundHashParameters:
72
77
  - braces
73
78
  - no_braces
74
79
  - context_dependent
75
- Style/CaseIndentation:
80
+ Layout/CaseIndentation:
76
81
  Description: Indentation of when in a case/when/[else/]end.
77
82
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
78
83
  Enabled: true
79
- IndentWhenRelativeTo: case
84
+ EnforcedStyle: case
80
85
  SupportedStyles:
81
86
  - case
82
87
  - end
@@ -95,7 +100,7 @@ Style/ClassCheck:
95
100
  SupportedStyles:
96
101
  - is_a?
97
102
  - kind_of?
98
- Style/ClosingParenthesisIndentation:
103
+ Layout/ClosingParenthesisIndentation:
99
104
  Description: Checks the indentation of hanging closing parentheses.
100
105
  Enabled: false
101
106
  Style/CollectionMethods:
@@ -119,7 +124,7 @@ Style/CommentAnnotation:
119
124
  - OPTIMIZE
120
125
  - HACK
121
126
  - REVIEW
122
- Style/DotPosition:
127
+ Layout/DotPosition:
123
128
  Description: Checks the position of the dot in multi-line method calls.
124
129
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
125
130
  Enabled: true
@@ -127,26 +132,26 @@ Style/DotPosition:
127
132
  SupportedStyles:
128
133
  - leading
129
134
  - trailing
130
- Style/EmptyLineBetweenDefs:
135
+ Layout/EmptyLineBetweenDefs:
131
136
  Description: Use empty lines between defs.
132
137
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
133
138
  Enabled: true
134
139
  AllowAdjacentOneLineDefs: false
135
- Style/EmptyLinesAroundBlockBody:
140
+ Layout/EmptyLinesAroundBlockBody:
136
141
  Description: Keeps track of empty lines around block bodies.
137
142
  Enabled: true
138
143
  EnforcedStyle: no_empty_lines
139
144
  SupportedStyles:
140
145
  - empty_lines
141
146
  - no_empty_lines
142
- Style/EmptyLinesAroundClassBody:
147
+ Layout/EmptyLinesAroundClassBody:
143
148
  Description: Keeps track of empty lines around class bodies.
144
149
  Enabled: true
145
150
  EnforcedStyle: no_empty_lines
146
151
  SupportedStyles:
147
152
  - empty_lines
148
153
  - no_empty_lines
149
- Style/EmptyLinesAroundModuleBody:
154
+ Layout/EmptyLinesAroundModuleBody:
150
155
  Description: Keeps track of empty lines around module bodies.
151
156
  Enabled: true
152
157
  EnforcedStyle: no_empty_lines
@@ -166,7 +171,7 @@ Style/FileName:
166
171
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
167
172
  Enabled: false
168
173
  Exclude: []
169
- Style/FirstParameterIndentation:
174
+ Layout/FirstParameterIndentation:
170
175
  Description: Checks the indentation of the first parameter in a method call.
171
176
  Enabled: true
172
177
  EnforcedStyle: consistent
@@ -215,12 +220,12 @@ Style/IfUnlessModifier:
215
220
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
216
221
  Enabled: false
217
222
  MaxLineLength: 100
218
- Style/IndentationWidth:
223
+ Layout/IndentationWidth:
219
224
  Description: Use 2 spaces for indentation.
220
225
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
221
226
  Enabled: true
222
227
  Width: 2
223
- Style/IndentHash:
228
+ Layout/IndentHash:
224
229
  Description: Checks the indentation of the first key in a hash literal.
225
230
  Enabled: true
226
231
  EnforcedStyle: consistent
@@ -265,7 +270,7 @@ Style/MethodName:
265
270
  SupportedStyles:
266
271
  - snake_case
267
272
  - camelCase
268
- Style/MultilineOperationIndentation:
273
+ Layout/MultilineOperationIndentation:
269
274
  Description: Checks indentation of binary operations that span more than one line.
270
275
  Enabled: true
271
276
  EnforcedStyle: aligned
@@ -275,7 +280,7 @@ Style/MultilineOperationIndentation:
275
280
  Style/NumericLiterals:
276
281
  Description: Add underscores to large numeric literals to improve their readability.
277
282
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
278
- Enabled: false
283
+ Enabled: true
279
284
  MinDigits: 5
280
285
  Style/ParenthesesAroundCondition:
281
286
  Description: Don't use parentheses around the condition of an if/unless/while.
@@ -376,14 +381,11 @@ Style/StringLiteralsInInterpolation:
376
381
  SupportedStyles:
377
382
  - single_quotes
378
383
  - double_quotes
379
- Style/SpaceAroundBlockParameters:
384
+ Layout/SpaceAroundBlockParameters:
380
385
  Description: Checks the spacing inside and after block parameters pipes.
381
386
  Enabled: true
382
387
  EnforcedStyleInsidePipes: no_space
383
- SupportedStyles:
384
- - space
385
- - no_space
386
- Style/SpaceAroundEqualsInParameterDefault:
388
+ Layout/SpaceAroundEqualsInParameterDefault:
387
389
  Description: Checks that the equals signs in parameter default assignments have
388
390
  or don't have surrounding space depending on configuration.
389
391
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
@@ -392,14 +394,14 @@ Style/SpaceAroundEqualsInParameterDefault:
392
394
  SupportedStyles:
393
395
  - space
394
396
  - no_space
395
- Style/SpaceBeforeBlockBraces:
397
+ Layout/SpaceBeforeBlockBraces:
396
398
  Description: Checks that the left block brace has or doesn't have space before it.
397
399
  Enabled: true
398
400
  EnforcedStyle: space
399
401
  SupportedStyles:
400
402
  - space
401
403
  - no_space
402
- Style/SpaceInsideBlockBraces:
404
+ Layout/SpaceInsideBlockBraces:
403
405
  Description: Checks that block braces have or don't have surrounding space. For
404
406
  blocks taking parameters, checks that the left brace has or doesn't have trailing
405
407
  space.
@@ -410,7 +412,7 @@ Style/SpaceInsideBlockBraces:
410
412
  - no_space
411
413
  EnforcedStyleForEmptyBraces: no_space
412
414
  SpaceBeforeBlockParameters: true
413
- Style/SpaceInsideHashLiteralBraces:
415
+ Layout/SpaceInsideHashLiteralBraces:
414
416
  Description: Use spaces inside hash literal braces - or don't.
415
417
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
416
418
  Enabled: false
@@ -424,7 +426,7 @@ Style/SymbolProc:
424
426
  Enabled: true
425
427
  IgnoredMethods:
426
428
  - respond_to
427
- Style/TrailingBlankLines:
429
+ Layout/TrailingBlankLines:
428
430
  Description: Checks trailing blank lines and final newline.
429
431
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
430
432
  Enabled: true
@@ -432,14 +434,16 @@ Style/TrailingBlankLines:
432
434
  SupportedStyles:
433
435
  - final_newline
434
436
  - 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
438
- Enabled: false
439
- EnforcedStyleForMultiline: no_comma
440
- SupportedStyles:
441
- - comma
442
- - no_comma
437
+ Style/TrailingCommaInArguments:
438
+ Description: 'Checks for trailing comma in argument lists.'
439
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
440
+ EnforcedStyleForMultiline: comma
441
+ Enabled: true
442
+ Style/TrailingCommaInLiteral:
443
+ Description: 'Checks for trailing comma in array and hash literals.'
444
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
445
+ EnforcedStyleForMultiline: comma
446
+ Enabled: true
443
447
  Style/TrivialAccessors:
444
448
  Description: Prefer attr_* methods to trivial readers/writers.
445
449
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
@@ -494,6 +498,30 @@ Metrics/BlockNesting:
494
498
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
495
499
  Enabled: false
496
500
  Max: 3
501
+ Metrics/BlockLength:
502
+ CountComments: false # count full line comments?
503
+ Max: 25
504
+ # Excluded for DSL files that uses blocks a lot.
505
+ Exclude:
506
+ # Rake
507
+ - 'Rakefile'
508
+ - '**/*.rake'
509
+ # Capistrano
510
+ - 'Capfile'
511
+ - 'lib/capistrano/tasks/*.cap'
512
+ - 'lib/capistrano/tasks/*.rb'
513
+ - 'config/deploy.rb'
514
+ - 'config/deploy/*.rb'
515
+ # Rails
516
+ - 'config/environments/*.rb'
517
+ - 'config/routes.rb'
518
+ - 'config/routes/*.rb'
519
+ - 'db/migrate/*.rb'
520
+ # RSpec
521
+ - 'spec/**/*.rb'
522
+ # GraphQL definitions
523
+ - 'app/graph/**/*.rb'
524
+
497
525
  Metrics/ClassLength:
498
526
  Description: Avoid classes longer than 100 lines of code.
499
527
  Enabled: false
@@ -538,17 +566,11 @@ Lint/AssignmentInCondition:
538
566
  Lint/EndAlignment:
539
567
  Description: Align ends correctly.
540
568
  Enabled: true
541
- AlignWith: variable
542
- SupportedStyles:
543
- - keyword
544
- - variable
569
+ EnforcedStyleAlignWith: variable
545
570
  Lint/DefEndAlignment:
546
571
  Description: Align ends corresponding to defs correctly.
547
572
  Enabled: true
548
- AlignWith: start_of_line
549
- SupportedStyles:
550
- - start_of_line
551
- - def
573
+ EnforcedStyleAlignWith: start_of_line
552
574
  Rails/ActionFilter:
553
575
  Description: Enforces consistent use of action filter methods.
554
576
  Enabled: false
@@ -558,11 +580,6 @@ Rails/ActionFilter:
558
580
  - filter
559
581
  Include:
560
582
  - 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
583
  Rails/HasAndBelongsToMany:
567
584
  Description: Prefer has_many :through to has_and_belongs_to_many.
568
585
  Enabled: true
@@ -576,6 +593,11 @@ Rails/Output:
576
593
  - config/**/*.rb
577
594
  - db/**/*.rb
578
595
  - lib/**/*.rb
596
+ Exclude:
597
+ - lib/capistrano/**/*.rb
598
+ - config/deploy.rb
599
+ - config/deploy/**/*.rb
600
+ - lib/tasks/**/*.rb
579
601
  Rails/ReadWriteAttribute:
580
602
  Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
581
603
  Enabled: true
@@ -602,7 +624,7 @@ Style/SymbolArray:
602
624
  Description: Use %i or %I for arrays of symbols.
603
625
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
604
626
  Enabled: false
605
- Style/ExtraSpacing:
627
+ Layout/ExtraSpacing:
606
628
  Description: Do not use unnecessary spacing.
607
629
  Enabled: false
608
630
  Style/AccessorMethodName:
@@ -612,7 +634,7 @@ Style/Alias:
612
634
  Description: Use alias_method instead of alias.
613
635
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
614
636
  Enabled: false
615
- Style/AlignArray:
637
+ Layout/AlignArray:
616
638
  Description: Align the elements of an array literal if they span more than one line.
617
639
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
618
640
  Enabled: true
@@ -640,7 +662,7 @@ Style/BlockComments:
640
662
  Description: Do not use block comments.
641
663
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
642
664
  Enabled: true
643
- Style/BlockEndNewline:
665
+ Layout/BlockEndNewline:
644
666
  Description: Put end statement of multiline block on its own line.
645
667
  Enabled: true
646
668
  Style/BlockDelimiters:
@@ -674,7 +696,7 @@ Style/ColonMethodCall:
674
696
  Description: 'Do not use :: for method call.'
675
697
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
676
698
  Enabled: false
677
- Style/CommentIndentation:
699
+ Layout/CommentIndentation:
678
700
  Description: Indentation of comments.
679
701
  Enabled: true
680
702
  Style/ConstantName:
@@ -685,7 +707,7 @@ Style/DefWithParentheses:
685
707
  Description: Use def with parentheses when there are arguments.
686
708
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
687
709
  Enabled: true
688
- Style/DeprecatedHashMethods:
710
+ Style/PreferredHashMethods:
689
711
  Description: Checks for use of deprecated Hash methods.
690
712
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
691
713
  Enabled: false
@@ -699,19 +721,19 @@ Style/DoubleNegation:
699
721
  Style/EachWithObject:
700
722
  Description: Prefer `each_with_object` over `inject` or `reduce`.
701
723
  Enabled: false
702
- Style/ElseAlignment:
724
+ Layout/ElseAlignment:
703
725
  Description: Align elses and elsifs correctly.
704
726
  Enabled: true
705
727
  Style/EmptyElse:
706
728
  Description: Avoid empty else-clauses.
707
729
  Enabled: true
708
- Style/EmptyLines:
730
+ Layout/EmptyLines:
709
731
  Description: Don't use several empty lines in a row.
710
732
  Enabled: true
711
- Style/EmptyLinesAroundAccessModifier:
733
+ Layout/EmptyLinesAroundAccessModifier:
712
734
  Description: Keep blank lines around access modifiers.
713
735
  Enabled: false
714
- Style/EmptyLinesAroundMethodBody:
736
+ Layout/EmptyLinesAroundMethodBody:
715
737
  Description: Keeps track of empty lines around method bodies.
716
738
  Enabled: true
717
739
  Style/EmptyLiteral:
@@ -722,7 +744,7 @@ Style/EndBlock:
722
744
  Description: Avoid the use of END blocks.
723
745
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
724
746
  Enabled: true
725
- Style/EndOfLine:
747
+ Layout/EndOfLine:
726
748
  Description: Use Unix-style line endings.
727
749
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
728
750
  Enabled: true
@@ -738,12 +760,13 @@ Style/IfWithSemicolon:
738
760
  Description: Do not use if x; .... Use the ternary operator instead.
739
761
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
740
762
  Enabled: false
741
- Style/IndentationConsistency:
763
+ Layout/IndentationConsistency:
742
764
  Description: Keep indentation straight.
743
765
  Enabled: true
744
- Style/IndentArray:
766
+ Layout/IndentArray:
745
767
  Description: Checks the indentation of the first element in an array literal.
746
768
  Enabled: true
769
+ EnforcedStyle: consistent
747
770
  Style/InfiniteLoop:
748
771
  Description: Use Kernel#loop for infinite loops.
749
772
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
@@ -752,7 +775,7 @@ Style/Lambda:
752
775
  Description: Use the new lambda literal syntax for single-line blocks.
753
776
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
754
777
  Enabled: false
755
- Style/LeadingCommentSpace:
778
+ Layout/LeadingCommentSpace:
756
779
  Description: Comments should start with a space.
757
780
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
758
781
  Enabled: true
@@ -760,7 +783,7 @@ Style/LineEndConcatenation:
760
783
  Description: Use \ instead of + or << to concatenate two string literals at line
761
784
  end.
762
785
  Enabled: false
763
- Style/MethodCallParentheses:
786
+ Style/MethodCallWithoutArgsParentheses:
764
787
  Description: Do not use parentheses for method calls with no arguments.
765
788
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
766
789
  Enabled: true
@@ -772,7 +795,7 @@ Style/MultilineBlockChain:
772
795
  Description: Avoid multi-line chains of blocks.
773
796
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
774
797
  Enabled: false
775
- Style/MultilineBlockLayout:
798
+ Layout/MultilineBlockLayout:
776
799
  Description: Ensures newlines after multiline block do statements.
777
800
  Enabled: true
778
801
  Style/MultilineIfThen:
@@ -840,59 +863,57 @@ Style/SelfAssignment:
840
863
  used.
841
864
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
842
865
  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.
866
+ Layout/SpaceBeforeFirstArg:
867
+ Description: >-
868
+ Checks that exactly one space is used between a method name
869
+ and the first argument for method calls without parentheses.
846
870
  Enabled: true
847
- Style/SpaceAfterColon:
871
+ Layout/SpaceAfterColon:
848
872
  Description: Use spaces after colons.
849
873
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
850
874
  Enabled: true
851
- Style/SpaceAfterComma:
875
+ Layout/SpaceAfterComma:
852
876
  Description: Use spaces after commas.
853
877
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
854
878
  Enabled: true
855
- Style/SpaceAfterControlKeyword:
856
- Description: Use spaces after if/elsif/unless/while/until/case/when.
879
+ Layout/SpaceAroundKeyword:
880
+ Description: 'Use a space around keywords if appropriate.'
857
881
  Enabled: true
858
- Style/SpaceAfterMethodName:
882
+ Layout/SpaceAfterMethodName:
859
883
  Description: Do not put a space between a method name and the opening parenthesis
860
884
  in a method definition.
861
885
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
862
886
  Enabled: true
863
- Style/SpaceAfterNot:
887
+ Layout/SpaceAfterNot:
864
888
  Description: Tracks redundant space after the ! operator.
865
889
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
866
890
  Enabled: true
867
- Style/SpaceAfterSemicolon:
891
+ Layout/SpaceAfterSemicolon:
868
892
  Description: Use spaces after semicolons.
869
893
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
870
894
  Enabled: true
871
- Style/SpaceBeforeComma:
895
+ Layout/SpaceBeforeComma:
872
896
  Description: No spaces before commas.
873
897
  Enabled: true
874
- Style/SpaceBeforeComment:
898
+ Layout/SpaceBeforeComment:
875
899
  Description: Checks for missing space between code and a comment on the same line.
876
900
  Enabled: true
877
- Style/SpaceBeforeSemicolon:
901
+ Layout/SpaceBeforeSemicolon:
878
902
  Description: No spaces before semicolons.
879
903
  Enabled: true
880
- Style/SpaceAroundOperators:
904
+ Layout/SpaceAroundOperators:
881
905
  Description: Use spaces around operators.
882
906
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
883
907
  Enabled: true
884
- Style/SpaceBeforeModifierKeyword:
885
- Description: Put a space before the modifier keyword.
886
- Enabled: true
887
- Style/SpaceInsideBrackets:
908
+ Layout/SpaceInsideBrackets:
888
909
  Description: No spaces after [ or before ].
889
910
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
890
911
  Enabled: true
891
- Style/SpaceInsideParens:
912
+ Layout/SpaceInsideParens:
892
913
  Description: No spaces after ( or before ).
893
914
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
894
915
  Enabled: true
895
- Style/SpaceInsideRangeLiteral:
916
+ Layout/SpaceInsideRangeLiteral:
896
917
  Description: No spaces inside range literals.
897
918
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
898
919
  Enabled: true
@@ -904,11 +925,11 @@ Style/StructInheritance:
904
925
  Description: Checks for inheritance from Struct.new.
905
926
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
906
927
  Enabled: true
907
- Style/Tab:
928
+ Layout/Tab:
908
929
  Description: No hard tabs.
909
930
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
910
931
  Enabled: true
911
- Style/TrailingWhitespace:
932
+ Layout/TrailingWhitespace:
912
933
  Description: Avoid trailing whitespace.
913
934
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
914
935
  Enabled: true
@@ -940,6 +961,11 @@ Style/WhileUntilDo:
940
961
  Description: Checks for redundant do after while or until.
941
962
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
942
963
  Enabled: true
964
+ Layout/MultilineMethodCallIndentation:
965
+ Description: Checks the indentation of the method name part in method calls that span more than one line.
966
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
967
+ Enabled: true
968
+ EnforcedStyle: indented
943
969
  Lint/AmbiguousOperator:
944
970
  Description: Checks for ambiguous operators in the first argument of a method invocation
945
971
  without parentheses.
@@ -982,7 +1008,7 @@ Lint/EnsureReturn:
982
1008
  Description: Do not use return in an ensure block.
983
1009
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
984
1010
  Enabled: true
985
- Lint/Eval:
1011
+ Security/Eval:
986
1012
  Description: The use of eval represents a serious security risk.
987
1013
  Enabled: true
988
1014
  Lint/HandleExceptions:
@@ -1019,10 +1045,6 @@ Lint/ShadowingOuterLocalVariable:
1019
1045
  Description: Do not use the same name as outer local variable for block arguments
1020
1046
  or block local variables.
1021
1047
  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
1048
  Lint/StringConversionInInterpolation:
1027
1049
  Description: Checks for Object#to_s usage in string interpolation.
1028
1050
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
@@ -1063,3 +1085,38 @@ Lint/Void:
1063
1085
  Rails/Delegate:
1064
1086
  Description: Prefer delegate method for delegations.
1065
1087
  Enabled: false
1088
+ Rails/TimeZone:
1089
+ Enabled: true
1090
+ EnforcedStyle: flexible
1091
+ Rails/HttpPositionalArguments:
1092
+ # This is just for Rails 5. We're on Rails 4.2 right now, so this lint leads to invalid code.
1093
+ Enabled: false
1094
+ RSpec/DescribeClass:
1095
+ # Not all specs must be tied to a specific unit of code.
1096
+ # Examples: integration tests; multi-class behaviour tests
1097
+ Enabled: false
1098
+ RSpec/DescribedClass:
1099
+ # `described_class` is reserved for where it's variable, such as
1100
+ # shared examples. Otherwise it's just unnecessary indirection.
1101
+ Enabled: false
1102
+ RSpec/DescribeMethod:
1103
+ # BDD describes the system's _behaviour_, not its API or method signatures.
1104
+ Enabled: false
1105
+ RSpec/MultipleExpectations:
1106
+ # Not suitable for integration tests.
1107
+ Enabled: false
1108
+ RSpec/VerifiedDoubles:
1109
+ # We are not sure if this will help us or not. Experience needed from code reviews.
1110
+ Enabled: true
1111
+ RSpec/NotToNot:
1112
+ # This is just noise.
1113
+ Enabled: false
1114
+ RSpec/ExampleLength:
1115
+ # Examples are not methods. Longer examples can sometimes be better than indirection.
1116
+ Enabled: false
1117
+ RSpec/MessageExpectation:
1118
+ # `allow`/`expect` have different behaviour. We shouldn't enforce either one.
1119
+ Enabled: false
1120
+ RSpec/NestedGroups:
1121
+ Enabled: true
1122
+ Max: 3
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --no-private --embed-mixins
data/Changelog.md ADDED
@@ -0,0 +1,16 @@
1
+ # 2.0.1
2
+
3
+ * Loosen Faraday version constraint to < 2.
4
+
5
+ # 2.0.0
6
+
7
+ * Switch from WP REST API plugin to native WP API in Wordpress 4.6+.
8
+
9
+ # 1.0.1
10
+
11
+ * Bugfixes for latest Wordpress
12
+ * Security update changed the API responses completely for metadata and taxonomy.
13
+
14
+ # 1.0.0
15
+
16
+ * 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