pdc 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +27 -0
  3. data/.gitignore +10 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +21 -0
  7. data/CODE_OF_CONDUCT.md +49 -0
  8. data/Gemfile +32 -0
  9. data/Guardfile +36 -0
  10. data/LICENSE +21 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +41 -0
  13. data/Rakefile +11 -0
  14. data/bin/console +11 -0
  15. data/bin/setup +11 -0
  16. data/docs/.gitignore +3 -0
  17. data/docs/LICENSE_sphinx_deployment +27 -0
  18. data/docs/Makefile +179 -0
  19. data/docs/source/conf.py +257 -0
  20. data/docs/source/example.rst +10 -0
  21. data/docs/source/index.rst +23 -0
  22. data/docs/sphinx_deployment.mk +117 -0
  23. data/examples/active_attr.rb +33 -0
  24. data/examples/http_failures.rb +18 -0
  25. data/examples/local_pdc_dev.rb +15 -0
  26. data/examples/logger.rb +50 -0
  27. data/examples/pdc_curb_access_token.rb +36 -0
  28. data/examples/pdc_resource_tests.rb +173 -0
  29. data/examples/pdc_test_cache.rb +48 -0
  30. data/examples/prod_failures.rb +26 -0
  31. data/examples/prod_pdc.rb +14 -0
  32. data/lib/pdc/base.rb +14 -0
  33. data/lib/pdc/config.rb +157 -0
  34. data/lib/pdc/errors.rb +8 -0
  35. data/lib/pdc/http/errors.rb +43 -0
  36. data/lib/pdc/http/request/append_slash.rb +19 -0
  37. data/lib/pdc/http/request.rb +12 -0
  38. data/lib/pdc/http/response/pagination.rb +43 -0
  39. data/lib/pdc/http/response/parser.rb +62 -0
  40. data/lib/pdc/http/response/raise_error.rb +13 -0
  41. data/lib/pdc/http/response.rb +3 -0
  42. data/lib/pdc/http/result.rb +28 -0
  43. data/lib/pdc/http.rb +12 -0
  44. data/lib/pdc/logger.rb +19 -0
  45. data/lib/pdc/resource/attribute_modifier.rb +43 -0
  46. data/lib/pdc/resource/attribute_store.rb +22 -0
  47. data/lib/pdc/resource/attributes.rb +144 -0
  48. data/lib/pdc/resource/errors.rb +3 -0
  49. data/lib/pdc/resource/identity.rb +75 -0
  50. data/lib/pdc/resource/path.rb +63 -0
  51. data/lib/pdc/resource/per_thread_registry.rb +54 -0
  52. data/lib/pdc/resource/relation/finder.rb +24 -0
  53. data/lib/pdc/resource/relation/pagination.rb +33 -0
  54. data/lib/pdc/resource/relation/query.rb +14 -0
  55. data/lib/pdc/resource/relation.rb +81 -0
  56. data/lib/pdc/resource/rest_api.rb +34 -0
  57. data/lib/pdc/resource/scope_registry.rb +19 -0
  58. data/lib/pdc/resource/scopes.rb +29 -0
  59. data/lib/pdc/resource/value_parser.rb +31 -0
  60. data/lib/pdc/resource/wip.rb +0 -0
  61. data/lib/pdc/resource.rb +12 -0
  62. data/lib/pdc/v1/arch.rb +6 -0
  63. data/lib/pdc/v1/product.rb +5 -0
  64. data/lib/pdc/v1/release.rb +18 -0
  65. data/lib/pdc/v1/release_variant.rb +17 -0
  66. data/lib/pdc/v1.rb +8 -0
  67. data/lib/pdc/version.rb +3 -0
  68. data/lib/pdc.rb +25 -0
  69. data/pdc.gemspec +38 -0
  70. data/spec/fixtures/vcr/_page_count_returns_total_count.yml +141 -0
  71. data/spec/fixtures/vcr/brew_can_be_nil.yml +61 -0
  72. data/spec/fixtures/vcr/brew_may_be_present.yml +50 -0
  73. data/spec/fixtures/vcr/caches_multiple_response.yml +173 -0
  74. data/spec/fixtures/vcr/caches_response_with_a_query.yml +64 -0
  75. data/spec/fixtures/vcr/caches_response_with_multiple_query.yml +64 -0
  76. data/spec/fixtures/vcr/caches_response_without_query.yml +61 -0
  77. data/spec/fixtures/vcr/can_iterate_using_each.yml +187 -0
  78. data/spec/fixtures/vcr/fetches_variants_of_a_release.yml +663 -0
  79. data/spec/fixtures/vcr/must_return_number_of_resources.yml +61 -0
  80. data/spec/fixtures/vcr/preserves_the_filters.yml +49 -0
  81. data/spec/fixtures/vcr/returns_resources_on_that_page.yml +49 -0
  82. data/spec/fixtures/vcr/returns_the_total_count_and_not_items_in_page.yml +135 -0
  83. data/spec/fixtures/vcr/should_not_be_in_the_list_of_attributes.yml +95 -0
  84. data/spec/fixtures/vcr/works_with_where.yml +49 -0
  85. data/spec/pdc/config_spec.rb +115 -0
  86. data/spec/pdc/http/errors_spec.rb +58 -0
  87. data/spec/pdc/resource/attributes_spec.rb +231 -0
  88. data/spec/pdc/resource/cache_spec.rb +88 -0
  89. data/spec/pdc/resource/count_spec.rb +45 -0
  90. data/spec/pdc/resource/identity_spec.rb +96 -0
  91. data/spec/pdc/resource/pagination_spec.rb +51 -0
  92. data/spec/pdc/resource/path_spec.rb +30 -0
  93. data/spec/pdc/resource/relation_spec.rb +94 -0
  94. data/spec/pdc/resource/rest_api_spec.rb +23 -0
  95. data/spec/pdc/resource/value_parser_spec.rb +15 -0
  96. data/spec/pdc/resource/wip_spec.rb +0 -0
  97. data/spec/pdc/v1/arch_spec.rb +34 -0
  98. data/spec/pdc/v1/release_spec.rb +54 -0
  99. data/spec/pdc/version_spec.rb +5 -0
  100. data/spec/spec_helper.rb +39 -0
  101. data/spec/support/fixtures.rb +116 -0
  102. data/spec/support/vcr.rb +10 -0
  103. data/spec/support/webmock.rb +34 -0
  104. metadata +295 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 75e51486f499cbbb02b2bbd086e4afafa4bd55dc
