editorconfig 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/editor_config.rb +4 -16
- data/lib/editor_config/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: 1e1a47db3cdf95e4fc2b97f54136d5446fbeea6c
|
4
|
+
data.tar.gz: b8f33f8d96bc75b140091cf1b5fb3f9552edc687
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fb9729bf61e957da4e27d7c309e720fea5dd97f549afaee4a519d122a96571d1d71ac65acf2a2f717721ead9759a01c891f12a62f12c25e0916bb3124c843f7
|
7
|
+
data.tar.gz: 425ec22a09d801773e0b13bbf7413dfed3cd9a20176b3a2716610da493f41a0ac1b8d6ad6da1972f3fc00eb4110499acef99c87b5ff58d2f1b268e075ad70763
|
data/lib/editor_config.rb
CHANGED
@@ -48,18 +48,6 @@ module EditorConfig
|
|
48
48
|
# components.
|
49
49
|
DEFAULT_FILENAME = "filename".freeze
|
50
50
|
|
51
|
-
# Internal: Maximum number of bytes to read per line. Lines over this limit
|
52
|
-
# will be truncated.
|
53
|
-
MAX_LINE = 200
|
54
|
-
|
55
|
-
# Internal: Maximum byte length of section name Strings. Names over this limit
|
56
|
-
# will be truncated.
|
57
|
-
MAX_SECTION_NAME = 500
|
58
|
-
|
59
|
-
# Internal: Maximum byte length of property name String. Names over this limit
|
60
|
-
# will be truncated.
|
61
|
-
MAX_PROPERTY_NAME = 500
|
62
|
-
|
63
51
|
# Internal: Maximum byte length of filename path. Paths over this limit will
|
64
52
|
# default to global "*" properties.
|
65
53
|
MAX_FILENAME = 4096
|
@@ -94,13 +82,13 @@ module EditorConfig
|
|
94
82
|
case line
|
95
83
|
when /\Aroot(\s+)?\=(\s+)?true\Z/i
|
96
84
|
root = true
|
97
|
-
when /\A\s*\[(?<name
|
85
|
+
when /\A\s*\[(?<name>.{1,4096})\]\s*\Z/
|
98
86
|
# section marker
|
99
|
-
last_section = Regexp.last_match[:name]
|
87
|
+
last_section = Regexp.last_match[:name]
|
100
88
|
config[last_section] ||= {}
|
101
|
-
when /\A\s*(?<name>[[:word:]]
|
89
|
+
when /\A\s*(?<name>[[:word:]]{1,50})\s*(\=|:)\s*(?<value>.{1,255})\s*\Z/
|
102
90
|
match = Regexp.last_match
|
103
|
-
name, value = match[:name]
|
91
|
+
name, value = match[:name].strip, match[:value].strip
|
104
92
|
config[last_section][name] = value if last_section
|
105
93
|
end
|
106
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: editorconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|