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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2b5768d1c5b1f9862099eb5d67e7c574561f256
4
- data.tar.gz: e257ffe48bab62974a02b76443e0d0c4aad563af
3
+ metadata.gz: cce729ba6d11269232cc35aeb9bd0e776cbbc8c6
4
+ data.tar.gz: d9bc60169106dc76750a275e9bd8e5bd71cb6333
5
5
  SHA512:
6
- metadata.gz: 63f482ee7c5696cff694e57a22efc2a187a20a074e10c651bbd272acedb03104a8646464fe0386cea3bb71f0e532b7f039ebcec9301c185437ca23ac6bfffad0
7
- data.tar.gz: 4d6213f4928e6abcb3809101f7b7d299eeaf24c51edeee8424f497bdeed6b3e7406127472e3639eb6efb719d4d98f98663a93b59c77634130074b2053cfc66be
6
+ metadata.gz: c43df16d49a5928d0937a0869b342966c5302543791084b1914a137fd984a2f55e99bd7c1d2f335c76a84142951e2a223f15f7d2a7e4789fc25782e1d5d06a6c
7
+ data.tar.gz: 86003e902a54018859e48c627e15027711b67aa2bd51f3c36c7963a6cd0a8ec4731089fb54c43c33583973334de569d2d5ca72e4341ff1491a33997e835a3916
@@ -57,7 +57,7 @@ end ## module Mono
57
57
 
58
58
  class MonoGitHub
59
59
  def self.clone( name )
60
- path = MonoFile.expand_path( name )
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.expand_path( name )
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.expand_path( path )
92
+ def self.real_path( path )
100
93
  "#{Mono.root}/#{path}"
101
94
  end
102
95
  def self.exist?( path )
103
- ::File.exist?( expand_path( path ))
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 = "#{Mono.root}/#{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
 
@@ -30,6 +30,11 @@ class Tool
30
30
  Mono.backup
31
31
  when 'run', 'r', 'exec'
32
32
  Mono.run( args )
33
+
34
+ ##################
35
+ ## for debugging / linting
36
+ when 'walk'
37
+ Mono.walk
33
38
  else
34
39
  puts "!! ERROR: unknown command >#{cmd}<"
35
40
  exit 1
@@ -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 = 0 ## todo: namespace inside version or something - why? why not??
9
- MINOR = 6
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.6.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-24 00:00:00.000000000 Z
11
+ date: 2020-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitti