ronin-repos 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30c76d7743b473b4df8d834209051aa7643aafade9edcc3e3f12e8b344741e7f
4
- data.tar.gz: a4c58c0869e1b44a4c5da6589760f86cf261af3dcfe6478a8cff01efe1bab9c1
3
+ metadata.gz: 5f165cb9c5c8eda828d18f33114a9407ccae14fb6d5a7edc84fbc5159ba26aad
4
+ data.tar.gz: 6518e8a7dc2b29c778bf82d8ce32efc692e85b0d3ab108f3575724181b689bd4
5
5
  SHA512:
6
- metadata.gz: 92a8b69b652f962de02fd63b9fbc8e71636c669126e0ab96e769e4aa9894aa70689bc275001e6ddfe214606977618b003daf3de8dfb7966c1feff4e96a910221
7
- data.tar.gz: fa460921d3bf47e09714d3fdfeb01d392739ef96366df19f2f6262df1c8df4d37f8eef05bc6f7ac56f0815b76fc8e0c6efd37e23111b788c29db4c3fdc5aa651
6
+ metadata.gz: 0a827887a127c7a8165087e71cd3e8098b154f1ecd72dd0136f66ef640562db59a401ded921ac74877a981974ab16570cc431850f12f8d184291b5834c9d998d
7
+ data.tar.gz: 4c6e43043c8a93b69b0f55a1a8016e6014e4343b338b90b9a85d6cc9477b93f8c413d5e3d98bf71bf39115731a13bdfc4e3a46e2d40aa9302029089edf502b6c
@@ -26,3 +26,17 @@ jobs:
26
26
  run: bundle install --jobs 4 --retry 3
27
27
  - name: Run tests
28
28
  run: bundle exec rake test
