ios_config 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -136,6 +136,30 @@ role
136
136
  shared_secret
137
137
  ```
138
138
 
139
+ #### Wi-Fi
140
+
141
+
142
+ ```ruby
143
+ payload = IOSConfig::Payload::WiFi.new(parameters).build
144
+ ```
145
+
146
+ Available parameters:
147
+
148
+ ```ruby
149
+ ssid
150
+ hidden_network # true, false
151
+ auto_join # true, fase
152
+ encryption_type # :wep, :wpa, :any, :none
153
+ password
154
+ proxy_type # :none, :manual, :auto
155
+ proxy_server
156
+ proxy_port
157
+ proxy_username
158
+ proxy_password
159
+ proxy_url
160
+ ```
161
+
162
+
139
163
  ## Contributing
140
164
 
141
165
  1. Fork it
@@ -0,0 +1,54 @@
1
+ module IOSConfig
2
+ module Payload
3
+ class WiFi < Base
4
+
5
+ ENCRYPTION_TYPES = { :wep => 'WEP',
6
+ :wpa => 'WPA',
7
+ :any => 'Any',
8
+ :none => 'None' }
9
+
10
+ attr_accessor :ssid,
11
+ :hidden_network, # true, false
12
+ :auto_join, # true, false
13
+ :encryption_type, # :wep, :wpa, :any, :none
14
+ :password,
15
+ :proxy_type, # :none, :manual, :auto
16
+ :proxy_server,
17
+ :proxy_port,
18
+ :proxy_username,
19
+ :proxy_password,
20
+ :proxy_url
21
+
22
+ private
23
+
24
+ def payload_type
25
+ "com.apple.wifi.managed"
26
+ end
27
+
28
+ def payload
29
+ p = { 'SSID_STR' => @ssid,
30
+ 'HIDDEN_NETWORK' => @hidden_network,
31
+ 'AutoJoin' => @auto_join,
32
+ 'EncryptionType' => ENCRYPTION_TYPES[@encryption_type],
33
+ 'ProxyType' => @proxy_type.to_s.capitalize }
34
+
35
+ p['Password'] = @password unless @password.blank?
36
+
37
+ # Proxy
38
+
39
+ case @proxy_type
40
+ when :manual
41
+ p.merge! ({ 'ProxyServer' => @proxy_server,
42
+ 'ProxyServerPort' => @proxy_port })
43
+ p['ProxyUsername'] = @proxy_username unless @proxy_username.blank?
44
+ p['ProxyPassword'] = @proxy_password unless @proxy_password.blank?
45
+ when :auto
46
+ p['ProxyPACURL'] = @proxy_url
47
+ end
48
+
49
+ p
50
+ end
51
+
52
+ end
53
+ end
54
+ end
@@ -17,7 +17,8 @@ module IOSConfig
17
17
 
18
18
  def initialize(options = {})
19
19
  options.each { |k,v| self.send("#{k}=", v) }
20
-
20
+ puts self.allow_removal
21
+ puts self.allow_removal.nil?
21
22
  self.allow_removal = true if self.allow_removal.nil?
22
23
  self.type ||= 'Configuration'
23
24
  self.version ||= 1
@@ -1,3 +1,3 @@
1
1
  module IOSConfig
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ios_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-15 00:00:00.000000000 Z
12
+ date: 2013-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: CFPropertyList
@@ -79,6 +79,7 @@ files:
79
79
  - lib/ios_config/.DS_Store
80
80
  - lib/ios_config/payload/base.rb
81
81
  - lib/ios_config/payload/vpn.rb
82
+ - lib/ios_config/payload/wifi.rb
82
83
  - lib/ios_config/profile.rb
83
84
  - lib/ios_config/version.rb
84
85
  homepage: https://github.com/tboyko/ios_config
@@ -96,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
97
  version: '0'
97
98
  segments:
98
99
  - 0
99
- hash: 2215369409629242488
100
+ hash: -811426562974101091
100
101
  required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  none: false
102
103
  requirements:
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  version: '0'
106
107
  segments:
107
108
  - 0
108
- hash: 2215369409629242488
109
+ hash: -811426562974101091
109
110
  requirements: []
110
111
  rubyforge_project:
111
112
  rubygems_version: 1.8.24