apstrings 0.2.0 → 0.2.1
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 +4 -4
- data/README.md +19 -3
- data/lib/apstrings/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2654ba9a832170ed36762b56735ed6ba7c07e19
|
4
|
+
data.tar.gz: ba194e889adfdcb6217d84a8f3a7d06f320d83a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d284ad330632b177317620c1c7092bffe8ac1d84cc93e525eb59eef60c418f41b682b4138167a4bd6f5dc1b2df3413025a79dcddc8643712ae56e7bf2bd56d0
|
7
|
+
data.tar.gz: 71d4d1c27185dc11491677be60b01af6dad88e5da87edba3767dbb0ae615554162d74f2b54559940915be746b487e1aa9ebfed27335dcaa10f803e4f1565464d
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Apstrings
|
2
2
|
|
3
|
-
|
3
|
+
Apple dot strings file parser and validator in ruby.
|
4
4
|
|
5
5
|
Valid input strings file formats :
|
6
6
|
|
@@ -31,16 +31,32 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
## Usage
|
33
33
|
|
34
|
+
|
35
|
+
####1. Parse a .strings file to json/hash in ruby :
|
34
36
|
```
|
35
|
-
|
37
|
+
require 'apstrings'
|
38
|
+
|
39
|
+
|
40
|
+
string_file = Apstring.parse('path/to/dotStringFile.strings')
|
36
41
|
|
37
|
-
string_file.to_hash
|
42
|
+
string_file.to_hash # => {key1 => value1 , key2 = > value2 ...}
|
38
43
|
|
39
44
|
string_file.to_json
|
40
45
|
|
41
46
|
|
42
47
|
```
|
43
48
|
|
49
|
+
|
50
|
+
####2. Run a validation for a .strings file and (optionally) compare a master .strings file to find missing keys.
|
51
|
+
|
52
|
+
```
|
53
|
+
require 'apstrings'
|
54
|
+
|
55
|
+
Apstrings.validate('path/to/dotStringFile.strings','path/to/masterDotStringFile.strings')
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
|
44
60
|
## Development
|
45
61
|
|
46
62
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake true` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/apstrings/version.rb
CHANGED