contribution_count 0.1.0 → 0.1.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 +4 -4
- data/README.md +13 -4
- data/lib/contribution_count/client.rb +10 -0
- data/lib/contribution_count/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0600b17970c524d60c7f97d0a738deaea4446eed1940fdd8bccab5068097259f
|
|
4
|
+
data.tar.gz: acb097ba2ce8d9ddc69821f742d6d7d000a3e25f02c7554bf2a673231f186ad9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 423b1df81bb556bcf0fb359975a2cc685e22d3ec8e3c177f8da9a8764d7b975bf9d28e2cbd5113fb200357a0033553923d4d8d8f9f67127ae4ebd18f1330ad91
|
|
7
|
+
data.tar.gz: 79c6acdd82a1296017e146c5b94f98565e72edd436a9cb9e5dfaad851677b45d9fd805613f527ae4166ac1df98807027da25599204d63d0f61592a33f54888c5
|
data/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# ContributionCount
|
|
2
|
-
GitHub contribution count client
|
|
2
|
+
- GitHub contribution count client
|
|
3
|
+
- https://rubygems.org/gems/contribution_count
|
|
3
4
|
|
|
4
5
|
## Installation
|
|
5
6
|
|
|
@@ -19,15 +20,19 @@ Or install it yourself as:
|
|
|
19
20
|
|
|
20
21
|
## Usage
|
|
21
22
|
```ruby
|
|
22
|
-
name =
|
|
23
|
+
name = "github_account_name"
|
|
23
24
|
# 1year
|
|
24
25
|
ContributionCount.new(name).all
|
|
25
26
|
# today
|
|
26
27
|
ContributionCount.new(name).today
|
|
27
28
|
# yesterday
|
|
28
|
-
ContributionCount.new(name).
|
|
29
|
+
ContributionCount.new(name).yesterday
|
|
29
30
|
# select date
|
|
30
31
|
ContributionCount.new(name).date("yyyy-mm-dd")
|
|
32
|
+
# today contribution?
|
|
33
|
+
ContributionCount.new(name).contribution_today?
|
|
34
|
+
# select date contribution?
|
|
35
|
+
ContributionCount.new(name).contribution("yyyy-mm-dd")?
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
## Contributing
|
|
@@ -40,4 +45,8 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
40
45
|
|
|
41
46
|
## Code of Conduct
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
Fork it ( https://github.com/emono/contribution_count )
|
|
49
|
+
Create your feature branch (git checkout -b my-new-feature)
|
|
50
|
+
Commit your changes (git commit -am 'Add some feature')
|
|
51
|
+
Push to the branch (git push origin my-new-feature)
|
|
52
|
+
Create a new Pull Request
|
|
@@ -14,6 +14,11 @@ module ContributionCount
|
|
|
14
14
|
count_hash[today]
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
def contribution_today?
|
|
18
|
+
return false if today == 0
|
|
19
|
+
true
|
|
20
|
+
end
|
|
21
|
+
|
|
17
22
|
def yesterday
|
|
18
23
|
yesterday = (Date.today - 1).to_s
|
|
19
24
|
count_hash[yesterday]
|
|
@@ -30,6 +35,11 @@ module ContributionCount
|
|
|
30
35
|
count
|
|
31
36
|
end
|
|
32
37
|
|
|
38
|
+
def contribution?(date_str)
|
|
39
|
+
return false if date(date_str) == 0
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
|
|
33
43
|
private
|
|
34
44
|
def html
|
|
35
45
|
begin
|