csvkit 0.1.3 → 0.1.4

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: 4617f7c84cd3fd76063dd2edcdd001a05a6a9aa1
4
- data.tar.gz: b3c2010d295eb7c7babb5ba5457b8ed0a84538d8
3
+ metadata.gz: ee7e6df336489a1a6b12050de1fe2f6d8f9ff5c3
4
+ data.tar.gz: 81fe43d6349b30e6003b332eb2720490865bd0a5
5
5
  SHA512:
6
- metadata.gz: f1156521497e166e76be94be75cdff59ec84d81bc4169261c3f6ebde101701558702faffbd0b7c2d95a658926ac80004dd8bea81c55c69006a3684d9009d05e3
7
- data.tar.gz: ef24b6c17928272d61f6be7e30630cd96c1c225b2c6554833d26889e5a0a529feec9ebd6c887a0ecd9129adf289cbca7b3da93c7c7f9d4acef4d1346451bf9ee
6
+ metadata.gz: bf510f9de514b4c3b10fdbb0d9e424beaaf890f13860d5c65db98b82c383ed6cc013188c03932a3a9a7d441087116e0d74d048e0645282384faad67636bc8a1d
7
+ data.tar.gz: f1eab932711204457e19affaa015c7b4a551470c3e2d44f1c723177844aee252db8c50d87b78206cf39a6a575fcb5071051e93b595ef103b2e02a5320dbc0c90
data/README.md CHANGED
@@ -18,7 +18,14 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ Add into application.rb
22
+
23
+ require 'csvkit'
24
+ config.middleware.use CSVKit::Middleware, {}#, :only => [%r[^/thing], %r[^/other_thing]]
25
+
26
+ Options:
27
+
28
+ show_link: shows url as opposed to an <a> link's text content.
22
29
 
23
30
  ## Contributing
24
31
 
@@ -7,9 +7,10 @@ class CSVKit
7
7
  attr_reader :options
8
8
 
9
9
  def initialize(body_content, options = {})
10
+ @options = {:show_link => false}.merge options
11
+
10
12
  @content = body_content
11
13
 
12
- @options = options
13
14
  end
14
15
 
15
16
  def to_csv
@@ -23,7 +24,7 @@ class CSVKit
23
24
  repeat = header_with_colspan?(cell) ? cell['colspan'].to_i : 1
24
25
  repeat.times do
25
26
  # if a link show href instead of text.
26
- if a_link = cell.search('a').first
27
+ if (a_link = cell.search('a').first) && options[:show_link]
27
28
  text = a_link['href']
28
29
  else
29
30
  text = cell.text
@@ -1,3 +1,3 @@
1
1
  class CSVKit
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathew Hartley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-18 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 2.0.0
65
+ rubygems_version: 2.0.3
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Inspired by PDFKit, allows a html page (with a <table>) to be converted to