argparse 0.0.2 → 0.0.4

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
  SHA256:
3
- metadata.gz: 8c47aa7c1a5561464ce640ae7b32a0a502206de110266fe279ef41a13b8c946d
4
- data.tar.gz: 69ff2ea44dd42997dd375451994d4fa59bc1263da32885d416e0729f3f05a93e
3
+ metadata.gz: e799b6161254080e3721a25b8ee155a8b6fc886ba72dac606e4d35cee72d7e9f
4
+ data.tar.gz: 36c12eef6f29b6da6506ccba16a4fef4ec98e02e7175a10a05026cf5e449d8fc
5
5
  SHA512:
6
- metadata.gz: c8172e339f33260c3c3b3d6a01ebe4787b042c15af1306c26e51f76690575c435a24e2a2ec8bb932d0b876cb91f42a8b97a40df8d928fcde4bd3be894a2f4523
7
- data.tar.gz: 29daa4c7e3cdfe82a0d93a40001209d3e59a418945ec13089f12a84dabf01c29258e0a4604921c84f7f7f292766cd598bc2496f65b0864cab658c6d7775e15e5
6
+ metadata.gz: 3a7daa4fbed759fb886ee575ce39bb41a3d9b80f528f7e7b555b7f33ead01148244d0c6d651a671d3cdd7a6c92f8a1d5be2ab731c85e89f075cc08322a3b95d7
7
+ data.tar.gz: 921aee45677843f4b84f5bd8735efac1ad1b6eae892e77c59991e2bab820847ab8c02179701cfa55c6d21b81a79fd886b83169f838acdf0500090f397fddc7c0
@@ -12,7 +12,7 @@ module ArgsParser
12
12
  return @s[a.to_sym][:arg]
13
13
  end
14
14
  else
15
- return false
15
+ return nil
16
16
  end
17
17
  end
18
18
  end
@@ -29,8 +29,10 @@ module ArgsParser
29
29
  a = b[0].split("")
30
30
 
31
31
  rmode = :new_switch
32
+ c = 0
32
33
  a.each do |x|
33
34
  x = x.to_sym
35
+ c = c + 1
34
36
 
35
37
  if rmode == :new_switch
36
38
  if expected_switches.keys.include?(x)
@@ -46,7 +48,7 @@ module ArgsParser
46
48
  end
47
49
  end
48
50
  elsif rmode[:arg_for_switch]
49
- @@switches[rmode[:arg_for_switch]][:arg] = x
51
+ @@switches[rmode[:arg_for_switch]][:arg] = arg[c..arg.length-1]
50
52
  rmode = :new_switch
51
53
  end
52
54
  end
@@ -12,7 +12,7 @@ module ArgsParser
12
12
  return @s[a.to_sym][:arg]
13
13
  end
14
14
  else
15
- return false
15
+ return nil
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module ArgsParser
2
- Version = "0.0.2"
2
+ Version = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argparse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Lee
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-04 00:00:00.000000000 Z
11
+ date: 2023-11-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for parsing command line arguments
14
14
  email: matthias@matthiasclee.com
@@ -25,11 +25,10 @@ files:
25
25
  - lib/argsparser/switches.rb
26
26
  - lib/argsparser/version.rb
27
27
  - readme.md
28
- - test.rb
29
28
  homepage: https://github.com/Matthiasclee/ArgParse
30
29
  licenses: []
31
30
  metadata: {}
32
- post_install_message:
31
+ post_install_message:
33
32
  rdoc_options: []
34
33
  require_paths:
35
34
  - lib
@@ -44,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
43
  - !ruby/object:Gem::Version
45
44
  version: '0'
46
45
  requirements: []
47
- rubygems_version: 3.1.6
48
- signing_key:
46
+ rubygems_version: 3.2.3
47
+ signing_key:
49
48
  specification_version: 4
50
49
  summary: A gem for parsing command line arguments
51
50
  test_files: []
data/test.rb DELETED
@@ -1,20 +0,0 @@
1
- require "argparse"
2
-
3
- o = {
4
- asd: { has_argument: false },
5
- qwe: { has_argument: true }
6
- }
7
-
8
- s = {
9
- q: { has_argument: true },
10
- a: { }
11
- }
12
-
13
- x=ArgsParser::Args.new(options: o, switches: s)
14
-
15
- puts x.switches[:q]
16
- puts x.switches[:a]
17
- puts x.options[:asd]
18
- puts x.options[:qwe]
19
-
20
- puts x.data.to_s