octopi 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 7
4
+ :patch: 8
data/lib/octopi/base.rb CHANGED
@@ -26,8 +26,8 @@ module Octopi
26
26
  # puts caller.first.inspect
27
27
  # puts "#{self.class.inspect} #{attributes.keys.map { |s| s.to_sym }.inspect}"
28
28
  attributes.each do |key, value|
29
- raise "no attr_accessor set for #{key} on #{self.class}" if !respond_to?("#{key}=")
30
- self.send("#{key}=", value)
29
+ method = "#{key}="
30
+ self.send(method, value) if respond_to? method
31
31
  end
32
32
  end
33
33
 
@@ -109,7 +109,7 @@ module Octopi
109
109
  end
110
110
 
111
111
  def collaborators
112
- property('collaborators', [self.owner, self.name].join('/')).values.map { |v| User.find(v) }
112
+ property('collaborators', [self.owner, self.name].join('/')).values.map { |v| User.find(v.join) }
113
113
  end
114
114
 
115
115
  def self.create(options={})
data/lib/octopi/user.rb CHANGED
@@ -1,9 +1,17 @@
1
1
  module Octopi
2
2
  class User < Base
3
3
  include Resource
4
- attr_accessor :company, :name, :following_count, :blog, :public_repo_count, :public_gist_count, :id, :login, :followers_count, :created_at, :email, :location, :disk_usage, :private_repo_count, :private_gist_count, :collaborators, :plan, :owned_private_repo_count, :total_private_repo_count,
5
- # These come from search results, which doesn't contain the above information.
6
- :actions, :score, :language, :followers, :following, :fullname, :type, :username, :repos, :pushed, :created
4
+ attr_accessor :company, :name, :following_count, :gravatar_id,
5
+ :blog, :public_repo_count, :public_gist_count,
6
+ :id, :login, :followers_count, :created_at,
7
+ :email, :location, :disk_usage, :private_repo_count,
8
+ :private_gist_count, :collaborators, :plan,
9
+ :owned_private_repo_count, :total_private_repo_count,
10
+
11
+ # These come from search results, which doesn't
12
+ # contain the above information.
13
+ :actions, :score, :language, :followers, :following,
14
+ :fullname, :type, :username, :repos, :pushed, :created
7
15
 
8
16
  def plan=(attributes={})
9
17
  @plan = Plan.new(attributes)
data/octopi.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{octopi}
8
- s.version = "0.2.7"
8
+ s.version = "0.2.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Felipe Coury"]
12
- s.date = %q{2009-12-29}
12
+ s.date = %q{2010-01-18}
13
13
  s.email = %q{felipe.coury@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
24
24
  "Rakefile",
25
25
  "VERSION.yml",
26
26
  "contrib/backup.rb",
27
- "lib/ext/hash_ext.rb",
28
27
  "lib/ext/string_ext.rb",
29
28
  "lib/octopi.rb",
30
29
  "lib/octopi/api.rb",
@@ -60,6 +59,7 @@ Gem::Specification.new do |s|
60
59
  s.test_files = [
61
60
  "test/api_test.rb",
62
61
  "test/authenticated_test.rb",
62
+ "test/base_test.rb",
63
63
  "test/blob_test.rb",
64
64
  "test/branch_test.rb",
65
65
  "test/commit_test.rb",
data/test/base_test.rb ADDED
@@ -0,0 +1,20 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class BaseTest < Test::Unit::TestCase
4
+ class SparseUser < Octopi::Base
5
+ include Octopi::Resource
6
+
7
+ attr_accessor :some_attribute
8
+
9
+ find_path "/user/search/:query"
10
+ resource_path "/user/show/:id"
11
+ end
12
+
13
+ def setup
14
+ fake_everything
15
+ end
16
+
17
+ should "not raise an error if it doesn't know about the attributes that GitHub API provides" do
18
+ assert_nothing_raised { SparseUser.find("radar") }
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felipe Coury
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-29 00:00:00 +10:00
12
+ date: 2010-01-18 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -70,7 +70,6 @@ files:
70
70
  - Rakefile
71
71
  - VERSION.yml
72
72
  - contrib/backup.rb
73
- - lib/ext/hash_ext.rb
74
73
  - lib/ext/string_ext.rb
75
74
  - lib/octopi.rb
76
75
  - lib/octopi/api.rb
@@ -127,6 +126,7 @@ summary: A Ruby interface to GitHub API v2
127
126
  test_files:
128
127
  - test/api_test.rb
129
128
  - test/authenticated_test.rb
129
+ - test/base_test.rb
130
130
  - test/blob_test.rb
131
131
  - test/branch_test.rb
132
132
  - test/commit_test.rb
data/lib/ext/hash_ext.rb DELETED
@@ -1,5 +0,0 @@
1
- class Hash
2
- def method_missing(method, *args)
3
- self[method] || self[method.to_s]
4
- end
5
- end