bolo 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/.circleci/config.yml +68 -0
- data/.gitignore +17 -0
- data/.rspec +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Dockerfile +21 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +60 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bolo.gemspec +29 -0
- data/docker-compose.yml +8 -0
- data/lib/bolo/core_ext/array.rb +28 -0
- data/lib/bolo/core_ext/enumerable.rb +5 -0
- data/lib/bolo/core_ext/object.rb +13 -0
- data/lib/bolo/core_ext/string.rb +5 -0
- data/lib/bolo/version.rb +3 -0
- data/lib/bolo.rb +14 -0
- data/qs +208 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8ccce5b3bb938fd56bc3ce7a4d15b1df25ed1fb88911a1d73d7dede2c2c06f9d
|
4
|
+
data.tar.gz: 17c2fdb896c66f922cc8d5bac8c182dc24d8f5f32d0dbc65149a6686c9bc907a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c1f8222deefb79b6edb099255461c6f1f08d69c57bc855549ad5b314ddd4fd0708c6918c44c1135d133790f38c9c63c950eac6b0f859624bbe631fdfdc0f62f9
|
7
|
+
data.tar.gz: 7b1024a7c771707a81abd4be560ac005a7f30ebca16bf6f691f820e509906fb3ed55d8ca73554d68b525b4d2a09a27f6f7e665b0e76707bbdddc4c90ff6fa84e
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/ruby:2.6.3
|
11
|
+
|
12
|
+
# Specify service dependencies here if necessary
|
13
|
+
# CircleCI maintains a library of pre-built images
|
14
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
+
# - image: circleci/postgres:9.4
|
16
|
+
|
17
|
+
working_directory: ~/repo
|
18
|
+
|
19
|
+
branches:
|
20
|
+
only:
|
21
|
+
- master
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- checkout
|
25
|
+
|
26
|
+
# Download and cache dependencies
|
27
|
+
- restore_cache:
|
28
|
+
keys:
|
29
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
30
|
+
# fallback to using the latest cache if no exact match is found
|
31
|
+
- v1-dependencies-
|
32
|
+
|
33
|
+
- run:
|
34
|
+
name: install dependencies
|
35
|
+
command: |
|
36
|
+
gem install bundler:2.0.1
|
37
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
38
|
+
|
39
|
+
- save_cache:
|
40
|
+
paths:
|
41
|
+
- ./vendor/bundle
|
42
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
43
|
+
|
44
|
+
# Database setup
|
45
|
+
# - run: bundle exec rake db:create
|
46
|
+
# - run: bundle exec rake db:schema:load
|
47
|
+
|
48
|
+
# run tests!
|
49
|
+
- run:
|
50
|
+
name: run tests
|
51
|
+
command: |
|
52
|
+
mkdir /tmp/test-results
|
53
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
|
54
|
+
circleci tests split --split-by=timings)"
|
55
|
+
|
56
|
+
bundle exec rspec \
|
57
|
+
--format progress \
|
58
|
+
--format RspecJunitFormatter \
|
59
|
+
--out /tmp/test-results/rspec.xml \
|
60
|
+
--format progress \
|
61
|
+
$TEST_FILES
|
62
|
+
|
63
|
+
# collect reports
|
64
|
+
- store_test_results:
|
65
|
+
path: /tmp/test-results
|
66
|
+
- store_artifacts:
|
67
|
+
path: /tmp/test-results
|
68
|
+
destination: test-results
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at belion.freee@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# use ruby version 2.6.3
|
2
|
+
FROM ruby:2.6.3
|
3
|
+
|
4
|
+
# using japanese on rails console
|
5
|
+
ENV LANG C.UTF-8
|
6
|
+
|
7
|
+
# remove warn
|
8
|
+
ENV DEBCONF_NOWARNINGS yes
|
9
|
+
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE yes
|
10
|
+
ENV XDG_CACHE_HOME /tmp
|
11
|
+
EXPOSE 3000
|
12
|
+
|
13
|
+
# install package to docker container
|
14
|
+
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
|
15
|
+
|
16
|
+
# setting work directory
|
17
|
+
RUN mkdir /bolo
|
18
|
+
WORKDIR /bolo
|
19
|
+
COPY . /bolo
|
20
|
+
|
21
|
+
RUN gem install bundler && bundle install
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 belion-freee
|
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,60 @@
|
|
1
|
+
[![CircleCI](https://circleci.com/gh/belion-freee/bolo.svg?style=svg)](https://circleci.com/gh/belion-freee/bolo)
|
2
|
+
|
3
|
+
# Bolo
|
4
|
+
|
5
|
+
This is a gem that will provide you to extend function of Ruby class.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'bolo'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install bolo
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Show you some extensions.
|
26
|
+
If you want to see all the extensions, see [spec](https://github.com/belion-freee/bolo/blob/master/spec/bolo_spec.rb).
|
27
|
+
|
28
|
+
### maps(Enumerable)
|
29
|
+
An extension of map. You can pass a second argument as an array.
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
["hoge", "foo"].maps(:+, 's') # => ["hoges", "foos"]
|
33
|
+
[{ hoge: "hoge1", foo: "foo1" }, { hoge: "hoge2", foo: "foo2" }].maps(:[], :hoge) # => ["hoge1", "hoge2"]
|
34
|
+
```
|
35
|
+
|
36
|
+
### integer?
|
37
|
+
Numeric judgment can be made with character strings.
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
"100".integer? # => true
|
41
|
+
"hoge".integer? # => false
|
42
|
+
```
|
43
|
+
|
44
|
+
## Development
|
45
|
+
|
46
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
47
|
+
|
48
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bolo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
53
|
+
|
54
|
+
## License
|
55
|
+
|
56
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
57
|
+
|
58
|
+
## Code of Conduct
|
59
|
+
|
60
|
+
Everyone interacting in the Bolo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/bolo/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "bolo"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/bolo.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "bolo/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "bolo"
|
7
|
+
spec.version = Bolo::VERSION
|
8
|
+
spec.authors = ["belion-freee"]
|
9
|
+
spec.email = ["belion.freee@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Extends Ruby class}
|
12
|
+
spec.description = %q{This is a gem that will provide you to extend function of Ruby class.}
|
13
|
+
spec.homepage = "https://github.com/belion-freee/bolo"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
+
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4"
|
29
|
+
end
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
class Array
|
2
|
+
def merge
|
3
|
+
case first
|
4
|
+
when Array
|
5
|
+
to_h
|
6
|
+
when Hash
|
7
|
+
inject(:merge)
|
8
|
+
else
|
9
|
+
Hash[*self]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def uniqs
|
14
|
+
group_by{|i| i }.select{|_, v| v.one? }.keys
|
15
|
+
end
|
16
|
+
|
17
|
+
def ununiqs
|
18
|
+
group_by{|i| i }.reject{|_, v| v.one? }.keys
|
19
|
+
end
|
20
|
+
|
21
|
+
def uniq?
|
22
|
+
(count - uniq.count).zero?
|
23
|
+
end
|
24
|
+
|
25
|
+
def ziph(*arr)
|
26
|
+
[self, arr].transpose.to_h
|
27
|
+
end
|
28
|
+
end
|
data/lib/bolo/version.rb
ADDED
data/lib/bolo.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# require bolo/*rb
|
2
|
+
Dir["#{File.dirname(__FILE__)}/bolo/*.rb"].each do |path|
|
3
|
+
next if File.basename(path, '.rb') == 'core_ext'
|
4
|
+
require "bolo/#{File.basename(path, '.rb')}"
|
5
|
+
end
|
6
|
+
|
7
|
+
# require bolo/core_ext/*rb
|
8
|
+
Dir["#{File.dirname(__FILE__)}/bolo/core_ext/*.rb"].each do |path|
|
9
|
+
require "bolo/core_ext/#{File.basename(path, '.rb')}"
|
10
|
+
end
|
11
|
+
|
12
|
+
module Bolo
|
13
|
+
class BoloError < StandardError; end
|
14
|
+
end
|
data/qs
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
dc=$(which docker-compose) # docker-compose command with full path
|
4
|
+
|
5
|
+
if [[ -x "$dc" ]]; then
|
6
|
+
:
|
7
|
+
else
|
8
|
+
echo "Please install Docker before run this command."
|
9
|
+
exit 2
|
10
|
+
fi
|
11
|
+
|
12
|
+
rm="--rm" # To destroy a container
|
13
|
+
|
14
|
+
app="app" # describe $application service name from docker-compose.yml
|
15
|
+
|
16
|
+
app_name=`pwd | awk -F "/" '{ print $NF }'` # get project dir name
|
17
|
+
|
18
|
+
# define container name
|
19
|
+
app_container="${app_name}_${app}_1"
|
20
|
+
|
21
|
+
echoing() {
|
22
|
+
echo "========================================================"
|
23
|
+
echo "$1"
|
24
|
+
echo "========================================================"
|
25
|
+
}
|
26
|
+
|
27
|
+
compose_init() {
|
28
|
+
echoing "Building containers"
|
29
|
+
dir="app"
|
30
|
+
is_gem=false
|
31
|
+
|
32
|
+
arg=$1
|
33
|
+
|
34
|
+
if [[ $arg =~ --gem= ]]; then
|
35
|
+
echo "options $arg"
|
36
|
+
dir=${arg/--gem=/}
|
37
|
+
is_gem=true
|
38
|
+
fi
|
39
|
+
|
40
|
+
echo "dir is setting by $dir"
|
41
|
+
echo "is_gem is setting by $is_gem"
|
42
|
+
|
43
|
+
sed -i -e s/belion/$dir/g docker-compose.yml
|
44
|
+
rm docker-compose.yml-e
|
45
|
+
sed -i -e s/belion/$dir/g Dockerfile
|
46
|
+
rm Dockerfile-e
|
47
|
+
|
48
|
+
$dc build --no-cache
|
49
|
+
|
50
|
+
if "${is_gem}"; then
|
51
|
+
bundle_cmd gem . -t --coc --mit
|
52
|
+
fi
|
53
|
+
}
|
54
|
+
|
55
|
+
compose_up() {
|
56
|
+
echoing "Create and start containers $*"
|
57
|
+
$dc up -d "$1"
|
58
|
+
}
|
59
|
+
|
60
|
+
compose_down() {
|
61
|
+
echoing "Stop and remove containers $*"
|
62
|
+
$dc down $*
|
63
|
+
}
|
64
|
+
|
65
|
+
compose_build() {
|
66
|
+
echoing "Build containers $*"
|
67
|
+
$dc build $*
|
68
|
+
}
|
69
|
+
|
70
|
+
compose_start() {
|
71
|
+
echoing "Start services $*"
|
72
|
+
$dc start $*
|
73
|
+
}
|
74
|
+
|
75
|
+
compose_stop() {
|
76
|
+
echoing "Stop services $*"
|
77
|
+
$dc stop $*
|
78
|
+
}
|
79
|
+
|
80
|
+
compose_restart() {
|
81
|
+
echoing "Restart services $*"
|
82
|
+
$dc restart $*
|
83
|
+
}
|
84
|
+
|
85
|
+
compose_ps() {
|
86
|
+
echoing "Showing running containers"
|
87
|
+
$dc ps
|
88
|
+
}
|
89
|
+
|
90
|
+
logs() {
|
91
|
+
echoing "Logs $*"
|
92
|
+
$dc logs -f $1
|
93
|
+
}
|
94
|
+
|
95
|
+
invoke_bash() {
|
96
|
+
$dc run $rm -u root $1 bash
|
97
|
+
}
|
98
|
+
|
99
|
+
invoke_run() {
|
100
|
+
$dc run $rm $*
|
101
|
+
}
|
102
|
+
|
103
|
+
run_app() {
|
104
|
+
invoke_run $app $*
|
105
|
+
}
|
106
|
+
|
107
|
+
ruby_cmd() {
|
108
|
+
bundle_exec ruby $*
|
109
|
+
}
|
110
|
+
|
111
|
+
rake_cmd() {
|
112
|
+
bundle_exec rake $*
|
113
|
+
}
|
114
|
+
|
115
|
+
rspec_cmd() {
|
116
|
+
bundle_exec rspec $*
|
117
|
+
}
|
118
|
+
|
119
|
+
bundle_cmd() {
|
120
|
+
run_app bundle $*
|
121
|
+
}
|
122
|
+
|
123
|
+
bundle_exec() {
|
124
|
+
run_app bundle exec $*
|
125
|
+
}
|
126
|
+
|
127
|
+
rubocop_cmd() {
|
128
|
+
bundle_exec rubocop $*
|
129
|
+
}
|
130
|
+
|
131
|
+
cmd=$1
|
132
|
+
shift
|
133
|
+
case "$cmd" in
|
134
|
+
init)
|
135
|
+
compose_init $* && exit 0
|
136
|
+
;;
|
137
|
+
ps)
|
138
|
+
compose_ps && exit 0
|
139
|
+
;;
|
140
|
+
up)
|
141
|
+
compose_up $* && compose_ps && exit 0
|
142
|
+
;;
|
143
|
+
build)
|
144
|
+
compose_build $* && exit 0
|
145
|
+
;;
|
146
|
+
start)
|
147
|
+
compose_start $* && exit 0
|
148
|
+
;;
|
149
|
+
stop)
|
150
|
+
compose_stop $* && exit 0
|
151
|
+
;;
|
152
|
+
restart)
|
153
|
+
compose_restart $* && exit 0
|
154
|
+
;;
|
155
|
+
down)
|
156
|
+
compose_down $* && exit 0
|
157
|
+
;;
|
158
|
+
logs)
|
159
|
+
logs $*
|
160
|
+
;;
|
161
|
+
bash)
|
162
|
+
invoke_bash $*
|
163
|
+
;;
|
164
|
+
run)
|
165
|
+
invoke_run $*
|
166
|
+
;;
|
167
|
+
ruby)
|
168
|
+
ruby_cmd $*
|
169
|
+
;;
|
170
|
+
rake)
|
171
|
+
rake_cmd $*
|
172
|
+
;;
|
173
|
+
rspec)
|
174
|
+
rspec_cmd $*
|
175
|
+
;;
|
176
|
+
bundle)
|
177
|
+
bundle_cmd $*
|
178
|
+
;;
|
179
|
+
rubocop)
|
180
|
+
rubocop_cmd $*
|
181
|
+
;;
|
182
|
+
*)
|
183
|
+
read -d '' help <<-EOF
|
184
|
+
Usage: $0 command
|
185
|
+
|
186
|
+
Service:
|
187
|
+
setup Create new rails application
|
188
|
+
init Initialize backend services then run
|
189
|
+
ps Show status of services
|
190
|
+
up Create service containers and start backend services
|
191
|
+
down Stop backend services and remove service containers
|
192
|
+
start Start services
|
193
|
+
stop Stop services
|
194
|
+
logs [options] default: none. View output from containers
|
195
|
+
bash [service] invoke bash
|
196
|
+
run [service] [command] run command in given container
|
197
|
+
|
198
|
+
App:
|
199
|
+
ruby [args] Run ruby command in application container
|
200
|
+
rake [args] Run rake command in application container
|
201
|
+
rspec [args] Run rspec command in application container
|
202
|
+
bundle [args] Run bundle command in application container
|
203
|
+
rubocop [args] Run rubocop
|
204
|
+
EOF
|
205
|
+
echo "$help"
|
206
|
+
exit 2
|
207
|
+
;;
|
208
|
+
esac
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bolo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- belion-freee
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.4'
|
69
|
+
description: This is a gem that will provide you to extend function of Ruby class.
|
70
|
+
email:
|
71
|
+
- belion.freee@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".circleci/config.yml"
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- CODE_OF_CONDUCT.md
|
80
|
+
- Dockerfile
|
81
|
+
- Gemfile
|
82
|
+
- LICENSE.txt
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- bin/console
|
86
|
+
- bin/setup
|
87
|
+
- bolo.gemspec
|
88
|
+
- docker-compose.yml
|
89
|
+
- lib/bolo.rb
|
90
|
+
- lib/bolo/core_ext/array.rb
|
91
|
+
- lib/bolo/core_ext/enumerable.rb
|
92
|
+
- lib/bolo/core_ext/object.rb
|
93
|
+
- lib/bolo/core_ext/string.rb
|
94
|
+
- lib/bolo/version.rb
|
95
|
+
- qs
|
96
|
+
homepage: https://github.com/belion-freee/bolo
|
97
|
+
licenses:
|
98
|
+
- MIT
|
99
|
+
metadata: {}
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 2.7.3
|
117
|
+
signing_key:
|
118
|
+
specification_version: 4
|
119
|
+
summary: Extends Ruby class
|
120
|
+
test_files: []
|