github-trending 0.2.1 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86176d792d7bbc10a8f96fef4e471f51cea5b7b8
4
- data.tar.gz: 6653cbef631bfe762bd2deffb91fb2bbecf71481
3
+ metadata.gz: 053f3ab2e5d2eaf8b406c7d3adf730a5fbaff290
4
+ data.tar.gz: 6ede68b0652db73810e5b35893319ec40057fd1d
5
5
  SHA512:
6
- metadata.gz: c9511832609bd6791d70f31427a3af1f8c6a613c460913c2228435f986360cf07e30a796ca75c89088de443c0694eb35d8ee96c07d673772b1a9fcca34aeeddb
7
- data.tar.gz: 6694b5a144ba214c6ff286750498478eea46514c7fd36a013c0fde1d110d16e382aabe9deef1a21000f7f90421366c4ada279a7bfacdfaf1dccaef87f94e3e42
6
+ metadata.gz: c8159c6c2c395ab6c20f35e5f837ef1883c35db04dd6d80b744405442abd217de431fcba2f466b839215c8845690303e17d46390664bef5435616225656229ff
7
+ data.tar.gz: 2074924d7936220f5def6443715c7537e7cee56b06f27ebb8fadf5e4011205b16f2c3e94157f2347c8a0696b52b749be4f316783139d722a6843e82d09c43b99
data/README.md CHANGED
@@ -58,15 +58,16 @@ You can also fetch by a specific language:
58
58
 
59
59
  ```ruby
60
60
  ruby_repos = Github::Trending.get :ruby
61
+ objc_repos = Github::Trending.get :objective_c
61
62
  ```
62
63
 
63
64
  To get a list of all languages:
64
65
 
65
66
  ```ruby
66
- languages = Github::Trending.all_languages
67
+ languages = Github::Trending.languages
67
68
  ```
68
69
 
69
- You can also get top github repos of the `:week` and `:month` as well (default is `:day`):
70
+ You can get top github repos of the `:week` and `:month` as well (default is `:day`):
70
71
 
71
72
  ```ruby
72
73
  Github::Trending.get(:scala, :week)
@@ -75,7 +76,7 @@ Github::Trending.get(:scala, :week)
75
76
  Github::Trending.get(nil, :month)
76
77
  # Top repos (all languages) in this month
77
78
 
78
- Github::Trending.get('visual-basic', 'day')
79
+ Github::Trending.get('objective-c++', 'day')
79
80
  # Can pass strings as well
80
81
  ```
81
82
 
@@ -9,11 +9,17 @@ module Github
9
9
  scraper.get(language, since)
10
10
  end
11
11
 
12
- def self.all_languages
12
+ def self.languages
13
13
  scraper = Github::Trending::Scraper.new
14
14
  scraper.list_languages
15
15
  end
16
16
 
17
+ class << self
18
+ alias_method :all_languages, :languages
19
+ alias_method :get_languages, :languages
20
+ alias_method :list_languages, :languages
21
+ end
22
+
17
23
  class Scraper
18
24
  BASE_HOST = 'https://github.com'
19
25
  BASE_URL = "#{BASE_HOST}/trending"
@@ -56,7 +62,7 @@ module Github
56
62
  private
57
63
 
58
64
  def generate_url_for_get(language, since)
59
- language = language.to_s if language
65
+ language = language.to_s.gsub('_', '-') if language
60
66
 
61
67
  if since
62
68
  since =
@@ -1,5 +1,5 @@
1
1
  module Github
2
2
  module Trending
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-trending
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - rochefort
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-12 00:00:00.000000000 Z
12
+ date: 2014-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor