vpn-config 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59b428d53dd9bd6ff78c96ce3ae747d7bd962e7a
4
- data.tar.gz: 8a4595c5b90d8dce348a76b1f57dfe2c87824526
3
+ metadata.gz: 475738afa271eaec1b58f69c482543e87ba90040
4
+ data.tar.gz: 54825eb2eef5fbe103e09a72658595f65b60afa2
5
5
  SHA512:
6
- metadata.gz: fe1a1d209a32ce56c164aab5b258fb21850eb940e349d1587c958b7462a59adfc1450deb4f79b11a707e32f6c59f5c6d95cb55427cc5dcfdbc8c5284e1387a40
7
- data.tar.gz: 88a46ea0eb843bc54ad5f56646cc5e91571ddcbe075705da10dabf3cc746adc87b68b3cc107c03b80c6f958405b6c8f2c3c71a5860410cd92161f0a371e00d3a
6
+ metadata.gz: b9ee6c47639fb29b92e43c6b5cb8b8b05c5f3addd04c8cad8a10c77925c460c66d0b08eff794df981af0d81eee50cad9c5041a87e85c7f4969c0faf21ace24d1
7
+ data.tar.gz: db748e6743fb6f5c97a21622c469c92913a1760e620d4761799701318faccbedb69c9649ad1c1266a5cc40c17e3b1322c8e2d3744eaa1e3f3c84771b0ec5b611
@@ -1,3 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.1
3
+ - 2.2.1
4
+ env:
5
+ global:
6
+ secure: Crjz3GT7vLX3neQ88SgN7T+Ykl/tahF9LVCwqYtNIfWQVI0cpej3+x77TJ24J3AyJmujFIF+/IY5pxcdOpDL3PcOvICx9ZxmRie0CqmgJg+xZNYjIvsJJQjVqkTjiNS2vBAKleavd0VHgcso94QqC7m7j6TklpoGKz3iHDN44Eo=
7
+ script: rake test
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## [1.0.1] - 2015-04-03
4
+
5
+ * Small internal improvements
6
+ * Documentation improvements
7
+
8
+
3
9
  ## [1.0.0] - 2015-04-03
4
10
 
5
11
  * Initial release of the gem
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # VPN Config
2
2
 
