so_far_so_good 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.md +22 -0
- data/README.md +40 -0
- data/Rakefile +13 -0
- data/lib/so_far_so_good/clause.rb +35 -0
- data/lib/so_far_so_good/clauses.rb +50 -0
- data/lib/so_far_so_good/version.rb +3 -0
- data/lib/so_far_so_good.rb +18 -0
- data/output.json +1 -0
- data/script/bootstrap +4 -0
- data/script/cibuild +5 -0
- data/script/console +3 -0
- data/script/release +3 -0
- data/script/vendor +4 -0
- data/so_far_so_good.gemspec +28 -0
- data/test/helper.rb +8 -0
- data/test/so_far_so_good_clauses_test.rb +30 -0
- data/test/so_far_so_good_test.rb +12 -0
- data/vendor/CFR-2010-title48-vol2-chap1-subchapH.xml +19549 -0
- metadata +151 -0
data/script/bootstrap
ADDED
data/script/cibuild
ADDED
data/script/console
ADDED
data/script/release
ADDED
data/script/vendor
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'so_far_so_good/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "so_far_so_good"
|
8
|
+
spec.version = SoFarSoGood::VERSION
|
9
|
+
spec.authors = ["Ben Balter"]
|
10
|
+
spec.email = ["ben.balter@github.com"]
|
11
|
+
spec.summary = ""
|
12
|
+
spec.description = ""
|
13
|
+
spec.homepage = "https://github.com/benbalter/so_far_so_good"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "nokogiri"
|
22
|
+
spec.add_dependency "terminal-table"
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency('pry', '~> 0.9')
|
26
|
+
spec.add_development_dependency('shoulda', '~> 3.5')
|
27
|
+
|
28
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestSoFarSoGoodClauses < Minitest::Test
|
4
|
+
should "know the clauses file" do
|
5
|
+
assert File.exists? SoFarSoGood::Clauses.send :source_path
|
6
|
+
end
|
7
|
+
|
8
|
+
should "parse the XML" do
|
9
|
+
assert Nokogiri::XML::Document, SoFarSoGood::Clauses.send(:doc).class
|
10
|
+
end
|
11
|
+
|
12
|
+
should "parse the rows" do
|
13
|
+
assert_equal 567, SoFarSoGood::Clauses.send(:rows).count
|
14
|
+
assert_equal ["52.200", "Scope of subpart."], SoFarSoGood::Clauses.send(:rows).first
|
15
|
+
end
|
16
|
+
|
17
|
+
should "parse section numbers" do
|
18
|
+
assert_equal 616, SoFarSoGood::Clauses.numbers.count
|
19
|
+
assert_equal "52.200", SoFarSoGood::Clauses.numbers.first
|
20
|
+
end
|
21
|
+
|
22
|
+
should "parse section descriptions" do
|
23
|
+
assert_equal 616, SoFarSoGood::Clauses.descriptions.count
|
24
|
+
assert_equal "Scope of subpart.", SoFarSoGood::Clauses.descriptions.first
|
25
|
+
end
|
26
|
+
|
27
|
+
should "put out valid JSON" do
|
28
|
+
assert !!JSON.parse(SoFarSoGood::Clauses.list.to_json)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestSoFarSoGood < Minitest::Test
|
4
|
+
should "figure out the vendor directory" do
|
5
|
+
assert File.exists?(SoFarSoGood.vendor_directory)
|
6
|
+
end
|
7
|
+
|
8
|
+
should "return the clause hash" do
|
9
|
+
assert_equal Array, SoFarSoGood.clauses.class
|
10
|
+
assert_equal 616, SoFarSoGood.clauses.count
|
11
|
+
end
|
12
|
+
end
|