middleman-rss_items 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0ee5bf50a0592ecbfa4c12e20daa5180bcc9fe11412e4cb1c57b2f6951d3a7b4
4
+ data.tar.gz: e52b80370745ebb3ce72008f20dee0413701875c736b5fb116c49f3693149ee4
5
+ SHA512:
6
+ metadata.gz: 13782200ce5dfdbff44f5598c5da071fcd0b2a61ac66b40041357068577a58c7846531c3c851122f237880a528c9895736a45f64af084c2235ee118812df9e79
7
+ data.tar.gz: 3d9bbfde0750fdb85e44eb80bc710beb8160167233b612d20f33cd6c854b572d5af00f91f53192a792ad1d5087c75d84661b8058c86d928fef31472f4d7ccb64
@@ -0,0 +1,5 @@
1
+ # Ignore bundler lock file
2
+ /Gemfile.lock
3
+
4
+ # Ignore pkg folder
5
+ /pkg
@@ -0,0 +1,75 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at seibii.it@seibii.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
75
+
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ # If you do not have OpenSSL installed, update
2
+ # the following line to use "http://" instead
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in middleman-rss_items.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ gem 'rake'
10
+ gem 'rdoc'
11
+ gem 'yard'
12
+ end
13
+
14
+ group :test do
15
+ gem 'cucumber'
16
+ gem 'aruba'
17
+ gem 'rspec'
18
+ end
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Seibii, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
@@ -0,0 +1,64 @@
1
+ # middleman-rss_items
2
+ [![Gem Version](https://badge.fury.io/rb/middleman-rss_items.svg)](https://badge.fury.io/rb/middleman-rss_items)
3
+ [![Code Climate](https://codeclimate.com/github/seibii/middleman-rss_items/badges/gpa.svg)](https://codeclimate.com/github/seibii/middleman-rss_items)
4
+ [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/seibii/middleman-rss_items.svg)](https://libraries.io/github/seibii/middleman-rss_items)
5
+ ![](http://ruby-gem-downloads-badge.herokuapp.com/middleman-rss_items?type=total)
6
+ ![GitHub](https://img.shields.io/github/license/seibii/middleman-rss_items.svg)
7
+
8
+ `middleman-rss_items` provide a method to get RSS resources and create RSS feed like html.
9
+
10
+ ## Installation
11
+
12
+ Add middleman-rss_item to your Gemfile:
13
+
14
+ ```ruby
15
+ gem "middleman-rss_item"
16
+ ```
17
+
18
+ ## Configuration
19
+
20
+ In `config.rb`
21
+
22
+ ```ruby
23
+ activate :rss_item do |rss_item|
24
+ rss.rss_resources = [ # Websites you want to display
25
+ {
26
+ name: :blog, # name to be accessed by template
27
+ url: 'https://blog.seibii.co.jp/rss/' # RSS url
28
+ }
29
+ ]
30
+ end
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ In your templates
36
+
37
+ ```erb
38
+ <% rss_items[:blog].each do |rss_item| %>
39
+ <%= rss_item.title %>
40
+ br
41
+ <%= rss_item.summary %>
42
+ br
43
+ <%= rss_item.url %>
44
+ br
45
+ <%= rss_item.published %>
46
+ br
47
+ <%= rss_item.image %>
48
+ <% end %>
49
+ ```
50
+
51
+ This gem using [feedjira](https://github.com/feedjira/feedjira) as parser and the `rss_item` is object of that.
52
+ So, please checkout [feedjira](https://github.com/feedjira/feedjira) about the objects.
53
+
54
+ ## Contributing
55
+
56
+ Bug reports and pull requests are welcome on GitHub at https://github.com/seibii/middleman-rss_items. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
57
+
58
+ ## License
59
+
60
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
61
+
62
+ ## Code of Conduct
63
+
64
+ Everyone interacting in the middleman-rss_items project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/seibii/middleman-rss_items/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,14 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'cucumber/rake/task'
5
+
6
+ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
+ t.cucumber_opts = '--color --tags ~@wip --strict'
8
+ end
9
+
10
+ require 'rake/clean'
11
+
12
+ task test: ['cucumber']
13
+
14
+ task default: :test
@@ -0,0 +1,4 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+ require 'middleman-core'
3
+ require 'middleman-core/step_definitions'
4
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-rss_items')
@@ -0,0 +1,24 @@
1
+ require 'feedjira'
2
+ require 'middleman-core'
3
+ require 'net/http'
4
+
5
+ class MiddlemanRssItems < ::Middleman::Extension
6
+ option :rss_resources, false, 'RSS resources to fetch'
7
+ attr_reader :rss_items
8
+ expose_to_template :rss_items
9
+
10
+ def initialize(app, options_hash={}, &block)
11
+ super
12
+
13
+ @rss_items = {}
14
+ end
15
+
16
+ def after_configuration
17
+ options.rss_resources.each do |resource|
18
+ rss = Net::HTTP.get(URI.parse(resource[:url]))
19
+ @rss_items[resource[:name] || resource[:url]] ||= Feedjira.parse(rss).entries
20
+ end
21
+ end
22
+ end
23
+
24
+ Middleman::Extensions.register :rss_items, MiddlemanRssItems
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "middleman-rss_items"
6
+ s.version = "0.0.1"
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['Seibii, Inc.', 'unhappychoice']
9
+ s.email = ["seibii.it@seibii.com"]
10
+ s.homepage = "https://github.com/seibii"
11
+ s.summary = %q{Middleman plugin to make RSS feed}
12
+ s.description = %q{This plugin adds methods to create RSS feed like html}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ s.add_runtime_dependency("middleman-core", [">= 4.3.5"])
20
+ s.add_runtime_dependency "feedjira"
21
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-rss_items
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Seibii, Inc.
8
+ - unhappychoice
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2020-02-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: middleman-core
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 4.3.5
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 4.3.5
28
+ - !ruby/object:Gem::Dependency
29
+ name: feedjira
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ description: This plugin adds methods to create RSS feed like html
43
+ email:
44
+ - seibii.it@seibii.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - CODE_OF_CONDUCT.md
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - features/support/env.rb
56
+ - lib/middleman-rss_items.rb
57
+ - middleman-rss_items.gemspec
58
+ homepage: https://github.com/seibii
59
+ licenses: []
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.0.3
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: Middleman plugin to make RSS feed
80
+ test_files:
81
+ - features/support/env.rb