4
+ data.tar.gz: a134eedc49ae661ba3c7edb44ebdf5707ad111b1
5
+ SHA512:
6
+ metadata.gz: 5b7face60ca16ecaeeed911fab646b5d5290705502ea0db5b6df117afca97b97e0abd1b2b6af12dba9f02bbcb90cadc3f188030ecea947c35c81522d3cc608ae
7
+ data.tar.gz: d8cb2c53473525966c40b15c57c9cec48e136b4bd0569d5b3b7123204e4182c6b57a3eccfa8daabd7760810623809e5fe8c54c94bb655f1a5741e5dc80e44716
data/.editorconfig ADDED
@@ -0,0 +1,27 @@
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+
4
+ # top-most EditorConfig file
5
+ root = true
6
+
7
+ # Unix-style newlines with a newline ending every file
8
+ [*]
9
+ # We recommend you to keep these unchanged
10
+ end_of_line = lf
11
+ insert_final_newline = true
12
+
13
+ indent_style = space
14
+ indent_size = 2
15
+
16
+ trim_trailing_whitespace = true
17
+
18
+ # Set default charset
19
+ charset = utf-8
20
+
21
+ # enable these if it helps
22
+ # max_line_length = 120
23
+
24
+
25
+ # Tab indentation (no size specified)
26
+ [Makefile]
27
+ indent_style = tab
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /examples/.token/
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ pdc
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ addons:
5
+ apt:
6
+ packages:
7
+ - python-sphinx
8
+ before_install: gem install bundler -v 1.11.2
9
+ install:
10
+ - bundle install --jobs=3 --retry=4
11
+ - gem install coveralls
12
+ - git config --global user.name "Travis CI"
13
+ - git config --global user.email "pdc@product-definition-center.com"
14
+ - export REPO_URL_GITHUB="https://$GH_TOKEN@github.com/$GH_REPO.git"
15
+ script:
16
+ - bundle exec rake test
17
+ - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then make deploy_doc; fi
18
+ env:
19
+ global:
20
+ - GH_REPO="product-definition-center/pdc-ruby-gem"
21
+ - secure: Mf6k7ZwdsOOzP4woIo9z3X8e8hYZUOitBYPVOBeWpXPY8rruet3DhRYAEMNqf8iH9YAVqssE4Q0j76PQrQ6WyX+TXnayl62VAGeRjwQt4rs3orDjN+lZSP1tMt8w5fN906XeV2pcbuahRU1cFEEJ6iWhTbvhvgugsmuo8dzoS5uLRtv+VopyZjJaOqvsk5wCPKMKQLAqCvYDf2ugCm2qI3+FdjQb24WaTMLmF+vVXQSGvOpXx8Z6gLZRk0/bZeBLxFLFJcAFnRdbC09YI8Jt5nmwg7Lc+mX19qGUmracsYz2KKTDg3XC2b4n4O63woQFdwwvj0LQIoLmc/6YoxIPuCDQ92oXVCDGHB9kTh3GPxHPVwWsveg8Auvj0cPMSOTZId46Jox8sOXlIxZD0xXHiq8XQ1WSYJm0LJheO9mZHV4DIHp0o0Zm7ii7cxkb2It0c2oACRpiyBmXPfGKwNoMgfAzPo4dbbmbqoRD6XxxzLxKNwhKOAtcBMs6j/dKlKyo12h79+yqlkcYmvOLp+Bz/NqRRN63j1h5wR2Irl95uLv2PN26k2sod+Kmk22IcmDJP80ha/IodcxmPIDTZKnqLd7bcaK3mHvZMQ1DsKeuktaqKvnK8fdaZHAhVSfUlu0yCi5PfiH28+HbdpSK6VHQhH7c9/YgwrS9sgcE0Kh1Mw0=
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at sthaha@redhat.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,32 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :tools do
4
+ gem 'rubocop'
5
+ gem 'guard', '<= 2.12.0'
6
+ gem 'guard-minitest', '~> 2.4.4'
7
+ gem 'guard-shell'
8
+ end
9
+
10
+ group :development do
11
+ gem 'rake', '~> 10.0'
12
+ gem 'rake-notes'
13
+ gem 'colorize'
14
+ gem 'awesome_print'
15
+ gem 'pry'
16
+ gem 'pry-byebug'
17
+ end
18
+
19
+ group :test do
20
+ gem 'mocha'
21
+ gem 'webmock', '~> 1.18.0'
22
+ gem 'minitest-reporters', '~> 1.1.9'
23
+ gem 'minitest-focus'
24
+ gem 'simplecov'
25
+ gem 'coveralls'
26
+ gem 'rack', '~> 1.4.7'
27
+ gem 'vcr'
28
+ gem 'timecop'
29
+ end
30
+
31
+ # Specify your gem's dependencies in pdc-ruby.gemspec
32
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,36 @@
1
+ ## Uncomment and set this to only include directories you want to watch
2
+ # directories %w(app lib config test spec features)
3
+
4
+ ## Uncomment to clear the screen before every task
5
+ # clearing :on
6
+
7
+ ## Guard internally checks for changes in the Guardfile and exits.
8
+ ## If you want Guard to automatically start up again, run guard in a
9
+ ## shell loop, e.g.:
10
+ ##
11
+ ## $ while bundle exec guard; do echo "Restarting Guard..."; done
12
+ ##
13
+ ## Note: if you are using the `directories` clause above and you are not
14
+ ## watching the project directory ('.'), then you will want to move
15
+ ## the Guardfile to a watched dir and symlink it back, e.g.
16
+ #
17
+ # $ mkdir config
18
+ # $ mv Guardfile config/
19
+ # $ ln -s config/Guardfile .
20
+ #
21
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
22
+
23
+ guard :minitest do
24
+ # with Minitest::Spec
25
+ watch(%r{^spec/(.*)_spec\.rb$})
26
+ watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
27
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
28
+ notification :off
29
+ end
30
+
31
+ guard :shell, all_on_start: false do
32
+ clearing :on
33
+ # autorun examples
34
+ watch(%r{^examples/.*\.rb$}) { |m| system "ruby #{m[0]}" }
35
+ notification :off
36
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 product-definition-center
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Sunil Thaha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # PDC
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pdc`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'pdc'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install pdc
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pdc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+ require 'rake/notes/rake_task'
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << "spec"
7
+ t.libs << "lib"
8
+ t.test_files = FileList['spec/**/*_spec.rb']
9
+ end
10
+
11
+ task default: :test
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "pry"
5
+ require "ap"
6
+
7
+ require "pdc"
8
+ require_relative "../spec/support/fixtures"
9
+
10
+ include Fixtures
11
+ Pry.start
data/bin/setup ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ mkdir -p ../ref/spyke
7
+ git clone -b id-per-resource git://github.com/sthaha/spyke.git ../ref/spyke/dev
8
+
9
+ bundle install
10
+
11
+ # Do any other automated setup that you need to do here
data/docs/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ # default ignored by sphinx-deployment
2
+ _deploy
3
+ build
@@ -0,0 +1,27 @@
1
+ Copyright (c) Teracy, Inc. and individual contributors.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of Teracy, Inc. nor the names of its contributors may be used
15
+ to endorse or promote products derived from this software without
16
+ specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/docs/Makefile ADDED
@@ -0,0 +1,179 @@
1
+ # Makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ PAPER =
8
+ BUILDDIR = build
9
+
10
+ # User-friendly check for sphinx-build
11
+ ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12
+ $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13
+ endif
14
+
15
+ # Internal variables.
16
+ PAPEROPT_a4 = -D latex_paper_size=a4
17
+ PAPEROPT_letter = -D latex_paper_size=letter
18
+ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
19
+ # the i18n builder cannot share the environment and doctrees with the others
20
+ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
21
+
22
+ .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23
+
24
+ help:
25
+ @echo "Please use \`make <target>' where <target> is one of"
26
+ @echo " html to make standalone HTML files"
27
+ @echo " dirhtml to make HTML files named index.html in directories"
28
+ @echo " singlehtml to make a single large HTML file"
29
+ @echo " pickle to make pickle files"
30
+ @echo " json to make JSON files"
31
+ @echo " htmlhelp to make HTML files and a HTML help project"
32
+ @echo " qthelp to make HTML files and a qthelp project"
33
+ @echo " devhelp to make HTML files and a Devhelp project"
34
+ @echo " epub to make an epub"
35
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
37
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38
+ @echo " text to make text files"
39
+ @echo " man to make manual pages"
40
+ @echo " texinfo to make Texinfo files"
41
+ @echo " info to make Texinfo files and run them through makeinfo"
42
+ @echo " gettext to make PO message catalogs"
43
+ @echo " changes to make an overview of all changed/added/deprecated items"
44
+ @echo " xml to make Docutils-native XML files"
45
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46
+ @echo " linkcheck to check all external links for integrity"
47
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48
+
49
+ clean:
50
+ rm -rf $(BUILDDIR)/*
51
+
52
+ html:
53
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54
+ @echo
55
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56
+
57
+ dirhtml:
58
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59
+ @echo
60
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61
+
62
+ singlehtml:
63
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64
+ @echo
65
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66
+
67
+ pickle:
68
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69
+ @echo
70
+ @echo "Build finished; now you can process the pickle files."
71
+
72
+ json:
73
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74
+ @echo
75
+ @echo "Build finished; now you can process the JSON files."
76
+
77
+ htmlhelp:
78
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79
+ @echo
80
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
81
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
82
+
83
+ qthelp:
84
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85
+ @echo
86
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
87
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PDC.qhcp"
89
+ @echo "To view the help file:"
90
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PDC.qhc"
91
+
92
+ devhelp:
93
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94
+ @echo
95
+ @echo "Build finished."
96
+ @echo "To view the help file:"
97
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/PDC"
98
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PDC"
99
+ @echo "# devhelp"
100
+
101
+ epub:
102
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103
+ @echo
104
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105
+
106
+ latex:
107
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108
+ @echo
109
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
111
+ "(use \`make latexpdf' here to do that automatically)."
112
+
113
+ latexpdf:
114
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115
+ @echo "Running LaTeX files through pdflatex..."
116
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
117
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118
+
119
+ latexpdfja:
120
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121
+ @echo "Running LaTeX files through platex and dvipdfmx..."
122
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124
+
125
+ text:
126
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127
+ @echo
128
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
129
+
130
+ man:
131
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132
+ @echo
133
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134
+
135
+ texinfo:
136
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137
+ @echo
138
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139
+ @echo "Run \`make' in that directory to run these through makeinfo" \
140
+ "(use \`make info' here to do that automatically)."
141
+
142
+ info:
143
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144
+ @echo "Running Texinfo files through makeinfo..."
145
+ make -C $(BUILDDIR)/texinfo info
146
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147
+
148
+ gettext:
149
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150
+ @echo
151
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152
+
153
+ changes:
154
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155
+ @echo
156
+ @echo "The overview file is in $(BUILDDIR)/changes."
157
+
158
+ linkcheck:
159
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160
+ @echo
161
+ @echo "Link check complete; look for any errors in the above output " \
162
+ "or in $(BUILDDIR)/linkcheck/output.txt."
163
+
164
+ doctest:
165
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166
+ @echo "Testing of doctests in the sources finished, look at the " \
167
+ "results in $(BUILDDIR)/doctest/output.txt."
168
+
169
+ xml:
170
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171
+ @echo
172
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173
+
174
+ pseudoxml:
175
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176
+ @echo
177
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
178
+
179
+ include sphinx_deployment.mk