brew_lib 0.1.1 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/brew_lib.iml +45 -1
- data/Gemfile +3 -1
- data/Gemfile.lock +107 -1
- data/README.md +13 -4
- data/Rakefile +24 -2
- data/exe/brew_lib +5 -0
- data/lib/brew_lib/version.rb +1 -1
- data/lib/brew_lib.rb +108 -1
- data/lib/post_build.rb +3 -0
- data/lib/post_install.rb +4 -0
- data/lib/post_uninstall.rb +3 -0
- data/lib/pre_install.rb +3 -0
- data/lib/pre_uninstall.rb +3 -0
- data/lib/rubygems_plugin.rb +53 -0
- metadata +220 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6f01f4e52280c9f7ef98d12dffaf5dbeffc802def42d2c5e0c48769e19d916c
|
4
|
+
data.tar.gz: e42c391a105996ec6d849517fb8c90e0f4f947c12ab159e03476a96398fbb933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e428e2fa74cb073d54b82148e7b7f83b7dd9d6aae02e3070990b6208e2e81d7b35e0894cdd49860690d49dfac02eae2942d6db7735344adc9136130db00ec4f
|
7
|
+
data.tar.gz: 148d0cf67080eb27134cfe7236481f2e3ad1ecddbbab3b6b8c76df4b8146489e5058ebac45b7664f10292845de975475c6d78934f50904a24215a142617d5bb7
|
data/.idea/brew_lib.iml
CHANGED
@@ -52,18 +52,62 @@
|
|
52
52
|
<orderEntry type="jdk" jdkName="ruby-2.6.8-p205" jdkType="RUBY_SDK" />
|
53
53
|
<orderEntry type="sourceFolder" forTests="false" />
|
54
54
|
<orderEntry type="library" name="Python 3.10 interpreter library" level="application" />
|
55
|
+
<orderEntry type="library" scope="PROVIDED" name="activesupport (v6.1.6, ruby-2.6.8-p205) [gem]" level="application" />
|
56
|
+
<orderEntry type="library" scope="PROVIDED" name="aruba (v2.0.1, ruby-2.6.8-p205) [gem]" level="application" />
|
55
57
|
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, ruby-2.6.8-p205) [gem]" level="application" />
|
56
58
|
<orderEntry type="library" scope="PROVIDED" name="awesome_print (v1.9.2, ruby-2.6.8-p205) [gem]" level="application" />
|
59
|
+
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, ruby-2.6.8-p205) [gem]" level="application" />
|
60
|
+
<orderEntry type="library" scope="PROVIDED" name="bundle (v0.0.1, ruby-2.6.8-p205) [gem]" level="application" />
|
57
61
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.13, ruby-2.6.8-p205) [gem]" level="application" />
|
62
|
+
<orderEntry type="library" scope="PROVIDED" name="childprocess (v4.1.0, ruby-2.6.8-p205) [gem]" level="application" />
|
63
|
+
<orderEntry type="library" scope="PROVIDED" name="coderay (v1.1.3, ruby-2.6.8-p205) [gem]" level="application" />
|
64
|
+
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.10, ruby-2.6.8-p205) [gem]" level="application" />
|
65
|
+
<orderEntry type="library" scope="PROVIDED" name="contracts (v0.16.1, ruby-2.6.8-p205) [gem]" level="application" />
|
66
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber (v7.1.0, ruby-2.6.8-p205) [gem]" level="application" />
|
67
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-core (v10.1.1, ruby-2.6.8-p205) [gem]" level="application" />
|
68
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-create-meta (v6.0.4, ruby-2.6.8-p205) [gem]" level="application" />
|
69
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-cucumber-expressions (v14.0.0, ruby-2.6.8-p205) [gem]" level="application" />
|
70
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-gherkin (v22.0.0, ruby-2.6.8-p205) [gem]" level="application" />
|
71
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-html-formatter (v17.0.0, ruby-2.6.8-p205) [gem]" level="application" />
|
72
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-messages (v17.1.1, ruby-2.6.8-p205) [gem]" level="application" />
|
73
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-tag-expressions (v4.1.0, ruby-2.6.8-p205) [gem]" level="application" />
|
74
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber-wire (v6.2.1, ruby-2.6.8-p205) [gem]" level="application" />
|
75
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, ruby-2.6.8-p205) [gem]" level="application" />
|
76
|
+
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.15.5, ruby-2.6.8-p205) [gem]" level="application" />
|
77
|
+
<orderEntry type="library" scope="PROVIDED" name="gem-release (v2.2.2, ruby-2.6.8-p205) [gem]" level="application" />
|
78
|
+
<orderEntry type="library" scope="PROVIDED" name="i18n (v1.10.0, ruby-2.6.8-p205) [gem]" level="application" />
|
79
|
+
<orderEntry type="library" scope="PROVIDED" name="io-console (v0.5.11, ruby-2.6.8-p205) [gem]" level="application" />
|
80
|
+
<orderEntry type="library" scope="PROVIDED" name="irb (v1.4.1, ruby-2.6.8-p205) [gem]" level="application" />
|
81
|
+
<orderEntry type="library" scope="PROVIDED" name="method_source (v1.0.0, ruby-2.6.8-p205) [gem]" level="application" />
|
82
|
+
<orderEntry type="library" scope="PROVIDED" name="mime-types (v3.4.1, ruby-2.6.8-p205) [gem]" level="application" />
|
83
|
+
<orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2022.0105, ruby-2.6.8-p205) [gem]" level="application" />
|
84
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.15.0, ruby-2.6.8-p205) [gem]" level="application" />
|
85
|
+
<orderEntry type="library" scope="PROVIDED" name="multi_test (v0.1.2, ruby-2.6.8-p205) [gem]" level="application" />
|
58
86
|
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, ruby-2.6.8-p205) [gem]" level="application" />
|
59
87
|
<orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.0, ruby-2.6.8-p205) [gem]" level="application" />
|
88
|
+
<orderEntry type="library" scope="PROVIDED" name="pry (v0.14.1, ruby-2.6.8-p205) [gem]" level="application" />
|
60
89
|
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, ruby-2.6.8-p205) [gem]" level="application" />
|
90
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-2.6.8-p205) [gem]" level="application" />
|
91
|
+
<orderEntry type="library" scope="PROVIDED" name="rb-readline (v0.5.5, ruby-2.6.8-p205) [gem]" level="application" />
|
61
92
|
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.4.0, ruby-2.6.8-p205) [gem]" level="application" />
|
93
|
+
<orderEntry type="library" scope="PROVIDED" name="reline (v0.3.1, ruby-2.6.8-p205) [gem]" level="application" />
|
62
94
|
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, ruby-2.6.8-p205) [gem]" level="application" />
|
63
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
95
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.11.0, ruby-2.6.8-p205) [gem]" level="application" />
|
96
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.11.0, ruby-2.6.8-p205) [gem]" level="application" />
|
97
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.11.0, ruby-2.6.8-p205) [gem]" level="application" />
|
98
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.11.1, ruby-2.6.8-p205) [gem]" level="application" />
|
99
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.11.0, ruby-2.6.8-p205) [gem]" level="application" />
|
100
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.29.1, ruby-2.6.8-p205) [gem]" level="application" />
|
64
101
|
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.18.0, ruby-2.6.8-p205) [gem]" level="application" />
|
102
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-minitest (v0.19.1, ruby-2.6.8-p205) [gem]" level="application" />
|
103
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-rake (v0.6.0, ruby-2.6.8-p205) [gem]" level="application" />
|
104
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v2.10.0, ruby-2.6.8-p205) [gem]" level="application" />
|
65
105
|
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, ruby-2.6.8-p205) [gem]" level="application" />
|
106
|
+
<orderEntry type="library" scope="PROVIDED" name="sys-uname (v1.2.2, ruby-2.6.8-p205) [gem]" level="application" />
|
107
|
+
<orderEntry type="library" scope="PROVIDED" name="thor (v1.2.1, ruby-2.6.8-p205) [gem]" level="application" />
|
108
|
+
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, ruby-2.6.8-p205) [gem]" level="application" />
|
66
109
|
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, ruby-2.6.8-p205) [gem]" level="application" />
|
110
|
+
<orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.4, ruby-2.6.8-p205) [gem]" level="application" />
|
67
111
|
</component>
|
68
112
|
<component name="RakeTasksCache">
|
69
113
|
<option name="myRootTask">
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,106 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
brew_lib (0.1.
|
4
|
+
brew_lib (0.1.9)
|
5
|
+
activesupport (< 7)
|
5
6
|
awesome_print
|
7
|
+
bundle
|
6
8
|
|
7
9
|
GEM
|
8
10
|
remote: https://rubygems.org/
|
9
11
|
specs:
|
12
|
+
activesupport (6.1.6)
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
minitest (>= 5.1)
|
16
|
+
tzinfo (~> 2.0)
|
17
|
+
zeitwerk (~> 2.3)
|
18
|
+
aruba (2.0.1)
|
19
|
+
bundler (>= 1.17, < 3.0)
|
20
|
+
childprocess (>= 2.0, < 5.0)
|
21
|
+
contracts (>= 0.16.0, < 0.18.0)
|
22
|
+
cucumber (>= 4.0, < 8.0)
|
23
|
+
rspec-expectations (~> 3.4)
|
24
|
+
thor (~> 1.0)
|
10
25
|
ast (2.4.2)
|
11
26
|
awesome_print (1.9.2)
|
27
|
+
builder (3.2.4)
|
28
|
+
bundle (0.0.1)
|
29
|
+
bundler
|
30
|
+
childprocess (4.1.0)
|
31
|
+
coderay (1.1.3)
|
32
|
+
concurrent-ruby (1.1.10)
|
33
|
+
contracts (0.16.1)
|
34
|
+
cucumber (7.1.0)
|
35
|
+
builder (~> 3.2, >= 3.2.4)
|
36
|
+
cucumber-core (~> 10.1, >= 10.1.0)
|
37
|
+
cucumber-create-meta (~> 6.0, >= 6.0.1)
|
38
|
+
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
|
39
|
+
cucumber-gherkin (~> 22.0, >= 22.0.0)
|
40
|
+
cucumber-html-formatter (~> 17.0, >= 17.0.0)
|
41
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
42
|
+
cucumber-wire (~> 6.2, >= 6.2.0)
|
43
|
+
diff-lcs (~> 1.4, >= 1.4.4)
|
44
|
+
mime-types (~> 3.3, >= 3.3.1)
|
45
|
+
multi_test (~> 0.1, >= 0.1.2)
|
46
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
47
|
+
cucumber-core (10.1.1)
|
48
|
+
cucumber-gherkin (~> 22.0, >= 22.0.0)
|
49
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
50
|
+
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
|
51
|
+
cucumber-create-meta (6.0.4)
|
52
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
53
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
54
|
+
cucumber-cucumber-expressions (14.0.0)
|
55
|
+
cucumber-gherkin (22.0.0)
|
56
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
57
|
+
cucumber-html-formatter (17.0.0)
|
58
|
+
cucumber-messages (~> 17.1, >= 17.1.0)
|
59
|
+
cucumber-messages (17.1.1)
|
60
|
+
cucumber-tag-expressions (4.1.0)
|
61
|
+
cucumber-wire (6.2.1)
|
62
|
+
cucumber-core (~> 10.1, >= 10.1.0)
|
63
|
+
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
|
64
|
+
diff-lcs (1.5.0)
|
65
|
+
ffi (1.15.5)
|
66
|
+
gem-release (2.2.2)
|
67
|
+
i18n (1.10.0)
|
68
|
+
concurrent-ruby (~> 1.0)
|
69
|
+
io-console (0.5.11)
|
70
|
+
irb (1.4.1)
|
71
|
+
reline (>= 0.3.0)
|
72
|
+
method_source (1.0.0)
|
73
|
+
mime-types (3.4.1)
|
74
|
+
mime-types-data (~> 3.2015)
|
75
|
+
mime-types-data (3.2022.0105)
|
12
76
|
minitest (5.15.0)
|
77
|
+
multi_test (0.1.2)
|
13
78
|
parallel (1.22.1)
|
14
79
|
parser (3.1.2.0)
|
15
80
|
ast (~> 2.4.1)
|
81
|
+
pry (0.14.1)
|
82
|
+
coderay (~> 1.1)
|
83
|
+
method_source (~> 1.0)
|
16
84
|
rainbow (3.1.1)
|
17
85
|
rake (13.0.6)
|
86
|
+
rb-readline (0.5.5)
|
18
87
|
regexp_parser (2.4.0)
|
88
|
+
reline (0.3.1)
|
89
|
+
io-console (~> 0.5)
|
19
90
|
rexml (3.2.5)
|
91
|
+
rspec (3.11.0)
|
92
|
+
rspec-core (~> 3.11.0)
|
93
|
+
rspec-expectations (~> 3.11.0)
|
94
|
+
rspec-mocks (~> 3.11.0)
|
95
|
+
rspec-core (3.11.0)
|
96
|
+
rspec-support (~> 3.11.0)
|
97
|
+
rspec-expectations (3.11.0)
|
98
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
+
rspec-support (~> 3.11.0)
|
100
|
+
rspec-mocks (3.11.1)
|
101
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
102
|
+
rspec-support (~> 3.11.0)
|
103
|
+
rspec-support (3.11.0)
|
20
104
|
rubocop (1.29.1)
|
21
105
|
parallel (~> 1.10)
|
22
106
|
parser (>= 3.1.0.0)
|
@@ -28,17 +112,39 @@ GEM
|
|
28
112
|
unicode-display_width (>= 1.4.0, < 3.0)
|
29
113
|
rubocop-ast (1.18.0)
|
30
114
|
parser (>= 3.1.1.0)
|
115
|
+
rubocop-minitest (0.19.1)
|
116
|
+
rubocop (>= 0.90, < 2.0)
|
117
|
+
rubocop-rake (0.6.0)
|
118
|
+
rubocop (~> 1.0)
|
119
|
+
rubocop-rspec (2.10.0)
|
120
|
+
rubocop (~> 1.19)
|
31
121
|
ruby-progressbar (1.11.0)
|
122
|
+
sys-uname (1.2.2)
|
123
|
+
ffi (~> 1.1)
|
124
|
+
thor (1.2.1)
|
125
|
+
tzinfo (2.0.4)
|
126
|
+
concurrent-ruby (~> 1.0)
|
32
127
|
unicode-display_width (2.1.0)
|
128
|
+
zeitwerk (2.5.4)
|
33
129
|
|
34
130
|
PLATFORMS
|
35
131
|
universal-darwin-21
|
36
132
|
|
37
133
|
DEPENDENCIES
|
134
|
+
aruba
|
38
135
|
brew_lib!
|
136
|
+
cucumber
|
137
|
+
gem-release
|
138
|
+
irb
|
39
139
|
minitest (~> 5.0)
|
140
|
+
pry
|
40
141
|
rake (~> 13.0)
|
142
|
+
rb-readline
|
143
|
+
rspec
|
41
144
|
rubocop
|
145
|
+
rubocop-minitest
|
146
|
+
rubocop-rake
|
147
|
+
rubocop-rspec
|
42
148
|
|
43
149
|
BUNDLED WITH
|
44
150
|
2.3.13
|
data/README.md
CHANGED
@@ -23,13 +23,20 @@ TODO: Write usage instructions here
|
|
23
23
|
|
24
24
|
## Development
|
25
25
|
|
26
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
26
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
27
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
27
28
|
|
28
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
30
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
|
31
|
+
which will create a git tag for the version, push git commits and the created tag,
|
32
|
+
and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
29
33
|
|
30
34
|
## Contributing
|
31
35
|
|
32
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/brew_lib.
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/brew_lib.
|
37
|
+
This project is intended to be a safe, welcoming space for collaboration,
|
38
|
+
and contributors are expected to adhere
|
39
|
+
to the [code of conduct](https://github.com/[USERNAME]/brew_lib/blob/main/CODE_OF_CONDUCT.md).
|
33
40
|
|
34
41
|
## License
|
35
42
|
|
@@ -37,4 +44,6 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
37
44
|
|
38
45
|
## Code of Conduct
|
39
46
|
|
40
|
-
Everyone
|
47
|
+
Everyone interacts in the brew_lib project's codebases, issue trackers,
|
48
|
+
chat rooms and mailing lists is expected
|
49
|
+
to follow the [code of conduct](https://github.com/[USERNAME]/brew_lib/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rake/testtask"
|
5
|
+
require "rubocop/rake_task"
|
6
|
+
require_relative "lib/brew_lib"
|
7
|
+
|
5
8
|
|
6
9
|
Rake::TestTask.new(:test) do |t|
|
7
10
|
t.libs << "test"
|
@@ -9,8 +12,27 @@ Rake::TestTask.new(:test) do |t|
|
|
9
12
|
t.test_files = FileList["test/**/test_*.rb"]
|
10
13
|
end
|
11
14
|
|
12
|
-
require "rubocop/rake_task"
|
13
|
-
|
14
15
|
RuboCop::RakeTask.new
|
15
16
|
|
17
|
+
def version
|
18
|
+
`git describe --tags --abbrev=0`.chomp
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "Create a new release and push [patch|minor|major], default is patch"
|
22
|
+
task bump: [:test] do |_, args|
|
23
|
+
part = args.to_a.fetch(0, "patch")
|
24
|
+
sh "{ git add -A && git commit --quiet -m 'bump #{part}' >/dev/null &&
|
25
|
+
gem bump --silent --quiet --tag --push --release && gh release create #{version} --generate-notes; } || true"
|
26
|
+
end
|
27
|
+
|
16
28
|
task default: %i[test rubocop]
|
29
|
+
|
30
|
+
desc "Show tasks in current Rakefile, to see descriptions rake -T or rake -D"
|
31
|
+
task :tasks do
|
32
|
+
sh "rake", "--tasks"
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Install new version of gem after publish to rubygems"
|
36
|
+
task :instal do
|
37
|
+
sh "rake", "--tasks"
|
38
|
+
end
|
data/exe/brew_lib
CHANGED
data/lib/brew_lib/version.rb
CHANGED
data/lib/brew_lib.rb
CHANGED
@@ -1,9 +1,116 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/core_ext/string'
|
4
|
+
require "optparse"
|
5
|
+
require "ostruct"
|
6
|
+
|
3
7
|
require_relative "brew_lib/version"
|
4
8
|
|
5
9
|
module BrewLib
|
6
10
|
class Error < StandardError; end
|
11
|
+
|
12
|
+
def self.pre_install
|
13
|
+
# noinspection RubyNilAnalysis
|
14
|
+
puts "Running #{__method__} => #{BrewLib.name.underscore} (#{BrewLib::VERSION})"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.pre_uninstall
|
18
|
+
# noinspection RubyNilAnalysis
|
19
|
+
puts "Running #{__method__} => #{BrewLib.name.underscore} (#{BrewLib::VERSION})"
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.post_build
|
23
|
+
# noinspection RubyNilAnalysis
|
24
|
+
puts "Running #{__method__} => #{BrewLib.name.underscore} (#{BrewLib::VERSION})"
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.post_install
|
28
|
+
# noinspection RubyNilAnalysis
|
29
|
+
puts "Running #{__method__} => #{BrewLib.name.underscore} (#{BrewLib::VERSION})"
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.post_uninstall
|
33
|
+
# noinspection RubyNilAnalysis
|
34
|
+
puts "Running #{__method__} => #{BrewLib.name.underscore} (#{BrewLib::VERSION})"
|
35
|
+
end
|
36
|
+
|
37
|
+
class CLI
|
38
|
+
def initialize(argv = ARGV)
|
39
|
+
exception_handling do
|
40
|
+
options_set_default
|
41
|
+
OptionParser.new do |opts|
|
42
|
+
# noinspection RubyNilAnalysis
|
43
|
+
opts.banner = "#{BrewLib.name.underscore} {options}"
|
44
|
+
opts.separator ""
|
45
|
+
opts.separator "Options are ..."
|
46
|
+
|
47
|
+
opts.on_tail("-h", "--help", "-H", "Display this help message.") do
|
48
|
+
puts opts
|
49
|
+
exit
|
50
|
+
end
|
51
|
+
|
52
|
+
options_spec.each { |args| opts.on(*args) }
|
53
|
+
end.parse(argv)
|
54
|
+
end
|
55
|
+
BrewLib.post if options.post
|
56
|
+
end
|
57
|
+
|
58
|
+
# A list of all the standard options used in rake, suitable for
|
59
|
+
# passing to OptionParser.
|
60
|
+
def options_spec # :nodoc:
|
61
|
+
[
|
62
|
+
["--post", "-p",
|
63
|
+
"Post install " ,
|
64
|
+
lambda { |_| options.post = true }
|
65
|
+
],
|
66
|
+
["--silent", "-s",
|
67
|
+
"Like --quiet, but also suppresses the " +
|
68
|
+
"'in directory' announcement.",
|
69
|
+
lambda { |_| options.silent = true }
|
70
|
+
],
|
71
|
+
["--verbose", "-v",
|
72
|
+
"Log message to standard output.",
|
73
|
+
lambda { |_| options.verbose = true }
|
74
|
+
],
|
75
|
+
["--version", "-V",
|
76
|
+
"Display the program version.",
|
77
|
+
lambda { |_|
|
78
|
+
puts BrewLib::VERSION
|
79
|
+
exit
|
80
|
+
}
|
81
|
+
],
|
82
|
+
]
|
83
|
+
end
|
84
|
+
|
85
|
+
# Application options from the command line
|
86
|
+
def options
|
87
|
+
@options ||= OpenStruct.new
|
88
|
+
end
|
89
|
+
|
90
|
+
# set default values for options
|
91
|
+
def options_set_default
|
92
|
+
options.post = false
|
93
|
+
options.silent = false
|
94
|
+
options.verbose = false
|
95
|
+
end
|
96
|
+
|
97
|
+
# Provide standard exception handling for the given block.
|
98
|
+
def exception_handling # :nodoc:
|
99
|
+
yield
|
100
|
+
rescue SystemExit
|
101
|
+
# Exit silently with current status
|
102
|
+
raise
|
103
|
+
rescue OptionParser::InvalidOption => ex
|
104
|
+
$stderr.puts ex.message
|
105
|
+
exit(false)
|
106
|
+
rescue Exception => ex
|
107
|
+
# Exit with error message
|
108
|
+
puts ex
|
109
|
+
puts ex.backtrace unless ex.backtrace.nil?
|
110
|
+
puts ex.cause unless ex.cause.nil?
|
111
|
+
puts ex.chain unless ex.chain.nil?
|
112
|
+
exit(false)
|
113
|
+
end
|
114
|
+
end
|
7
115
|
# Your code goes here...
|
8
|
-
puts VERSION
|
9
116
|
end
|
data/lib/post_build.rb
ADDED
data/lib/post_install.rb
ADDED
data/lib/pre_install.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# https://guides.rubygems.org/plugins/
|
4
|
+
|
5
|
+
require "pathname"
|
6
|
+
def run(action, installer)
|
7
|
+
path = Pathname.new(installer.spec.lib_dirs_glob) / "#{action}.rb"
|
8
|
+
if path.exist?
|
9
|
+
delete = false
|
10
|
+
unless $LOAD_PATH.include?(installer.spec.lib_dirs_glob)
|
11
|
+
$LOAD_PATH.unshift installer.spec.lib_dirs_glob
|
12
|
+
delete = true
|
13
|
+
end
|
14
|
+
#noinspection RubyResolve
|
15
|
+
require action
|
16
|
+
if delete
|
17
|
+
$LOAD_PATH.delete installer.spec.lib_dirs_glob
|
18
|
+
end
|
19
|
+
true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def msg(action, installer)
|
24
|
+
puts "Finished: plugin: #{action} => #{installer.spec.name} (#{installer.spec.version})"
|
25
|
+
end
|
26
|
+
|
27
|
+
Gem.pre_install do |installer|
|
28
|
+
run "pre_install", installer
|
29
|
+
end
|
30
|
+
|
31
|
+
Gem.pre_uninstall do |installer|
|
32
|
+
run "pre_uninstall", installer
|
33
|
+
end
|
34
|
+
|
35
|
+
Gem.post_build do |installer|
|
36
|
+
run "post_build", installer
|
37
|
+
end
|
38
|
+
|
39
|
+
Gem.post_install do |installer|
|
40
|
+
run "post_install", installer
|
41
|
+
end
|
42
|
+
|
43
|
+
Gem.post_uninstall do |installer|
|
44
|
+
run "post_uninstall", installer
|
45
|
+
end
|
46
|
+
|
47
|
+
# TODO: el caller o que solo se haga una vez
|
48
|
+
=begin
|
49
|
+
bundle clean --force
|
50
|
+
gem uninstall --ignore-dependencies --all -x
|
51
|
+
gem install bundle
|
52
|
+
bundle install
|
53
|
+
=end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brew_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- root
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "<"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '7'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: awesome_print
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,7 +38,203 @@ dependencies:
|
|
24
38
|
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '0'
|
27
|
-
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundle
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aruba
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: cucumber
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: gem-release
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: irb
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pry
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rb-readline
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rspec
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rubocop
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: rubocop-minitest
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rubocop-rake
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: rubocop-rspec
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
description: BrewLib
|
28
238
|
email:
|
29
239
|
- root@example.com
|
30
240
|
executables:
|
@@ -57,6 +267,12 @@ files:
|
|
57
267
|
- exe/brew_lib
|
58
268
|
- lib/brew_lib.rb
|
59
269
|
- lib/brew_lib/version.rb
|
270
|
+
- lib/post_build.rb
|
271
|
+
- lib/post_install.rb
|
272
|
+
- lib/post_uninstall.rb
|
273
|
+
- lib/pre_install.rb
|
274
|
+
- lib/pre_uninstall.rb
|
275
|
+
- lib/rubygems_plugin.rb
|
60
276
|
- sig/brew_lib.rbs
|
61
277
|
homepage: https://github.com/j5pu/brew_lib
|
62
278
|
licenses:
|
@@ -82,5 +298,5 @@ requirements: []
|
|
82
298
|
rubygems_version: 3.0.3.1
|
83
299
|
signing_key:
|
84
300
|
specification_version: 4
|
85
|
-
summary:
|
301
|
+
summary: BrewLib
|
86
302
|
test_files: []
|