aigu 0.5.1 → 0.6

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: 5fdb5bb14cd6a7eae3740682157c4b191a4cec7e
4
- data.tar.gz: 12e0582f9321bae273c470f63d753cf5b4454ef5
3
+ metadata.gz: 0fd149f963c09f87e0c98ce37d2d18c097f63429
4
+ data.tar.gz: 5abda80734cad210e3753b377d622aa01d0b9284
5
5
  SHA512:
6
- metadata.gz: e6c9afb797fdd833f2ae97f922fe2a428b4187f6ebfd63ceae744bc5f3d0ba6dd26603f2fc7c7bd56596a3eaf273bfbaeab676299d7d5eddb8bbb5917dd58834
7
- data.tar.gz: a44afd273329859bd8896affb29ac95560470dcc7a2c9c530bb5489d795b6cd82a885ad6da7df6d501e95ee0a9141a5c298c8dc87d63a27f198fbeb0a48c4a8b
6
+ metadata.gz: 4be0e6074cdd88f7ba8d445e86dafb4c8b8735f1ce4a6fb0a7b89c7f9a87cb23533a9eaaace2ee3d02bd08e8b91180614f065651805be39a6e0d3f4f1a173a4c
7
+ data.tar.gz: 2781c2102ffb0b9817ef7063850d8434e497aff7b22cac0012d0eae068980512ca571c2cd39001425fae7c0bef79d62be2a794faf973aca9976dcadb37e8c359
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'phare', '~> 0.6'
25
25
  spec.add_development_dependency 'rubocop', '~> 0.27.0'
26
26
 
27
- spec.add_dependency 'nokogiri', '~> 1.6.3'
27
+ spec.add_dependency 'nokogiri', '~> 1.6'
28
28
  end
@@ -19,7 +19,7 @@ module Aigu
19
19
 
20
20
  def parse_json
21
21
  json = File.read(@input_file)
22
- @object = JSON.parse(json)
22
+ @object = JSON.parse(json).sort_with_keys
23
23
  @object = expand_content_values(@object)
24
24
  @object = escape_special_characters(@object)
25
25
  end
@@ -19,7 +19,7 @@ module Aigu
19
19
 
20
20
  def parse_json
21
21
  json = File.read(@input_file)
22
- @object = JSON.parse(json)
22
+ @object = JSON.parse(json).sort_with_keys
23
23
  end
24
24
 
25
25
  def read_java
@@ -16,7 +16,7 @@ module Aigu
16
16
 
17
17
  def parse_json
18
18
  json = File.read(@input_file)
19
- @object = JSON.parse(json)
19
+ @object = JSON.parse(json).sort_with_keys
20
20
  end
21
21
 
22
22
  def write_javascript_file
@@ -10,4 +10,12 @@ class Hash
10
10
  memo.merge! key.to_sym => value
11
11
  end
12
12
  end
13
+
14
+ def sort_with_keys
15
+ sort.to_h.tap do |hash|
16
+ hash.each_pair do |key, value|
17
+ hash.merge! key => value.sort_with_keys if value.is_a?(Hash)
18
+ end
19
+ end
20
+ end
13
21
  end
@@ -22,7 +22,7 @@ module Aigu
22
22
 
23
23
  def parse_json
24
24
  json = File.read(@input_file)
25
- @object = JSON.parse(json)
25
+ @object = JSON.parse(json).sort_with_keys
26
26
  end
27
27
 
28
28
  def split_dict
@@ -18,7 +18,7 @@ module Aigu
18
18
 
19
19
  def parse_json
20
20
  json = File.read(@input_file)
21
- @object = JSON.parse(json)
21
+ @object = JSON.parse(json).sort_with_keys
22
22
  @object = expand_content_values(@object)
23
23
  @object = localize_content_keys(@object)
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module Aigu
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Aigu::RailsImporter do
4
- describe :build_blob do
4
+ describe :expand_content_values do
5
5
  let(:importer) { Aigu::RailsImporter.new }
6
6
  let(:expanded_content) { importer.send(:expand_content_values, content) }
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aigu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rémi Prévost
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-27 00:00:00.000000000 Z
12
+ date: 2015-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 1.6.3
90
+ version: '1.6'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 1.6.3
97
+ version: '1.6'
98
98
  description: Aigu converts a directory of Rails localization files into a single JSON
99
99
  file to import in Accent.
100
100
  email: