mumuki-laboratory 5.6.1 → 5.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c5189b48ca183cc5e8a18e32bd521ef6fd8ec7c5c86b5dde80860b0f77bbabb
4
- data.tar.gz: 9ca11265a9b2a7beaefd93eb596fc75a09ab47356c51558391a3a4e9043d2dd1
3
+ metadata.gz: abf1e7ba469d8ee20ad2a43ef9f59b83d746c43d0a9ce388a7a5c4c6c0c1dbf6
4
+ data.tar.gz: 976f739faaae534f9cb5a7a9cfb32683fddb6be42b8d5db37b458209b014a160
5
5
  SHA512:
6
- metadata.gz: 975947dc234fcd2ee37bb8b08e487b2fcbf45b5d7a138af168df743e664d661869293b0ca30ac5481468bf5ea5d8ec35b05fe2190ce73906bc50512abd8e7f22
7
- data.tar.gz: 71ce59ecee694bc8acde167cd33e4a15743eb1b970a0aa44d7fcf69e0694e20596a7c85fb43d5432108542035abe7a559f8b6e7f6dfad1a19e410c162d3e1a7d
6
+ metadata.gz: 94b3f5a4455054e596bd5800e7fd3638e425c0e041efb92b27124df292ecfd05b66086881dfa1d52a043f0f0249fce6a56b583dcccd8f23c227641feb0390829
7
+ data.tar.gz: 9efb17c56cd9b95086e9d01e0b0a64851209d69244bf6e579b96cf427169126eb3c722628cc28b550bb96c1cdeb530996a1facfcd50c506f07e1ece5a698cd26
data/app/models/guide.rb CHANGED
@@ -72,7 +72,9 @@ class Guide < Content
72
72
  exercise.import_from_json! (i+1), e
73
73
  end
74
74
 
75
- self.exercises.where('number > ?', json['exercises'].size).destroy_all
75
+ new_ids = json['exercises'].map { |it| it['id'] }
76
+ self.exercises.where.not(bibliotheca_id: new_ids).destroy_all
77
+
76
78
  reload
77
79
  end
78
80
 
@@ -1,8 +1,26 @@
1
1
  require 'mumukit/bridge'
2
2
 
3
3
  module Mumuki::Laboratory::Seed
4
- def self.import_contents!
5
- Mumukit::Platform.bibliotheca_bridge.import_contents! do |resource_type, slug|
4
+ # Those are organizations that provide content
5
+ # that was actually curated by the Mumuki Project and
6
+ # as such must be supported by each platform release
7
+ MAIN_CONTENT_ORGANIZATIONS = %w(
8
+ mumuki
9
+ mumukiproject
10
+ sagrado-corazon-alcal
11
+ pdep-utn
12
+ smartedu-mumuki
13
+ 10pines-mumuki
14
+ arquitecturas-concurrentes
15
+ flbulgarelli
16
+ )
17
+
18
+ def self.import_main_contents!
19
+ import_contents! /^#{MAIN_CONTENT_ORGANIZATIONS.join('|')}\/.*$/i
20
+ end
21
+
22
+ def self.import_contents!(slug_regex = /.*/)
23
+ Mumukit::Platform.bibliotheca_bridge.import_contents!(slug_regex) do |resource_type, slug|
6
24
  resource_type.classify.constantize.import!(slug)
7
25
  end
8
26
  end
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '5.6.1'
3
+ VERSION = '5.6.2'
4
4
  end
5
5
  end
@@ -105,7 +105,7 @@ ActiveRecord::Schema.define(version: 20180704150839) do
105
105
  t.string "queries", default: [], array: true
106
106
  t.text "query_results"
107
107
  t.text "manual_evaluation_comment"
108
- t.integer "upvotes_count"
108
+ t.integer "upvotes_count", default: 0
109
109
  t.index ["initiator_id"], name: "index_discussions_on_initiator_id"
110
110
  t.index ["item_type", "item_id"], name: "index_discussions_on_item_type_and_item_id"
111
111
  end
@@ -1,8 +1,7 @@
1
1
  require 'mumuki/laboratory/seed'
2
2
 
3
3
  Mumuki::Laboratory::Seed.import_languages!
4
-
5
- Mumuki::Laboratory::Seed.import_contents!
4
+ Mumuki::Laboratory::Seed.import_main_contents!
6
5
 
7
6
  Organization.find_or_create_by!(name: 'base') do |org|
8
7
  org.contact_email = 'issues@mumuki.org'
@@ -115,7 +115,7 @@ describe Guide do
115
115
  end
116
116
 
117
117
  describe 'it is removed from the guide' do
118
- it { expect(guide.exercises.count).to eq 6 }
118
+ it { expect(guide.exercises.count).to eq 5 }
119
119
  it { expect(guide.exercises).not_to include exercise_6 }
120
120
  end
121
121
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.1
4
+ version: 5.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-24 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '2.2'
117
+ version: '2.3'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '2.2'
124
+ version: '2.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: mumukit-login
127
127
  requirement: !ruby/object:Gem::Requirement