feedly_api 0.4b → 0.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e10ba937ee8365a176d401cb4a4d0d19e7ed04d9
4
- data.tar.gz: c227bf1ad3674a71b969cf21f3df017134c830c0
3
+ metadata.gz: 86fb506af74039368a58334f45e356865d820ddf
4
+ data.tar.gz: 870e91de5e35cd523fd3ffc642fed5ce17c49366
5
5
  SHA512:
6
- metadata.gz: b9d1c14a4300efb6ee8c7ff6da7d1162b75ebfaaf23bb0f2ec0b319cc42f9b5bb5b804de8ce33058cf8d94ee3dc48ae054e205e00fb7e1f5182593d194b5a296
7
- data.tar.gz: a5869186cbba6d7ce01fc979a53ad062c38579870b976530741c93f1f9cda04c48a51f36b901e7d869714f5614b8b70cad103a8b1f661a7a4c634da1a5756f4a
6
+ metadata.gz: 2e3a9003ff8f32588cfdbb3668ec0b4ff2eed92a8675c8216958bb3546c5931e78c3f7d04849a70f3cb3614bebf00bdb0777ff30c3e8ccfb67ee95d32cc0e32b
7
+ data.tar.gz: 8cac8a2f152aa564e9db597f75cb798a77235331d84bf04efd6a8f5e95ee893d70a6a23141d49fafdd8808e52b0b575d3f635555e5d14e044fd90ace2c1bed52
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
- feedly_api [![Build Status](https://travis-ci.org/Myuzu/feedly_api.png?branch=master)](https://travis-ci.org/Myuzu/feedly_api) [![Code Climate](https://codeclimate.com/github/Myuzu/feedly_api.png)](https://codeclimate.com/github/Myuzu/feedly_api) [![Dependency Status](https://gemnasium.com/Myuzu/feedly_api.png)](https://gemnasium.com/Myuzu/feedly_api) [![Gem Version](https://badge.fury.io/rb/feedly_api.png)](http://badge.fury.io/rb/feedly_api)
1
+ feedly_api
2
2
  ==========
3
+ [![Coverage Status](https://coveralls.io/repos/Myuzu/feedly_api/badge.png)](https://coveralls.io/r/Myuzu/feedly_api) [![Build Status](https://travis-ci.org/Myuzu/feedly_api.png?branch=master)](https://travis-ci.org/Myuzu/feedly_api) [![Code Climate](https://codeclimate.com/github/Myuzu/feedly_api.png)](https://codeclimate.com/github/Myuzu/feedly_api) [![Dependency Status](https://gemnasium.com/Myuzu/feedly_api.png)](https://gemnasium.com/Myuzu/feedly_api) [![Gem Version](https://badge.fury.io/rb/feedly_api.png)](http://badge.fury.io/rb/feedly_api)
3
4
 
4
- Early unofficial Feedly API
5
+ Early unofficial Feedly API with no external dependencies
5
6
 
6
7
  ## Limitations
7
8
  * no auth for now
@@ -49,6 +50,10 @@ List of params you can pass to `items` method:
49
50
  * `continuation`: string
50
51
  * maybe some other params...
51
52
 
53
+ ## Supported Ruby Versions
54
+
55
+ feedly_api is tested under 1.9.3, 2.0.0, JRuby (1.9 mode), and Rubinius (1.9 mode).
56
+
52
57
  ## License
53
58
 
54
59
  Apache License, Version 2.0
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.homepage = 'https://github.com/Myuzu/feedly_api'
10
10
  s.summary = %q{Ruby wrapper for Feedly API}
11
11
  s.description = %q{Simpe unofficial Feedly API wrapper. No auth yet.}
12
- s.license = 'Apache version 2'
12
+ s.license = 'Apache License, Version 2.0'
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.require_paths = ['lib']
@@ -19,4 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_development_dependency 'rake'
20
20
  s.add_development_dependency 'rspec'
21
21
  s.add_development_dependency 'pry'
22
+ s.add_development_dependency 'coveralls'
22
23
  end
@@ -7,7 +7,7 @@ require 'feedly_api/client'
7
7
 
8
8
  module FeedlyApi
9
9
  class Feed
10
- attr_reader :url, :subscribers, :title, :velocity
10
+ attr_reader :url, :subscribers, :title, :velocity, :id
11
11
 
12
12
  def initialize(url)
13
13
  @url = url
@@ -1,3 +1,3 @@
1
1
  module FeedlyApi
2
- VERSION = '0.4b'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -1,5 +1,55 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe FeedlyApi do
3
+ describe FeedlyApi::Feed do
4
4
 
5
+ describe '#new' do
6
+ context 'valid url' do
7
+ let(:feed) { FeedlyApi::Feed.new 'https://www.eff.org/rss/updates.xml' }
8
+
9
+ it 'has url' do
10
+ expect(feed.url).to eq 'https://www.eff.org/rss/updates.xml'
11
+ end
12
+
13
+ it 'has id' do
14
+ expect(feed.id).to eq 'feed%2Fhttps%3A%2F%2Fwww.eff.org%2Frss%2Fupdates.xml'
15
+ end
16
+ end
17
+
18
+ context 'invalid url' do
19
+ it 'fails with exception' do
20
+ expect {
21
+ FeedlyApi::Feed.new 'https://www.eff.org/rss/updates.xml12'
22
+ }.to raise_error
23
+ end
24
+ end
25
+ end
26
+
27
+ describe '#items' do
28
+ let(:feed) { FeedlyApi::Feed.new 'https://www.eff.org/rss/updates.xml' }
29
+
30
+ context 'valid params' do
31
+ it 'returns 20 feed items by default' do
32
+ expect(feed.items.length).to eq 20
33
+ end
34
+
35
+ it 'takes :count param to get more or less feed items' do
36
+ expect(feed.items(count: 50).length).to eq 50
37
+ end
38
+
39
+ it 'takes :ranked param with value "oldest" and returns oldest items first' do
40
+ items = feed.items(ranked: 'oldest')
41
+ expect(items.first[:published] < items.last[:published]).to be_true
42
+ end
43
+ end
44
+
45
+ context 'not valid params' do
46
+ it 'returns 0 items for negative :count param' do
47
+ expect(feed.items(count: -50).length).to eq 0
48
+ end
49
+
50
+ it 'return defaul count of items (20) for non integer value' do
51
+ expect(feed.items(count: 'NOT_AN_INTEGER').length).to eq 20
52
+ end
53
+ end
54
+ end
5
55
  end
@@ -1,2 +1,4 @@
1
1
  require 'feedly_api'
2
2
  require 'pry'
3
+ require 'coveralls'
4
+ Coveralls.wear!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedly_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4b
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myuzu
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
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'
55
69
  description: Simpe unofficial Feedly API wrapper. No auth yet.
56
70
  email:
57
71
  executables: []
@@ -75,7 +89,7 @@ files:
75
89
  - spec/spec_helper.rb
76
90
  homepage: https://github.com/Myuzu/feedly_api
77
91
  licenses:
78
- - Apache version 2
92
+ - Apache License, Version 2.0
79
93
  metadata: {}
80
94
  post_install_message:
81
95
  rdoc_options: []
@@ -88,9 +102,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
102
  version: 1.9.3
89
103
  required_rubygems_version: !ruby/object:Gem::Requirement
90
104
  requirements:
91
- - - '>'
105
+ - - '>='
92
106
  - !ruby/object:Gem::Version
93
- version: 1.3.1
107
+ version: '0'
94
108
  requirements: []
95
109
  rubyforge_project:
96
110
  rubygems_version: 2.0.3