raketary 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/CHANGELOG.md +19 -0
- data/Gemfile +25 -0
- data/Gemfile.lock +25 -0
- data/LICENSE.txt +165 -0
- data/README.md +128 -0
- data/Rakefile +31 -0
- data/bin/raketary +28 -0
- data/lib/raketary.rb +48 -0
- data/lib/raketary/app.rb +85 -0
- data/lib/raketary/app_bump.rb +129 -0
- data/lib/raketary/app_irb.rb +54 -0
- data/lib/raketary/app_nokogiri.rb +81 -0
- data/lib/raketary/app_run.rb +58 -0
- data/lib/raketary/cmd.rb +103 -0
- data/lib/raketary/errors.rb +38 -0
- data/lib/raketary/sub_cmd.rb +38 -0
- data/lib/raketary/version.rb +26 -0
- data/raketary.gemspec +64 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f7f04941d17363acc2c135112a32dad0bd3bd08a91816fa19549872ee45c7126
|
4
|
+
data.tar.gz: c6ae793c0862763e176c8e50cc31c4f81d655466724eb8526fc32241ec088881
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a2d92c730b9386e57297247f65b6126ff7f6a49688d563f27bc6d563f709197e1d526b65f268efd763d77d3a3422eea23a5de840cfb50f755390617f9c04fa17
|
7
|
+
data.tar.gz: 5b73f78649614e97fbc094f2201a70e64d1a4e4f2fc96c3e9d0ecc18d97812679226219c7e07fd6dedfc0cd02bf9b93f19bed56cfed1222fca4f948eef746a32
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Changelog | Raketary
|
2
|
+
|
3
|
+
Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
4
|
+
|
5
|
+
## [[Unreleased]](https://github.com/esotericpig/raketary/compare/v0.1.0...master)
|
6
|
+
|
7
|
+
## [v0.1.0] - 2019-xx-xx
|
8
|
+
### Added
|
9
|
+
- .gitignore
|
10
|
+
- CHANGELOG.md
|
11
|
+
- Gemfile
|
12
|
+
- Gemfile.lock
|
13
|
+
- LICENSE.txt
|
14
|
+
- Rakefile
|
15
|
+
- raketary.gemspec
|
16
|
+
- README.md
|
17
|
+
- bin/raketary
|
18
|
+
- lib/raketary.rb
|
19
|
+
- lib/raketary/version.rb
|
data/Gemfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#--
|
5
|
+
# This file is part of Raketary.
|
6
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
7
|
+
#
|
8
|
+
# Raketary is free software: you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# Raketary is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU Lesser General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU Lesser General Public License
|
19
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#++
|
21
|
+
|
22
|
+
|
23
|
+
source 'https://rubygems.org'
|
24
|
+
|
25
|
+
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
raketary (0.1.0)
|
5
|
+
irb (~> 1.0)
|
6
|
+
rake (~> 12.3)
|
7
|
+
raketeer (~> 0.2)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
irb (1.0.0)
|
13
|
+
rake (12.3.3)
|
14
|
+
raketeer (0.2.6)
|
15
|
+
rake
|
16
|
+
|
17
|
+
PLATFORMS
|
18
|
+
ruby
|
19
|
+
|
20
|
+
DEPENDENCIES
|
21
|
+
bundler (~> 2.0)
|
22
|
+
raketary!
|
23
|
+
|
24
|
+
BUNDLED WITH
|
25
|
+
2.0.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/README.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
# Raketary
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/raketary.svg)](https://badge.fury.io/rb/raketary)
|
4
|
+
|
5
|
+
[![Source Code](https://img.shields.io/badge/source-github-%23A0522D.svg?style=for-the-badge)](https://github.com/esotericpig/raketary)
|
6
|
+
[![Changelog](https://img.shields.io/badge/changelog-md-%23A0522D.svg?style=for-the-badge)](CHANGELOG.md)
|
7
|
+
[![License](https://img.shields.io/github/license/esotericpig/raketary.svg?color=%23A0522D&style=for-the-badge)](LICENSE.txt)
|
8
|
+
|
9
|
+
CLI for [Raketeer](https://github.com/esotericpig/raketeer).
|
10
|
+
|
11
|
+
## Contents
|
12
|
+
|
13
|
+
- [Install](#install)
|
14
|
+
- [Using](#using)
|
15
|
+
- [Hacking](#hacking)
|
16
|
+
- [License](#license)
|
17
|
+
|
18
|
+
## [Install](#contents)
|
19
|
+
|
20
|
+
Pick your poison...
|
21
|
+
|
22
|
+
With the RubyGems CLI package manager:
|
23
|
+
|
24
|
+
`$ gem install raketary`
|
25
|
+
|
26
|
+
Manually:
|
27
|
+
|
28
|
+
```
|
29
|
+
$ git clone 'https://github.com/esotericpig/raketary.git'
|
30
|
+
$ cd raketary
|
31
|
+
$ bundle install
|
32
|
+
$ bundle exec rake install:local
|
33
|
+
```
|
34
|
+
|
35
|
+
## [Using](#contents)
|
36
|
+
|
37
|
+
**TODO:** flesh out Using section
|
38
|
+
|
39
|
+
```
|
40
|
+
$ raketary
|
41
|
+
Usage: raketary [options] [command] [options]...
|
42
|
+
|
43
|
+
Commands:
|
44
|
+
bump Bump your project's version
|
45
|
+
irb Open an irb session loaded with your library
|
46
|
+
nokogiri Install Nokogiri libs
|
47
|
+
run Run your project's main file: raketary run -- --version
|
48
|
+
|
49
|
+
Options:
|
50
|
+
-h, --help show this help
|
51
|
+
-v, --version show the version of raketary
|
52
|
+
```
|
53
|
+
|
54
|
+
**Bump**
|
55
|
+
|
56
|
+
```
|
57
|
+
$ raketary bump
|
58
|
+
...
|
59
|
+
[bump] Options:
|
60
|
+
-n, --dry-run do a dry run (do NOT write to files)
|
61
|
+
-s, --strict enforce semantic versioning (i.e., \d+\.\d+\.\d+.*)
|
62
|
+
|
63
|
+
-v, --ver [STR] show/set the version (e.g.: '1.2.3-alpha.4+beta.5') (default: show)
|
64
|
+
-m, --major [INT,STR] bump/set the major number (e.g.: +2, 4) (default: +1)
|
65
|
+
-i, --minor [INT,STR] bump/set the minor number (e.g.: +2, 4) (default: +1)
|
66
|
+
-p, --patch [INT,STR] bump/set the patch number (e.g.: +2, 4) (default: +1)
|
67
|
+
-r, --pre [STR] set/erase the pre-release extension (e.g.: 'alpha.4') (default: erase)
|
68
|
+
-b, --build [STR] set/erase the the build metadata (e.g.: 'beta.5') (default: erase)
|
69
|
+
-u, --bundle bump the Gemfile.lock version
|
70
|
+
|
71
|
+
-h, --help show this help
|
72
|
+
-x, --example show some examples
|
73
|
+
```
|
74
|
+
|
75
|
+
```
|
76
|
+
$ raketary bump -x
|
77
|
+
raketary bump -v # Show the current version
|
78
|
+
raketary bump -n # Do a dry run for any task (will NOT write to files)
|
79
|
+
|
80
|
+
raketary bump -v '1.2.3-alpha.4-beta.5' # Set the version manually
|
81
|
+
raketary bump -m 1 -i 2 -p 3 # Set the version numbers
|
82
|
+
raketary bump -r 'alpha.4' -b 'beta.5' # Set the version extensions
|
83
|
+
raketary bump -m -i -p # Bump the version numbers by 1
|
84
|
+
raketary bump -m +2 -i +3 -p +4 # Bump the version numbers by X
|
85
|
+
|
86
|
+
raketary bump -m # Bump the major number by 1
|
87
|
+
raketary bump -m 1 # Set the major number to 1
|
88
|
+
raketary bump -m +2 # Bump the major number by 2
|
89
|
+
raketary bump -i # Bump the minor number by 1
|
90
|
+
raketary bump -i 2 # Set the minor number to 2
|
91
|
+
raketary bump -i +3 # Bump the minor number by 3
|
92
|
+
raketary bump -p # Bump the patch number by 1
|
93
|
+
raketary bump -p 3 # Set the patch number to 3
|
94
|
+
raketary bump -p +4 # Bump the patch number by 4
|
95
|
+
raketary bump -r # Erase the pre-release extension
|
96
|
+
raketary bump -r 'alpha.4' # Set the pre-release extension
|
97
|
+
raketary bump -b # Erase the build metadata
|
98
|
+
raketary bump -b 'beta.5' # Set the build metadata
|
99
|
+
raketary bump -u # Bump the Gemfile.lock version
|
100
|
+
```
|
101
|
+
|
102
|
+
## [Hacking](#contents)
|
103
|
+
|
104
|
+
```
|
105
|
+
$ git clone 'https://github.com/esotericpig/raketary.git'
|
106
|
+
$ bundle install
|
107
|
+
$ bundle exec rake -T
|
108
|
+
```
|
109
|
+
|
110
|
+
## [License](#contents)
|
111
|
+
|
112
|
+
[GNU LGPL v3+](LICENSE.txt)
|
113
|
+
|
114
|
+
> Raketary (<https://github.com/esotericpig/raketary>)
|
115
|
+
> Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
116
|
+
>
|
117
|
+
> Raketary is free software: you can redistribute it and/or modify
|
118
|
+
> it under the terms of the GNU Lesser General Public License as published by
|
119
|
+
> the Free Software Foundation, either version 3 of the License, or
|
120
|
+
> (at your option) any later version.
|
121
|
+
>
|
122
|
+
> Raketary is distributed in the hope that it will be useful,
|
123
|
+
> but WITHOUT ANY WARRANTY; without even the implied warranty of
|
124
|
+
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
125
|
+
> GNU Lesser General Public License for more details.
|
126
|
+
>
|
127
|
+
> You should have received a copy of the GNU Lesser General Public License
|
128
|
+
> along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
data/Rakefile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#--
|
5
|
+
# This file is part of Raketary.
|
6
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
7
|
+
#
|
8
|
+
# Raketary is free software: you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# Raketary is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU Lesser General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU Lesser General Public License
|
19
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#++
|
21
|
+
|
22
|
+
|
23
|
+
require 'bundler/gem_tasks'
|
24
|
+
|
25
|
+
require 'rake/clean'
|
26
|
+
require 'raketeer/run'
|
27
|
+
|
28
|
+
task default: [:run]
|
29
|
+
|
30
|
+
CLEAN.exclude('.git/','stock/')
|
31
|
+
CLOBBER.include('doc/')
|
data/bin/raketary
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'raketary'
|
25
|
+
|
26
|
+
app = Raketary::App.new()
|
27
|
+
|
28
|
+
app.run()
|
data/lib/raketary.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
TESTING_RAKETARY = ($0 == __FILE__)
|
25
|
+
|
26
|
+
if TESTING_RAKETARY
|
27
|
+
require 'rubygems'
|
28
|
+
require 'bundler/setup'
|
29
|
+
end
|
30
|
+
|
31
|
+
require 'raketary/app'
|
32
|
+
require 'raketary/app_bump'
|
33
|
+
require 'raketary/app_irb'
|
34
|
+
require 'raketary/app_nokogiri'
|
35
|
+
require 'raketary/app_run'
|
36
|
+
require 'raketary/cmd'
|
37
|
+
require 'raketary/errors'
|
38
|
+
require 'raketary/sub_cmd'
|
39
|
+
require 'raketary/version'
|
40
|
+
|
41
|
+
###
|
42
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
43
|
+
# @since 0.1.0
|
44
|
+
###
|
45
|
+
module Raketary
|
46
|
+
end
|
47
|
+
|
48
|
+
Raketary::App.new().run() if TESTING_RAKETARY
|
data/lib/raketary/app.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'raketary/app_bump'
|
25
|
+
require 'raketary/app_irb'
|
26
|
+
require 'raketary/app_nokogiri'
|
27
|
+
require 'raketary/app_run'
|
28
|
+
require 'raketary/cmd'
|
29
|
+
require 'raketary/sub_cmd'
|
30
|
+
require 'raketary/version'
|
31
|
+
|
32
|
+
module Raketary
|
33
|
+
###
|
34
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
35
|
+
# @since 0.1.0
|
36
|
+
###
|
37
|
+
class App < Cmd
|
38
|
+
attr_reader :args
|
39
|
+
attr_reader :options
|
40
|
+
attr_reader :parsers
|
41
|
+
attr_accessor :ran_cmd
|
42
|
+
attr_accessor :soft_error
|
43
|
+
attr_reader :version
|
44
|
+
|
45
|
+
alias_method :ran_cmd?,:ran_cmd
|
46
|
+
|
47
|
+
def initialize(args=ARGV)
|
48
|
+
super(self,'raketary')
|
49
|
+
|
50
|
+
@args = args
|
51
|
+
@options = {}
|
52
|
+
@parsers = []
|
53
|
+
@ran_cmd = false
|
54
|
+
@soft_error = nil
|
55
|
+
@version = Raketary::VERSION
|
56
|
+
|
57
|
+
@sub_cmds = {
|
58
|
+
'bump' => SubCmd.new(%q(Bump your project's version),AppBump),
|
59
|
+
'irb' => SubCmd.new('Open an irb session loaded with your library',AppIRB),
|
60
|
+
'nokogiri' => SubCmd.new('Install Nokogiri libs',AppNokogiri),
|
61
|
+
'run' => SubCmd.new(%Q(Run your project's main file: #{@name} run -- --version),AppRun)
|
62
|
+
}
|
63
|
+
|
64
|
+
parse!(true) do |op|
|
65
|
+
op.banner = "Usage: #{@name} [options] [command] [options]..."
|
66
|
+
|
67
|
+
op.on_tail('-v','--version',"show the version of #{@name}") do
|
68
|
+
puts "#{@name} v#{@version}"
|
69
|
+
exit
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def run()
|
75
|
+
return if @ran_cmd
|
76
|
+
|
77
|
+
puts @parsers.join()
|
78
|
+
|
79
|
+
if !@soft_error.nil?()
|
80
|
+
puts
|
81
|
+
puts "ERROR: #{@soft_error}"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'raketary/cmd'
|
25
|
+
require 'raketeer/bump_task'
|
26
|
+
|
27
|
+
module Raketary
|
28
|
+
###
|
29
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
30
|
+
# @since 0.1.0
|
31
|
+
###
|
32
|
+
class AppBump < Cmd
|
33
|
+
def initialize(*)
|
34
|
+
super
|
35
|
+
|
36
|
+
@run_cmd = false
|
37
|
+
|
38
|
+
parse!() do |op|
|
39
|
+
op.on('-n','--dry-run','do a dry run (do NOT write to files)')
|
40
|
+
op.on('-s','--strict','enforce semantic versioning (i.e., \\d+\\.\\d+\\.\\d+.*)')
|
41
|
+
op.separator op.summary_indent
|
42
|
+
|
43
|
+
op.on('-v','--ver [STR]',%q{show/set the version (e.g.: '1.2.3-alpha.4+beta.5') (default: show)}) do |ver|
|
44
|
+
@run_cmd = true
|
45
|
+
ver
|
46
|
+
end
|
47
|
+
op.on('-m','--major [INT,STR]',%q{bump/set the major number (e.g.: +2, 4) (default: +1)}) do |major|
|
48
|
+
@run_cmd = true
|
49
|
+
major.nil?() ? '+1' : major
|
50
|
+
end
|
51
|
+
op.on('-i','--minor [INT,STR]',%q{bump/set the minor number (e.g.: +2, 4) (default: +1)}) do |minor|
|
52
|
+
@run_cmd = true
|
53
|
+
minor.nil?() ? '+1' : minor
|
54
|
+
end
|
55
|
+
op.on('-p','--patch [INT,STR]',%q{bump/set the patch number (e.g.: +2, 4) (default: +1)}) do |patch|
|
56
|
+
@run_cmd = true
|
57
|
+
patch.nil?() ? '+1' : patch
|
58
|
+
end
|
59
|
+
op.on('-r','--pre [STR]',%q{set/erase the pre-release extension (e.g.: 'alpha.4') (default: erase)}) do |pre|
|
60
|
+
@run_cmd = true
|
61
|
+
pre.nil?() ? '' : pre
|
62
|
+
end
|
63
|
+
op.on('-b','--build [STR]',%q{set/erase the the build metadata (e.g.: 'beta.5') (default: erase)}) do |build|
|
64
|
+
@run_cmd = true
|
65
|
+
build.nil?() ? '' : build
|
66
|
+
end
|
67
|
+
op.on('-u','--bundle','bump the Gemfile.lock version') do
|
68
|
+
@run_cmd = true
|
69
|
+
true
|
70
|
+
end
|
71
|
+
op.separator op.summary_indent
|
72
|
+
|
73
|
+
op.on_tail('-x','--example','show some examples') do
|
74
|
+
puts <<~EOX
|
75
|
+
#{app.name} #{@name} -v # Show the current version
|
76
|
+
#{app.name} #{@name} -n # Do a dry run for any task (will NOT write to files)
|
77
|
+
|
78
|
+
#{app.name} #{@name} -v '1.2.3-alpha.4-beta.5' # Set the version manually
|
79
|
+
#{app.name} #{@name} -m 1 -i 2 -p 3 # Set the version numbers
|
80
|
+
#{app.name} #{@name} -r 'alpha.4' -b 'beta.5' # Set the version extensions
|
81
|
+
#{app.name} #{@name} -m -i -p # Bump the version numbers by 1
|
82
|
+
#{app.name} #{@name} -m +2 -i +3 -p +4 # Bump the version numbers by X
|
83
|
+
|
84
|
+
#{app.name} #{@name} -m # Bump the major number by 1
|
85
|
+
#{app.name} #{@name} -m 1 # Set the major number to 1
|
86
|
+
#{app.name} #{@name} -m +2 # Bump the major number by 2
|
87
|
+
#{app.name} #{@name} -i # Bump the minor number by 1
|
88
|
+
#{app.name} #{@name} -i 2 # Set the minor number to 2
|
89
|
+
#{app.name} #{@name} -i +3 # Bump the minor number by 3
|
90
|
+
#{app.name} #{@name} -p # Bump the patch number by 1
|
91
|
+
#{app.name} #{@name} -p 3 # Set the patch number to 3
|
92
|
+
#{app.name} #{@name} -p +4 # Bump the patch number by 4
|
93
|
+
#{app.name} #{@name} -r # Erase the pre-release extension
|
94
|
+
#{app.name} #{@name} -r 'alpha.4' # Set the pre-release extension
|
95
|
+
#{app.name} #{@name} -b # Erase the build metadata
|
96
|
+
#{app.name} #{@name} -b 'beta.5' # Set the build metadata
|
97
|
+
#{app.name} #{@name} -u # Bump the Gemfile.lock version
|
98
|
+
EOX
|
99
|
+
exit
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def run()
|
105
|
+
super()
|
106
|
+
return unless @run_cmd
|
107
|
+
|
108
|
+
bump_task = Raketeer::BumpTask.new()
|
109
|
+
bump_task.bump_bundle = false
|
110
|
+
bump_task.dry_run = app.options[:dry_run] ? true : false
|
111
|
+
bump_task.strict = app.options[:strict] ? true : false
|
112
|
+
|
113
|
+
bump_task.check_env()
|
114
|
+
|
115
|
+
bump_task.bump_bundle_file() if app.options[:bundle]
|
116
|
+
|
117
|
+
bump_task.bump_all(Raketeer::BumpVer.new(
|
118
|
+
version: app.options[:ver],
|
119
|
+
major: app.options[:major],
|
120
|
+
minor: app.options[:minor],
|
121
|
+
patch: app.options[:patch],
|
122
|
+
prerelease: app.options[:pre],
|
123
|
+
build_meta: app.options[:build]
|
124
|
+
))
|
125
|
+
|
126
|
+
app.ran_cmd = true
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'rake'
|
25
|
+
require 'raketary/cmd'
|
26
|
+
require 'raketeer/irb_task'
|
27
|
+
|
28
|
+
module Raketary
|
29
|
+
###
|
30
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
31
|
+
# @since 0.1.0
|
32
|
+
###
|
33
|
+
class AppIRB < Cmd
|
34
|
+
def initialize(*)
|
35
|
+
super
|
36
|
+
|
37
|
+
parse!() do |op|
|
38
|
+
#op.separator op.summary_indent
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def run()
|
43
|
+
super()
|
44
|
+
|
45
|
+
irb_task = Raketeer::IRBTask.new()
|
46
|
+
irb_task = Rake::Task[irb_task.name]
|
47
|
+
|
48
|
+
irb_task.reenable()
|
49
|
+
irb_task.invoke()
|
50
|
+
|
51
|
+
app.ran_cmd = true
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'raketary/cmd'
|
25
|
+
require 'raketary/errors'
|
26
|
+
require 'raketeer/nokogiri_install_tasks'
|
27
|
+
|
28
|
+
module Raketary
|
29
|
+
###
|
30
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
31
|
+
# @since 0.1.0
|
32
|
+
###
|
33
|
+
class AppNokogiri < Cmd
|
34
|
+
def initialize(*)
|
35
|
+
super
|
36
|
+
|
37
|
+
@main_opts = 0
|
38
|
+
|
39
|
+
parse!() do |op|
|
40
|
+
op.on('-a','--apt','install Nokogiri libs for Ubuntu/Debian') do
|
41
|
+
@main_opts += 1
|
42
|
+
true
|
43
|
+
end
|
44
|
+
op.on('-d','--dnf','install Nokogiri libs for Fedora/CentOS/Red Hat') do
|
45
|
+
@main_opts += 1
|
46
|
+
true
|
47
|
+
end
|
48
|
+
op.on('-o','--other','install Nokogiri libs for other OSes') do
|
49
|
+
@main_opts += 1
|
50
|
+
true
|
51
|
+
end
|
52
|
+
op.separator op.summary_indent
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def run()
|
57
|
+
super()
|
58
|
+
return if @main_opts <= 0
|
59
|
+
|
60
|
+
if @main_opts >= 2
|
61
|
+
raise DoNotRunCmdError,'Please choose only one platform to install the libs for.'
|
62
|
+
end
|
63
|
+
|
64
|
+
install_task = nil
|
65
|
+
|
66
|
+
if app.options[:apt]
|
67
|
+
install_task = Raketeer::NokogiriAPTTask.new()
|
68
|
+
elsif app.options[:dnf]
|
69
|
+
install_task = Raketeer::NokogiriDNFTask.new()
|
70
|
+
elsif app.options[:other]
|
71
|
+
install_task = Raketeer::NokogiriOtherTask.new()
|
72
|
+
end
|
73
|
+
|
74
|
+
if !install_task.nil?()
|
75
|
+
install_task.run(install_task,nil)
|
76
|
+
|
77
|
+
app.ran_cmd = true
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'rake'
|
25
|
+
require 'raketary/cmd'
|
26
|
+
require 'raketeer/run_task'
|
27
|
+
|
28
|
+
module Raketary
|
29
|
+
###
|
30
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
31
|
+
# @since 0.1.0
|
32
|
+
###
|
33
|
+
class AppRun < Cmd
|
34
|
+
def initialize(*)
|
35
|
+
super
|
36
|
+
|
37
|
+
parse!() do |op|
|
38
|
+
#op.separator op.summary_indent
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def run()
|
43
|
+
super()
|
44
|
+
|
45
|
+
run_task = Raketeer::RunTask.new()
|
46
|
+
|
47
|
+
ARGV << run_task.name.to_s()
|
48
|
+
ARGV.push(*@leftover_args)
|
49
|
+
|
50
|
+
run_task = Rake::Task[run_task.name]
|
51
|
+
|
52
|
+
run_task.reenable()
|
53
|
+
run_task.invoke()
|
54
|
+
|
55
|
+
app.ran_cmd = true
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/raketary/cmd.rb
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
require 'optparse'
|
25
|
+
require 'raketary/errors'
|
26
|
+
|
27
|
+
module Raketary
|
28
|
+
###
|
29
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
30
|
+
# @since 0.1.0
|
31
|
+
###
|
32
|
+
class Cmd
|
33
|
+
attr_reader :app
|
34
|
+
attr_reader :leftover_args
|
35
|
+
attr_reader :name
|
36
|
+
attr_reader :sub_cmds
|
37
|
+
|
38
|
+
def initialize(app,name)
|
39
|
+
@app = app
|
40
|
+
@leftover_args = []
|
41
|
+
@name = name
|
42
|
+
@sub_cmds = {}
|
43
|
+
end
|
44
|
+
|
45
|
+
def parse!(is_app=false)
|
46
|
+
parser = OptionParser.new() do |op|
|
47
|
+
op.program_name = app.name
|
48
|
+
op.version = app.version
|
49
|
+
|
50
|
+
op.banner = ''
|
51
|
+
op.separator '' if is_app
|
52
|
+
|
53
|
+
if !@sub_cmds.empty?()
|
54
|
+
op.separator is_app ? 'Commands:' : "[#{@name}] Commands:"
|
55
|
+
|
56
|
+
@sub_cmds.each do |name,sub_cmd|
|
57
|
+
name_desc = ''.dup()
|
58
|
+
name_desc << op.summary_indent
|
59
|
+
name_desc << ("%-#{op.summary_width}s #{sub_cmd.desc}" % [name])
|
60
|
+
|
61
|
+
op.separator name_desc
|
62
|
+
end
|
63
|
+
op.separator ''
|
64
|
+
end
|
65
|
+
|
66
|
+
op.separator is_app ? 'Options:' : "[#{@name}] Options:"
|
67
|
+
|
68
|
+
op.on_tail('-h','--help','show this help')
|
69
|
+
|
70
|
+
yield op
|
71
|
+
end
|
72
|
+
|
73
|
+
options = {}
|
74
|
+
@leftover_args = parser.order!(app.args,into: options).dup()
|
75
|
+
|
76
|
+
options.keys.each do |key|
|
77
|
+
if (key_s = key.to_s()).include?('-')
|
78
|
+
options[key_s.gsub('-','_').to_sym()] = options[key]
|
79
|
+
options.delete(key)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
app.options.merge!(options)
|
83
|
+
|
84
|
+
app.parsers << parser
|
85
|
+
|
86
|
+
if !app.args.nil?() && !(sub_cmd_name = app.args.shift()).nil?()
|
87
|
+
if !(sub_cmd = @sub_cmds[sub_cmd_name]).nil?()
|
88
|
+
begin
|
89
|
+
sub_cmd.cmd_class.new(app,sub_cmd_name).run()
|
90
|
+
rescue DoNotRunCmdError => e
|
91
|
+
app.soft_error = e.soft_msg
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
return parser
|
97
|
+
end
|
98
|
+
|
99
|
+
def run()
|
100
|
+
raise DoNotRunCmdError if app.options[:help] || app.ran_cmd?()
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
module Raketary
|
25
|
+
###
|
26
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
27
|
+
# @since 0.1.0
|
28
|
+
###
|
29
|
+
class DoNotRunCmdError < StandardError
|
30
|
+
attr_accessor :soft_msg
|
31
|
+
|
32
|
+
def initialize(msg=nil)
|
33
|
+
super(msg)
|
34
|
+
|
35
|
+
@soft_msg = msg
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
module Raketary
|
25
|
+
###
|
26
|
+
# @author Jonathan Bradley Whited (@esotericpig)
|
27
|
+
# @since 0.1.0
|
28
|
+
###
|
29
|
+
class SubCmd
|
30
|
+
attr_reader :cmd_class
|
31
|
+
attr_reader :desc
|
32
|
+
|
33
|
+
def initialize(desc,cmd_class)
|
34
|
+
@cmd_class = cmd_class
|
35
|
+
@desc = desc
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
#--
|
6
|
+
# This file is part of Raketary.
|
7
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
8
|
+
#
|
9
|
+
# Raketary is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Raketary is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU Lesser General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU Lesser General Public License
|
20
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
|
24
|
+
module Raketary
|
25
|
+
VERSION = '0.1.0'
|
26
|
+
end
|
data/raketary.gemspec
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#--
|
5
|
+
# This file is part of Raketary.
|
6
|
+
# Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
|
7
|
+
#
|
8
|
+
# Raketary is free software: you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# Raketary is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU Lesser General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU Lesser General Public License
|
19
|
+
# along with Raketary. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#++
|
21
|
+
|
22
|
+
|
23
|
+
lib = File.expand_path(File.join('..','lib'),__FILE__)
|
24
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
25
|
+
|
26
|
+
require 'raketary/version'
|
27
|
+
|
28
|
+
Gem::Specification.new() do |spec|
|
29
|
+
spec.name = 'raketary'
|
30
|
+
spec.version = Raketary::VERSION
|
31
|
+
spec.authors = ['Jonathan Bradley Whited (@esotericpig)']
|
32
|
+
spec.email = ['bradley@esotericpig.com']
|
33
|
+
spec.licenses = ['LGPL-3.0-or-later']
|
34
|
+
spec.homepage = 'https://github.com/esotericpig/raketary'
|
35
|
+
spec.summary = 'CLI for Raketeer.'
|
36
|
+
spec.description = spec.summary
|
37
|
+
|
38
|
+
spec.metadata = {
|
39
|
+
'bug_tracker_uri' => 'https://github.com/esotericpig/raketary/issues',
|
40
|
+
'changelog_uri' => 'https://github.com/esotericpig/raketary/blob/master/CHANGELOG.md',
|
41
|
+
'homepage_uri' => 'https://github.com/esotericpig/raketary',
|
42
|
+
'source_code_uri' => 'https://github.com/esotericpig/raketary'
|
43
|
+
}
|
44
|
+
|
45
|
+
spec.require_paths = ['lib']
|
46
|
+
spec.bindir = 'bin'
|
47
|
+
spec.executables = [spec.name]
|
48
|
+
|
49
|
+
spec.files = Dir.glob(File.join("{#{spec.require_paths.join(',')}}",'**','*.{erb,rb}')) +
|
50
|
+
Dir.glob(File.join(spec.bindir,'**',"{#{spec.executables.join(',')}}")) +
|
51
|
+
Dir.glob(File.join('{test,yard}','**','*.{erb,rb}')) +
|
52
|
+
%W( Gemfile Gemfile.lock #{spec.name}.gemspec Rakefile ) +
|
53
|
+
%w( CHANGELOG.md LICENSE.txt README.md )
|
54
|
+
|
55
|
+
spec.post_install_message = "You can now use [#{spec.executables.join(', ')}] on the command line."
|
56
|
+
|
57
|
+
spec.required_ruby_version = '>= 2.4.6'
|
58
|
+
|
59
|
+
spec.add_runtime_dependency 'irb' ,'~> 1.0' # For Raketeer::IRBTask
|
60
|
+
spec.add_runtime_dependency 'rake' ,'~> 12.3' # For Raketeer
|
61
|
+
spec.add_runtime_dependency 'raketeer','~> 0.2'
|
62
|
+
|
63
|
+
spec.add_development_dependency 'bundler','~> 2.0'
|
64
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: raketary
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonathan Bradley Whited (@esotericpig)
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: irb
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.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: '12.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: raketeer
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
description: CLI for Raketeer.
|
70
|
+
email:
|
71
|
+
- bradley@esotericpig.com
|
72
|
+
executables:
|
73
|
+
- raketary
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- CHANGELOG.md
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/raketary
|
84
|
+
- lib/raketary.rb
|
85
|
+
- lib/raketary/app.rb
|
86
|
+
- lib/raketary/app_bump.rb
|
87
|
+
- lib/raketary/app_irb.rb
|
88
|
+
- lib/raketary/app_nokogiri.rb
|
89
|
+
- lib/raketary/app_run.rb
|
90
|
+
- lib/raketary/cmd.rb
|
91
|
+
- lib/raketary/errors.rb
|
92
|
+
- lib/raketary/sub_cmd.rb
|
93
|
+
- lib/raketary/version.rb
|
94
|
+
- raketary.gemspec
|
95
|
+
homepage: https://github.com/esotericpig/raketary
|
96
|
+
licenses:
|
97
|
+
- LGPL-3.0-or-later
|
98
|
+
metadata:
|
99
|
+
bug_tracker_uri: https://github.com/esotericpig/raketary/issues
|
100
|
+
changelog_uri: https://github.com/esotericpig/raketary/blob/master/CHANGELOG.md
|
101
|
+
homepage_uri: https://github.com/esotericpig/raketary
|
102
|
+
source_code_uri: https://github.com/esotericpig/raketary
|
103
|
+
post_install_message: You can now use [raketary] on the command line.
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 2.4.6
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubygems_version: 3.0.4
|
119
|
+
signing_key:
|
120
|
+
specification_version: 4
|
121
|
+
summary: CLI for Raketeer.
|
122
|
+
test_files: []
|