nx-yaml 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: ef34a5526be2214ea4461bc0ebd557d8a31756c5978556ce816c67cd4f8bb711
4
- data.tar.gz: 4452033b85c4160165a3fbe02140a5595f0d360b1b239337e1da27c8b1b36bb1
3
+ metadata.gz: aa75a020bfec141d1c18a1de80fdc3a45d96c132f186f237c570598b82f82c93
4
+ data.tar.gz: abe23262e49c0aea453436084d2d9909907466dad468b01b85e20ff91c9aedc9
5
5
  SHA512:
6
- metadata.gz: 420e36d7e6990f962dd0bbee26b417ac02e382f54addd0b356214c11eae31ee6f28de3331dcfe848d6daeef4c9906b36bd6e741ca3923d70d70b2e51f89e1784
7
- data.tar.gz: 9be5529f2ef7d9aa7d7e1469585e3d83c6fd1aee97d0750548ea026ddfce0f68be8ccb94ad1cc578478ef96a9c3f28a64bb190cc2a6c9e6dc9af605103be9dad
6
+ metadata.gz: 97a0ae1ac0c0fd5547058e590acdd1774cb64e239b6c78a7d3485fb9e6752e5cf8ec904bdbd54a5280f99e76bee1a42754b34a8e717ed54239040af7d60abac3
7
+ data.tar.gz: 82efdeb24dd6bbe2db8251a55c4426b2f5aef64ecc4df7ec194eb82cf3d647211d5cc2b5154fb93c920ee2c5d67a23fbd875c53a6afc5260bd39be3592253147
data/README.md CHANGED
@@ -16,16 +16,23 @@ Nx::Yaml.load('./template.yml', { name: 'my-template', description: 'Awesome tem
16
16
 
17
17
  ## template.yml
18
18
  ```yml
19
- name: <%= name %>
20
- description: <%= description %>
21
- version: 1.0.0
19
+ name: nx-yml
20
+ version: 0.1.0
21
+ env:
22
+ home: <%= ENV["HOME"] %>
23
+ host: <%= host %>
22
24
  ```
23
25
 
24
26
  <!-- After load -->
25
- ```yml
26
- name: my-template
27
- description: Awesome template
28
- version: 1.0.0
27
+ ```rb
28
+ {
29
+ "name"=>"nx-yml",
30
+ "version"=>"0.1.0",
31
+ "env"=>{
32
+ "home"=>"/Users/aric.zheng"
33
+ },
34
+ "host"=>"0.0.0.0"
35
+ }
29
36
  ```
30
37
 
31
38
  ## build/publish
@@ -6,10 +6,10 @@ RSpec.describe Nx do
6
6
  path = File.join(File.dirname(__FILE__), "template_with_var.yml")
7
7
  res = Nx::Yaml.load(path, { host: "0.0.0.0" })
8
8
  expect(res).to eq(
9
- "name" => "nx-yml",
10
- "version" => "0.1.0",
11
- "env" => { "home" => ENV["HOME"] },
12
- "host" => "0.0.0.0",
9
+ name: "nx-yml",
10
+ version: "0.1.0",
11
+ env: { home: ENV["HOME"] },
12
+ host: "0.0.0.0",
13
13
  )
14
14
  end
15
15
 
@@ -17,8 +17,8 @@ RSpec.describe Nx do
17
17
  path = File.join(File.dirname(__FILE__), "template_pure.yml")
18
18
  res = Nx::Yaml.load(path)
19
19
  expect(res).to eq(
20
- "name" => "nx-yml",
21
- "version" => "0.1.0",
20
+ name: "nx-yml",
21
+ version: "0.1.0",
22
22
  )
23
23
  end
24
24
  end
data/lib/nx/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Nx
2
2
  class Yaml
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
data/lib/nx/yaml.rb CHANGED
@@ -19,7 +19,7 @@ module Nx
19
19
  def self.load(in_path, in_data = nil)
20
20
  raw_content = File.read(in_path)
21
21
  str = in_data.nil? ? raw_content : ErbalT::render_from_hash(raw_content, in_data)
22
- YAML::load str
22
+ YAML::load(str, symbolize_names: true)
23
23
  end
24
24
  end
25
25
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx-yaml",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Nx yaml tools.",
5
5
  "directories": {
6
6
  "lib": "lib"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nx-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - afeiship
@@ -79,7 +79,6 @@ files:
79
79
  - lib/nx-yaml.rb
80
80
  - lib/nx/version.rb
81
81
  - lib/nx/yaml.rb
82
- - nx-yaml-0.1.0.gem
83
82
  - nx-yaml.gemspec
84
83
  - package.json
85
84
  homepage: https://github.com/afeiship/nx-yaml