configparser 0.1.2 → 0.1.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: fb8abd63de5675ecb447293414f42920df48f4f8
4
- data.tar.gz: cdfd1a378fbf2bda1df9934ddae8d22299908443
3
+ metadata.gz: 4d3c3eacddf5d2024c066d1538085850467ba989
4
+ data.tar.gz: b121f9f948a254895fe7051802dcba8f7f72d612
5
5
  SHA512:
6
- metadata.gz: c9ea08520489ce5de29f8c718f059527dae061d5be7abe300b6a9785b88dbba9d55576e5f1b9c2ef40a60497d605ebd3468feeb97b22c90bedd26fd59d222092
7
- data.tar.gz: e5045a31bb7913efe020dc089cfbd6b6c5b3f068060f5240523c07f2c7d6d01fe8b74413584767c586c499bac6e69f8281ecce68061fbe4ab157361b2458088e
6
+ metadata.gz: b6fe602bdc834e0f4da93cd2db56ba3f38c9d85aab61fb73f5a4388d479fcb56e18c68d7447d658417f02606fb3712562063f1dd26494b6a17a5d16eaa84b126
7
+ data.tar.gz: 257e52754a0e7f41ff98d70aeeab23943a60c78e39e2f6ab28cd1fea3776de8db1417131f8a0a0730deddcb576d4b1107869fde5100f6e1029379b8c2df2a92e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -14,7 +14,7 @@ class ConfigParser < Hash
14
14
  next if (line =~ /^(#|;)/)
15
15
 
16
16
  # parse out the lines of the config
17
- if line =~ /^(.+?)\s*[=:]\s*(.+)$/ # handle key=value lines
17
+ if line =~ /^\s*(.+?)\s*[=:]\s*(.+)$/ # handle key=value lines
18
18
  if section
19
19
  self[section] = {} unless self[section]
20
20
  key = $1
@@ -1,3 +1,3 @@
1
1
  class Configparser
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,20 @@
1
+ [global]
2
+
3
+ ## Browsing/Identification ###
4
+
5
+ # Change this to the workgroup/NT-domain name your Samba server will part of
6
+ workgroup = WORKGROUP
7
+
8
+ # server string is the equivalent of the NT Description field
9
+ server string = %h server (Samba, Ubuntu)
10
+
11
+ # Windows Internet Name Serving Support Section:
12
+ # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
13
+ # wins support = no
14
+
15
+ # WINS Server - Tells the NMBD components of Samba to be a WINS Client
16
+ # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
17
+ ; wins server = w.x.y.z
18
+
19
+ # This will prevent nmbd to search for NetBIOS names through DNS.
20
+ dns proxy = no
@@ -43,6 +43,14 @@ myway: or the highway
43
43
  assert_equal('un$(resolvable)',cp['section2']['local3'])
44
44
  end
45
45
 
46
+ def test_parse_a_config_with_indents
47
+ cp = ConfigParser.new('test/smb.cfg')
48
+ assert_not_nil(cp)
49
+ assert_equal("WORKGROUP", cp['global']["workgroup"])
50
+ assert_equal("%h server (Samba, Ubuntu)", cp['global']["server string"])
51
+ assert_equal("no", cp['global']["dns proxy"])
52
+ end
53
+
46
54
  def test_parse_from_non_file
47
55
  simple_content = <<end_of_simple
48
56
  test1=hi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - chrislee35
@@ -30,48 +30,48 @@ cert_chain:
30
30
  jLXMQu2ZgISYwXNjNbGVHehut82U7U9oiHoWcrOGazaRUmGO9TXP+aJLH0gw2dcK
31
31
  AfMglXPi
32
32
  -----END CERTIFICATE-----
33
- date: 2014-03-05 00:00:00.000000000 Z
33
+ date: 2014-05-20 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bundler
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.3'
42
42
  type: :development
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
48
  version: '1.3'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: rake
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: minitest
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  description: parses configuration files compatable with Python's ConfigParser
@@ -81,7 +81,7 @@ executables: []
81
81
  extensions: []
82
82
  extra_rdoc_files: []
83
83
  files:
84
- - .gitignore
84
+ - ".gitignore"
85
85
  - Gemfile
86
86
  - LICENSE.txt
87
87
  - README.md
@@ -92,6 +92,7 @@ files:
92
92
  - test/complex.cfg
93
93
  - test/helper.rb
94
94
  - test/simple.cfg
95
+ - test/smb.cfg
95
96
  - test/test_configparser.rb
96
97
  homepage: https://github.com/chrislee35/configparser
97
98
  licenses:
@@ -103,17 +104,17 @@ require_paths:
103
104
  - lib
104
105
  required_ruby_version: !ruby/object:Gem::Requirement
105
106
  requirements:
106
- - - '>='
107
+ - - ">="
107
108
  - !ruby/object:Gem::Version
108
109
  version: '0'
109
110
  required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  requirements:
111
- - - '>='
112
+ - - ">="
112
113
  - !ruby/object:Gem::Version
113
114
  version: '0'
114
115
  requirements: []
115
116
  rubyforge_project:
116
- rubygems_version: 2.1.11
117
+ rubygems_version: 2.2.2
117
118
  signing_key:
118
119
  specification_version: 4
119
120
  summary: parses configuration files compatable with Python's ConfigParser
@@ -121,4 +122,5 @@ test_files:
121
122
  - test/complex.cfg
122
123
  - test/helper.rb
123
124
  - test/simple.cfg
125
+ - test/smb.cfg
124
126
  - test/test_configparser.rb
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- 1���R9��c��_`I�� ���vu�I���"Rr���o[��Ki]Ј90 h]����Y͉^��gX�^o��b�}�&'Ӻ��ɤ���
2
- �݁������Z��4G�������I�ѯ�V}w*���7���!p ,6��y:�"øB�E'�H߆�ŧ�c��"<����O=L��xik�ܑa1�wN���٥�c�3�����j�t~FwY�~Z��h
1
+ x��n�ˉ���qut7���5%�l}�O�>�iGi��{oz ��<�兾FM �ގ`�2Hb�x�C�*�_|&� jp���l�?�XWg��8e�o�vU�]{�~��2����g&n�����|���gJP�6tb������