3
- [![Build Status](https://travis-ci.org/matiaskorhonen/vpn-config.svg?branch=master)](https://travis-ci.org/matiaskorhonen/vpn-config)
3
+ [![Build Status](https://travis-ci.org/matiaskorhonen/vpn-config.svg?branch=master)](https://travis-ci.org/matiaskorhonen/vpn-config) [![Gem Version](https://badge.fury.io/rb/vpn-config.svg)](http://badge.fury.io/rb/vpn-config) [![Code Climate](https://codeclimate.com/github/matiaskorhonen/vpn-config/badges/gpa.svg)](https://codeclimate.com/github/matiaskorhonen/vpn-config) [![Test Coverage](https://codeclimate.com/github/matiaskorhonen/vpn-config/badges/coverage.svg)](https://codeclimate.com/github/matiaskorhonen/vpn-config)
4
4
 
5
5
  Generate iOS/OS X configuration profiles for VPNs.
6
6
 
@@ -25,27 +25,27 @@ For information on a specific command: `vpn-config help COMMAND`
25
25
  To generate a configuration file for the default VPN Provider (Private Internet Access), run:
26
26
 
27
27
  ```sh
28
- vpn-config generate --username=foo --password=bar test.mobileconfig
28
+ vpn-config generate test.mobileconfig --username=foo --password=bar
29
29
  ```
30
30
 
31
31
  To sign the configuration file, also give the `--sign` argument:
32
32
 
33
33
  ```sh
34
- vpn-config generate --username=foo --password=bar --sign test.mobileconfig
34
+ vpn-config generate test.mobileconfig --username=foo --password=bar --sign
35
35
  ```
36
36
 
37
37
  To select specific endpoints, use the `--endpoints` option:
38
38
 
39
39
  ```sh
40
- vpn-config generate --username=foo --password=bar --sign \
41
- --endpoints "US East" "Canada" "Hong Kong" test.mobileconfig
40
+ vpn-config generate test.mobileconfig --username=foo --password=bar --sign \
41
+ --endpoints "US East" "Canada" "Hong Kong"
42
42
  ```
43
43
 
44
44
  To sign with your own certificate, simply provide the path and passphrase (the certificate **must** be a PKCS12 file):
45
45
 
46
46
  ```sh
47
- vpn-config generate --username=foo --password=bar --sign \
48
- --certificate-path my.p12 --certificate-pass SuperSecret test.mobileconfig
47
+ vpn-config generate test.mobileconfig --username=foo --password=bar --sign \
48
+ --certificate-path my.p12 --certificate-pass SuperSecret
49
49
  ```
50
50
 
51
51
  ### Supply your own data file
@@ -53,8 +53,8 @@ vpn-config generate --username=foo --password=bar --sign \
53
53
  If you wish, you can use your own VPN list instead of the built-in list:
54
54
 
55
55
  ```sh
56
- vpn-config generate --username=foo --password=bar --sign \
57
- --data-file mydata.yml --provider "My Provider" test.mobileconfig
56
+ vpn-config generate test.mobileconfig --username=foo --password=bar --sign \
57
+ --data-file mydata.yml --provider "My Provider"
58
58
  ```
59
59
 
60
60
  Use the [data/providers.yml](https://github.com/matiaskorhonen/vpn-config/blob/master/data/providers.yml) file as an example of how to format your list.
@@ -17,23 +17,15 @@ module VPN
17
17
  method_option :sign, type: :boolean, default: false, aliases: "-S"
18
18
  method_option :data_file, type: :string, required: false, banner: "YAML_FILE", aliases: "-d"
19
19
  def generate(output_file)
20
- datafile = if options[:data_file]
21
- File.expand_path(options[:data_file])
22
- end
23
-
24
- certificate_path = if options[:certificate_path]
25
- File.expand_path(options[:certificate_path])
26
- end
27
-
28
20
  generator = VPN::Config::Generator.new(
29
21
  auth_name: options[:username],
30
22
  auth_pass: options[:password],
31
23
  identifier: options[:identifier],
32
- certificate_path: certificate_path,
24
+ certificate_path: expand_path(options[:certificate_path]),
33
25
  certificate_pass: options[:certificate_pass],
34
26
  endpoints: options[:endpoints],
35
27
  provider: options[:provider],
36
- data_file: datafile
28
+ data_file: expand_path(options[:data_file])
37
29
  )
38
30
 
39
31
  plist = if options[:sign]
@@ -62,11 +54,7 @@ module VPN
62
54
  method_option :data_file, type: :string, required: false, banner: "YAML_FILE", aliases: "-d"
63
55
  method_option :verbose, type: :boolean, default: false, aliases: "-v"
64
56
  def providers
65
- datafile = if options[:data_file]
66
- File.expand_path(options[:data_file])
67
- end
68
-
69
- generator = VPN::Config::Generator.new(data_file: datafile)
57
+ generator = VPN::Config::Generator.new(data_file: expand_path(options[:data_file]))
70
58
  generator.providers.each do |pr|
71
59
  puts "* " + pr["name"]
72
60
  if options[:verbose]
@@ -80,11 +68,7 @@ module VPN
80
68
  method_option :data_file, type: :string, required: false, banner: "YAML_FILE", aliases: "-d"
81
69
  method_option :verbose, type: :boolean, default: false, aliases: "-v"
82
70
  def endpoints(provider="Private Internet Access")
83
- datafile = if options[:data_file]
84
- File.expand_path(options[:data_file])
85
- end
86
-
87
- generator = VPN::Config::Generator.new(data_file: datafile)
71
+ generator = VPN::Config::Generator.new(data_file: expand_path(options[:data_file]))
88
72
  provider = generator.providers.find {|pr| pr["name"] =~ Regexp.new(provider, Regexp::IGNORECASE) }
89
73
  if provider
90
74
  provider["endpoints"].each do |e|
@@ -99,6 +83,12 @@ module VPN
99
83
  abort "No provider found"
100
84
  end
101
85
  end
86
+
87
+ no_commands do
88
+ private def expand_path(path)
89
+ path ? File.expand_path(path) : nil
90
+ end
91
+ end
102
92
  end
103
93
  end
104
94
  end
@@ -1,5 +1,5 @@
1
1
  module VPN
2
2
  module Config
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -19,11 +19,13 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.required_ruby_version = ">= 2.2.0"
23
+
22
24
  spec.add_dependency "plist"
23
25
  spec.add_dependency "thor"
24
26
 
25
27
  spec.add_development_dependency "bundler", "~> 1.8"
26
28
  spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "minitest", "~> 5.5.1"
28
- spec.add_development_dependency "simplecov", "~> 0.9.2"
29
+ spec.add_development_dependency "minitest", "~> 5.5"
30
+ spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
29
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpn-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Korhonen
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 5.5.1
75
+ version: '5.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 5.5.1
82
+ version: '5.5'
83
83
  - !ruby/object:Gem::Dependency
84
- name: simplecov
84
+ name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.9.2
89
+ version: '0.4'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.9.2
96
+ version: '0.4'
97
97
  description: Generate signed and unsigned iOS/OS X configuration profiles for VPNs
98
98
  email:
99
99
  - matias@kiskolabs.com
@@ -131,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: '0'
134
+ version: 2.2.0
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="