sengiri_yaml 0.0.1.beta1 → 0.0.4

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
- SHA1:
3
- metadata.gz: c2eb45aa8976068ece4e8286cf44d596da7e436d
4
- data.tar.gz: 33c9680ede3025853a0361e963545de2dceddd2f
2
+ SHA256:
3
+ metadata.gz: 1bc9b7b545e4caeffc7a768c2e7780cc384c569e9263b969da6274d2d5fafdae
4
+ data.tar.gz: 8d0895a01e0258d5a8cf9913a2600383e71339ca42a3a3e3d737366626ba50bc
5
5
  SHA512:
6
- metadata.gz: 97189d98ded574ed38b191916ac5b583222571af9ea00b67b52317a128cb57ced4fcda5e59eae28799df1948c5fbfa0db645c3623bbd885cfb947253ccc350c9
7
- data.tar.gz: c26cadd1906deed5d525d2329d1566dc907abcf58aad254e9b028f117233ec75d3a42177577a2affaf0f4aeab126b4c1f3a2b653c3065b0b89a756ff9352337e
6
+ metadata.gz: 435f2940fcbd337b8e7738c8e0970cb30e7d1ce750494e72c490ee7b59d0a6547718d62bd6679befa3f6a52e4e84fd636011ac42d6fb337a91a8f73e6c6f8afc
7
+ data.tar.gz: 15eea172ff624a0f195262caddd537b1374d8c72b9d20b6d7ccd44f4d6d4a9a68dfc5494619151d95526feb0288cb5ec6f40d3552cf4339e2580d6e92370fa0a
@@ -0,0 +1,96 @@
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
+ env:
16
+ CI: "true"
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ container: ${{ matrix.ruby }}
23
+
24
+ strategy:
25
+ fail-fast: false
26
+
27
+ matrix:
28
+ ruby:
29
+ - ruby:2.1
30
+ - ruby:2.2
31
+ - ruby:2.3
32
+ - ruby:2.4
33
+ - ruby:2.5
34
+ - ruby:2.6
35
+ - ruby:2.7
36
+ - ruby:3.0
37
+ - rubylang/ruby:master-nightly-bionic
38
+ include:
39
+ - ruby: rubylang/ruby:master-nightly-bionic
40
+ allow_failures: "true"
41
+
42
+ steps:
43
+ - uses: actions/checkout@v2
44
+
45
+
46
+ - name: Cache vendor/bundle
47
+ uses: actions/cache@v1
48
+ id: cache_gem
49
+ with:
50
+ path: vendor/bundle
51
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
52
+ restore-keys: |
53
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
54
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
55
+
56
+ - name: bundle update
57
+ run: |
58
+ set -xe
59
+ bundle config path vendor/bundle
60
+ bundle update --jobs $(nproc) --retry 3
61
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
62
+
63
+ - name: Run test
64
+ run: |
65
+ set -xe
66
+ bundle exec rspec
67
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
68
+
69
+ - name: Slack Notification (not success)
70
+ uses: lazy-actions/slatify@master
71
+ if: "! success()"
72
+ continue-on-error: true
73
+ with:
74
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
75
+ type: ${{ job.status }}
76
+ icon_emoji: ":octocat:"
77
+ url: ${{ secrets.SLACK_WEBHOOK }}
78
+ token: ${{ secrets.GITHUB_TOKEN }}
79
+
80
+ notify:
81
+ needs:
82
+ - test
83
+
84
+ runs-on: ubuntu-latest
85
+
86
+ steps:
87
+ - name: Slack Notification (success)
88
+ uses: lazy-actions/slatify@master
89
+ if: always()
90
+ continue-on-error: true
91
+ with:
92
+ job_name: '*build*'
93
+ type: ${{ job.status }}
94
+ icon_emoji: ":octocat:"
95
+ url: ${{ secrets.SLACK_WEBHOOK }}
96
+ token: ${{ secrets.GITHUB_TOKEN }}
data/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # Change Log
2
+
3
+ ## [v0.0.4](https://github.com/sue445/sengiri_yaml/tree/v0.0.4) (2021-11-20)
4
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.3...v0.0.4)
5
+
6
+ * Enable MFA requirement for gem releasing
7
+ * https://github.com/sue445/sengiri_yaml/pull/24
8
+
9
+ ## [v0.0.3](https://github.com/sue445/sengiri_yaml/tree/v0.0.3) (2016-04-26)
10
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.2...v0.0.3)
11
+
12
+ **Merged pull requests:**
13
+
14
+ - Load yaml file with order by filename [\#5](https://github.com/sue445/sengiri_yaml/pull/5) ([sue445](https://github.com/sue445))
15
+
16
+ ## [v0.0.2](https://github.com/sue445/sengiri_yaml/tree/v0.0.2) (2015-01-26)
17
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.1...v0.0.2)
18
+
19
+ **Merged pull requests:**
20
+
21
+ - Bugfix: NameError in irb [\#3](https://github.com/sue445/sengiri_yaml/pull/3) ([sue445](https://github.com/sue445))
22
+
23
+ ## [v0.0.1](https://github.com/sue445/sengiri_yaml/tree/v0.0.1) (2014-12-31)
24
+ [Full Changelog](https://github.com/sue445/sengiri_yaml/compare/v0.0.1.beta1...v0.0.1)
25
+
26
+ ## [v0.0.1.beta1](https://github.com/sue445/sengiri_yaml/tree/v0.0.1.beta1) (2014-12-31)
27
+ **Merged pull requests:**
28
+
29
+ - Feature/loader [\#2](https://github.com/sue445/sengiri_yaml/pull/2) ([sue445](https://github.com/sue445))
30
+ - Impl executable file [\#1](https://github.com/sue445/sengiri_yaml/pull/1) ([sue445](https://github.com/sue445))
31
+
32
+
33
+
34
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # SengiriYaml
2
2
 
3
- [![Build Status](https://travis-ci.org/sue445/sengiri_yaml.svg?branch=master)](https://travis-ci.org/sue445/sengiri_yaml)
3
+ [![Gem Version](https://badge.fury.io/rb/sengiri_yaml.svg)](http://badge.fury.io/rb/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)
4
5
  [![Code Climate](https://codeclimate.com/github/sue445/sengiri_yaml/badges/gpa.svg)](https://codeclimate.com/github/sue445/sengiri_yaml)
5
6
  [![Coverage Status](https://img.shields.io/coveralls/sue445/sengiri_yaml.svg)](https://coveralls.io/r/sue445/sengiri_yaml)
6
- [![Dependency Status](https://gemnasium.com/sue445/sengiri_yaml.svg)](https://gemnasium.com/sue445/sengiri_yaml)
7
7
 
8
8
  divide yaml file
9
9
 
@@ -25,7 +25,35 @@ Or install it yourself as:
25
25
 
26
26
  ## Usage
27
27
 
28
- TODO: Write usage instructions here
28
+ ### divide yaml
29
+ ```bash
30
+ $ cat "/path/to/fat.yml"
31
+ - data1: data1
32
+ value: 1
33
+ - data2: data2
34
+ value: 2
35
+
36
+ $ sengiri_yaml "/path/to/fat.yml" "/path/to/fat_dir"
37
+
38
+ $ ls "/path/to/fat_dir"
39
+ data1.yml data2.yml
40
+
41
+ $ cat data1.yml
42
+ ---
43
+ - data1: data1
44
+ value: 1
45
+
46
+ $ cat data2.yml
47
+ ---
48
+ - data2: data2
49
+ value: 2
50
+ ```
51
+
52
+ ### load divided yaml
53
+ ```ruby
54
+ merged_data = SengiriYaml.load_dir("/path/to/fat_dir")
55
+ # => [{"data1" => "data1", "value" => 1}, {"data2" => "data2", "value" => 2}]
56
+ ```
29
57
 
30
58
  ## Contributing
31
59
 
data/Rakefile CHANGED
@@ -1,2 +1,4 @@
1
1
  require "bundler/gem_tasks"
2
+ require "yard"
2
3
 
4
+ YARD::Rake::YardocTask.new
@@ -1,5 +1,6 @@
1
1
  module SengiriYaml
2
2
  require "yaml"
3
+ require "pathname"
3
4
 
4
5
  class Loader
5
6
  # load divided yaml files
@@ -8,7 +9,7 @@ module SengiriYaml
8
9
  def load_dir(src_dir)
9
10
  merged_content = ""
10
11
 
11
- Pathname.glob("#{src_dir}/*.yml") do |yaml_path|
12
+ Pathname.glob("#{src_dir}/*.yml").sort.each do |yaml_path|
12
13
  content = yaml_path.read.gsub(/^---$/, "")
13
14
  merged_content << content
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module SengiriYaml
2
- VERSION = "0.0.1.beta1"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  module SengiriYaml
2
2
  require "yaml"
3
+ require "fileutils"
3
4
 
4
5
  class Writer
5
6
  # divide yaml file
data/lib/sengiri_yaml.rb CHANGED
@@ -6,8 +6,7 @@ module SengiriYaml
6
6
  module_function
7
7
 
8
8
  # load divided yaml files
9
- # @param src_dir [String] divided yaml dir
10
- # @return [Hash] merged yaml hash
9
+ # @see SengiriYaml::Loader#load_dir
11
10
  def load_dir(src_dir)
12
11
  SengiriYaml::Loader.new.load_dir(src_dir)
13
12
  end
data/sengiri_yaml.gemspec CHANGED
@@ -13,6 +13,11 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/sue445/sengiri_yaml"
14
14
  spec.license = "MIT"
15
15
 
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = spec.homepage
18
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
19
+ spec.metadata["rubygems_mfa_required"] = "true"
20
+
16
21
  spec.files = `git ls-files -z`.split("\x0")
17
22
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
23
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -20,8 +25,9 @@ Gem::Specification.new do |spec|
20
25
 
21
26
  spec.add_development_dependency "bundler"
22
27
  spec.add_development_dependency "coveralls"
23
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rake"
24
29
  spec.add_development_dependency "rspec"
25
30
  spec.add_development_dependency "rspec-power_assert"
26
31
  spec.add_development_dependency "rspec-temp_dir"
32
+ spec.add_development_dependency "yard"
27
33
  end
@@ -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.1.beta1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-31 00:00:00.000000000 Z
11
+ date: 2021-11-20 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
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: divide yaml file
98
112
  email:
99
113
  - sue445@sue445.net
@@ -103,11 +117,11 @@ extensions: []
103
117
  extra_rdoc_files: []
104
118
  files:
105
119
  - ".coveralls.yml"
120
+ - ".github/workflows/test.yml"
106
121
  - ".gitignore"
107
- - ".hound.yml"
108
122
  - ".rspec"
109
- - ".travis.yml"
110
123
  - ".yardopts"
124
+ - CHANGELOG.md
111
125
  - Gemfile
112
126
  - LICENSE.txt
113
127
  - README.md
@@ -129,8 +143,12 @@ files:
129
143
  homepage: https://github.com/sue445/sengiri_yaml
130
144
  licenses:
131
145
  - MIT
132
- metadata: {}
133
- 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:
134
152
  rdoc_options: []
135
153
  require_paths:
136
154
  - lib
@@ -141,13 +159,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
159
  version: '0'
142
160
  required_rubygems_version: !ruby/object:Gem::Requirement
143
161
  requirements:
144
- - - ">"
162
+ - - ">="
145
163
  - !ruby/object:Gem::Version
146
- version: 1.3.1
164
+ version: '0'
147
165
  requirements: []
148
- rubyforge_project:
149
- rubygems_version: 2.4.5
150
- signing_key:
166
+ rubygems_version: 3.2.22
167
+ signing_key:
151
168
  specification_version: 4
152
169
  summary: divide yaml file
153
170
  test_files:
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