monofile 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 547a6deaf1db0ea792b640dcf686fa5788d0de30
4
- data.tar.gz: 01fdcf2b3cfc5ddb70eb68dec8a808f0a1edd2e1
3
+ metadata.gz: dc46a512fd3305af7a7d3949bdfe049de0e1e238
4
+ data.tar.gz: f152af472841c5145d37ca45f54504fbb48e6f3a
5
5
  SHA512:
6
- metadata.gz: e3358beae7a3a96107e13e4b01d0fa065acb629b131acca5031168b85331ff88463a8f9e5f7fac09de0e28eb18f2380322e6e481857a8ec077cb4e4355240298
7
- data.tar.gz: 7c100f51fb8cb143202016b7d129b80fcf20acea7301c117263b09efec99fdf9ffede2ecb0d47cef266d86489e07de0053b6c586c8d572a0d720fb815d395534
6
+ metadata.gz: 83b933f57ceab663f8186d1fd8f99737bebc1f35ecde411b44f4a24d6dc3476b510376d7194f77f68f9d9f5537919e00c7fcf66aedc2a22ce90e37fa75f840ea
7
+ data.tar.gz: 73acb18f7deb86cc6e4669459c4f531b98cdd7c248c12f36c820577550fcc1ba4eeebc65edbac2ba2fb9f0b697fe73f0b028c828c9f0c420d9c225b3be3b27fa
@@ -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 == 2 && args[0].is_a?(String) && args[1].is_a?(String)
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.pretty_inspect}"
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',
@@ -5,7 +5,7 @@ module Monofile
5
5
 
6
6
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
7
7
  MINOR = 2
8
- PATCH = 2
8
+ PATCH = 3
9
9
  VERSION = [MAJOR,MINOR,PATCH].join('.')
10
10
 
11
11
  def self.version
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.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-02 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc