radius-toolbelt 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +14 -0
- data/Gemfile +14 -0
- data/LICENSE.txt +22 -0
- data/README.md +43 -0
- data/Rakefile +2 -0
- data/bin/radius +9 -0
- data/lib/radius/toolbelt/release_github.rb +49 -0
- data/lib/radius/toolbelt/release_helpers.rb +40 -0
- data/lib/radius/toolbelt/release_repo.rb +55 -0
- data/lib/radius/toolbelt/tasks.rb +27 -0
- data/lib/radius/toolbelt/version.rb +5 -0
- data/lib/radius/toolbelt/xcode_helpers.rb +27 -0
- data/lib/radius/toolbelt.rb +6 -0
- data/radius-toolbelt.gemspec +31 -0
- data/spec/features/cli_spec.rb +8 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/string.rb +9 -0
- data/spec/support/subcommand.rb +55 -0
- metadata +157 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6f72c26fce998cd0bf966124ece0f2fc3bc38098
|
4
|
+
data.tar.gz: 564456b0d2133b9c67f9bac0be7a252582348229
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3c7039f6f95f56d0c7daa3666d6b98969ed1d48e6ff8ed32bee7aae35ee0e970de9011712cff97b5011854a940422443268a694a40820351006ddede9ba5b5d9
|
7
|
+
data.tar.gz: 1424d751816862dc59cf3bbd48cbf6ef86e82a66ab27815cdc9ab8121c7738c1a46fb516fa6481c637110b6ac80ad50fa2396ef5e13ff67a13dd3e7c976ad5ac
|
data/.gitignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
/.yardoc
|
2
|
+
/Gemfile.lock
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
*.so
|
10
|
+
*.o
|
11
|
+
*.a
|
12
|
+
mkmf.log
|
13
|
+
|
14
|
+
# Ignore bundler related files
|
15
|
+
/.bundle/
|
16
|
+
/bundle/
|
17
|
+
*.bundle
|
18
|
+
|
19
|
+
# Ignore development related binstubs
|
20
|
+
/bin/
|
21
|
+
/sbin/
|
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.3
|
data/.travis.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
language: ruby
|
2
|
+
sudo: false
|
3
|
+
bundler_args: --binstubs sbin --standalone --without documentation debug
|
4
|
+
script: sbin/rspec
|
5
|
+
rvm:
|
6
|
+
- 2.0
|
7
|
+
- 2.1
|
8
|
+
- ruby-head
|
9
|
+
- rbx-2
|
10
|
+
matrix:
|
11
|
+
allow_failures:
|
12
|
+
- rvm: ruby-head
|
13
|
+
- rvm: rbx-2
|
14
|
+
fast_finish: true
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in radius-toolbelt.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
group :debug do
|
7
|
+
gem "pry-nav", require: false
|
8
|
+
gem "travis-lint", require: false
|
9
|
+
end
|
10
|
+
|
11
|
+
# Deps for rdoc.info
|
12
|
+
group :documentation do
|
13
|
+
gem 'yard', :require => false
|
14
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Radius Networks
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Radius::Toolbelt
|
2
|
+
|
3
|
+
Radius Networks' collection of CLI tools and Rake tasks for common activities.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'radius-toolbelt', github: 'RadiusNetworks/radius-toolbelt'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```console
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
```console
|
22
|
+
# Download or clone the project from GitHub:
|
23
|
+
$ git clone git@github.com:RadiusNetworks/radius-toolbelt.git
|
24
|
+
$ cd radius-toolbelt
|
25
|
+
$ rake install
|
26
|
+
```
|
27
|
+
|
28
|
+
### Rake
|
29
|
+
|
30
|
+
Some of these tools come with handy [Rake](https://github.com/jimweirich/rake)
|
31
|
+
equivalents. To use these tasks add the following to your `Rakefile`:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
require 'radius/toolbelt/tasks'
|
35
|
+
```
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
1. Fork it ( https://github.com/[my-github-username]/radius-toolbelt/fork )
|
40
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
41
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
42
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
43
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/radius
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'octokit'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'launchy'
|
5
|
+
|
6
|
+
module Radius
|
7
|
+
module Toolbelt
|
8
|
+
|
9
|
+
class ReleaseGithub
|
10
|
+
|
11
|
+
attr_reader :repo, :tag_name, :release_name, :body, :filenames, :token
|
12
|
+
def initialize(repo, token, tag_name, release_name, body, filenames)
|
13
|
+
@repo = repo
|
14
|
+
@tag_name = tag_name
|
15
|
+
@release_name = release_name
|
16
|
+
@body = body
|
17
|
+
@filenames = filenames
|
18
|
+
@token = token
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
# pull token from ENV or hub config
|
23
|
+
|
24
|
+
puts "\nCreating draft release \"#{release_name}\" for repo \"#{repo}\"..."
|
25
|
+
# create the release
|
26
|
+
client = Octokit::Client.new(access_token: token)
|
27
|
+
release = client.create_release(
|
28
|
+
repo, tag_name,
|
29
|
+
#target_commitish: tag_name,
|
30
|
+
name: release_name,
|
31
|
+
body: body,
|
32
|
+
draft: true
|
33
|
+
)
|
34
|
+
|
35
|
+
# upload the files
|
36
|
+
filenames.each do |filename|
|
37
|
+
puts "Uploading #{filename}..."
|
38
|
+
client.upload_asset release.url, filename
|
39
|
+
end
|
40
|
+
|
41
|
+
puts "\nRelease URL: #{release.html_url}"
|
42
|
+
Launchy.open( release.html_url.gsub("/tag/", "/edit/") )
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Radius
|
4
|
+
module Toolbelt
|
5
|
+
module ReleaseHelpers
|
6
|
+
|
7
|
+
def replace(src, dest)
|
8
|
+
FileUtils.copy_entry(src, dest, false, false, true)
|
9
|
+
end
|
10
|
+
|
11
|
+
def github_token
|
12
|
+
@token ||= ENV["github_token"] || YAML.load(`cat ~/.config/hub`)["github.com"].first["oauth_token"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def clean(dir)
|
16
|
+
rm_rf Dir.glob("#{dir}/*.framework")
|
17
|
+
rm_rf Dir.glob("#{dir}/*.zip")
|
18
|
+
end
|
19
|
+
|
20
|
+
def release_github(repo, release_name, version, files)
|
21
|
+
tag_name = "v#{version}"
|
22
|
+
body = "TODO: Describe the changes in this release"
|
23
|
+
token = github_token
|
24
|
+
|
25
|
+
r = ReleaseGithub.new repo, token, tag_name, release_name, body, files
|
26
|
+
r.run
|
27
|
+
end
|
28
|
+
|
29
|
+
# Clone down the `repo`, copy all the `file` over then commit, tag and push
|
30
|
+
# it up to the origin.
|
31
|
+
#
|
32
|
+
# `files` is an array of files to copy into the root of the local repo.
|
33
|
+
def release_repo(repo, version, files, dir = "build/release-repo")
|
34
|
+
r = ReleaseRepo.new repo, version, dir, files
|
35
|
+
r.run
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Radius
|
4
|
+
module Toolbelt
|
5
|
+
|
6
|
+
class ReleaseRepo
|
7
|
+
include Rake::DSL
|
8
|
+
|
9
|
+
attr_reader :repo, :ver, :dir, :files
|
10
|
+
def initialize(repo, ver, dir, files)
|
11
|
+
@repo = repo
|
12
|
+
@dir = dir
|
13
|
+
@ver = ver
|
14
|
+
@files = files
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
puts "Releasing to repo in #{dir}"
|
19
|
+
checkout
|
20
|
+
copy
|
21
|
+
tag_commit_push
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def checkout
|
27
|
+
if File.exists? "#{dir}/.git"
|
28
|
+
FileUtils.chdir dir do
|
29
|
+
sh "git checkout master --quiet"
|
30
|
+
sh "git reset --hard origin/master"
|
31
|
+
end
|
32
|
+
else
|
33
|
+
system "git clone --depth 1 git@github.com:#{repo}.git #{dir}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def copy
|
38
|
+
files.each do |src|
|
39
|
+
dest = File.join dir, File.basename(src)
|
40
|
+
FileUtils.copy_entry(src, dest, false, false, true)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def tag_commit_push
|
45
|
+
FileUtils.chdir dir do
|
46
|
+
sh "git add ."
|
47
|
+
sh "git commit -m 'Version #{ver}'"
|
48
|
+
sh "git tag v#{ver}"
|
49
|
+
sh "git push origin master --tags"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Main hook for loading various Rake tasks
|
2
|
+
require 'rake'
|
3
|
+
require_relative 'release_helpers'
|
4
|
+
require_relative 'xcode_helpers'
|
5
|
+
require_relative 'release_repo'
|
6
|
+
require_relative 'release_github'
|
7
|
+
|
8
|
+
task :git_clean_tree do
|
9
|
+
|
10
|
+
unless system("git diff-files --quiet --ignore-submodules --")
|
11
|
+
fail "Error: There are unstaged changes in the working tree. You are trying to run a task that requires a clean git working tree"
|
12
|
+
end
|
13
|
+
|
14
|
+
unless system("git diff-index --cached --quiet HEAD --ignore-submodules --")
|
15
|
+
fail "Error: Uncommitted changes in the index. You are trying to run a task that requires a clean git working tree"
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
task :git_version_tag => :git_clean_tree do
|
21
|
+
|
22
|
+
unless `git describe --exact-match --tags HEAD`.chomp.include?(agvtool_version)
|
23
|
+
fail "Error: The current git HEAD does not have a tag that matches \"#{agvtool_version}\". You are trying to run a task that requires a matching tag on the current git ref."
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Radius
|
4
|
+
module Toolbelt
|
5
|
+
module XcodeHelpers
|
6
|
+
|
7
|
+
def self.included klass
|
8
|
+
klass.class_eval do
|
9
|
+
include ReleaseHelpers
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def compress(src, dest)
|
14
|
+
system "ditto -ck --rsrc --sequesterRsrc --keepParent #{src} #{dest}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def xcode(action, params)
|
18
|
+
system "xcodebuild #{params.map {|k,v| "-#{k} #{v}"}.join ' '} #{action}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def agvtool_version
|
22
|
+
@agvtool_version ||= `xcrun agvtool what-version -terse`.chomp
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'radius/toolbelt/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "radius-toolbelt"
|
8
|
+
spec.version = Radius::Toolbelt::VERSION
|
9
|
+
spec.authors = ["Radius Networks", "Aaron Kromer", "Christopher Sexton"]
|
10
|
+
spec.email = ["support@radiusnetworks.com"]
|
11
|
+
spec.summary = %q{Radius Networks Tools and Utilities}
|
12
|
+
spec.description = %q{Collection of CLI tools and Rake tasks for common activities.}
|
13
|
+
spec.homepage = "https://github.com/RadiusNetworks/radius-toolbelt"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = %w[ radius ]
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = %w[ lib ]
|
20
|
+
|
21
|
+
spec.required_ruby_version = '~> 2.0'
|
22
|
+
|
23
|
+
spec.add_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_dependency "launchy"
|
25
|
+
spec.add_dependency "octokit"
|
26
|
+
spec.add_dependency "mime-types"
|
27
|
+
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler"
|
30
|
+
spec.add_development_dependency "rspec"
|
31
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# These two settings work together to allow you to limit a spec run
|
42
|
+
# to individual examples or groups you care about by tagging them with
|
43
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
44
|
+
# get run.
|
45
|
+
config.filter_run :focus
|
46
|
+
config.run_all_when_everything_filtered = true
|
47
|
+
|
48
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
49
|
+
# For more details, see:
|
50
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
51
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
52
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
53
|
+
config.disable_monkey_patching!
|
54
|
+
|
55
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
56
|
+
# be too noisy due to issues in dependencies.
|
57
|
+
config.warnings = true
|
58
|
+
|
59
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
60
|
+
# file, and it's useful to allow more verbose output when running an
|
61
|
+
# individual spec file.
|
62
|
+
if config.files_to_run.one?
|
63
|
+
# Use the documentation formatter for detailed output,
|
64
|
+
# unless a formatter has already been configured
|
65
|
+
# (e.g. via a command-line flag).
|
66
|
+
config.default_formatter = 'doc'
|
67
|
+
end
|
68
|
+
|
69
|
+
# Print the 10 slowest examples and example groups at the
|
70
|
+
# end of the spec run, to help surface which specs are running
|
71
|
+
# particularly slow.
|
72
|
+
config.profile_examples = 10
|
73
|
+
|
74
|
+
# Run specs in random order to surface order dependencies. If you find an
|
75
|
+
# order dependency and want to debug it, you can fix the order by providing
|
76
|
+
# the seed, which is printed after each run.
|
77
|
+
# --seed 1234
|
78
|
+
config.order = :random
|
79
|
+
|
80
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
81
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
82
|
+
# test failures related to randomization by passing the same `--seed` value
|
83
|
+
# as the one that triggered the failure.
|
84
|
+
Kernel.srand config.seed
|
85
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
unless String.public_instance_methods.include? :strip_heredoc
|
2
|
+
String.class_exec do # self is set to the String class
|
3
|
+
def strip_heredoc
|
4
|
+
leading_space = scan(/^[ \t]*(?=\S)/).min
|
5
|
+
indent = leading_space ? leading_space.size : 0
|
6
|
+
gsub(/^[ \t]{#{indent}}/, '')
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
3
|
+
module Radius
|
4
|
+
module RSpec
|
5
|
+
module Processes
|
6
|
+
def subcommand(*args)
|
7
|
+
Subcommand.new(*args).run
|
8
|
+
end
|
9
|
+
|
10
|
+
class Subcommand
|
11
|
+
TERMINAL_COLORS = /\e\[\d+m/
|
12
|
+
|
13
|
+
attr_reader :raw_stdout, :raw_stderr, :status, :command
|
14
|
+
|
15
|
+
def initialize(*args)
|
16
|
+
raise 'Command cannot be empty' if args.empty?
|
17
|
+
|
18
|
+
# Helpfully handle when the command is an array
|
19
|
+
args.unshift(*args.shift) if Array === args.first
|
20
|
+
|
21
|
+
@command = args
|
22
|
+
@raw_stdout = ''
|
23
|
+
@raw_stderr = ''
|
24
|
+
@status = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def failure?
|
28
|
+
!success?
|
29
|
+
end
|
30
|
+
|
31
|
+
def run
|
32
|
+
@raw_stdout, @raw_stderr, @status = Open3.capture3(*command)
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
def stderr
|
37
|
+
raw_stderr.gsub(TERMINAL_COLORS, '')
|
38
|
+
end
|
39
|
+
|
40
|
+
def stdout
|
41
|
+
raw_stdout.gsub(TERMINAL_COLORS, '')
|
42
|
+
end
|
43
|
+
|
44
|
+
def success?
|
45
|
+
status == 0
|
46
|
+
end
|
47
|
+
alias_method :successful?, :success?
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
RSpec.configure do |c|
|
54
|
+
c.include Radius::RSpec::Processes, type: :feature
|
55
|
+
end
|
metadata
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: radius-toolbelt
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Radius Networks
|
8
|
+
- Aaron Kromer
|
9
|
+
- Christopher Sexton
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '10.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '10.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: launchy
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: octokit
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: mime-types
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: bundler
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: rspec
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
description: Collection of CLI tools and Rake tasks for common activities.
|
100
|
+
email:
|
101
|
+
- support@radiusnetworks.com
|
102
|
+
executables:
|
103
|
+
- radius
|
104
|
+
extensions: []
|
105
|
+
extra_rdoc_files: []
|
106
|
+
files:
|
107
|
+
- ".gitignore"
|
108
|
+
- ".rspec"
|
109
|
+
- ".ruby-version"
|
110
|
+
- ".travis.yml"
|
111
|
+
- Gemfile
|
112
|
+
- LICENSE.txt
|
113
|
+
- README.md
|
114
|
+
- Rakefile
|
115
|
+
- bin/radius
|
116
|
+
- lib/radius/toolbelt.rb
|
117
|
+
- lib/radius/toolbelt/release_github.rb
|
118
|
+
- lib/radius/toolbelt/release_helpers.rb
|
119
|
+
- lib/radius/toolbelt/release_repo.rb
|
120
|
+
- lib/radius/toolbelt/tasks.rb
|
121
|
+
- lib/radius/toolbelt/version.rb
|
122
|
+
- lib/radius/toolbelt/xcode_helpers.rb
|
123
|
+
- radius-toolbelt.gemspec
|
124
|
+
- spec/features/cli_spec.rb
|
125
|
+
- spec/spec_helper.rb
|
126
|
+
- spec/support/string.rb
|
127
|
+
- spec/support/subcommand.rb
|
128
|
+
homepage: https://github.com/RadiusNetworks/radius-toolbelt
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '2.0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.2.2
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: Radius Networks Tools and Utilities
|
152
|
+
test_files:
|
153
|
+
- spec/features/cli_spec.rb
|
154
|
+
- spec/spec_helper.rb
|
155
|
+
- spec/support/string.rb
|
156
|
+
- spec/support/subcommand.rb
|
157
|
+
has_rdoc:
|