gist_updater 0.4.2 → 0.4.3
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/gist_updater.gemspec +1 -0
- data/lib/gist_updater/updater.rb +9 -5
- data/lib/gist_updater/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf608c9e5b957a646b9169b87db0716a4ffa57ab
|
4
|
+
data.tar.gz: dc1eb9253fd32f87751a673f184836736eeea99e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66af51b11688aed690c3e1a887a2143e3d36aa06372520d7a3502a3eff2d83e2a339030c150d239e4ecc8e622f0ab4d5bbe25740123d13123a9255c3c192f78f
|
7
|
+
data.tar.gz: 7634a9be5d0465562ad3e38eb44dca722526fa89162faa984f9deb8c2a83415890351573d6fea98749e1105114c2703291dd919bccdcc6b52c61226fe48a8f14
|
data/gist_updater.gemspec
CHANGED
data/lib/gist_updater/updater.rb
CHANGED
@@ -4,7 +4,7 @@ module GistUpdater
|
|
4
4
|
# Updates according to user configuration
|
5
5
|
class Updater
|
6
6
|
# @param options [Hash] options generated by Thor
|
7
|
-
# @param config_class [Class]
|
7
|
+
# @param config_class [Class] A Class which has configuration duty
|
8
8
|
def initialize(options, config_class = Config)
|
9
9
|
@user = options[:user] || ENV['GISTUPDATER_USER']
|
10
10
|
@access_token = options[:token] || ENV['GISTUPDATER_ACCESS_TOKEN']
|
@@ -14,13 +14,14 @@ module GistUpdater
|
|
14
14
|
|
15
15
|
# Update your Gist
|
16
16
|
#
|
17
|
+
# @param content_class [Class] A Class which has content duty
|
17
18
|
# @return [Array<Sawyer::Resource>] Updated resource(s)
|
18
|
-
def update
|
19
|
+
def update(content_class = Content)
|
19
20
|
updated = []
|
20
21
|
|
21
22
|
config.each do |gist_id:, file_paths:|
|
22
23
|
file_paths.each do |file_path|
|
23
|
-
updated << update_by_gist(gist_id, file_path)
|
24
|
+
updated << update_by_gist(gist_id, file_path, content_class)
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
@@ -33,9 +34,12 @@ module GistUpdater
|
|
33
34
|
|
34
35
|
# Update a Gist file
|
35
36
|
#
|
37
|
+
# @param id [String] A gist id
|
38
|
+
# @param file_path [String] A relative file path
|
39
|
+
# @param content_class [Class] A Class which has content duty
|
36
40
|
# @return (see GistUpdater::Content#update_if_need)
|
37
|
-
def update_by_gist(id, file_path)
|
38
|
-
|
41
|
+
def update_by_gist(id, file_path, content_class)
|
42
|
+
content_class.new(
|
39
43
|
user: user,
|
40
44
|
access_token: access_token,
|
41
45
|
gist_id: id,
|
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.
|
4
|
+
version: 0.4.3
|
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-10-
|
11
|
+
date: 2016-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.9.5
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.1'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.1'
|
111
125
|
description: |
|
112
126
|
Updates your Gist files defined in YAML.
|
113
127
|
For example, it's useful for syncing GitHub and Gist in CI.
|