guardian_searcher 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2b759b274d5740491fcdebc5409244dc3a76049010d0c5f3e4c002652bb041ed
4
+ data.tar.gz: 8079a62b35fc56f5c86ba4445ffe27e3a0d485a9f083c89aab167c9d26113fab
5
+ SHA512:
6
+ metadata.gz: 4bfc533e16810d12c4ebfa5be6910a36af3ade604065857571289349393247249088c22a734098743f1417c011010b83420f6b7cd4330aa82b4ecd7fe7211b9d
7
+ data.tar.gz: ca3c63de95ca6e1cf3a915f5b445c6141c6e96b0ce045b3f26e5e49bb3bf158fb62deca5fbb62f296a2420558801ae659f5c68151ae5912f113ad6223177bdea
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ Gemfile.lock
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-10-01
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in guardian_searcher.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
data/Guardfile ADDED
@@ -0,0 +1,81 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(lib spec).select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
6
+
7
+ ## Note: if you are using the `directories` clause above and you are not
8
+ ## watching the project directory ('.'), then you will want to move
9
+ ## the Guardfile to a watched dir and symlink it back, e.g.
10
+ #
11
+ # $ mkdir config
12
+ # $ mv Guardfile config/
13
+ # $ ln -s config/Guardfile .
14
+ #
15
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
16
+
17
+ # Note: The cmd option is now required due to the increasing number of ways
18
+ # rspec may be run, below are examples of the most common uses.
19
+ # * bundler: 'bundle exec rspec'
20
+ # * bundler binstubs: 'bin/rspec'
21
+ # * spring: 'bin/rspec' (This will use spring if running and you have
22
+ # installed the spring binstubs per the docs)
23
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
24
+ # * 'just' rspec: 'rspec'
25
+
26
+ guard :rspec, cmd: "bundle exec rspec" do
27
+ require "guard/rspec/dsl"
28
+ dsl = Guard::RSpec::Dsl.new(self)
29
+
30
+ # Feel free to open issues for suggestions and improvements
31
+
32
+ # RSpec files
33
+ rspec = dsl.rspec
34
+ watch(rspec.spec_helper) { rspec.spec_dir }
35
+ watch(rspec.spec_support) { rspec.spec_dir }
36
+ watch(rspec.spec_files)
37
+
38
+ # Ruby files
39
+ ruby = dsl.ruby
40
+ dsl.watch_spec_files_for(ruby.lib_files)
41
+
42
+ # Rails files
43
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
44
+ dsl.watch_spec_files_for(rails.app_files)
45
+ dsl.watch_spec_files_for(rails.views)
46
+
47
+ watch(rails.controllers) do |m|
48
+ [
49
+ rspec.spec.call("routing/#{m[1]}_routing"),
50
+ rspec.spec.call("controllers/#{m[1]}_controller"),
51
+ rspec.spec.call("acceptance/#{m[1]}")
52
+ ]
53
+ end
54
+
55
+ # Rails config changes
56
+ watch(rails.spec_helper) { rspec.spec_dir }
57
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
58
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
59
+
60
+ # Capybara features specs
61
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
62
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
63
+
64
+ # Turnip features and steps
65
+ watch(%r{^spec/acceptance/(.+)\.feature$})
66
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
67
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
68
+ end
69
+ end
70
+
71
+ guard :bundler do
72
+ require 'guard/bundler'
73
+ require 'guard/bundler/verify'
74
+ helper = Guard::Bundler::Verify.new
75
+
76
+ files = ['Gemfile']
77
+ files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
78
+
79
+ # Assume files are symlinked from somewhere
80
+ files.each { |file| watch(helper.real_path(file)) }
81
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Alain Mauri
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 TODO: Write your name
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.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # GuardianSearcher
2
+
3
+ This is a work in progress, and its status is currently not even an alpha version. Tests needs to be implemented and the code is not optimal.
4
+ The goal of this project is to provide a Ruby wrapper to query the Guardian Api and to experiment with some programming techniques.
5
+
6
+ If you wanna try it you need to have an API key and use it as an environment variable.
7
+
8
+ ```bash
9
+ export guardian_api_key = "<your_api_key"
10
+ ```
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'guardian_searcher'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle install
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install guardian_searcher
26
+
27
+ ## Usage
28
+
29
+ TODO: Write usage instructions here
30
+
31
+ ## Development
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/guardian_searcher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/guardian_searcher/blob/master/CODE_OF_CONDUCT.md).
40
+
41
+ ## License
42
+
43
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
44
+
45
+ ## Code of Conduct
46
+
47
+ Everyone interacting in the GuardianSearcher project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/guardian_searcher/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "guardian_searcher"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/guardian_searcher/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "guardian_searcher"
7
+ spec.version = GuardianSearcher::VERSION
8
+ spec.authors = "Alain Mauri"
9
+ spec.email = "wildeng@hotmail.com"
10
+
11
+ spec.summary = "A wrapper to search articles from The Guardian"
12
+ spec.homepage = "https://alainmauri.eu"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
15
+
16
+ spec.metadata["homepage_uri"] = "https://github.com/wildeng/guardian_searcher"
17
+ spec.metadata["source_code_uri"] = "https://github.com/wildeng/guardian_searcher"
18
+ spec.metadata["changelog_uri"] = "https://github.com/wildeng/guardian_searcher/blob/main/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ # Uncomment to register a new dependency of your gem
30
+ # spec.add_dependency "example-gem", "~> 1.0"
31
+ spec.add_dependency "faraday"
32
+
33
+ spec.add_development_dependency 'vcr'
34
+ spec.add_development_dependency 'guard'
35
+ spec.add_development_dependency 'guard-bundler'
36
+ spec.add_development_dependency 'guard-rspec'
37
+ # For more information and examples about making a new gem, checkout our
38
+ # guide at: https://bundler.io/guides/creating_gem.html
39
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GuardianSearcher
4
+ class Base
5
+ include Faraday
6
+ attr_reader :api_key
7
+ attr_accessor :base_uri
8
+
9
+ def initialize(api_key: nil)
10
+ @base_uri = "https://content.guardianapis.com"
11
+
12
+ raise GuardianApyKeyError unless api_key
13
+
14
+ @api_key = api_key
15
+ end
16
+
17
+ # Options needs to be passed following Guardian API docs
18
+ def search(q, options = {})
19
+ opt = build_options(options)
20
+
21
+ url = @base_uri + "/search?q=#{q}&#{opt}&api-key=#{@api_key}"
22
+ Faraday.get(url)
23
+ end
24
+
25
+ def search_sections(q, options = {})
26
+ opt = build_options(options)
27
+ url = @base_uri + "/sections?q=#{q}&#{opt}&api-key=#{@api_key}"
28
+ Faraday.get(url)
29
+ end
30
+
31
+ private
32
+
33
+ def build_options(options)
34
+ return {} if options.empty?
35
+
36
+ opt = ""
37
+ options.each do |key, value|
38
+ opt += "&#{key}=#{value}"
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GuardianSearcher
4
+ class Content < GuardianSearcher::Base
5
+ end
6
+ end
@@ -0,0 +1,18 @@
1
+ module GuardianSearcher
2
+ class OptionsNotHashError < StandardError; end
3
+ class OptionsNotSupportedError < StandardError; end
4
+
5
+ class Options < Hash
6
+ private attr_accessor :options
7
+
8
+ def method_missing(method_name, *args, &blk)
9
+ return self.options.[](method_name, &blk) if @options.has_key?(method_name)
10
+ super(method_name, *args, &blk)
11
+ end
12
+
13
+ def initialize(options)
14
+ raise OptionsNotHashError unless options.is_a?(Hash)
15
+ @options = options
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GuardianSearcher
4
+ class Search < GuardianSearcher::Base
5
+ def self.search_articles(q, options = {})
6
+ searcher = GuardianSearcher::Search.new(api_key: ENV["guardian_api_key"])
7
+ searcher.search(q, options)
8
+ end
9
+
10
+ def self.search_sections(q, options = {})
11
+ searcher = GuardianSearcher::Search.new(api_key: ENV["guardian_api_key"])
12
+ searcher.search_sections(q, options)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module GuardianSearcher
6
+ class SearchResult
7
+ attr_reader :results, :start, :page_size, :pages, :current_page
8
+
9
+ def initialize(
10
+ current_page: nil,
11
+ results: nil,
12
+ page_size: nil,
13
+ pages: nil,
14
+ start: nil
15
+ )
16
+
17
+ @current_page = current_page
18
+ @results = results
19
+ @page_size = page_size
20
+ @pages = pages
21
+ @start = start
22
+ end
23
+
24
+ def self.parse_results(body: nil)
25
+ return unless body
26
+
27
+ body = JSON.parse(body)
28
+ response = body["response"]
29
+ GuardianSearcher::SearchResult.new(
30
+ current_page: response["currentPage"],
31
+ results: response["results"],
32
+ page_size: response["pageSize"],
33
+ pages: response["pages"],
34
+ start: response["startIndex"]
35
+ )
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module GuardianSearcher
6
+ class SectionResult
7
+ attr_reader :results, :editions
8
+
9
+ def initialize(
10
+ results: nil,
11
+ editions: nil
12
+ )
13
+
14
+ @results = results
15
+ @editions = editions
16
+ end
17
+
18
+ def self.parse_results(body: nil)
19
+ return unless body
20
+
21
+ body = JSON.parse(body)
22
+ response = body["response"]
23
+ GuardianSearcher::SearchResult.new(
24
+ results: response["results"],
25
+ editions: response["results"][0]["editions"]
26
+ )
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GuardianSearcher
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "guardian_searcher/version"
4
+ require "faraday"
5
+ require_relative "guardian_searcher/base"
6
+ require_relative "guardian_searcher/search"
7
+ require_relative "guardian_searcher/search_result"
8
+ require_relative "guardian_searcher/section_result"
9
+ require_relative "guardian_searcher/options"
10
+
11
+ module GuardianSearcher
12
+ class Error < StandardError; end
13
+ class GuardianApyKeyError < StandardError; end
14
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guardian_searcher
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Alain Mauri
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-10-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: vcr
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard-bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description:
84
+ email: wildeng@hotmail.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - ".gitignore"
90
+ - ".rspec"
91
+ - ".rubocop.yml"
92
+ - CHANGELOG.md
93
+ - CODE_OF_CONDUCT.md
94
+ - Gemfile
95
+ - Guardfile
96
+ - LICENSE
97
+ - LICENSE.txt
98
+ - README.md
99
+ - Rakefile
100
+ - bin/console
101
+ - bin/setup
102
+ - guardian_searcher.gemspec
103
+ - lib/guardian_searcher.rb
104
+ - lib/guardian_searcher/base.rb
105
+ - lib/guardian_searcher/content.rb
106
+ - lib/guardian_searcher/options.rb
107
+ - lib/guardian_searcher/search.rb
108
+ - lib/guardian_searcher/search_result.rb
109
+ - lib/guardian_searcher/section_result.rb
110
+ - lib/guardian_searcher/version.rb
111
+ homepage: https://alainmauri.eu
112
+ licenses:
113
+ - MIT
114
+ metadata:
115
+ homepage_uri: https://github.com/wildeng/guardian_searcher
116
+ source_code_uri: https://github.com/wildeng/guardian_searcher
117
+ changelog_uri: https://github.com/wildeng/guardian_searcher/blob/main/CHANGELOG.md
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 2.7.0
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ requirements: []
133
+ rubygems_version: 3.2.15
134
+ signing_key:
135
+ specification_version: 4
136
+ summary: A wrapper to search articles from The Guardian
137
+ test_files: []