gist_updater 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -11
- data/lib/gist_updater/config.rb +2 -2
- data/lib/gist_updater/content.rb +1 -1
- data/lib/gist_updater/updater.rb +6 -4
- data/lib/gist_updater/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8dc664768fabfe6e4e086ab381b3b58f08274ba
|
4
|
+
data.tar.gz: 9b74e345d7683da1a001f56fa832c2f9a0fafd5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 830f3f9d40f2c3b3067a18c86b59edd11ec7e9cc754213327abb2e346c26bff3ae5ad88d6ffa5ee563d49a4be6d9cbc2771811c7f035ef94ac9958479259291f
|
7
|
+
data.tar.gz: 23fcdd22918ccce311d79e96569d80c4a41d750b6c8de825a508318950506c1c3e831fd9295d7d1c8d8bd76439296ba4bc5ea187270c094b7f596d2b4fee7b4c
|
data/README.md
CHANGED
@@ -52,10 +52,10 @@ Options:
|
|
52
52
|
require 'gist_updater'
|
53
53
|
|
54
54
|
GistUpdater::Updater.new(
|
55
|
-
yaml:
|
56
|
-
user:
|
57
|
-
token:
|
58
|
-
debug:
|
55
|
+
yaml: 'User definition YAML file',
|
56
|
+
user: 'GitHub usename', # or $GISTUPDATER_USER
|
57
|
+
token: 'GitHub personal access token', # or $GISTUPDATER_ACCESS_TOKEN
|
58
|
+
debug: 'true or false'
|
59
59
|
).update
|
60
60
|
#=> update count
|
61
61
|
```
|
@@ -64,11 +64,12 @@ GistUpdater::Updater.new(
|
|
64
64
|
|
65
65
|
```yaml
|
66
66
|
-
|
67
|
-
-
|
68
|
-
-
|
67
|
+
- 'gist_id_1'
|
68
|
+
- 'path to file_1'
|
69
69
|
-
|
70
|
-
-
|
71
|
-
-
|
70
|
+
- 'gist_id_2'
|
71
|
+
- 'path to file_2a'
|
72
|
+
- 'path to file_2b'
|
72
73
|
```
|
73
74
|
|
74
75
|
For example,
|
@@ -79,9 +80,10 @@ For example,
|
|
79
80
|
- 8177244
|
80
81
|
- .emacs.d/init.el
|
81
82
|
-
|
82
|
-
# https://gist.github.com/masutaka/
|
83
|
-
-
|
84
|
-
-
|
83
|
+
# https://gist.github.com/masutaka/f7ce8b3c71e995c20e48
|
84
|
+
- f7ce8b3c71e995c20e48
|
85
|
+
- circle.yml
|
86
|
+
- tasks/pushover.rake
|
85
87
|
```
|
86
88
|
|
87
89
|
## Development
|
data/lib/gist_updater/config.rb
CHANGED
data/lib/gist_updater/content.rb
CHANGED
data/lib/gist_updater/updater.rb
CHANGED
@@ -12,8 +12,10 @@ module GistUpdater
|
|
12
12
|
def update
|
13
13
|
count = 0
|
14
14
|
|
15
|
-
config.each do |gist_id
|
16
|
-
|
15
|
+
config.each do |gist_id:, file_paths:|
|
16
|
+
file_paths.each do |file_path|
|
17
|
+
count += 1 if update_by_gist(gist_id, file_path)
|
18
|
+
end
|
17
19
|
end
|
18
20
|
|
19
21
|
count
|
@@ -23,11 +25,11 @@ module GistUpdater
|
|
23
25
|
|
24
26
|
attr_reader :user, :access_token, :config
|
25
27
|
|
26
|
-
def
|
28
|
+
def update_by_gist(id, file_path)
|
27
29
|
Content.new(
|
28
30
|
user: user,
|
29
31
|
access_token: access_token,
|
30
|
-
gist_id:
|
32
|
+
gist_id: id,
|
31
33
|
file_path: file_path
|
32
34
|
).update_if_need
|
33
35
|
end
|
data/lib/gist_updater/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gist_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Masuda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|