rbd 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +16 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +42 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/Rakefile +16 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/exe/rbd +6 -0
- data/lib/rbd.rb +9 -0
- data/lib/rbd/cli.rb +49 -0
- data/lib/rbd/version.rb +5 -0
- data/rbd.gemspec +36 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d1a8b20f8440e8a5c531c3aa3ae3ea084fe6c47a3fb5a75c95249ecc9e1b34ab
|
4
|
+
data.tar.gz: b0ad56d5e1e21d61abbb2222c0c6aa4f720edaf4d6d1f6beadcfc0582536659a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d77326f6097f58fc48cba6090077140072e9d4fc491baf7cff1d21a9e9cac4103f5648f3d67b75d2a6fc2e27a9646cf87dadd680835941f163e97e011df5f370
|
7
|
+
data.tar.gz: 6a5d24ecf19745798829c3e297054c592998be6a5584b7ee3c287a560a0cae45fd6a9e0840d63bff56347ab9350a4cbbfaead63a340322294dc8c2134c21de47
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 3.0.0
|
3
|
+
|
4
|
+
Layout/LineLength:
|
5
|
+
Max: 80
|
6
|
+
|
7
|
+
Style/StringLiterals:
|
8
|
+
Enabled: true
|
9
|
+
EnforcedStyle: double_quotes
|
10
|
+
|
11
|
+
Style/StringLiteralsInInterpolation:
|
12
|
+
Enabled: true
|
13
|
+
EnforcedStyle: double_quotes
|
14
|
+
|
15
|
+
Style/Documentation:
|
16
|
+
Enabled: false
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rbd (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.1)
|
10
|
+
minitest (5.14.3)
|
11
|
+
parallel (1.20.1)
|
12
|
+
parser (3.0.0.0)
|
13
|
+
ast (~> 2.4.1)
|
14
|
+
rainbow (3.0.0)
|
15
|
+
rake (13.0.3)
|
16
|
+
regexp_parser (2.0.3)
|
17
|
+
rexml (3.2.4)
|
18
|
+
rubocop (0.93.1)
|
19
|
+
parallel (~> 1.10)
|
20
|
+
parser (>= 2.7.1.5)
|
21
|
+
rainbow (>= 2.2.2, < 4.0)
|
22
|
+
regexp_parser (>= 1.8)
|
23
|
+
rexml
|
24
|
+
rubocop-ast (>= 0.6.0)
|
25
|
+
ruby-progressbar (~> 1.7)
|
26
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
27
|
+
rubocop-ast (1.4.0)
|
28
|
+
parser (>= 2.7.1.5)
|
29
|
+
ruby-progressbar (1.11.0)
|
30
|
+
unicode-display_width (1.7.0)
|
31
|
+
|
32
|
+
PLATFORMS
|
33
|
+
x86_64-darwin-20
|
34
|
+
|
35
|
+
DEPENDENCIES
|
36
|
+
minitest (~> 5.0)
|
37
|
+
rake (~> 13.0)
|
38
|
+
rbd!
|
39
|
+
rubocop (~> 0.80)
|
40
|
+
|
41
|
+
BUNDLED WITH
|
42
|
+
2.2.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Jeff Peterson
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Rbd
|
2
|
+
|
3
|
+
Working on a ruby gem to make ruby dev simpler.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rbd'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install rbd
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
rbd run
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
28
|
+
`rake test` to run the tests. You can also run `bin/console` for an interactive
|
29
|
+
prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
32
|
+
release a new version, update the version number in `version.rb`, and then run
|
33
|
+
`bundle exec rake release`, which will create a git tag for the version, push
|
34
|
+
git commits and the created tag, and push the `.gem` file to
|
35
|
+
[rubygems.org](https://rubygems.org).
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
Bug reports and pull requests are welcome on GitHub at
|
40
|
+
https://github.com/[USERNAME]/rbd.
|
41
|
+
|
42
|
+
## License
|
43
|
+
|
44
|
+
The gem is available as open source under the terms of the
|
45
|
+
[MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "rubocop/rake_task"
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: %i[test rubocop]
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "rbd"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/exe/rbd
ADDED
data/lib/rbd.rb
ADDED
data/lib/rbd/cli.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "optparse"
|
4
|
+
require "ostruct"
|
5
|
+
|
6
|
+
module Rbd
|
7
|
+
class NoMainError < StandardError; end
|
8
|
+
|
9
|
+
class Cli
|
10
|
+
attr_reader :cmd, :flags, :args
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@flags = OpenStruct.new
|
14
|
+
@args = ARGV.clone
|
15
|
+
opt_parser.parse!(@args, into: flags)
|
16
|
+
@cmd = @args.shift || "run"
|
17
|
+
end
|
18
|
+
|
19
|
+
def run!
|
20
|
+
return puts "Todo: help" if flags.help
|
21
|
+
|
22
|
+
case cmd
|
23
|
+
when "run"
|
24
|
+
|
25
|
+
raise Rbd::NoMainError unless load! "main", "lib/main"
|
26
|
+
else
|
27
|
+
puts "Not a valid command: #{cmd}"
|
28
|
+
end
|
29
|
+
rescue Rbd::NoMainError
|
30
|
+
puts "Could not run project. Expected main.rb file"
|
31
|
+
end
|
32
|
+
|
33
|
+
def opt_parser
|
34
|
+
@opt_parser ||= OptionParser.new do |op|
|
35
|
+
op.on("-h", "--help", "Displays help")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def load!(*files)
|
40
|
+
file, *files = files
|
41
|
+
return if file.nil?
|
42
|
+
|
43
|
+
load "#{Dir.pwd}/#{file}.rb"
|
44
|
+
file
|
45
|
+
rescue LoadError
|
46
|
+
load!(*files)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/lib/rbd/version.rb
ADDED
data/rbd.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/rbd/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "rbd"
|
7
|
+
spec.version = Rbd::VERSION
|
8
|
+
spec.authors = ["Jeff Peterson"]
|
9
|
+
spec.email = ["jeff@yak.sh"]
|
10
|
+
|
11
|
+
spec.summary = "Better ruby development tooling."
|
12
|
+
spec.homepage = "https://github.com/jeffpeterson/rbd"
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/jeffpeterson/rbd"
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added
|
21
|
+
# into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
f.match(%r{\A(?:test|spec|features)/})
|
25
|
+
end
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
# Uncomment to register a new dependency of your gem
|
32
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
33
|
+
|
34
|
+
# For more information and examples about making a new gem, checkout our
|
35
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rbd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jeff Peterson
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- jeff@yak.sh
|
16
|
+
executables:
|
17
|
+
- rbd
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".gitignore"
|
22
|
+
- ".rubocop.yml"
|
23
|
+
- Gemfile
|
24
|
+
- Gemfile.lock
|
25
|
+
- LICENSE.txt
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- bin/console
|
29
|
+
- bin/setup
|
30
|
+
- exe/rbd
|
31
|
+
- lib/rbd.rb
|
32
|
+
- lib/rbd/cli.rb
|
33
|
+
- lib/rbd/version.rb
|
34
|
+
- rbd.gemspec
|
35
|
+
homepage: https://github.com/jeffpeterson/rbd
|
36
|
+
licenses:
|
37
|
+
- MIT
|
38
|
+
metadata:
|
39
|
+
homepage_uri: https://github.com/jeffpeterson/rbd
|
40
|
+
source_code_uri: https://github.com/jeffpeterson/rbd
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 3.0.0
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubygems_version: 3.2.3
|
57
|
+
signing_key:
|
58
|
+
specification_version: 4
|
59
|
+
summary: Better ruby development tooling.
|
60
|
+
test_files: []
|