argparse 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: e799b6161254080e3721a25b8ee155a8b6fc886ba72dac606e4d35cee72d7e9f
4
- data.tar.gz: 36c12eef6f29b6da6506ccba16a4fef4ec98e02e7175a10a05026cf5e449d8fc
3
+ metadata.gz: 4f583d4ca7e913ba56b2b25c490d30aaa48b24e8f764534bb544266e5130cb04
4
+ data.tar.gz: 49bde67b206f8c78cec034f51bc221e7e51dec0b38b1f2127cdfde6bcf10f06d
5
5
  SHA512:
6
- metadata.gz: 3a7daa4fbed759fb886ee575ce39bb41a3d9b80f528f7e7b555b7f33ead01148244d0c6d651a671d3cdd7a6c92f8a1d5be2ab731c85e89f075cc08322a3b95d7
7
- data.tar.gz: 921aee45677843f4b84f5bd8735efac1ad1b6eae892e77c59991e2bab820847ab8c02179701cfa55c6d21b81a79fd886b83169f838acdf0500090f397fddc7c0
6
+ metadata.gz: 7f780d3fc8fba1448f7fd7a7c5becf02f8f96ff26df228029073111bdb5b32211f43eed7b7a5e781f7c1c0effed5fee0f6c16e813f1d8531b4a7ea6ff7d0951d
7
+ data.tar.gz: 536b4855fc53650216bbce6f1b3a77a4df4f4b9cc619b63017908101e05f070ea05622d300ae571b614e69f2b0fb6ea55fcbaf25d2a491bb05433e02261eefc0
data/argsparser.gemspec CHANGED
@@ -11,4 +11,5 @@ Gem::Specification.new do |s|
11
11
  s.files.delete("argparse-#{ArgsParser::Version}.gem")
12
12
  s.require_paths = ["lib"]
13
13
  s.homepage = "https://github.com/Matthiasclee/ArgParse"
14
+ s.license = "CC-BY-NC-SA-4.0"
14
15
  end
@@ -6,9 +6,14 @@ module ArgsParser
6
6
  @@data = []
7
7
 
8
8
  read = :new_arg
9
+ rmode = nil
9
10
  args.each do |arg|
10
11
  if read == :new_arg
11
- if arg.start_with?("--")
12
+ if rmode == :data
13
+ @@data << arg
14
+ elsif arg == "--"
15
+ rmode = :data
16
+ elsif arg.start_with?("--")
12
17
  b = arg.sub("--", "").split("=")
13
18
  a = b[0].to_sym
14
19
 
@@ -37,7 +42,7 @@ module ArgsParser
37
42
  if rmode == :new_switch
38
43
  if expected_switches.keys.include?(x)
39
44
  if expected_switches[x][:has_argument]
40
- if b[1] && x == a.reverse[0].to_sym
45
+ if b[1] && a.length == 1
41
46
  @@switches[x] = {arg: b[1]}
42
47
  else
43
48
  rmode = {arg_for_switch: x}
@@ -50,6 +55,7 @@ module ArgsParser
50
55
  elsif rmode[:arg_for_switch]
51
56
  @@switches[rmode[:arg_for_switch]][:arg] = arg[c..arg.length-1]
52
57
  rmode = :new_switch
58
+ break
53
59
  end
54
60
  end
55
61
 
@@ -1,3 +1,3 @@
1
1
  module ArgsParser
2
- Version = "0.0.4"
2
+ Version = "0.0.5"
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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-21 00:00:00.000000000 Z
11
+ date: 2024-06-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for parsing command line arguments
14
14
  email: matthias@matthiasclee.com
@@ -26,7 +26,8 @@ files:
26
26
  - lib/argsparser/version.rb
27
27
  - readme.md
28
28
  homepage: https://github.com/Matthiasclee/ArgParse
29
- licenses: []
29
+ licenses:
30
+ - CC-BY-NC-SA-4.0
30
31
  metadata: {}
31
32
  post_install_message:
32
33
  rdoc_options: []
@@ -43,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
44
  - !ruby/object:Gem::Version
44
45
  version: '0'
45
46
  requirements: []
46
- rubygems_version: 3.2.3
47
+ rubygems_version: 3.1.6
47
48
  signing_key:
48
49
  specification_version: 4
49
50
  summary: A gem for parsing command line arguments