githubstats 1.0.0 → 1.0.1

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: a8fcc1bfccab9560ddc96b3697b0e85be337cf05
4
- data.tar.gz: b7450562a5f1ed71da62c9350eb2b2c1e0ce0ff1
3
+ metadata.gz: c3c2414532bab26c7b105bdc59067f931fa0e39b
4
+ data.tar.gz: b6a65ed1ebcc89f6b6956130019710ccad39b984
5
5
  SHA512:
6
- metadata.gz: b6a800c7df5de40509861207ed9bc3c427b2ffb28546b7e96ca492b1e4a47d98c8375fcd0de9e6cb702af02a87db0ca225b344a6603a4369a62401f598a3536f
7
- data.tar.gz: 0af4dc52be5b355c68df764f4f6c4bfbd63a6af3aa5ae95d90b6dbc17b547f31eb7ebbc20384551b0b82a8f3b9a9e61fdf284cf2434452ee7f988338d9eca946
6
+ metadata.gz: 315b992cf733de530e044cefe4442cd1ffbba829f4a0a5b01bfc5ef02817a2566a2878a2e79701b7ec56f89f41bd68f04aa3f99d43a47c06a395899f955358ce
7
+ data.tar.gz: 91577a89b83e153f44e06c5334a7073a61b9ab32683562a52064202c4cb61663aacb8fde7be3cb088e3f644a41f4026d7300bfbf5840c6614833507ff243b30f
data/.travis.yml CHANGED
@@ -2,8 +2,10 @@ language: ruby
2
2
  cache: bundler
3
3
  sudo: false
4
4
  rvm:
5
+ - 2.2.2
6
+ - 2.2.1
5
7
  - 2.2.0
6
- - 2.1.5
8
+ - 2.1.6
7
9
  - 2.0.0-p598
8
10
  - 1.9.3-p551
9
11
  env:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.0.1 / 2015-07-16
2
+
3
+ * [ENHANCEMENT] Replace instance_eval with define_singleton_method for dynamic method passing
4
+ * [FEATURE] Add support for GitHub Enterprise via GITHUB_URL environment variable
5
+
1
6
  # 1.0.0 / 2015-02-09
2
7
 
3
8
  * [ENHANCEMENT] Stabilized API
data/README.md CHANGED
@@ -83,6 +83,10 @@ Contribution data for fly:
83
83
 
84
84
  ```
85
85
 
86
+ ### GitHub Enterprise
87
+
88
+ If you're using GitHub Enterprise, you can override the URL used by setting the GITHUB_URL environment variable or by passing the :url parameter when creating a GithubStats object.
89
+
86
90
  ## Installation
87
91
 
88
92
  gem install githubstats
data/githubstats.gemspec CHANGED
@@ -22,9 +22,9 @@ Gem::Specification.new do |s|
22
22
  s.add_runtime_dependency 'nokogiri', '~> 1.6.5'
23
23
 
24
24
  s.add_development_dependency 'timecop', '~> 0.7.1'
25
- s.add_development_dependency 'rubocop', '~> 0.29.0'
25
+ s.add_development_dependency 'rubocop', '~> 0.32.0'
26
26
  s.add_development_dependency 'rake', '~> 10.4.0'
27
- s.add_development_dependency 'coveralls', '~> 0.7.1'
28
- s.add_development_dependency 'rspec', '~> 3.2.0'
27
+ s.add_development_dependency 'coveralls', '~> 0.8.0'
28
+ s.add_development_dependency 'rspec', '~> 3.3.0'
29
29
  s.add_development_dependency 'fuubar', '~> 2.0.0'
30
30
  end
data/lib/githubstats.rb CHANGED
@@ -22,10 +22,15 @@ module GithubStats
22
22
  self::User.new(*args)
23
23
  end
24
24
 
25
+ ##
26
+ # Default host for grabbing data
27
+
28
+ DEFAULT_HOST = ENV['GITHUB_URL'] || 'https://github.com'
29
+
25
30
  ##
26
31
  # Default URL for grabbing data
27
32
 
28
- DEFAULT_URL = 'https://github.com/users/%s/contributions'
33
+ DEFAULT_URL = "#{DEFAULT_HOST}/users/%s/contributions"
29
34
 
30
35
  ##
31
36
  # User object
@@ -101,7 +106,7 @@ module GithubStats
101
106
  def method_missing(sym, *args, &block)
102
107
  load_data if @last_updated.nil?
103
108
  return super unless @data.respond_to? sym
104
- instance_eval "def #{sym}(*args, &block) @data.#{sym}(*args, &block) end"
109
+ define_singleton_method(sym) { |*a, &b| @data.send(sym, *a, &b) }
105
110
  send(sym, *args, &block)
106
111
  end
107
112
  end
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Define the version
3
3
  module GithubStats
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githubstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.29.0
75
+ version: 0.32.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.29.0
82
+ version: 0.32.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,28 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.7.1
103
+ version: 0.8.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.7.1
110
+ version: 0.8.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 3.2.0
117
+ version: 3.3.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 3.2.0
124
+ version: 3.3.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: fuubar
127
127
  requirement: !ruby/object:Gem::Requirement