gfwlist2ipset 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/gfwlist2ipset +11 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec3da723af1f59cb914ccb38d3f2af34ce676af5
4
- data.tar.gz: 627f9ac7ea9d24b522df3eb56a63ee0b67a47f80
3
+ metadata.gz: 58cc997f476e71ad84a6cd1d1b268195d587f346
4
+ data.tar.gz: 78c1593784e47bdd4e1e68c455b58c75f0dcb965
5
5
  SHA512:
6
- metadata.gz: 37c9b55d69ac549e56a3e711c959ab146cc5613e39074b07e3eb243b257b64f33f101c7fd0126ba5336f4b997d1c5f2912053d40a18141df3328b8e56ad13807
7
- data.tar.gz: 5b30ae6602d573d74cee1969202f033b0ff670eeeb6f2d2e92883c413902fb5a737ea7e865edf7b5df450d1830a4e02ad999bf2199822bd532b6d59342c05d43
6
+ metadata.gz: 21bb6a67e5fe18eb5f28ae2a216d8931fa05ec907d1907464d6febe0c2fd0792da88af95a0a210bcfa1bc9534a338f5c3fb398eb0285b8cdb432dd63b2fccae0
7
+ data.tar.gz: a8f93340ec6eb6ba2b3fb32975bf825870ce7330e4918cf3808da5b34163fd55349475964b485cbf80d63fc05c296f0b0d7aa635e9ba430853db0b9960725a2f
data/bin/gfwlist2ipset CHANGED
@@ -8,14 +8,20 @@ options = {}
8
8
  OptionParser.new do |opts|
9
9
  opts.banner = "Usage: gfwlist2ipset [options]"
10
10
 
11
- opts.on('-d <DNS Server>', '--dns <DNS Server>', 'Set a DNS Server') do |value|
12
- options[:dns] = value
11
+ options[:ipset] = 'outwall'
12
+ options[:output] = 'gfwlist.conf'
13
+
14
+ opts.on('', '--ipset <ipset name>', 'Specify ipset name, default: outwall') do |value|
15
+ options[:ipset] = value
13
16
  end
14
17
 
15
- options[:output] = 'gfwlist.conf'
16
18
  opts.on('-o OUTPUT', '--output OUTPUT', 'Output file, default: gfwlist.conf') do |value|
17
19
  options[:output] = value
18
20
  end
21
+
22
+ opts.on('-d <DNS Server>', '--dns <DNS Server>', 'Specify DNS Server') do |value|
23
+ options[:dns] = value
24
+ end
19
25
  end.parse!
20
26
 
21
27
  gfwlist_url = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt'
@@ -107,11 +113,11 @@ File.open(options[:output], 'w+') do |f|
107
113
  if options.has_key?(:dns)
108
114
  domains.sort.uniq.each do |domain|
109
115
  f.puts('server=/' + domain + '/' + options[:dns])
110
- f.puts('ipset=/' + domain + '/outwall')
116
+ f.puts('ipset=/' + domain + '/' + options[:ipset])
111
117
  end
112
118
  else
113
119
  domains.sort.uniq.each do |domain|
114
- f.puts('ipset=/' + domain + '/outwall')
120
+ f.puts('ipset=/' + domain + '/' + options[:ipset])
115
121
  end
116
122
  end
117
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gfwlist2ipset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nullizer