monofile 0.2.2 → 0.2.3
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/monofile/monofile.rb +30 -4
- data/lib/monofile/version.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: dc46a512fd3305af7a7d3949bdfe049de0e1e238
|
4
|
+
data.tar.gz: f152af472841c5145d37ca45f54504fbb48e6f3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83b933f57ceab663f8186d1fd8f99737bebc1f35ecde411b44f4a24d6dc3476b510376d7194f77f68f9d9f5537919e00c7fcf66aedc2a22ce90e37fa75f840ea
|
7
|
+
data.tar.gz: 73acb18f7deb86cc6e4669459c4f531b98cdd7c248c12f36c820577550fcc1ba4eeebc65edbac2ba2fb9f0b697fe73f0b028c828c9f0c420d9c225b3be3b27fa
|
data/lib/monofile/monofile.rb
CHANGED
@@ -5,13 +5,13 @@ class Monofile
|
|
5
5
|
## nested class
|
6
6
|
class Project ## todo/fix: change to Monoproject/MonoProject - why? why not?
|
7
7
|
def initialize( *args )
|
8
|
-
if args.size ==
|
8
|
+
if args.size == 1 && args[0].is_a?( String )
|
9
|
+
@name = Mononame.parse( args[0] )
|
10
|
+
elsif args.size == 2 && args[0].is_a?(String) && args[1].is_a?(String)
|
9
11
|
## assume [org, name]
|
10
12
|
@name = Mononame.new( *args )
|
11
|
-
elsif args.size == 1 && args[0].is_a?( String )
|
12
|
-
@name = Mononame.parse( args[0] )
|
13
13
|
else
|
14
|
-
raise ArgumentError, "[MonoProject] one or two string args expected; got: #{args.
|
14
|
+
raise ArgumentError, "[MonoProject] one or two string args expected; got: #{args.inspect}"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -32,13 +32,39 @@ class Monofile
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def project( *args )
|
35
|
+
## auto-convert symbols to string
|
36
|
+
args = args.map do |arg|
|
37
|
+
arg.is_a?( Symbol ) ? arg.to_s : arg
|
38
|
+
end
|
39
|
+
|
35
40
|
project = Project.new( *args )
|
36
41
|
@monofile.projects << project
|
37
42
|
end
|
43
|
+
|
44
|
+
###
|
45
|
+
## adding many projects at once (by batch) - keep - why? why not?
|
46
|
+
def projects( *args )
|
47
|
+
## note: for now only support (list of) hash
|
48
|
+
## add more later (nested array or text or such) - why? why not?
|
49
|
+
args.each do |arg|
|
50
|
+
raise ArgumentError, "expected Hash type - got: #{arg.inspect} : #{arg.class.name}" unless arg.is_a?( Hash )
|
51
|
+
end
|
52
|
+
|
53
|
+
## pp arg
|
54
|
+
args.each do |arg|
|
55
|
+
arg.each do |org, names|
|
56
|
+
names.each do |name|
|
57
|
+
## puts "adding #{org} #{name}"
|
58
|
+
project( org, name )
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
38
63
|
end # (nested) class Builder
|
39
64
|
|
40
65
|
|
41
66
|
|
67
|
+
|
42
68
|
RUBY_NAMES = ['monofile',
|
43
69
|
'Monofile',
|
44
70
|
'monofile.rb',
|
data/lib/monofile/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monofile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|