├── .github
└── workflows
│ └── ci.yaml
├── .rc
├── Changes
├── License
├── Makefile
├── Meta
├── ReadMe.pod
├── doc
├── git-hub-hack.swim
└── git-hub.swim
├── ext
├── bashplus
│ ├── .gitignore
│ ├── .gitrepo
│ ├── .travis.yml
│ ├── Changes
│ ├── License
│ ├── Makefile
│ ├── Meta
│ ├── ReadMe.pod
│ ├── bin
│ │ └── bash+
│ ├── doc
│ │ └── bash+.swim
│ ├── lib
│ │ └── bash+.bash
│ ├── man
│ │ ├── man1
│ │ │ └── bash+.1
│ │ └── man3
│ │ │ └── bash+.3
│ └── test
│ │ ├── base.t
│ │ ├── fcopy.t
│ │ ├── lib
│ │ └── foo
│ │ │ ├── bar.bash
│ │ │ └── foo.bash
│ │ ├── source-bash+-std.t
│ │ ├── source-bash+.t
│ │ ├── test.bash
│ │ └── use.t
├── json-bash
│ ├── .gitrepo
│ ├── .pkg
│ │ └── pkg.yaml
│ ├── .travis.yml
│ ├── Changes
│ ├── License
│ ├── Makefile
│ ├── Meta
│ ├── ReadMe.pod
│ ├── bin
│ │ ├── json-to-linear
│ │ └── json-value
│ ├── doc
│ │ ├── json.bash.1
│ │ └── json.swim
│ ├── ext
│ │ └── test-more-bash
│ │ │ ├── .gitrepo
│ │ │ ├── .travis.yml
│ │ │ ├── Changes
│ │ │ ├── License
│ │ │ ├── Makefile
│ │ │ ├── Meta
│ │ │ ├── ReadMe.pod
│ │ │ ├── doc
│ │ │ └── test-more.swim
│ │ │ ├── ext
│ │ │ ├── bashplus
│ │ │ │ ├── .gitignore
│ │ │ │ ├── .gitrepo
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── Changes
│ │ │ │ ├── License
│ │ │ │ ├── Makefile
│ │ │ │ ├── Meta
│ │ │ │ ├── ReadMe.pod
│ │ │ │ ├── bin
│ │ │ │ │ └── bash+
│ │ │ │ ├── doc
│ │ │ │ │ └── bash+.swim
│ │ │ │ ├── lib
│ │ │ │ │ └── bash+.bash
│ │ │ │ ├── man
│ │ │ │ │ ├── man1
│ │ │ │ │ │ └── bash+.1
│ │ │ │ │ └── man3
│ │ │ │ │ │ └── bash+.3
│ │ │ │ └── test
│ │ │ │ │ ├── base.t
│ │ │ │ │ ├── fcopy.t
│ │ │ │ │ ├── lib
│ │ │ │ │ └── foo
│ │ │ │ │ │ ├── bar.bash
│ │ │ │ │ │ └── foo.bash
│ │ │ │ │ ├── source-bash+-std.t
│ │ │ │ │ ├── source-bash+.t
│ │ │ │ │ ├── test.bash
│ │ │ │ │ └── use.t
│ │ │ └── test-tap-bash
│ │ │ │ ├── .gitrepo
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── Changes
│ │ │ │ ├── License
│ │ │ │ ├── Makefile
│ │ │ │ ├── Meta
│ │ │ │ ├── ReadMe.pod
│ │ │ │ ├── doc
│ │ │ │ └── test-tap.swim
│ │ │ │ ├── lib
│ │ │ │ └── test
│ │ │ │ │ └── tap.bash
│ │ │ │ ├── man
│ │ │ │ └── man3
│ │ │ │ │ └── test-tap.3
│ │ │ │ └── test
│ │ │ │ ├── bail_out.t
│ │ │ │ ├── done.t
│ │ │ │ ├── fail.t
│ │ │ │ ├── fail_fast.t
│ │ │ │ ├── helper.bash
│ │ │ │ ├── pass.t
│ │ │ │ ├── plan.t
│ │ │ │ ├── skip_all.t
│ │ │ │ ├── tap.t
│ │ │ │ └── test
│ │ │ │ ├── bail.t
│ │ │ │ ├── fail.t
│ │ │ │ ├── fail_fast.t
│ │ │ │ ├── skip-all-init.t
│ │ │ │ └── skip-all-plan.t
│ │ │ ├── lib
│ │ │ └── test
│ │ │ │ └── more.bash
│ │ │ ├── man
│ │ │ └── man3
│ │ │ │ └── test-more.3
│ │ │ └── test
│ │ │ ├── fail.t
│ │ │ ├── more.t
│ │ │ ├── pass.t
│ │ │ ├── setup
│ │ │ ├── skip_all.t
│ │ │ └── test
│ │ │ ├── fail1.t
│ │ │ └── skip_all.t
│ ├── lib
│ │ └── json.bash
│ ├── man
│ │ └── man1
│ │ │ └── json.1
│ ├── note
│ │ └── todo
│ └── test
│ │ ├── first-element.t
│ │ ├── get.t
│ │ ├── issue4.json
│ │ ├── issues.t
│ │ ├── keys.json
│ │ ├── keys.t
│ │ ├── load.t
│ │ ├── setup
│ │ ├── test1.json
│ │ └── trailing-newlines.t
└── test-more-bash
│ ├── .gitrepo
│ ├── .travis.yml
│ ├── Changes
│ ├── License
│ ├── Makefile
│ ├── Meta
│ ├── ReadMe.pod
│ ├── doc
│ └── test-more.swim
│ ├── ext
│ ├── bashplus
│ │ ├── .gitignore
│ │ ├── .gitrepo
│ │ ├── .travis.yml
│ │ ├── Changes
│ │ ├── License
│ │ ├── Makefile
│ │ ├── Meta
│ │ ├── ReadMe.pod
│ │ ├── bin
│ │ │ └── bash+
│ │ ├── doc
│ │ │ └── bash+.swim
│ │ ├── lib
│ │ │ └── bash+.bash
│ │ ├── man
│ │ │ ├── man1
│ │ │ │ └── bash+.1
│ │ │ └── man3
│ │ │ │ └── bash+.3
│ │ └── test
│ │ │ ├── base.t
│ │ │ ├── fcopy.t
│ │ │ ├── lib
│ │ │ └── foo
│ │ │ │ ├── bar.bash
│ │ │ │ └── foo.bash
│ │ │ ├── source-bash+-std.t
│ │ │ ├── source-bash+.t
│ │ │ ├── test.bash
│ │ │ └── use.t
│ └── test-tap-bash
│ │ ├── .gitrepo
│ │ ├── .travis.yml
│ │ ├── Changes
│ │ ├── License
│ │ ├── Makefile
│ │ ├── Meta
│ │ ├── ReadMe.pod
│ │ ├── doc
│ │ └── test-tap.swim
│ │ ├── lib
│ │ └── test
│ │ │ └── tap.bash
│ │ ├── man
│ │ └── man3
│ │ │ └── test-tap.3
│ │ └── test
│ │ ├── bail_out.t
│ │ ├── done.t
│ │ ├── fail.t
│ │ ├── fail_fast.t
│ │ ├── helper.bash
│ │ ├── pass.t
│ │ ├── plan.t
│ │ ├── skip_all.t
│ │ ├── tap.t
│ │ └── test
│ │ ├── bail.t
│ │ ├── fail.t
│ │ ├── fail_fast.t
│ │ ├── skip-all-init.t
│ │ └── skip-all-plan.t
│ ├── lib
│ └── test
│ │ └── more.bash
│ ├── man
│ └── man3
│ │ └── test-more.3
│ └── test
│ ├── fail.t
│ ├── more.t
│ ├── pass.t
│ ├── setup
│ ├── skip_all.t
│ └── test
│ ├── fail1.t
│ └── skip_all.t
├── lib
├── git-hub
└── git-hub.d
│ ├── bash+.bash
│ ├── git-hub-cache-clear
│ ├── git-hub-comment
│ ├── git-hub-config
│ ├── git-hub-fork
│ ├── git-hub-gist
│ ├── git-hub-irc
│ ├── git-hub-issue
│ ├── git-hub-keys
│ ├── git-hub-member
│ ├── git-hub-notify
│ ├── git-hub-open
│ ├── git-hub-org
│ ├── git-hub-other
│ ├── git-hub-pr
│ ├── git-hub-repo
│ ├── git-hub-repo-init
│ ├── git-hub-scope
│ ├── git-hub-search
│ ├── git-hub-setup
│ ├── git-hub-team
│ ├── git-hub-token
│ ├── git-hub-upgrade
│ ├── git-hub-url
│ ├── git-hub-user
│ ├── help-functions.bash
│ ├── json-perl.bash
│ ├── json-setup.bash
│ ├── json.bash
│ └── json.pl
├── man
└── man1
│ └── git-hub.1
├── note
├── .gitignore
├── Commands
├── ToDo
├── func-list
├── pull-request-spec.md
└── test-commands
├── pkg
└── cpan
│ ├── .travis.yml
│ ├── About
│ ├── Changes
│ ├── Meta
│ ├── ReadMe.pod
│ ├── bin
│ └── git-hub
│ ├── doc
│ └── App
│ │ └── git
│ │ └── hub.swim
│ ├── lib
│ └── App
│ │ └── git
│ │ └── hub.pm
│ ├── share
│ ├── lib
│ └── man
│ └── test
│ └── test.t
├── plugin
└── git-hub-travis
│ ├── .gitrepo
│ ├── .travis.yml
│ ├── Makefile
│ ├── ReadMe.pod
│ ├── doc
│ ├── git-hub-travis.1
│ └── git-hub-travis.swim
│ ├── ext
│ └── test-more-bash
│ │ ├── .gitrepo
│ │ ├── .travis.yml
│ │ ├── Changes
│ │ ├── License
│ │ ├── Makefile
│ │ ├── Meta
│ │ ├── ReadMe.pod
│ │ ├── doc
│ │ └── test-more.swim
│ │ ├── ext
│ │ ├── bashplus
│ │ │ ├── .gitignore
│ │ │ ├── .gitrepo
│ │ │ ├── .travis.yml
│ │ │ ├── Changes
│ │ │ ├── License
│ │ │ ├── Makefile
│ │ │ ├── Package
│ │ │ ├── ReadMe.md
│ │ │ ├── bin
│ │ │ │ └── bash+
│ │ │ ├── doc
│ │ │ │ └── bash+.md
│ │ │ ├── lib
│ │ │ │ └── bash+.bash
│ │ │ └── test
│ │ │ │ ├── base.t
│ │ │ │ ├── fcopy.t
│ │ │ │ ├── lib
│ │ │ │ └── foo
│ │ │ │ │ ├── bar.bash
│ │ │ │ │ └── foo.bash
│ │ │ │ ├── source-bash+-std.t
│ │ │ │ ├── source-bash+.t
│ │ │ │ ├── test.bash
│ │ │ │ └── use.t
│ │ └── test-tap-bash
│ │ │ ├── .gitrepo
│ │ │ ├── .travis.yml
│ │ │ ├── Changes
│ │ │ ├── License
│ │ │ ├── Makefile
│ │ │ ├── Package
│ │ │ ├── ReadMe.md
│ │ │ ├── doc
│ │ │ └── test-tap.md
│ │ │ ├── lib
│ │ │ └── test
│ │ │ │ └── tap.bash
│ │ │ └── test
│ │ │ ├── bail_out.t
│ │ │ ├── done.t
│ │ │ ├── fail.t
│ │ │ ├── fail_fast.t
│ │ │ ├── helper.bash
│ │ │ ├── pass.t
│ │ │ ├── plan.t
│ │ │ ├── skip_all.t
│ │ │ ├── tap.t
│ │ │ └── test
│ │ │ ├── bail.t
│ │ │ ├── fail.t
│ │ │ ├── fail_fast.t
│ │ │ ├── skip-all-init.t
│ │ │ └── skip-all-plan.t
│ │ ├── lib
│ │ └── test
│ │ │ └── more.bash
│ │ ├── man
│ │ └── man3
│ │ │ └── test-more.3
│ │ └── test
│ │ ├── fail.t
│ │ ├── more.t
│ │ ├── pass.t
│ │ ├── setup
│ │ ├── skip_all.t
│ │ └── test
│ │ ├── fail1.t
│ │ └── skip_all.t
│ ├── lib
│ ├── git-hub-travis-disable
│ └── git-hub-travis-enable
│ ├── man
│ └── man1
│ │ └── git-hub-travis.1
│ ├── note
│ └── todo
│ └── test
│ ├── setup
│ └── use_ok.t
├── share
├── completion.bash
├── enable-completion.sh
├── git-completion.bash
└── zsh-completion
│ └── _git-hub
├── test
├── ReadMe.md
├── args.t
├── bin
│ ├── clean-head.rb
│ ├── clean-json.rb
│ ├── make-command-test
│ └── make-fake-repo
├── changes.t
├── commands.t
├── commands
│ ├── drinkup+git_hub_fork
│ │ ├── e4f5a477e23652028a1b18b83d6437b0d11753a8
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_repo
│ │ ├── 779b694ba94ef6574892d1161a9ce6bc6b7a0500
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_star
│ │ ├── dc30e59d940e09376f6b7e8dea08bc4e52d2c9c1
│ │ │ ├── err
│ │ │ └── head
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_user
│ │ ├── 976efa9d52ae05a961db6dd5ad8b054c3abe22e1
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_user_-O
│ │ ├── 19651663813e9c1e31e7ae6b3d4fbdd78dc5b48a
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_user_-r
│ │ ├── 976efa9d52ae05a961db6dd5ad8b054c3abe22e1
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_user_aocole
│ │ ├── e35bf7564cdc5d9e19589899eb7cf2471eb81684
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── drinkup+git_hub_user_aocole_-r
│ │ ├── e35bf7564cdc5d9e19589899eb7cf2471eb81684
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── git-hub+git_hub_repos
│ │ ├── 71aeacd7aeae24ba552664f11c6a5c40e9c09b61
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── git-hub+git_hub_user
│ │ ├── 73c0684d632059a4f511ba3369274aeb82ab9f01
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── not-repo+git_hub_repos
│ │ ├── 01f8932c5ab49a067328832450845bafd9ab7942
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── not-repo+git_hub_repos_-c5
│ │ ├── 3a793bff9546bbf81cafa1a6c55f67f3c3757d76
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── not-repo+git_hub_repos_stash
│ │ ├── 2348f7e1f193b9e8e88030cad75c8ff46ec7dd9e
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── not-repo+git_hub_repos_tadzik_-a
│ │ ├── 2cf9b013ff449b41f503a3bfdb2dbf90a664d667
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── eb1a3c8b00f4f738e93ab285600ef4e217386f47
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ ├── not-repo+git_hub_user
│ │ ├── e35bf7564cdc5d9e19589899eb7cf2471eb81684
│ │ │ ├── err
│ │ │ ├── head
│ │ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
│ └── not-repo+git_hub_user_frioux
│ │ ├── 976efa9d52ae05a961db6dd5ad8b054c3abe22e1
│ │ ├── err
│ │ ├── head
│ │ └── out
│ │ ├── run.bash
│ │ ├── stderr
│ │ └── stdout
├── compile.t
├── devel
│ ├── all_commands.t
│ └── each.t
├── githubconfig
├── lib
│ ├── git-hub-subclass
│ └── git-hub-test-run
├── repo
│ ├── drinkup
│ │ ├── HEAD
│ │ ├── config
│ │ ├── objects
│ │ │ └── _
│ │ └── refs
│ │ │ └── _
│ ├── git-hub
│ │ ├── HEAD
│ │ ├── config
│ │ ├── objects
│ │ │ └── _
│ │ └── refs
│ │ │ └── _
│ ├── git-scheme
│ │ ├── HEAD
│ │ ├── config
│ │ ├── objects
│ │ │ └── _
│ │ └── refs
│ │ │ └── _
│ ├── not-repo
│ │ └── _
│ └── ricardo-foo
│ │ ├── HEAD
│ │ ├── config
│ │ ├── objects
│ │ └── _
│ │ └── refs
│ │ └── _
├── setup
├── source-all.t
└── url.t
└── tool
├── generate-completion.pl
└── generate-help-functions.pl
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | name: CI
3 |
4 | on:
5 | push:
6 | branches: [ '*' ]
7 | pull_request:
8 | branches: [ main ]
9 |
10 | # Allows you to run this workflow manually from the Actions tab
11 | workflow_dispatch:
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v2
19 |
20 | - name: Info
21 | run: |
22 | set -x
23 | bash --version
24 | perl -v
25 | env | sort
26 |
27 | - name: Test
28 | run: |
29 | PROVEOPT=-v make test
30 |
--------------------------------------------------------------------------------
/.rc:
--------------------------------------------------------------------------------
1 | #!bash
2 |
3 | #------------------------------------------------------------------------------
4 | #
5 | # This is the `git-hub` initialization script.
6 | #
7 | # This script turns on the `git-hub` Git subcommand, its manpages and TAB
8 | # completion for the *Bash* and *zsh* shells.
9 | #
10 | # Just add a line like this to your shell startup configuration:
11 | #
12 | # source /path/to/git-hub/.rc
13 | #
14 | #------------------------------------------------------------------------------
15 |
16 | [[ -n ${ZSH_VERSION-} ]] &&
17 | GIT_HUB_ROOT="$0" ||
18 | GIT_HUB_ROOT="$BASH_SOURCE"
19 | [[ $GIT_HUB_ROOT =~ ^/ ]] ||
20 | GIT_HUB_ROOT="$PWD/$GIT_HUB_ROOT"
21 | export GIT_HUB_ROOT="$(cd "$(dirname $GIT_HUB_ROOT)"; pwd)"
22 |
23 | export PATH="$GIT_HUB_ROOT/lib:$PATH"
24 | export MANPATH="$GIT_HUB_ROOT/man:${MANPATH-}"
25 |
26 | source "$GIT_HUB_ROOT/share/enable-completion.sh"
27 |
--------------------------------------------------------------------------------
/License:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013-2016 Ingy döt Net
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.
22 |
--------------------------------------------------------------------------------
/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.1
2 |
3 | name: git-hub
4 | version: 0.1.0
5 | abstract: The Git command for GitHub
6 | homepage: http://bpan.org/package/git-hub/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | git: 1.7.0
21 | bashplus: 0.0.1
22 | json: 0.0.1
23 |
24 | test:
25 | cmd: make test
26 | requires:
27 | test-more: 0.0.1
28 |
29 | install: make bpan-install
30 |
31 | devel:
32 | git: git@github.org:ingydotnet/git-hub.git
33 | irc: irc.freenode.net/gitcommands
34 | bug: https://github.com/ingydotnet/git-hub/issues/
35 |
--------------------------------------------------------------------------------
/doc/git-hub-hack.swim:
--------------------------------------------------------------------------------
1 | git-hub-hack
2 | ============
3 |
4 | How to hack on `git-hub`.
5 |
6 | = Synopsis
7 |
8 | git hub fork ingydotnet/git-hub
9 | git hub clone git-hub
10 | cd git-hub
11 | make dev-install
12 | man git-hub-hacker
13 | # … write some tests …
14 | # … hack hack hack …
15 | make test
16 | make dev-test
17 | git hub pr-new
18 |
19 |
20 | = Welcome Young Hacker
21 |
22 | If you are reading this, hopefully you want to contribute to the `git-hub`
23 | command. Welcome!
24 |
25 | The `git-hub` command does a lot of things
26 |
--------------------------------------------------------------------------------
/ext/bashplus/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/ext/bashplus/.gitignore
--------------------------------------------------------------------------------
/ext/bashplus/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/bashplus.git
8 | branch = master
9 | commit = aba653bd279d584c9e40803e10a10a9c16050393
10 | parent = 4aacae3f479f5e2d589772440cdcc148ca3e1eb5
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/bashplus/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/bashplus/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.7
3 | date: Sat Jan 23 16:28:59 PST 2016
4 | changes:
5 | - Update tooling, and copyright
6 | ---
7 | version: 0.0.6
8 | date: Fri Jan 23 21:05:15 PST 2015
9 | changes:
10 | - Update tooling, and copyright
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 19:07:51 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/bashplus/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016 Ingy döt Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/bashplus/Makefile:
--------------------------------------------------------------------------------
1 | ifeq ($(MAKECMDGOALS),install)
2 | ifeq "$(shell bpan version 2>/dev/null)" ""
3 | $(error 'BPAN not installed. See http://bpan.org')
4 | endif
5 | endif
6 |
7 | NAME := bash+
8 | LIB := lib/$(NAME).bash
9 | DOC := doc/$(NAME).swim
10 | MAN1 := man/man1
11 | MAN3 := man/man3
12 |
13 | INSTALL_LIB ?= $(shell bpan env BPAN_LIB)
14 | INSTALL_DIR ?= test
15 | INSTALL_MAN1 ?= $(shell bpan env BPAN_MAN1)
16 | INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
17 |
18 | default: help
19 |
20 | help:
21 | @echo 'Rules: test, install, doc'
22 |
23 | .PHONY: test
24 | test:
25 | prove $(PROVEOPT:%=% )test/
26 |
27 | install:
28 | install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
29 | install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
30 | install -C -d -m 0755 $(INSTALL_MAN1)/
31 | install -C -d -m 0755 $(INSTALL_MAN3)/
32 | install -C -m 0644 $(MAN1)/$(NAME).1 $(INSTALL_MAN1)/
33 | install -C -m 0644 $(MAN3)/$(NAME).3 $(INSTALL_MAN3)/
34 |
35 | .PHONY: doc
36 | doc: ReadMe.pod $(MAN1)/$(NAME).1 $(MAN3)/$(NAME).3
37 |
38 | ReadMe.pod: $(DOC)
39 | swim --to=pod --complete --wrap $< > $@
40 |
41 | $(MAN1)/%.1: doc/%.swim
42 | swim --to=man $< > $@
43 |
44 | $(MAN3)/%.3: doc/%.swim
45 | swim --to=man $< > $@
46 |
--------------------------------------------------------------------------------
/ext/bashplus/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: bashplus
4 | version: 0.0.7
5 | abstract: Modern Bash Programming
6 | homepage: http://bpan.org/package/bashplus/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | test:
21 | cmd: make test
22 | install:
23 | cmd: make install
24 |
25 | devel:
26 | git: git@github.org/ingydotnet/bashplus
27 | irc: irc.freenode.net/bpan
28 | bug: https://github.com/ingydotnet/bashplus/issues/
29 |
--------------------------------------------------------------------------------
/ext/bashplus/ReadMe.pod:
--------------------------------------------------------------------------------
1 | =pod
2 |
3 | =for comment
4 | DO NOT EDIT. This Pod was generated by Swim v0.1.41.
5 | See http://github.com/ingydotnet/swim-pm#readme
6 |
7 | =encoding utf8
8 |
9 | =head1 Name
10 |
11 | Bash+(1) - Modern Bash Programming
12 |
13 | =for html
14 |
15 |
16 | =head1 Synopsis
17 |
18 | source bash+ :std :array
19 |
20 | use Foo::Bar this that
21 |
22 | Array.new args "$@"
23 |
24 | if args.empty?; then
25 | die "I need args!"
26 | fi
27 |
28 | Foo::Bar.new foo args
29 |
30 | this is awesome # <= this is a real command! (You just imported it)
31 |
32 | =head1 Description
33 |
34 | Bash+ is just Bash... B some libraries that can make Bash programming a
35 | lot nicer.
36 |
37 | =for comment # Installation
38 |
39 | Get the source code from GitHub:
40 |
41 | git clone git@github.com:ingydotnet/bashplus
42 |
43 | Then run:
44 |
45 | make test
46 | make install # Possibly with 'sudo'
47 |
48 | =head1 Usage
49 |
50 | For now look at some libraries the use Bash+:
51 |
52 | =over
53 |
54 | =item * L
55 |
56 | =item * L
57 |
58 | =item * L
59 |
60 | =back
61 |
62 | =head1 Status
63 |
64 | If you are interested in chatting about this, C on
65 | irc.freenode.net.
66 |
67 | =head1 Author
68 |
69 | Written by Ingy döt Net
70 |
71 | =head1 Copyright & License
72 |
73 | Copyright 2013-2016. Ingy döt Net.
74 |
75 | The MIT License (MIT).
76 |
77 | =cut
78 |
--------------------------------------------------------------------------------
/ext/bashplus/bin/bash+:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #------------------------------------------------------------------------------
3 | # Bash+ - Modern Bash Programming
4 | #
5 | # Copyright (c) 2013-2016 Ingy döt Net
6 | #------------------------------------------------------------------------------
7 |
8 | set -e
9 | shopt -s compat31&>/dev/null||:
10 |
11 | #------------------------------------------------------------------------------
12 | # Determine how `bash+` was called, and do the right thing:
13 | #------------------------------------------------------------------------------
14 | if [ "${BASH_SOURCE[0]}" != "$0" ]; then
15 | # 'bash+' is being sourced:
16 | [[ "${BASH_SOURCE[0]}" =~ /bin/bash\\+$ ]] || {
17 | echo "Invalid Bash+ path '${BASH_SOURCE[0]}'" 2> /dev/null
18 | exit 1
19 | }
20 | source "${BASH_SOURCE[0]%/bin/*}"/lib/bash+.bash || return $?
21 | bash+:import "$@"
22 | return $?
23 | else
24 | if [ $# -eq 1 -a "$1" == --version ]; then
25 | echo 'bash+ version 0.0.7'
26 | else
27 | cat <<...
28 |
29 | Greetings modern Bash programmer. Welcome to Bash+!
30 |
31 | Bash+ is framework that makes Bash programming more like Ruby and Perl.
32 |
33 | See: https://github.com/bpan-org/bashplus
34 |
35 | If you got here trying to use bash+ in a program, you need to source it:
36 |
37 | source bash+
38 |
39 | Happy Bash Hacking!
40 |
41 | ...
42 | fi
43 | fi
44 |
--------------------------------------------------------------------------------
/ext/bashplus/doc/bash+.swim:
--------------------------------------------------------------------------------
1 | Bash+(1)
2 | ========
3 |
4 | Modern Bash Programming
5 |
6 |
7 |
8 | = Synopsis
9 |
10 | source bash+ :std :array
11 |
12 | use Foo::Bar this that
13 |
14 | Array.new args "$@"
15 |
16 | if args.empty?; then
17 | die "I need args!"
18 | fi
19 |
20 | Foo::Bar.new foo args
21 |
22 | this is awesome # <= this is a real command! (You just imported it)
23 |
24 | = Description
25 |
26 | Bash+ is just Bash... *plus* some libraries that can make Bash programming a
27 | lot nicer.
28 |
29 | ## Installation
30 |
31 | Get the source code from GitHub:
32 |
33 | git clone git@github.com:ingydotnet/bashplus
34 |
35 | Then run:
36 |
37 | make test
38 | make install # Possibly with 'sudo'
39 |
40 | = Usage
41 |
42 | For now look at some libraries the use Bash+:
43 |
44 | * https://github.com/ingydotnet/git-hub
45 | * https://github.com/ingydotnet/json-bash
46 | * https://github.com/ingydotnet/test-more-bash
47 |
48 | = Status
49 |
50 | If you are interested in chatting about this, `/join #bpan` on
51 | irc.freenode.net.
52 |
53 | = Author
54 |
55 | Written by Ingy döt Net
56 |
57 | = Copyright & License
58 |
59 | Copyright 2013-2016. Ingy döt Net.
60 |
61 | The MIT License (MIT).
62 |
--------------------------------------------------------------------------------
/ext/bashplus/test/base.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok $? '`source bash+` works'
9 |
10 | is "$BASHPLUS_VERSION" '0.0.7' 'BASHPLUS_VERSION is 0.0.7'
11 |
12 | done_testing 2
13 |
--------------------------------------------------------------------------------
/ext/bashplus/test/fcopy.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | foo() {
9 | echo O HAI
10 | }
11 |
12 | like "$(type bar 2>&1)" 'bar: not found' \
13 | 'bar is not yet a function'
14 |
15 | bash+:fcopy foo bar
16 |
17 | type -t bar &>/dev/null
18 | ok $? 'bar is now a function'
19 | is "$(type foo | tail -n+3)" "$(type bar | tail -n+3)" \
20 | 'Copy matches original'
21 |
22 | done_testing 3
23 |
--------------------------------------------------------------------------------
/ext/bashplus/test/lib/foo/bar.bash:
--------------------------------------------------------------------------------
1 | Foo__Bar_VERSION='1.2.3'
2 |
3 | Foo::Bar:baz() { :;}
4 |
--------------------------------------------------------------------------------
/ext/bashplus/test/lib/foo/foo.bash:
--------------------------------------------------------------------------------
1 | Foo::Foo:import() {
2 | echo $1---$2
3 | }
4 |
--------------------------------------------------------------------------------
/ext/bashplus/test/source-bash+-std.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok "`bash+:can use`" 'use is imported'
9 | ok "`bash+:can die`" 'die is imported'
10 | ok "`bash+:can warn`" 'warn is imported'
11 |
12 | ok "`! bash+:can import`" 'import is not imported'
13 | ok "`! bash+:can main`" 'main is not imported'
14 | ok "`! bash+:can fcopy`" 'fcopy is not imported'
15 | ok "`! bash+:can findlib`" 'findlib is not imported'
16 | ok "`! bash+:can can`" 'can is not imported'
17 |
18 | done_testing 8
19 |
--------------------------------------------------------------------------------
/ext/bashplus/test/source-bash+.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | functions=(
9 | use
10 | import
11 | fcopy
12 | findlib
13 | die
14 | warn
15 | can
16 | )
17 |
18 | for f in ${functions[@]}; do
19 | is "$(type -t "bash+:$f")" function \
20 | "bash+:$f is a function"
21 | done
22 |
23 | done_testing 7
24 |
--------------------------------------------------------------------------------
/ext/bashplus/test/test.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #------------------------------------------------------------------------------
4 | # This is a tiny version of test-more-bash that I use here. test-more-bash uses
5 | # bash+, so I want to avoid the circular dependency. This little guy does
6 | # 80-90% what test-more-bash does, with minimal code. It's a good example of
7 | # how nice Bash can be.
8 | #------------------------------------------------------------------------------
9 |
10 | plan() {
11 | echo "1..$1"
12 | }
13 |
14 | pass() {
15 | let run=run+1
16 | echo "ok $run${1:+ - $1}"
17 | }
18 |
19 | fail() {
20 | let run=run+1
21 | echo "not ok $run${1:+ - $1}"
22 | }
23 |
24 | is() {
25 | if [ "$1" == "$2" ]; then
26 | pass "$3"
27 | else
28 | fail "$3"
29 | diag "Got: $1"
30 | diag "Want: $2"
31 | fi
32 | }
33 |
34 | ok() {
35 | (exit ${1:-$?}) &&
36 | pass "$2" ||
37 | fail "$2"
38 | }
39 |
40 | like() {
41 | if [[ "$1" =~ "$2" ]]; then
42 | pass "$3"
43 | else
44 | fail "$3"
45 | diag "Got: $1"
46 | diag "Like: $2"
47 | fi
48 | }
49 |
50 | unlike() {
51 | if [[ ! "$1" =~ "$2" ]]; then
52 | pass "$3"
53 | else
54 | fail "$3"
55 | diag "Got: $1"
56 | diag "Dont: $2"
57 | fi
58 | }
59 |
60 | done_testing() {
61 | echo "1..${1:-$run}"
62 | }
63 |
64 | diag() {
65 | echo "# ${1//$'\n'/$'\n'# }" >&2
66 | }
67 |
68 | note() {
69 | echo "# ${1//$'\n'/$'\n'# }"
70 | }
71 |
--------------------------------------------------------------------------------
/ext/bashplus/test/use.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std can
7 |
8 | BASHLIB=test/lib
9 |
10 | use Foo::Bar
11 | ok $? 'use Foo::Bar - works'
12 | ok "`can Foo::Bar:baz`" 'Function Foo::Bar:baz exists'
13 | is "$Foo__Bar_VERSION" 1.2.3 '$Foo__Bar_VERSION == 1.2.3'
14 |
15 | output=`use Foo::Foo Boo Booo`
16 | ok $? 'use Foo::Foo Boo Booo - works'
17 | is "$output" Boo---Booo 'Correct import called'
18 |
19 | done_testing 5
20 |
--------------------------------------------------------------------------------
/ext/json-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/json-bash.git
8 | branch = master
9 | commit = d94c3085583c9865463c12273e15b704c87d455c
10 | parent = 3df29421c7be1c3d02e2e4e9fed4605aedfb7a6c
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/json-bash/.pkg/pkg.yaml:
--------------------------------------------------------------------------------
1 | pkg:
2 | submodule: ./ext
3 | repo:
4 | - url: git://github.com:ingydotnet/bash-pkg.git
5 | - url: git://github.com:ingydotnet/ingy-pkg.git
6 |
7 | name: json-bash
8 | abstract: JSON Loader/Dumper for Bash
9 | version: 0.0.1
10 | description: |
11 | This library provides functions to load JSON into an internal format, and to
12 | dump the internal format into JSON.
13 |
--------------------------------------------------------------------------------
/ext/json-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/json-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.2
3 | date: Sun Jan 24 07:36:36 PST 2016
4 | changes: First official tagged release. Originally written in August 2013.
5 |
--------------------------------------------------------------------------------
/ext/json-bash/License:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013-2016 Ingy döt Net
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.
22 |
--------------------------------------------------------------------------------
/ext/json-bash/Makefile:
--------------------------------------------------------------------------------
1 | CMD := json.bash
2 |
3 | PREFIX ?= /usr/local
4 | INSTALL_LIB ?= $(PREFIX)/lib/bash
5 | INSTALL_MAN ?= $(PREFIX)/share/man/man1
6 |
7 | # Submodules
8 | TEST_MORE := ext/test-more-bash/lib/test/more.bash
9 |
10 | ##
11 | # User targets:
12 | default: help
13 |
14 | help:
15 | @echo 'Makefile rules:'
16 | @echo ''
17 | @echo 'test Run all tests'
18 | @echo 'install Install $(CMD)'
19 | @echo 'uninstall Uninstall $(CMD)'
20 | @echo 'clean Remove build/test files'
21 |
22 | .PHONY: test
23 | test: $(TEST_MORE)
24 | prove $(PROVEOPT) test/
25 |
26 | install: $(INSTALL_LIB)
27 | install -m 0755 lib/$(CMD) $(INSTALL_LIB)/
28 | install -c -d -m 0755 $(INSTALL_MAN)/
29 | install -c -m 0644 man/man1/$(CMD).1 $(INSTALL_MAN)/
30 |
31 | uninstall:
32 | rm -f $(INSTALL_LIB)/$(CMD)
33 | rm -f $(INSTALL_MAN)/$(CMD).1
34 |
35 | clean purge:
36 | true
37 |
38 | # Builder rules:
39 | .PHONY: doc
40 | doc: ReadMe.pod man/man1/json.1
41 |
42 | ReadMe.pod: doc/json.swim
43 | swim --to=pod --wrap --complete $< > $@
44 |
45 | man/man1/json.1: doc/json.swim
46 | swim --to=man $< > $@
47 |
48 | $(INSTALL_LIB):
49 | mkdir -p $@
50 |
--------------------------------------------------------------------------------
/ext/json-bash/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: json
4 | version: 0.0.2
5 | abstract: JSON for Bash
6 | homepage: http://bpan.org/package/json/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | test:
21 | cmd: make test
22 | requires:
23 | test-more: 0.0.3
24 | install:
25 | cmd: make install
26 |
27 | devel:
28 | git: git:github.org:ingydotnet/json-bash.git
29 | irc: irc.freenode.net/bpan
30 | bug: https://github.com/ingydotnet/json-bash/issues/
31 |
--------------------------------------------------------------------------------
/ext/json-bash/bin/json-to-linear:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | PATH="$(dirname $0)/../lib:$PATH" source json.bash
4 |
5 | JSON.load
6 |
--------------------------------------------------------------------------------
/ext/json-bash/bin/json-value:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | PATH="$(dirname $0)/../lib:$PATH" source json.bash
4 |
5 | JSON.load | JSON.get "$@"
6 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/test-more-bash.git
8 | branch = master
9 | commit = 05a1bddbe237bbf2c390048c80ca70d4f66c6a37
10 | parent = 8d487b26a087f17ac8ffab8f46406ea716de9816
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.3
3 | date: Sat Jan 23 16:39:20 PST 2016
4 | changes:
5 | - Make up to date
6 | ---
7 | version: 0.0.2
8 | date: Fri Jan 23 21:26:18 PST 2015
9 | changes:
10 | - Make up to date
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 22:53:10 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016. Ingy döt Net.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/Makefile:
--------------------------------------------------------------------------------
1 | NAME := test-more
2 | DOC := doc/$(NAME).swim
3 | MAN3 := man/man3
4 |
5 | default: help
6 |
7 | help:
8 | @echo 'Rules: test, doc'
9 |
10 | .PHONY: test
11 | test:
12 | prove $(PROVEOPT:%=% )test/
13 |
14 | doc: ReadMe.pod $(MAN3)/$(NAME).3
15 |
16 | ReadMe.pod: $(DOC)
17 | swim --to=pod --complete --wrap $< > $@
18 |
19 | $(MAN3)/%.3: doc/%.swim
20 | swim --to=man $< > $@
21 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: test-more
4 | version: 0.0.3
5 | abstract: TAP Testing for Bash
6 | homepage: http://bpan.org/package/test-more/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | bashplus: 0.0.7
21 | test-tap: 0.0.4
22 | test:
23 | cmd: make test
24 | install:
25 | cmd: make install
26 |
27 | devel:
28 | git: git@github.org/ingydotnet/test-more-bash.git
29 | irc: irc.freenode.net#bpan
30 | bug: https://github.com/ingydotnet/test-more-bash/issues/
31 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/ext/json-bash/ext/test-more-bash/ext/bashplus/.gitignore
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/bashplus.git
8 | branch = master
9 | commit = aba653bd279d584c9e40803e10a10a9c16050393
10 | parent = ffffa7200e1912bf8783e415f3aa030d63d354d3
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.7
3 | date: Sat Jan 23 16:28:59 PST 2016
4 | changes:
5 | - Update tooling, and copyright
6 | ---
7 | version: 0.0.6
8 | date: Fri Jan 23 21:05:15 PST 2015
9 | changes:
10 | - Update tooling, and copyright
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 19:07:51 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016 Ingy döt Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/Makefile:
--------------------------------------------------------------------------------
1 | ifeq ($(MAKECMDGOALS),install)
2 | ifeq "$(shell bpan version 2>/dev/null)" ""
3 | $(error 'BPAN not installed. See http://bpan.org')
4 | endif
5 | endif
6 |
7 | NAME := bash+
8 | LIB := lib/$(NAME).bash
9 | DOC := doc/$(NAME).swim
10 | MAN1 := man/man1
11 | MAN3 := man/man3
12 |
13 | INSTALL_LIB ?= $(shell bpan env BPAN_LIB)
14 | INSTALL_DIR ?= test
15 | INSTALL_MAN1 ?= $(shell bpan env BPAN_MAN1)
16 | INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
17 |
18 | default: help
19 |
20 | help:
21 | @echo 'Rules: test, install, doc'
22 |
23 | .PHONY: test
24 | test:
25 | prove $(PROVEOPT:%=% )test/
26 |
27 | install:
28 | install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
29 | install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
30 | install -C -d -m 0755 $(INSTALL_MAN1)/
31 | install -C -d -m 0755 $(INSTALL_MAN3)/
32 | install -C -m 0644 $(MAN1)/$(NAME).1 $(INSTALL_MAN1)/
33 | install -C -m 0644 $(MAN3)/$(NAME).3 $(INSTALL_MAN3)/
34 |
35 | .PHONY: doc
36 | doc: ReadMe.pod $(MAN1)/$(NAME).1 $(MAN3)/$(NAME).3
37 |
38 | ReadMe.pod: $(DOC)
39 | swim --to=pod --complete --wrap $< > $@
40 |
41 | $(MAN1)/%.1: doc/%.swim
42 | swim --to=man $< > $@
43 |
44 | $(MAN3)/%.3: doc/%.swim
45 | swim --to=man $< > $@
46 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: bashplus
4 | version: 0.0.7
5 | abstract: Modern Bash Programming
6 | homepage: http://bpan.org/package/bashplus/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | test:
21 | cmd: make test
22 | install:
23 | cmd: make install
24 |
25 | devel:
26 | git: git@github.org/ingydotnet/bashplus
27 | irc: irc.freenode.net/bpan
28 | bug: https://github.com/ingydotnet/bashplus/issues/
29 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/bin/bash+:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #------------------------------------------------------------------------------
3 | # Bash+ - Modern Bash Programming
4 | #
5 | # Copyright (c) 2013-2016 Ingy döt Net
6 | #------------------------------------------------------------------------------
7 |
8 | set -e
9 | shopt -s compat31&>/dev/null||:
10 |
11 | #------------------------------------------------------------------------------
12 | # Determine how `bash+` was called, and do the right thing:
13 | #------------------------------------------------------------------------------
14 | if [ "${BASH_SOURCE[0]}" != "$0" ]; then
15 | # 'bash+' is being sourced:
16 | [[ "${BASH_SOURCE[0]}" =~ /bin/bash\\+$ ]] || {
17 | echo "Invalid Bash+ path '${BASH_SOURCE[0]}'" 2> /dev/null
18 | exit 1
19 | }
20 | source "${BASH_SOURCE[0]%/bin/*}"/lib/bash+.bash || return $?
21 | bash+:import "$@"
22 | return $?
23 | else
24 | if [ $# -eq 1 -a "$1" == --version ]; then
25 | echo 'bash+ version 0.0.7'
26 | else
27 | cat <<...
28 |
29 | Greetings modern Bash programmer. Welcome to Bash+!
30 |
31 | Bash+ is framework that makes Bash programming more like Ruby and Perl.
32 |
33 | See: https://github.com/bpan-org/bashplus
34 |
35 | If you got here trying to use bash+ in a program, you need to source it:
36 |
37 | source bash+
38 |
39 | Happy Bash Hacking!
40 |
41 | ...
42 | fi
43 | fi
44 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/doc/bash+.swim:
--------------------------------------------------------------------------------
1 | Bash+(1)
2 | ========
3 |
4 | Modern Bash Programming
5 |
6 |
7 |
8 | = Synopsis
9 |
10 | source bash+ :std :array
11 |
12 | use Foo::Bar this that
13 |
14 | Array.new args "$@"
15 |
16 | if args.empty?; then
17 | die "I need args!"
18 | fi
19 |
20 | Foo::Bar.new foo args
21 |
22 | this is awesome # <= this is a real command! (You just imported it)
23 |
24 | = Description
25 |
26 | Bash+ is just Bash... *plus* some libraries that can make Bash programming a
27 | lot nicer.
28 |
29 | ## Installation
30 |
31 | Get the source code from GitHub:
32 |
33 | git clone git@github.com:ingydotnet/bashplus
34 |
35 | Then run:
36 |
37 | make test
38 | make install # Possibly with 'sudo'
39 |
40 | = Usage
41 |
42 | For now look at some libraries the use Bash+:
43 |
44 | * https://github.com/ingydotnet/git-hub
45 | * https://github.com/ingydotnet/json-bash
46 | * https://github.com/ingydotnet/test-more-bash
47 |
48 | = Status
49 |
50 | If you are interested in chatting about this, `/join #bpan` on
51 | irc.freenode.net.
52 |
53 | = Author
54 |
55 | Written by Ingy döt Net
56 |
57 | = Copyright & License
58 |
59 | Copyright 2013-2016. Ingy döt Net.
60 |
61 | The MIT License (MIT).
62 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/base.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok $? '`source bash+` works'
9 |
10 | is "$BASHPLUS_VERSION" '0.0.7' 'BASHPLUS_VERSION is 0.0.7'
11 |
12 | done_testing 2
13 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/fcopy.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | foo() {
9 | echo O HAI
10 | }
11 |
12 | like "$(type bar 2>&1)" 'bar: not found' \
13 | 'bar is not yet a function'
14 |
15 | bash+:fcopy foo bar
16 |
17 | type -t bar &>/dev/null
18 | ok $? 'bar is now a function'
19 | is "$(type foo | tail -n+3)" "$(type bar | tail -n+3)" \
20 | 'Copy matches original'
21 |
22 | done_testing 3
23 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/lib/foo/bar.bash:
--------------------------------------------------------------------------------
1 | Foo__Bar_VERSION='1.2.3'
2 |
3 | Foo::Bar:baz() { :;}
4 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/lib/foo/foo.bash:
--------------------------------------------------------------------------------
1 | Foo::Foo:import() {
2 | echo $1---$2
3 | }
4 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok "`bash+:can use`" 'use is imported'
9 | ok "`bash+:can die`" 'die is imported'
10 | ok "`bash+:can warn`" 'warn is imported'
11 |
12 | ok "`! bash+:can import`" 'import is not imported'
13 | ok "`! bash+:can main`" 'main is not imported'
14 | ok "`! bash+:can fcopy`" 'fcopy is not imported'
15 | ok "`! bash+:can findlib`" 'findlib is not imported'
16 | ok "`! bash+:can can`" 'can is not imported'
17 |
18 | done_testing 8
19 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/source-bash+.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | functions=(
9 | use
10 | import
11 | fcopy
12 | findlib
13 | die
14 | warn
15 | can
16 | )
17 |
18 | for f in ${functions[@]}; do
19 | is "$(type -t "bash+:$f")" function \
20 | "bash+:$f is a function"
21 | done
22 |
23 | done_testing 7
24 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/test.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #------------------------------------------------------------------------------
4 | # This is a tiny version of test-more-bash that I use here. test-more-bash uses
5 | # bash+, so I want to avoid the circular dependency. This little guy does
6 | # 80-90% what test-more-bash does, with minimal code. It's a good example of
7 | # how nice Bash can be.
8 | #------------------------------------------------------------------------------
9 |
10 | plan() {
11 | echo "1..$1"
12 | }
13 |
14 | pass() {
15 | let run=run+1
16 | echo "ok $run${1:+ - $1}"
17 | }
18 |
19 | fail() {
20 | let run=run+1
21 | echo "not ok $run${1:+ - $1}"
22 | }
23 |
24 | is() {
25 | if [ "$1" == "$2" ]; then
26 | pass "$3"
27 | else
28 | fail "$3"
29 | diag "Got: $1"
30 | diag "Want: $2"
31 | fi
32 | }
33 |
34 | ok() {
35 | (exit ${1:-$?}) &&
36 | pass "$2" ||
37 | fail "$2"
38 | }
39 |
40 | like() {
41 | if [[ "$1" =~ "$2" ]]; then
42 | pass "$3"
43 | else
44 | fail "$3"
45 | diag "Got: $1"
46 | diag "Like: $2"
47 | fi
48 | }
49 |
50 | unlike() {
51 | if [[ ! "$1" =~ "$2" ]]; then
52 | pass "$3"
53 | else
54 | fail "$3"
55 | diag "Got: $1"
56 | diag "Dont: $2"
57 | fi
58 | }
59 |
60 | done_testing() {
61 | echo "1..${1:-$run}"
62 | }
63 |
64 | diag() {
65 | echo "# ${1//$'\n'/$'\n'# }" >&2
66 | }
67 |
68 | note() {
69 | echo "# ${1//$'\n'/$'\n'# }"
70 | }
71 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/bashplus/test/use.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std can
7 |
8 | BASHLIB=test/lib
9 |
10 | use Foo::Bar
11 | ok $? 'use Foo::Bar - works'
12 | ok "`can Foo::Bar:baz`" 'Function Foo::Bar:baz exists'
13 | is "$Foo__Bar_VERSION" 1.2.3 '$Foo__Bar_VERSION == 1.2.3'
14 |
15 | output=`use Foo::Foo Boo Booo`
16 | ok $? 'use Foo::Foo Boo Booo - works'
17 | is "$output" Boo---Booo 'Correct import called'
18 |
19 | done_testing 5
20 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/test-tap-bash.git
8 | branch = master
9 | commit = 7890df93f13e684715750a2d6a608e7e79671ca4
10 | parent = 3faca582ee96a320b5675ad67b47ad0f16730446
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.4
3 | date: Sat Jan 23 16:32:22 PST 2016
4 | changes:
5 | - Make up to date.
6 | ---
7 | version: 0.0.3
8 | date: Fri Jan 23 21:39:39 PST 2015
9 | changes:
10 | - Make up to date.
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 23:02:11 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016. Ingy döt Net.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/Makefile:
--------------------------------------------------------------------------------
1 | ifeq ($(MAKECMDGOALS),install)
2 | ifeq "$(shell bpan version 2>/dev/null)" ""
3 | $(error 'BPAN not installed. See http://bpan.org')
4 | endif
5 | endif
6 |
7 | NAME := test-tap
8 | LIB := lib/test/tap.bash
9 | MAN3 := man/man3
10 |
11 | INSTALL_LIB ?= $(shell bpan env BPAN_LIB)
12 | INSTALL_DIR ?= test
13 | INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
14 |
15 | default: help
16 |
17 | help:
18 | @echo 'Rules: test, install, doc'
19 |
20 | .PHONY: test
21 | test:
22 | prove $(PROVEOPT:%=% )test/
23 |
24 | install:
25 | install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
26 | install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
27 | install -C -d -m 0755 $(INSTALL_MAN3)/
28 | install -C -m 0644 $(MAN3)/$(NAME).3 $(INSTALL_MAN3)/
29 |
30 | .PHONY: doc
31 | doc: ReadMe.pod $(MAN3)/$(NAME).3
32 |
33 | ReadMe.pod: doc/test-tap.swim
34 | swim --to=pod --complete --wrap $< > $@
35 |
36 | man/man3/%.3: doc/%.swim
37 | swim --to=man $< > $@
38 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: test-tap
4 | version: 0.0.4
5 | abstract: TAP Test Base for Bash
6 | homepage: http://bpan.org/package/test-tap/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | test:
21 | cmd: make test
22 | install:
23 | cmd: make install
24 |
25 | devel:
26 | git: git@github.org/ingydotnet/test-tap-bash.git
27 | irc: irc.freenode.net/bpan
28 | bug: https://github.com/ingydotnet/test-tap-bash/issues/
29 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod:
--------------------------------------------------------------------------------
1 | =pod
2 |
3 | =for comment
4 | DO NOT EDIT. This Pod was generated by Swim v0.1.41.
5 | See http://github.com/ingydotnet/swim-pm#readme
6 |
7 | =encoding utf8
8 |
9 | =head1 Name
10 |
11 | Test::Tap - TAP Test Base for Bash
12 |
13 | =for html
14 |
15 |
16 | =head1 Synopsis
17 |
18 | source test/tap.bash
19 |
20 | Test::Tap:plan tests 1
21 |
22 | pass 'Everything is OK!'
23 |
24 | =head1 Description
25 |
26 | This is a TAP testing base class for Bash. It has all the basic TAP functions,
27 | and works properly from a TAP harness, like the C utility.
28 |
29 | test-tap-bash is used as the base for test-more-bash, which is what you want
30 | if you are writing tests in bash.
31 |
32 | See: L
33 |
34 | =head1 Functions
35 |
36 | =over
37 |
38 | =item C
39 |
40 | Must be called first for every test file/process.
41 |
42 | =item C
43 |
44 | Used to set the plan.
45 |
46 | =back
47 |
48 | =head1 TODO
49 |
50 | =over
51 |
52 | =item * Finish this doc.
53 |
54 | =back
55 |
56 | =head1 Author
57 |
58 | Written by Ingy döt Net
59 |
60 | =head1 Copyright & License
61 |
62 | Copyright 2013-2016. Ingy döt Net.
63 |
64 | The MIT License (MIT).
65 |
66 | =cut
67 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim:
--------------------------------------------------------------------------------
1 | Test::Tap
2 | =========
3 |
4 | TAP Test Base for Bash
5 |
6 |
7 |
8 | = Synopsis
9 |
10 | source test/tap.bash
11 |
12 | Test::Tap:plan tests 1
13 |
14 | pass 'Everything is OK!'
15 |
16 | = Description
17 |
18 | This is a TAP testing base class for Bash. It has all the basic TAP functions,
19 | and works properly from a TAP harness, like the `prove` utility.
20 |
21 | test-tap-bash is used as the base for test-more-bash, which is what you want
22 | if you are writing tests in bash.
23 |
24 | See: https://github.com/ingydotnet/test-more-bash/
25 |
26 | = Functions
27 |
28 | - `Test::Tap:init`
29 |
30 | Must be called first for every test file/process.
31 |
32 | - `Test::Tap::plan`
33 |
34 | Used to set the plan.
35 |
36 | = TODO
37 |
38 | * Finish this doc.
39 |
40 | = Author
41 |
42 | Written by Ingy döt Net
43 |
44 | = Copyright & License
45 |
46 | Copyright 2013-2016. Ingy döt Net.
47 |
48 | The MIT License (MIT).
49 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 1
7 |
8 | output=$(prove -v test/test/{b,f}ail.t 2>&1)
9 |
10 | test-helper:like \
11 | "$output" \
12 | 'Bailout called. Further testing stopped: Get me outta here' \
13 | 'Test::Tap:BAIL_OUT works'
14 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/done.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 |
7 | Test::Tap:pass one
8 | Test::Tap:pass two
9 |
10 | Test::Tap:done_testing
11 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 2
7 |
8 | output="$(prove -v test/test/fail.t 2>&1)"
9 |
10 | # echo "# >>>${output//$'\n'/$'\n'# }<<<" >&2
11 |
12 | test-helper:like \
13 | "$output" \
14 | 'not ok 1 - I am a failure' \
15 | 'Test::Tap:fail works'
16 |
17 | test-helper:like \
18 | "$output" \
19 | 'Failed 1/1 subtests' \
20 | 'Proper summary'
21 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 1
7 |
8 | output="$(prove -v test/test/fail_fast.t 2>&1)"
9 |
10 | # echo ">>>$output<<<" >&2
11 |
12 | test-helper:like \
13 | "$output" \
14 | 'Further testing stopped: Bailing out on status=1' \
15 | 'Test::Tap:BAIL_OUT works'
16 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/helper.bash:
--------------------------------------------------------------------------------
1 | test-helper:like() {
2 | local got=$1 regex=$2 label=$3
3 | if [[ "$got" =~ "$regex" ]]; then
4 | Test::Tap:pass "$label"
5 | else
6 | Test::Tap:fail "$label"
7 | Test::Tap:diag "Got: '$got'"
8 | fi
9 | }
10 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/pass.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 3
6 |
7 | Test::Tap:pass 'pass 1 - with label'
8 | Test::Tap:pass
9 | Test::Tap:pass 'pass 3 - 2 has no label'
10 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/plan.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 | Test::Tap:plan tests 3
7 |
8 | for n in 1 2 3; do
9 | Test::Tap:pass "Test #$n"
10 | done
11 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 4
7 |
8 | for s in plan init; do
9 | output=$(prove test/test/skip-all-$s.t)
10 |
11 | test-helper:like \
12 | "$output" \
13 | "skipped: Test for skip_all from $s" \
14 | "skip_all from $s: it works"
15 |
16 | test-helper:like \
17 | "$output" \
18 | 'Result: NOTESTS' \
19 | "skip_all from $s: No tests run"
20 | done
21 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/tap.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 4
6 |
7 | Test::Tap:pass 'pass with label'
8 | Test::Tap:pass
9 | Test::Tap:pass 'previous test has no label'
10 | msg="$(Test::Tap:fail 'faaaaailll' 2>/dev/null)"
11 | if [[ "$msg" =~ not\ ok\ 4\ -\ faaaaailll ]]; then
12 | Test::Tap:pass 'fail works'
13 | fi
14 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/test/bail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 5
6 |
7 | Test::Tap:pass 'test #1'
8 | Test::Tap:pass 'test #2'
9 | Test::Tap:pass 'test #3'
10 |
11 | Test::Tap:BAIL_OUT 'Get me outta here'
12 |
13 | Test::Tap:pass 'test #4'
14 | Test::Tap:fail 'test #5'
15 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 1
6 |
7 | Test::Tap:fail 'I am a failure'
8 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/test/fail_fast.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 5
6 | Test::Tap:BAIL_ON_FAIL
7 |
8 | Test::Tap:pass 'test #1'
9 | Test::Tap:pass 'test #2'
10 | Test::Tap:fail 'test #3'
11 | Test::Tap:pass 'test #4'
12 | Test::Tap:pass 'test #5'
13 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-init.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init skip_all 'Test for skip_all from init'
6 |
7 | Test::Tap:diag "This code should not be run"
8 | Test::Tap:fail
9 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-plan.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 | Test::Tap:plan skip_all 'Test for skip_all from plan'
7 |
8 | Test::Tap:diag "This code should not be run"
9 | Test::Tap:fail
10 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More
6 |
7 | output=$(prove -v test/test/fail1.t 2>&1) || true
8 |
9 | like "$output" 'not ok 1 - fail with label' \
10 | 'fail with label'
11 | like "$output" 'not ok 2' \
12 | 'fail with no label'
13 | like "$output" 'not ok 3 - is foo bar' \
14 | 'fail output is correct'
15 | like "$output" "# got: 'foo'" \
16 | 'difference reporting - got'
17 | like "$output" "# expected: 'bar'" \
18 | 'difference reporting - want'
19 |
20 | done_testing 5
21 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/more.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan tests 5
7 |
8 | pass 'This test always passes'
9 |
10 | is 'foo' "foo" 'foo is foo'
11 |
12 | ok "`true`" 'true is true'
13 |
14 | ok "`[ 123 -eq $((61+62)) ]`" 'Math works'
15 |
16 | ok "`[[ ! team =~ I ]]`" "There's no I in team"
17 |
18 | # diag "A msg for stderr"
19 |
20 | note "A msg for stdout"
21 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/pass.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 3
6 |
7 | pass 'pass 1 - with label'
8 | pass
9 | pass 'pass 3 - 2 has no label'
10 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | BASHLIB="`find $PWD -type d | grep -E '/(bin|lib)$' | xargs -n1 printf "%s:"`"
6 | PATH="$BASHLIB:$PATH"
7 |
8 | source bash+ :std
9 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | output=$(prove -v test/test/skip_all.t 2>&1) || true
7 |
8 | like "$output" 'skipped: Skipping this test to demo skip_all' \
9 | 'skip_all works'
10 |
11 | done_testing 1
12 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/test/fail1.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | fail 'fail with label'
7 |
8 | fail
9 |
10 | is foo bar 'is foo bar'
11 |
12 | done_testing 3
13 |
--------------------------------------------------------------------------------
/ext/json-bash/ext/test-more-bash/test/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan skip_all 'Skipping this test to demo skip_all'
7 |
8 | fail "Don't run this code"
9 |
10 | done_testing
11 |
--------------------------------------------------------------------------------
/ext/json-bash/note/todo:
--------------------------------------------------------------------------------
1 |
2 |
3 | + Add tests for get bugs
4 | + Allow status code in test-simple
5 | + support -n -b -z flags for JSON.get
6 | + remove the perl flag handling
7 | + get make install-man to work
8 | + need asciidoc conf
9 | + use space around ' = ' and ' ?= ' in Makefile
10 | + Ensure JSON.get sets proper status code
11 | + support -s flag for JSON.get
12 | + Test JSON.get
13 | + get make install to work
14 | + Add INSTALL to doc
15 | + Add submodule checker to Makefile
16 |
--------------------------------------------------------------------------------
/ext/json-bash/test/first-element.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 2
6 | use JSON
7 |
8 | tree1=$(cat test/test1.json | JSON.load)
9 | ok $? "JSON.load succeeded"
10 |
11 | is "$(JSON.get '/id' tree1)" '12345678' \
12 | "JSON.get works on first element"
13 |
--------------------------------------------------------------------------------
/ext/json-bash/test/get.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 7
6 | use JSON
7 |
8 | tree1=$(cat test/test1.json | JSON.load)
9 | ok $? "JSON.load succeeded"
10 | is "$(JSON.get '/owner/login' tree1)" '"ingydotnet"' \
11 | "JSON.get works"
12 | is "$(JSON.get -s '/owner/login' tree1)" 'ingydotnet' \
13 | "JSON.get -s works"
14 | is $(JSON.get -s '/id' tree1 2> /dev/null || echo $?) 1 \
15 | "JSON.get -s failure works"
16 |
17 | JSON.load "$(< test/test1.json)"
18 | ok $? "JSON.load succeeded"
19 | is "$(JSON.get '/owner/login' -)" '"ingydotnet"' \
20 | "JSON.get works"
21 | is "$(cat test/test1.json | JSON.load | JSON.get -a "/owner/login")" \
22 | 'ingydotnet' \
23 | 'JSON.get works with piped data'
24 |
25 | # XXX Disabling for now because we can't depend on pipefail
26 | # Maybe use a tee and `wc -l` and check 0 or 1
27 | # JSON.get '/bad-key' -
28 | # ok [ $? -eq 1 ] "JSON.get on bad key fails"
29 |
--------------------------------------------------------------------------------
/ext/json-bash/test/issue4.json:
--------------------------------------------------------------------------------
1 | {"files": {"first.txt": "Tina", "second file": "Test" }}
2 |
--------------------------------------------------------------------------------
/ext/json-bash/test/issues.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More
6 | use JSON
7 |
8 | tree1=$(cat test/issue4.json | JSON.load)
9 | ok $? "JSON.load succeeded"
10 |
11 | done_testing
12 |
--------------------------------------------------------------------------------
/ext/json-bash/test/keys.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "description of gist",
3 | "files": {
4 | "file1.txt": {
5 | "type": "text/plain",
6 | "content": "two\nlines"
7 | },
8 | "file 2.txt": {
9 | "type": "text/plain",
10 | "content": "two\nlines"
11 | }
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ext/json-bash/test/keys.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 5
6 | use JSON
7 |
8 | tree1=$(cat test/keys.json | JSON.load)
9 | ok $? \
10 | "JSON.load succeeded"
11 |
12 | is "$(JSON.get '/files/file 2.txt/type' tree1)" \
13 | '"text/plain"' \
14 | "JSON.get works"
15 |
16 | file_object=$(JSON.object '/files' tree1)
17 |
18 | keys="$(JSON.keys '/' file_object)"
19 | is "$keys" \
20 | "file1.txt"$'\n'"file 2.txt" \
21 | "JSON.keys '/'" #'
22 |
23 | keys="$(JSON.keys '/files' tree1)"
24 | is "$keys" \
25 | "file1.txt"$'\n'"file 2.txt" \
26 | "JSON.keys '/files'" #'
27 |
28 | keys="$(JSON.keys '/' tree1)"
29 | is "$keys" "description"$'\n'"files" \
30 | "JSON.keys '/'" #'
31 |
--------------------------------------------------------------------------------
/ext/json-bash/test/load.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 13
6 | use JSON
7 |
8 | tree1=$(cat test/test1.json | JSON.load)
9 | ok $? "JSON.load succeeded"
10 | [ -z "$JSON__cache" ]
11 | ok $? "JSON__cache is unset"
12 | [ -n "$tree1" ]
13 | ok $? "load result has content"
14 |
15 | echo "$tree1" | grep -E "^/owner/login" &> /dev/null
16 | ok $? "load output contains login key"
17 |
18 | is $(echo "$tree1" | wc -l) 12 \
19 | "linear tree has 12 values"
20 |
21 | JSON.load "$(cat test/test1.json)"
22 | ok $? "JSON.load succeeded"
23 | [ -n "$JSON__cache" ]
24 | ok $? "JSON__cache is set"
25 |
26 | JSON.cache | grep -E '^/description' &> /dev/null
27 | ok $? "load output contains description"
28 |
29 | is $(JSON.cache | wc -l) 12 \
30 | "linear tree has 12 values"
31 |
32 | JSON.load "$(cat test/test1.json)" tree2
33 | ok $? "JSON.load succeeded"
34 | [ -z "$JSON__cache" ]
35 | ok $? "JSON__cache is set"
36 |
37 | echo "$tree2" | grep -E '^/id' &> /dev/null
38 | ok $? "load output contains id"
39 |
40 | is $(echo -n "$tree2" | wc -l) 12 \
41 | "linear tree has 12 values"
42 |
43 |
--------------------------------------------------------------------------------
/ext/json-bash/test/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | BASHLIB="`find $PWD -type d | grep -E '/(bin|lib)$' | xargs -n1 printf "%s:"`"
6 | PATH="$BASHLIB:$PATH"
7 |
8 | source bash+ :std
9 |
--------------------------------------------------------------------------------
/ext/json-bash/test/test1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 12345678,
3 | "name": "git-hub",
4 | "full_name": "ingydotnet/git-hub",
5 | "owner": {
6 | "login": "ingydotnet",
7 | "id": 12345,
8 | },
9 | "private": false,
10 | "html_url": "https://github.com/ingydotnet/git-hub",
11 | "description": "Do GitHub operations from the `git` command",
12 | "fork": false,
13 | "homepage": null,
14 | "has_issues": true,
15 | "forks_count": 4,
16 | }
17 |
--------------------------------------------------------------------------------
/ext/json-bash/test/trailing-newlines.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 4
6 | use JSON
7 |
8 | trailing_newline_re=$'\n''$'
9 | json_string='{"foo": "bar", "baz": "quux"}'
10 |
11 | JSON.load "$json_string"
12 | [[ "$JSON__cache" =~ $trailing_newline_re ]]
13 | ok $? "JSON__cache has trailing newline" || echo -n "$JSON__cache" | hexdump -C
14 |
15 | JSON.load "$json_string" tree
16 | [[ "$tree" =~ $trailing_newline_re ]]
17 | ok $? "linear tree has trailing newline" || echo -n "$tree" | hexdump -C
18 |
19 | JSON.load "{}"
20 | [[ "$JSON__cache" == '' ]]
21 | ok $? "empty JSON__cache has no trailing newline" || echo -n "$JSON__cache" | hexdump -C
22 |
23 | JSON.load "[]" tree
24 | [[ "$tree" == '' ]]
25 | ok $? "empty linear tree has no trailing newline" || echo -n "$tree" | hexdump -C
26 |
--------------------------------------------------------------------------------
/ext/test-more-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/test-more-bash.git
8 | branch = master
9 | commit = 05a1bddbe237bbf2c390048c80ca70d4f66c6a37
10 | parent = 9a581b772bf400db9eb2962b123b686132e43638
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/test-more-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/test-more-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.3
3 | date: Sat Jan 23 16:39:20 PST 2016
4 | changes:
5 | - Make up to date
6 | ---
7 | version: 0.0.2
8 | date: Fri Jan 23 21:26:18 PST 2015
9 | changes:
10 | - Make up to date
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 22:53:10 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/test-more-bash/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016. Ingy döt Net.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/test-more-bash/Makefile:
--------------------------------------------------------------------------------
1 | NAME := test-more
2 | DOC := doc/$(NAME).swim
3 | MAN3 := man/man3
4 |
5 | default: help
6 |
7 | help:
8 | @echo 'Rules: test, doc'
9 |
10 | .PHONY: test
11 | test:
12 | prove $(PROVEOPT:%=% )test/
13 |
14 | doc: ReadMe.pod $(MAN3)/$(NAME).3
15 |
16 | ReadMe.pod: $(DOC)
17 | swim --to=pod --complete --wrap $< > $@
18 |
19 | $(MAN3)/%.3: doc/%.swim
20 | swim --to=man $< > $@
21 |
--------------------------------------------------------------------------------
/ext/test-more-bash/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: test-more
4 | version: 0.0.3
5 | abstract: TAP Testing for Bash
6 | homepage: http://bpan.org/package/test-more/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | bashplus: 0.0.7
21 | test-tap: 0.0.4
22 | test:
23 | cmd: make test
24 | install:
25 | cmd: make install
26 |
27 | devel:
28 | git: git@github.org/ingydotnet/test-more-bash.git
29 | irc: irc.freenode.net#bpan
30 | bug: https://github.com/ingydotnet/test-more-bash/issues/
31 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/ext/test-more-bash/ext/bashplus/.gitignore
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/bashplus.git
8 | branch = master
9 | commit = aba653bd279d584c9e40803e10a10a9c16050393
10 | parent = ffffa7200e1912bf8783e415f3aa030d63d354d3
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.7
3 | date: Sat Jan 23 16:28:59 PST 2016
4 | changes:
5 | - Update tooling, and copyright
6 | ---
7 | version: 0.0.6
8 | date: Fri Jan 23 21:05:15 PST 2015
9 | changes:
10 | - Update tooling, and copyright
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 19:07:51 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016 Ingy döt Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/Makefile:
--------------------------------------------------------------------------------
1 | ifeq ($(MAKECMDGOALS),install)
2 | ifeq "$(shell bpan version 2>/dev/null)" ""
3 | $(error 'BPAN not installed. See http://bpan.org')
4 | endif
5 | endif
6 |
7 | NAME := bash+
8 | LIB := lib/$(NAME).bash
9 | DOC := doc/$(NAME).swim
10 | MAN1 := man/man1
11 | MAN3 := man/man3
12 |
13 | INSTALL_LIB ?= $(shell bpan env BPAN_LIB)
14 | INSTALL_DIR ?= test
15 | INSTALL_MAN1 ?= $(shell bpan env BPAN_MAN1)
16 | INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
17 |
18 | default: help
19 |
20 | help:
21 | @echo 'Rules: test, install, doc'
22 |
23 | .PHONY: test
24 | test:
25 | prove $(PROVEOPT:%=% )test/
26 |
27 | install:
28 | install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
29 | install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
30 | install -C -d -m 0755 $(INSTALL_MAN1)/
31 | install -C -d -m 0755 $(INSTALL_MAN3)/
32 | install -C -m 0644 $(MAN1)/$(NAME).1 $(INSTALL_MAN1)/
33 | install -C -m 0644 $(MAN3)/$(NAME).3 $(INSTALL_MAN3)/
34 |
35 | .PHONY: doc
36 | doc: ReadMe.pod $(MAN1)/$(NAME).1 $(MAN3)/$(NAME).3
37 |
38 | ReadMe.pod: $(DOC)
39 | swim --to=pod --complete --wrap $< > $@
40 |
41 | $(MAN1)/%.1: doc/%.swim
42 | swim --to=man $< > $@
43 |
44 | $(MAN3)/%.3: doc/%.swim
45 | swim --to=man $< > $@
46 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: bashplus
4 | version: 0.0.7
5 | abstract: Modern Bash Programming
6 | homepage: http://bpan.org/package/bashplus/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | test:
21 | cmd: make test
22 | install:
23 | cmd: make install
24 |
25 | devel:
26 | git: git@github.org/ingydotnet/bashplus
27 | irc: irc.freenode.net/bpan
28 | bug: https://github.com/ingydotnet/bashplus/issues/
29 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/ReadMe.pod:
--------------------------------------------------------------------------------
1 | =pod
2 |
3 | =for comment
4 | DO NOT EDIT. This Pod was generated by Swim v0.1.41.
5 | See http://github.com/ingydotnet/swim-pm#readme
6 |
7 | =encoding utf8
8 |
9 | =head1 Name
10 |
11 | Bash+(1) - Modern Bash Programming
12 |
13 | =for html
14 |
15 |
16 | =head1 Synopsis
17 |
18 | source bash+ :std :array
19 |
20 | use Foo::Bar this that
21 |
22 | Array.new args "$@"
23 |
24 | if args.empty?; then
25 | die "I need args!"
26 | fi
27 |
28 | Foo::Bar.new foo args
29 |
30 | this is awesome # <= this is a real command! (You just imported it)
31 |
32 | =head1 Description
33 |
34 | Bash+ is just Bash... B some libraries that can make Bash programming a
35 | lot nicer.
36 |
37 | =for comment # Installation
38 |
39 | Get the source code from GitHub:
40 |
41 | git clone git@github.com:ingydotnet/bashplus
42 |
43 | Then run:
44 |
45 | make test
46 | make install # Possibly with 'sudo'
47 |
48 | =head1 Usage
49 |
50 | For now look at some libraries the use Bash+:
51 |
52 | =over
53 |
54 | =item * L
55 |
56 | =item * L
57 |
58 | =item * L
59 |
60 | =back
61 |
62 | =head1 Status
63 |
64 | If you are interested in chatting about this, C on
65 | irc.freenode.net.
66 |
67 | =head1 Author
68 |
69 | Written by Ingy döt Net
70 |
71 | =head1 Copyright & License
72 |
73 | Copyright 2013-2016. Ingy döt Net.
74 |
75 | The MIT License (MIT).
76 |
77 | =cut
78 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/bin/bash+:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #------------------------------------------------------------------------------
3 | # Bash+ - Modern Bash Programming
4 | #
5 | # Copyright (c) 2013-2016 Ingy döt Net
6 | #------------------------------------------------------------------------------
7 |
8 | set -e
9 | shopt -s compat31&>/dev/null||:
10 |
11 | #------------------------------------------------------------------------------
12 | # Determine how `bash+` was called, and do the right thing:
13 | #------------------------------------------------------------------------------
14 | if [ "${BASH_SOURCE[0]}" != "$0" ]; then
15 | # 'bash+' is being sourced:
16 | [[ "${BASH_SOURCE[0]}" =~ /bin/bash\\+$ ]] || {
17 | echo "Invalid Bash+ path '${BASH_SOURCE[0]}'" 2> /dev/null
18 | exit 1
19 | }
20 | source "${BASH_SOURCE[0]%/bin/*}"/lib/bash+.bash || return $?
21 | bash+:import "$@"
22 | return $?
23 | else
24 | if [ $# -eq 1 -a "$1" == --version ]; then
25 | echo 'bash+ version 0.0.7'
26 | else
27 | cat <<...
28 |
29 | Greetings modern Bash programmer. Welcome to Bash+!
30 |
31 | Bash+ is framework that makes Bash programming more like Ruby and Perl.
32 |
33 | See: https://github.com/bpan-org/bashplus
34 |
35 | If you got here trying to use bash+ in a program, you need to source it:
36 |
37 | source bash+
38 |
39 | Happy Bash Hacking!
40 |
41 | ...
42 | fi
43 | fi
44 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/doc/bash+.swim:
--------------------------------------------------------------------------------
1 | Bash+(1)
2 | ========
3 |
4 | Modern Bash Programming
5 |
6 |
7 |
8 | = Synopsis
9 |
10 | source bash+ :std :array
11 |
12 | use Foo::Bar this that
13 |
14 | Array.new args "$@"
15 |
16 | if args.empty?; then
17 | die "I need args!"
18 | fi
19 |
20 | Foo::Bar.new foo args
21 |
22 | this is awesome # <= this is a real command! (You just imported it)
23 |
24 | = Description
25 |
26 | Bash+ is just Bash... *plus* some libraries that can make Bash programming a
27 | lot nicer.
28 |
29 | ## Installation
30 |
31 | Get the source code from GitHub:
32 |
33 | git clone git@github.com:ingydotnet/bashplus
34 |
35 | Then run:
36 |
37 | make test
38 | make install # Possibly with 'sudo'
39 |
40 | = Usage
41 |
42 | For now look at some libraries the use Bash+:
43 |
44 | * https://github.com/ingydotnet/git-hub
45 | * https://github.com/ingydotnet/json-bash
46 | * https://github.com/ingydotnet/test-more-bash
47 |
48 | = Status
49 |
50 | If you are interested in chatting about this, `/join #bpan` on
51 | irc.freenode.net.
52 |
53 | = Author
54 |
55 | Written by Ingy döt Net
56 |
57 | = Copyright & License
58 |
59 | Copyright 2013-2016. Ingy döt Net.
60 |
61 | The MIT License (MIT).
62 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/base.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok $? '`source bash+` works'
9 |
10 | is "$BASHPLUS_VERSION" '0.0.7' 'BASHPLUS_VERSION is 0.0.7'
11 |
12 | done_testing 2
13 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/fcopy.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | foo() {
9 | echo O HAI
10 | }
11 |
12 | like "$(type bar 2>&1)" 'bar: not found' \
13 | 'bar is not yet a function'
14 |
15 | bash+:fcopy foo bar
16 |
17 | type -t bar &>/dev/null
18 | ok $? 'bar is now a function'
19 | is "$(type foo | tail -n+3)" "$(type bar | tail -n+3)" \
20 | 'Copy matches original'
21 |
22 | done_testing 3
23 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/lib/foo/bar.bash:
--------------------------------------------------------------------------------
1 | Foo__Bar_VERSION='1.2.3'
2 |
3 | Foo::Bar:baz() { :;}
4 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/lib/foo/foo.bash:
--------------------------------------------------------------------------------
1 | Foo::Foo:import() {
2 | echo $1---$2
3 | }
4 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok "`bash+:can use`" 'use is imported'
9 | ok "`bash+:can die`" 'die is imported'
10 | ok "`bash+:can warn`" 'warn is imported'
11 |
12 | ok "`! bash+:can import`" 'import is not imported'
13 | ok "`! bash+:can main`" 'main is not imported'
14 | ok "`! bash+:can fcopy`" 'fcopy is not imported'
15 | ok "`! bash+:can findlib`" 'findlib is not imported'
16 | ok "`! bash+:can can`" 'can is not imported'
17 |
18 | done_testing 8
19 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/source-bash+.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | functions=(
9 | use
10 | import
11 | fcopy
12 | findlib
13 | die
14 | warn
15 | can
16 | )
17 |
18 | for f in ${functions[@]}; do
19 | is "$(type -t "bash+:$f")" function \
20 | "bash+:$f is a function"
21 | done
22 |
23 | done_testing 7
24 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/test.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #------------------------------------------------------------------------------
4 | # This is a tiny version of test-more-bash that I use here. test-more-bash uses
5 | # bash+, so I want to avoid the circular dependency. This little guy does
6 | # 80-90% what test-more-bash does, with minimal code. It's a good example of
7 | # how nice Bash can be.
8 | #------------------------------------------------------------------------------
9 |
10 | plan() {
11 | echo "1..$1"
12 | }
13 |
14 | pass() {
15 | let run=run+1
16 | echo "ok $run${1:+ - $1}"
17 | }
18 |
19 | fail() {
20 | let run=run+1
21 | echo "not ok $run${1:+ - $1}"
22 | }
23 |
24 | is() {
25 | if [ "$1" == "$2" ]; then
26 | pass "$3"
27 | else
28 | fail "$3"
29 | diag "Got: $1"
30 | diag "Want: $2"
31 | fi
32 | }
33 |
34 | ok() {
35 | (exit ${1:-$?}) &&
36 | pass "$2" ||
37 | fail "$2"
38 | }
39 |
40 | like() {
41 | if [[ "$1" =~ "$2" ]]; then
42 | pass "$3"
43 | else
44 | fail "$3"
45 | diag "Got: $1"
46 | diag "Like: $2"
47 | fi
48 | }
49 |
50 | unlike() {
51 | if [[ ! "$1" =~ "$2" ]]; then
52 | pass "$3"
53 | else
54 | fail "$3"
55 | diag "Got: $1"
56 | diag "Dont: $2"
57 | fi
58 | }
59 |
60 | done_testing() {
61 | echo "1..${1:-$run}"
62 | }
63 |
64 | diag() {
65 | echo "# ${1//$'\n'/$'\n'# }" >&2
66 | }
67 |
68 | note() {
69 | echo "# ${1//$'\n'/$'\n'# }"
70 | }
71 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/bashplus/test/use.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std can
7 |
8 | BASHLIB=test/lib
9 |
10 | use Foo::Bar
11 | ok $? 'use Foo::Bar - works'
12 | ok "`can Foo::Bar:baz`" 'Function Foo::Bar:baz exists'
13 | is "$Foo__Bar_VERSION" 1.2.3 '$Foo__Bar_VERSION == 1.2.3'
14 |
15 | output=`use Foo::Foo Boo Booo`
16 | ok $? 'use Foo::Foo Boo Booo - works'
17 | is "$output" Boo---Booo 'Correct import called'
18 |
19 | done_testing 5
20 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/test-tap-bash.git
8 | branch = master
9 | commit = 7890df93f13e684715750a2d6a608e7e79671ca4
10 | parent = 3faca582ee96a320b5675ad67b47ad0f16730446
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.4
3 | date: Sat Jan 23 16:32:22 PST 2016
4 | changes:
5 | - Make up to date.
6 | ---
7 | version: 0.0.3
8 | date: Fri Jan 23 21:39:39 PST 2015
9 | changes:
10 | - Make up to date.
11 | ---
12 | version: 0.0.1
13 | date: Sun Oct 27 23:02:11 PDT 2013
14 | changes:
15 | - First release.
16 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013-2016. Ingy döt Net.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/Makefile:
--------------------------------------------------------------------------------
1 | ifeq ($(MAKECMDGOALS),install)
2 | ifeq "$(shell bpan version 2>/dev/null)" ""
3 | $(error 'BPAN not installed. See http://bpan.org')
4 | endif
5 | endif
6 |
7 | NAME := test-tap
8 | LIB := lib/test/tap.bash
9 | MAN3 := man/man3
10 |
11 | INSTALL_LIB ?= $(shell bpan env BPAN_LIB)
12 | INSTALL_DIR ?= test
13 | INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
14 |
15 | default: help
16 |
17 | help:
18 | @echo 'Rules: test, install, doc'
19 |
20 | .PHONY: test
21 | test:
22 | prove $(PROVEOPT:%=% )test/
23 |
24 | install:
25 | install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
26 | install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
27 | install -C -d -m 0755 $(INSTALL_MAN3)/
28 | install -C -m 0644 $(MAN3)/$(NAME).3 $(INSTALL_MAN3)/
29 |
30 | .PHONY: doc
31 | doc: ReadMe.pod $(MAN3)/$(NAME).3
32 |
33 | ReadMe.pod: doc/test-tap.swim
34 | swim --to=pod --complete --wrap $< > $@
35 |
36 | man/man3/%.3: doc/%.swim
37 | swim --to=man $< > $@
38 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.2
2 |
3 | name: test-tap
4 | version: 0.0.4
5 | abstract: TAP Test Base for Bash
6 | homepage: http://bpan.org/package/test-tap/
7 |
8 | license: MIT
9 | copyright: 2013-2016
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | test:
21 | cmd: make test
22 | install:
23 | cmd: make install
24 |
25 | devel:
26 | git: git@github.org/ingydotnet/test-tap-bash.git
27 | irc: irc.freenode.net/bpan
28 | bug: https://github.com/ingydotnet/test-tap-bash/issues/
29 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod:
--------------------------------------------------------------------------------
1 | =pod
2 |
3 | =for comment
4 | DO NOT EDIT. This Pod was generated by Swim v0.1.41.
5 | See http://github.com/ingydotnet/swim-pm#readme
6 |
7 | =encoding utf8
8 |
9 | =head1 Name
10 |
11 | Test::Tap - TAP Test Base for Bash
12 |
13 | =for html
14 |
15 |
16 | =head1 Synopsis
17 |
18 | source test/tap.bash
19 |
20 | Test::Tap:plan tests 1
21 |
22 | pass 'Everything is OK!'
23 |
24 | =head1 Description
25 |
26 | This is a TAP testing base class for Bash. It has all the basic TAP functions,
27 | and works properly from a TAP harness, like the C utility.
28 |
29 | test-tap-bash is used as the base for test-more-bash, which is what you want
30 | if you are writing tests in bash.
31 |
32 | See: L
33 |
34 | =head1 Functions
35 |
36 | =over
37 |
38 | =item C
39 |
40 | Must be called first for every test file/process.
41 |
42 | =item C
43 |
44 | Used to set the plan.
45 |
46 | =back
47 |
48 | =head1 TODO
49 |
50 | =over
51 |
52 | =item * Finish this doc.
53 |
54 | =back
55 |
56 | =head1 Author
57 |
58 | Written by Ingy döt Net
59 |
60 | =head1 Copyright & License
61 |
62 | Copyright 2013-2016. Ingy döt Net.
63 |
64 | The MIT License (MIT).
65 |
66 | =cut
67 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim:
--------------------------------------------------------------------------------
1 | Test::Tap
2 | =========
3 |
4 | TAP Test Base for Bash
5 |
6 |
7 |
8 | = Synopsis
9 |
10 | source test/tap.bash
11 |
12 | Test::Tap:plan tests 1
13 |
14 | pass 'Everything is OK!'
15 |
16 | = Description
17 |
18 | This is a TAP testing base class for Bash. It has all the basic TAP functions,
19 | and works properly from a TAP harness, like the `prove` utility.
20 |
21 | test-tap-bash is used as the base for test-more-bash, which is what you want
22 | if you are writing tests in bash.
23 |
24 | See: https://github.com/ingydotnet/test-more-bash/
25 |
26 | = Functions
27 |
28 | - `Test::Tap:init`
29 |
30 | Must be called first for every test file/process.
31 |
32 | - `Test::Tap::plan`
33 |
34 | Used to set the plan.
35 |
36 | = TODO
37 |
38 | * Finish this doc.
39 |
40 | = Author
41 |
42 | Written by Ingy döt Net
43 |
44 | = Copyright & License
45 |
46 | Copyright 2013-2016. Ingy döt Net.
47 |
48 | The MIT License (MIT).
49 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 1
7 |
8 | output=$(prove -v test/test/{b,f}ail.t 2>&1)
9 |
10 | test-helper:like \
11 | "$output" \
12 | 'Bailout called. Further testing stopped: Get me outta here' \
13 | 'Test::Tap:BAIL_OUT works'
14 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/done.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 |
7 | Test::Tap:pass one
8 | Test::Tap:pass two
9 |
10 | Test::Tap:done_testing
11 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 2
7 |
8 | output="$(prove -v test/test/fail.t 2>&1)"
9 |
10 | # echo "# >>>${output//$'\n'/$'\n'# }<<<" >&2
11 |
12 | test-helper:like \
13 | "$output" \
14 | 'not ok 1 - I am a failure' \
15 | 'Test::Tap:fail works'
16 |
17 | test-helper:like \
18 | "$output" \
19 | 'Failed 1/1 subtests' \
20 | 'Proper summary'
21 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 1
7 |
8 | output="$(prove -v test/test/fail_fast.t 2>&1)"
9 |
10 | # echo ">>>$output<<<" >&2
11 |
12 | test-helper:like \
13 | "$output" \
14 | 'Further testing stopped: Bailing out on status=1' \
15 | 'Test::Tap:BAIL_OUT works'
16 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/helper.bash:
--------------------------------------------------------------------------------
1 | test-helper:like() {
2 | local got=$1 regex=$2 label=$3
3 | if [[ "$got" =~ "$regex" ]]; then
4 | Test::Tap:pass "$label"
5 | else
6 | Test::Tap:fail "$label"
7 | Test::Tap:diag "Got: '$got'"
8 | fi
9 | }
10 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/pass.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 3
6 |
7 | Test::Tap:pass 'pass 1 - with label'
8 | Test::Tap:pass
9 | Test::Tap:pass 'pass 3 - 2 has no label'
10 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/plan.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 | Test::Tap:plan tests 3
7 |
8 | for n in 1 2 3; do
9 | Test::Tap:pass "Test #$n"
10 | done
11 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 4
7 |
8 | for s in plan init; do
9 | output=$(prove test/test/skip-all-$s.t)
10 |
11 | test-helper:like \
12 | "$output" \
13 | "skipped: Test for skip_all from $s" \
14 | "skip_all from $s: it works"
15 |
16 | test-helper:like \
17 | "$output" \
18 | 'Result: NOTESTS' \
19 | "skip_all from $s: No tests run"
20 | done
21 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/tap.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 4
6 |
7 | Test::Tap:pass 'pass with label'
8 | Test::Tap:pass
9 | Test::Tap:pass 'previous test has no label'
10 | msg="$(Test::Tap:fail 'faaaaailll' 2>/dev/null)"
11 | if [[ "$msg" =~ not\ ok\ 4\ -\ faaaaailll ]]; then
12 | Test::Tap:pass 'fail works'
13 | fi
14 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/test/bail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 5
6 |
7 | Test::Tap:pass 'test #1'
8 | Test::Tap:pass 'test #2'
9 | Test::Tap:pass 'test #3'
10 |
11 | Test::Tap:BAIL_OUT 'Get me outta here'
12 |
13 | Test::Tap:pass 'test #4'
14 | Test::Tap:fail 'test #5'
15 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 1
6 |
7 | Test::Tap:fail 'I am a failure'
8 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/test/fail_fast.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 5
6 | Test::Tap:BAIL_ON_FAIL
7 |
8 | Test::Tap:pass 'test #1'
9 | Test::Tap:pass 'test #2'
10 | Test::Tap:fail 'test #3'
11 | Test::Tap:pass 'test #4'
12 | Test::Tap:pass 'test #5'
13 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-init.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init skip_all 'Test for skip_all from init'
6 |
7 | Test::Tap:diag "This code should not be run"
8 | Test::Tap:fail
9 |
--------------------------------------------------------------------------------
/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-plan.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 | Test::Tap:plan skip_all 'Test for skip_all from plan'
7 |
8 | Test::Tap:diag "This code should not be run"
9 | Test::Tap:fail
10 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More
6 |
7 | output=$(prove -v test/test/fail1.t 2>&1) || true
8 |
9 | like "$output" 'not ok 1 - fail with label' \
10 | 'fail with label'
11 | like "$output" 'not ok 2' \
12 | 'fail with no label'
13 | like "$output" 'not ok 3 - is foo bar' \
14 | 'fail output is correct'
15 | like "$output" "# got: 'foo'" \
16 | 'difference reporting - got'
17 | like "$output" "# expected: 'bar'" \
18 | 'difference reporting - want'
19 |
20 | done_testing 5
21 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/more.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan tests 5
7 |
8 | pass 'This test always passes'
9 |
10 | is 'foo' "foo" 'foo is foo'
11 |
12 | ok "`true`" 'true is true'
13 |
14 | ok "`[ 123 -eq $((61+62)) ]`" 'Math works'
15 |
16 | ok "`[[ ! team =~ I ]]`" "There's no I in team"
17 |
18 | # diag "A msg for stderr"
19 |
20 | note "A msg for stdout"
21 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/pass.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 3
6 |
7 | pass 'pass 1 - with label'
8 | pass
9 | pass 'pass 3 - 2 has no label'
10 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | BASHLIB="`find $PWD -type d | grep -E '/(bin|lib)$' | xargs -n1 printf "%s:"`"
6 | PATH="$BASHLIB:$PATH"
7 |
8 | source bash+ :std
9 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | output=$(prove -v test/test/skip_all.t 2>&1) || true
7 |
8 | like "$output" 'skipped: Skipping this test to demo skip_all' \
9 | 'skip_all works'
10 |
11 | done_testing 1
12 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/test/fail1.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | fail 'fail with label'
7 |
8 | fail
9 |
10 | is foo bar 'is foo bar'
11 |
12 | done_testing 3
13 |
--------------------------------------------------------------------------------
/ext/test-more-bash/test/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan skip_all 'Skipping this test to demo skip_all'
7 |
8 | fail "Don't run this code"
9 |
10 | done_testing
11 |
--------------------------------------------------------------------------------
/lib/git-hub.d/bash+.bash:
--------------------------------------------------------------------------------
1 | ../../ext/bashplus/lib/bash+.bash
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-cache-clear:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:cache-clear() {
6 | a="$(prompt "Delete all of '$GIT_HUB_CACHE'? [yN]")"
7 | if [[ $a == y ]]; then
8 | rm -fr "$GIT_HUB_CACHE"
9 | msg_ok="'$GIT_HUB_CACHE' deleted."
10 | else
11 | msg_ok="'$GIT_HUB_CACHE' not deleted."
12 | fi
13 | }
14 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-comment:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | command:comment() {
4 | [[ $# -ge 1 ]] || error "comment requires at least an issue #"
5 |
6 | get-args '?owner:get-user/repo:get-repo' number
7 |
8 | local url="/repos/$owner/$repo/issues/$number/comments"
9 |
10 | local issue_report="$(git hub issue "$owner/$repo" "$number" | sed 's/^/# /')"
11 |
12 | editor-comment "
13 | # Add a comment for the issue above this line.
14 | #
15 | $issue_report"
16 |
17 | if [[ ! "$body" =~ [^[:space:]] ]]; then
18 | abort "no comment body provided."
19 | fi
20 |
21 | api-post "$url" "$(
22 | json-dump-object body "$body"
23 | )"
24 | }
25 |
26 | # vim: set lisp:
27 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-config:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:config() {
6 | local config_key= config_value=
7 | get-args config_key:empty config_value:empty
8 | if [[ -z $config_key ]]; then
9 | dump-config || OK=1
10 | msg_ok=0
11 | elif [[ -z $config_value ]]; then
12 | read-config-value "$config_key" || OK=1
13 | msg_ok="$value"
14 | else
15 | write-config-value "$config_key" "$config_value" || OK=1
16 | msg_ok="git-hub.$config_key=$config_value"
17 | fi
18 | }
19 |
20 | command:config-unset() {
21 | get-args config_key
22 | delete-config-value "$config_key" || OK=1
23 | msg_ok="Config key 'git-hub.$config_key' removed"
24 | }
25 |
26 | command:config-list() {
27 | list-config-values
28 | msg_ok=0
29 | }
30 |
31 | command:config-keys() {
32 | list-possible-config-keys
33 | msg_ok=0
34 | }
35 |
36 | # vim: set lisp:
37 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-irc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | # Freenode command to allow message without join:
6 | # /msg chanserv set #channel mlock -n
7 |
8 | command:irc() {
9 | assert-inside-git-repo
10 | require-auth
11 | owner="$(get-owner)"
12 | repo="$(get-repo)"
13 | msg_ok=0
14 | cat <<...
15 |
16 | https://github.com/$owner/$repo/settings/hooks
17 |
18 | ...
19 | }
20 |
21 | command:irc-url() {
22 | assert-inside-git-repo
23 | require-auth
24 | owner="$(get-owner)"
25 | repo="$(get-repo)"
26 | msg_ok=0
27 | echo "https://github.com/$owner/$repo/settings/hooks"
28 | }
29 |
30 | command:irc-enable() {
31 | assert-inside-git-repo
32 | require-auth
33 | get-args room '?server'
34 | [[ -n $server ]] || server="irc.freenode.net"
35 | owner="$(get-owner)"
36 | repo="$(get-repo)"
37 | events='["push","issues","pull_request","issue_comment"]'
38 | config="$(json-dump-object room "$room" server "$server")"
39 | json="$(json-dump-object name irc active true events "$events" config "$config")"
40 | api-post "/repos/$owner/$repo/hooks" "$json"
41 | msg_ok="Enabled IRC for '$owner/$repo' in #$room on $server."
42 | }
43 |
44 | command:irc-disable() {
45 | assert-inside-git-repo
46 | require-auth
47 | owner="$(get-owner)"
48 | repo="$(get-repo)"
49 | msg_ok=0
50 | cat <<...
51 | Note: 'git hub irc-disable' not yet implemented.
52 |
53 | You can do it yourself here:
54 |
55 | https://github.com/$owner/$repo/settings/hooks
56 |
57 | ...
58 | }
59 |
60 | # vim: set lisp:
61 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-keys:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:keys() {
6 | get-args owner:get-user
7 | report-list \
8 | "/users/$owner/keys" \
9 | key
10 | }
11 |
12 | format-entry:keys() {
13 | if "$raw_output"; then
14 | out "$2"
15 | else
16 | say "Public SSH keys for '$owner':"
17 | printf "%s %s\n" "$(colorize LABEL "$1)" )" "$2"
18 | fi
19 | }
20 |
21 | command:keys-add() {
22 | require-auth
23 | get-args title key
24 | api-post /user/keys "$(json-dump-object title "$title" key "$key")"
25 | msg_ok="Public key successfully added."
26 | }
27 |
28 | # vim: set lisp:
29 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-member:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:members() {
6 | require-auth
7 | get-args team_id
8 | local args=()
9 | "$raw_output" && args+=(-r)
10 | if [[ ! $team_id =~ ^[0-9]+$ ]]; then
11 | git hub org-members "${args[@]}" "$team_id"
12 | return
13 | else
14 | git hub team-members "${args[@]}" "$team_id"
15 | fi
16 | }
17 |
18 | command:member-get() {
19 | require-auth
20 | get-args team_id user
21 | api-get "/teams/$team_id/members/$user"
22 | msg_ok="'$user' is of team (id) '$team_id'"
23 | msg_404="'$user' is NOT a member of team (id) '$team_id'"
24 | }
25 |
26 | command:member-add() {
27 | require-auth
28 | get-args team_id user
29 | api-put "/teams/$team_id/members/$user"
30 | msg_ok="'$user' is now on team (id) '$team_id'"
31 | }
32 |
33 | command:member-remove() {
34 | require-auth
35 | get-args team_id user
36 | api-delete "/teams/$team_id/members/$user"
37 | msg_ok="'$user' is no longer on team (id) '$team_id'"
38 | }
39 |
40 | # vim: set lisp:
41 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-notify:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:notify-list() {
6 | require-auth
7 | local all=false
8 | "$do_all" && all=true
9 |
10 | title="Notifications for '$login' (all=$all):"
11 |
12 | list_size=$Infinity
13 | interactive=false
14 | report-list \
15 | "/notifications?all=$all" \
16 | 'subject/title reason updated_at unread subject/type subject/url'
17 | }
18 |
19 | format-entry:notify-list() {
20 | if "$raw_output"; then
21 | out "$2"
22 | else
23 | local url="${7/api\./}"
24 | url="${url/repos\//}"
25 | color-table-row \
26 | "%2d)" LABEL "$1" \
27 | "" "" "$2" \
28 | " (%s)" YELLOW "$3"
29 | color-table-row \
30 | " %s)" DATE "${4%T*}" \
31 | "unread=%s" YELLOW "$5" \
32 | "(%s)" LABEL "$6" \
33 | "" "" "$url"
34 | fi
35 | }
36 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-open:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Try this vim command:
4 | #
5 | # map \gho :let $l=line("."):let $p=@%:!git hub open $p $l
6 |
7 | set -e
8 |
9 | command:open() {
10 | local options=()
11 | "$raw_output" && options+=(--raw)
12 | [[ -n $remote_name ]] && options+=(--remote "$remote_name")
13 |
14 | set -- "${command_arguments[@]}"
15 |
16 | url="$(git hub url $@ ${options[@]})"
17 |
18 | get-browser
19 |
20 | "$browser" "$url" &
21 | msg_ok="$browser $url"
22 | }
23 |
24 | get-browser() {
25 | if read-config-value browser; then
26 | browser="$value"
27 | return
28 | fi
29 |
30 | if [[ $(uname) == Darwin ]]; then
31 | browser="open"
32 | return
33 | fi
34 |
35 | for browser in x-www-browser sensible-browser firefox chromium-browser; do
36 | [[ -n $(type $browser) ]] && return
37 | done
38 |
39 | die <<...
40 | Can't determine your web browser. Try something like:
41 |
42 | git hub config browser chromium
43 |
44 | ...
45 | }
46 |
47 | # vim: set lisp:
48 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-repo-init:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:repo-init() {
6 | get-args "dir:'.'"
7 | local need_init=true need_repo=true need_remote=true
8 | if [[ -d $dir ]]; then
9 | if [[ -d $dir/.git ]]; then
10 | need_init=false
11 | if [[ -n $(GIT_DIR="$dir/.git" git remote) ]]; then
12 | need_repo=false
13 | need_remote=false
14 | fi
15 | fi
16 | fi
17 | "$need_init" || "$need_repo" || "$need_remote" || {
18 | say "Nothing to do."
19 | exit 0
20 | }
21 | if "$need_init"; then
22 | (
23 | set -x
24 | git init "$dir"
25 | )
26 | fi
27 | if "$need_repo"; then
28 | (
29 | cd "$dir"
30 | local name="$(basename "$PWD")"
31 | set -x
32 | git hub repo-new "$name"
33 | )
34 | fi
35 | if "$need_remote"; then
36 | get-var login
37 | (
38 | cd "$dir"
39 | local name="$(basename "$PWD")"
40 | set -x
41 | git remote add origin "git@github.com:$login/$name.git"
42 | )
43 | fi
44 | }
45 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-upgrade:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | command:upgrade() {
4 | local path="$0"
5 | local branch="$(git rev-parse --abbrev-ref HEAD)"
6 | if [[ $branch != main ]]; then
7 | error "git-hub repo is not on the 'main' branch"
8 | fi
9 | if [[ $path =~ ^/ && $path =~ ^(.*/git-hub)/lib/git-hub$ ]]; then
10 | (
11 | set -x
12 | cd "${BASH_REMATCH[1]}"
13 | git pull --rebase
14 | )
15 | else
16 | die "\
17 |
18 | Sorry. Your installation can't use the 'git hub upgrade' command. The command
19 | only works if you installed git hub by adding '/path/to/git-hub' to your PATH.
20 |
21 | If you used 'make install' to install git-hub, then just do this:
22 |
23 | cd /path/to/git-hub
24 | git pull
25 | make install
26 |
27 | "
28 | fi
29 | }
30 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-url:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Try this vim command:
4 | #
5 | # :map \ghu :let $l=line("."):let $p=@%:!echo -n "$(git hub url $p $l)" \| xsel -b
6 |
7 | set -e
8 |
9 | command:url() {
10 | set -- "${command_arguments[@]}"
11 |
12 | local pwd=`git rev-parse --show-prefix`
13 | pwd=${pwd%/}
14 | local path= line=
15 | if inside-git-repo && [[ $# -gt 0 && -e $1 ]]; then
16 | path="$1"
17 | path="${path%/}"
18 | [[ -n $2 ]] && line="$2"
19 | command_arguments=()
20 | fi
21 |
22 | get-args '?owner:get-user/repo:get-repo'
23 | branch="$(git rev-parse --abbrev-ref HEAD)"
24 | url="https://github.com/$owner/$repo/tree/$branch"
25 |
26 | if [[ $path == "." ]]; then
27 | path=""
28 | fi
29 |
30 | if [[ -n $pwd && -n $path ]]; then
31 | path="$pwd/$path"
32 | elif [[ -n $pwd ]]; then
33 | path=$pwd
34 | fi
35 |
36 | if [[ -n $path ]]; then
37 | url+="/$path"
38 | if [[ -n $line ]]; then
39 | url+="#L$line"
40 | fi
41 | fi
42 |
43 | if pipeline; then
44 | echo -n "$url"
45 | else
46 | echo "$url"
47 | fi
48 |
49 | msg_ok=0
50 | }
51 |
52 | # vim: set lisp:
53 |
--------------------------------------------------------------------------------
/lib/git-hub.d/git-hub-user:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:user() {
6 | get-args '?user:get-user'
7 | api-get "/users/$user"
8 | msg_404="User '$user' not found."
9 | }
10 |
11 | ok:user() {
12 | fields=(
13 | login type name html_url email blog location company bio
14 | followers following public_repos public_gists created_at updated_at
15 | )
16 | report-data
17 | }
18 |
19 | command:user-get() {
20 | get-args '?user:get-user' key
21 | api-get "/users/$user"
22 | OK || {
23 | msg_fail="User '$user' not found"
24 | return
25 | }
26 | local value="$(JSON.get -a "/$key" -)"
27 | if [[ -n $value ]]; then
28 | msg_ok="$value"
29 | else
30 | msg_fail="Couldn't get value for '$key'"
31 | OK=1
32 | fi
33 | }
34 |
35 | command:user-edit() {
36 | require-auth
37 | get-args %pairs
38 | api-patch /user "$(json-dump-object-pairs)"
39 | }
40 |
41 | # vim: set lisp:
42 |
--------------------------------------------------------------------------------
/lib/git-hub.d/json-perl.bash:
--------------------------------------------------------------------------------
1 | JSON.load() {
2 | perl "$GIT_HUB_EXT_PATH/json.pl"
3 | }
4 |
--------------------------------------------------------------------------------
/lib/git-hub.d/json.bash:
--------------------------------------------------------------------------------
1 | ../../ext/json-bash/lib/json.bash
--------------------------------------------------------------------------------
/lib/git-hub.d/json.pl:
--------------------------------------------------------------------------------
1 | use strict;
2 |
3 | my $JSON;
4 | for ( qw/JSON::MaybeXS JSON JSON::PP/ ) {
5 | last if $JSON = eval "use $_; '$_'";
6 | }
7 |
8 | $JSON or die <<'...';
9 |
10 | ERROR: No JSON Perl modules are installed.
11 |
12 | This Perl program is being used to speed up the 'git-hub' command. It requires
13 | one of the 'JSON::MaybeXS', 'JSON' or 'JSON::PP' Perl modules, but it seems
14 | that you have none of these installed.
15 |
16 | Please install the 'JSON::MaybeXS' module from CPAN, and try again.
17 |
18 | ...
19 |
20 | {
21 | my $data = decode_json(do {local $/; <>});
22 | die "Unknown JSON result" unless
23 | ref($data) =~ /^(HASH|ARRAY)$/;
24 | walk($data, '');
25 | };
26 |
27 | sub walk {
28 | my ($node, $path) = @_;
29 | if (ref($node) eq 'HASH') {
30 | for my $key (keys %$node) {
31 | walk($node->{$key}, "$path/$key");
32 | }
33 | }
34 | elsif (ref($node) eq 'ARRAY') {
35 | for (my $i = 0; $i < @$node; $i++) {
36 | walk($node->[$i], "$path/$i");
37 | }
38 | }
39 | else {
40 | my $value = encode_json([$node]);
41 | print "$path\t", substr($value,1,-1), "\n";
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/note/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/note/Commands:
--------------------------------------------------------------------------------
1 | cache-clear
2 | clone
3 | collabs
4 | comment
5 | config
6 | config-unset
7 | follow
8 | followers
9 | following
10 | follows
11 | fork
12 | forks
13 | help
14 | issue
15 | issue-close
16 | issues
17 | issue-new
18 | issue-update
19 | keys
20 | keys-add
21 | members
22 | open
23 | org
24 | org-edit
25 | org-get
26 | orgs
27 | pr-diff
28 | pr-list
29 | pr-merge
30 | pr-request
31 | repo
32 | repo-delete
33 | repo-edit
34 | repo-get
35 | repo-init
36 | repo-new
37 | repos
38 | scope-add
39 | scopes
40 | scope-remove
41 | setup
42 | star
43 | starred
44 | stars
45 | teams
46 | token-delete
47 | token-get
48 | tokens
49 | token-new
50 | trust
51 | unfollow
52 | unstar
53 | untrust
54 | unwatch
55 | upgrade
56 | url
57 | user
58 | user-edit
59 | user-get
60 | watch
61 |
--------------------------------------------------------------------------------
/note/func-list:
--------------------------------------------------------------------------------
1 | Bash:version-check
2 | main
3 | run-command
4 | run-each
5 | command:help
6 | api-get
7 | api-post
8 | api-put
9 | api-patch
10 | api-delete
11 | api-call
12 | format-curl-command
13 | cache-response-files
14 | check-api-call-status
15 | OK
16 | get-args
17 | keyword-assign
18 | spec-assign
19 | slash-assign
20 | hash-assign
21 | array-assign
22 | get-user
23 | get-login
24 | get-owner
25 | get-repo
26 | get-repo-config
27 | get-remote-name
28 | get-default-remote-name
29 | get-branch-name
30 | get-parent-owner-repo
31 | get-parent-remote-name
32 | get-parent-base
33 | require-auth
34 | basic-auth
35 | check-token-id
36 | get-hub-config
37 | report-list
38 | report-list-process
39 | get-next-page-url
40 | default-format-entry
41 | normalize-multiline-text-output
42 | report-data
43 | report-data-process
44 | report-value
45 | init-env
46 | init-vars
47 | run-for-each
48 | assert-env
49 | check-system-commands
50 | source-ext
51 | source-ext-maybe
52 | assert-env-var
53 | get-opts
54 | interactive
55 | osx
56 | pipeline
57 | set-var
58 | check-config
59 | get-var
60 | get-var-bool
61 | need-api-token
62 | config-not-setup
63 | prompt-to-run-setup
64 | editor-title-body
65 | editor-comment
66 | editor-comment-state
67 | say
68 | say-
69 | nay
70 | nay-
71 | out
72 | out-
73 | err
74 | err-
75 | error
76 | abort
77 | prompt
78 | callable-or-source
79 | assert-inside-git-repo
80 | assert-repo-top-level
81 | assert-git-repo-is-clean
82 | assert-git-on-branch
83 | assert-git-head-is-pushed
84 | inside-git-repo
85 |
--------------------------------------------------------------------------------
/note/pull-request-spec.md:
--------------------------------------------------------------------------------
1 | ##The Dream
2 |
3 | * `git hub clone foo/bar`
4 | * find bug
5 | * `git checkout -b fix-bug`
6 | * fix bug
7 | * `gut hub fork --with-remote frioux`
8 | * `git push frioux fix-bug`
9 | * `git hub pull-request --to foo` (*maybe* default --to if it's a fork?)
10 |
11 | git-hub should then:
12 |
13 | * Error if you forgot to fork/push (or maybe optionally offer to do it for you? `git hub pull-request --to foo --dwim`)
14 | * Pop up an editor a la `git commit`
15 | * first line of editor is title of PR (can be set with --title maybe?)
16 | * third and following are the body (can be skipped with --no-body?)
17 | * below the body include a full diff of the pull-request, like if the user had done git commit -av
18 | * as with git commit, if the title is empty, exit saying "nothing to PR" or something
19 |
20 | ##The Moon
21 |
22 | * Author gets email mentioning PR
23 | * `git hub pulls` lists the oustanding PR's
24 | * `git hub pull 34 --fetch` fetches PR#34 into FETCH_HEAD (this is just `git fetch origin refs/pull/34/head`)
25 | * `git hub pull 34` merges #34 in and closes PR#34 (maybe with an autopush? Note I would never use this command so feel free to ignore it)
26 | * `git hub pull 34 --close --message 'Merged'` This is what I'd do, after a manual merge
27 |
--------------------------------------------------------------------------------
/note/test-commands:
--------------------------------------------------------------------------------
1 | git-hub:git_hub_user
2 | not-repo:git_hub_repos
3 | not-repo:git_hub_user
4 | perlball:git_hub_fork
5 | perlball:git_hub_repo
6 | perlball:git_hub_star
7 | perlball:git_hub_user
8 | perlball:git_hub_user_-O
9 |
--------------------------------------------------------------------------------
/pkg/cpan/.travis.yml:
--------------------------------------------------------------------------------
1 | # DO NOT EDIT
2 | #
3 | # This .travis.yml file generated by Zilla-Dist-0.0.189.
4 | #
5 | # To update it, run:
6 | #
7 | # > zild update
8 | #
9 |
10 | language: perl
11 |
12 | perl:
13 | - '5.20'
14 | - '5.18'
15 | - '5.16'
16 | - '5.14'
17 | - '5.12'
18 | - '5.10'
19 | - '5.8'
20 |
21 | install:
22 | - cpanm --quiet --notest
23 | Devel::Cover::Report::Coveralls
24 | File::Share
25 |
26 | script:
27 | - true && [ ! -e test/ ] ||
28 | PERL5OPT=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine
29 | prove -lv test/
30 | - true && [ ! -e test/ ] || cover
31 |
32 | after_success:
33 | - cover -report coveralls
34 |
35 | notifications:
36 | irc:
37 | channels:
38 | - irc.freenode.net#git-commands
39 | on_success: change
40 | on_failure: always
41 | skip_join: true
42 |
43 | # Hack to not run on tag pushes:
44 | branches:
45 | except:
46 | - /^v?[0-9]+\.[0-9]+/
47 |
--------------------------------------------------------------------------------
/pkg/cpan/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.1.5
3 | date: Wed Jan 7 12:10:30 PST 2015
4 | changes:
5 | - New CPAN release for 2015
6 | ---
7 | version: 0.1.4
8 | date: Thu Sep 4 16:25:54 MDT 2014
9 | changes:
10 | - Lots of improvement
11 | - pull-* commands are now pr-*
12 | ---
13 | version: 0.1.3
14 | date: Wed Jul 30 14:40:31 PDT 2014
15 | changes:
16 | - Fix pull-request failure handling. It was dieing on JSON call instead of just
17 | showing the error.
18 | - SHow more/better error info for -v.
19 | ---
20 | version: 0.1.2
21 | date: Mon Jul 28 18:31:48 PDT 2014
22 | changes:
23 | - Added 'version' subcommand
24 | ---
25 | version: 0.1.1
26 | date: Mon Jul 28 08:58:52 PDT 2014
27 | changes:
28 | - Add a dummy test
29 | ---
30 | version: 0.1.0
31 | date: Mon Jul 28 08:50:43 PDT 2014
32 | changes:
33 | - First release
34 |
--------------------------------------------------------------------------------
/pkg/cpan/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.1
2 |
3 | name: App-git-hub
4 | version: 0.1.5
5 | abstract: The Git command for GitHub
6 | homepage: https://metacpan.org/release/App-git-hub
7 | license: perl
8 | copyright: 2014-2016
9 |
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@cpan.org
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | perl: 5.8.1
20 | File::Share: 0
21 |
22 | devel:
23 | git: https://github.com/ingydotnet/git-hub
24 | bug: https://github.com/ingydotnet/git-hub/issues
25 | irc: irc.freenode.net#git-commands
26 |
27 | =travis:
28 | type: perl
29 | irc: irc.freenode.net#git-commands
30 |
--------------------------------------------------------------------------------
/pkg/cpan/ReadMe.pod:
--------------------------------------------------------------------------------
1 | =pod
2 |
3 | =for comment
4 | DO NOT EDIT. This Pod was generated by Swim v0.1.37.
5 | See http://github.com/ingydotnet/swim-pm#readme
6 |
7 | =encoding utf8
8 |
9 | =head1 Name
10 |
11 | App::git::hub - The git-hub command on CPAN.
12 |
13 | =head1 Synopsis
14 |
15 | > cpanm App::git::hub
16 | > git hub
17 |
18 | =head1 Description
19 |
20 | The C command allows you to do most of your GitHub interaction from
21 | the terminal.
22 |
23 | The project is here: L
24 |
25 | The command is written in Bash, but some Perl people wanted to be able to
26 | install it from CPAN. This module is an attempt to do that.
27 |
28 | =head1 Experimental!!!
29 |
30 | I have no idea how well this will work out, or whether I want to support this
31 | in the future.
32 |
33 | =head1 Author
34 |
35 | Ingy döt Net
36 |
37 | =head1 Copyright and License
38 |
39 | Copyright 2014-2015. Ingy döt Net.
40 |
41 | This program is free software; you can redistribute it and/or modify it under
42 | the same terms as Perl itself.
43 |
44 | See L
45 |
46 | =cut
47 |
--------------------------------------------------------------------------------
/pkg/cpan/bin/git-hub:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 |
3 | use File::Share;
4 |
5 | my $dir = File::Share::dist_dir('App-git-hub');
6 |
7 | exec "$dir/lib/git-hub", @ARGV;
8 |
--------------------------------------------------------------------------------
/pkg/cpan/doc/App/git/hub.swim:
--------------------------------------------------------------------------------
1 | App::git::hub
2 | =============
3 |
4 | The git-hub command on CPAN.
5 |
6 | = Synopsis
7 |
8 | > cpanm App::git::hub
9 | > git hub
10 |
11 | = Description
12 |
13 | The `git-hub` command allows you to do most of your GitHub interaction from
14 | the terminal.
15 |
16 | The project is here: https://github.com/ingydotnet/git-hub#readme
17 |
18 | The command is written in Bash, but some Perl people wanted to be able to
19 | install it from CPAN. This module is an attempt to do that.
20 |
21 | = Experimental!!!
22 |
23 | I have no idea how well this will work out, or whether I want to support this
24 | in the future.
25 |
26 | <<>>
27 |
--------------------------------------------------------------------------------
/pkg/cpan/lib/App/git/hub.pm:
--------------------------------------------------------------------------------
1 | package App::git::hub;
2 | our $VERSION = '0.1.5';
3 |
--------------------------------------------------------------------------------
/pkg/cpan/share/lib:
--------------------------------------------------------------------------------
1 | ../../../lib
--------------------------------------------------------------------------------
/pkg/cpan/share/man:
--------------------------------------------------------------------------------
1 | ../../../man
--------------------------------------------------------------------------------
/pkg/cpan/test/test.t:
--------------------------------------------------------------------------------
1 | use Test::More;
2 |
3 | pass 'Placeholder until we get the bash tests to run';
4 |
5 | done_testing;
6 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/git-hub-travis
8 | branch = master
9 | commit = 328f645d10ff0d2e5f5e8894d29794409708c468
10 | parent = a875187b88907921573363fa7da5ca48e32a6686
11 | cmdver = 0.3.0
12 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/.travis.yml:
--------------------------------------------------------------------------------
1 | language: c
2 | script:
3 | - git submodule update --init --recursive
4 | - make test
5 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/Makefile:
--------------------------------------------------------------------------------
1 | NAME = git-hub-travis
2 | LIB = lib
3 | LIBS = $(shell find $(LIB) -type f) \
4 | $(shell find $(LIB) -type l)
5 | DOC = doc/$(NAME).swim
6 | MAN = $(MAN1)/$(NAME).1
7 | MAN1 = man/man1
8 |
9 | # XXX Make these vars look like git.git/Makefile style
10 | PREFIX ?= /usr/local
11 | INSTALL_LIB ?= $(shell git --exec-path)/git-hub.d
12 | INSTALL_MAN ?= $(PREFIX)/share/man/man1
13 |
14 | ##
15 | # User targets:
16 | default: help
17 |
18 | help:
19 | @echo 'Makefile targets:'
20 | @echo ''
21 | @echo 'test Run all tests'
22 | @echo 'install Install $(NAME)'
23 | @echo 'uninstall Uninstall $(NAME)'
24 |
25 | .PHONY: test
26 | test:
27 | ifeq ($(shell which prove),)
28 | @echo '`make test` requires the `prove` utility'
29 | @exit 1
30 | endif
31 | prove $(PROVE_OPTIONS) test/
32 |
33 | install: install-lib install-doc
34 |
35 | install-lib: $(INSTALL_LIB)
36 | install -C -d -m 0755 $(INSTALL_LIB)/
37 | install -C -m 0755 $(LIBS) $(INSTALL_LIB)/
38 |
39 | install-doc:
40 | install -C -d -m 0755 $(INSTALL_MAN)
41 | install -C -m 0644 doc/$(NAME).1 $(INSTALL_MAN)
42 |
43 | uninstall: uninstall-lib uninstall-doc
44 |
45 | uninstall-lib:
46 | rm -fr $(INSTALL_LIB)
47 |
48 | uninstall-doc:
49 | rm -f $(INSTALL_MAN)/$(NAME).1
50 |
51 | ##
52 | # Build rules:
53 | doc: $(MAN) ReadMe.pod
54 |
55 | $(MAN1)/%.1: doc/%.swim swim-check
56 | swim --to=man $< > $@
57 |
58 | ReadMe.pod: $(DOC) swim-check
59 | swim --to=pod --complete=1 --wrap=1 $< > $@
60 |
61 | swim-check:
62 | @# Need to assert Swim and Swim::Plugin::badge are installed
63 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/test-more-bash
8 | branch = master
9 | commit = 5893b1e942488f65febb7368dbabb1bc8bcda2dc
10 | parent = 4fa1121dc4505cea66e6a2b897db2147f1c4d3ea
11 | cmdver = 0.1.0
12 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.1
3 | date: Sun Oct 27 22:53:10 PDT 2013
4 | changes:
5 | - First release.
6 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013, 2014 Ingy döt Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/Makefile:
--------------------------------------------------------------------------------
1 | NAME = test-more
2 | DOC = doc/$(NAME).swim
3 | MAN = $(MAN3)/$(NAME).3
4 | MAN3 = man/man3
5 |
6 | .PHONY: test
7 | test:
8 | prove $(PROVEOPT:%=% )test/
9 |
10 | doc: $(MAN) ReadMe.pod
11 |
12 | $(MAN3)/%.3: doc/%.swim swim-check
13 | swim --to=man $< > $@
14 |
15 | ReadMe.pod: $(DOC) swim-check
16 | swim --to=pod --complete=1 --wrap=1 $< > $@
17 |
18 | swim-check:
19 | @# Need to assert Swim and Swim::Plugin::badge are installed
20 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/Meta:
--------------------------------------------------------------------------------
1 | =meta: 0.0.1
2 |
3 | name: test-more
4 | version: 0.0.1
5 | abstract: TAP Testing for Bash
6 | homepage: http://bpan.org/package/test-more/
7 |
8 | license: MIT
9 | copyright: 2013, 2014
10 | author:
11 | name: Ingy döt Net
12 | email: ingy@ingy.net
13 | github: ingydotnet
14 | twitter: ingydotnet
15 | freenode: ingy
16 | homepage: http://ingy.net
17 |
18 | requires:
19 | bash: 3.2.0
20 | bashplus: 0.0.1
21 | test-tap: 0.0.1
22 | test:
23 | cmd: make test
24 | install:
25 | cmd: make install
26 |
27 | devel:
28 | git: git@github.org/ingydotnet/test-more-bash.git
29 | irc: irc.freenode.net#bpan
30 | bug: https://github.com/ingydotnet/test-more-bash/issues/
31 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/.gitignore
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/bashplus.git
8 | branch = master
9 | commit = 6f15ca55fc89b728df5d7a2c0daccac435939d0a
10 | former = cfd84ccc65a1ba0d7f9e494a4d5fb7957fc4f4c5
11 | cmdver = 0.1.0
12 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.1
3 | date: Sun Oct 27 19:07:51 PDT 2013
4 | changes:
5 | - First release.
6 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013 Ingy döt Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: default help test
2 |
3 | default: help
4 |
5 | help:
6 | @echo 'Makefile targets:'
7 | @echo ''
8 | @echo ' test - Run test suite'
9 | @echo ''
10 |
11 | test:
12 | prove $(PROVEOPT:%=% )test/
13 |
14 | install:
15 | @echo 'install not implemented yet'
16 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/Package:
--------------------------------------------------------------------------------
1 | [pkg]
2 | name = bashplus
3 | author = Ingy döt Net
4 | copyright-holder = Ingy döt Net
5 | copyright-year = 2013
6 | license = MIT
7 | abstract = Modern Bash Programming
8 | source-url = git@github.com:bash-org/bashplus.git
9 | home-url = http://github.com/bash-org/bashplus#readme
10 |
11 | [bpan]
12 | version = 0.0.1
13 | owner = ingydotnet
14 | requires-bash = > 3.2
15 |
16 | ; Set prereqs so that these core packages get installed with Bash+
17 | requires-package = test-more
18 | requires-package = config-ini
19 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/ReadMe.md:
--------------------------------------------------------------------------------
1 | doc/bash+.md
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/bin/bash+:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #------------------------------------------------------------------------------
3 | # Bash+ - Modern Bash Programming
4 | #
5 | # Copyright (c) 2013 Ingy döt Net
6 | #------------------------------------------------------------------------------
7 |
8 | set -e
9 |
10 | #------------------------------------------------------------------------------
11 | # Determine how `bash+` was called, and do the right thing:
12 | #------------------------------------------------------------------------------
13 | if [ "${BASH_SOURCE[0]}" != "$0" ]; then
14 | # 'bash+' is being sourced:
15 | [[ "${BASH_SOURCE[0]}" =~ /bin/bash\+$ ]] || {
16 | echo "Invalid Bash+ path '${BASH_SOURCE[0]}'" 2> /dev/null
17 | exit 1
18 | }
19 | source "${BASH_SOURCE[0]%/bin/*}"/lib/bash+.bash || return $?
20 | bash+:import "$@"
21 | return $?
22 | else
23 | if [ $# -eq 1 -a "$1" == --version ]; then
24 | echo 'bash+ version 0.0.1'
25 | else
26 | cat <<...
27 |
28 | Greetings modern Bash programmer. Welcome to Bash+!
29 |
30 | Bash+ is framework that makes Bash programming more like Ruby and Perl.
31 |
32 | See: https://github.com/bpan-org/bashplus
33 |
34 | If you got here trying to use bash+ in a program, you need to source it:
35 |
36 | source bash+
37 |
38 | Happy Bash Hacking!
39 |
40 | ...
41 | fi
42 | fi
43 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/doc/bash+.md:
--------------------------------------------------------------------------------
1 | Bash+(1) - Modern Bash Programming
2 | ==================================
3 |
4 | [](https://travis-ci.org/ingydotnet/bashplus)
5 |
6 | ## Synopsis
7 |
8 | source bash+ :std :array
9 |
10 | use Foo::Bar this that
11 |
12 | Array.new args "$@"
13 |
14 | if args.empty?; then
15 | die "I need args!"
16 | fi
17 |
18 | Foo::Bar.new foo args
19 |
20 | this is awesome # <= this is a real command! (You just imported it)
21 |
22 | ## Description
23 |
24 | Bash+ is just Bash... *plus* some libraries that can make Bash programming a
25 | lot nicer.
26 |
27 | ## Installation
28 |
29 | Get the source code from GitHub:
30 |
31 | git clone git@github.com:bpan-org/bashplus
32 |
33 | Then run:
34 |
35 | make test
36 | make install # Possibly with 'sudo'
37 |
38 | ## Usage
39 |
40 | For now look at some libraries the use Bash+:
41 |
42 | * https://github.com/bpan-org/git-hub
43 | * https://github.com/bpan-org/json-bash
44 | * https://github.com/bpan-org/test-more-bash
45 |
46 | ## Status
47 |
48 | This stuff is really new. Watch the https://github.com/bpan-org/ for
49 | developments.
50 |
51 | If you are interested in chatting about this, `/join #bpan` on
52 | irc.freenode.net.
53 |
54 | ## Author
55 |
56 | Written by Ingy döt Net
57 |
58 | ## Copyright
59 |
60 | Copyright 2013 Ingy döt Net
61 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/base.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok $? '`source bash+` works'
9 |
10 | is "$BASHPLUS_VERSION" '0.0.1' 'BASHPLUS_VERSION is 0.0.1'
11 |
12 | done_testing 2
13 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/fcopy.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | foo() {
9 | echo O HAI
10 | }
11 |
12 | like "$(type bar 2>&1)" 'bar: not found' \
13 | 'bar is not yet a function'
14 |
15 | bash+:fcopy foo bar
16 |
17 | type -t bar &>/dev/null
18 | ok $? 'bar is now a function'
19 | is "$(type foo | tail -n+3)" "$(type bar | tail -n+3)" \
20 | 'Copy matches original'
21 |
22 | done_testing 3
23 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/lib/foo/bar.bash:
--------------------------------------------------------------------------------
1 | Foo__Bar_VERSION='1.2.3'
2 |
3 | Foo::Bar:baz() { :;}
4 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/lib/foo/foo.bash:
--------------------------------------------------------------------------------
1 | Foo::Foo:import() {
2 | echo $1---$2
3 | }
4 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std
7 |
8 | ok "`bash+:can use`" 'use is imported'
9 | ok "`bash+:can die`" 'die is imported'
10 | ok "`bash+:can warn`" 'warn is imported'
11 |
12 | ok "`! bash+:can import`" 'import is not imported'
13 | ok "`! bash+:can main`" 'main is not imported'
14 | ok "`! bash+:can fcopy`" 'fcopy is not imported'
15 | ok "`! bash+:can findlib`" 'findlib is not imported'
16 | ok "`! bash+:can can`" 'can is not imported'
17 |
18 | done_testing 8
19 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/source-bash+.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+
7 |
8 | functions=(
9 | use
10 | import
11 | fcopy
12 | findlib
13 | die
14 | warn
15 | can
16 | )
17 |
18 | for f in ${functions[@]}; do
19 | is "$(type -t "bash+:$f")" function \
20 | "bash+:$f is a function"
21 | done
22 |
23 | done_testing 7
24 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/test.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #------------------------------------------------------------------------------
4 | # This is a tiny version of test-more-bash that I use here. test-more-bash uses
5 | # bash+, so I want to avoid the circular dependency. This little guy does
6 | # 80-90% what test-more-bash does, with minimal code. It's a good example of
7 | # how nice Bash can be.
8 | #------------------------------------------------------------------------------
9 |
10 | plan() {
11 | echo "1..$1"
12 | }
13 |
14 | pass() {
15 | let run=run+1
16 | echo "ok $run${1:+ - $1}"
17 | }
18 |
19 | fail() {
20 | let run=run+1
21 | echo "not ok $run${1:+ - $1}"
22 | }
23 |
24 | is() {
25 | if [ "$1" == "$2" ]; then
26 | pass "$3"
27 | else
28 | fail "$3"
29 | diag "Got: $1"
30 | diag "Want: $2"
31 | fi
32 | }
33 |
34 | ok() {
35 | (exit ${1:-$?}) &&
36 | pass "$2" ||
37 | fail "$2"
38 | }
39 |
40 | like() {
41 | if [[ "$1" =~ "$2" ]]; then
42 | pass "$3"
43 | else
44 | fail "$3"
45 | diag "Got: $1"
46 | diag "Like: $2"
47 | fi
48 | }
49 |
50 | unlike() {
51 | if [[ ! "$1" =~ "$2" ]]; then
52 | pass "$3"
53 | else
54 | fail "$3"
55 | diag "Got: $1"
56 | diag "Dont: $2"
57 | fi
58 | }
59 |
60 | done_testing() {
61 | echo "1..${1:-$run}"
62 | }
63 |
64 | diag() {
65 | echo "# ${1//$'\n'/$'\n'# }" >&2
66 | }
67 |
68 | note() {
69 | echo "# ${1//$'\n'/$'\n'# }"
70 | }
71 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/bashplus/test/use.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | source test/test.bash
4 |
5 | PATH=$PWD/bin:$PATH
6 | source bash+ :std can
7 |
8 | BASHLIB=test/lib
9 |
10 | use Foo::Bar
11 | ok $? 'use Foo::Bar - works'
12 | ok "`can Foo::Bar:baz`" 'Function Foo::Bar:baz exists'
13 | is "$Foo__Bar_VERSION" 1.2.3 '$Foo__Bar_VERSION == 1.2.3'
14 |
15 | output=`use Foo::Foo Boo Booo`
16 | ok $? 'use Foo::Foo Boo Booo - works'
17 | is "$output" Boo---Booo 'Correct import called'
18 |
19 | done_testing 5
20 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = git@github.com:ingydotnet/test-tap-bash.git
8 | branch = master
9 | commit = ae171e0f465939acb6aefd006a58cbf91b1e5c33
10 | former = 4df3ef56588d8e5a9e0e0d1acaf5256de0d6bef7
11 | cmdver = 0.1.0
12 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/.travis.yml:
--------------------------------------------------------------------------------
1 | # C language gives closest shell env.
2 | language: c
3 |
4 | script:
5 | - git submodule update --init --recursive
6 | - PROVEOPT=-v make test
7 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/Changes:
--------------------------------------------------------------------------------
1 | ---
2 | version: 0.0.1
3 | date: Sun Oct 27 23:02:11 PDT 2013
4 | changes:
5 | - First release.
6 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/License:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright © 2013 Ingy döt Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the ‘Software’), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | 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 NON-INFRINGEMENT. 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 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: test
2 | test:
3 | prove $(PROVEOPT:%=% )test/
4 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/Package:
--------------------------------------------------------------------------------
1 | [pkg]
2 | name = test-tap
3 | author = Ingy döt Net
4 | copyright-holder = Ingy döt Net
5 | copyright-year = 2013
6 | license = MIT
7 | abstract = TAP Test Base for Bash
8 | source-url = git@github.com:bash-org/test-tap-bash.git
9 | home-url = http://github.com/bash-org/test-tap-bash#readme
10 |
11 | [bpan]
12 | version = 0.0.1
13 | owner = ingydotnet
14 | requires-bash = > 3.2
15 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/ReadMe.md:
--------------------------------------------------------------------------------
1 | doc/test-tap.md
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.md:
--------------------------------------------------------------------------------
1 | Test::Tap(1) - TAP Test Base for Bash
2 | =====================================
3 |
4 | [](https://travis-ci.org/ingydotnet/test-tap-bash)
5 |
6 | ## Synopsis
7 |
8 | source test/tap.bash
9 |
10 | Test::Tap:plan tests 1
11 |
12 | pass 'Everything is OK!'
13 |
14 | ## Description
15 |
16 | This is a TAP testing base class for Bash. It has all the basic TAP functions, and works properly from a TAP harness, like the `prove` utility.
17 |
18 | test-tap-bash is used as the base for test-more-bash, which is what you want
19 | if you are writing tests in bash.
20 |
21 | See: https://github.com/ingydotnet/test-more-bash/
22 |
23 | ## Functions
24 |
25 | `Test::Tap:init`::
26 | Must be called first for every test file/process.
27 |
28 | `Test::Tap::plan`::
29 | Used to set the plan.
30 |
31 | TODO - finish this doc.
32 |
33 | ## Author
34 |
35 | Written by Ingy döt Net
36 |
37 | ## Copyright
38 |
39 | Copyright 2013 Ingy döt Net
40 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 1
7 |
8 | output=$(prove -v test/test/{b,f}ail.t 2>&1)
9 |
10 | test-helper:like \
11 | "$output" \
12 | 'Bailout called. Further testing stopped: Get me outta here' \
13 | 'Test::Tap:BAIL_OUT works'
14 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/done.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 |
7 | Test::Tap:pass one
8 | Test::Tap:pass two
9 |
10 | Test::Tap:done_testing
11 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 2
7 |
8 | output="$(prove -v test/test/fail.t 2>&1)"
9 |
10 | # echo "# >>>${output//$'\n'/$'\n'# }<<<" >&2
11 |
12 | test-helper:like \
13 | "$output" \
14 | 'not ok 1 - I am a failure' \
15 | 'Test::Tap:fail works'
16 |
17 | test-helper:like \
18 | "$output" \
19 | 'Failed 1/1 subtests' \
20 | 'Proper summary'
21 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 1
7 |
8 | output="$(prove -v test/test/fail_fast.t 2>&1)"
9 |
10 | # echo ">>>$output<<<" >&2
11 |
12 | test-helper:like \
13 | "$output" \
14 | 'Further testing stopped: Bailing out on status=1' \
15 | 'Test::Tap:BAIL_OUT works'
16 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/helper.bash:
--------------------------------------------------------------------------------
1 | test-helper:like() {
2 | local got=$1 regex=$2 label=$3
3 | if [[ "$got" =~ "$regex" ]]; then
4 | Test::Tap:pass "$label"
5 | else
6 | Test::Tap:fail "$label"
7 | Test::Tap:diag "Got: '$got'"
8 | fi
9 | }
10 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/pass.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 3
6 |
7 | Test::Tap:pass 'pass 1 - with label'
8 | Test::Tap:pass
9 | Test::Tap:pass 'pass 3 - 2 has no label'
10 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/plan.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 | Test::Tap:plan tests 3
7 |
8 | for n in 1 2 3; do
9 | Test::Tap:pass "Test #$n"
10 | done
11 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/helper.bash
4 | source lib/test/tap.bash
5 |
6 | Test::Tap:init tests 4
7 |
8 | for s in plan init; do
9 | output=$(prove test/test/skip-all-$s.t)
10 |
11 | test-helper:like \
12 | "$output" \
13 | "skipped: Test for skip_all from $s" \
14 | "skip_all from $s: it works"
15 |
16 | test-helper:like \
17 | "$output" \
18 | 'Result: NOTESTS' \
19 | "skip_all from $s: No tests run"
20 | done
21 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/tap.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 4
6 |
7 | Test::Tap:pass 'pass with label'
8 | Test::Tap:pass
9 | Test::Tap:pass 'previous test has no label'
10 | msg="$(Test::Tap:fail 'faaaaailll' 2>/dev/null)"
11 | if [[ "$msg" =~ not\ ok\ 4\ -\ faaaaailll ]]; then
12 | Test::Tap:pass 'fail works'
13 | fi
14 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/test/bail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 5
6 |
7 | Test::Tap:pass 'test #1'
8 | Test::Tap:pass 'test #2'
9 | Test::Tap:pass 'test #3'
10 |
11 | Test::Tap:BAIL_OUT 'Get me outta here'
12 |
13 | Test::Tap:pass 'test #4'
14 | Test::Tap:fail 'test #5'
15 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 1
6 |
7 | Test::Tap:fail 'I am a failure'
8 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/test/fail_fast.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init tests 5
6 | Test::Tap:BAIL_ON_FAIL
7 |
8 | Test::Tap:pass 'test #1'
9 | Test::Tap:pass 'test #2'
10 | Test::Tap:fail 'test #3'
11 | Test::Tap:pass 'test #4'
12 | Test::Tap:pass 'test #5'
13 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-init.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init skip_all 'Test for skip_all from init'
6 |
7 | Test::Tap:diag "This code should not be run"
8 | Test::Tap:fail
9 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-plan.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source lib/test/tap.bash
4 |
5 | Test::Tap:init
6 | Test::Tap:plan skip_all 'Test for skip_all from plan'
7 |
8 | Test::Tap:diag "This code should not be run"
9 | Test::Tap:fail
10 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/fail.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More
6 |
7 | output=$(prove -v test/test/fail1.t 2>&1) || true
8 |
9 | like "$output" 'not ok 1 - fail with label' \
10 | 'fail with label'
11 | like "$output" 'not ok 2' \
12 | 'fail with no label'
13 | like "$output" 'not ok 3 - is foo bar' \
14 | 'fail output is correct'
15 | like "$output" "# got: 'foo'" \
16 | 'difference reporting - got'
17 | like "$output" "# expected: 'bar'" \
18 | 'difference reporting - want'
19 |
20 | done_testing 5
21 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/more.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan tests 5
7 |
8 | pass 'This test always passes'
9 |
10 | is 'foo' "foo" 'foo is foo'
11 |
12 | ok "`true`" 'true is true'
13 |
14 | ok "`[ 123 -eq $((61+62)) ]`" 'Math works'
15 |
16 | ok "`[[ ! team =~ I ]]`" "There's no I in team"
17 |
18 | # diag "A msg for stderr"
19 |
20 | note "A msg for stdout"
21 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/pass.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More tests 3
6 |
7 | pass 'pass 1 - with label'
8 | pass
9 | pass 'pass 3 - 2 has no label'
10 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | BASHLIB="`find $PWD -type d | grep -E '/(bin|lib)$' | xargs -n1 printf "%s:"`"
6 | PATH="$BASHLIB:$PATH"
7 |
8 | source bash+ :std
9 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | output=$(prove -v test/test/skip_all.t 2>&1) || true
7 |
8 | like "$output" 'skipped: Skipping this test to demo skip_all' \
9 | 'skip_all works'
10 |
11 | done_testing 1
12 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/test/fail1.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | fail 'fail with label'
7 |
8 | fail
9 |
10 | is foo bar 'is foo bar'
11 |
12 | done_testing 3
13 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/ext/test-more-bash/test/test/skip_all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan skip_all 'Skipping this test to demo skip_all'
7 |
8 | fail "Don't run this code"
9 |
10 | done_testing
11 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/lib/git-hub-travis-disable:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | command:travis-disable() {
4 | get-args ?owner:get-user/repo:get-repo
5 | require-auth
6 |
7 | api-get "/repos/$owner/$repo/hooks"
8 | id="$(JSON.get -n /0/id - 2>/dev/null)" || {
9 | msg_fail="Travis was not enabled"
10 | OK=1
11 | return
12 | }
13 | api-delete "/repos/$owner/$repo/hooks/$id"
14 | }
15 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/lib/git-hub-travis-enable:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | command:travis-enable() {
6 | get-args ?owner:get-user/repo:get-repo
7 | require-auth
8 |
9 | local user="$(get-login)"
10 | user="${user:?No login set in git-hub config}"
11 |
12 | local token=
13 | travis:get-token
14 |
15 | config="$(json-dump-object user "$user" token "$token")"
16 |
17 | json="$(json-dump-object name travis active true events '[ "push" ]' config "$config")"
18 |
19 | api-post "/repos/$owner/$repo/hooks" "$json"
20 | }
21 |
22 | travis:get-token() {
23 | if [ -n "$GIT_HUB_TRAVIS_API_TOKEN" ]; then
24 | token="$GIT_HUB_TRAVIS_API_TOKEN"
25 | else
26 | if read-config-value travis-api-token; then
27 | token="$value"
28 | elif read-config-value api-token; then
29 | token="$value"
30 | else
31 | die "Can't find a Travis API Token"
32 | fi
33 | fi
34 | }
35 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/note/todo:
--------------------------------------------------------------------------------
1 | - Makefile should make sure git-hub is installed
2 |
3 | == Bugs
4 |
5 | - enable not working against repos in an organization or other user
6 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/test/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | BASHLIB="$(
4 | shopt -s nullglob globstar
5 | set -- $PWD/**/{bin,lib}
6 | IFS=':'; echo "$*"
7 | )"
8 | PATH="$BASHLIB:$PATH"
9 |
10 | source bash+ :std
11 |
--------------------------------------------------------------------------------
/plugin/git-hub-travis/test/use_ok.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 | use Test::More
5 |
6 | plan tests 2
7 |
8 | ok "`source git-hub-travis-enable`" 'git-hub-travis-enable loads'
9 | ok "`source git-hub-travis-disable`" 'git-hub-travis-disable loads'
10 |
11 | # vim: set ft=sh:
12 |
--------------------------------------------------------------------------------
/test/ReadMe.md:
--------------------------------------------------------------------------------
1 | git-hub test
2 | ============
3 |
4 | This document describes how the tests in this directory work.
5 |
6 | From the top directory of this repository, you can run:
7 |
8 | make test
9 |
10 | or:
11 |
12 | prove test
13 |
14 | or:
15 |
16 | prove -v test
17 |
18 | The test files end with a '.t' suffix and are written in bash. They use the
19 | `test-more-bash` framework, which is stored under the top level `ext/`
20 | directory. It contains a ReadMe that explains it, as well as its own test
21 | suite.
22 |
23 | ## `commands.t`
24 |
25 | This test runs `git hub` commands that have been mocked up. They don't
26 | actually call to the GitHub server. They use cached data responses. New
27 | command tests are created like this:
28 |
29 | GIT_DIR=test/repo/drinkup/ test/bin/make-command-test 'git hub '
30 |
31 | The `GIT_DIR` variable must be set to one of the fake repos under
32 | `test/repo/`. This is the context repo under which the command is run, since
33 | git-hub is always aware of its repo context.
34 |
35 | The test data is stored under `test/commands/`, and contains the
36 | stdout and stderr from the command. It also contains all the API call
37 | responses, which are stored under sha1 disrectories.
38 |
--------------------------------------------------------------------------------
/test/bin/clean-head.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | keep = %w(
4 | HTTP
5 | Server:
6 | Content-Type:
7 | Status:
8 | Link:
9 | Content-Length:
10 | )
11 |
12 | file = ARGV.shift or fail 'Usage: clean-head.rb .../api-head'
13 | `cp #{file} /tmp/` or fail 123
14 |
15 | keepers = Regexp.new '^(' + keep.join('|') + ')'
16 | lines = File.readlines(file)
17 | out = File.open(file, 'w')
18 | lines.each do |l|
19 | out.print l if l.match keepers
20 | end
21 |
--------------------------------------------------------------------------------
/test/bin/clean-json.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require 'json'
4 |
5 | keep = %w(
6 | bio
7 | blog
8 | company
9 | description
10 | email
11 | followers
12 | following
13 | forks
14 | full_name
15 | html_url
16 | language
17 | location
18 | login
19 | name
20 | open_issues
21 | public_gists
22 | public_repos
23 | pushed_at
24 | ssh_url
25 | type
26 | watchers
27 | )
28 |
29 | $keepers = Regexp.new '^(' + keep.join('|') + ')$'
30 | def clean hash
31 | hash.keys.each do |k|
32 | hash.delete k unless k.match $keepers
33 | end
34 | end
35 |
36 | file = ARGV.shift or fail 'Usage: clean-json.rb .../out'
37 | `cp #{file} /tmp/` or fail
38 | data = JSON.load File.read(file)
39 | if data.kind_of? Array
40 | data.each do |o|
41 | clean o
42 | end
43 | else
44 | clean data
45 | end
46 |
47 | File.open(file, 'w').puts JSON.pretty_generate data
48 |
--------------------------------------------------------------------------------
/test/bin/make-fake-repo:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -ex
4 |
5 | spec=${1:?"$0 requires a repo spec"}
6 | [[ "$spec" =~ / ]] || {
7 | echo "Invalid repo spec"
8 | exit 1
9 | }
10 |
11 | repo=${spec#*/}
12 |
13 | (
14 | set -ex
15 |
16 | cd $(dirname $0)/../
17 |
18 | git hub clone "$spec" -q
19 |
20 | cp -r repo/git-hub repo/$repo
21 |
22 | cp $repo/.git/config repo/$repo/config
23 |
24 | [[ $repo =~ ^[a-zA-Z] ]] && rm -fr "$repo"
25 | )
26 |
--------------------------------------------------------------------------------
/test/changes.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 |
3 | use strict;
4 | use warnings;
5 | use Test::More tests => 1;
6 | use FindBin '$Bin';
7 |
8 | my $yaml = eval "use YAML::XS; 1";
9 |
10 | SKIP: {
11 | skip "YAML::XS not installed", 1 unless $yaml;
12 | my $data = YAML::XS::LoadFile("$Bin/../Changes");
13 | isnt($data, undef, "Changes file valid");
14 | }
15 |
--------------------------------------------------------------------------------
/test/commands.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More
6 |
7 | if [[ -n $ALL_TESTS ]]; then
8 | ALL_TESTS=($ALL_TESTS)
9 | else
10 | ALL_TESTS=()
11 | for dir in $TEST_DIR/*/run.bash; do
12 | dir="$(dirname "$dir")"
13 | if [[ ! -e $dir/skip:${OSTYPE/[0-9]*/} ]]; then
14 | ALL_TESTS+=("$dir")
15 | fi
16 | done
17 | fi
18 |
19 | main() {
20 | export PATH=$TEST_LIB:$PATH
21 | for test_dir in "${ALL_TESTS[@]}"; do
22 |
23 |
24 | # XXX Bug in _repos commands since internal pager removed
25 | [[ $test_dir =~ _repos ]] && continue
26 |
27 |
28 | export GIT_HUB_CACHE="$test_dir"
29 | bash $test_dir/run.bash \
30 | > "$TEST_DIR/stdout" \
31 | 2> "$TEST_DIR/stderr" || true
32 | file-test stdout
33 | file-test stderr
34 | rm -f "$TEST_DIR/stdout"
35 | rm -f "$TEST_DIR/stderr"
36 | done
37 | done_testing
38 | }
39 |
40 | file-test() {
41 | local file="$1"
42 | local label=$test_dir
43 | label="${label#$TEST_DIR/}"
44 | label+=" ($file)"
45 | is "$(< "$TEST_DIR/$file")" "$(< "$test_dir/$file")" "$label"
46 | }
47 |
48 | main "$@"
49 |
50 | # vim: set ft=sh:
51 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_fork/e4f5a477e23652028a1b18b83d6437b0d11753a8/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_fork/e4f5a477e23652028a1b18b83d6437b0d11753a8/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_fork/e4f5a477e23652028a1b18b83d6437b0d11753a8/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 202 Accepted
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 202 Accepted
5 | Content-Length: 13663
6 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_fork/e4f5a477e23652028a1b18b83d6437b0d11753a8/out:
--------------------------------------------------------------------------------
1 | {
2 | "name": "drinkup",
3 | "full_name": "ingydotnet/drinkup",
4 | "html_url": "https://github.com/ingydotnet/drinkup",
5 | "description": "",
6 | "pushed_at": "2013-11-01T01:10:38Z",
7 | "ssh_url": "git@github.com:ingydotnet/drinkup.git",
8 | "language": "Perl",
9 | "forks": 0,
10 | "open_issues": 0,
11 | "watchers": 0
12 | }
13 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_fork/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub fork
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_fork/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_fork/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_fork/stdout:
--------------------------------------------------------------------------------
1 | Repository 'frioux/drinkup' forked to 'aocole'
2 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_repo/779b694ba94ef6574892d1161a9ce6bc6b7a0500/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_repo/779b694ba94ef6574892d1161a9ce6bc6b7a0500/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_repo/779b694ba94ef6574892d1161a9ce6bc6b7a0500/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 4484
6 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_repo/779b694ba94ef6574892d1161a9ce6bc6b7a0500/out:
--------------------------------------------------------------------------------
1 | {
2 | "name": "drinkup",
3 | "full_name": "frioux/drinkup",
4 | "html_url": "https://github.com/frioux/drinkup",
5 | "description": "",
6 | "pushed_at": "2013-11-01T01:10:38Z",
7 | "ssh_url": "git@github.com:frioux/drinkup.git",
8 | "language": "Perl",
9 | "forks": 2,
10 | "open_issues": 4,
11 | "stargazers_count": 5
12 | }
13 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_repo/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub repo
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_repo/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_repo/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_repo/stdout:
--------------------------------------------------------------------------------
1 | Full Name frioux/drinkup
2 | Language Perl
3 | GitHub Page https://github.com/frioux/drinkup
4 | Remote URL git@github.com:frioux/drinkup.git
5 | Forks 2
6 | Stars 5
7 | Open Issues 4
8 | Pushed At 2013-11-01 01:10:38
9 |
10 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_star/dc30e59d940e09376f6b7e8dea08bc4e52d2c9c1/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_star/dc30e59d940e09376f6b7e8dea08bc4e52d2c9c1/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_star/dc30e59d940e09376f6b7e8dea08bc4e52d2c9c1/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 204 No Content
2 | Server: GitHub.com
3 | Status: 204 No Content
4 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_star/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub star
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_star/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_star/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_star/stdout:
--------------------------------------------------------------------------------
1 | 'frioux/drinkup' starred
2 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 1258
6 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/out:
--------------------------------------------------------------------------------
1 | {
2 | "login": "frioux",
3 | "html_url": "https://github.com/frioux",
4 | "type": "User",
5 | "name": "fREW Schmidt",
6 | "company": null,
7 | "blog": "blog.afoolishmanifesto.com",
8 | "location": "Dallas, TX",
9 | "email": "frioux@gmail.com",
10 | "bio": null,
11 | "public_repos": 196,
12 | "public_gists": 34,
13 | "followers": 69,
14 | "following": 26
15 | }
16 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub user
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user/stdout:
--------------------------------------------------------------------------------
1 | Login frioux
2 | Type User
3 | Name fREW Schmidt
4 | GitHub Page https://github.com/frioux
5 | Email frioux@gmail.com
6 | Web Site blog.afoolishmanifesto.com
7 | Location Dallas, TX
8 | Followers 69
9 | Following 26
10 | Public Repos 196
11 | Public Gists 34
12 |
13 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-O/19651663813e9c1e31e7ae6b3d4fbdd78dc5b48a/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_-O/19651663813e9c1e31e7ae6b3d4fbdd78dc5b48a/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-O/19651663813e9c1e31e7ae6b3d4fbdd78dc5b48a/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 1380
6 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-O/19651663813e9c1e31e7ae6b3d4fbdd78dc5b48a/out:
--------------------------------------------------------------------------------
1 | {
2 | "login": "frioux",
3 | "id": 8163,
4 | "avatar_url": "https://gravatar.com/avatar/88c6023527fbe5a832d1092d7d032a95?d=https%3A%2F%2Fidenticons.github.com%2F95cc7ef498e141173576365264fc5fba.png&r=x",
5 | "gravatar_id": "88c6023527fbe5a832d1092d7d032a95",
6 | "url": "https://api.github.com/users/frioux",
7 | "html_url": "https://github.com/frioux",
8 | "followers_url": "https://api.github.com/users/frioux/followers",
9 | "following_url": "https://api.github.com/users/frioux/following{/other_user}",
10 | "gists_url": "https://api.github.com/users/frioux/gists{/gist_id}",
11 | "starred_url": "https://api.github.com/users/frioux/starred{/owner}{/repo}",
12 | "subscriptions_url": "https://api.github.com/users/frioux/subscriptions",
13 | "organizations_url": "https://api.github.com/users/frioux/orgs",
14 | "repos_url": "https://api.github.com/users/frioux/repos",
15 | "events_url": "https://api.github.com/users/frioux/events{/privacy}",
16 | "received_events_url": "https://api.github.com/users/frioux/received_events",
17 | "type": "User",
18 | "site_admin": false,
19 | "name": "fREW Schmidt",
20 | "company": null,
21 | "blog": "blog.afoolishmanifesto.com",
22 | "location": "Dallas, TX",
23 | "email": "frioux@gmail.com",
24 | "hireable": false,
25 | "bio": null,
26 | "public_repos": 196,
27 | "public_gists": 34,
28 | "followers": 69,
29 | "following": 26,
30 | "created_at": "2008-04-22T14:05:21Z",
31 | "updated_at": "2014-03-16T22:30:30Z"
32 | }
33 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-O/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub user -O
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-O/stderr:
--------------------------------------------------------------------------------
1 | {
2 | "login": "frioux",
3 | "id": 8163,
4 | "avatar_url": "https://gravatar.com/avatar/88c6023527fbe5a832d1092d7d032a95?d=https%3A%2F%2Fidenticons.github.com%2F95cc7ef498e141173576365264fc5fba.png&r=x",
5 | "gravatar_id": "88c6023527fbe5a832d1092d7d032a95",
6 | "url": "https://api.github.com/users/frioux",
7 | "html_url": "https://github.com/frioux",
8 | "followers_url": "https://api.github.com/users/frioux/followers",
9 | "following_url": "https://api.github.com/users/frioux/following{/other_user}",
10 | "gists_url": "https://api.github.com/users/frioux/gists{/gist_id}",
11 | "starred_url": "https://api.github.com/users/frioux/starred{/owner}{/repo}",
12 | "subscriptions_url": "https://api.github.com/users/frioux/subscriptions",
13 | "organizations_url": "https://api.github.com/users/frioux/orgs",
14 | "repos_url": "https://api.github.com/users/frioux/repos",
15 | "events_url": "https://api.github.com/users/frioux/events{/privacy}",
16 | "received_events_url": "https://api.github.com/users/frioux/received_events",
17 | "type": "User",
18 | "site_admin": false,
19 | "name": "fREW Schmidt",
20 | "company": null,
21 | "blog": "blog.afoolishmanifesto.com",
22 | "location": "Dallas, TX",
23 | "email": "frioux@gmail.com",
24 | "hireable": false,
25 | "bio": null,
26 | "public_repos": 196,
27 | "public_gists": 34,
28 | "followers": 69,
29 | "following": 26,
30 | "created_at": "2008-04-22T14:05:21Z",
31 | "updated_at": "2014-03-16T22:30:30Z"
32 | }
33 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-O/stdout:
--------------------------------------------------------------------------------
1 | Login frioux
2 | Type User
3 | Name fREW Schmidt
4 | GitHub Page https://github.com/frioux
5 | Email frioux@gmail.com
6 | Web Site blog.afoolishmanifesto.com
7 | Location Dallas, TX
8 | Followers 69
9 | Following 26
10 | Public Repos 196
11 | Public Gists 34
12 | Created At 2008-04-22
13 | Updated At 2014-03-16
14 |
15 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-r/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_-r/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-r/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Date: Mon, 17 Mar 2014 04:44:33 GMT
4 | Content-Type: application/json; charset=utf-8
5 | Status: 200 OK
6 | X-RateLimit-Limit: 60
7 | X-RateLimit-Remaining: 54
8 | X-RateLimit-Reset: 1395034989
9 | Cache-Control: public, max-age=60, s-maxage=60
10 | Last-Modified: Sun, 16 Mar 2014 22:30:30 GMT
11 | ETag: "13af81d93445a52f3eab7224183ca71e"
12 | Vary: Accept
13 | X-GitHub-Media-Type: github.beta
14 | X-Content-Type-Options: nosniff
15 | Content-Length: 1258
16 | Access-Control-Allow-Credentials: true
17 | Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
18 | Access-Control-Allow-Origin: *
19 | X-GitHub-Request-Id: 0F7D58FA:40EA:52756F:53267DB1
20 | Vary: Accept-Encoding
21 |
22 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-r/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/out:
--------------------------------------------------------------------------------
1 | {"login":"frioux","id":8163,"avatar_url":"https://gravatar.com/avatar/88c6023527fbe5a832d1092d7d032a95?d=https%3A%2F%2Fidenticons.github.com%2F95cc7ef498e141173576365264fc5fba.png&r=x","gravatar_id":"88c6023527fbe5a832d1092d7d032a95","url":"https://api.github.com/users/frioux","html_url":"https://github.com/frioux","followers_url":"https://api.github.com/users/frioux/followers","following_url":"https://api.github.com/users/frioux/following{/other_user}","gists_url":"https://api.github.com/users/frioux/gists{/gist_id}","starred_url":"https://api.github.com/users/frioux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frioux/subscriptions","organizations_url":"https://api.github.com/users/frioux/orgs","repos_url":"https://api.github.com/users/frioux/repos","events_url":"https://api.github.com/users/frioux/events{/privacy}","received_events_url":"https://api.github.com/users/frioux/received_events","type":"User","site_admin":false,"name":"fREW Schmidt","company":null,"blog":"blog.afoolishmanifesto.com","location":"Dallas, TX","email":"frioux@gmail.com","hireable":false,"bio":null,"public_repos":196,"public_gists":34,"followers":69,"following":26,"created_at":"2008-04-22T14:05:21Z","updated_at":"2014-03-16T22:30:30Z"}
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-r/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub user -r
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-r/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_-r/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_-r/stdout:
--------------------------------------------------------------------------------
1 | login frioux
2 | type User
3 | name fREW Schmidt
4 | html_url https://github.com/frioux
5 | email frioux@gmail.com
6 | blog blog.afoolishmanifesto.com
7 | location Dallas, TX
8 | followers 69
9 | following 26
10 | public_repos 196
11 | public_gists 34
12 | created_at 2008-04-22
13 | updated_at 2014-03-16
14 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole/e35bf7564cdc5d9e19589899eb7cf2471eb81684/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_aocole/e35bf7564cdc5d9e19589899eb7cf2471eb81684/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole/e35bf7564cdc5d9e19589899eb7cf2471eb81684/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 1218
6 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole/e35bf7564cdc5d9e19589899eb7cf2471eb81684/out:
--------------------------------------------------------------------------------
1 | {
2 | "login": "aocole",
3 | "html_url": "https://github.com/aocole",
4 | "type": "User",
5 | "name": "Andrew Cole",
6 | "company": null,
7 | "blog": null,
8 | "location": "Seattle, WA",
9 | "email": null,
10 | "bio": null,
11 | "public_repos": 16,
12 | "public_gists": 2,
13 | "followers": 2,
14 | "following": 4
15 | }
16 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub user aocole
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_aocole/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole/stdout:
--------------------------------------------------------------------------------
1 | Login aocole
2 | Type User
3 | Name Andrew Cole
4 | GitHub Page https://github.com/aocole
5 | Location Seattle, WA
6 | Followers 2
7 | Following 4
8 | Public Repos 16
9 | Public Gists 2
10 |
11 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole_-r/e35bf7564cdc5d9e19589899eb7cf2471eb81684/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_aocole_-r/e35bf7564cdc5d9e19589899eb7cf2471eb81684/err
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole_-r/e35bf7564cdc5d9e19589899eb7cf2471eb81684/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Date: Mon, 17 Mar 2014 04:44:26 GMT
4 | Content-Type: application/json; charset=utf-8
5 | Status: 200 OK
6 | X-RateLimit-Limit: 60
7 | X-RateLimit-Remaining: 55
8 | X-RateLimit-Reset: 1395034989
9 | Cache-Control: public, max-age=60, s-maxage=60
10 | Last-Modified: Sun, 16 Mar 2014 19:19:05 GMT
11 | ETag: "56bc2826c4896f23cc7e23520c3ecf16"
12 | Vary: Accept
13 | X-GitHub-Media-Type: github.beta
14 | X-Content-Type-Options: nosniff
15 | Content-Length: 1218
16 | Access-Control-Allow-Credentials: true
17 | Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
18 | Access-Control-Allow-Origin: *
19 | X-GitHub-Request-Id: 0F7D58FA:40EB:71E2FE:53267DAA
20 | Vary: Accept-Encoding
21 |
22 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole_-r/e35bf7564cdc5d9e19589899eb7cf2471eb81684/out:
--------------------------------------------------------------------------------
1 | {"login":"aocole","id":393591,"avatar_url":"https://gravatar.com/avatar/cd56dcbe68e6bc9609442fa7f4b3f502?d=https%3A%2F%2Fidenticons.github.com%2Fca8c94e987c9f198167ac4c1c601e214.png&r=x","gravatar_id":"cd56dcbe68e6bc9609442fa7f4b3f502","url":"https://api.github.com/users/aocole","html_url":"https://github.com/aocole","followers_url":"https://api.github.com/users/aocole/followers","following_url":"https://api.github.com/users/aocole/following{/other_user}","gists_url":"https://api.github.com/users/aocole/gists{/gist_id}","starred_url":"https://api.github.com/users/aocole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aocole/subscriptions","organizations_url":"https://api.github.com/users/aocole/orgs","repos_url":"https://api.github.com/users/aocole/repos","events_url":"https://api.github.com/users/aocole/events{/privacy}","received_events_url":"https://api.github.com/users/aocole/received_events","type":"User","site_admin":false,"name":"Andrew Cole","company":null,"blog":null,"location":"Seattle, WA","email":null,"hireable":false,"bio":null,"public_repos":16,"public_gists":2,"followers":2,"following":4,"created_at":"2010-09-09T17:29:50Z","updated_at":"2014-03-16T19:19:05Z"}
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole_-r/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/drinkup
2 | git hub user aocole -r
3 |
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole_-r/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/drinkup+git_hub_user_aocole_-r/stderr
--------------------------------------------------------------------------------
/test/commands/drinkup+git_hub_user_aocole_-r/stdout:
--------------------------------------------------------------------------------
1 | login aocole
2 | type User
3 | name Andrew Cole
4 | html_url https://github.com/aocole
5 | location Seattle, WA
6 | followers 2
7 | following 4
8 | public_repos 16
9 | public_gists 2
10 | created_at 2010-09-09
11 | updated_at 2014-03-16
12 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_repos/71aeacd7aeae24ba552664f11c6a5c40e9c09b61/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/git-hub+git_hub_repos/71aeacd7aeae24ba552664f11c6a5c40e9c09b61/err
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_repos/71aeacd7aeae24ba552664f11c6a5c40e9c09b61/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Link: ; rel="next", ; rel="last"
6 | Content-Length: 107653
7 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_repos/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/git-hub
2 | git hub repos
3 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_repos/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/git-hub+git_hub_repos/stderr
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_repos/stdout:
--------------------------------------------------------------------------------
1 | Repos for 'ingydotnet':
2 | 1) (2014-03-17) ingydotnet/git-hub Do GitHub operations from the `g
3 | 2) (2014-03-16) ingydotnet/inline-pm Write Perl subroutines in other
4 | 3) (2014-03-14) ingydotnet/cisco-pegex
5 | 4) (2014-03-14) ingydotnet/io-all-pm All in One Perl IO
6 | 5) (2014-03-13) ingydotnet/yaml-libyaml-pm Perl Binding to libyaml
7 | 6) (2014-03-13) ingydotnet/pegex-atoms-pgx
8 | 7) (2014-03-13) ingydotnet/pegex-pgx Pegex grammar for Pegex itself
9 | 8) (2014-03-12) ingydotnet/pegex-pm Pegex Parser for Perl
10 | 9) (2014-03-10) ingydotnet/ilovestvincent-com-site
11 | 10) (2014-03-06) ingydotnet/boolean-pm Boolean Type Support for Perl
12 | 11) (2014-03-06) ingydotnet/jemplate Industrial strength JavaScript
13 | 12) (2014-03-06) ingydotnet/git-subrepo
14 | 13) (2014-02-26) ingydotnet/pegex-json-pm Pegex JSON Parser for Perl
15 | 14) (2014-02-23) ingydotnet/sr-test
16 | 15) (2014-02-19) ingydotnet/termcast-kato
17 | 16) (2014-02-18) ingydotnet/dea_ng Droplet Execution Agent for Clo
18 | 17) (2014-02-18) ingydotnet/node-termcast-server Termcast Server in node.js
19 | 18) (2014-02-18) ingydotnet/app-termcast-server Stand-alone server for termcast
20 | 19) (2014-02-18) ingydotnet/app-termcast broadcast your terminal session
21 | 20) (2014-02-18) ingydotnet/json-bash Load, Dump and Manipulate JSON
22 | 21) (2014-02-17) ingydotnet/test-more-bash
23 | 22) (2014-02-14) ingydotnet/pairup
24 | --More-- (press Enter or CTRL-C)
25 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_user/73c0684d632059a4f511ba3369274aeb82ab9f01/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/git-hub+git_hub_user/73c0684d632059a4f511ba3369274aeb82ab9f01/err
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_user/73c0684d632059a4f511ba3369274aeb82ab9f01/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 1843
6 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_user/73c0684d632059a4f511ba3369274aeb82ab9f01/out:
--------------------------------------------------------------------------------
1 | {
2 | "login": "ingydotnet",
3 | "html_url": "https://github.com/ingydotnet",
4 | "type": "User",
5 | "name": "Ingy döt Net",
6 | "company": "Oui Code Software",
7 | "blog": "http://ingy.net",
8 | "location": "Seattle",
9 | "email": "ingy@ingy.net",
10 | "bio": "Ingy döt Net is a hacker who started programming in Assembler on punchcards, switched over to Perl and has since become enlightened to the goodness of all the OSDC languages and the people who hack, support and evangelize them. He is one of the creators of YAML, a major CPAN contributor, a founder of Oui Code Software, the father of Acmeism and is drinking a double americano as you read this.\r\n\r\nIngy is a citizen of the Earth who currently lives in Seattle and visits Taiwan every chance he can. He loves to make things DRY.\r\n",
11 | "public_repos": 354,
12 | "public_gists": 311,
13 | "followers": 299,
14 | "following": 135
15 | }
16 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_user/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/git-hub
2 | git hub user
3 |
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_user/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/git-hub+git_hub_user/stderr
--------------------------------------------------------------------------------
/test/commands/git-hub+git_hub_user/stdout:
--------------------------------------------------------------------------------
1 | Login ingydotnet
2 | Type User
3 | Name Ingy döt Net
4 | GitHub Page https://github.com/ingydotnet
5 | Email ingy@ingy.net
6 | Web Site http://ingy.net
7 | Location Seattle
8 | Company Oui Code Software
9 | Bio:
10 | Ingy döt Net is a hacker who started programming in Assembler on punchcards,
11 | switched over to Perl and has since become enlightened to the goodness of all
12 | the OSDC languages and the people who hack, support and evangelize them. He
13 | is one of the creators of YAML, a major CPAN contributor, a founder of Oui
14 | Code Software, the father of Acmeism and is drinking a double americano as
15 | you read this.
16 |
17 | Ingy is a citizen of the Earth who currently lives in Seattle and visits
18 | Taiwan every chance he can. He loves to make things DRY.
19 | Followers 299
20 | Following 135
21 | Public Repos 354
22 | Public Gists 311
23 |
24 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos/01f8932c5ab49a067328832450845bafd9ab7942/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos/01f8932c5ab49a067328832450845bafd9ab7942/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos/01f8932c5ab49a067328832450845bafd9ab7942/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 75766
6 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/not-repo
2 | git hub repos
3 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos/stderr
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos/stdout:
--------------------------------------------------------------------------------
1 | Repos for 'aocole':
2 | 1) (2014-03-16) aocole/growingpanes
3 | 2) (2014-02-25) aocole/skill-shot-list The Rails app that runs the list
4 | 3) (2014-01-14) aocole/skill-shot-android Skill Shot App for Android
5 | 4) (2014-01-07) aocole/aocole-dots
6 | 5) (2013-11-21) aocole/rack-oauth2 OAuth 2.0 Server & Client Librar
7 | 6) (2013-10-28) aocole/SmashPuttTwitterBox Smash Putt Twitter Box
8 | 7) (2013-10-25) aocole/cf-uaa-lib Ruby client APIs to access the C
9 | 8) (2013-10-08) aocole/mayorschool
10 | 9) (2013-09-20) aocole/scim-query-filter-parser-rb
11 | 10) (2013-07-04) aocole/nwpollination.org Wordpress site running nwpollin
12 | 11) (2013-05-07) aocole/upp-data Urban Pollination Project Data
13 | 12) (2013-04-16) aocole/RosettaCodeExplorer
14 | 13) (2013-04-02) aocole/nadine Open Coworking Software
15 | 14) (2013-01-25) aocole/rack a modular Ruby webserver interf
16 | 15) (2011-01-29) aocole/pbm-android Android Application for pinball
17 | 16) (2010-09-10) aocole/chef A systems integration framework
18 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_-c5/3a793bff9546bbf81cafa1a6c55f67f3c3757d76/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_-c5/3a793bff9546bbf81cafa1a6c55f67f3c3757d76/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_-c5/3a793bff9546bbf81cafa1a6c55f67f3c3757d76/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Link: ; rel="next", ; rel="last"
6 | Content-Length: 23780
7 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_-c5/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/not-repo
2 | git hub repos -c5
3 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_-c5/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_-c5/stderr
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_-c5/stdout:
--------------------------------------------------------------------------------
1 | Repos for 'aocole':
2 | 1) (2014-03-16) aocole/growingpanes
3 | 2) (2014-02-25) aocole/skill-shot-list The Rails app that runs the list
4 | 3) (2014-01-14) aocole/skill-shot-android Skill Shot App for Android
5 | 4) (2014-01-07) aocole/aocole-dots
6 | 5) (2013-11-21) aocole/rack-oauth2 OAuth 2.0 Server & Client Librar
7 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_stash/2348f7e1f193b9e8e88030cad75c8ff46ec7dd9e/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_stash/2348f7e1f193b9e8e88030cad75c8ff46ec7dd9e/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_stash/2348f7e1f193b9e8e88030cad75c8ff46ec7dd9e/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Link: ; rel="next", ; rel="last"
6 | Content-Length: 100933
7 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_stash/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/not-repo
2 | git hub repos stash
3 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_stash/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_stash/stderr
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/2cf9b013ff449b41f503a3bfdb2dbf90a664d667/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_tadzik_-a/2cf9b013ff449b41f503a3bfdb2dbf90a664d667/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/2cf9b013ff449b41f503a3bfdb2dbf90a664d667/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Link: ; rel="first", ; rel="prev"
6 | Content-Length: 13335
7 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/2cf9b013ff449b41f503a3bfdb2dbf90a664d667/out:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "notworks",
4 | "full_name": "tadzik/notworks",
5 | "html_url": "https://github.com/tadzik/notworks",
6 | "description": "Wired and wireless network manager",
7 | "pushed_at": "2010-07-17T21:04:46Z",
8 | "ssh_url": "git@github.com:tadzik/notworks.git",
9 | "language": "Perl",
10 | "forks": 0,
11 | "open_issues": 0,
12 | "watchers": 1
13 | },
14 | {
15 | "name": "feed2mbox",
16 | "full_name": "tadzik/feed2mbox",
17 | "html_url": "https://github.com/tadzik/feed2mbox",
18 | "description": "Fetch RSS/Atom feeds and deliver to local mailbox",
19 | "pushed_at": "2010-05-30T10:46:54Z",
20 | "ssh_url": "git@github.com:tadzik/feed2mbox.git",
21 | "language": "Python",
22 | "forks": 0,
23 | "open_issues": 0,
24 | "watchers": 1
25 | },
26 | {
27 | "name": "l",
28 | "full_name": "tadzik/l",
29 | "html_url": "https://github.com/tadzik/l",
30 | "description": "Launching applications faster than ever before",
31 | "pushed_at": "2010-05-30T09:15:33Z",
32 | "ssh_url": "git@github.com:tadzik/l.git",
33 | "language": "Perl",
34 | "forks": 0,
35 | "open_issues": 0,
36 | "watchers": 1
37 | }
38 | ]
39 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/eb1a3c8b00f4f738e93ab285600ef4e217386f47/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_tadzik_-a/eb1a3c8b00f4f738e93ab285600ef4e217386f47/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/eb1a3c8b00f4f738e93ab285600ef4e217386f47/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Link: ; rel="next", ; rel="last"
6 | Content-Length: 461270
7 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/not-repo
2 | git hub repos tadzik -a
3 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_repos_tadzik_-a/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_repos_tadzik_-a/stderr
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user/e35bf7564cdc5d9e19589899eb7cf2471eb81684/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_user/e35bf7564cdc5d9e19589899eb7cf2471eb81684/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user/e35bf7564cdc5d9e19589899eb7cf2471eb81684/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 1218
6 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user/e35bf7564cdc5d9e19589899eb7cf2471eb81684/out:
--------------------------------------------------------------------------------
1 | {
2 | "login": "aocole",
3 | "html_url": "https://github.com/aocole",
4 | "type": "User",
5 | "name": "Andrew Cole",
6 | "company": null,
7 | "blog": null,
8 | "location": "Seattle, WA",
9 | "email": null,
10 | "bio": null,
11 | "public_repos": 16,
12 | "public_gists": 2,
13 | "followers": 2,
14 | "following": 4
15 | }
16 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/not-repo
2 | git hub user
3 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_user/stderr
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user/stdout:
--------------------------------------------------------------------------------
1 | Login aocole
2 | Type User
3 | Name Andrew Cole
4 | GitHub Page https://github.com/aocole
5 | Location Seattle, WA
6 | Followers 2
7 | Following 4
8 | Public Repos 16
9 | Public Gists 2
10 |
11 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user_frioux/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/err:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_user_frioux/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/err
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user_frioux/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/head:
--------------------------------------------------------------------------------
1 | HTTP/1.1 200 OK
2 | Server: GitHub.com
3 | Content-Type: application/json; charset=utf-8
4 | Status: 200 OK
5 | Content-Length: 1258
6 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user_frioux/976efa9d52ae05a961db6dd5ad8b054c3abe22e1/out:
--------------------------------------------------------------------------------
1 | {
2 | "login": "frioux",
3 | "html_url": "https://github.com/frioux",
4 | "type": "User",
5 | "name": "fREW Schmidt",
6 | "company": null,
7 | "blog": "blog.afoolishmanifesto.com",
8 | "location": "Dallas, TX",
9 | "email": "frioux@gmail.com",
10 | "bio": null,
11 | "public_repos": 196,
12 | "public_gists": 34,
13 | "followers": 69,
14 | "following": 26
15 | }
16 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user_frioux/run.bash:
--------------------------------------------------------------------------------
1 | export GIT_DIR=$TEST_DIR/../repo/not-repo
2 | git hub user frioux
3 |
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user_frioux/stderr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/commands/not-repo+git_hub_user_frioux/stderr
--------------------------------------------------------------------------------
/test/commands/not-repo+git_hub_user_frioux/stdout:
--------------------------------------------------------------------------------
1 | Login frioux
2 | Type User
3 | Name fREW Schmidt
4 | GitHub Page https://github.com/frioux
5 | Email frioux@gmail.com
6 | Web Site blog.afoolishmanifesto.com
7 | Location Dallas, TX
8 | Followers 69
9 | Following 26
10 | Public Repos 196
11 | Public Gists 34
12 |
13 |
--------------------------------------------------------------------------------
/test/compile.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source test/setup
4 |
5 | use Test::More
6 |
7 | {
8 | source lib/git-hub
9 | pass 'git-hub compiles'
10 | }
11 |
12 | for f in lib/git-hub lib/git-hub.d/*; do
13 | [[ -f $f ]] || continue
14 | if [[ $f =~ \.pl$ ]]; then
15 | perl -c $f &>/dev/null
16 | else
17 | source "$f"
18 | fi
19 | pass "${f##*/} compiles"
20 | done
21 |
22 | done_testing
23 |
--------------------------------------------------------------------------------
/test/devel/all_commands.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # This test is just a large grained, realtime test of the commands. Good to
4 | # run before commit or release.
5 |
6 | set -e
7 | source test/setup
8 | use Test::More
9 |
10 | ME="$(git hub config login)"
11 | [ -n "$ME" ] || die "'git hub config login' has no value"
12 |
13 | O1=git-commands
14 | R1=git-hub-api-test
15 | F1=$O1/$R1
16 |
17 | U2=cdent
18 | R2=simper
19 | F2=$U2/$R2
20 |
21 | deletes=("$F1" "$O1/$R2")
22 | TEARDOWN() {
23 | rm -fr $R2
24 | for test_repo in "${deletes[@]}"; do
25 | ( set -x; git hub repo-delete $test_repo ) || true
26 | done
27 | }
28 |
29 | # Make sure test repos deleted (if left over from previous failure)
30 | TEARDOWN
31 |
32 | {
33 | set -x
34 |
35 | git hub -h || true
36 | git hub help user
37 | git hub user
38 | git hub user cdent
39 | git hub repo
40 | git hub repo pegex-pm
41 | git hub repos -c5
42 | git hub repos cdent --count=10
43 | git hub repo-new $F1
44 | git hub repo-edit $F1 \
45 | description "This is just a test repo" \
46 | homepage http://example.com
47 | git hub repo $F2
48 | git hub fork $F2 --org=$O1
49 | git hub clone $O1/$R2
50 | ok "`[ -d "$R2/.git" ]`" "$R2 repo directory exists"
51 | (
52 | cd $R2
53 | git hub repos
54 | git hub star
55 | git hub stars
56 | git hub repo
57 | git hub unstar
58 | git hub repo
59 | )
60 | git hub starred -c5
61 | git hub collabs
62 |
63 | set +x
64 | }
65 |
66 | TEARDOWN
67 |
68 | pass 'All commands ran seemingly without error.'
69 |
70 | done_testing
71 |
72 | # vim: set ft=sh:
73 |
--------------------------------------------------------------------------------
/test/devel/each.t:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e -o pipefail
4 |
5 | export GIT_EXEC_PATH=$PWD/lib:$(git --exec-path)
6 | git hub followers -qrc2 | git hub user - -j
7 |
--------------------------------------------------------------------------------
/test/githubconfig:
--------------------------------------------------------------------------------
1 | [git-hub]
2 | login = aocole
3 | api-token = 0123456789abcdef0123456789abcdef01234567
4 |
--------------------------------------------------------------------------------
/test/lib/git-hub-subclass:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | interactive() {
4 | [[ -n $GIT_HUB_TEST_INTERACTIVE ]] && return 0
5 |
6 | if [[ -t 0 && -t 1 ]]; then
7 | return 0
8 | else
9 | return 1
10 | fi
11 | }
12 |
13 | prompt() {
14 | echo "$prompt_msg"
15 | exit 0
16 | }
17 |
18 | read-config-value() {
19 | if [[ -n $GIT_HUB_TEST_MAKE ]]; then
20 | if [[ $1 == login ]]; then
21 | value=aocole
22 | return
23 | fi
24 | if [[ $1 == use-auth ]]; then
25 | value=
26 | fi
27 | fi
28 | value="$(git config -f $GIT_HUB_CONFIG "git-hub.$1")" || value="$2"
29 | }
30 |
--------------------------------------------------------------------------------
/test/lib/git-hub-test-run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | source git-hub-subclass
4 |
5 | api-call() {
6 | format-curl-command "$@"
7 |
8 | command_header_file="$GIT_HUB_CACHE/$command_sha1/head"
9 | command_output_file="$GIT_HUB_CACHE/$command_sha1/out"
10 | command_error_file="$GIT_HUB_CACHE/$command_sha1/err"
11 |
12 | if [[ -s $command_output_file ]]; then
13 | JSON__cache="$(cat $command_output_file | JSON.load)"
14 | $show_output && cat $command_output_file >&2
15 | $show_json && JSON.cache >&2
16 | fi
17 |
18 | check-api-call-status 0
19 |
20 | true
21 | }
22 |
--------------------------------------------------------------------------------
/test/repo/drinkup/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/test/repo/drinkup/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = false
5 | logallrefupdates = true
6 | [remote "origin"]
7 | fetch = +refs/heads/*:refs/remotes/origin/*
8 | url = git@github.com:frioux/drinkup
9 | [branch "master"]
10 | remote = origin
11 | merge = refs/heads/master
12 |
--------------------------------------------------------------------------------
/test/repo/drinkup/objects/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/drinkup/objects/_
--------------------------------------------------------------------------------
/test/repo/drinkup/refs/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/drinkup/refs/_
--------------------------------------------------------------------------------
/test/repo/git-hub/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/test/repo/git-hub/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = true
5 | [remote "origin"]
6 | url = git@github.com:ingydotnet/git-hub.git
7 |
--------------------------------------------------------------------------------
/test/repo/git-hub/objects/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/git-hub/objects/_
--------------------------------------------------------------------------------
/test/repo/git-hub/refs/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/git-hub/refs/_
--------------------------------------------------------------------------------
/test/repo/git-scheme/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/test/repo/git-scheme/config:
--------------------------------------------------------------------------------
1 | [remote "origin"]
2 | url = git://github.com/ricky/bar.git
3 | fetch = +refs/heads/*:refs/remotes/origin/*
4 |
--------------------------------------------------------------------------------
/test/repo/git-scheme/objects/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/git-scheme/objects/_
--------------------------------------------------------------------------------
/test/repo/git-scheme/refs/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/git-scheme/refs/_
--------------------------------------------------------------------------------
/test/repo/not-repo/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/not-repo/_
--------------------------------------------------------------------------------
/test/repo/ricardo-foo/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/master
2 |
--------------------------------------------------------------------------------
/test/repo/ricardo-foo/config:
--------------------------------------------------------------------------------
1 | [remote "origin"]
2 | url = git@github.com:ricardo/foo
3 | fetch = +refs/heads/*:refs/remotes/origin/*
4 |
--------------------------------------------------------------------------------
/test/repo/ricardo-foo/objects/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/ricardo-foo/objects/_
--------------------------------------------------------------------------------
/test/repo/ricardo-foo/refs/_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ingydotnet/git-hub/e4a859a3986b724324e2b9a8d35afee1ed110f43/test/repo/ricardo-foo/refs/_
--------------------------------------------------------------------------------
/test/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | BASHLIB="$(
6 | find $PWD -type d |
7 | grep -E '/(bin|lib)$' |
8 | grep -v '/pkg/cpan' |
9 | xargs -n1 printf "%s:"
10 | )"
11 | export PATH="$BASHLIB:$PATH"
12 |
13 | source bash+ :std
14 |
15 | export TEST_DIR="$PWD/test/commands"
16 | export TEST_BIN="$PWD/test/bin"
17 | export TEST_LIB="$PWD/test/lib"
18 |
19 | # unset most of GIT_HUB_* vars:
20 | unset `env | cut -f1 -d= | grep '^GIT_HUB' | grep -v 'GIT_HUB_JSON_LIB'`
21 |
22 | # Set env vars for testing:
23 | export GIT_HUB_TEST_RUN=true
24 |
25 | export GIT_HUB_USER_DIR=$PWD/test
26 | export GIT_HUB_EXEC_PATH=$PWD/lib
27 | export GIT_HUB_EXT_PATH=$GIT_HUB_EXEC_PATH/git-hub.d
28 | export GIT_HUB_API_URI=https://api.github.com
29 | export GIT_HUB_CONFIG=$GIT_HUB_USER_DIR/githubconfig
30 |
31 | export GIT_DIR=.no-git-repo
32 | export GIT_EXEC_PATH=$GIT_HUB_EXEC_PATH
33 | export GIT_AUTHOR_NAME=Tester
34 | export GIT_AUTHOR_EMAIL=test@example.com
35 | export GIT_COMMITTER_NAME=Tester
36 | export GIT_COMMITTER_EMAIL=test@example.com
37 |
38 | export GIT_HUB_TEST_INTERACTIVE=true
39 | export GIT_HUB_TEST_COLS=80
40 | export GIT_HUB_TEST_LINES=24
41 |
--------------------------------------------------------------------------------
/test/source-all.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | source test/setup
6 |
7 | use Test::More
8 |
9 | # use git-hub
10 | source git-hub
11 |
12 | files=("$(find lib/git-hub.d plugin/*/lib -type f | sort)")
13 |
14 | for file in ${files[@]}; do
15 | library=${file##*/}
16 | if [[ "$library" =~ ^git-hub ]] || [[ "$library" =~ \.bash$ ]]; then
17 | (source "$file" &> /dev/null) && OK=$? || OK=$?
18 | ok $OK "'source $file' works"
19 | elif [[ "$library" =~ \.pl$ ]]; then
20 | (perl -c "$file" &> /dev/null) && OK=$? || OK=$?
21 | ok $OK "'perl -c $file' works"
22 | fi
23 | done
24 |
25 | done_testing
26 |
27 | # vim: set ft=sh:
28 |
--------------------------------------------------------------------------------
/test/url.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Set up the test environment (PATH, etc)
4 | source test/setup
5 | # This is set for other tests, but cause problems here
6 | unset GIT_DIR
7 |
8 | # Pull in TAP framework (from ext/test-more-bash)
9 | use Test::More
10 |
11 | # Make a test repo dir called tmp
12 | # TODO: this should be abstracted
13 | rm -fr tmp
14 | mkdir tmp
15 |
16 | # Create a basic repo with a 'bar' branch
17 | # Run our test command and capture the output
18 | # Parens () create a subprocess
19 | url="$(
20 | # This will change back to current dir after we exit subprocess
21 | cd tmp
22 | # Set up dir as a minimal repo the way we want it.
23 | # D it in subprocess and throw away output
24 | (
25 | git init
26 | git remote add origin git@github.com:test/test
27 | touch foo
28 | git add foo
29 | git commit -m ...
30 | git checkout -b bar
31 | ) &> /dev/null
32 | # Run the test command
33 | git hub url
34 | )"
35 | # Make sure output URL has 'bar' in it:
36 | like "$url" bar "'git hub url' repects branches"
37 |
38 | # Clean up test repo:
39 | rm -fr tmp
40 |
41 | done_testing
42 |
--------------------------------------------------------------------------------