json_compacker 0.1.0 → 0.1.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 +33 -10
- data/json_compacker.gemspec +1 -1
- data/lib/json_compacker/version.rb +1 -1
- metadata +1 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22ce3faf607ed465ffe76b19e800afcc12bbb22e
|
4
|
+
data.tar.gz: 5b4b6b63a23fcbe4802a96bf8f6152fc926ebe0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2988eae971ac7d1cceb3bd4c96619296f572986988df5d3ad52643b8f56406af7ff77b7ade7cef8009b4675f7f96ef1ab951666f0bdaec9e21ecb18ffc68a52
|
7
|
+
data.tar.gz: efe34e2a8b1de306ee6d8c0e2bad402eea89319e916b87e049a27850ec48f57a6be35e080af5fafb694a832e49d533f3bac687e072d3a950f4411e5d9f3e1dde
|
data/README.md
CHANGED
@@ -3,25 +3,43 @@ compack multiple json files into one, for the loading speed
|
|
3
3
|
|
4
4
|
## Installation
|
5
5
|
|
6
|
-
|
6
|
+
Install it yourself as:
|
7
|
+
|
8
|
+
$ sudo gem install json_compacker
|
9
|
+
|
10
|
+
On Mac you need set the install path to local for the special feature on Mac
|
11
|
+
|
12
|
+
$ sudo gem install -n /usr/local/bin json_compacker
|
13
|
+
|
14
|
+
## Usage
|
7
15
|
|
8
16
|
```ruby
|
9
|
-
|
17
|
+
json_compacker -s src_json_path -o output_file
|
10
18
|
```
|
11
19
|
|
12
|
-
|
20
|
+
every json will compack into a single file with a key-value which key is the filename and value is origin json object.
|
13
21
|
|
14
|
-
|
22
|
+
## Example
|
23
|
+
in the src path, test path have
|
24
|
+
a.json:
|
25
|
+
{
|
26
|
+
"a": 1
|
27
|
+
}
|
15
28
|
|
16
|
-
|
29
|
+
b.json:
|
30
|
+
{
|
31
|
+
"b": "b"
|
32
|
+
}
|
17
33
|
|
18
|
-
|
34
|
+
c.json:
|
35
|
+
{
|
36
|
+
"c" : [1,2,3],
|
37
|
+
"d" : "d"
|
38
|
+
}
|
19
39
|
|
20
|
-
|
40
|
+
output is:(compacked without space)
|
41
|
+
{"a":{"a":1},"b":{"b":"b"},"c":{"c":[1,2,3],"d":"d"}}
|
21
42
|
|
22
|
-
```ruby
|
23
|
-
json_compacker -p src_json_path -o output_file
|
24
|
-
```
|
25
43
|
|
26
44
|
## Development
|
27
45
|
|
@@ -33,6 +51,11 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
33
51
|
|
34
52
|
Bug reports and pull requests are welcome on GitHub at https://github.com/jtianling/json_compacker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
35
53
|
|
54
|
+
1. Fork it
|
55
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
56
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
57
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
58
|
+
5. Create new Pull Request
|
36
59
|
|
37
60
|
## License
|
38
61
|
|
data/json_compacker.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
26
|
spec.bindir = 'exe'
|
27
|
-
spec.executables =
|
27
|
+
spec.executables = ['json_compacker']
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.12"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_compacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jtianling
|
@@ -42,9 +42,7 @@ description: compack multiple json files into one, for the loading speed
|
|
42
42
|
email:
|
43
43
|
- jtianling@gmail.com
|
44
44
|
executables:
|
45
|
-
- console
|
46
45
|
- json_compacker
|
47
|
-
- setup
|
48
46
|
extensions: []
|
49
47
|
extra_rdoc_files: []
|
50
48
|
files:
|