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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ff2ee6a8ae7cbd5e1f5338814b3240249de79e0
4
- data.tar.gz: 7a6dad62d2f1e6b4006378e70d2bbb8f663c974d
3
+ metadata.gz: 63742aa810552a858472fbbcfc3515ebd3975770
4
+ data.tar.gz: 6898f88f062a389ffc2114ac56e471f59701e05c
5
5
  SHA512:
6
- metadata.gz: c24cbb7bf757fe5d5a451ad0ecb00a99d0462a34fff68dd9d0cb38f08999870b6bb99e58caef3d1cea5ca9d714c23be1f2bf888517ecce35424fdf9dc779933e
7
- data.tar.gz: 11dabfbd36bd6e1ea49643972dcf28f3431bc2d654187e26b487e7b71f924049f0f41fd7370e13d4605ce578c978021a6ebc4c19f3327d965e3c06d6ff10de70
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
- # require 'rake/testtask'
9
+ require 'rake/testtask'
10
10
 
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
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 => :console
17
+ task :default => :test
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Arena::VERSION
17
17
 
18
18
  gem.add_development_dependency 'rake'
19
+ gem.add_development_dependency 'minitest'
19
20
 
20
21
  gem.add_runtime_dependency 'json'
21
22
  gem.add_runtime_dependency 'httparty'
@@ -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)
@@ -1,6 +1,6 @@
1
1
  module Arena
2
2
  module Default
3
- BASE_DOMAIN = "arena-api.herokuapp.com" unless defined? 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
@@ -1,5 +1,5 @@
1
1
  module Arena
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
 
4
4
  def self.version
5
5
  VERSION
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.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-05-29 00:00:00.000000000 Z
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