kori 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/Gemfile +1 -0
  4. data/README.md +10 -5
  5. data/kori.gemspec +1 -1
  6. data/lib/kori.rb +2 -1
  7. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66fb858b63dabff08dc6e959e8e7f491a1fac555
4
- data.tar.gz: 330b0e16ab07e6d7fb32888c94aca6035bbaf415
3
+ metadata.gz: 7a174295f0da0dd1d18d2d923e39bcc9acc1f55a
4
+ data.tar.gz: 7d906c048cc5f37f16a3475b5b68526bb11a670e
5
5
  SHA512:
6
- metadata.gz: ef7f21bc9252ced63909f44aeb1ae4489975919d3cbdc89abbe19a589e3c04881cc4e0001505be397bcf083667e4374e911c18e6af1e92dccfd555b971f67eef
7
- data.tar.gz: ad25b5fbe62a7ce8f7876ad75e8133a8f0da0b7f8e871014f2ec9ee1e5720932db3ad9bed0bd2b3ba9cb6ba9ec1bf90a9de0b1c484a0cf5d43c99beb053df2e9
6
+ metadata.gz: 5492aacdd29e4b870406ad6ea932a027324ee7d2999d0c6326f8a6e49ba4881c9ce32641c6c619b814fc898ba3a6c3860e0c8a76e735ff384613ccdcfa9fddf3
7
+ data.tar.gz: 440b0476586446c93acd5c4653954e3a8c6a645e4ee239290feb7c054f4d63c52867f9f91b81ff077438dc794edd9e5af065fc157036e1ede7b9abfbac413d57
data/.travis.yml CHANGED
@@ -2,3 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 2.2.2
4
4
  before_install: gem install bundler -v 1.10.5
5
+ addons:
6
+ code_climate:
7
+ repo_token: c05778589e31826bd230d58f92c598299c96c83805126865525a976c0d4807ce
data/Gemfile CHANGED
@@ -13,6 +13,7 @@ group :test do
13
13
  gem 'minitest-power_assert'
14
14
  gem 'minitest-stub_any_instance'
15
15
  gem 'minitest-reporters'
16
+ gem "codeclimate-test-reporter", require: false
16
17
  end
17
18
 
18
19
  # Specify your gem's dependencies in kori.gemspec
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Kori
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/kori.svg)](https://badge.fury.io/rb/kori)
4
+ [![Build Status](https://travis-ci.org/nalabjp/kori.svg?branch=master)](https://travis-ci.org/nalabjp/kori)
5
+ [![Code Climate](https://codeclimate.com/repos/5648b1ae1787d73e1f016cf6/badges/5e21bf44e70faa02d88a/gpa.svg)](https://codeclimate.com/repos/5648b1ae1787d73e1f016cf6/feed)
6
+ [![Test Coverage](https://codeclimate.com/repos/5648b1ae1787d73e1f016cf6/badges/5e21bf44e70faa02d88a/coverage.svg)](https://codeclimate.com/repos/5648b1ae1787d73e1f016cf6/coverage)
7
+
3
8
  Kori generate deep frozen objects from yaml or hash.
4
9
  It using a [ice_nine](https://github.com/dkubb/ice_nine), inspired by [Settingslogic](https://github.com/settingslogic/settingslogic).
5
10
 
@@ -14,7 +19,7 @@ Kori(kōri) means Ice in japanese.
14
19
  require 'kori'
15
20
 
16
21
  # From Hash
17
- config = Kori.create({ a: 1, b: { c: 'abc' } })
22
+ config = Kori.freeze({ a: 1, b: { c: 'abc' } })
18
23
  config.a # 1
19
24
  config[:a] # 1
20
25
  config['a'] # 1
@@ -27,12 +32,12 @@ Kori(kōri) means Ice in japanese.
27
32
  config.b.c.frozen? # true
28
33
 
29
34
  # From YAML
30
- config = Kori.create('app_config.yml') # load from ./app_config.yml
31
- config = Kori.create('/path/to/app_config.yml') # load from /path/to/app_config.yml
35
+ config = Kori.freeze('app_config.yml') # load from ./app_config.yml
36
+ config = Kori.freeze('/path/to/app_config.yml') # load from /path/to/app_config.yml
32
37
 
33
38
  # If you are using Rails, it is possible to use as `Rails.application.config_for`
34
- config = Kori.create(:app_config) # load from /rails_root/config/app_config.yml
35
- config = Kori.create('subdir/app_config') # load from /rails_root/config/subdir/app_config.yml
39
+ config = Kori.freeze(:app_config) # load from /rails_root/config/app_config.yml
40
+ config = Kori.freeze('subdir/app_config') # load from /rails_root/config/subdir/app_config.yml
36
41
 
37
42
  ## License
38
43
 
data/kori.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'kori'
7
- spec.version = '0.2.0'
7
+ spec.version = '0.3.0'
8
8
  spec.authors = ['nalabjp']
9
9
  spec.email = ['nalabjp@gmail.com']
10
10
 
data/lib/kori.rb CHANGED
@@ -6,9 +6,10 @@ class Kori < Hash
6
6
  private_class_method :new
7
7
 
8
8
  class << self
9
- def create(file_or_hash)
9
+ def freeze(file_or_hash)
10
10
  IceNine.deep_freeze(new(file_or_hash))
11
11
  end
12
+ alias :create :freeze
12
13
 
13
14
  undef_method :[]
14
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kori
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nalabjp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_nine