kuport 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/bin/kuport +21 -22
  3. data/lib/kuport/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9cfd6d6c849f5f34ca6037044bd3905953fc4499
4
- data.tar.gz: 52db103a1eccf46388b60cb6d441472e642888e6
2
+ SHA256:
3
+ metadata.gz: 381e0567e391c27c10d8727f9bdb72ab3343b55ef68a9f1c32b443ad455ef351
4
+ data.tar.gz: 220dceb6da0066d018920725eedf7660e2a9655897588b9aede1bf2a35d5a86f
5
5
  SHA512:
6
- metadata.gz: 2f6d15a9d1ec0b12d0a691b2c5394738c16e6f068db30b31ea8eecad3b4bc82aff628c766de5a792cf4689dcc651a8b95499003505f16cba8dec85f7d04a60dc
7
- data.tar.gz: 35ab6aa99e4e4f7bc313135022528d8643ccc84dc29c2c98dded5a6d1dc9c1848e00948a2a61a4760814ce740873f50b87625f8267e8f4fdc8e35d6d52231341
6
+ metadata.gz: 3b127e36f8a6e0a5532b57c3706a5b9b0e5efce3fa03a5e6297e50bd5de8b087e41fe9a456b1291c7dcf0919e1e1ba9fd93cd162d20db133276f0593ebbe67fa
7
+ data.tar.gz: 9c6cf84f2673190c42aee74dcacc18668ecbd78ef4148f086f06176981426530f4be086e179ac50bce0d04a33f76d35da912fcc3d9aa9f9a05f6665491622db0
data/bin/kuport CHANGED
@@ -5,37 +5,36 @@ require 'json'
5
5
 
6
6
  using Kuport::ClassExtensions
7
7
 
8
- # ruby2.3 <<~DOC
9
- example_usage = <<USAGE
10
- example usage
8
+ example_usage = <<~USAGE
9
+ Example usage
11
10
 
12
- # Get messages
13
- kuport --id=jx91234 -m
11
+ # Get messages
12
+ kuport --id=jx91234 -m
14
13
 
15
14
 
16
- # Get already read messages
17
- kuport --id=jx91234 -m read
15
+ # Get already read messages
16
+ kuport --id=jx91234 -m read
18
17
 
19
18
 
20
- # Login only(cache cookies)
21
- kuport --id=jx91234
19
+ # Login only(cache cookies)
20
+ kuport --id=jx91234
22
21
 
23
22
 
24
- # Download URL as NAME
25
- kuport --download=NAME:URL
23
+ # Download URL as NAME
24
+ kuport --download=NAME:URL
26
25
 
27
26
 
28
- # Download message attachment
29
- json="$(kuport --id jx91234 -m | jq '.[0].links')"
30
- kuport --download="$json"
27
+ # Download message attachment
28
+ json="$(kuport --id jx91234 -m | jq '.[0].links')"
29
+ kuport --download="$json"
31
30
 
32
31
 
33
- # Interactively download message attachment
34
- go get github.com/simeji/jid/cmd/jid
35
- kuport --download="$(kuport --id jx91234 -m | jid)"
32
+ # Interactively download message attachment
33
+ go get github.com/simeji/jid/cmd/jid
34
+ kuport --download="$(kuport --id jx91234 -m | jid)"
36
35
 
37
- # Download specific subjects materials
38
- kuport --materials | kuport --filter='subject:Computer' | kuport --download
36
+ # Download specific subjects materials
37
+ kuport --materials | kuport --filter='subject:Computer' | kuport --download
39
38
  USAGE
40
39
 
41
40
  def debug?
@@ -96,6 +95,7 @@ parser = OptionParser.new do |o|
96
95
  o.separator('')
97
96
 
98
97
  o.separator('')
98
+ o.separator('------------------------------------------------------------')
99
99
  o.on_tail(example_usage)
100
100
  end
101
101
 
@@ -104,11 +104,10 @@ parser.permute!(ARGV)
104
104
  opts = parser.options
105
105
 
106
106
  # read config
107
- config = {}
108
107
  if File.readable?(RC_FILE)
109
- config = JSON.parse(File.read(RC_FILE), {symbolize_names: true})
108
+ config = JSON.parse(File.read(RC_FILE), { symbolize_names: true })
109
+ opts.merge!(config) {|key, old, new| old }
110
110
  end
111
- config.each{|k,v| opts[k] = config[k] unless opts.has_key?(k)}
112
111
 
113
112
  if debug?
114
113
  warn "opts #{opts}"
@@ -1,3 +1,3 @@
1
1
  class Kuport
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - u+
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2019-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.6.11
111
+ rubygems_version: 2.7.7
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Kuport scraping library and command