coolkit 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5824a5224b213f0f640864757a042cddff2994a46450066b5cbb7438604a95b
4
- data.tar.gz: 43a8a6ea69ae91e8389f0b730c5d88544004821d6494926bc0e5c618f853c2c1
3
+ metadata.gz: 9ad36bff0a52088342ecb08344d0de312ff5c3a0b9c9ef9c48284dc6c920152c
4
+ data.tar.gz: b907315cb342b131b2b7dffaec5b8b1e757396999e0b8d500f9c327a9d252913
5
5
  SHA512:
6
- metadata.gz: 5c6c1b58118ec3b4ab741bcdd5fefc5cc9b5f3005c884a8a8826616b306792817137d9a25f0e161f6e2c3c3d63726b1bf295adc42ab63bf6015d9931280984f0
7
- data.tar.gz: 607c920e59c12184e2fb16cd42166556b3951f8f6740f812e13fb0932ee7b4fa633f02afa29f0e57bb49080ad2161441cb28b039680dbf63abf3c8a395c057df
6
+ metadata.gz: 7f92f5384b3e470fea659e3718752c5e92c6758d0f45f2bb3331d3dcb8bd71818e38e4e232aa8e1833ff1c37069a438f62f3c06e6d6fd3cfa33e69a360ba5faa
7
+ data.tar.gz: bd1a2364ac6a2132a91e4c08f737e99b4f147bab2438df1e722da9148f1944e520582bc8c6344b079a2a964df0bce4f42e3ef04117943edbea3b209cdf47a91a
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /ignore/
10
+ .rake_tasks
@@ -0,0 +1,2 @@
1
+ --charset utf-8
2
+ --markup markdown
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  <!-- ## [Unreleased] -->
9
9
 
10
+ ## 0.2.0 (2019-11-17)
11
+
12
+ ### Added
13
+
14
+ - `JSON.read` to replace `JSON.parse(File.read(path))`. Inspired by `CSV.read`.
15
+
10
16
  ## 0.1.0 (2019-11-17)
11
17
 
12
18
  ### Added
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coolkit (0.1.0)
4
+ coolkit (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Coolkit
2
2
 
3
+ [![Gem](https://img.shields.io/gem/v/coolkit)](https://rubygems.org/gems/coolkit)
3
4
  [![Build Status](https://travis-ci.org/tcd/coolkit.svg?branch=master)](https://travis-ci.org/tcd/coolkit)
4
5
  [![Coverage Status](https://coveralls.io/repos/github/tcd/coolkit/badge.svg?branch=master)](https://coveralls.io/github/tcd/coolkit?branch=master)
5
6
  [![GitHub](https://img.shields.io/github/license/tcd/coolkit)](https://github.com/tcd/coolkit/blob/master/LICENSE.txt)
7
+ [![Documentation](http://img.shields.io/badge/docs-rubydoc.org-blue.svg)](https://www.rubydoc.info/gems/coolkit)
6
8
 
7
9
  Useful ruby code with no dependencies.
8
10
 
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Rebuild project documentation and serve it locally.
4
+ rm -rf .yardoc && yard server -r
@@ -15,7 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.metadata = {
16
16
  "homepage_uri" => spec.homepage,
17
17
  "source_code_uri" => spec.homepage,
18
- "changelog_uri" => spec.homepage,
18
+ "changelog_uri" => "https://github.com/tcd/coolkit/blob/master/CHANGELOG.md",
19
+ "yard.run" => "yri", # use "yard" to build full HTML docs.
19
20
  }
20
21
 
21
22
  # Specify which files should be added to the gem when it is released.
@@ -0,0 +1,16 @@
1
+ module JSON
2
+ # Parse JSON data from a file at the given path.
3
+ #
4
+ # TODO: Test this on [ruby 2.7][1]
5
+ #
6
+ # @param path [String]
7
+ # @param opts [Hash] Options to pass to [`JSON.parse`][2].
8
+ # @param (see #parse)
9
+ # @return [Hash]
10
+ #
11
+ # [1]: https://blog.saeloun.com/2019/10/07/ruby-2-7-keyword-arguments-redesign.html
12
+ # [2]: https://ruby-doc.org/stdlib-2.6.3/libdoc/json/rdoc/JSON.html#method-i-parse
13
+ def self.read(path, opts = {})
14
+ return self.parse(File.read(path), opts)
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Coolkit
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay Dunston
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-17 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,6 +118,7 @@ files:
118
118
  - ".gitignore"
119
119
  - ".rubocop.yml"
120
120
  - ".travis.yml"
121
+ - ".yardopts"
121
122
  - CHANGELOG.md
122
123
  - Gemfile
123
124
  - Gemfile.lock
@@ -125,12 +126,14 @@ files:
125
126
  - README.md
126
127
  - Rakefile
127
128
  - bin/console
129
+ - bin/docs
128
130
  - bin/setup
129
131
  - coolkit.gemspec
130
132
  - lib/coolkit.rb
131
133
  - lib/coolkit/array/remove_first.rb
132
134
  - lib/coolkit/error.rb
133
135
  - lib/coolkit/filesystem.rb
136
+ - lib/coolkit/json.rb
134
137
  - lib/coolkit/paths.rb
135
138
  - lib/coolkit/string/comment.rb
136
139
  - lib/coolkit/string/indent.rb
@@ -144,7 +147,8 @@ licenses:
144
147
  metadata:
145
148
  homepage_uri: https://github.com/tcd/coolkit
146
149
  source_code_uri: https://github.com/tcd/coolkit
147
- changelog_uri: https://github.com/tcd/coolkit
150
+ changelog_uri: https://github.com/tcd/coolkit/blob/master/CHANGELOG.md
151
+ yard.run: yri
148
152
  post_install_message:
149
153
  rdoc_options: []
150
154
  require_paths: