weneedfeed 0.13.0 → 0.14.0

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
2
  SHA256:
3
- metadata.gz: b15a14704cc5ed0eb9e73c0211aec07e3b196ff1fab56f042cbdfcf68071e8f0
4
- data.tar.gz: 936bf427a0e666ecbd7cec9943f9961f89ce463358b6dca6472709bb05c86def
3
+ metadata.gz: fa3500ddeba8701a3cc8c7f729fbfef3c61f95050572bc34327c489842c5744d
4
+ data.tar.gz: dd89a38ec4ceed97813e9fc5b73b5df1f1c7568ae0dd6b3ab2e0e6a52d0f7bec
5
5
  SHA512:
6
- metadata.gz: 1e839fe9a30af84216310c9abc1680d81bbfc2dbd74ab422a97ebc5365cc27dc67fcc6539fb41d5c137e27c0193feb38d1fe4988c36b343a177a8c89722c3480
7
- data.tar.gz: 57180cb7901a7e91f5bcb73b2944aff645b355b76be66fb546cafb9b55940e7929d17e5095c94494c1c6a03e34c2c44483e5563bf4a454966e6629174e845540
6
+ metadata.gz: 8e74fb89776dde8f1c7dfb068ddea721a9a9ce6da67d31aa496673e53efcd0993f3deee7452685d643ab73e56ac56fdf42be59aa11413593ee1de326bd219a2c
7
+ data.tar.gz: d9036bccf6f43b8480eb36d7ea3db5dc348e879705e93b92290ea953b04302898caa5cf4a3aea8fda71704291ab0bf1841e3c761873798f72172191f17c57c88
data/CHANGELOG.md CHANGED
@@ -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.14.0 - 2022-04-14
11
+
12
+ ### Added
13
+
14
+ - Support YAML aliases (on psych 4.x).
15
+
10
16
  ## 0.13.0 - 2022-04-14
11
17
 
12
18
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weneedfeed (0.13.0)
4
+ weneedfeed (0.14.0)
5
5
  activesupport
6
6
  addressable
7
7
  builder
@@ -10,6 +10,7 @@ PATH
10
10
  hibana (>= 0.2)
11
11
  marcel
12
12
  nokogiri
13
+ psych (>= 4)
13
14
  rack-capture (>= 0.4.0)
14
15
  thor
15
16
 
@@ -81,6 +82,8 @@ GEM
81
82
  parallel (1.22.1)
82
83
  parser (3.1.2.0)
83
84
  ast (~> 2.4.1)
85
+ psych (4.0.3)
86
+ stringio
84
87
  public_suffix (4.0.7)
85
88
  racc (1.6.0)
86
89
  rack (2.2.3)
@@ -122,6 +125,7 @@ GEM
122
125
  rubocop (~> 1.19)
123
126
  ruby-progressbar (1.11.0)
124
127
  ruby2_keywords (0.0.5)
128
+ stringio (3.0.1)
125
129
  thor (1.2.1)
126
130
  tilt (2.0.10)
127
131
  tzinfo (2.0.4)
@@ -9,9 +9,9 @@ module Weneedfeed
9
9
  get '/feeds/:page_id.xml', to: ::Weneedfeed::Controllers::ShowFeed, as: :feed
10
10
  end
11
11
 
12
- # @param [Hash] schema
13
- def initialize(schema:)
14
- @schema = ::Weneedfeed::Schema.new(schema)
12
+ # @param [String] schema_path
13
+ def initialize(schema_path:)
14
+ @schema = ::Weneedfeed::Schema.load_file(schema_path)
15
15
  super()
16
16
  end
17
17
 
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rack/capture'
4
- require 'yaml'
5
4
 
6
5
  module Weneedfeed
7
6
  class Capture
@@ -44,7 +43,7 @@ module Weneedfeed
44
43
  # @return [Weneedfeed::Application]
45
44
  def app
46
45
  @app ||= ::Weneedfeed::Application.new(
47
- schema: ::YAML.load_file(@schema_path)
46
+ schema_path: @schema_path
48
47
  )
49
48
  end
50
49
 
@@ -53,11 +52,6 @@ module Weneedfeed
53
52
  @base_uri ||= ::URI.parse(@base_url)
54
53
  end
55
54
 
56
- # @return [Hash]
57
- def schema
58
- ::YAML.load_file(@schema_path)
59
- end
60
-
61
55
  # @return [String]
62
56
  def script_name
63
57
  case base_uri.path
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rack'
4
4
  require 'thor'
5
- require 'yaml'
6
5
 
7
6
  module Weneedfeed
8
7
  class Command < ::Thor
@@ -55,8 +54,7 @@ module Weneedfeed
55
54
  )
56
55
 
57
56
  def server
58
- schema = ::YAML.load_file(options[:schema_path])
59
- application = Weneedfeed::Application.new(schema: schema)
57
+ application = Weneedfeed::Application.new(schema_path: options[:schema_path])
60
58
  ::Rack::Handler.default.run(application)
61
59
  end
62
60
  end
@@ -1,7 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'yaml'
4
+
3
5
  module Weneedfeed
4
6
  class Schema
7
+ class << self
8
+ # @param [String] schema_path
9
+ # @return [Weneedfeed::Schema]
10
+ def load_file(schema_path)
11
+ raw = ::YAML.load_file(schema_path, aliases: true)
12
+ new(raw)
13
+ end
14
+ end
15
+
5
16
  # @param [Hash] raw
6
17
  def initialize(raw)
7
18
  @raw = raw
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weneedfeed
4
- VERSION = '0.13.0'
4
+ VERSION = '0.14.0'
5
5
  end
data/weneedfeed.gemspec CHANGED
@@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_runtime_dependency 'hibana', '>= 0.2'
36
36
  spec.add_runtime_dependency 'marcel'
37
37
  spec.add_runtime_dependency 'nokogiri'
38
+ spec.add_runtime_dependency 'psych', '>= 4'
38
39
  spec.add_runtime_dependency 'rack-capture', '>= 0.4.0'
39
40
  spec.add_runtime_dependency 'thor'
40
41
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weneedfeed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2022-04-14 00:00:00.000000000 Z
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: psych
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '4'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '4'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rack-capture
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +164,7 @@ dependencies:
150
164
  - - ">="
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
- description:
167
+ description:
154
168
  email:
155
169
  - r7kamura@gmail.com
156
170
  executables:
@@ -201,7 +215,7 @@ metadata:
201
215
  homepage_uri: https://github.com/r7kamura/weneedfeed
202
216
  source_code_uri: https://github.com/r7kamura/weneedfeed
203
217
  rubygems_mfa_required: 'true'
204
- post_install_message:
218
+ post_install_message:
205
219
  rdoc_options: []
206
220
  require_paths:
207
221
  - lib
@@ -217,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
231
  version: '0'
218
232
  requirements: []
219
233
  rubygems_version: 3.1.4
220
- signing_key:
234
+ signing_key:
221
235
  specification_version: 4
222
236
  summary: Generate feeds from URL and selectors.
223
237
  test_files: []