├── .bashrc
├── .gitignore
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
├── bundle
├── bundler
│ └── setup.rb
└── ruby
│ ├── bin
│ ├── httparty
│ └── httparty.bat
│ ├── cache
│ ├── gerry-0.0.3.gem
│ ├── gerry-0.0.4.gem
│ ├── httparty-0.13.5.gem
│ ├── json-1.8.3.gem
│ └── multi_xml-0.5.5.gem
│ ├── extensions
│ └── x64-mingw32
│ │ ├── 2.1.0
│ │ └── json-1.8.3
│ │ │ ├── gem.build_complete
│ │ │ ├── gem_make.out
│ │ │ └── json
│ │ │ └── ext
│ │ │ ├── generator.so
│ │ │ └── parser.so
│ │ └── 2.2.0
│ │ └── json-1.8.3
│ │ ├── gem.build_complete
│ │ ├── gem_make.out
│ │ └── json
│ │ └── ext
│ │ ├── generator.so
│ │ └── parser.so
│ ├── gems
│ ├── gerry-0.1.2
│ │ ├── README.md
│ │ ├── Rakefile
│ │ ├── lib
│ │ │ ├── gerry.rb
│ │ │ └── gerry
│ │ │ │ ├── client.rb
│ │ │ │ ├── client
│ │ │ │ ├── access.rb
│ │ │ │ ├── accounts.rb
│ │ │ │ ├── changes.rb
│ │ │ │ ├── groups.rb
│ │ │ │ ├── projects.rb
│ │ │ │ └── request.rb
│ │ │ │ └── version.rb
│ │ └── spec
│ │ │ ├── access_spec.rb
│ │ │ ├── accounts_spec.rb
│ │ │ ├── changes_spec.rb
│ │ │ ├── fixtures
│ │ │ ├── access_rights.json
│ │ │ ├── account_groups.json
│ │ │ ├── capabilities.json
│ │ │ ├── changes.json
│ │ │ ├── changes_batch_0.json
│ │ │ ├── changes_batch_1.json
│ │ │ ├── changes_batch_2.json
│ │ │ ├── group_members.json
│ │ │ ├── groups.json
│ │ │ ├── open_changes.json
│ │ │ ├── project_head.json
│ │ │ ├── projects.json
│ │ │ └── query_capabilities.json
│ │ │ ├── groups_spec.rb
│ │ │ ├── projects_spec.rb
│ │ │ ├── request_spec.rb
│ │ │ └── spec_helper.rb
│ ├── httparty-0.13.5
│ │ ├── .gitignore
│ │ ├── .rubocop.yml
│ │ ├── .rubocop_todo.yml
│ │ ├── .simplecov
│ │ ├── .travis.yml
│ │ ├── Gemfile
│ │ ├── Guardfile
│ │ ├── History
│ │ ├── MIT-LICENSE
│ │ ├── README.md
│ │ ├── Rakefile
│ │ ├── bin
│ │ │ └── httparty
│ │ ├── cucumber.yml
│ │ ├── examples
│ │ │ ├── README.md
│ │ │ ├── aaws.rb
│ │ │ ├── basic.rb
│ │ │ ├── crack.rb
│ │ │ ├── custom_parsers.rb
│ │ │ ├── delicious.rb
│ │ │ ├── google.rb
│ │ │ ├── headers_and_user_agents.rb
│ │ │ ├── logging.rb
│ │ │ ├── nokogiri_html_parser.rb
│ │ │ ├── rescue_json.rb
│ │ │ ├── rubyurl.rb
│ │ │ ├── stackexchange.rb
│ │ │ ├── tripit_sign_in.rb
│ │ │ ├── twitter.rb
│ │ │ └── whoismyrep.rb
│ │ ├── features
│ │ │ ├── basic_authentication.feature
│ │ │ ├── command_line.feature
│ │ │ ├── deals_with_http_error_codes.feature
│ │ │ ├── digest_authentication.feature
│ │ │ ├── handles_compressed_responses.feature
│ │ │ ├── handles_multiple_formats.feature
│ │ │ ├── steps
│ │ │ │ ├── env.rb
│ │ │ │ ├── httparty_response_steps.rb
│ │ │ │ ├── httparty_steps.rb
│ │ │ │ ├── mongrel_helper.rb
│ │ │ │ └── remote_service_steps.rb
│ │ │ ├── supports_read_timeout_option.feature
│ │ │ ├── supports_redirection.feature
│ │ │ └── supports_timeout_option.feature
│ │ ├── httparty.gemspec
│ │ ├── lib
│ │ │ ├── httparty.rb
│ │ │ └── httparty
│ │ │ │ ├── connection_adapter.rb
│ │ │ │ ├── cookie_hash.rb
│ │ │ │ ├── exceptions.rb
│ │ │ │ ├── hash_conversions.rb
│ │ │ │ ├── logger
│ │ │ │ ├── apache_logger.rb
│ │ │ │ ├── curl_logger.rb
│ │ │ │ └── logger.rb
│ │ │ │ ├── module_inheritable_attributes.rb
│ │ │ │ ├── net_digest_auth.rb
│ │ │ │ ├── parser.rb
│ │ │ │ ├── request.rb
│ │ │ │ ├── response.rb
│ │ │ │ ├── response
│ │ │ │ └── headers.rb
│ │ │ │ └── version.rb
│ │ ├── script
│ │ │ └── release
│ │ ├── spec
│ │ │ ├── fixtures
│ │ │ │ ├── delicious.xml
│ │ │ │ ├── empty.xml
│ │ │ │ ├── google.html
│ │ │ │ ├── ssl
│ │ │ │ │ ├── generate.sh
│ │ │ │ │ ├── generated
│ │ │ │ │ │ ├── 1fe462c2.0
│ │ │ │ │ │ ├── bogushost.crt
│ │ │ │ │ │ ├── ca.crt
│ │ │ │ │ │ ├── ca.key
│ │ │ │ │ │ ├── selfsigned.crt
│ │ │ │ │ │ ├── server.crt
│ │ │ │ │ │ └── server.key
│ │ │ │ │ └── openssl-exts.cnf
│ │ │ │ ├── twitter.csv
│ │ │ │ ├── twitter.json
│ │ │ │ ├── twitter.xml
│ │ │ │ └── undefined_method_add_node_for_nil.xml
│ │ │ ├── httparty
│ │ │ │ ├── connection_adapter_spec.rb
│ │ │ │ ├── cookie_hash_spec.rb
│ │ │ │ ├── exception_spec.rb
│ │ │ │ ├── hash_conversions_spec.rb
│ │ │ │ ├── logger
│ │ │ │ │ ├── apache_logger_spec.rb
│ │ │ │ │ ├── curl_logger_spec.rb
│ │ │ │ │ └── logger_spec.rb
│ │ │ │ ├── net_digest_auth_spec.rb
│ │ │ │ ├── parser_spec.rb
│ │ │ │ ├── request_spec.rb
│ │ │ │ ├── response_spec.rb
│ │ │ │ └── ssl_spec.rb
│ │ │ ├── httparty_spec.rb
│ │ │ ├── spec_helper.rb
│ │ │ └── support
│ │ │ │ ├── ssl_test_helper.rb
│ │ │ │ ├── ssl_test_server.rb
│ │ │ │ └── stub_response.rb
│ │ └── website
│ │ │ ├── css
│ │ │ └── common.css
│ │ │ └── index.html
│ ├── json-1.8.3
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CHANGES
│ │ ├── COPYING
│ │ ├── COPYING-json-jruby
│ │ ├── GPL
│ │ ├── Gemfile
│ │ ├── README-json-jruby.markdown
│ │ ├── README.rdoc
│ │ ├── Rakefile
│ │ ├── TODO
│ │ ├── VERSION
│ │ ├── data
│ │ │ ├── example.json
│ │ │ ├── index.html
│ │ │ └── prototype.js
│ │ ├── diagrams
│ │ │ └── .keep
│ │ ├── ext
│ │ │ └── json
│ │ │ │ ├── ext
│ │ │ │ ├── fbuffer
│ │ │ │ │ └── fbuffer.h
│ │ │ │ ├── generator
│ │ │ │ │ ├── .RUBYARCHDIR.-.json.-.ext.time
│ │ │ │ │ ├── depend
│ │ │ │ │ ├── extconf.rb
│ │ │ │ │ ├── generator-x64-mingw32.def
│ │ │ │ │ ├── generator.c
│ │ │ │ │ ├── generator.h
│ │ │ │ │ └── generator.so
│ │ │ │ └── parser
│ │ │ │ │ ├── .RUBYARCHDIR.-.json.-.ext.time
│ │ │ │ │ ├── depend
│ │ │ │ │ ├── extconf.rb
│ │ │ │ │ ├── parser-x64-mingw32.def
│ │ │ │ │ ├── parser.c
│ │ │ │ │ ├── parser.h
│ │ │ │ │ ├── parser.rl
│ │ │ │ │ └── parser.so
│ │ │ │ └── extconf.rb
│ │ ├── install.rb
│ │ ├── java
│ │ │ └── src
│ │ │ │ └── json
│ │ │ │ └── ext
│ │ │ │ ├── ByteListTranscoder.java
│ │ │ │ ├── Generator.java
│ │ │ │ ├── GeneratorMethods.java
│ │ │ │ ├── GeneratorService.java
│ │ │ │ ├── GeneratorState.java
│ │ │ │ ├── OptionsReader.java
│ │ │ │ ├── Parser.java
│ │ │ │ ├── Parser.rl
│ │ │ │ ├── ParserService.java
│ │ │ │ ├── RuntimeInfo.java
│ │ │ │ ├── StringDecoder.java
│ │ │ │ ├── StringEncoder.java
│ │ │ │ └── Utils.java
│ │ ├── json-java.gemspec
│ │ ├── json.gemspec
│ │ ├── json_pure.gemspec
│ │ ├── lib
│ │ │ ├── json.rb
│ │ │ └── json
│ │ │ │ ├── add
│ │ │ │ ├── bigdecimal.rb
│ │ │ │ ├── complex.rb
│ │ │ │ ├── core.rb
│ │ │ │ ├── date.rb
│ │ │ │ ├── date_time.rb
│ │ │ │ ├── exception.rb
│ │ │ │ ├── ostruct.rb
│ │ │ │ ├── range.rb
│ │ │ │ ├── rational.rb
│ │ │ │ ├── regexp.rb
│ │ │ │ ├── struct.rb
│ │ │ │ ├── symbol.rb
│ │ │ │ └── time.rb
│ │ │ │ ├── common.rb
│ │ │ │ ├── ext.rb
│ │ │ │ ├── ext
│ │ │ │ ├── .keep
│ │ │ │ ├── generator.so
│ │ │ │ └── parser.so
│ │ │ │ ├── generic_object.rb
│ │ │ │ ├── pure.rb
│ │ │ │ ├── pure
│ │ │ │ ├── generator.rb
│ │ │ │ └── parser.rb
│ │ │ │ └── version.rb
│ │ ├── tests
│ │ │ ├── fixtures
│ │ │ │ ├── fail1.json
│ │ │ │ ├── fail10.json
│ │ │ │ ├── fail11.json
│ │ │ │ ├── fail12.json
│ │ │ │ ├── fail13.json
│ │ │ │ ├── fail14.json
│ │ │ │ ├── fail18.json
│ │ │ │ ├── fail19.json
│ │ │ │ ├── fail2.json
│ │ │ │ ├── fail20.json
│ │ │ │ ├── fail21.json
│ │ │ │ ├── fail22.json
│ │ │ │ ├── fail23.json
│ │ │ │ ├── fail24.json
│ │ │ │ ├── fail25.json
│ │ │ │ ├── fail27.json
│ │ │ │ ├── fail28.json
│ │ │ │ ├── fail3.json
│ │ │ │ ├── fail4.json
│ │ │ │ ├── fail5.json
│ │ │ │ ├── fail6.json
│ │ │ │ ├── fail7.json
│ │ │ │ ├── fail8.json
│ │ │ │ ├── fail9.json
│ │ │ │ ├── pass1.json
│ │ │ │ ├── pass15.json
│ │ │ │ ├── pass16.json
│ │ │ │ ├── pass17.json
│ │ │ │ ├── pass2.json
│ │ │ │ ├── pass26.json
│ │ │ │ └── pass3.json
│ │ │ ├── setup_variant.rb
│ │ │ ├── test_json.rb
│ │ │ ├── test_json_addition.rb
│ │ │ ├── test_json_encoding.rb
│ │ │ ├── test_json_fixtures.rb
│ │ │ ├── test_json_generate.rb
│ │ │ ├── test_json_generic_object.rb
│ │ │ ├── test_json_string_matching.rb
│ │ │ └── test_json_unicode.rb
│ │ └── tools
│ │ │ ├── fuzz.rb
│ │ │ └── server.rb
│ └── multi_xml-0.5.5
│ │ ├── .yardopts
│ │ ├── CHANGELOG.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE.md
│ │ ├── README.md
│ │ ├── Rakefile
│ │ ├── lib
│ │ ├── multi_xml.rb
│ │ └── multi_xml
│ │ │ ├── parsers
│ │ │ ├── libxml.rb
│ │ │ ├── libxml2_parser.rb
│ │ │ ├── nokogiri.rb
│ │ │ ├── ox.rb
│ │ │ └── rexml.rb
│ │ │ └── version.rb
│ │ ├── multi_xml.gemspec
│ │ └── spec
│ │ ├── helper.rb
│ │ ├── multi_xml_spec.rb
│ │ ├── parser_shared_example.rb
│ │ └── speed.rb
│ └── specifications
│ ├── gerry-0.0.3.gemspec
│ ├── gerry-0.1.2.gemspec
│ ├── httparty-0.13.5.gemspec
│ ├── json-1.8.3.gemspec
│ └── multi_xml-0.5.5.gemspec
├── gerrit
├── count-active-owners.rb
├── count-active-projects.rb
├── gerrit-clone.sh
├── gerrit-push-for.sh
├── list-groups.rb
├── list-users.sh
├── repo-clean.sh
├── set-head.rb
└── set-parent.sh
├── git
├── .gitconfig
├── git-alias
├── git-author-count
├── git-authorship
├── git-blob-hash
├── git-branch-owners
├── git-check-blacklist
├── git-cherry-pick-branch
├── git-cherry-pick-path
├── git-commit-signoff.txt
├── git-commit-size
├── git-contains-symlinks
├── git-count-cc-merges
├── git-diff-all
├── git-diff-last
├── git-find-least-modifications
├── git-hash-blob
├── git-list-branches-with-contained-commits.sh
├── git-list-reviewers
├── git-list-tags
├── git-log-json
├── git-log-other-than
├── git-merge-customizations
├── git-prompt.sh
├── git-rename-remote-branch
├── git-set-author-committer
├── git-show-merge-resolution
├── git-split-arbitrary-paths
└── git-test-rebase-merge-commits
├── github
├── github-clone-org.sh
└── github-delete-workflow-runs.sh
├── gradle
├── github-dependency-graph-gradle-plugin.init.gradle
├── github-dependency-graph-gradle-plugin.sh
├── gradlew_bootstrap.sh
└── gradlew_update.sh
├── kotlin
├── .gitignore
├── build.gradle.kts
├── json-schema-to-kotlinx-serialization.main.kts
├── openapi-to-kotlinx-serialization.main.kts
├── remove-default-gradle-build-script-imports.main.kts
└── scancode-licensedb-statistics.main.kts
├── linux
└── watch_and_copy.sh
├── maven
├── inject-maven-plugin-from-jar.sh
└── list_pom_deps.sh
└── text
├── ensure_final_newline.sh
└── trim_trailing_whitespaces.sh
/.bashrc:
--------------------------------------------------------------------------------
1 | git_ps1() {
2 | __git_ps1 "%s"
3 | }
4 |
5 | hg_ps1() {
6 | hg prompt "{branch}{ at {bookmark}}{ (status: {status})} " 2> /dev/null
7 | }
8 |
9 | export PS1='\n\[\033[33m\]\w\[\033[0m\] \[\033[32m\]$(git_ps1)$(hg_ps1)\[\033[0m\]\n$ '
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.bundle/
2 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org/'
2 | gem 'gerry'
3 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | gerry (0.1.2)
5 | httparty
6 | httparty (0.21.0)
7 | mini_mime (>= 1.0.0)
8 | multi_xml (>= 0.5.2)
9 | mini_mime (1.1.2)
10 | multi_xml (0.6.0)
11 |
12 | PLATFORMS
13 | ruby
14 | x64-mingw32
15 |
16 | DEPENDENCIES
17 | gerry
18 |
19 | BUNDLED WITH
20 | 1.10.6
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Sebastian Schuberth
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.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is a loose collection of miscellaneous scripts (mostly Bash or Ruby) for development work with Git and Hg version control, Gerrit code review, and the Android OS.
2 |
3 | The scripts are tested best with the "Git Bash" that comes with "Git for Windows" but should run just fine under Linux and / or Mac OS X.
4 |
--------------------------------------------------------------------------------
/bundle/bundler/setup.rb:
--------------------------------------------------------------------------------
1 | require 'rbconfig'
2 | # ruby 1.8.7 doesn't define RUBY_ENGINE
3 | ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
4 | path = File.expand_path('..', __FILE__)
5 | $:.unshift "#{path}/../#{ruby_engine}/gems/json-1.8.3/C/Users/seschube/Development/GitHub/dev-scripts/bundle/ruby/2.1.0/extensions/x64-mingw32/2.1.0/json-1.8.3"
6 | $:.unshift "#{path}/../#{ruby_engine}/gems/json-1.8.3/lib"
7 | $:.unshift "#{path}/../#{ruby_engine}/gems/multi_xml-0.5.5/lib"
8 | $:.unshift "#{path}/../#{ruby_engine}/gems/httparty-0.13.5/lib"
9 | $:.unshift "#{path}/../#{ruby_engine}/gems/gerry-0.1.2/lib"
10 |
--------------------------------------------------------------------------------
/bundle/ruby/bin/httparty:
--------------------------------------------------------------------------------
1 | #! ruby
2 | #
3 | # This file was generated by RubyGems.
4 | #
5 | # The application 'httparty' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'rubygems'
10 |
11 | version = ">= 0"
12 |
13 | if ARGV.first
14 | str = ARGV.first
15 | str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
16 | if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
17 | version = $1
18 | ARGV.shift
19 | end
20 | end
21 |
22 | gem 'httparty', version
23 | load Gem.bin_path('httparty', 'httparty', version)
24 |
--------------------------------------------------------------------------------
/bundle/ruby/bin/httparty.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | @"C:\Ruby\bin\ruby.exe" "%~dpn0" %*
3 |
--------------------------------------------------------------------------------
/bundle/ruby/cache/gerry-0.0.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/cache/gerry-0.0.3.gem
--------------------------------------------------------------------------------
/bundle/ruby/cache/gerry-0.0.4.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/cache/gerry-0.0.4.gem
--------------------------------------------------------------------------------
/bundle/ruby/cache/httparty-0.13.5.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/cache/httparty-0.13.5.gem
--------------------------------------------------------------------------------
/bundle/ruby/cache/json-1.8.3.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/cache/json-1.8.3.gem
--------------------------------------------------------------------------------
/bundle/ruby/cache/multi_xml-0.5.5.gem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/cache/multi_xml-0.5.5.gem
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/gem.build_complete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/gem.build_complete
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/gem_make.out:
--------------------------------------------------------------------------------
1 | C:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150710-6892-cabvle.rb extconf.rb
2 | creating Makefile
3 |
4 | make "DESTDIR=" clean
5 |
6 | make "DESTDIR="
7 | make: Nothing to be done for `all'.
8 |
9 | make "DESTDIR=" install
10 | installing default libraries
11 |
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/json/ext/generator.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/json/ext/generator.so
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/json/ext/parser.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/extensions/x64-mingw32/2.1.0/json-1.8.3/json/ext/parser.so
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/gem.build_complete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/gem.build_complete
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/gem_make.out:
--------------------------------------------------------------------------------
1 | C:/Ruby/bin/ruby.exe -r ./siteconf20150810-11412-mi0qt2.rb extconf.rb
2 | creating Makefile
3 |
4 | make "DESTDIR=" clean
5 |
6 | make "DESTDIR="
7 | make: Nothing to be done for `all'.
8 |
9 | make "DESTDIR=" install
10 |
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/json/ext/generator.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/json/ext/generator.so
--------------------------------------------------------------------------------
/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/json/ext/parser.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sschuberth/dev-scripts/d42d1028c59c25946375c9e75be02caa37af9a50/bundle/ruby/extensions/x64-mingw32/2.2.0/json-1.8.3/json/ext/parser.so
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/Rakefile:
--------------------------------------------------------------------------------
1 | require 'rspec/core/rake_task'
2 | require 'bundler/gem_tasks'
3 |
4 | RSpec::Core::RakeTask.new(:spec)
5 |
6 | task :default => :spec
7 |
8 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry.rb:
--------------------------------------------------------------------------------
1 | require_relative 'gerry/client'
2 |
3 | module Gerry
4 | class << self
5 | # Alias for Gerry::Client.new
6 | #
7 | # @return [Gerry::Client]
8 | def new(url, username = nil, password = nil)
9 | Gerry::Client.new(url, username, password)
10 | end
11 | end
12 | end
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/client.rb:
--------------------------------------------------------------------------------
1 | require 'httparty'
2 | require 'json'
3 |
4 | module Gerry
5 | class Client
6 | include HTTParty
7 | headers 'Accept' => 'application/json'
8 |
9 | require_relative 'client/access'
10 | require_relative 'client/accounts'
11 | require_relative 'client/changes'
12 | require_relative 'client/groups'
13 | require_relative 'client/projects'
14 | require_relative 'client/request'
15 |
16 | include Access
17 | include Accounts
18 | include Changes
19 | include Groups
20 | include Projects
21 | include Request
22 |
23 | def initialize(url, username = nil, password = nil)
24 | self.class.base_uri(url)
25 |
26 | if username && password
27 | @username = username
28 | @password = password
29 | end
30 | end
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/client/access.rb:
--------------------------------------------------------------------------------
1 | require 'erb'
2 |
3 | module Gerry
4 | class Client
5 | module Access
6 | # Get access rights for the specified project
7 | #
8 | # @param [VarArgs] projects the project names
9 | # @return [Hash] the list of access rights
10 | def access(*projects)
11 | projects = projects.flatten.map { |name| ERB::Util.url_encode(name) }
12 | url = "/access/?project=#{projects.join('&project=')}"
13 | get(url)
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/client/accounts.rb:
--------------------------------------------------------------------------------
1 | module Gerry
2 | class Client
3 | module Accounts
4 | # Get the account info for the specified account ID.
5 | #
6 | # @param [String] account_id the account.
7 | # @return [Hash] the account info.
8 | def account_info(account_id)
9 | url = "/accounts/#{account_id}"
10 | get(url)
11 | end
12 |
13 | # Get the global capabilities that are enabled for the calling user.
14 | #
15 | # @param [Array] options the query parameters.
16 | # @return [Hash] the account capabilities.
17 | def account_capabilities(options = [])
18 | url = '/accounts/self/capabilities'
19 |
20 | if options.empty?
21 | return get(url)
22 | end
23 |
24 | options = map_options(options)
25 | get("#{url}?#{options}")
26 | end
27 |
28 | # Get all groups that contain the specified account as a member
29 | #
30 | # @param [String] account_id the account
31 | # @return [Enumberable] the groups
32 | def groups_for_account(account_id)
33 | url = "/accounts/#{account_id}/groups/"
34 | get(url)
35 | end
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/client/changes.rb:
--------------------------------------------------------------------------------
1 | require 'cgi'
2 |
3 | module Gerry
4 | class Client
5 | module Changes
6 | # Get changes visible to the caller.
7 | #
8 | # @param [Array] options the query parameters.
9 | # @return [Hash] the changes.
10 | def changes(options = [])
11 | endpoint = '/changes/'
12 | url = endpoint
13 |
14 | if !options.empty?
15 | url += '?' + map_options(options)
16 | end
17 |
18 | response = get(url)
19 | return response unless response.last(1).delete('_more_changes')
20 |
21 | # Get the original start parameter, if any, else start from 0.
22 | query = URI.parse(url).query
23 | query = query ? CGI.parse(query) : { 'S' => ['0'] }
24 | start = query['S'].join.to_i
25 |
26 | # Keep getting data until there are no more changes.
27 | loop do
28 | # Replace the start parameter, using the original start as an offset.
29 | query['S'] = ["#{start + response.size}"]
30 | url = endpoint + '?' + map_options(query)
31 |
32 | response.concat(get(url))
33 | return response unless response.last.delete('_more_changes')
34 | end
35 | end
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/client/groups.rb:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | module Gerry
4 | class Client
5 | module Groups
6 | # Get all groups
7 | #
8 | # @return [Hash] the groups
9 | def groups
10 | url = '/groups/'
11 | get(url)
12 | end
13 |
14 | # Get all members for a group
15 | #
16 | # @param [Array] options the query parameters
17 | # @return [Array] the members
18 | def group_members(group_id, options = [])
19 | url = "/groups/#{group_id}/members/"
20 |
21 | if options.empty?
22 | return get(url)
23 | end
24 |
25 | options = map_options(options)
26 | get("#{url}?#{options}")
27 | end
28 |
29 | # Get the directly included groups of a group
30 | #
31 | # @return [Array] the included groups
32 | def included_groups(group_id)
33 | url = "/groups/#{group_id}/groups/"
34 | get(url)
35 | end
36 |
37 | # Create a new group
38 | #
39 | # @return [Hash] the group details
40 | def create_group(name, description, visible, owner_id=nil)
41 | url = "/groups/#{name}"
42 | body = {
43 | description: description,
44 | visible_to_all: visible,
45 | }
46 | body[:owner_id] = owner_id unless owner_id.nil? || owner_id.empty?
47 | put(url, body)
48 | end
49 |
50 | # Adds one or more users to a group
51 | #
52 | # @param [String] group_id the group id
53 | # @param [Enumberable] users the list of users identified by email address
54 | # @return [Hash] the account info details for each user added
55 | def add_to_group(group_id, users)
56 | url = "/groups/#{group_id}/members"
57 | body = {
58 | members: users
59 | }
60 | post(url, body)
61 | end
62 |
63 | def remove_from_group(group_id, users)
64 | url = "/groups/#{group_id}/members.delete"
65 | body = {
66 | members: users
67 | }
68 | post(url, body)
69 | end
70 | end
71 | end
72 | end
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/client/projects.rb:
--------------------------------------------------------------------------------
1 | module Gerry
2 | class Client
3 | module Projects
4 | # Get the projects accessible by the caller.
5 | #
6 | # @return [Hash] the projects.
7 | def projects
8 | get('/projects/')
9 | end
10 |
11 | # Get the projects that start with the specified prefix
12 | # and accessible by the caller.
13 | #
14 | # @param [String] name the project name.
15 | # @return [Hash] the projects.
16 | def find_project(name)
17 | get("/projects/#{name}")
18 | end
19 |
20 | # Get the symbolic HEAD ref for the specified project.
21 | #
22 | # @param [String] project the project name.
23 | # @return [String] the current ref to which HEAD points to.
24 | def get_head(project)
25 | get("/projects/#{project}/HEAD")
26 | end
27 |
28 | # Set the symbolic HEAD ref for the specified project to
29 | # point to the specified branch.
30 | #
31 | # @param [String] project the project name.
32 | # @param [String] branch the branch to point to.
33 | # @return [String] the new ref to which HEAD points to.
34 | def set_head(project, branch)
35 | url = "/projects/#{project}/HEAD"
36 | body = {
37 | ref: 'refs/heads/' + branch
38 | }
39 | put(url, body)
40 | end
41 | end
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/lib/gerry/version.rb:
--------------------------------------------------------------------------------
1 | module Gerry
2 |
3 | VERSION = "0.1.2"
4 |
5 | end
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/access_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe '.list_access_rights' do
4 | it 'lists the access rights for projects' do
5 | projects = ['All-Projects', 'MyProject']
6 | stub = stub_get("/access/?project=#{projects.join('&project=')}", 'access_rights.json')
7 |
8 | client = MockGerry.new
9 | access_rights = client.access(projects)
10 | expect(stub).to have_been_requested
11 |
12 | expect(access_rights['All-Projects']['revision']).to eq('edd453d18e08640e67a8c9a150cec998ed0ac9aa')
13 | expect(access_rights['MyProject']['revision']).to eq('61157ed63e14d261b6dca40650472a9b0bd88474')
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/accounts_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe '.account_capabilities' do
4 | it 'should fetch all account capabilities' do
5 | stub = stub_get('/accounts/self/capabilities', 'capabilities.json')
6 |
7 | client = MockGerry.new
8 | capabilities = client.account_capabilities
9 |
10 | expect(capabilities['queryLimit']['min']).to eq(0)
11 | expect(capabilities['queryLimit']['max']).to eq(500)
12 | end
13 |
14 | it 'should fetch some account capabilities' do
15 | stub = stub_get('/accounts/self/capabilities?q=createAccount&q=createGroup', 'query_capabilities.json')
16 |
17 | client = MockGerry.new
18 | capabilities = client.account_capabilities(['q=createAccount', 'q=createGroup'])
19 | expect(stub).to have_been_requested
20 |
21 | expect(capabilities['createAccount']).to eq(true)
22 | expect(capabilities['createGroup']).to eq(true)
23 | end
24 | end
25 |
26 | describe '.groups_for_account' do
27 | it "fetches all groups for which the account is a member" do
28 | user = "jane.roe@example.com"
29 |
30 | stub = stub_get("/accounts/#{user}/groups/", "account_groups.json")
31 |
32 | client = MockGerry.new
33 | new_group = client.groups_for_account(user)
34 | expect(stub).to have_been_requested
35 | end
36 | end
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/changes_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe '.changes' do
4 | it 'should fetch all changes' do
5 | stub = stub_get('/changes/', 'changes.json')
6 |
7 | client = MockGerry.new
8 | changes = client.changes
9 |
10 | expect(stub).to have_been_requested
11 |
12 | expect(changes[0]['project']).to eq('awesome')
13 | expect(changes[0]['branch']).to eq('master')
14 |
15 | expect(changes[1]['project']).to eq('clean')
16 | expect(changes[1]['subject']).to eq('Refactor code')
17 | expect(changes[1]['owner']['name']).to eq('Batman')
18 | end
19 |
20 | it 'should fetch all changes in batches' do
21 | stub_batch_0 = stub_get('/changes/', 'changes_batch_0.json')
22 | stub_batch_1 = stub_get('/changes/?S=1', 'changes_batch_1.json')
23 | stub_batch_2 = stub_get('/changes/?S=2', 'changes_batch_2.json')
24 |
25 | client = MockGerry.new
26 | changes = client.changes
27 |
28 | expect(stub_batch_0).to have_been_requested
29 | expect(stub_batch_1).to have_been_requested
30 |
31 | expect(changes[0]['project']).to eq('awesome')
32 | expect(changes[0]['branch']).to eq('master')
33 | expect(changes[0]['owner']['name']).to eq('The Duke')
34 |
35 | expect(changes[1]['project']).to eq('clean')
36 | expect(changes[1]['subject']).to eq('Refactor code')
37 | expect(changes[1]['owner']['name']).to eq('Batman')
38 |
39 | expect(changes[2]['project']).to eq('X')
40 | expect(changes[2]['subject']).to eq('Remove unused imports')
41 | expect(changes[2]['owner']['name']).to eq('Bill')
42 | end
43 |
44 | it 'should fetch all open changes' do
45 | stub = stub_get('/changes/?q=is:open+owner:self', 'open_changes.json')
46 |
47 | client = MockGerry.new
48 | changes = client.changes(['q=is:open+owner:self'])
49 |
50 | expect(stub).to have_been_requested
51 |
52 | expect(changes[0]['status']).to eq('OPEN')
53 | expect(changes[0]['owner']['name']).to eq('The Duke')
54 | end
55 | end
56 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/account_groups.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "kind": "gerritcodereview#group",
5 | "id": "global%3AAnonymous-Users",
6 | "url": "#/admin/groups/uuid-global%3AAnonymous-Users",
7 | "options": {
8 | },
9 | "description": "Any user, signed-in or not",
10 | "group_id": 2,
11 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
12 | },
13 | {
14 | "kind": "gerritcodereview#group",
15 | "id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
16 | "url": "#/admin/groups/uuid-834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
17 | "options": {
18 | "visible_to_all": true
19 | },
20 | "group_id": 6,
21 | "owner_id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7"
22 | },
23 | {
24 | "kind": "gerritcodereview#group",
25 | "id": "global%3ARegistered-Users",
26 | "url": "#/admin/groups/uuid-global%3ARegistered-Users",
27 | "options": {
28 | },
29 | "description": "Any signed-in user",
30 | "group_id": 3,
31 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
32 | }
33 | ]
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/capabilities.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | {
3 | "queryLimit": {
4 | "min": 0,
5 | "max": 500
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/changes.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "project": "awesome",
5 | "branch": "master",
6 | "id": "Idd8747a5ea93bb9bddf7695bab25670be135f777",
7 | "subject": "Add an awesome feature",
8 | "status": "NEW",
9 | "created": "2012-09-12 15:54:21.531000000",
10 | "updated": "2012-10-13 01:34:40.511000000",
11 | "_sortkey": "00115dfe00009334",
12 | "_number": 3,
13 | "owner": {
14 | "name": "The Duke"
15 | }
16 | },
17 | {
18 | "project": "clean",
19 | "branch": "master",
20 | "id": "Idac803deea68faa1294b3fa5bf814277e899f075",
21 | "subject": "Refactor code",
22 | "status": "NEW",
23 | "created": "2012-09-12 15:51:30.605000000",
24 | "updated": "2012-10-13 00:45:26.431000000",
25 | "_sortkey": "00205dcddd00937d",
26 | "_number": 42,
27 | "owner": {
28 | "name": "Batman"
29 | }
30 | }
31 | ]
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/changes_batch_0.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "project": "awesome",
5 | "branch": "master",
6 | "id": "Idd8747a5ea93bb9bddf7695bab25670be135f777",
7 | "subject": "Add an awesome feature",
8 | "status": "NEW",
9 | "created": "2012-09-12 15:54:21.531000000",
10 | "updated": "2012-10-13 01:34:40.511000000",
11 | "_sortkey": "00115dfe00009334",
12 | "_number": 3,
13 | "owner": {
14 | "name": "The Duke"
15 | },
16 | "_more_changes": true
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/changes_batch_1.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "project": "clean",
5 | "branch": "master",
6 | "id": "Idac803deea68faa1294b3fa5bf814277e899f075",
7 | "subject": "Refactor code",
8 | "status": "NEW",
9 | "created": "2012-09-12 15:51:30.605000000",
10 | "updated": "2012-10-13 00:45:26.431000000",
11 | "_sortkey": "00205dcddd00937d",
12 | "_number": 42,
13 | "owner": {
14 | "name": "Batman"
15 | },
16 | "_more_changes": true
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/changes_batch_2.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "project": "X",
5 | "branch": "default",
6 | "id": "Ieb185f4da8725ae35e9f940e614c6eaa7b88eff5",
7 | "subject": "Remove unused imports",
8 | "status": "NEW",
9 | "created": "2016-01-11 15:51:30.605000000",
10 | "updated": "2016-02-12 00:45:26.431000000",
11 | "_sortkey": "002e4203000187d5",
12 | "_number": 4711,
13 | "owner": {
14 | "name": "Bill"
15 | }
16 | }
17 | ]
18 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/group_members.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "_account_id": 1000097,
5 | "name": "Jane Roe",
6 | "email": "jane.roe@example.com",
7 | "username": "jane"
8 | },
9 | {
10 | "_account_id": 1000096,
11 | "name": "John Doe",
12 | "email": "john.doe@example.com",
13 | "username": "john"
14 | }
15 | ]
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/groups.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | {
3 | "Administrators": {
4 | "kind": "gerritcodereview#group",
5 | "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
6 | "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
7 | "options": {
8 | },
9 | "description": "Gerrit Site Administrators",
10 | "group_id": 1,
11 | "owner": "Administrators",
12 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
13 | },
14 | "Anonymous Users": {
15 | "kind": "gerritcodereview#group",
16 | "id": "global%3AAnonymous-Users",
17 | "url": "#/admin/groups/uuid-global%3AAnonymous-Users",
18 | "options": {
19 | },
20 | "description": "Any user, signed-in or not",
21 | "group_id": 2,
22 | "owner": "Administrators",
23 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
24 | },
25 | "MyProject_Committers": {
26 | "kind": "gerritcodereview#group",
27 | "id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
28 | "url": "#/admin/groups/uuid-834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
29 | "options": {
30 | "visible_to_all": true
31 | },
32 | "group_id": 6,
33 | "owner": "MyProject_Committers",
34 | "owner_id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7"
35 | },
36 | "Non-Interactive Users": {
37 | "kind": "gerritcodereview#group",
38 | "id": "5057f3cbd3519d6ab69364429a89ffdffba50f73",
39 | "url": "#/admin/groups/uuid-5057f3cbd3519d6ab69364429a89ffdffba50f73",
40 | "options": {
41 | },
42 | "description": "Users who perform batch actions on Gerrit",
43 | "group_id": 4,
44 | "owner": "Administrators",
45 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
46 | },
47 | "Project Owners": {
48 | "kind": "gerritcodereview#group",
49 | "id": "global%3AProject-Owners",
50 | "url": "#/admin/groups/uuid-global%3AProject-Owners",
51 | "options": {
52 | },
53 | "description": "Any owner of the project",
54 | "group_id": 5,
55 | "owner": "Administrators",
56 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
57 | },
58 | "Registered Users": {
59 | "kind": "gerritcodereview#group",
60 | "id": "global%3ARegistered-Users",
61 | "url": "#/admin/groups/uuid-global%3ARegistered-Users",
62 | "options": {
63 | },
64 | "description": "Any signed-in user",
65 | "group_id": 3,
66 | "owner": "Administrators",
67 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
68 | }
69 | }
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/open_changes.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | [
3 | {
4 | "project": "awesome",
5 | "branch": "master",
6 | "id": "Idd8747a5ea93bb9bddf7695bab25670be135f777",
7 | "subject": "Add an awesome feature",
8 | "status": "OPEN",
9 | "created": "2012-09-12 15:54:21.531000000",
10 | "updated": "2012-10-13 01:34:40.511000000",
11 | "_sortkey": "00115dfe00009334",
12 | "_number": 3,
13 | "owner": {
14 | "name": "The Duke"
15 | }
16 | }
17 | ]
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/project_head.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | "refs/heads/stable"
3 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/projects.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | {
3 | "awesome": {
4 | "description": "Awesome project"
5 | },
6 | "clean": {
7 | "description": "Clean code!"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/fixtures/query_capabilities.json:
--------------------------------------------------------------------------------
1 | )]}'
2 | {
3 | "createAccount": true,
4 | "createGroup": true
5 | }
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/projects_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe '.projects' do
4 | it 'should fetch all projects' do
5 | stub = stub_get('/projects/', 'projects.json')
6 |
7 | client = MockGerry.new
8 | projects = client.projects
9 |
10 | expect(stub).to have_been_requested
11 |
12 | expect(projects['awesome']['description']).to eq('Awesome project')
13 | expect(projects['clean']['description']).to eq('Clean code!')
14 | end
15 |
16 | it 'should fetch a project' do
17 | stub = stub_get('/projects/awesome', 'projects.json')
18 |
19 | client = MockGerry.new
20 | projects = client.find_project('awesome')
21 |
22 | expect(stub).to have_been_requested
23 |
24 | expect(projects['awesome']['description']).to eq('Awesome project')
25 | end
26 |
27 | it 'should resolve the symbolic HEAD ref of a project' do
28 | project = 'awesome'
29 | stub = stub_get("/projects/#{project}/HEAD", 'project_head.json')
30 |
31 | client = MockGerry.new
32 | branch = client.get_head(project)
33 |
34 | expect(stub).to have_been_requested
35 |
36 | expect(branch).to eq('refs/heads/stable')
37 | end
38 |
39 | it 'should define the symbolic HEAD ref of a project' do
40 | project = 'awesome'
41 | branch = 'stable'
42 | input = {
43 | ref: 'refs/heads/' + branch
44 | }
45 | stub = stub_put("/projects/#{project}/HEAD", input.to_json, get_fixture('project_head.json'))
46 |
47 | client = MockGerry.new
48 | new_branch = client.set_head(project, branch)
49 |
50 | expect(stub).to have_been_requested
51 |
52 | expect(new_branch).to eq('refs/heads/' + branch)
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/request_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe '.map_options' do
4 | it 'should map the query options' do
5 |
6 | client = MockGerry.new
7 | options = client.map_options(['q=createAccount', 'q=createGroup'])
8 |
9 | expect(options).to eq('q=createAccount&q=createGroup')
10 | end
11 | end
12 |
13 | describe '.get' do
14 | it 'should request projects as anoymous' do
15 | stub = stub_get('/projects/', 'projects.json')
16 |
17 | client = MockGerry.new
18 | client.projects
19 |
20 | expect(stub).to have_been_requested
21 | end
22 |
23 | it 'should request projects as user' do
24 | username = 'gerry'
25 | password = 'whoop'
26 |
27 | body = get_fixture('projects.json')
28 |
29 | stub = stub_request(:get, "http://localhost/a/projects/").
30 | with(:headers => {'Accept'=>'application/json'}).
31 | to_return(:status => 200, :body => body, :headers => {})
32 |
33 | client = Gerry.new(MockGerry::URL, 'gerry', 'whoop')
34 | projects = client.projects
35 |
36 | # twice because the first is the auth challenge and then the actual request
37 | expect(stub).to have_been_requested.twice
38 |
39 | expect(projects['awesome']['description']).to eq('Awesome project')
40 | expect(projects['clean']['description']).to eq('Clean code!')
41 | end
42 | end
--------------------------------------------------------------------------------
/bundle/ruby/gems/gerry-0.1.2/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | require "rspec/expectations"
2 | require 'webmock/rspec'
3 |
4 | require_relative '../lib/gerry'
5 |
6 | class MockGerry < Gerry::Client
7 | URL = 'http://localhost'
8 |
9 | def initialize
10 | super(URL)
11 | end
12 | end
13 |
14 | def get_fixture(filename)
15 | return '' if filename.empty?
16 | file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
17 | File.read(file_path)
18 | end
19 |
20 | def stub_get(url, filename)
21 | body = get_fixture(filename)
22 | stub_request(:get, "#{MockGerry::URL}#{url}").
23 | to_return(:status => 200, :body => "#{body}", :headers => {'Content-Type' => 'application/json'})
24 | end
25 |
26 | def stub_put(url, body, response_body=nil)
27 | response = {
28 | status: 200,
29 | headers: {
30 | 'Content-Type' => 'application/json'
31 | },
32 | body: response_body
33 | }
34 | stub_request(:put, "#{MockGerry::URL}#{url}").
35 | with(:body => body, :headers => { 'Content-Type' => 'application/json' }).
36 | to_return(response)
37 | end
38 |
39 | def stub_post(url, body, response_body=nil)
40 | response = {
41 | status: 200,
42 | headers: {
43 | 'Content-Type' => 'application/json'
44 | },
45 | body: response_body
46 | }
47 | stub_request(:post, "#{MockGerry::URL}#{url}").
48 | with(:body => body, :headers => { 'Content-Type' => 'application/json' }).
49 | to_return(response)
50 | end
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/.gitignore:
--------------------------------------------------------------------------------
1 | Gemfile.lock
2 | .DS_Store
3 | .yardoc/
4 | doc/
5 | tmp/
6 | log/
7 | pkg/
8 | *.swp
9 | /.bundle
10 | .rvmrc
11 | coverage
12 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/.simplecov:
--------------------------------------------------------------------------------
1 | SimpleCov.start "test_frameworks"
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | rvm:
3 | - 1.9.3
4 | - 2.0.0
5 | notifications:
6 | email: false
7 | bundler_args: --without development
8 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | gemspec
3 |
4 | gem 'rake'
5 | gem 'fakeweb', '~> 1.3'
6 | gem 'mongrel', '1.2.0.pre2'
7 |
8 | group :development do
9 | gem 'guard'
10 | gem 'guard-rspec'
11 | gem 'guard-bundler'
12 | end
13 |
14 | group :test do
15 | gem 'rspec', '~> 3.1'
16 | gem 'simplecov', require: false
17 | gem 'aruba'
18 | gem 'cucumber', '~> 1.3.17'
19 | end
20 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/Guardfile:
--------------------------------------------------------------------------------
1 | rspec_options = {
2 | version: 1,
3 | all_after_pass: false,
4 | all_on_start: false
5 | }
6 |
7 | guard 'rspec', rspec_options do
8 | watch(%r{^spec/.+_spec\.rb$})
9 | watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
10 | watch('spec/spec_helper.rb') { "spec" }
11 | end
12 |
13 | guard 'bundler' do
14 | watch('Gemfile')
15 | watch(/^.+\.gemspec/)
16 | end
17 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/MIT-LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008 John Nunemaker
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/README.md:
--------------------------------------------------------------------------------
1 | # httparty
2 |
3 | Makes http fun again!
4 |
5 | ## Install
6 |
7 | ```
8 | gem install httparty
9 | ```
10 |
11 | ## Requirements
12 |
13 | * Ruby 1.9.3 or higher
14 | * multi_xml
15 | * You like to party!
16 |
17 | ## Examples
18 |
19 | ```ruby
20 | # Use the class methods to get down to business quickly
21 | response = HTTParty.get('https://api.stackexchange.com/2.2/questions?site=stackoverflow')
22 |
23 | puts response.body, response.code, response.message, response.headers.inspect
24 |
25 | # Or wrap things up in your own class
26 | class StackExchange
27 | include HTTParty
28 | base_uri 'api.stackexchange.com'
29 |
30 | def initialize(service, page)
31 | @options = { query: {site: service, page: page} }
32 | end
33 |
34 | def questions
35 | self.class.get("/2.2/questions", @options)
36 | end
37 |
38 | def users
39 | self.class.get("/2.2/users", @options)
40 | end
41 | end
42 |
43 | stack_exchange = StackExchange.new("stackoverflow", 1)
44 | puts stack_exchange.questions
45 | puts stack_exchange.users
46 | ```
47 |
48 | See the [examples directory](http://github.com/jnunemaker/httparty/tree/master/examples) for even more goodies.
49 |
50 | ## Command Line Interface
51 |
52 | httparty also includes the executable `httparty` which can be
53 | used to query web services and examine the resulting output. By default
54 | it will output the response as a pretty-printed Ruby object (useful for
55 | grokking the structure of output). This can also be overridden to output
56 | formatted XML or JSON. Execute `httparty --help` for all the
57 | options. Below is an example of how easy it is.
58 |
59 | ```
60 | httparty "https://api.stackexchange.com/2.2/questions?site=stackoverflow"
61 | ```
62 |
63 | ## Help and Docs
64 |
65 | * https://groups.google.com/forum/#!forum/httparty-gem
66 | * http://rdoc.info/projects/jnunemaker/httparty
67 | * http://stackoverflow.com/questions/tagged/httparty
68 |
69 | ## Contributing
70 |
71 | * Fork the project.
72 | * Run `bundle`
73 | * Run `bundle exec rake`
74 | * Make your feature addition or bug fix.
75 | * Add tests for it. This is important so I don't break it in a future version unintentionally.
76 | * Run `bundle exec rake` (No, REALLY :))
77 | * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself in another branch so I can ignore when I pull)
78 | * Send me a pull request. Bonus points for topic branches.
79 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/Rakefile:
--------------------------------------------------------------------------------
1 | begin
2 | require 'rspec/core/rake_task'
3 | RSpec::Core::RakeTask.new(:spec)
4 | rescue LoadError
5 | end
6 |
7 | require 'cucumber/rake/task'
8 | Cucumber::Rake::Task.new(:features)
9 |
10 | task default: [:spec, :features]
11 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/cucumber.yml:
--------------------------------------------------------------------------------
1 | default: features --format progress
2 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/README.md:
--------------------------------------------------------------------------------
1 | ## Examples
2 |
3 | * [Amazon Book Search](aaws.rb)
4 | * Httparty included into poro class
5 | * Uses `get` requests
6 | * Transforms query params to uppercased params
7 |
8 | * [Google Search](google.rb)
9 | * Httparty included into poro class
10 | * Uses `get` requests
11 |
12 | * [Crack Custom Parser](crack.rb)
13 | * Creates a custom parser for XML using crack gem
14 | * Uses `get` request
15 |
16 | * [Create HTML Nokogiri parser](nokogiri_html_parser.rb)
17 | * Adds Html as a format
18 | * passed the body of request to Nokogiri
19 |
20 | * [More Custom Parsers](custom_parsers.rb)
21 | * Create an additional parser for atom or make it the ONLY parser
22 |
23 | * [Basic Auth, Delicious](delicious.rb)
24 | * Basic Auth, shows how to merge those into options
25 | * Uses `get` requests
26 |
27 | * [Passing Headers, User Agent](headers_and_user_agents.rb)
28 | * Use the class method of Httparty
29 | * Pass the User-Agent in the headers
30 | * Uses `get` requests
31 |
32 | * [Basic Post Request](basic.rb)
33 | * Httparty included into poro class
34 | * Uses `post` requests
35 |
36 | * [Access Rubyurl Shortener](rubyurl.rb)
37 | * Httparty included into poro class
38 | * Uses `post` requests
39 |
40 | * [Add a custom log file](logging.rb)
41 | * create a log file and have httparty log requests
42 |
43 | * [Accessing StackExchange](stackexchange.rb)
44 | * Httparty included into poro class
45 | * Creates methods for different endpoints
46 | * Uses `get` requests
47 |
48 | * [Accessing Tripit](tripit_sign_in.rb)
49 | * Httparty included into poro class
50 | * Example of using `debug_output` to see headers/urls passed
51 | * Getting and using Cookies
52 | * Uses `get` requests
53 |
54 | * [Accessing Twitter](twitter.rb)
55 | * Httparty included into poro class
56 | * Basic Auth
57 | * Loads settings from a config file
58 | * Uses `get` requests
59 | * Uses `post` requests
60 |
61 | * [Accessing WhoIsMyRep](whoismyrep.rb)
62 | * Httparty included into poro class
63 | * Uses `get` requests
64 | * Two ways to pass params to get, inline on the url or in query hash
65 |
66 | * [Rescue Json Error](rescue_json.rb)
67 | * Rescue errors due to parsing response
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/aaws.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'active_support'
3 |
4 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
5 | require File.join(dir, 'httparty')
6 | require 'pp'
7 | config = YAML.load(File.read(File.join(ENV['HOME'], '.aaws')))
8 |
9 | module AAWS
10 | class Book
11 | include HTTParty
12 | base_uri 'http://ecs.amazonaws.com'
13 | default_params Service: 'AWSECommerceService', Operation: 'ItemSearch', SearchIndex: 'Books'
14 |
15 | def initialize(key)
16 | self.class.default_params AWSAccessKeyId: key
17 | end
18 |
19 | def search(options = {})
20 | raise ArgumentError, 'You must search for something' if options[:query].blank?
21 |
22 | # amazon uses nasty camelized query params
23 | options[:query] = options[:query].inject({}) { |h, q| h[q[0].to_s.camelize] = q[1]; h }
24 |
25 | # make a request and return the items (NOTE: this doesn't handle errors at this point)
26 | self.class.get('/onca/xml', options)['ItemSearchResponse']['Items']
27 | end
28 | end
29 | end
30 |
31 | aaws = AAWS::Book.new(config[:access_key])
32 | pp aaws.search(query: {title: 'Ruby On Rails'})
33 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/basic.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 |
5 | # You can also use post, put, delete, head, options in the same fashion
6 | response = HTTParty.get('https://api.stackexchange.com/2.2/questions?site=stackoverflow')
7 | puts response.body, response.code, response.message, response.headers.inspect
8 |
9 | # An example post to a minimal rails app in the development environment
10 | # Note that "skip_before_filter :verify_authenticity_token" must be set in the
11 | # "pears" controller for this example
12 |
13 | class Partay
14 | include HTTParty
15 | base_uri 'http://localhost:3000'
16 | end
17 |
18 | options = {
19 | body: {
20 | pear: { # your resource
21 | foo: '123', # your columns/data
22 | bar: 'second',
23 | baz: 'last thing'
24 | }
25 | }
26 | }
27 |
28 | pp Partay.post('/pears.xml', options)
29 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/crack.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'crack'
3 |
4 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
5 | require File.join(dir, 'httparty')
6 | require 'pp'
7 |
8 | class Rep
9 | include HTTParty
10 |
11 | parser(
12 | proc do |body, format|
13 | Crack::XML.parse(body)
14 | end
15 | )
16 | end
17 |
18 | pp Rep.get('http://whoismyrepresentative.com/getall_mems.php?zip=46544')
19 | pp Rep.get('http://whoismyrepresentative.com/getall_mems.php', query: {zip: 46544})
20 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/custom_parsers.rb:
--------------------------------------------------------------------------------
1 | class ParseAtom
2 | include HTTParty
3 |
4 | # Support Atom along with the default parsers: xml, json, etc.
5 | class Parser::Atom < HTTParty::Parser
6 | SupportedFormats.merge!({"application/atom+xml" => :atom})
7 |
8 | protected
9 |
10 | # perform atom parsing on body
11 | def atom
12 | body.to_atom
13 | end
14 | end
15 |
16 | parser Parser::Atom
17 | end
18 |
19 | class OnlyParseAtom
20 | include HTTParty
21 |
22 | # Only support Atom
23 | class Parser::OnlyAtom < HTTParty::Parser
24 | SupportedFormats = {"application/atom+xml" => :atom}
25 |
26 | protected
27 |
28 | # perform atom parsing on body
29 | def atom
30 | body.to_atom
31 | end
32 | end
33 |
34 | parser Parser::OnlyAtom
35 | end
36 |
37 | class SkipParsing
38 | include HTTParty
39 |
40 | # Parse the response body however you like
41 | class Parser::Simple < HTTParty::Parser
42 | def parse
43 | body
44 | end
45 | end
46 |
47 | parser Parser::Simple
48 | end
49 |
50 | class AdHocParsing
51 | include HTTParty
52 | parser(
53 | proc do |body, format|
54 | case format
55 | when :json
56 | body.to_json
57 | when :xml
58 | body.to_xml
59 | else
60 | body
61 | end
62 | end
63 | )
64 | end
65 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/delicious.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 | config = YAML.load(File.read(File.join(ENV['HOME'], '.delicious')))
5 |
6 | class Delicious
7 | include HTTParty
8 | base_uri 'https://api.del.icio.us/v1'
9 |
10 | def initialize(u, p)
11 | @auth = {username: u, password: p}
12 | end
13 |
14 | # query params that filter the posts are:
15 | # tag (optional). Filter by this tag.
16 | # dt (optional). Filter by this date (CCYY-MM-DDThh:mm:ssZ).
17 | # url (optional). Filter by this url.
18 | # ie: posts(query: {tag: 'ruby'})
19 | def posts(options = {})
20 | options.merge!({basic_auth: @auth})
21 | self.class.get('/posts/get', options)
22 | end
23 |
24 | # query params that filter the posts are:
25 | # tag (optional). Filter by this tag.
26 | # count (optional). Number of items to retrieve (Default:15, Maximum:100).
27 | def recent(options = {})
28 | options.merge!({basic_auth: @auth})
29 | self.class.get('/posts/recent', options)
30 | end
31 | end
32 |
33 | delicious = Delicious.new(config['username'], config['password'])
34 | pp delicious.posts(query: {tag: 'ruby'})
35 | pp delicious.recent
36 |
37 | delicious.recent['posts']['post'].each { |post| puts post['href'] }
38 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/google.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 |
5 | class Google
6 | include HTTParty
7 | format :html
8 | end
9 |
10 | # google.com redirects to www.google.com so this is live test for redirection
11 | pp Google.get('http://google.com')
12 |
13 | puts '', '*' * 70, ''
14 |
15 | # check that ssl is requesting right
16 | pp Google.get('https://www.google.com')
17 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/headers_and_user_agents.rb:
--------------------------------------------------------------------------------
1 | # To send custom user agents to identify your application to a web service (or mask as a specific browser for testing), send "User-Agent" as a hash to headers as shown below.
2 |
3 | require 'httparty'
4 |
5 | APPLICATION_NAME = "Httparty"
6 | response = HTTParty.get('http://example.com', headers: {"User-Agent" => APPLICATION_NAME})
7 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/logging.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'logger'
4 | require 'pp'
5 |
6 | my_logger = Logger.new "httparty.log"
7 |
8 | my_logger.info "Logging can be used on the main HTTParty class. It logs redirects too."
9 | HTTParty.get "http://google.com", logger: my_logger
10 |
11 | my_logger.info '*' * 70
12 |
13 | my_logger.info "It can be used also on a custom class."
14 |
15 | class Google
16 | include HTTParty
17 | logger ::Logger.new "httparty.log"
18 | end
19 |
20 | Google.get "http://google.com"
21 |
22 | my_logger.info '*' * 70
23 |
24 | my_logger.info "The default formatter is :apache. The :curl formatter can also be used."
25 | my_logger.info "You can tell wich method to call on the logger too. It is info by default."
26 | HTTParty.get "http://google.com", logger: my_logger, log_level: :debug, log_format: :curl
27 |
28 | my_logger.info '*' * 70
29 |
30 | my_logger.info "These configs are also available on custom classes."
31 | class Google
32 | include HTTParty
33 | logger ::Logger.new("httparty.log"), :debug, :curl
34 | end
35 |
36 | Google.get "http://google.com"
37 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/nokogiri_html_parser.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'nokogiri'
3 |
4 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
5 | require File.join(dir, 'httparty')
6 | require 'pp'
7 |
8 | class HtmlParserIncluded < HTTParty::Parser
9 | def html
10 | Nokogiri::HTML(body)
11 | end
12 | end
13 |
14 | class Page
15 | include HTTParty
16 | parser HtmlParserIncluded
17 | end
18 |
19 | pp Page.get('http://www.google.com')
20 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/rescue_json.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 |
4 | # Take note of the "; 1" at the end of the following line. It's required only if
5 | # running this in IRB, because IRB will try to inspect the variable named
6 | # "request", triggering the exception.
7 | request = HTTParty.get 'https://rubygems.org/api/v1/versions/doesnotexist.json' ; 1
8 |
9 | # Check an exception due to parsing the response
10 | # because HTTParty evaluate the response lazily
11 | begin
12 | request.inspect
13 | # This would also suffice by forcing the request to be parsed:
14 | # request.parsed_response
15 | rescue => e
16 | puts "Rescued #{e.inspect}"
17 | end
18 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/rubyurl.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 |
5 | class Rubyurl
6 | include HTTParty
7 | base_uri 'rubyurl.com'
8 |
9 | def self.shorten(website_url)
10 | post('/api/links.json', query: { link: { website_url: website_url } })
11 | end
12 | end
13 |
14 | pp Rubyurl.shorten('http://istwitterdown.com/')
15 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/stackexchange.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 |
5 | class StackExchange
6 | include HTTParty
7 | base_uri 'api.stackexchange.com'
8 |
9 | def initialize(service, page)
10 | @options = { query: {site: service, page: page} }
11 | end
12 |
13 | def questions
14 | self.class.get("/2.2/questions", @options)
15 | end
16 |
17 | def users
18 | self.class.get("/2.2/users", @options)
19 | end
20 | end
21 |
22 | stack_exchange = StackExchange.new("stackoverflow", 1)
23 | pp stack_exchange.questions
24 | pp stack_exchange.users
25 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/tripit_sign_in.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 |
4 | class TripIt
5 | include HTTParty
6 | base_uri 'http://www.tripit.com'
7 | debug_output
8 |
9 | def initialize(email, password)
10 | @email = email
11 | response = self.class.get('/account/login')
12 | response = self.class.post(
13 | '/account/login',
14 | body: {
15 | login_email_address: email,
16 | login_password: password
17 | },
18 | headers: {'Cookie' => response.headers['Set-Cookie']}
19 | )
20 | @cookie = response.request.options[:headers]['Cookie']
21 | end
22 |
23 | def account_settings
24 | self.class.get('/account/edit', headers: {'Cookie' => @cookie})
25 | end
26 |
27 | def logged_in?
28 | account_settings.include? "You're logged in as #{@email}"
29 | end
30 | end
31 |
32 | tripit = TripIt.new('email', 'password')
33 | puts "Logged in: #{tripit.logged_in?}"
34 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/twitter.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 | config = YAML.load(File.read(File.join(ENV['HOME'], '.twitter')))
5 |
6 | class Twitter
7 | include HTTParty
8 | base_uri 'twitter.com'
9 |
10 | def initialize(u, p)
11 | @auth = {username: u, password: p}
12 | end
13 |
14 | # which can be :friends, :user or :public
15 | # options[:query] can be things like since, since_id, count, etc.
16 | def timeline(which = :friends, options = {})
17 | options.merge!({basic_auth: @auth})
18 | self.class.get("/statuses/#{which}_timeline.json", options)
19 | end
20 |
21 | def post(text)
22 | options = { query: {status: text}, basic_auth: @auth }
23 | self.class.post('/statuses/update.json', options)
24 | end
25 | end
26 |
27 | twitter = Twitter.new(config['email'], config['password'])
28 | pp twitter.timeline
29 | # pp twitter.timeline(:friends, query: {since_id: 868482746})
30 | # pp twitter.timeline(:friends, query: 'since_id=868482746')
31 | # pp twitter.post('this is a test of 0.2.0')
32 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/examples/whoismyrep.rb:
--------------------------------------------------------------------------------
1 | dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2 | require File.join(dir, 'httparty')
3 | require 'pp'
4 |
5 | class Rep
6 | include HTTParty
7 | end
8 |
9 | pp Rep.get('http://whoismyrepresentative.com/getall_mems.php?zip=46544')
10 | pp Rep.get('http://whoismyrepresentative.com/getall_mems.php', query: {zip: 46544})
11 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/basic_authentication.feature:
--------------------------------------------------------------------------------
1 | Feature: Basic Authentication
2 |
3 | As a developer
4 | I want to be able to use a service that requires Basic Authentication
5 | Because that is not an uncommon requirement
6 |
7 | Scenario: Passing no credentials to a page requiring Basic Authentication
8 | Given a restricted page at '/basic_auth.html'
9 | When I call HTTParty#get with '/basic_auth.html'
10 | Then it should return a response with a 401 response code
11 |
12 | Scenario: Passing proper credentials to a page requiring Basic Authentication
13 | Given a remote service that returns 'Authenticated Page'
14 | And that service is accessed at the path '/basic_auth.html'
15 | And that service is protected by Basic Authentication
16 | And that service requires the username 'jcash' with the password 'maninblack'
17 | When I call HTTParty#get with '/basic_auth.html' and a basic_auth hash:
18 | | username | password |
19 | | jcash | maninblack |
20 | Then the return value should match 'Authenticated Page'
21 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/deals_with_http_error_codes.feature:
--------------------------------------------------------------------------------
1 | Feature: Deals with HTTP error codes
2 |
3 | As a developer
4 | I want to be informed of non-successful responses
5 | Because sometimes thing explode
6 | And I should probably know what happened
7 |
8 | Scenario: A response of '404 - Not Found'
9 | Given a remote service that returns a 404 status code
10 | And that service is accessed at the path '/404_service.html'
11 | When I call HTTParty#get with '/404_service.html'
12 | Then it should return a response with a 404 response code
13 |
14 | Scenario: A response of '500 - Internal Server Error'
15 | Given a remote service that returns a 500 status code
16 | And that service is accessed at the path '/500_service.html'
17 | When I call HTTParty#get with '/500_service.html'
18 | Then it should return a response with a 500 response code
19 |
20 | Scenario: A non-successful response where I need the body
21 | Given a remote service that returns a 400 status code
22 | And the response from the service has a body of 'Bad response'
23 | And that service is accessed at the path '/400_service.html'
24 | When I call HTTParty#get with '/400_service.html'
25 | Then it should return a response with a 400 response code
26 | And the return value should match 'Bad response'
27 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/digest_authentication.feature:
--------------------------------------------------------------------------------
1 | Feature: Digest Authentication
2 |
3 | As a developer
4 | I want to be able to use a service that requires Digest Authentication
5 | Because that is not an uncommon requirement
6 |
7 | Scenario: Passing no credentials to a page requiring Digest Authentication
8 | Given a restricted page at '/digest_auth.html'
9 | When I call HTTParty#get with '/digest_auth.html'
10 | Then it should return a response with a 401 response code
11 |
12 | Scenario: Passing proper credentials to a page requiring Digest Authentication
13 | Given a remote service that returns 'Digest Authenticated Page'
14 | And that service is accessed at the path '/digest_auth.html'
15 | And that service is protected by Digest Authentication
16 | And that service requires the username 'jcash' with the password 'maninblack'
17 | When I call HTTParty#get with '/digest_auth.html' and a digest_auth hash:
18 | | username | password |
19 | | jcash | maninblack |
20 | Then the return value should match 'Digest Authenticated Page'
21 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/handles_compressed_responses.feature:
--------------------------------------------------------------------------------
1 | Feature: Handles Compressed Responses
2 |
3 | In order to save bandwidth
4 | As a developer
5 | I want to uncompress compressed responses
6 |
7 | Scenario: Supports deflate encoding
8 | Given a remote deflate service
9 | And the response from the service has a body of '
Some HTML
'
10 | And that service is accessed at the path '/deflate_service.html'
11 | When I call HTTParty#get with '/deflate_service.html'
12 | Then the return value should match '
Some HTML
'
13 |
14 | Scenario: Supports gzip encoding
15 | Given a remote gzip service
16 | And the response from the service has a body of '
Some HTML
'
17 | And that service is accessed at the path '/gzip_service.html'
18 | When I call HTTParty#get with '/gzip_service.html'
19 | Then the return value should match '
Some HTML
'
20 |
21 | Scenario: Supports HEAD request with gzip encoding
22 | Given a remote gzip service
23 | And that service is accessed at the path '/gzip_head.gz.js'
24 | When I call HTTParty#head with '/gzip_head.gz.js'
25 | Then it should return a response with a 200 response code
26 | Then it should return a response with a gzip content-encoding
27 | Then it should return a response with a blank body
28 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/steps/env.rb:
--------------------------------------------------------------------------------
1 | require 'mongrel'
2 | require './lib/httparty'
3 | require 'rspec/expectations'
4 | require 'aruba/cucumber'
5 |
6 | def run_server(port)
7 | @host_and_port = "0.0.0.0:#{port}"
8 | @server = Mongrel::HttpServer.new("0.0.0.0", port)
9 | @server.run
10 | @request_options = {}
11 | end
12 |
13 | def new_port
14 | server = TCPServer.new('0.0.0.0', nil)
15 | port = server.addr[1]
16 | ensure
17 | server.close
18 | end
19 |
20 | Before('~@command_line') do
21 | port = ENV["HTTPARTY_PORT"] || new_port
22 | run_server(port)
23 | end
24 |
25 | After do
26 | @server.stop if @server
27 | end
28 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/steps/httparty_response_steps.rb:
--------------------------------------------------------------------------------
1 | # Not needed anymore in ruby 2.0, but needed to resolve constants
2 | # in nested namespaces. This is taken from rails :)
3 | def constantize(camel_cased_word)
4 | names = camel_cased_word.split('::')
5 | names.shift if names.empty? || names.first.empty?
6 |
7 | constant = Object
8 | names.each do |name|
9 | constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
10 | end
11 | constant
12 | end
13 |
14 | Then /it should return an? (\w+)$/ do |class_string|
15 | expect(@response_from_httparty).to be_a(class_string.class)
16 | end
17 |
18 | Then /the return value should match '(.*)'/ do |expected_text|
19 | expect(@response_from_httparty.parsed_response).to eq(expected_text)
20 | end
21 |
22 | Then /it should return a Hash equaling:/ do |hash_table|
23 | expect(@response_from_httparty).to be_a(Hash)
24 | expect(@response_from_httparty.keys.length).to eq(hash_table.rows.length)
25 | hash_table.hashes.each do |pair|
26 | key, value = pair["key"], pair["value"]
27 | expect(@response_from_httparty.keys).to include(key)
28 | expect(@response_from_httparty[key]).to eq(value)
29 | end
30 | end
31 |
32 | Then /it should return an Array equaling:/ do |array|
33 | expect(@response_from_httparty).to be_a(Array)
34 | expect(@response_from_httparty.parsed_response).to eq(array.raw)
35 | end
36 |
37 | Then /it should return a response with a (\d+) response code/ do |code|
38 | expect(@response_from_httparty.code).to eq(code.to_i)
39 | end
40 |
41 | Then /it should return a response with a (.*) content\-encoding$/ do |content_type|
42 | expect(@response_from_httparty.headers['content-encoding']).to eq('gzip')
43 | end
44 |
45 | Then /it should return a response with a blank body$/ do
46 | expect(@response_from_httparty.body).to be_nil
47 | end
48 |
49 | Then /it should raise (?:an|a) ([\w:]+) exception/ do |exception|
50 | expect(@exception_from_httparty).to_not be_nil
51 | expect(@exception_from_httparty).to be_a constantize(exception)
52 | end
53 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/steps/httparty_steps.rb:
--------------------------------------------------------------------------------
1 | When /^I set my HTTParty timeout option to (\d+)$/ do |timeout|
2 | @request_options[:timeout] = timeout.to_i
3 | end
4 |
5 | When /^I set my HTTParty open_timeout option to (\d+)$/ do |timeout|
6 | @request_options[:open_timeout] = timeout.to_i
7 | end
8 |
9 | When /^I set my HTTParty read_timeout option to (\d+)$/ do |timeout|
10 | @request_options[:read_timeout] = timeout.to_i
11 | end
12 |
13 | When /I call HTTParty#get with '(.*)'$/ do |url|
14 | begin
15 | @response_from_httparty = HTTParty.get("http://#{@host_and_port}#{url}", @request_options)
16 | rescue HTTParty::RedirectionTooDeep, Timeout::Error => e
17 | @exception_from_httparty = e
18 | end
19 | end
20 |
21 | When /^I call HTTParty#head with '(.*)'$/ do |url|
22 | begin
23 | @response_from_httparty = HTTParty.head("http://#{@host_and_port}#{url}", @request_options)
24 | rescue HTTParty::RedirectionTooDeep, Timeout::Error => e
25 | @exception_from_httparty = e
26 | end
27 | end
28 |
29 | When /I call HTTParty#get with '(.*)' and a basic_auth hash:/ do |url, auth_table|
30 | h = auth_table.hashes.first
31 | @response_from_httparty = HTTParty.get(
32 | "http://#{@host_and_port}#{url}",
33 | basic_auth: { username: h["username"], password: h["password"] }
34 | )
35 | end
36 |
37 | When /I call HTTParty#get with '(.*)' and a digest_auth hash:/ do |url, auth_table|
38 | h = auth_table.hashes.first
39 | @response_from_httparty = HTTParty.get(
40 | "http://#{@host_and_port}#{url}",
41 | digest_auth: { username: h["username"], password: h["password"] }
42 | )
43 | end
44 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/supports_read_timeout_option.feature:
--------------------------------------------------------------------------------
1 | Feature: Supports the read timeout option
2 | In order to handle inappropriately slow response times
3 | As a developer
4 | I want my request to raise an exception after my specified read_timeout as elapsed
5 |
6 | Scenario: A long running response
7 | Given a remote service that returns '
Some HTML
'
8 | And that service is accessed at the path '/long_running_service.html'
9 | And that service takes 2 seconds to generate a response
10 | When I set my HTTParty read_timeout option to 1
11 | And I call HTTParty#get with '/long_running_service.html'
12 | Then it should raise a Timeout::Error exception
13 | And I wait for the server to recover
14 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/supports_redirection.feature:
--------------------------------------------------------------------------------
1 | Feature: Supports Redirection
2 |
3 | As a developer
4 | I want to work with services that may redirect me
5 | And I want it to follow a reasonable number of redirects
6 | Because sometimes web services do that
7 |
8 | Scenario: A service that redirects once
9 | Given a remote service that returns 'Service Response'
10 | And that service is accessed at the path '/landing_service.html'
11 | And the url '/redirector.html' redirects to '/landing_service.html'
12 | When I call HTTParty#get with '/redirector.html'
13 | Then the return value should match 'Service Response'
14 |
15 | # TODO: Look in to why this actually fails...
16 | Scenario: A service that redirects to a relative URL
17 |
18 | Scenario: A service that redirects infinitely
19 | Given the url '/first.html' redirects to '/second.html'
20 | And the url '/second.html' redirects to '/first.html'
21 | When I call HTTParty#get with '/first.html'
22 | Then it should raise an HTTParty::RedirectionTooDeep exception
23 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/features/supports_timeout_option.feature:
--------------------------------------------------------------------------------
1 | Feature: Supports the timeout option
2 | In order to handle inappropriately slow response times
3 | As a developer
4 | I want my request to raise an exception after my specified timeout as elapsed
5 |
6 | Scenario: A long running response
7 | Given a remote service that returns '
Some HTML
'
8 | And that service is accessed at the path '/long_running_service.html'
9 | And that service takes 2 seconds to generate a response
10 | When I set my HTTParty timeout option to 1
11 | And I call HTTParty#get with '/long_running_service.html'
12 | Then it should raise a Timeout::Error exception
13 | And I wait for the server to recover
14 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/httparty.gemspec:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | $LOAD_PATH.push File.expand_path("../lib", __FILE__)
3 | require "httparty/version"
4 |
5 | Gem::Specification.new do |s|
6 | s.name = "httparty"
7 | s.version = HTTParty::VERSION
8 | s.platform = Gem::Platform::RUBY
9 | s.licenses = ['MIT']
10 | s.authors = ["John Nunemaker", "Sandro Turriate"]
11 | s.email = ["nunemaker@gmail.com"]
12 | s.homepage = "http://jnunemaker.github.com/httparty"
13 | s.summary = 'Makes http fun! Also, makes consuming restful web services dead easy.'
14 | s.description = 'Makes http fun! Also, makes consuming restful web services dead easy.'
15 |
16 | s.required_ruby_version = '>= 1.9.3'
17 |
18 | s.add_dependency 'json', "~> 1.8"
19 | s.add_dependency 'multi_xml', ">= 0.5.2"
20 |
21 | # If this line is removed, all hard partying will cease.
22 | s.post_install_message = "When you HTTParty, you must party hard!"
23 |
24 | s.files = `git ls-files`.split("\n")
25 | s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
26 | s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
27 | s.require_paths = ["lib"]
28 | end
29 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/lib/httparty/cookie_hash.rb:
--------------------------------------------------------------------------------
1 | class HTTParty::CookieHash < Hash #:nodoc:
2 | CLIENT_COOKIES = %w(path expires domain path secure httponly)
3 |
4 | def add_cookies(value)
5 | case value
6 | when Hash
7 | merge!(value)
8 | when String
9 | value.split('; ').each do |cookie|
10 | array = cookie.split('=', 2)
11 | self[array[0].to_sym] = array[1]
12 | end
13 | else
14 | raise "add_cookies only takes a Hash or a String"
15 | end
16 | end
17 |
18 | def to_cookie_string
19 | delete_if { |k, v| CLIENT_COOKIES.include?(k.to_s.downcase) }.collect { |k, v| "#{k}=#{v}" }.join("; ")
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/lib/httparty/exceptions.rb:
--------------------------------------------------------------------------------
1 | module HTTParty
2 | # @abstact Exceptions raised by HTTParty inherit from Error
3 | class Error < StandardError; end
4 |
5 | # Exception raised when you attempt to set a non-existant format
6 | class UnsupportedFormat < Error; end
7 |
8 | # Exception raised when using a URI scheme other than HTTP or HTTPS
9 | class UnsupportedURIScheme < Error; end
10 |
11 | # @abstract Exceptions which inherit from ResponseError contain the Net::HTTP
12 | # response object accessible via the {#response} method.
13 | class ResponseError < Error
14 | # Returns the response of the last request
15 | # @return [Net::HTTPResponse] A subclass of Net::HTTPResponse, e.g.
16 | # Net::HTTPOK
17 | attr_reader :response
18 |
19 | # Instantiate an instance of ResponseError with a Net::HTTPResponse object
20 | # @param [Net::HTTPResponse]
21 | def initialize(response)
22 | @response = response
23 | end
24 | end
25 |
26 | # Exception that is raised when request has redirected too many times.
27 | # Calling {#response} returns the Net:HTTP response object.
28 | class RedirectionTooDeep < ResponseError; end
29 | end
30 |
--------------------------------------------------------------------------------
/bundle/ruby/gems/httparty-0.13.5/lib/httparty/hash_conversions.rb:
--------------------------------------------------------------------------------
1 | module HTTParty
2 | module HashConversions
3 | # @return This hash as a query string
4 | #
5 | # @example
6 | # { name: "Bob",
7 | # address: {
8 | # street: '111 Ruby Ave.',
9 | # city: 'Ruby Central',
10 | # phones: ['111-111-1111', '222-222-2222']
11 | # }
12 | # }.to_params
13 | # #=> "name=Bob&address[city]=Ruby Central&address[phones][]=111-111-1111&address[phones][]=222-222-2222&address[street]=111 Ruby Ave."
14 | def self.to_params(hash)
15 | hash.to_hash.map { |k, v| normalize_param(k, v) }.join.chop
16 | end
17 |
18 | # @param key