ogpr 1.0.0

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: 0f1a5135434cb88fe69a9d8423c7cca4d2a0a16654140ad65457c6fe46227c99
4
+ data.tar.gz: a6fc2839ce8ef1be118cdf6046e3ea0c92c1197e4210da2a5482742b87733907
5
+ SHA512:
6
+ metadata.gz: 236d7dbcaa7d48f309fea3fad98c24a51079b70bb4ce13b8d3ebe9df121a02fcd98c079bcbafb3550737d694e92606bfc64b19fd577859e88427de19e4489c9e
7
+ data.tar.gz: 13ae1312ba6d873511302cddaa1cffa210a72becb0bf3b36fdaf534ed3acf1a9ec6b7fffc52c55ccc4f0279b6e3be147e01fe8620cf26b03bdb469036679aac4
@@ -0,0 +1,34 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/ruby:2.5.0
6
+ working_directory: ~/app
7
+
8
+ steps:
9
+ - checkout
10
+ - restore_cache:
11
+ keys:
12
+ - dependency-cache-{{ arch }}-{{ checksum "Gemfile" }}-{{ checksum "ogpr.gemspec" }}
13
+ - dependency-cache
14
+ - run:
15
+ name: Install dependency
16
+ command: bundle install --jobs=4 --retry=3 --path ./.bundle
17
+ - save_cache:
18
+ paths:
19
+ - ./.bundle
20
+ key: dependency-cache-{{ arch }}-{{ checksum "Gemfile" }}-{{ checksum "ogpr.gemspec" }}
21
+ - run:
22
+ name: Check lint
23
+ command: bundle exec rake rubocop
24
+ - run:
25
+ name: Run unit test
26
+ command: |
27
+ bundle exec rake spec
28
+ bundle exec codeclimate-test-reporter
29
+
30
+ workflows:
31
+ version: 2
32
+ build:
33
+ jobs:
34
+ - build
@@ -0,0 +1,69 @@
1
+ .rspec_status
2
+ # Created by https://www.gitignore.io/api/ruby,vim
3
+
4
+ ### Ruby ###
5
+ *.gem
6
+ *.rbc
7
+ /.config
8
+ /coverage/
9
+ /InstalledFiles
10
+ /pkg/
11
+ /spec/reports/
12
+ /spec/examples.txt
13
+ /test/tmp/
14
+ /test/version_tmp/
15
+ /tmp/
16
+
17
+ # Used by dotenv library to load environment variables.
18
+ # .env
19
+
20
+ ## Specific to RubyMotion:
21
+ .dat*
22
+ .repl_history
23
+ build/
24
+ *.bridgesupport
25
+ build-iPhoneOS/
26
+ build-iPhoneSimulator/
27
+
28
+ ## Specific to RubyMotion (use of CocoaPods):
29
+ #
30
+ # We recommend against adding the Pods directory to your .gitignore. However
31
+ # you should judge for yourself, the pros and cons are mentioned at:
32
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
33
+ #
34
+ # vendor/Pods/
35
+
36
+ ## Documentation cache and generated files:
37
+ /.yardoc/
38
+ /_yardoc/
39
+ /doc/
40
+ /rdoc/
41
+
42
+ ## Environment normalization:
43
+ /.bundle/
44
+ /vendor/bundle
45
+ /lib/bundler/man/
46
+
47
+ # for a library or gem, you might want to ignore these files since the code is
48
+ # intended to run in multiple environments; otherwise, check them in:
49
+ Gemfile.lock
50
+ # .ruby-version
51
+ # .ruby-gemset
52
+
53
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
54
+ .rvmrc
55
+
56
+ ### Vim ###
57
+ # swap
58
+ .sw[a-p]
59
+ .*.sw[a-p]
60
+ # session
61
+ Session.vim
62
+ # temporary
63
+ .netrwhist
64
+ *~
65
+ # auto-generated tag files
66
+ tags
67
+
68
+
69
+ # End of https://www.gitignore.io/api/ruby,vim
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,90 @@
1
+ AllCops:
2
+ Include:
3
+ - 'lib/**/*.rb'
4
+ Exclude:
5
+ - '*.rb'
6
+ - 'spec/**/*'
7
+ - 'features/**/*'
8
+ - 'test/**/*'
9
+ - 'Gemfile'
10
+ - 'Guardfile'
11
+ - 'Rakefile'
12
+ - '*.gemspec'
13
+ - 'bin/*'
14
+
15
+ Metrics/ClassLength:
16
+ Max: 150
17
+
18
+ MethodLength:
19
+ Max: 30
20
+
21
+ Documentation:
22
+ Enabled: false
23
+
24
+ AndOr:
25
+ Enabled: false
26
+
27
+ ParenthesesAroundCondition:
28
+ Enabled: false
29
+
30
+ Style/MethodCallWithoutArgsParentheses:
31
+ Enabled: false
32
+
33
+ # why use this option ?
34
+ #RedundantBegin:
35
+ # Enabled: false
36
+
37
+ NumericLiterals:
38
+ Enabled: false
39
+
40
+ CyclomaticComplexity:
41
+ Max: 15
42
+
43
+ Metrics/PerceivedComplexity:
44
+ Max: 10
45
+
46
+ Next:
47
+ Enabled: false
48
+
49
+ Layout/AlignHash:
50
+ Enabled: false
51
+
52
+ Style/RaiseArgs:
53
+ Enabled: false
54
+
55
+ Style/RedundantFreeze:
56
+ Enabled: false
57
+
58
+ Metrics/AbcSize:
59
+ Max: 20
60
+
61
+ Metrics/LineLength:
62
+ Max: 100
63
+ IgnoredPatterns: [
64
+ '^\s*#',
65
+ 'ruby wrapper for the Bitbucket REST API*'
66
+ ]
67
+
68
+ Style/SymbolArray:
69
+ Enabled: false
70
+
71
+ Style/FormatStringToken:
72
+ Enabled: false
73
+
74
+ Style/RescueStandardError:
75
+ Enabled: false
76
+
77
+ Style/PercentLiteralDelimiters:
78
+ Enabled: false
79
+
80
+ Layout/SpaceAroundOperators:
81
+ Enabled: false
82
+
83
+ Layout/ExtraSpacing:
84
+ Enabled: false
85
+
86
+ Style/SafeNavigation:
87
+ Enabled: false
88
+
89
+ Lint/DuplicateMethods:
90
+ Enabled: false
@@ -0,0 +1 @@
1
+ 2.5.0
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.0
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in ogpr.gemspec
6
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 hirakiuc
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.
@@ -0,0 +1,69 @@
1
+ # Ogpr
2
+
3
+ [![CircleCI](https://circleci.com/gh/hirakiuc/ogpr.svg?style=shield&circle-token=332a902a7ec2815346b303dd1aebe68b44ce0ced)](https://circleci.com/gh/hirakiuc/ogpr)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/4e0e0aa416b417195cef/maintainability)](https://codeclimate.com/github/hirakiuc/ogpr/maintainability)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/4e0e0aa416b417195cef/test_coverage)](https://codeclimate.com/github/hirakiuc/ogpr/test_coverage)
6
+
7
+ a ruby library to fetch and parse meta tags which represent OpenGraph Protocol.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'ogpr'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install ogpr
24
+
25
+ ## Usage
26
+
27
+ ```ruby
28
+ require "ogpr"
29
+
30
+ # Fetch and parse meta tags from the url
31
+ ogp = Ogpr.fetch("http://example.com/path/to/page")
32
+ # Parse the string as meta tags.
33
+ ogp = Ogpr.parse("<meta ....>")
34
+
35
+ # Fetch OpenGraph meta tag
36
+ og = ogp.open_graph
37
+ if og
38
+ og.each_pair do |k, v|
39
+ puts "#{k} => #{v}"
40
+ end
41
+ end
42
+
43
+ # Fetch TwitterCard meta tag
44
+ card = ogp.twitter_card
45
+ if card
46
+ card.each_pair do |k,v|
47
+ puts "#{k} => #{v}"
48
+ end
49
+ end
50
+
51
+ # Fetch all of OpenGraph and TwitterCard meta tag
52
+ if ogp.exist?
53
+ ogp.title # og:title or twitter:title
54
+ ogp.type # og:type or twitter:card
55
+ ogp.description # og:description or twitter:description
56
+ ogp.image # og:image or twitter:image
57
+ ogp.url # og:url or twitter:url
58
+ end
59
+ ```
60
+
61
+ ## Development
62
+
63
+ 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.
64
+
65
+ 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
66
+
67
+ ## Contributing
68
+
69
+ Bug reports and pull requests are welcome on GitHub at https://github.com/hirakiuc/ogpr.
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require 'rubocop/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ RuboCop::RakeTask.new
8
+
9
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ogpr"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -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,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ogpr/version'
4
+ require_relative './ogpr/fetcher.rb'
5
+ require_relative './ogpr/loader.rb'
6
+ require_relative './ogpr/parser.rb'
7
+
8
+ module Ogpr
9
+ class << self
10
+ # Fetch the url and parse meta data.
11
+ #
12
+ # @param url [String] the target URL to fetch TwitterCard/OpenGraph meta tags from.
13
+ # @return [Ogpr::Result] the result object which contains TwitterCard/OpenGraph tags.
14
+ def fetch(url)
15
+ result = Fetcher.fetch(url)
16
+ Parser.parse(result.to_s)
17
+ end
18
+
19
+ # Load the hash object
20
+ #
21
+ # @param hash [Hash] hash object which contains TwitterCard/OpenGraph tags.
22
+ # @return [Ogpr::Result] the result object which contains TwitterCard/OpenGraph tags.
23
+ def load(hash)
24
+ Loader.load(hash)
25
+ end
26
+
27
+ # Parse the string
28
+ #
29
+ # @param str [String] html string which contains TwitterCard/OpenGraph meta tags.
30
+ # @return [Ogpr::Result] the result object which contains TwitterCard/OpenGraph tags.
31
+ def parse(str)
32
+ Parser.parse(str)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'uri'
4
+ require_relative './fetcher/html_fetcher.rb'
5
+
6
+ module Ogpr
7
+ class Fetcher
8
+ def self.fetch(url)
9
+ HtmlFetcher.new(url).fetch
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'uri'
4
+ require 'rest-client'
5
+ require 'kconv'
6
+
7
+ module Ogpr
8
+ class Fetcher
9
+ class HtmlFetcher
10
+ def initialize(url)
11
+ @uri = URI.parse(url)
12
+ @accept_types = %w(text/html text/plain)
13
+ end
14
+
15
+ def fetch(headers = {})
16
+ head = send_request(:head, @uri, headers)
17
+ acceptable_content!(head.headers[:content_type])
18
+
19
+ res = send_request(:get, @uri, headers)
20
+ Kconv.toutf8(res.to_str)
21
+ rescue => e
22
+ raise e
23
+ end
24
+
25
+ private
26
+
27
+ def acceptable_content!(content_type)
28
+ parts = content_type.split(';').map(&:strip)
29
+ return if parts.any? { |v| @accept_types.include?(v) }
30
+
31
+ raise "Can't accept content-type: #{content_type}"
32
+ end
33
+
34
+ def send_request(method, uri, headers)
35
+ RestClient::Request.execute(
36
+ request_options(method, uri, headers)
37
+ )
38
+ rescue RestClient::ExceptionWithResponse => e
39
+ raise "Got http status code(#{e.response.code}) by #{method} request from #{uri}"
40
+ rescue => e
41
+ raise e
42
+ end
43
+
44
+ def request_options(method, uri, headers)
45
+ {
46
+ method: method,
47
+ url: uri.to_s,
48
+ headers: headers,
49
+ max_redirects: 10,
50
+ verify_ssl: OpenSSL::SSL::VERIFY_NONE,
51
+ timeout: 30
52
+ }
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './result.rb'
4
+
5
+ module Ogpr
6
+ class Loader
7
+ class << self
8
+ def load(hash)
9
+ Result.new(hash)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ogpr
4
+ module Model
5
+ class Base
6
+ attr_reader :meta
7
+
8
+ def self.create(meta)
9
+ new(meta)
10
+ rescue
11
+ nil
12
+ end
13
+
14
+ def initialize(hash)
15
+ @meta = hash
16
+ @prefix = nil
17
+
18
+ raise 'Meta is empty' if @meta.empty?
19
+ end
20
+
21
+ %w(title description url image).each do |attr|
22
+ define_method attr.to_sym do
23
+ @meta["#{@prefix}:#{attr}"]
24
+ end
25
+ end
26
+
27
+ def [](key)
28
+ @meta[key]
29
+ end
30
+
31
+ def keys
32
+ @meta.keys.sort
33
+ end
34
+
35
+ def each_key(&block)
36
+ return unless block
37
+ @meta.each_key { |key| yield key }
38
+ end
39
+
40
+ def each_pair(&block)
41
+ return unless block
42
+ @meta.each_pair { |k, v| yield k, v }
43
+ end
44
+
45
+ def to_s
46
+ "#<#{self.class}::#{object_id} @meta=#{@meta}>"
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base.rb'
4
+
5
+ module Ogpr
6
+ module Model
7
+ class OpenGraph < Base
8
+ def initialize(hash)
9
+ super hash.select { |k, _| k =~ /^og:\w+/ }
10
+ @prefix = 'og'
11
+ end
12
+
13
+ def type
14
+ @meta['og:type']
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './base.rb'
4
+
5
+ module Ogpr
6
+ module Model
7
+ class TwitterCard < Base
8
+ def initialize(hash)
9
+ super hash.select { |k, _| k =~ /^twitter:\w+/ }
10
+ @prefix = 'twitter'
11
+ end
12
+
13
+ def type
14
+ @meta['twitter:card']
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'nokogiri'
4
+ require_relative './result.rb'
5
+
6
+ module Ogpr
7
+ class Parser
8
+ class << self
9
+ def parse(str)
10
+ new(str).parse
11
+ end
12
+ end
13
+
14
+ def initialize(html)
15
+ @html = html
16
+ end
17
+
18
+ def parse
19
+ doc = Nokogiri::HTML(@html, nil, 'utf-8')
20
+ meta = parse_meta(doc)
21
+
22
+ Result.new(meta)
23
+ end
24
+
25
+ private
26
+
27
+ def parse_meta(doc)
28
+ doc.css('meta').map do |elm|
29
+ key = nil
30
+ value = nil
31
+ if (elm['property'] =~ /og:\w+/)
32
+ key = elm['property']
33
+ value = elm['content']
34
+ elsif (elm['name'] =~ /twitter:\w+/)
35
+ key = elm['name']
36
+ # Always value is in 'content',
37
+ # but value is in 'value' property on twitpic...
38
+ value = elm['content'] || elm['value']
39
+ end
40
+
41
+ if key.nil? || key.empty? || value.nil? || value.empty?
42
+ {}
43
+ else
44
+ Hash[key, value]
45
+ end
46
+ end.reduce(&:merge)
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './model/open_graph.rb'
4
+ require_relative './model/twitter_card.rb'
5
+
6
+ module Ogpr
7
+ class Result
8
+ attr_reader :open_graph, :twitter_card, :meta
9
+
10
+ def initialize(meta)
11
+ @open_graph = Model::OpenGraph.create(meta)
12
+ @twitter_card = Model::TwitterCard.create(meta)
13
+ @meta = meta
14
+ end
15
+
16
+ def exist?
17
+ !@open_graph.nil? || !@twitter_card.nil?
18
+ end
19
+
20
+ def open_graph?
21
+ @open_graph != nil
22
+ end
23
+
24
+ def twitter_card?
25
+ @twitter_card != nil
26
+ end
27
+
28
+ %w(title description url image).each do |key|
29
+ define_method key.to_sym do
30
+ attr = key.to_sym
31
+
32
+ # rubocop:disable Style/EmptyElse
33
+ if @open_graph && @twitter_card
34
+ @open_graph.send(attr) || @twitter_card.send(attr)
35
+ elsif @open_graph
36
+ @open_graph.send(attr)
37
+ elsif @twitter_card
38
+ @twitter_card.send(attr)
39
+ else
40
+ nil
41
+ end
42
+ # rubocop:enable Style/EmptyElse
43
+ end
44
+ end
45
+
46
+ def to_s
47
+ "#<Ogpr::Result:#{object_id} @open_graph=#{@open_graph}, @twitter_card=#{@twitter_card}>"
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ogpr
4
+ VERSION = '1.0.0'
5
+ end
@@ -0,0 +1,33 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "ogpr/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ogpr"
8
+ spec.version = Ogpr::VERSION
9
+ spec.authors = ["hirakiuc"]
10
+ spec.email = ["hirakiuc@gmail.com"]
11
+
12
+ spec.summary = %q{a ruby library to fetch and parse OpenGraph protocol}
13
+ spec.description = %q{a ruby library to fetch and parse meta tags which represent OpenGraph protocol}
14
+ spec.homepage = 'https://github.com/hirakiuc/ogpr'
15
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
+ f.match(%r{^(test|spec|features)/})
17
+ end
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.16"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.0"
25
+ spec.add_development_dependency "sinatra", "~> 2.0.1"
26
+ spec.add_development_dependency 'rubocop', '~> 0.52.1'
27
+ spec.add_development_dependency "webmock", "~> 3.3.0"
28
+ spec.add_development_dependency "simplecov", "~> 0.14.1"
29
+ spec.add_development_dependency "coveralls", "~> 0.8.21"
30
+ spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0"
31
+ spec.add_dependency 'rest-client', '~> 2.0.2'
32
+ spec.add_dependency 'nokogiri', '~> 1.8'
33
+ end
metadata ADDED
@@ -0,0 +1,221 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ogpr
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - hirakiuc
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-03-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.0.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.52.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.52.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 3.3.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 3.3.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.14.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.14.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.8.21
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.8.21
125
+ - !ruby/object:Gem::Dependency
126
+ name: codeclimate-test-reporter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rest-client
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 2.0.2
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 2.0.2
153
+ - !ruby/object:Gem::Dependency
154
+ name: nokogiri
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.8'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.8'
167
+ description: a ruby library to fetch and parse meta tags which represent OpenGraph
168
+ protocol
169
+ email:
170
+ - hirakiuc@gmail.com
171
+ executables: []
172
+ extensions: []
173
+ extra_rdoc_files: []
174
+ files:
175
+ - ".circleci/config.yml"
176
+ - ".gitignore"
177
+ - ".rspec"
178
+ - ".rubocop.yml"
179
+ - ".ruby-version"
180
+ - ".travis.yml"
181
+ - Gemfile
182
+ - LICENSE
183
+ - README.md
184
+ - Rakefile
185
+ - bin/console
186
+ - bin/setup
187
+ - lib/ogpr.rb
188
+ - lib/ogpr/fetcher.rb
189
+ - lib/ogpr/fetcher/html_fetcher.rb
190
+ - lib/ogpr/loader.rb
191
+ - lib/ogpr/model/base.rb
192
+ - lib/ogpr/model/open_graph.rb
193
+ - lib/ogpr/model/twitter_card.rb
194
+ - lib/ogpr/parser.rb
195
+ - lib/ogpr/result.rb
196
+ - lib/ogpr/version.rb
197
+ - ogpr.gemspec
198
+ homepage: https://github.com/hirakiuc/ogpr
199
+ licenses: []
200
+ metadata: {}
201
+ post_install_message:
202
+ rdoc_options: []
203
+ require_paths:
204
+ - lib
205
+ required_ruby_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ required_rubygems_version: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
215
+ requirements: []
216
+ rubyforge_project:
217
+ rubygems_version: 2.7.3
218
+ signing_key:
219
+ specification_version: 4
220
+ summary: a ruby library to fetch and parse OpenGraph protocol
221
+ test_files: []