common_core_parser 0.0.1 → 0.0.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.
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +9 -9
- data/README.md +2 -0
- data/lib/common_core_parser/broken_data_corrector.rb +10 -1
- data/lib/common_core_parser/version.rb +1 -1
- data/test/unit/domain_test.rb +4 -2
- data/test/unit/loader_test.rb +12 -0
- metadata +2 -2
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (3.2.
|
4
|
+
activesupport (3.2.11)
|
5
5
|
i18n (~> 0.6)
|
6
6
|
multi_json (~> 1.0)
|
7
7
|
i18n (0.6.1)
|
8
|
-
json (1.6
|
8
|
+
json (1.7.6)
|
9
9
|
metaclass (0.0.1)
|
10
|
-
mocha (0.
|
10
|
+
mocha (0.13.1)
|
11
11
|
metaclass (~> 0.0.1)
|
12
|
-
multi_json (1.
|
12
|
+
multi_json (1.5.0)
|
13
13
|
nokogiri (1.5.6.rc2)
|
14
|
-
rake (0.
|
14
|
+
rake (10.0.3)
|
15
15
|
rdoc (3.12)
|
16
16
|
json (~> 1.4)
|
17
|
-
simplecov (0.
|
17
|
+
simplecov (0.7.1)
|
18
18
|
multi_json (~> 1.0)
|
19
|
-
simplecov-html (~> 0.
|
20
|
-
simplecov-html (0.
|
19
|
+
simplecov-html (~> 0.7.1)
|
20
|
+
simplecov-html (0.7.1)
|
21
21
|
|
22
22
|
PLATFORMS
|
23
23
|
ruby
|
@@ -26,6 +26,6 @@ DEPENDENCIES
|
|
26
26
|
activesupport
|
27
27
|
mocha
|
28
28
|
nokogiri (= 1.5.6.rc2)
|
29
|
-
rake
|
29
|
+
rake
|
30
30
|
rdoc (>= 3.12)
|
31
31
|
simplecov
|
data/README.md
CHANGED
@@ -133,7 +133,16 @@ module CommonCoreParser
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
|
136
|
+
def correct_bad_codes_in_literacy_domains(element)
|
137
|
+
if element.is_a?(Domain)
|
138
|
+
if element.statement.match(/^Reading Standards for Literacy in Science/)
|
139
|
+
element.instance_variable_set(:@code,element.code.gsub(/^(ELA\.CC\.[K\d\-]+)\.RF$/,"#{$1}.RST"))
|
140
|
+
end
|
141
|
+
if element.statement.match(/^Writing Standards for Literacy/)
|
142
|
+
element.instance_variable_set(:@code,element.code.gsub(/^(ELA\.CC\.[K\d\-]+)\.RF$/,"#{$1}.WHST"))
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
137
146
|
|
138
147
|
|
139
148
|
|
data/test/unit/domain_test.rb
CHANGED
@@ -23,11 +23,13 @@ module CommonCoreParser
|
|
23
23
|
assert_equal false, saved_math_domain.valid?
|
24
24
|
end
|
25
25
|
|
26
|
-
test 'should return
|
26
|
+
test 'should return predecessor ref id' do
|
27
27
|
assert_equal('C235350E091D437FBE2794CE93FBE949',math_domain.parent_ref_id)
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
#######
|
31
|
+
private
|
32
|
+
#######
|
31
33
|
|
32
34
|
def math_domain
|
33
35
|
Domain.new(math_domain_xml)
|
data/test/unit/loader_test.rb
CHANGED
@@ -131,6 +131,18 @@ module CommonCoreParser
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
+
test 'should fix wrong code on literacy domains' do
|
135
|
+
@master.load_ela
|
136
|
+
|
137
|
+
@master.domains.select {|domain| domain.statement == 'Reading Standards for Literacy in Science and Technical Subjects 6-12' }.each do |rst_domain|
|
138
|
+
assert_match(/\.RST$/,rst_domain.code)
|
139
|
+
end
|
140
|
+
|
141
|
+
@master.domains.select {|domain| domain.statement.match(/^Writing Standards for Literacy/) }.each do |whst_domain|
|
142
|
+
assert_match(/\.WHST$/,whst_domain.code)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
134
146
|
test "should load all xml files for math and reunite parents with children" do
|
135
147
|
@master.load_math
|
136
148
|
orphan_elements = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: common_core_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2013-01-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: nokogiri
|