ddollar-octopi 0.0.13
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.
- data/.gitignore +3 -0
- data/LICENSE +20 -0
- data/README.rdoc +169 -0
- data/Rakefile +83 -0
- data/VERSION.yml +4 -0
- data/contrib/backup.rb +100 -0
- data/examples/authenticated.rb +20 -0
- data/examples/github.yml.example +14 -0
- data/examples/issues.rb +18 -0
- data/examples/overall.rb +50 -0
- data/lib/octopi.rb +236 -0
- data/lib/octopi/base.rb +111 -0
- data/lib/octopi/blob.rb +21 -0
- data/lib/octopi/branch.rb +18 -0
- data/lib/octopi/commit.rb +65 -0
- data/lib/octopi/error.rb +23 -0
- data/lib/octopi/file_object.rb +15 -0
- data/lib/octopi/issue.rb +102 -0
- data/lib/octopi/key.rb +18 -0
- data/lib/octopi/repository.rb +111 -0
- data/lib/octopi/resource.rb +75 -0
- data/lib/octopi/tag.rb +17 -0
- data/lib/octopi/user.rb +99 -0
- data/octopi.gemspec +66 -0
- data/test/octopi_test.rb +46 -0
- data/test/test_helper.rb +10 -0
- metadata +83 -0
data/octopi.gemspec
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{octopi}
|
5
|
+
s.version = "0.0.13"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Felipe Coury"]
|
9
|
+
s.date = %q{2009-07-14}
|
10
|
+
s.email = %q{felipe.coury@gmail.com}
|
11
|
+
s.extra_rdoc_files = [
|
12
|
+
"LICENSE",
|
13
|
+
"README.rdoc"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
".gitignore",
|
17
|
+
"LICENSE",
|
18
|
+
"README.rdoc",
|
19
|
+
"Rakefile",
|
20
|
+
"VERSION.yml",
|
21
|
+
"contrib/backup.rb",
|
22
|
+
"examples/authenticated.rb",
|
23
|
+
"examples/github.yml.example",
|
24
|
+
"examples/issues.rb",
|
25
|
+
"examples/overall.rb",
|
26
|
+
"lib/octopi.rb",
|
27
|
+
"lib/octopi/base.rb",
|
28
|
+
"lib/octopi/blob.rb",
|
29
|
+
"lib/octopi/branch.rb",
|
30
|
+
"lib/octopi/commit.rb",
|
31
|
+
"lib/octopi/error.rb",
|
32
|
+
"lib/octopi/file_object.rb",
|
33
|
+
"lib/octopi/issue.rb",
|
34
|
+
"lib/octopi/key.rb",
|
35
|
+
"lib/octopi/repository.rb",
|
36
|
+
"lib/octopi/resource.rb",
|
37
|
+
"lib/octopi/tag.rb",
|
38
|
+
"lib/octopi/user.rb",
|
39
|
+
"octopi.gemspec",
|
40
|
+
"test/octopi_test.rb",
|
41
|
+
"test/test_helper.rb"
|
42
|
+
]
|
43
|
+
s.homepage = %q{http://github.com/fcoury/octopi}
|
44
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
45
|
+
s.require_paths = ["lib"]
|
46
|
+
s.rubyforge_project = %q{octopi}
|
47
|
+
s.rubygems_version = %q{1.3.4}
|
48
|
+
s.summary = %q{A Ruby interface to GitHub API v2}
|
49
|
+
s.test_files = [
|
50
|
+
"test/octopi_test.rb",
|
51
|
+
"test/test_helper.rb",
|
52
|
+
"examples/authenticated.rb",
|
53
|
+
"examples/issues.rb",
|
54
|
+
"examples/overall.rb"
|
55
|
+
]
|
56
|
+
|
57
|
+
if s.respond_to? :specification_version then
|
58
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
59
|
+
s.specification_version = 3
|
60
|
+
|
61
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
62
|
+
else
|
63
|
+
end
|
64
|
+
else
|
65
|
+
end
|
66
|
+
end
|
data/test/octopi_test.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class OctopiTest < Test::Unit::TestCase
|
4
|
+
include Octopi
|
5
|
+
|
6
|
+
# TODO: Those tests are obviously brittle. Need to stub/mock it.
|
7
|
+
|
8
|
+
def assert_find_all(cls, check_method, repo, user)
|
9
|
+
repo_method = cls.resource_name(:plural)
|
10
|
+
|
11
|
+
item1 = cls.find_all(repo.name,user.login).first
|
12
|
+
item2 = cls.find_all(repo).first
|
13
|
+
item3 = repo.send(repo_method).first
|
14
|
+
|
15
|
+
assert_equal item1.send(check_method), item2.send(check_method)
|
16
|
+
assert_equal item1.send(check_method), item3.send(check_method)
|
17
|
+
end
|
18
|
+
|
19
|
+
def setup
|
20
|
+
@user = User.find("fcoury")
|
21
|
+
@repo = @user.repository("octopi")
|
22
|
+
@issue = @repo.issues.first
|
23
|
+
end
|
24
|
+
|
25
|
+
context Issue do
|
26
|
+
should "return the correct issue by number" do
|
27
|
+
assert_equal @issue.number, Issue.find(@repo, @issue.number).number
|
28
|
+
assert_equal @issue.number, Issue.find(@user, @repo, @issue.number).number
|
29
|
+
assert_equal @issue.number, Issue.find(@repo.owner, @repo.name, @issue.number).number
|
30
|
+
end
|
31
|
+
|
32
|
+
should "return the correct issue by using repo.issue number" do
|
33
|
+
assert_equal @issue.number, @repo.issue(@issue.number).number
|
34
|
+
end
|
35
|
+
|
36
|
+
should "fetch the same issue using different but equivalent find_all params" do
|
37
|
+
assert_find_all Issue, :number, @repo, @user
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context Commit do
|
42
|
+
should "fetch the same commit using different but equivalent find_all params" do
|
43
|
+
assert_find_all Commit, :id, @repo, @user
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ddollar-octopi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.13
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Felipe Coury
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-07-14 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: felipe.coury@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- .gitignore
|
27
|
+
- LICENSE
|
28
|
+
- README.rdoc
|
29
|
+
- Rakefile
|
30
|
+
- VERSION.yml
|
31
|
+
- contrib/backup.rb
|
32
|
+
- examples/authenticated.rb
|
33
|
+
- examples/github.yml.example
|
34
|
+
- examples/issues.rb
|
35
|
+
- examples/overall.rb
|
36
|
+
- lib/octopi.rb
|
37
|
+
- lib/octopi/base.rb
|
38
|
+
- lib/octopi/blob.rb
|
39
|
+
- lib/octopi/branch.rb
|
40
|
+
- lib/octopi/commit.rb
|
41
|
+
- lib/octopi/error.rb
|
42
|
+
- lib/octopi/file_object.rb
|
43
|
+
- lib/octopi/issue.rb
|
44
|
+
- lib/octopi/key.rb
|
45
|
+
- lib/octopi/repository.rb
|
46
|
+
- lib/octopi/resource.rb
|
47
|
+
- lib/octopi/tag.rb
|
48
|
+
- lib/octopi/user.rb
|
49
|
+
- octopi.gemspec
|
50
|
+
- test/octopi_test.rb
|
51
|
+
- test/test_helper.rb
|
52
|
+
has_rdoc: false
|
53
|
+
homepage: http://github.com/fcoury/octopi
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options:
|
56
|
+
- --charset=UTF-8
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
requirements: []
|
72
|
+
|
73
|
+
rubyforge_project: octopi
|
74
|
+
rubygems_version: 1.2.0
|
75
|
+
signing_key:
|
76
|
+
specification_version: 3
|
77
|
+
summary: A Ruby interface to GitHub API v2
|
78
|
+
test_files:
|
79
|
+
- test/octopi_test.rb
|
80
|
+
- test/test_helper.rb
|
81
|
+
- examples/authenticated.rb
|
82
|
+
- examples/issues.rb
|
83
|
+
- examples/overall.rb
|