core_extend 0.1.7 → 0.1.8

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: bdae9b5882a313ffe12d0b2f3e485213e0ed2d60
4
- data.tar.gz: c3c9a6434939aa9373d6f0ddc1b3b8674fc0e4f8
3
+ metadata.gz: a079726c3db000caac5eca6fd2bd8834b4e07d48
4
+ data.tar.gz: 7a75a6fd699ac06556520156c31f16a4947ccf8f
5
5
  SHA512:
6
- metadata.gz: 1f6bce0b5738aa878081d0748b266ecb7070d2925227439dc8bad081d1bf96577f39875f5d36444c83d35223a8a875c2f1cb32a56017023bcc9b3db245129a69
7
- data.tar.gz: eb5cd5433c3c358be10fc93fb2b414045b743a270a3a42ab0a7698322d9c3229e4ff56d396eeac917ffbe59ab8c66d5de9b15510bceb8620b58785537cfa8937
6
+ metadata.gz: c58dd79359f73046892e1409ca75ecf1d22a5331f6787ad396eb2c3fd0bd385a60399911732cb2a1b6bbebfbb886f4780abeb1fd1736fc6675497ad7ba728880
7
+ data.tar.gz: 383e5925e6c2d5e9bdbd59736a041631aa9f217b59a110bbdbb995a41ee68423c1e06009a82446b2d1526238c63ada3b70659d0458ad17f211627184cbe50f61
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- core_extend (0.1.6)
4
+ core_extend (0.1.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -66,6 +66,16 @@ p str
66
66
  #=>"tdb1hruwxd8p0z5qtdl7pvhva5uxbru9"
67
67
  ```
68
68
 
69
+ ## Hash
70
+ ###to_yaml
71
+ ```ruby
72
+ h = {package: 'com.xxx.yyy', appName: '哈哈'}
73
+ puts h.to_yaml
74
+ #=>.--- !ruby/object:Hash
75
+ #=>:appName: 哈哈
76
+ #=>:package: com.xxx.yyy
77
+ ```
78
+
69
79
 
70
80
  ## Development
71
81
 
data/lib/core_extend.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'core_extend/version'
2
2
  require 'erb'
3
+ require 'yaml'
3
4
  require 'core_extend/float_module'
4
5
 
5
6
  Dir.glob("#{File.dirname(__FILE__)}/core_extend/*.rb") { |f| require f }
@@ -0,0 +1,11 @@
1
+ class Hash
2
+ def to_yaml(opts = {})
3
+ YAML::quick_emit(object_id, opts) do |out|
4
+ out.map(taguri, to_yaml_style) do |map|
5
+ sort.each do |k, v| # "sort" added
6
+ map.add(k, v)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module CoreExtend
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core_extend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,6 +61,7 @@ files:
61
61
  - lib/core_extend/big_decimal.rb
62
62
  - lib/core_extend/float.rb
63
63
  - lib/core_extend/float_module.rb
64
+ - lib/core_extend/hash.rb
64
65
  - lib/core_extend/integer.rb
65
66
  - lib/core_extend/random.rb
66
67
  - lib/core_extend/version.rb