mumukit-sync 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/sync/store/github/guide_export.rb +2 -2
- data/lib/mumukit/sync/syncer.rb +11 -7
- data/lib/mumukit/sync/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7700646a96762c5edfceece47306f9293cdab5a5de8ea51c9c516dee4b18361
|
4
|
+
data.tar.gz: e7da567e3e033a31bc601b55ef73e2149364136f8d8848cdf589231345de80dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78600a1359af3109d25012ad77eed530d59631a3d0c409d680efe222b8e9fa54ee997821b4d9950a01ad3e2456620c42ae03b69dc479a7fcd05cf23e4e3092a4
|
7
|
+
data.tar.gz: 425ca634c05eac111674e147cba15d2ed1f5b04c7f0f819e590ba1d38e8dee0cf9b8ce0134a6c2ebf12ad2cba5afe909efecd27dfaa88717af548bb108cc4b80
|
@@ -23,11 +23,11 @@ class Mumukit::Sync::Store::Github
|
|
23
23
|
|
24
24
|
def run_in_local_repo(dir, local_repo)
|
25
25
|
clear_repo local_repo
|
26
|
-
GuideWriter.new(dir
|
26
|
+
GuideWriter.new(dir).write_guide! guide_resource_h
|
27
27
|
local_repo.add(all: true)
|
28
28
|
local_repo.commit("Mumuki Export on #{Time.now}", commit_options)
|
29
29
|
local_repo.push
|
30
|
-
rescue
|
30
|
+
rescue StandardError => e
|
31
31
|
puts "Could not export guide #{guide_resource_h[:slug]} to git #{e}"
|
32
32
|
end
|
33
33
|
|
data/lib/mumukit/sync/syncer.rb
CHANGED
@@ -32,22 +32,26 @@ module Mumukit::Sync
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def locate_and_import!(*args)
|
35
|
-
|
35
|
+
sync_key = key_for(*args)
|
36
|
+
locate(sync_key).tap { |it| import! sync_key, it }
|
36
37
|
end
|
37
38
|
|
38
|
-
def import!(resource)
|
39
|
-
|
40
|
-
|
39
|
+
def import!(sync_key = nil, resource)
|
40
|
+
sync_key ||= resource.sync_key
|
41
|
+
resource_h = @store.read_resource(sync_key)
|
42
|
+
Mumukit::Sync::Inflator.inflate_with! sync_key, resource_h, @inflators
|
41
43
|
resource.import_from_resource_h!(resource_h)
|
42
44
|
end
|
43
45
|
|
44
46
|
def locate_and_export!(*args)
|
45
|
-
|
47
|
+
sync_key = key_for(*args)
|
48
|
+
locate(sync_key).tap { |it| export! sync_key, it }
|
46
49
|
end
|
47
50
|
|
48
|
-
def export!(resource)
|
51
|
+
def export!(sync_key = nil, resource)
|
52
|
+
sync_key ||= resource.sync_key
|
49
53
|
resource_h = resource.to_resource_h
|
50
|
-
@store.write_resource!(
|
54
|
+
@store.write_resource!(sync_key, resource_h)
|
51
55
|
end
|
52
56
|
|
53
57
|
private
|
data/lib/mumukit/sync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit-core
|
@@ -194,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
|
-
|
198
|
-
rubygems_version: 2.7.8
|
197
|
+
rubygems_version: 3.0.2
|
199
198
|
signing_key:
|
200
199
|
specification_version: 4
|
201
200
|
summary: Synchronization tool for resources
|