Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More descriptive constant names

  • Loading branch information...
commit da7bac8bb7bfbf8e62296671505ba8e729e1da25 1 parent e4ad30a
@johnmuhl authored
View
6 lib/ray/constants.rb
@@ -10,8 +10,8 @@ module Ray
GEMFILE = "#{ROOT}/Gemfile"
EXT_DIR = "#{ROOT}/vendor/extensions"
TMP_DIR = "#{ROOT}/tmp/ray"
- RG_V1_API = "http://rubygems.org/api/v1"
- GH_V2_API = "http://github.com/api/v2/json"
- GH_V3_API = "https://api.github.com"
+ RUBYGEMS_V1_API = "http://rubygems.org/api/v1"
+ GITHUB_V2_API = "http://github.com/api/v2/json"
+ GITHUB_V3_API = "https://api.github.com"
end
View
2  lib/ray/extension/gem.rb
@@ -37,7 +37,7 @@ def add_gem
def version
return 0 unless @name
- uri = "#{RG_V1_API}/gems/radiant-#{@name}-extension.json"
+ uri = "#{RUBYGEMS_V1_API}/gems/radiant-#{@name}-extension.json"
response = open(uri).read
MultiJson.decode(response)["version"]
end
View
4 lib/ray/search/github.rb
@@ -10,7 +10,7 @@ class GitHub
def initialize query
@query = query
- @uri = "#{Ray::GH_V2_API}/repos/search/radiant+#{@query}"
+ @uri = "#{Ray::GITHUB_V2_API}/repos/search/radiant+#{@query}"
@results = search
end
@@ -31,7 +31,7 @@ def normalize response
end
def real_name owner
- response = open("#{GH_V3_API}/users/#{owner}").read
+ response = open("#{GITHUB_V3_API}/users/#{owner}").read
MultiJson.decode(response)["name"]
end
View
2  lib/ray/search/rubygems.rb
@@ -11,7 +11,7 @@ class RubyGems
def initialize query
@query = query
- @uri = "#{Ray::RG_V1_API}/search.json?query=radiant-#{@query}"
+ @uri = "#{Ray::RUBYGEMS_V1_API}/search.json?query=radiant-#{@query}"
@results = search
end
Please sign in to comment.
Something went wrong with that request. Please try again.