jekyll-twitter-plugin 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-twitter-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Murray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2016-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,18 +42,18 @@ dependencies:
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.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: '3.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: byebug
56
+ name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,19 +67,19 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: twitter
70
+ name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '5.16'
76
- type: :runtime
75
+ version: '0'
76
+ type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '5.16'
82
+ version: '0'
83
83
  description:
84
84
  email:
85
85
  - robmurray17@gmail.com
@@ -97,8 +97,12 @@ files:
97
97
  - Rakefile
98
98
  - jekyll-twitter-plugin.gemspec
99
99
  - lib/jekyll-twitter-plugin.rb
100
+ - media/embedded-grid.png
101
+ - media/embedded-moment.png
102
+ - media/embedded-timeline.png
103
+ - media/embedded-tweet.png
104
+ - spec/api_request_spec.rb
100
105
  - spec/integration_tests.rb
101
- - spec/oembed_spec.rb
102
106
  - spec/spec_helper.rb
103
107
  - spec/support/jekyll_template.rb
104
108
  - spec/support/shared_contexts.rb
@@ -115,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
119
  requirements:
116
120
  - - ">="
117
121
  - !ruby/object:Gem::Version
118
- version: 1.9.3
122
+ version: 2.0.0
119
123
  required_rubygems_version: !ruby/object:Gem::Requirement
120
124
  requirements:
121
125
  - - ">="
@@ -126,10 +130,11 @@ rubyforge_project:
126
130
  rubygems_version: 2.5.1
127
131
  signing_key:
128
132
  specification_version: 4
129
- summary: A Liquid tag plugin for Jekyll that renders Tweets from Twitter API
133
+ summary: A Liquid tag plugin for Jekyll blogging engine that embeds Tweets, Timelines
134
+ and more from Twitter API.
130
135
  test_files:
136
+ - spec/api_request_spec.rb
131
137
  - spec/integration_tests.rb
132
- - spec/oembed_spec.rb
133
138
  - spec/spec_helper.rb
134
139
  - spec/support/jekyll_template.rb
135
140
  - spec/support/shared_contexts.rb
@@ -1,103 +0,0 @@
1
- # frozen_string_literal: true
2
- RSpec.describe TwitterJekyll::Oembed do
3
- let(:api_client) { double("Twitter::REST::Client") }
4
- let(:status_response) { double }
5
- subject { described_class.new(api_client, params) }
6
-
7
- describe "parsing status id" do
8
- let(:params) { ["https://twitter.com/twitter_user/status/12345"] }
9
-
10
- it "parses the status id from the tweet url correctly" do
11
- status_response = double
12
- allow(Twitter::REST::Client).to receive(:new).and_return(api_client)
13
-
14
- expect(api_client).to receive(:status).with(12_345).and_return(status_response)
15
- expect(api_client).to receive(:oembed).with(status_response, {}).and_return("")
16
- subject.fetch
17
- end
18
- end
19
-
20
- describe "parsing options" do
21
- context "with extra options" do
22
- let(:params) { ["https://twitter.com/twitter_user/status/12345", "align='right'", "width='350'"] }
23
-
24
- it "passes to api" do
25
- allow(Twitter::REST::Client).to receive(:new).and_return(api_client)
26
- allow(api_client).to receive(:status).with(12_345).and_return(status_response)
27
-
28
- expect(api_client).to receive(:oembed).with(status_response, "align" => "right", "width" => "350").and_return("")
29
- subject.fetch
30
- end
31
- end
32
-
33
- context "with an invalid option" do
34
- let(:params) { ["https://twitter.com/twitter_user/status/12345", "align=", "width='350'"] }
35
-
36
- it "ignores param" do
37
- allow(Twitter::REST::Client).to receive(:new).and_return(api_client)
38
- allow(api_client).to receive(:status).with(12_345).and_return(status_response)
39
-
40
- expect(api_client).to receive(:oembed).with(status_response, "width" => "350").and_return("")
41
- subject.fetch
42
- end
43
- end
44
- end
45
-
46
- describe "#fetch" do
47
- let(:params) { ["https://twitter.com/twitter_user/status/12345"] }
48
-
49
- it "returns response from api" do
50
- allow(Twitter::REST::Client).to receive(:new).and_return(api_client)
51
- allow(api_client).to receive(:status).with(12_345).and_return(status_response)
52
-
53
- expect(api_client).to receive(:oembed).with(status_response, {}).and_return("api response")
54
- expect(subject.fetch).to eq "api response"
55
- end
56
-
57
- context "when status is not found" do
58
- it "returns error" do
59
- allow(Twitter::REST::Client).to receive(:new).and_return(api_client)
60
- allow(api_client).to receive(:status).with(12_345).and_raise(Twitter::Error::NotFound)
61
-
62
- expect(api_client).not_to receive(:oembed)
63
- result = subject.fetch
64
- expect(result).to be_a(TwitterJekyll::ErrorResponse)
65
- expect(result.error).to eq "There was a 'Twitter::Error::NotFound' error fetching Tweet 'https://twitter.com/twitter_user/status/12345'"
66
- end
67
- end
68
- end
69
-
70
- describe "#cache_key" do
71
- context "with no params" do
72
- let(:params) { ["https://twitter.com/twitter_user/status/12345"] }
73
-
74
- it "matches on status url" do
75
- oembed_1 = TwitterJekyll::Oembed.new(api_client, params.dup)
76
- oembed_2 = TwitterJekyll::Oembed.new(api_client, params.dup)
77
-
78
- expect(
79
- oembed_1.cache_key == oembed_2.cache_key
80
- ).to be true
81
- end
82
- end
83
-
84
- context "with params" do
85
- let(:params_1) { ["https://twitter.com/twitter_user/status/12345", "align='right'"] }
86
- let(:params_2) { ["https://twitter.com/twitter_user/status/12345", "align='left'"] }
87
-
88
- it "matches on keys and values" do
89
- oembed_1 = TwitterJekyll::Oembed.new(api_client, params_1.dup)
90
- oembed_2 = TwitterJekyll::Oembed.new(api_client, params_2.dup)
91
- oembed_3 = TwitterJekyll::Oembed.new(api_client, params_1.dup)
92
-
93
- expect(
94
- oembed_1.cache_key == oembed_2.cache_key
95
- ).to be false
96
-
97
- expect(
98
- oembed_1.cache_key == oembed_3.cache_key
99
- ).to be true
100
- end
101
- end
102
- end
103
- end