RubyGemsApi 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/RubyGemsApi/version.rb +1 -1
- data/lib/ruby_gems.rb +12 -26
- data/spec/rubygemsapi_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3f62218e00ac875936745e421e6274c4c4eb506
|
4
|
+
data.tar.gz: 3e00953285cb43b8c1ec87abccfda04d6e17e878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12f3ea213d2d14d29bcaba0a0511f7e1a5e920afe262976a74b0b6958c53696e5af88df36ec41387b8daeee47b95f829e27c78da3c06de3c1a3346486b000200
|
7
|
+
data.tar.gz: 5f7f908fbece1cbaefa4266e8e33126a9b151159033a11dca2ae863c7e75d14488c536d087e4a48598a0c2639b9abd21d27a918bcc8ec6269d47e7d12daafce6
|
data/README.md
CHANGED
@@ -24,6 +24,8 @@ Or install it yourself as:
|
|
24
24
|
* Command is on the left, output is on the right
|
25
25
|
|
26
26
|
```ruby
|
27
|
+
require 'ruby_gems'
|
28
|
+
|
27
29
|
faraday = RubyGems.new("faraday")
|
28
30
|
faraday.name # 'faraday'
|
29
31
|
faraday.version # '0.9.0'
|
@@ -31,7 +33,7 @@ Or install it yourself as:
|
|
31
33
|
faraday.version_downloads # 1202947
|
32
34
|
faraday.urls # {:gem_uri => "http://rubygems.org/gems/faraday-0.9.0.gem",:homepage_uri => "https://github.com/lostisland/faraday",:project_uri => "http://rubygems.org/gems/faraday"}
|
33
35
|
faraday.description # "HTTP/REST API client library."
|
34
|
-
faraday.dependencies # {
|
36
|
+
faraday.dependencies # {:development => [{:name => "bundler", :requirements => "~> 1.0"}], :runtime => [{:name => "multipart-post", :requirements => "< 3, >= 1.2"}]}
|
35
37
|
faraday.licenses # ['MIT']
|
36
38
|
faraday.authors # ['Rick Olson']
|
37
39
|
faraday.platform # ['ruby']
|
data/lib/RubyGemsApi/version.rb
CHANGED
data/lib/ruby_gems.rb
CHANGED
@@ -26,30 +26,16 @@ class RubyGems
|
|
26
26
|
|
27
27
|
def urls
|
28
28
|
url_hash = {}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
if @body["
|
33
|
-
|
34
|
-
|
35
|
-
if @body["
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
url_hash[:homepage_uri] = @body["homepage_uri"]
|
40
|
-
end
|
41
|
-
if @body["mailing_list_uri"]
|
42
|
-
url_hash[:mailing_list_uri] = @body["mailing_list_uri"]
|
43
|
-
end
|
44
|
-
if @body["project_uri"]
|
45
|
-
url_hash[:project_uri] = @body["project_uri"]
|
46
|
-
end
|
47
|
-
if @body["source_code_uri"]
|
48
|
-
url_hash[:source_code_uri] = @body["source_code_uri"]
|
49
|
-
end
|
50
|
-
if @body["wiki_uri"]
|
51
|
-
url_hash[:wiki_uri] = @body["wiki_uri"]
|
52
|
-
end
|
29
|
+
|
30
|
+
url_hash[:bug_tracker_uri] = @body["bug_tracker_uri"] if @body["bug_tracker_uri"]
|
31
|
+
url_hash[:documentation_uri] = @body["documentation_uri"] if @body["documentation_uri"]
|
32
|
+
url_hash[:gem_uri] = @body["gem_uri"] if @body["gem_uri"]
|
33
|
+
url_hash[:homepage_uri] = @body["homepage_uri"] if @body["homepage_uri"]
|
34
|
+
url_hash[:mailing_list_uri] = @body["mailing_list_uri"] if @body["mailing_list_uri"]
|
35
|
+
url_hash[:project_uri] = @body["project_uri"] if @body["project_uri"]
|
36
|
+
url_hash[:source_code_uri] = @body["source_code_uri"] if @body["source_code_uri"]
|
37
|
+
url_hash[:wiki_uri] = @body["wiki_uri"] if @body["wiki_uri"]
|
38
|
+
|
53
39
|
url_hash
|
54
40
|
end
|
55
41
|
|
@@ -58,7 +44,7 @@ class RubyGems
|
|
58
44
|
end
|
59
45
|
|
60
46
|
def dependencies
|
61
|
-
@body["dependencies"]
|
47
|
+
Hash[@body["dependencies"].map{|(k,v)| [k.to_sym,[Hash[v.first.map{|(k,v)| [k.to_sym,v]}]]]}]
|
62
48
|
end
|
63
49
|
|
64
50
|
def licenses
|
@@ -66,7 +52,7 @@ class RubyGems
|
|
66
52
|
end
|
67
53
|
|
68
54
|
def authors
|
69
|
-
@body["authors"].split(",").map{|author| author.strip}
|
55
|
+
@body["authors"].split(",").map { |author| author.strip }
|
70
56
|
end
|
71
57
|
|
72
58
|
def name
|
data/spec/rubygemsapi_spec.rb
CHANGED
@@ -35,7 +35,7 @@ describe RubyGems do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'can return dependencies' do
|
38
|
-
expect(@faraday.dependencies).to eq({
|
38
|
+
expect(@faraday.dependencies).to eq({:development => [{:name => "bundler", :requirements => "~> 1.0"}], :runtime => [{:name => "multipart-post", :requirements => "< 3, >= 1.2"}]})
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'can return the licenses' do
|