monos 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mono.rb +6 -0
- data/lib/mono/base.rb +30 -5
- data/lib/mono/commands/backup.rb +3 -2
- data/lib/mono/commands/env.rb +2 -1
- data/lib/mono/commands/fetch.rb +2 -1
- data/lib/mono/commands/run.rb +2 -1
- data/lib/mono/commands/status.rb +3 -2
- data/lib/mono/commands/sync.rb +3 -1
- data/lib/mono/tool.rb +7 -6
- data/lib/mono/version.rb +1 -1
- data/test/test_base.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0e3b6e34281f0de5814be5353282f3433ff7a2
|
4
|
+
data.tar.gz: 0adb54bd17a900418ebeb7c8cb72aff6db9c95cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75be1cebf370650581e4600debea7b128a0f53a7661bff57fc22b6086d2b53306f09bcb4e1e481f2be003489c160440f3708fe329de4c6eede610968bf948aa0
|
7
|
+
data.tar.gz: 279c3310bb58d3272b596d5fd511fb40bc6749ea0f71087b0558f343ea46c5c4e6a7b8eca7cfe4b388cd2b8395a817432bc2fb322ac45beb48c3258ad7fa9ed8
|
data/lib/mono.rb
CHANGED
@@ -11,6 +11,12 @@ require 'gitti/backup/base'
|
|
11
11
|
module Mono
|
12
12
|
## note: make Git, GitProject, GitRepoSet, etc. available without Gitti::
|
13
13
|
include Gitti
|
14
|
+
|
15
|
+
class Tool
|
16
|
+
include Gitti
|
17
|
+
end
|
18
|
+
|
19
|
+
## add more classes e.g. MonoGitProject, etc. - why? why not?
|
14
20
|
end
|
15
21
|
|
16
22
|
|
data/lib/mono/base.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
#####################
|
2
2
|
# add repo helper
|
3
3
|
|
4
|
-
##
|
5
|
-
## todo/fix: ALWAYS assert name format
|
6
|
-
## (rename to mononame and monopath) - why? why not?
|
7
4
|
|
8
5
|
class MonoGitHub
|
9
6
|
def self.clone( name, depth: nil )
|
@@ -11,7 +8,9 @@ class MonoGitHub
|
|
11
8
|
## @rubycoco/gitti or
|
12
9
|
## gitti@rubycoco
|
13
10
|
## => rubycoco/gitti
|
14
|
-
|
11
|
+
|
12
|
+
## note: allow passing in (reusing) of mononames too
|
13
|
+
mononame = name.is_a?( Mononame ) ? name : Mononame.parse( name )
|
15
14
|
path = mononame.real_path
|
16
15
|
|
17
16
|
org_path = File.dirname( path )
|
@@ -32,7 +31,8 @@ MonoGithub = MonoGitHub ## add convenience (typo?) alias
|
|
32
31
|
|
33
32
|
class MonoGitProject
|
34
33
|
def self.open( name, &block )
|
35
|
-
|
34
|
+
## note: allow passing in (reusing) of mononames too
|
35
|
+
mononame = name.is_a?( Mononame ) ? name : Mononame.parse( name )
|
36
36
|
path = mononame.real_path
|
37
37
|
Gitti::GitProject.open( path, &block )
|
38
38
|
end
|
@@ -40,11 +40,36 @@ end
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
+
|
43
44
|
module Mono
|
44
45
|
#################
|
45
46
|
## add some short cuts
|
46
47
|
def self.open( name, &block ) MonoGitProject.open( name, &block ); end
|
47
48
|
def self.clone( name, depth: nil ) MonoGitHub.clone( name, depth: depth ); end
|
49
|
+
|
50
|
+
######################################
|
51
|
+
## add some more "porcelain" helpers
|
52
|
+
def self.sync( name )
|
53
|
+
## add some options - why? why not?
|
54
|
+
## - :readonly - auto-adds depth: 1 on clone or such - why? why not?
|
55
|
+
## - :clone true/false - do NOT clone only fast forward or such - why? why not?
|
56
|
+
## - :clean true/false or similar - only clone repos; no fast forward
|
57
|
+
## others - ideas -- ??
|
58
|
+
|
59
|
+
## note: allow passing in (reusing) of mononames too
|
60
|
+
mononame = name.is_a?( Mononame ) ? name : Mononame.parse( name )
|
61
|
+
if mononame.exist?
|
62
|
+
MonoGitProject.open( mononame ) do |proj|
|
63
|
+
if proj.changes?
|
64
|
+
puts "!! WARN - local changes in workdir; skipping fast forward (remote) sync / merge"
|
65
|
+
else
|
66
|
+
proj.fast_forward ## note: use git pull --ff-only (fast forward only - do NOT merge)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
else
|
70
|
+
MonoGitHub.clone( mononame )
|
71
|
+
end
|
72
|
+
end # method self.sync
|
48
73
|
end ## module Mono
|
49
74
|
|
50
75
|
|
data/lib/mono/commands/backup.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Mono
|
2
2
|
|
3
|
-
|
3
|
+
## pass along hash of repos (e.g. monorepo.yml or repos.yml )
|
4
|
+
class Tool
|
4
5
|
def self.backup
|
5
6
|
repos = Mono.monofile
|
6
7
|
|
@@ -11,5 +12,5 @@ module Mono
|
|
11
12
|
## 2) git remote update (if local backup already exists)
|
12
13
|
backup.backup( repos )
|
13
14
|
end # method backup
|
14
|
-
|
15
|
+
end # class Tool
|
15
16
|
end # module Mono
|
data/lib/mono/commands/env.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Mono
|
2
2
|
|
3
|
+
class Tool
|
3
4
|
def self.env ## check environment setup
|
4
5
|
puts "Mono.root (MOPATH): >#{Mono.root}<"
|
5
6
|
puts "Mono::Module::Tool.root: >#{Mono::Module::Tool.root}<"
|
@@ -22,5 +23,5 @@ module Mono
|
|
22
23
|
puts "monofile => (#{Monofile.find}):"
|
23
24
|
pp Mono.monofile
|
24
25
|
end
|
25
|
-
|
26
|
+
end # class Tool
|
26
27
|
end # module Mono
|
data/lib/mono/commands/fetch.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Mono
|
2
2
|
## pass along hash of repos (e.g. monorepo.yml or repos.yml )
|
3
|
+
class Tool
|
3
4
|
def self.fetch
|
4
5
|
repos = Mono.monofile
|
5
6
|
|
@@ -39,5 +40,5 @@ module Mono
|
|
39
40
|
print "#{count_repos} repo(s) @ #{count_orgs} org(s)"
|
40
41
|
print "\n"
|
41
42
|
end # method fetch
|
42
|
-
|
43
|
+
end # class Tool
|
43
44
|
end # module Mono
|
data/lib/mono/commands/run.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Mono
|
2
2
|
|
3
|
+
class Tool
|
3
4
|
def self.run( *args )
|
4
5
|
## todo/fix: use a "standard" argument to pass along hash of repos
|
5
6
|
## (e.g. monorepo.yml or repos.yml ) how? - why? why not?
|
@@ -43,5 +44,5 @@ module Mono
|
|
43
44
|
print "#{count_repos} repo(s) @ #{count_orgs} org(s)"
|
44
45
|
print "\n"
|
45
46
|
end # method run
|
46
|
-
|
47
|
+
end # class Tool
|
47
48
|
end # module Mono
|
data/lib/mono/commands/status.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Mono
|
2
2
|
|
3
|
-
|
3
|
+
## pass along hash of repos (e.g. monorepo.yml or repos.yml )
|
4
|
+
class Tool
|
4
5
|
def self.status
|
5
6
|
repos = Mono.monofile
|
6
7
|
|
@@ -61,5 +62,5 @@ module Mono
|
|
61
62
|
end
|
62
63
|
|
63
64
|
end # method status
|
64
|
-
|
65
|
+
end # class Tool
|
65
66
|
end # module Mono
|
data/lib/mono/commands/sync.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Mono
|
2
2
|
|
3
|
-
|
3
|
+
## pass along hash of repos (e.g. monorepo.yml or repos.yml )
|
4
|
+
class Tool
|
4
5
|
def self.sync
|
5
6
|
repos = Mono.monofile
|
6
7
|
|
@@ -50,4 +51,5 @@ module Mono
|
|
50
51
|
puts "#{count_repos} repo(s) @ #{count_orgs} org(s)"
|
51
52
|
end # method sync
|
52
53
|
|
54
|
+
end # class Tool
|
53
55
|
end # module Mono
|
data/lib/mono/tool.rb
CHANGED
@@ -44,20 +44,21 @@ class Tool
|
|
44
44
|
## note: allow shortcut for commands
|
45
45
|
case cmd.downcase
|
46
46
|
when 'status', 'stati', 'stat', 'st', 's'
|
47
|
-
|
47
|
+
status
|
48
48
|
when 'sync', 'syn', 'sy', ## note: allow aliases such as install, get & up too
|
49
49
|
'get', 'g',
|
50
50
|
'install', 'insta', 'inst', 'ins', 'i',
|
51
51
|
'up', 'u'
|
52
|
-
|
52
|
+
sync
|
53
53
|
when 'fetch', 'f'
|
54
|
-
|
54
|
+
fetch
|
55
55
|
when 'env', 'e'
|
56
|
-
|
56
|
+
env
|
57
57
|
when 'backup', 'back', 'b'
|
58
|
-
|
58
|
+
backup
|
59
59
|
when 'run', 'r', 'exec'
|
60
|
-
|
60
|
+
run( args )
|
61
|
+
|
61
62
|
|
62
63
|
##################
|
63
64
|
## for debugging / linting
|
data/lib/mono/version.rb
CHANGED
data/test/test_base.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: monofile
|