inidol 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/inidol.rb +17 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6cc13eb65f4561305df034009056ff4955799423
4
+ data.tar.gz: 5afc4f930e35454b149b75584ae7b653db9f3e00
5
+ SHA512:
6
+ metadata.gz: 2bf9e727396ca6d91f320927dcc935c7c77028ea1d3a6f085f7276158c1f3109d7a1172416a0a188352c5607f7e4d022afc41348507e78c3efba57ab97e5ab11
7
+ data.tar.gz: fede84ffe58270ab074157fb9dac6d768adea4d500ac1f6313f3ed24ffc805a7a5724533773c3a5fdd9029d7a4f69760419ad8db1ef624ed3ca37d91259ac89b
data/lib/inidol.rb ADDED
@@ -0,0 +1,17 @@
1
+ class Hash
2
+ def to_ini
3
+ result = ''
4
+ self.each do |key, value|
5
+ if value.instance_of?(Hash)
6
+ result += "\n[#{key}]\n#{value.to_ini}"
7
+ elsif value.instance_of?(Array)
8
+ value.each do |element|
9
+ result += "#{key}[]=#{element}\n"
10
+ end
11
+ else
12
+ result += "#{key}=#{value}\n"
13
+ end
14
+ end
15
+ result
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: inidol
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - homonoid
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-09-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Inidol is for Hash -> INI converting
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/inidol.rb
20
+ homepage: https://github.com/homonoid/inidol
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.5.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Inidol
44
+ test_files: []