arena 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +7 -7
- data/arena.gemspec +1 -0
- data/lib/arena/api.rb +6 -0
- data/lib/arena/default.rb +1 -1
- data/lib/arena/user_feed.rb +21 -0
- data/lib/arena/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63742aa810552a858472fbbcfc3515ebd3975770
|
4
|
+
data.tar.gz: 6898f88f062a389ffc2114ac56e471f59701e05c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 773272201707b610eaafdb248bd08e3c07a290e86cdead10b7dbbe2f8335c8711cf0f769d5dbe575c680f3aec448b7f391711e77d757392e6fcebb900eaecb07
|
7
|
+
data.tar.gz: 38133e74108afe9e4024104a966ab7d7263210a1f11cffd60bb395d330c8ec3128b7268aeff73838e373a50245ab265e5596af6f9697c9768154a513fa47798e
|
data/Rakefile
CHANGED
@@ -6,12 +6,12 @@ task :console do
|
|
6
6
|
sh "irb -rubygems -I lib -r arena.rb"
|
7
7
|
end
|
8
8
|
|
9
|
-
|
9
|
+
require 'rake/testtask'
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
Rake::TestTask.new do |t|
|
12
|
+
t.libs << 'lib/arena'
|
13
|
+
t.test_files = FileList['test/lib/arena/*_test.rb']
|
14
|
+
t.verbose = true
|
15
|
+
end
|
16
16
|
|
17
|
-
task :default => :
|
17
|
+
task :default => :test
|
data/arena.gemspec
CHANGED
data/lib/arena/api.rb
CHANGED
@@ -7,6 +7,7 @@ require "arena/account"
|
|
7
7
|
require "arena/comment"
|
8
8
|
require "arena/feed"
|
9
9
|
require "arena/channel_feed"
|
10
|
+
require "arena/user_feed"
|
10
11
|
|
11
12
|
module Arena
|
12
13
|
module API
|
@@ -50,6 +51,11 @@ module Arena
|
|
50
51
|
object_from_response(Arena::ChannelFeed, :get, "/channel/#{id}/feed", options)
|
51
52
|
end
|
52
53
|
|
54
|
+
# Returns a paginated feed for a given User
|
55
|
+
def user_feed(id, options={})
|
56
|
+
object_from_response(Arena::UserFeed, :get, "/user/#{id}/feed", options)
|
57
|
+
end
|
58
|
+
|
53
59
|
# Returns a full Block representation
|
54
60
|
def block(id, options={})
|
55
61
|
object_from_response(Arena::Block, :get, "/blocks/#{id}", options)
|
data/lib/arena/default.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Arena
|
2
2
|
module Default
|
3
|
-
BASE_DOMAIN = "
|
3
|
+
BASE_DOMAIN = "api.are.na" unless defined? BASE_DOMAIN
|
4
4
|
API_VERSION = "v2" unless defined? API_VERSION
|
5
5
|
USE_CACHING = false unless defined? USE_CACHING
|
6
6
|
EXPIRES_IN = 600 unless defined? EXPIRES_IN # 10 minutes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "arena/base"
|
2
|
+
require "arena/story"
|
3
|
+
|
4
|
+
module Arena
|
5
|
+
class UserFeed < Arena::Base
|
6
|
+
attr_reader :type, :limit, :total, :offset, :range_start, :range_end
|
7
|
+
|
8
|
+
def stories
|
9
|
+
@stories ||= @attrs["items"].collect { |item| Arena::Story.new(item) } if stories?
|
10
|
+
end
|
11
|
+
|
12
|
+
alias items stories
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def stories?
|
17
|
+
!@attrs["items"].nil?
|
18
|
+
end
|
19
|
+
|
20
|
+
end # Feed
|
21
|
+
end # Arena
|
data/lib/arena/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arena
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dzuc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
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'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: json
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,6 +116,7 @@ files:
|
|
102
116
|
- lib/arena/story.rb
|
103
117
|
- lib/arena/summary.rb
|
104
118
|
- lib/arena/user.rb
|
119
|
+
- lib/arena/user_feed.rb
|
105
120
|
- lib/arena/version.rb
|
106
121
|
- test/lib/arena/version_test.rb
|
107
122
|
- test/test_helper.rb
|