so_far_so_good 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3de507b8e6d2e3821b5683474725eaffa542e24
4
- data.tar.gz: 543852db29e69e7521469bf315e0d078fa5e139e
3
+ metadata.gz: c2ca1e1faee170885d750ae8aa87c30a61df066c
4
+ data.tar.gz: a79f4c6c6c6dbeab6d07c69adf9a637b991a6ceb
5
5
  SHA512:
6
- metadata.gz: 7f902bb7820a3bc257a77f04e1b627f8c59d0690ee4169bd8ac4b6e4e2360edc523cdd0e5205fea3700359694237d6424c14af3e3d951eb3ef7e303f8afba984
7
- data.tar.gz: 1c731803816dea74afab78fec805e65f30113597cf3a33199cc7124c99a07151734415d7d4eca8fac74a6f3bc62cb200e58b0868b17b2a15e3f36b71b6e2440d
6
+ metadata.gz: dafecb860e56a9597298eefa47168d583b162d6ec8348abb7acc8ba181dcc4f66aa3cac185bfdca8b6fa27da2454e9f36e26a56f63450c5c819e807c540bcc86
7
+ data.tar.gz: 877882c0ebcbe79822c0d03937bda564a066641b83ee4405b0429ee984d162144bc4ff299ee229dfb497f5043aeb3e24bd953eb0e6e6816a3dc5cd2a1a948e12
data/bin/far CHANGED
@@ -5,8 +5,11 @@ clause = SoFarSoGood[ARGV[0]]
5
5
 
6
6
  if ARGV[0].nil? || ARGV[0] == "--help"
7
7
  puts "Usage: far [CLAUSE NUMBER]"
8
+ exit 1
8
9
  elsif clause
9
10
  puts clause.extract(:format => :markdown)
11
+ exit 0
10
12
  else
11
13
  puts "Not found."
14
+ exit 1
12
15
  end
@@ -43,7 +43,7 @@ module SoFarSoGood
43
43
  options = {:format => :html}.merge(options)
44
44
  @extract ||= node.css("EXTRACT").inner_html
45
45
  if options[:format] == :markdown
46
- ReverseMarkdown.convert @extract
46
+ ReverseMarkdown.convert @extract, :unknown_tags => :bypass
47
47
  else
48
48
  @extract
49
49
  end
@@ -53,7 +53,7 @@ module SoFarSoGood
53
53
  options = {:format => :html}.merge(options)
54
54
  @body ||= node.css("> P").to_html
55
55
  if options[:format] == :markdown
56
- ReverseMarkdown.convert @body
56
+ ReverseMarkdown.convert @body, :unknown_tags => :bypass
57
57
  else
58
58
  @body
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module SoFarSoGood
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "nokogiri"
22
22
  spec.add_dependency "terminal-table"
23
- spec.add_dependency "reverse_markdown"
23
+ spec.add_dependency "reverse_markdown", "~> 0.7"
24
24
  spec.add_development_dependency "bundler", "~> 1.6"
25
25
  spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency('pry', '~> 0.9')
@@ -1,8 +1,10 @@
1
1
  require 'helper'
2
+ require 'open3'
2
3
 
3
4
  class TestSoFarSoGoodBin < Minitest::Test
4
5
  should "work via CLI" do
5
- output = `bundle exec far 52.222-3`
6
+ output, status = Open3.capture2e("bundle", "exec", "bin/far", "52.222-3")
7
+ assert_equal 0, status.exitstatus
6
8
  assert output.include? "Convict Labor"
7
9
  end
8
10
  end
@@ -49,6 +49,10 @@ class TestSoFarSoGoodSubpart < Minitest::Test
49
49
  assert_includes @subpart.extract(:format => :markdown), "### Covenant Against Contingent Fees (APR 1984)\n\n(a)"
50
50
  end
51
51
 
52
+ should "not pass unknown tags in markdown" do
53
+ refute_match /gpotable/, SoFarSoGood["52.225-4"].extract(:format => :markdown)
54
+ end
55
+
52
56
  should "build the link" do
53
57
  assert_equal "http://www.law.cornell.edu/cfr/text/48/52.203-5", @subpart.link
54
58
  end
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: reverse_markdown
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.7'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement