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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c659613a5cf31ae6187d7aef2d53fb2898e6e48317fbd1bdee0b316932f3a41
4
- data.tar.gz: e699518a09b463a3b06ea20592e06850d3ded4cad5cab2e0be5ef984b78122b1
3
+ metadata.gz: d7700646a96762c5edfceece47306f9293cdab5a5de8ea51c9c516dee4b18361
4
+ data.tar.gz: e7da567e3e033a31bc601b55ef73e2149364136f8d8848cdf589231345de80dd
5
5
  SHA512:
6
- metadata.gz: 7f2749d271932fbadf3f60cc5b44685e3d5f83e0de4f2c7aac02c2cbb895f054b511831b8b9afc6cb31b386ec1eb9f15ad17962a47f29094bdc51d113f19b142
7
- data.tar.gz: 686a7017bcfe01e693fc0edf6b45d421bedf6f025ee5b7494fc3b5c515dbfbf22862a6b80da690d5832855c8c2fff29e6c7e85c39a24afe274d4636967bcbe62
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, log).write_guide! guide_resource_h
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 Git::GitExecuteError => e
30
+ rescue StandardError => e
31
31
  puts "Could not export guide #{guide_resource_h[:slug]} to git #{e}"
32
32
  end
33
33
 
@@ -32,22 +32,26 @@ module Mumukit::Sync
32
32
  end
33
33
 
34
34
  def locate_and_import!(*args)
35
- locate(key_for(*args)).tap { |it| import! it }
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
- resource_h = @store.read_resource(resource.sync_key)
40
- Mumukit::Sync::Inflator.inflate_with! resource.sync_key, resource_h, @inflators
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
- locate(key_for(*args)).tap { |it| export! it }
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!(resource.sync_key, resource_h)
54
+ @store.write_resource!(sync_key, resource_h)
51
55
  end
52
56
 
53
57
  private
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Sync
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
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.1
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: 2018-11-24 00:00:00.000000000 Z
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
- rubyforge_project:
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