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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d5a02ec6cdfeb6e9b9d00226966edc24000185c
4
- data.tar.gz: 2447fe441095ac271e4ae0f3c8a237efc9013d27
3
+ metadata.gz: f3f62218e00ac875936745e421e6274c4c4eb506
4
+ data.tar.gz: 3e00953285cb43b8c1ec87abccfda04d6e17e878
5
5
  SHA512:
6
- metadata.gz: 5698963b7a4f4eb66e0f30ce5c17f74da1c22438d471304145953dacfd112092695276206e4508aab19505be6fefa6e1d94e5381b3ebddbace590228d3a24e14
7
- data.tar.gz: 3867718dad4a4552dd5b229a41bad22f481dccc8565442132b7c93602b8385966c482558a464ce320d61a72e04992ddab78d8b8f3006b4c3d80bff6f0412af3d
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 # {"development" => [{"name" => "bundler", "requirements" => "~> 1.0"}], "runtime" => [{"name" => "multipart-post", "requirements" => "< 3, >= 1.2"}]}
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']
@@ -1,3 +1,3 @@
1
1
  module RubyGemsApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -26,30 +26,16 @@ class RubyGems
26
26
 
27
27
  def urls
28
28
  url_hash = {}
29
- if @body["bug_tracker_uri"]
30
- url_hash[:bug_tracker_uri] = @body["bug_tracker_uri"]
31
- end
32
- if @body["documentation_uri"]
33
- url_hash[:documentation_uri] = @body["documentation_uri"]
34
- end
35
- if @body["gem_uri"]
36
- url_hash[:gem_uri] = @body["gem_uri"]
37
- end
38
- if @body["homepage_uri"]
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
@@ -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({"development" => [{"name" => "bundler", "requirements" => "~> 1.0"}], "runtime" => [{"name" => "multipart-post", "requirements" => "< 3, >= 1.2"}]})
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyGemsApi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - stevepm