29
+
30
+ # rubocop linting
31
+ rubocop:
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v2
35
+ - name: Set up Ruby
36
+ uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: 3.0
39
+ - name: Install dependencies
40
+ run: bundle install --jobs 4 --retry 3
41
+ - name: Run rubocop
42
+ run: bundle exec rubocop --parallel
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 3.1
5
+
6
+ inherit_gem:
7
+ rubocop-ronin: rubocop.yml
8
+
9
+ #
10
+ # ronin-repos specific exceptions
11
+ #
12
+
13
+ Lint/EmptyFile:
14
+ Exclude:
15
+ - 'spec/fixtures/class_dir/file1.rb'
16
+ - 'spec/fixtures/class_dir/file2.rb'
17
+ - 'spec/fixtures/class_dir/only_in_class_dir.rb'
data/ChangeLog.md CHANGED
@@ -1,4 +1,16 @@
1
- ### 0.1.0 / 2023-XX-XX
1
+ ### 0.1.1 / 2023-06-09
2
+
3
+ * Fixed a bug in {Ronin::Repos::ClassDir::ClassMethods#list_files} where the
4
+ {Ronin::Repos::ClassDir::ClassMethods#repo_class_dir repo_class_dir} was not
5
+ being removed from paths.
6
+ * Documentation fixes and improvements.
7
+
8
+ #### CLI
9
+
10
+ * Multiple bug fixes to the `ronin-repos install` command.
11
+ * Add missing man-page for the `ronin-repos new` command.
12
+
13
+ ### 0.1.0 / 2023-02-01
2
14
 
3
15
  * Initial release:
4
16
  * Supports installing any [Git][git] repository.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
@@ -7,7 +9,7 @@ platform :jruby do
7
9
  end
8
10
 
9
11
  # Ronin dependencies:
10
- # gem 'ronin-core', '~> 0.1', github: "ronin-rb/ronin-core",
12
+ # gem 'ronin-core', '~> 0.1', github: 'ronin-rb/ronin-core',
11
13
  # branch: 'main'
12
14
 
13
15
  # gem 'command_kit', '~> 0.4', github: 'postmodern/command_kit.rb',
@@ -27,6 +29,8 @@ group :development do
27
29
  gem 'yard-spellcheck', require: false
28
30
 
29
31
  gem 'dead_end', require: false
30
- gem 'sord', require: false, platforms: :mri
31
- gem 'stackprof', require: false, platforms: :mri
32
+ gem 'sord', require: false, platform: :mri
33
+ gem 'stackprof', require: false, platform: :mri
34
+ gem 'rubocop', require: false, platform: :mri
35
+ gem 'rubocop-ronin', require: false, platform: :mri
32
36
  end
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
- require 'rubygems'
1
+ # frozen_string_literal: true
2
2
 
3
3
  begin
4
4
  require 'bundler'
5
5
  rescue LoadError => e
6
6
  warn e.message
7
7
  warn "Run `gem install bundler` to install Bundler"
8
- exit -1
8
+ exit(-1)
9
9
  end
10
10
 
11
11
  begin
data/bin/ronin-repos CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
5
  #
@@ -21,13 +22,11 @@
21
22
  root = File.expand_path(File.join(__dir__,'..'))
22
23
  if File.file?(File.join(root,'Gemfile.lock'))
23
24
  Dir.chdir(root) do
24
- begin
25
- require 'bundler/setup'
26
- rescue LoadError => e
27
- warn e.message
28
- warn "Run `gem install bundler` to install Bundler"
29
- exit -1
30
- end
25
+ require 'bundler/setup'
26
+ rescue LoadError => e
27
+ warn e.message
28
+ warn "Run `gem install bundler` to install Bundler"
29
+ exit(-1)
31
30
  end
32
31
  end
33
32
 
@@ -5,7 +5,7 @@
5
5
  This git repository can be installed by the [ronin-repos] command:
6
6
 
7
7
  ```shell
8
- ronin-repos download https://github.com/<%= @github_user %>/<%= @name %>.git
8
+ ronin-repos install https://github.com/<%= @github_user %>/<%= @name %>.git
9
9
  ```
10
10
 
11
11
  [ronin-repos]: https://github.com/ronin-rb/ronin-repos#readme
@@ -34,7 +34,7 @@ module Ronin
34
34
 
35
35
  include Enumerable
36
36
 
37
- # The ~/.cache/ronin-repos/ directory where all repos are stored.
37
+ # The `~/.cache/ronin-repos/` directory where all repos are stored.
38
38
  PATH = Core::Home.cache_dir('ronin-repos')
39
39
 
40
40
  # The path to the cache directory.
@@ -52,7 +52,7 @@ module Ronin
52
52
  @path = path
53
53
  end
54
54
 
55
- #
55
+ #
56
56
  # Accesses a repository from the cache directory.
57
57
  #
58
58
  # @param [String] name
@@ -129,10 +129,9 @@ module Ronin
129
129
  #
130
130
  def update
131
131
  each do |repo|
132
- begin
133
- repo.update
134
- rescue CommandFailed
135
- end
132
+ repo.update
133
+ rescue CommandFailed
134
+ # ignore any `git` errors when updating
136
135
  end
137
136
  end
138
137
 
@@ -33,12 +33,12 @@ module Ronin
33
33
  #
34
34
  # require 'ronin/core/module_registry'
35
35
  # require 'ronin/repos/class_dir'
36
- #
36
+ #
37
37
  # module Ronin
38
38
  # module Exploits
39
39
  # include Ronin::Core::ClassRegistry
40
40
  # include Ronin::Repos::ClassDir
41
- #
41
+ #
42
42
  # class_dir "#{__dir__}/classes"
43
43
  # repo_class_dir "exploits"
44
44
  # end
@@ -49,11 +49,11 @@ module Ronin
49
49
  # module Ronin
50
50
  # module Exploits
51
51
  # class Exploit
52
- #
52
+ #
53
53
  # def self.register(name)
54
54
  # Exploits.register(name,self)
55
55
  # end
56
- #
56
+ #
57
57
  # end
58
58
  # end
59
59
  # end
@@ -61,13 +61,13 @@ module Ronin
61
61
  # `~/.cache/ronin-repos/repo1/exploits/my_exploit.rb`:
62
62
  #
63
63
  # require 'ronin/exploits/exploit'
64
- #
64
+ #
65
65
  # module Ronin
66
66
  # module Exploits
67
67
  # class MyExploit < Exploit
68
- #
68
+ #
69
69
  # register 'my_exploit'
70
- #
70
+ #
71
71
  # end
72
72
  # end
73
73
  # end
@@ -88,6 +88,9 @@ module Ronin
88
88
  namespace.extend ClassMethods
89
89
  end
90
90
 
91
+ #
92
+ # Class-methods.
93
+ #
91
94
  module ClassMethods
92
95
  #
93
96
  # Gets or sets the repository module directory name.
@@ -97,7 +100,7 @@ module Ronin
97
100
  #
98
101
  # @return [String]
99
102
  # The repository module directory name.
100
- #
103
+ #
101
104
  # @raise [NotImplementedError]
102
105
  # The `repo_class_dir` method was not defined in the module.
103
106
  #
@@ -117,13 +120,16 @@ module Ronin
117
120
  # {#repo_class_dir} across all installed repositories.
118
121
  #
119
122
  # @return [Array<String>]
120
- #
123
+ #
121
124
  def list_files
122
125
  modules = Set.new(super)
123
- pattern = File.join(repo_class_dir,"{**/}*.rb")
126
+ pattern = File.join(repo_class_dir,"{**/}*.rb")
127
+
128
+ # the String#slice range to remove the repo_class_dir/ and .rb ext
129
+ slice_range = (repo_class_dir.length + 1)...-3
124
130
 
125
131
  Repos.list_files(pattern).each do |path|
126
- modules << path.chomp('.rb')
132
+ modules << path.slice(slice_range)
127
133
  end
128
134
 
129
135
  return modules.to_a
@@ -24,6 +24,9 @@ require 'ronin/core/cli/command'
24
24
  module Ronin
25
25
  module Repos
26
26
  class CLI
27
+ #
28
+ # Base command for all `ronin-repos` commands.
29
+ #
27
30
  class Command < Core::CLI::Command
28
31
 
29
32
  man_dir File.join(ROOT,'man')
@@ -39,8 +42,7 @@ module Ronin
39
42
  @cache_dir = CacheDir.new(dir)
40
43
  end
41
44
 
42
-
43
- # The ronin-repos cache directory.
45
+ # The `ronin-repos` cache directory.
44
46
  #
45
47
  # @return [CacheDir]
46
48
  attr_reader :cache_dir
@@ -18,6 +18,8 @@
18
18
 
19
19
  require 'ronin/repos/cli/command'
20
20
 
21
+ require 'ronin/core/cli/logging'
22
+
21
23
  module Ronin
22
24
  module Repos
23
25
  class CLI
@@ -40,6 +42,8 @@ module Ronin
40
42
  #
41
43
  class Install < Command
42
44
 
45
+ include Core::CLI::Logging
46
+
43
47
  usage '[options] URI'
44
48
 
45
49
  argument :uri, required: true,
@@ -58,7 +62,7 @@ module Ronin
58
62
  #
59
63
  def run(uri)
60
64
  log_info "Installing repository from #{uri} ..."
61
- cache_dir.download(uri)
65
+ cache_dir.install(uri)
62
66
  rescue CommandFailed => error
63
67
  print_error(error.message)
64
68
  exit(-1)
@@ -63,7 +63,7 @@ module Ronin
63
63
  # The path to the new repo directory to create.
64
64
  #
65
65
  def run(path)
66
- @name = File.basename(path)
66
+ @name = File.basename(path)
67
67
  @github_user = Core::Git.github_user || ENV['USER']
68
68
 
69
69
  mkdir path
@@ -22,12 +22,27 @@ module Ronin
22
22
  module Repos
23
23
  class CLI
24
24
  module Commands
25
+ #
26
+ # The `ronin-repos purge` command.
27
+ #
28
+ # ## Usage
29
+ #
30
+ # ronin-repos purge [options]
31
+ #
32
+ # ## Options
33
+ #
34
+ # -C, --cache-dir DIR Overrides the default cache directory
35
+ # -h, --help Print help information
36
+ #
25
37
  class Purge < Command
26
38
 
27
39
  description 'Removes all git repository from the cache directory'
28
40
 
29
41
  man_page 'ronin-repos-download.1'
30
42
 
43
+ #
44
+ # Runs the `ronin-repos purge` command.
45
+ #
31
46
  def run
32
47
  cache_dir.purge
33
48
  end
@@ -21,13 +21,13 @@ module Ronin
21
21
  class Exception < RuntimeError
22
22
  end
23
23
 
24
- class RepositoryNotFound < Exception
24
+ class RepositoryNotFound < Repos::Exception
25
25
  end
26
26
 
27
- class CommandNotInstalled < Exception
27
+ class CommandNotInstalled < Repos::Exception
28
28
  end
29
29
 
30
- class CommandFailed < Exception
30
+ class CommandFailed < Repos::Exception
31
31
  end
32
32
  end
33
33
  end
@@ -66,7 +66,7 @@ module Ronin
66
66
  # Clones a repository.
67
67
  #
68
68
  # @param [String, URI::HTTPS] uri
69
- # The `https://` or `git@HOST:PATH` SSH URI
69
+ # The `https://` or `git@HOST:PATH` SSH URI
70
70
  #
71
71
  # @param [String] path
72
72
  # The path to where the repository will be cloned to.
@@ -109,7 +109,7 @@ module Ronin
109
109
  # path.
110
110
  #
111
111
  # @param [String, URI::HTTPS] uri
112
- # The `https://` or `git@HOST:PATH` SSH URI
112
+ # The `https://` or `git@HOST:PATH` SSH URI
113
113
  #
114
114
  # @param [String] path
115
115
  # The path to where the repository will be cloned to.
@@ -304,7 +304,7 @@ module Ronin
304
304
  #
305
305
  def glob(pattern,&block)
306
306
  path = join(pattern)
307
- matches = Dir.glob(path).sort
307
+ matches = Dir.glob(path)
308
308
 
309
309
  if block then matches.each(&block)
310
310
  else matches
@@ -19,6 +19,6 @@
19
19
  module Ronin
20
20
  module Repos
21
21
  # ronin-repos version
22
- VERSION = '0.1.0'
22
+ VERSION = '0.1.1'
23
23
  end
24
24
  end
data/lib/ronin/repos.rb CHANGED
@@ -25,7 +25,7 @@ module Ronin
25
25
  # @api public
26
26
  #
27
27
  module Repos
28
- @@cache_dir = CacheDir.new
28
+ @cache_dir = CacheDir.new
29
29
 
30
30
  #
31
31
  # Finds the first matching file.
@@ -42,7 +42,7 @@ module Ronin
42
42
  # # => "/home/user/.cache/ronin-repos/foo-repo/wordlists/wordlist.txt"
43
43
  #
44
44
  def self.find_file(path)
45
- @@cache_dir.find_file(path)
45
+ @cache_dir.find_file(path)
46
46
  end
47
47
 
48
48
  #
@@ -62,7 +62,7 @@ module Ronin
62
62
  # # "/home/user/.cache/ronin-repos/bar-repo/wordlists/beers.txt"]
63
63
  #
64
64
  def self.glob(pattern,&block)
65
- @@cache_dir.glob(pattern,&block)
65
+ @cache_dir.glob(pattern,&block)
66
66
  end
67
67
 
68
68
  #
@@ -75,7 +75,7 @@ module Ronin
75
75
  # The matching files within all repositories.
76
76
  #
77
77
  def self.list_files(pattern='{**/}*.*')
78
- @@cache_dir.list_files(pattern)
78
+ @cache_dir.list_files(pattern)
79
79
  end
80
80
  end
81
81
  end
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos-install 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos-install 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -21,25 +21,29 @@ The URI to the git repository\.
21
21
  .SH OPTIONS
22
22
  .LP
23
23
  .TP
24
+ \fB-C\fR, \fB--cache-dir\fR \fIDIR\fP
25
+ Overrides the default cache directory\.
26
+ .LP
27
+ .TP
24
28
  \fB-h\fR, \fB--help\fR
25
29
  Prints help information\.
26
30
  .LP
27
- .SH FILES
31
+ .SH ENVIRONMENT
28
32
  .LP
29
33
  .TP
30
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\[sl]\fP
31
- Installation directory for all repositories\.
34
+ \fIHOME\fP
35
+ Specifies the home directory of the user\. Ronin will search for the
36
+ \fB~/.cache/ronin-repos\fR cache directory within the home directory\.
32
37
  .LP
33
- .SH ENVIRONMENT
38
+ .TP
39
+ \fIXDG\[ru]CACHE\[ru]HOME\fP
40
+ Specifies the cache directory to use\. Defaults to \fB$HOME/.cache\fR\.
34
41
  .LP
35
- .PP
36
- HOME
37
- Specifies the home directory of the user\. Ronin will search for the
38
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP cache directory within the home directory\.
42
+ .SH FILES
39
43
  .LP
40
- .PP
41
- XDG\[ru]CACHE\[ru]HOME
42
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.cache\fP\.
44
+ .TP
45
+ \fB~/.cache/ronin-repos/\fR
46
+ Installation directory for all repositories\.
43
47
  .LP
44
48
  .SH EXAMPLES
45
49
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-repos-install 1 "2022-01-01" Ronin Repos "User Manuals"
1
+ # ronin-repos-install 1 "2023-02-01" Ronin Repos "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -15,22 +15,25 @@ Downloads a repository.
15
15
 
16
16
  ## OPTIONS
17
17
 
18
+ `-C`, `--cache-dir` *DIR*
19
+ Overrides the default cache directory.
20
+
18
21
  `-h`, `--help`
19
22
  Prints help information.
20
23
 
21
- ## FILES
22
-
23
- *~/.cache/ronin-repos/*
24
- Installation directory for all repositories.
25
-
26
24
  ## ENVIRONMENT
27
25
 
28
- HOME
26
+ *HOME*
29
27
  Specifies the home directory of the user. Ronin will search for the
30
- *~/.cache/ronin-repos* cache directory within the home directory.
28
+ `~/.cache/ronin-repos` cache directory within the home directory.
31
29
 
32
- XDG_CACHE_HOME
33
- Specifies the cache directory to use. Defaults to *$HOME/.cache*.
30
+ *XDG_CACHE_HOME*
31
+ Specifies the cache directory to use. Defaults to `$HOME/.cache`.
32
+
33
+ ## FILES
34
+
35
+ `~/.cache/ronin-repos/`
36
+ Installation directory for all repositories.
34
37
 
35
38
  ## EXAMPLES
36
39
 
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos-list 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos-list 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -21,25 +21,29 @@ The optional repository name to only list\.
21
21
  .SH OPTIONS
22
22
  .LP
23
23
  .TP
24
+ \fB-C\fR, \fB--cache-dir\fR \fIDIR\fP
25
+ Overrides the default cache directory\.
26
+ .LP
27
+ .TP
24
28
  \fB-h\fR, \fB--help\fR
25
29
  Prints help information\.
26
30
  .LP
27
- .SH FILES
31
+ .SH ENVIRONMENT
28
32
  .LP
29
33
  .TP
30
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP
31
- Installation directory for repositories\.
34
+ \fIHOME\fP
35
+ Specifies the home directory of the user\. Ronin will search for the
36
+ \fB~/.cache/ronin-repos\fR cache directory within the home directory\.
32
37
  .LP
33
- .SH ENVIRONMENT
38
+ .TP
39
+ \fIXDG\[ru]CACHE\[ru]HOME\fP
40
+ Specifies the cache directory to use\. Defaults to \fB$HOME/.cache\fR\.
34
41
  .LP
35
- .PP
36
- HOME
37
- Specifies the home directory of the user\. Ronin will search for the
38
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP cache directory within the home directory\.
42
+ .SH FILES
39
43
  .LP
40
- .PP
41
- XDG\[ru]CACHE\[ru]HOME
42
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.cache\fP\.
44
+ .TP
45
+ \fB~/.cache/ronin-repos\fR
46
+ Installation directory for repositories\.
43
47
  .LP
44
48
  .SH AUTHOR
45
49
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-repos-list 1 "2022-01-01" Ronin Repos "User Manuals"
1
+ # ronin-repos-list 1 "2023-02-01" Ronin Repos "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -15,22 +15,25 @@ Lists all downloaded repositories.
15
15
 
16
16
  ## OPTIONS
17
17
 
18
+ `-C`, `--cache-dir` *DIR*
19
+ Overrides the default cache directory.
20
+
18
21
  `-h`, `--help`
19
22
  Prints help information.
20
23
 
21
- ## FILES
22
-
23
- *~/.cache/ronin-repos*
24
- Installation directory for repositories.
25
-
26
24
  ## ENVIRONMENT
27
25
 
28
- HOME
26
+ *HOME*
29
27
  Specifies the home directory of the user. Ronin will search for the
30
- *~/.cache/ronin-repos* cache directory within the home directory.
28
+ `~/.cache/ronin-repos` cache directory within the home directory.
31
29
 
32
- XDG_CACHE_HOME
33
- Specifies the cache directory to use. Defaults to *$HOME/.cache*.
30
+ *XDG_CACHE_HOME*
31
+ Specifies the cache directory to use. Defaults to `$HOME/.cache`.
32
+
33
+ ## FILES
34
+
35
+ `~/.cache/ronin-repos`
36
+ Installation directory for repositories.
34
37
 
35
38
  ## AUTHOR
36
39
 
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos-new 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos-new 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -21,6 +21,10 @@ The path to the new git repository directory\.
21
21
  .SH OPTIONS
22
22
  .LP
23
23
  .TP
24
+ \fB-C\fR, \fB--cache-dir\fR \fIDIR\fP
25
+ Overrides the default cache directory\.
26
+ .LP
27
+ .TP
24
28
  \fB-h\fR, \fB--help\fR
25
29
  Prints help information\.
26
30
  .LP
@@ -0,0 +1,30 @@
1
+ # ronin-repos-new 1 "2023-02-01" Ronin Repos "User Manuals"
2
+
3
+ ## SYNOPSIS
4
+
5
+ `ronin-repos new` [*options*] *PATH*
6
+
7
+ ## DESCRIPTION
8
+
9
+ Generates a new git repository.
10
+
11
+ ## ARGUMENTS
12
+
13
+ *PATH*
14
+ The path to the new git repository directory.
15
+
16
+ ## OPTIONS
17
+
18
+ `-C`, `--cache-dir` *DIR*
19
+ Overrides the default cache directory.
20
+
21
+ `-h`, `--help`
22
+ Prints help information.
23
+
24
+ ## AUTHOR
25
+
26
+ Postmodern <postmodern.mod3@gmail.com>
27
+
28
+ ## SEE ALSO
29
+
30
+ ronin-repos(1) ronin-repos-list(1) ronin-repos-install(1) ronin-repos-remove(1) ronin-repos-update(1) ronin-repos-purge(1)
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos-purge 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos-purge 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -15,6 +15,10 @@ Removes all installed repositories\.
15
15
  .SH OPTIONS
16
16
  .LP
17
17
  .TP
18
+ \fB-C\fR, \fB--cache-dir\fR \fIDIR\fP
19
+ Overrides the default cache directory\.
20
+ .LP
21
+ .TP
18
22
  \fB-h\fR, \fB--help\fR
19
23
  Prints help information\.
20
24
  .LP
@@ -24,22 +28,22 @@ Prints help information\.
24
28
  \fBronin-repo purge\fR
25
29
  Removes all installed repositories\.
26
30
  .LP
27
- .SH FILES
31
+ .SH ENVIRONMENT
28
32
  .LP
29
33
  .TP
30
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\[sl]\fP
31
- Installation directory for all repositories\.
34
+ \fIHOME\fP
35
+ Specifies the home directory of the user\. Ronin will search for the
36
+ \fB~/.cache/ronin-repos\fR cache directory within the home directory\.
32
37
  .LP
33
- .SH ENVIRONMENT
38
+ .TP
39
+ \fIXDG\[ru]CACHE\[ru]HOME\fP
40
+ Specifies the cache directory to use\. Defaults to \fB$HOME/.cache\fR\.
34
41
  .LP
35
- .PP
36
- HOME
37
- Specifies the home directory of the user\. Ronin will search for the
38
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP cache directory within the home directory\.
42
+ .SH FILES
39
43
  .LP
40
- .PP
41
- XDG\[ru]CACHE\[ru]HOME
42
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.cache\fP\.
44
+ .TP
45
+ \fB~/.cache/ronin-repos/\fR
46
+ Installation directory for all repositories\.
43
47
  .LP
44
48
  .SH AUTHOR
45
49
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-repos-purge 1 "2022-01-01" Ronin Repos "User Manuals"
1
+ # ronin-repos-purge 1 "2023-02-01" Ronin Repos "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -10,6 +10,9 @@ Removes all installed repositories.
10
10
 
11
11
  ## OPTIONS
12
12
 
13
+ `-C`, `--cache-dir` *DIR*
14
+ Overrides the default cache directory.
15
+
13
16
  `-h`, `--help`
14
17
  Prints help information.
15
18
 
@@ -18,19 +21,19 @@ Removes all installed repositories.
18
21
  `ronin-repo purge`
19
22
  Removes all installed repositories.
20
23
 
21
- ## FILES
22
-
23
- *~/.cache/ronin-repos/*
24
- Installation directory for all repositories.
25
-
26
24
  ## ENVIRONMENT
27
25
 
28
- HOME
26
+ *HOME*
29
27
  Specifies the home directory of the user. Ronin will search for the
30
- *~/.cache/ronin-repos* cache directory within the home directory.
28
+ `~/.cache/ronin-repos` cache directory within the home directory.
31
29
 
32
- XDG_CACHE_HOME
33
- Specifies the cache directory to use. Defaults to *$HOME/.cache*.
30
+ *XDG_CACHE_HOME*
31
+ Specifies the cache directory to use. Defaults to `$HOME/.cache`.
32
+
33
+ ## FILES
34
+
35
+ `~/.cache/ronin-repos/`
36
+ Installation directory for all repositories.
34
37
 
35
38
  ## AUTHOR
36
39
 
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos-remove 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos-remove 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -30,22 +30,22 @@ Prints help information\.
30
30
  \fBronin-repo remove repo\fR
31
31
  Removes the repository with with the name \fBrepo\fR\.
32
32
  .LP
33
- .SH FILES
33
+ .SH ENVIRONMENT
34
34
  .LP
35
35
  .TP
36
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\[sl]\fP
37
- Installation directory for all repositories\.
36
+ \fIHOME\fP
37
+ Specifies the home directory of the user\. Ronin will search for the
38
+ \fB~/.cache/ronin-repos\fR cache directory within the home directory\.
38
39
  .LP
39
- .SH ENVIRONMENT
40
+ .TP
41
+ \fIXDG\[ru]CACHE\[ru]HOME\fP
42
+ Specifies the cache directory to use\. Defaults to \fB$HOME/.cache\fR\.
40
43
  .LP
41
- .PP
42
- HOME
43
- Specifies the home directory of the user\. Ronin will search for the
44
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP cache directory within the home directory\.
44
+ .SH FILES
45
45
  .LP
46
- .PP
47
- XDG\[ru]CACHE\[ru]HOME
48
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.cache\fP\.
46
+ .TP
47
+ \fB~/.cache/ronin-repos/\fR
48
+ Installation directory for all repositories\.
49
49
  .LP
50
50
  .SH AUTHOR
51
51
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-repos-remove 1 "2022-01-01" Ronin Repos "User Manuals"
1
+ # ronin-repos-remove 1 "2023-02-01" Ronin Repos "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -23,19 +23,19 @@ Removes a repository.
23
23
  `ronin-repo remove repo`
24
24
  Removes the repository with with the name `repo`.
25
25
 
26
- ## FILES
27
-
28
- *~/.cache/ronin-repos/*
29
- Installation directory for all repositories.
30
-
31
26
  ## ENVIRONMENT
32
27
 
33
- HOME
28
+ *HOME*
34
29
  Specifies the home directory of the user. Ronin will search for the
35
- *~/.cache/ronin-repos* cache directory within the home directory.
30
+ `~/.cache/ronin-repos` cache directory within the home directory.
36
31
 
37
- XDG_CACHE_HOME
38
- Specifies the cache directory to use. Defaults to *$HOME/.cache*.
32
+ *XDG_CACHE_HOME*
33
+ Specifies the cache directory to use. Defaults to `$HOME/.cache`.
34
+
35
+ ## FILES
36
+
37
+ `~/.cache/ronin-repos/`
38
+ Installation directory for all repositories.
39
39
 
40
40
  ## AUTHOR
41
41
 
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos-update 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos-update 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -21,6 +21,10 @@ The optional repository name to only update\.
21
21
  .SH OPTIONS
22
22
  .LP
23
23
  .TP
24
+ \fB-C\fR, \fB--cache-dir\fR \fIDIR\fP
25
+ Overrides the default cache directory\.
26
+ .LP
27
+ .TP
24
28
  \fB-h\fR, \fB--help\fR
25
29
  Prints help information\.
26
30
  .LP
@@ -34,22 +38,22 @@ Updates all installed repositories\.
34
38
  \fBronin update repo\fR
35
39
  Updates the specific repository named \fBrepo\fR\.
36
40
  .LP
37
- .SH FILES
41
+ .SH ENVIRONMENT
38
42
  .LP
39
43
  .TP
40
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\[sl]\fP
41
- Installation directory for all repositories\.
44
+ \fIHOME\fP
45
+ Specifies the home directory of the user\. Ronin will search for the
46
+ \fB~/.cache/ronin-repos\fR cache directory within the home directory\.
42
47
  .LP
43
- .SH ENVIRONMENT
48
+ .TP
49
+ \fIXDG\[ru]CACHE\[ru]HOME\fP
50
+ Specifies the cache directory to use\. Defaults to \fB$HOME/.cache\fR\.
44
51
  .LP
45
- .PP
46
- HOME
47
- Specifies the home directory of the user\. Ronin will search for the
48
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP cache directory within the home directory\.
52
+ .SH FILES
49
53
  .LP
50
- .PP
51
- XDG\[ru]CACHE\[ru]HOME
52
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.cache\fP\.
54
+ .TP
55
+ \fB~/.cache/ronin-repos/\fR
56
+ Installation directory for all repositories\.
53
57
  .LP
54
58
  .SH AUTHOR
55
59
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-repos-update 1 "2022-01-01" Ronin Repos "User Manuals"
1
+ # ronin-repos-update 1 "2023-02-01" Ronin Repos "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -15,6 +15,9 @@ Updates all repositories or just one.
15
15
 
16
16
  ## OPTIONS
17
17
 
18
+ `-C`, `--cache-dir` *DIR*
19
+ Overrides the default cache directory.
20
+
18
21
  `-h`, `--help`
19
22
  Prints help information.
20
23
 
@@ -26,19 +29,19 @@ Updates all repositories or just one.
26
29
  `ronin update repo`
27
30
  Updates the specific repository named `repo`.
28
31
 
29
- ## FILES
30
-
31
- *~/.cache/ronin-repos/*
32
- Installation directory for all repositories.
33
-
34
32
  ## ENVIRONMENT
35
33
 
36
- HOME
34
+ *HOME*
37
35
  Specifies the home directory of the user. Ronin will search for the
38
- *~/.cache/ronin-repos* cache directory within the home directory.
36
+ `~/.cache/ronin-repos` cache directory within the home directory.
39
37
 
40
- XDG_CACHE_HOME
41
- Specifies the cache directory to use. Defaults to *$HOME/.cache*.
38
+ *XDG_CACHE_HOME*
39
+ Specifies the cache directory to use. Defaults to `$HOME/.cache`.
40
+
41
+ ## FILES
42
+
43
+ `~/.cache/ronin-repos/`
44
+ Installation directory for all repositories.
42
45
 
43
46
  ## AUTHOR
44
47
 
data/man/ronin-repos.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-repos 1 "2022-01-01" Ronin Repos "User Manuals"
3
+ .TH ronin-repos 1 "2023-02-01" Ronin Repos "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -19,22 +19,48 @@ and use any git repository containing Ruby code or other data\.
19
19
  \fB-h\fR, \fB--help\fR
20
20
  Prints help information\.
21
21
  .LP
22
- .SH FILES
22
+ .SH COMMANDS
23
23
  .LP
24
24
  .TP
25
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP
26
- Installation directory for repositories\.
25
+ \fBinstall\fR
26
+ Installs a 3rd\-party git repository\.
27
+ .LP
28
+ .TP
29
+ \fBlist\fR, \fBls\fR
30
+ Lists installed git repositories\.
31
+ .LP
32
+ .TP
33
+ \fBnew\fR
34
+ Generates a new git repository\.
35
+ .LP
36
+ .TP
37
+ \fBpurge\fR
38
+ Deletes all installed git repositories\.
39
+ .LP
40
+ .TP
41
+ \fBremove\fR, \fBrm\fR
42
+ Removes a previously installed git repository\.
43
+ .LP
44
+ .TP
45
+ \fBupdate\fR, \fBup\fR
46
+ Updates a previously installed git repository\.
27
47
  .LP
28
48
  .SH ENVIRONMENT
29
49
  .LP
30
- .PP
31
- HOME
50
+ .TP
51
+ \fIHOME\fP
32
52
  Specifies the home directory of the user\. Ronin will search for the
33
- \fI\[ti]\[sl]\.cache\[sl]ronin\-repos\fP cache directory within the home directory\.
53
+ \fB~/.cache/ronin-repos\fR cache directory within the home directory\.
34
54
  .LP
35
- .PP
36
- XDG\[ru]CACHE\[ru]HOME
37
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.cache\fP\.
55
+ .TP
56
+ \fIXDG\[ru]CACHE\[ru]HOME\fP
57
+ Specifies the cache directory to use\. Defaults to \fB$HOME/.cache\fR\.
58
+ .LP
59
+ .SH FILES
60
+ .LP
61
+ .TP
62
+ \fB~/.cache/ronin-repos\fR
63
+ Installation directory for repositories\.
38
64
  .LP
39
65
  .SH AUTHOR
40
66
  .LP
data/man/ronin-repos.1.md CHANGED
@@ -1,4 +1,4 @@
1
- # ronin-repos 1 "2022-01-01" Ronin Repos "User Manuals"
1
+ # ronin-repos 1 "2023-02-01" Ronin Repos "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -14,19 +14,39 @@ and use any git repository containing Ruby code or other data.
14
14
  `-h`, `--help`
15
15
  Prints help information.
16
16
 
17
- ## FILES
17
+ ## COMMANDS
18
18
 
19
- *~/.cache/ronin-repos*
20
- Installation directory for repositories.
19
+ `install`
20
+ Installs a 3rd-party git repository.
21
+
22
+ `list`, `ls`
23
+ Lists installed git repositories.
24
+
25
+ `new`
26
+ Generates a new git repository.
27
+
28
+ `purge`
29
+ Deletes all installed git repositories.
30
+
31
+ `remove`, `rm`
32
+ Removes a previously installed git repository.
33
+
34
+ `update`, `up`
35
+ Updates a previously installed git repository.
21
36
 
22
37
  ## ENVIRONMENT
23
38
 
24
- HOME
39
+ *HOME*
25
40
  Specifies the home directory of the user. Ronin will search for the
26
- *~/.cache/ronin-repos* cache directory within the home directory.
41
+ `~/.cache/ronin-repos` cache directory within the home directory.
42
+
43
+ *XDG_CACHE_HOME*
44
+ Specifies the cache directory to use. Defaults to `$HOME/.cache`.
27
45
 
28
- XDG_CACHE_HOME
29
- Specifies the cache directory to use. Defaults to *$HOME/.cache*.
46
+ ## FILES
47
+
48
+ `~/.cache/ronin-repos`
49
+ Installation directory for repositories.
30
50
 
31
51
  ## AUTHOR
32
52
 
data/ronin-repos.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'yaml'
4
4
 
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
22
22
  gem.homepage = gemspec['homepage']
23
23
  gem.metadata = gemspec['metadata'] if gemspec['metadata']
24
24
 
25
- glob = lambda { |patterns| gem.files & Dir[*patterns] }
25
+ glob = ->(patterns) { gem.files & Dir[*patterns] }
26
26
 
27
27
  gem.files = `git ls-files`.split($/)
28
28
  gem.files = glob[gemspec['files']] if gemspec['files']
@@ -33,6 +33,7 @@ Gem::Specification.new do |gem|
33
33
  gem.executables = gemspec.fetch('executables') do
34
34
  glob['bin/*'].map { |path| File.basename(path) }
35
35
  end
36
+
36
37
  gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
37
38
 
38
39
  gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
@@ -47,7 +48,7 @@ Gem::Specification.new do |gem|
47
48
  gem.required_rubygems_version = gemspec['required_rubygems_version']
48
49
  gem.post_install_message = gemspec['post_install_message']
49
50
 
50
- split = lambda { |string| string.split(/,\s*/) }
51
+ split = ->(string) { string.split(/,\s*/) }
51
52
 
52
53
  if gemspec['dependencies']
53
54
  gemspec['dependencies'].each do |name,versions|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-repos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-01 00:00:00.000000000 Z
11
+ date: 2023-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ronin-core
@@ -53,6 +53,7 @@ files:
53
53
  - ".github/workflows/ruby.yml"
54
54
  - ".gitignore"
55
55
  - ".rspec"
56
+ - ".rubocop.yml"
56
57
  - ".ruby-version"
57
58
  - ".yardopts"
58
59
  - COPYING.txt
@@ -83,6 +84,7 @@ files:
83
84
  - man/ronin-repos-list.1
84
85
  - man/ronin-repos-list.1.md
85
86
  - man/ronin-repos-new.1
87
+ - man/ronin-repos-new.1.md
86
88
  - man/ronin-repos-purge.1
87
89
  - man/ronin-repos-purge.1.md
88
90
  - man/ronin-repos-remove.1