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 CHANGED
@@ -2,3 +2,4 @@ coverage
2
2
  *.csv
3
3
  *.ods
4
4
  .~lock*
5
+ *.gem
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
  gem "nokogiri", '1.5.6.rc2'
3
3
  gem "simplecov"
4
- gem 'rake', '>= 0.9.2'
4
+ gem 'rake'
5
5
  gem 'rdoc', '>= 3.12'
6
6
  gem 'activesupport'
7
7
  gem 'mocha'
data/Gemfile.lock CHANGED
@@ -1,23 +1,23 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.2.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.5)
8
+ json (1.7.6)
9
9
  metaclass (0.0.1)
10
- mocha (0.12.4)
10
+ mocha (0.13.1)
11
11
  metaclass (~> 0.0.1)
12
- multi_json (1.3.6)
12
+ multi_json (1.5.0)
13
13
  nokogiri (1.5.6.rc2)
14
- rake (0.9.2.2)
14
+ rake (10.0.3)
15
15
  rdoc (3.12)
16
16
  json (~> 1.4)
17
- simplecov (0.6.4)
17
+ simplecov (0.7.1)
18
18
  multi_json (~> 1.0)
19
- simplecov-html (~> 0.5.3)
20
- simplecov-html (0.5.3)
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 (>= 0.9.2)
29
+ rake
30
30
  rdoc (>= 3.12)
31
31
  simplecov
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/wwidea/common_core_parser)
2
+
1
3
  Common Core Parser
2
4
  ==================
3
5
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module CommonCoreParser
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -23,11 +23,13 @@ module CommonCoreParser
23
23
  assert_equal false, saved_math_domain.valid?
24
24
  end
25
25
 
26
- test 'should return repdecessor ref id' do
26
+ test 'should return predecessor ref id' do
27
27
  assert_equal('C235350E091D437FBE2794CE93FBE949',math_domain.parent_ref_id)
28
28
  end
29
29
 
30
- private
30
+ #######
31
+ private
32
+ #######
31
33
 
32
34
  def math_domain
33
35
  Domain.new(math_domain_xml)
@@ -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.1
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: 2012-11-14 00:00:00.000000000 Z
14
+ date: 2013-01-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri