monos 0.6.0 → 1.0.0
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 +4 -4
- data/lib/mono/base.rb +14 -20
- data/lib/mono/tool.rb +5 -0
- data/lib/mono/version.rb +2 -2
- 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: cce729ba6d11269232cc35aeb9bd0e776cbbc8c6
|
4
|
+
data.tar.gz: d9bc60169106dc76750a275e9bd8e5bd71cb6333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c43df16d49a5928d0937a0869b342966c5302543791084b1914a137fd984a2f55e99bd7c1d2f335c76a84142951e2a223f15f7d2a7e4789fc25782e1d5d06a6c
|
7
|
+
data.tar.gz: 86003e902a54018859e48c627e15027711b67aa2bd51f3c36c7963a6cd0a8ec4731089fb54c43c33583973334de569d2d5ca72e4341ff1491a33997e835a3916
|
data/lib/mono/base.rb
CHANGED
@@ -57,7 +57,7 @@ end ## module Mono
|
|
57
57
|
|
58
58
|
class MonoGitHub
|
59
59
|
def self.clone( name )
|
60
|
-
path = MonoFile.
|
60
|
+
path = MonoFile.real_path( name )
|
61
61
|
|
62
62
|
org_path = File.dirname( path )
|
63
63
|
FileUtils.mkdir_p( org_path ) unless Dir.exist?( org_path ) ## make sure path exists
|
@@ -77,46 +77,31 @@ MonoGithub = MonoGitHub ## add convenience (typo?) alias
|
|
77
77
|
|
78
78
|
class MonoGitProject
|
79
79
|
def self.open( name, &block )
|
80
|
-
path = MonoFile.
|
80
|
+
path = MonoFile.real_path( name )
|
81
81
|
Gitti::GitProject.open( path, &block )
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
85
|
|
86
|
-
module Mono
|
87
|
-
## add some short cuts
|
88
|
-
def self.open( name, &block ) MonoGitProject.open( name, &block ); end
|
89
|
-
def self.clone( name ) MonoGitHub.clone( name ); end
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
86
|
|
94
87
|
class MonoFile
|
95
88
|
## e.g. openfootball/austria etc.
|
96
89
|
## expand to to "real" absolute path
|
97
90
|
##
|
98
91
|
## todo/check: assert name must be {orgname,username}/reponame
|
99
|
-
def self.
|
92
|
+
def self.real_path( path )
|
100
93
|
"#{Mono.root}/#{path}"
|
101
94
|
end
|
102
95
|
def self.exist?( path )
|
103
|
-
::File.exist?(
|
104
|
-
end
|
105
|
-
|
106
|
-
|
107
|
-
## add some aliases - why? why not?
|
108
|
-
class << self
|
109
|
-
alias_method :real_path, :expand_path
|
110
|
-
alias_method :exists?, :exist? ## add deprecated exists? too - why? why not?
|
96
|
+
::File.exist?( real_path( path ))
|
111
97
|
end
|
112
98
|
|
113
99
|
|
114
|
-
|
115
100
|
## path always relative to Mono.root
|
116
101
|
## todo/fix: use File.expand_path( path, Mono.root ) - why? why not?
|
117
102
|
## or always enfore "absolut" path e.g. do NOT allow ../ or ./ or such
|
118
103
|
def self.open( path, mode='r:utf-8', &block )
|
119
|
-
full_path =
|
104
|
+
full_path = real_path( path )
|
120
105
|
## make sure path exists if we open for writing/appending - why? why not?
|
121
106
|
if mode[0] == 'w' || mode[0] == 'a'
|
122
107
|
::FileUtils.mkdir_p( ::File.dirname( full_path ) ) ## make sure path exists
|
@@ -134,4 +119,13 @@ end ## class MonoFile
|
|
134
119
|
|
135
120
|
|
136
121
|
|
122
|
+
module Mono
|
123
|
+
#################
|
124
|
+
## add some short cuts
|
125
|
+
def self.open( name, &block ) MonoGitProject.open( name, &block ); end
|
126
|
+
def self.clone( name ) MonoGitHub.clone( name ); end
|
127
|
+
def self.real_path( name) MonoFile.real_path( name ); end
|
128
|
+
end ## module Mono
|
129
|
+
|
130
|
+
|
137
131
|
|
data/lib/mono/tool.rb
CHANGED
data/lib/mono/version.rb
CHANGED
@@ -5,8 +5,8 @@ module MonoCore ## todo/check: rename to MonoMeta, MonoModule or such - why? w
|
|
5
5
|
|
6
6
|
## note: move root to its own namespace to avoid
|
7
7
|
## conflict with Mono.root!!!!
|
8
|
-
MAJOR =
|
9
|
-
MINOR =
|
8
|
+
MAJOR = 1 ## todo: namespace inside version or something - why? why not??
|
9
|
+
MINOR = 0
|
10
10
|
PATCH = 0
|
11
11
|
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
12
12
|
|
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: 0.
|
4
|
+
version: 1.0.0
|
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-10-
|
11
|
+
date: 2020-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitti
|