so_far_so_good 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/bin/far +12 -0
- data/lib/so_far_so_good/subchapter.rb +5 -1
- data/lib/so_far_so_good/subpart.rb +20 -20
- data/lib/so_far_so_good/version.rb +1 -1
- data/lib/so_far_so_good.rb +1 -1
- data/test/so_far_so_good_bin_test.rb +8 -0
- data/test/so_far_so_good_test.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3de507b8e6d2e3821b5683474725eaffa542e24
|
4
|
+
data.tar.gz: 543852db29e69e7521469bf315e0d078fa5e139e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f902bb7820a3bc257a77f04e1b627f8c59d0690ee4169bd8ac4b6e4e2360edc523cdd0e5205fea3700359694237d6424c14af3e3d951eb3ef7e303f8afba984
|
7
|
+
data.tar.gz: 1c731803816dea74afab78fec805e65f30113597cf3a33199cc7124c99a07151734415d7d4eca8fac74a6f3bc62cb200e58b0868b17b2a15e3f36b71b6e2440d
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# So FAR so Good
|
2
2
|
|
3
|
-
A Ruby Gem to parse and manipulate the Federal Acquisition Regulation (FAR) and Defense Federal Acquisition Regulation Supplement (
|
3
|
+
A Ruby Gem to parse and manipulate the Federal Acquisition Regulation (FAR) and Defense Federal Acquisition Regulation Supplement (DFARS)
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/so_far_so_good.svg)](http://badge.fury.io/rb/so_far_so_good) [![Build Status](https://travis-ci.org/benbalter/so_far_so_good.svg)](https://travis-ci.org/benbalter/so_far_so_good)
|
6
6
|
|
7
7
|
## What it does
|
8
8
|
|
9
|
-
So FAR so Good is a Ruby Gem to interact with the Federal Acquisition Regulation (FAR) and Defense Federal Acquisition Regulation Supplement (
|
9
|
+
So FAR so Good is a Ruby Gem to interact with the Federal Acquisition Regulation (FAR) and Defense Federal Acquisition Regulation Supplement (DFARS). Right now, it supports section 52.20x and 252.20x, the FAR and DFARS standard contracting clause templates.
|
10
10
|
|
11
11
|
For any contract clause, it will provide:
|
12
12
|
|
@@ -27,7 +27,7 @@ It will give you access to this information in object-oriented Ruby, as JSON, or
|
|
27
27
|
```ruby
|
28
28
|
subchapters = SoFarSoGood.subchapters
|
29
29
|
=> [#<SoFarSoGood::Subchapter year=2013 title=48 volume=2 chapter=1 name="FAR">,
|
30
|
-
#<SoFarSoGood::Subchapter year=2013 title=48 volume=3 chapter=2 name="
|
30
|
+
#<SoFarSoGood::Subchapter year=2013 title=48 volume=3 chapter=2 name="DFARS">]
|
31
31
|
|
32
32
|
# Get the FAR's subparts
|
33
33
|
subparts = SoFarSoGood.far.subparts
|
data/bin/far
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative "../lib/so_far_so_good"
|
4
|
+
clause = SoFarSoGood[ARGV[0]]
|
5
|
+
|
6
|
+
if ARGV[0].nil? || ARGV[0] == "--help"
|
7
|
+
puts "Usage: far [CLAUSE NUMBER]"
|
8
|
+
elsif clause
|
9
|
+
puts clause.extract(:format => :markdown)
|
10
|
+
else
|
11
|
+
puts "Not found."
|
12
|
+
end
|
@@ -75,8 +75,12 @@ module SoFarSoGood
|
|
75
75
|
@source_path ||= File.expand_path filename, SoFarSoGood.vendor_directory
|
76
76
|
end
|
77
77
|
|
78
|
+
def source_contents
|
79
|
+
File.open(source_path, :encoding => 'utf-8')
|
80
|
+
end
|
81
|
+
|
78
82
|
def doc
|
79
|
-
@doc ||= Nokogiri::XML(
|
83
|
+
@doc ||= Nokogiri::XML(source_contents) do |config|
|
80
84
|
config.noblanks.nonet
|
81
85
|
end
|
82
86
|
end
|
@@ -6,15 +6,15 @@ module SoFarSoGood
|
|
6
6
|
attr_reader :title
|
7
7
|
attr_reader :volume
|
8
8
|
attr_reader :chapter
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :subchapter
|
10
10
|
|
11
11
|
def initialize(hash)
|
12
|
-
@year
|
13
|
-
@title
|
14
|
-
@volume
|
15
|
-
@chapter
|
16
|
-
@
|
17
|
-
@node
|
12
|
+
@year = hash[:year]
|
13
|
+
@title = hash[:title]
|
14
|
+
@volume = hash[:volume]
|
15
|
+
@chapter = hash[:chapter]
|
16
|
+
@subchapter = hash[:name]
|
17
|
+
@node = hash[:node]
|
18
18
|
normalize!
|
19
19
|
end
|
20
20
|
|
@@ -61,18 +61,18 @@ module SoFarSoGood
|
|
61
61
|
|
62
62
|
def to_hash(options={})
|
63
63
|
{
|
64
|
-
:year
|
65
|
-
:title
|
66
|
-
:volume
|
67
|
-
:chapter
|
68
|
-
:number
|
69
|
-
:subject
|
70
|
-
:reserverd
|
71
|
-
:citation
|
72
|
-
:extract
|
73
|
-
:body
|
74
|
-
:link
|
75
|
-
:
|
64
|
+
:year => year,
|
65
|
+
:title => title,
|
66
|
+
:volume => volume,
|
67
|
+
:chapter => chapter,
|
68
|
+
:number => number,
|
69
|
+
:subject => subject,
|
70
|
+
:reserverd => reserved,
|
71
|
+
:citation => citation,
|
72
|
+
:extract => extract(options),
|
73
|
+
:body => body(options),
|
74
|
+
:link => link,
|
75
|
+
:subchapter => subchapter,
|
76
76
|
}
|
77
77
|
end
|
78
78
|
|
@@ -81,7 +81,7 @@ module SoFarSoGood
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def inspect
|
84
|
-
"#<SoFarSoGood::Subpart year=#{year} title=#{title} volume=#{volume} chapter=#{chapter} number=\"#{number}\" subject=\"#{subject}\"
|
84
|
+
"#<SoFarSoGood::Subpart year=#{year} title=#{title} volume=#{volume} chapter=#{chapter} number=\"#{number}\" subject=\"#{subject}\" subchapter=\"#{subchapter}\" reserved=#{reserved}>"
|
85
85
|
end
|
86
86
|
|
87
87
|
private
|
data/lib/so_far_so_good.rb
CHANGED
data/test/so_far_so_good_test.rb
CHANGED
@@ -12,7 +12,7 @@ class TestSoFarSoGood < Minitest::Test
|
|
12
12
|
|
13
13
|
should "know the DFARs" do
|
14
14
|
assert_equal SoFarSoGood::Subchapter, SoFarSoGood.dfars.class
|
15
|
-
assert_equal "
|
15
|
+
assert_equal "DFARS", SoFarSoGood.dfars.name
|
16
16
|
end
|
17
17
|
|
18
18
|
should "return subchapters" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: so_far_so_good
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -111,7 +111,8 @@ dependencies:
|
|
111
111
|
description: ''
|
112
112
|
email:
|
113
113
|
- ben.balter@github.com
|
114
|
-
executables:
|
114
|
+
executables:
|
115
|
+
- far
|
115
116
|
extensions: []
|
116
117
|
extra_rdoc_files: []
|
117
118
|
files:
|
@@ -121,6 +122,7 @@ files:
|
|
121
122
|
- LICENSE.md
|
122
123
|
- README.md
|
123
124
|
- Rakefile
|
125
|
+
- bin/far
|
124
126
|
- lib/so_far_so_good.rb
|
125
127
|
- lib/so_far_so_good/subchapter.rb
|
126
128
|
- lib/so_far_so_good/subpart.rb
|
@@ -132,6 +134,7 @@ files:
|
|
132
134
|
- script/vendor
|
133
135
|
- so_far_so_good.gemspec
|
134
136
|
- test/helper.rb
|
137
|
+
- test/so_far_so_good_bin_test.rb
|
135
138
|
- test/so_far_so_good_subchapter_test.rb
|
136
139
|
- test/so_far_so_good_subpart_test.rb
|
137
140
|
- test/so_far_so_good_test.rb
|
@@ -163,6 +166,7 @@ specification_version: 4
|
|
163
166
|
summary: ''
|
164
167
|
test_files:
|
165
168
|
- test/helper.rb
|
169
|
+
- test/so_far_so_good_bin_test.rb
|
166
170
|
- test/so_far_so_good_subchapter_test.rb
|
167
171
|
- test/so_far_so_good_subpart_test.rb
|
168
172
|
- test/so_far_so_good_test.rb
|