sengiri_yaml 0.0.2 → 1.0.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
- SHA1:
3
- metadata.gz: b47b759a07bd35a6b000cec3c24caec24f961202
4
- data.tar.gz: c3c5e0f81bf005a146871b7e05915b592b5bf9a9
2
+ SHA256:
3
+ metadata.gz: 58102e42e98edcba9e565ec3eed04d5ca52248376233d343c9d0d3a697ee767c
4
+ data.tar.gz: 5e2c9d8532612d4340ccbdf57960d567fce4e9329d84e354116a45f797d1a105
5
5
  SHA512:
6
- metadata.gz: c7b150b112e87b114441113e799c61038cc71510349e8d4dab9ab030f963f5966602d88d4e5ced5ac20236f5a019f6fb5a73434baa405f2395031aba9dff33f9
7
- data.tar.gz: b87d00a1ce254ecfc52a3b4fe9e075cba9050c4875ecc8c6ca9780697f09e3214c6cf8f8afd5ee51ff043f7ab14582693b027a2ae0a26e5970988f6e0f8890e7
6
+ metadata.gz: 68cb3de869aa0d7037e69726353da740b85df293daa8a26c38020e6de67a4cabad85c76f639398241334f8c80cd20e7be1ea384824728670e10b67a7698d5ff7
7
+ data.tar.gz: 7b1a37b4bda515d13c09bf8f5634193a11b3a3543afbf76525896f9ff631a38ed4dc7e4357864f50941b946340fd827de4599aa1b7afa09b960ed77f2a8a85e4
@@ -0,0 +1,88 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+
19
+ container: ${{ matrix.ruby }}
20
+
21
+ strategy:
22
+ fail-fast: false
23
+
24
+ matrix:
25
+ ruby:
26
+ - ruby:2.6
27
+ - ruby:2.7
28
+ - ruby:3.0
29
+ - ruby:3.1
30
+ - rubylang/ruby:master-nightly-bionic
31
+ include:
32
+ - ruby: rubylang/ruby:master-nightly-bionic
33
+ allow_failures: "true"
34
+
35
+ steps:
36
+ - uses: actions/checkout@v2
37
+
38
+ - name: Cache vendor/bundle
39
+ uses: actions/cache@v1
40
+ id: cache_gem
41
+ with:
42
+ path: vendor/bundle
43
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
44
+ restore-keys: |
45
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
46
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
47
+
48
+ - name: bundle update
49
+ run: |
50
+ set -xe
51
+ bundle config path vendor/bundle
52
+ bundle update --jobs $(nproc) --retry 3
53
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
54
+
55
+ - name: Run test
56
+ run: |
57
+ set -xe
58
+ bundle exec rspec
59
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
60
+
61
+ - name: Slack Notification (not success)
62
+ uses: lazy-actions/slatify@master
63
+ if: "! success()"
64
+ continue-on-error: true
65
+ with:
66
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
67
+ type: ${{ job.status }}
68
+ icon_emoji: ":octocat:"
69
+ url: ${{ secrets.SLACK_WEBHOOK }}
70
+ token: ${{ secrets.GITHUB_TOKEN }}
71
+
72
+ notify:
73
+ needs:
74
+ - test
75
+
76
+ runs-on: ubuntu-latest
77
+
78
+ steps:
79
+ - name: Slack Notification (success)
80
+ uses: lazy-actions/slatify@master
81
+ if: always()
82
+ continue-on-error: true
83
+ with:
84
+ job_name: '*build*'
85
+ type: ${{ job.status }}
86
+ icon_emoji: ":octocat:"
87
+ url: ${{ secrets.SLACK_WEBHOOK }}
88
+ token: ${{ secrets.GITHUB_TOKEN }}
data/CHANGELOG.md ADDED
@@ -0,0 +1,43 @@
1
+ # Change Log
2
+
3
+ ## Unreleased
4
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v1.0.0...master)
5
+
6
+ ## [v1.0.0](https://github.com/sue445/sengiri_yaml/tree/v0.0.4) (2021-12-31)
7
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.4...v1.0.0)
8
+
9
+ * **:bomb: [Breaking Change]** Use `permitted_classes` and `aliases` for Ruby 3.1+ and drop support ruby < 2.6
10
+ * https://github.com/sue445/sengiri_yaml/pull/26
11
+
12
+ ## [v0.0.4](https://github.com/sue445/sengiri_yaml/tree/v0.0.4) (2021-11-20)
13
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.3...v0.0.4)
14
+
15
+ * Enable MFA requirement for gem releasing
16
+ * https://github.com/sue445/sengiri_yaml/pull/24
17
+
18
+ ## [v0.0.3](https://github.com/sue445/sengiri_yaml/tree/v0.0.3) (2016-04-26)
19
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.2...v0.0.3)
20
+
21
+ **Merged pull requests:**
22
+
23
+ - Load yaml file with order by filename [\#5](https://github.com/sue445/sengiri_yaml/pull/5) ([sue445](https://github.com/sue445))
24
+
25
+ ## [v0.0.2](https://github.com/sue445/sengiri_yaml/tree/v0.0.2) (2015-01-26)
26
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.1...v0.0.2)
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Bugfix: NameError in irb [\#3](https://github.com/sue445/sengiri_yaml/pull/3) ([sue445](https://github.com/sue445))
31
+
32
+ ## [v0.0.1](https://github.com/sue445/sengiri_yaml/tree/v0.0.1) (2014-12-31)
33
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.1.beta1...v0.0.1)
34
+
35
+ ## [v0.0.1.beta1](https://github.com/sue445/sengiri_yaml/tree/v0.0.1.beta1) (2014-12-31)
36
+ **Merged pull requests:**
37
+
38
+ - Feature/loader [\#2](https://github.com/sue445/sengiri_yaml/pull/2) ([sue445](https://github.com/sue445))
39
+ - Impl executable file [\#1](https://github.com/sue445/sengiri_yaml/pull/1) ([sue445](https://github.com/sue445))
40
+
41
+
42
+
43
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # SengiriYaml
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/sengiri_yaml.svg)](http://badge.fury.io/rb/sengiri_yaml)
4
- [![Build Status](https://travis-ci.org/sue445/sengiri_yaml.svg?branch=master)](https://travis-ci.org/sue445/sengiri_yaml)
4
+ [![Build Status](https://github.com/sue445/sengiri_yaml/workflows/test/badge.svg?branch=master)](https://github.com/sue445/sengiri_yaml/actions?query=workflow%3Atest)
5
5
  [![Code Climate](https://codeclimate.com/github/sue445/sengiri_yaml/badges/gpa.svg)](https://codeclimate.com/github/sue445/sengiri_yaml)
6
6
  [![Coverage Status](https://img.shields.io/coveralls/sue445/sengiri_yaml.svg)](https://coveralls.io/r/sue445/sengiri_yaml)
7
- [![Dependency Status](https://gemnasium.com/sue445/sengiri_yaml.svg)](https://gemnasium.com/sue445/sengiri_yaml)
8
7
 
9
8
  divide yaml file
10
9
 
@@ -6,15 +6,15 @@ module SengiriYaml
6
6
  # load divided yaml files
7
7
  # @param src_dir [String] divided yaml dir
8
8
  # @return [Hash] merged yaml hash
9
- def load_dir(src_dir)
9
+ def load_dir(src_dir, permitted_classes: [], aliases: false)
10
10
  merged_content = ""
11
11
 
12
- Pathname.glob("#{src_dir}/*.yml") do |yaml_path|
12
+ Pathname.glob("#{src_dir}/*.yml").sort.each do |yaml_path|
13
13
  content = yaml_path.read.gsub(/^---$/, "")
14
14
  merged_content << content
15
15
  end
16
16
 
17
- YAML.load(merged_content)
17
+ YAML.safe_load(merged_content, permitted_classes: permitted_classes, aliases: aliases)
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module SengiriYaml
2
- VERSION = "0.0.2"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/sengiri_yaml.rb CHANGED
@@ -7,7 +7,7 @@ module SengiriYaml
7
7
 
8
8
  # load divided yaml files
9
9
  # @see SengiriYaml::Loader#load_dir
10
- def load_dir(src_dir)
11
- SengiriYaml::Loader.new.load_dir(src_dir)
10
+ def load_dir(src_dir, permitted_classes: [], aliases: false)
11
+ SengiriYaml::Loader.new.load_dir(src_dir, permitted_classes: permitted_classes, aliases: aliases)
12
12
  end
13
13
  end
data/sengiri_yaml.gemspec CHANGED
@@ -13,6 +13,13 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/sue445/sengiri_yaml"
14
14
  spec.license = "MIT"
15
15
 
16
+ spec.required_ruby_version = ">= 2.6"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = spec.homepage
20
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
21
+ spec.metadata["rubygems_mfa_required"] = "true"
22
+
16
23
  spec.files = `git ls-files -z`.split("\x0")
17
24
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
25
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -20,7 +27,7 @@ Gem::Specification.new do |spec|
20
27
 
21
28
  spec.add_development_dependency "bundler"
22
29
  spec.add_development_dependency "coveralls"
23
- spec.add_development_dependency "rake", "~> 10.0"
30
+ spec.add_development_dependency "rake"
24
31
  spec.add_development_dependency "rspec"
25
32
  spec.add_development_dependency "rspec-power_assert"
26
33
  spec.add_development_dependency "rspec-temp_dir"
@@ -1,6 +1,6 @@
1
1
  describe SengiriYaml do
2
2
  describe "sengiri_yaml" do
3
- subject { `bundle exec ./bin/sengiri_yaml #{option}` }
3
+ subject { `./bin/sengiri_yaml #{option}` }
4
4
 
5
5
  context "without 2 args" do
6
6
  let(:option){ "--help" }
@@ -11,7 +11,7 @@ sengiri_yaml <source_yaml> <destination_dir>
11
11
  EOS
12
12
  end
13
13
 
14
- it{ should eq help }
14
+ it{ should start_with help }
15
15
  end
16
16
 
17
17
  context "with 2 args" do
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- if ENV["COVERAGE"]
1
+ if ENV["CI"]
2
2
  require 'coveralls'
3
3
  Coveralls.wear!
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sengiri_yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-26 00:00:00.000000000 Z
11
+ date: 2021-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -117,11 +117,11 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".coveralls.yml"
120
+ - ".github/workflows/test.yml"
120
121
  - ".gitignore"
121
- - ".hound.yml"
122
122
  - ".rspec"
123
- - ".travis.yml"
124
123
  - ".yardopts"
124
+ - CHANGELOG.md
125
125
  - Gemfile
126
126
  - LICENSE.txt
127
127
  - README.md
@@ -143,8 +143,12 @@ files:
143
143
  homepage: https://github.com/sue445/sengiri_yaml
144
144
  licenses:
145
145
  - MIT
146
- metadata: {}
147
- post_install_message:
146
+ metadata:
147
+ homepage_uri: https://github.com/sue445/sengiri_yaml
148
+ source_code_uri: https://github.com/sue445/sengiri_yaml
149
+ changelog_uri: https://github.com/sue445/sengiri_yaml/blob/master/CHANGELOG.md
150
+ rubygems_mfa_required: 'true'
151
+ post_install_message:
148
152
  rdoc_options: []
149
153
  require_paths:
150
154
  - lib
@@ -152,16 +156,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
156
  requirements:
153
157
  - - ">="
154
158
  - !ruby/object:Gem::Version
155
- version: '0'
159
+ version: '2.6'
156
160
  required_rubygems_version: !ruby/object:Gem::Requirement
157
161
  requirements:
158
162
  - - ">="
159
163
  - !ruby/object:Gem::Version
160
164
  version: '0'
161
165
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 2.4.5
164
- signing_key:
166
+ rubygems_version: 3.3.3
167
+ signing_key:
165
168
  specification_version: 4
166
169
  summary: divide yaml file
167
170
  test_files:
@@ -173,4 +176,3 @@ test_files:
173
176
  - spec/sengiri_yaml/loader_spec.rb
174
177
  - spec/sengiri_yaml/writer_spec.rb
175
178
  - spec/spec_helper.rb
176
- has_rdoc:
data/.hound.yml DELETED
@@ -1,25 +0,0 @@
1
- Style/LineLength:
2
- Description: 'Limit lines to 130 characters.'
3
- Max: 130
4
- Style/SpaceInsideParens:
5
- Enabled: false
6
- Style/SpaceBeforeBlockBraces:
7
- Enabled: false
8
- StringLiterals:
9
- Enabled: false
10
- Style/TrailingComma:
11
- Enabled: false
12
- Style/BlockComments:
13
- Enabled: false
14
- Style/NilComparison:
15
- Enabled: false
16
- Style/Documentation:
17
- Enabled: false
18
- Style/RegexpLiteral:
19
- Enabled: false
20
- Style/SignalException:
21
- Enabled: false
22
- Style/CaseEquality:
23
- Enabled: false
24
- Style/SpaceBeforeComma:
25
- Enabled: false
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1
4
- - 2.2
5
- - ruby-head
6
- bundler_args: "--jobs=2"
7
- before_script:
8
- - export COVERAGE=true
9
- script:
10
- - bundle exec rspec
11
- branches:
12
- only:
13
- - master
14
- notifications:
15
- email: false
16
- slack:
17
- secure: Wz6kbQXUl1J+XVLR/yt0XeI+FEiwcSNsGTsRdKBYSN1CEWnws0BwbWSN1tyRGmMXODiCAHchdGKEqgkm2Nk1/wEhBpCoF/clEeUq8fKyAIdKkEg3laBFI5dSdBm+eYcqQAdUnWeDHnQgdGT1lQBAe6tIAaN6Oqaw1v9bexvQgv8=
18
- matrix:
19
- allow_failures:
20
- - rvm: ruby-head