wpa_cli_web 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDQ3YTA3N2ViN2Q1NzFmMTg4MmFmYzdlOTVjN2IzY2ZlMzljN2NkNw==
4
+ N2VlN2JhNzYwNGI1ZTZkY2UxNmYxMzkzY2Q0M2E1MTA3OGQyOGJiOA==
5
5
  data.tar.gz: !binary |-
6
- ODQyZmJjYzQ4MWI4MDlmY2NjNGQ0ZTg0OTZlYmQ5YzAyYzk2NDE4OA==
6
+ MjcyOTIyNjZmZjRiYmNiYmY4NjM0NTY1ZmQyMGU3ZGNhM2JiMDEwMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTYxYmMxNDA4ZmM0NzIxYjc2YTdkZWM1ODY5ZTA5YmVlNGFjYjdhNWRlZjM1
10
- NmEzYmZlYTExZmExMmE2OGI4NGUxNDdjZDdmMGI5NDA2ZTNlMzFmMTU3Y2E4
11
- OTViZDAxN2Q1NjNiNTNlZWFmOTk3OWZjMDBkYmZhMWZkYTQ0ZTg=
9
+ NWU3YTFkNzJlZWNjOWFmMTNhNWI2OWIzOTYyMGZlZGEwMTZhOTg1NWZkYTZi
10
+ NGNjOTZmZWY4NjhlYzRjZGRlNWY1ZTZiM2VmMjliMzg5NTBmNGY1MmEyNjZj
11
+ ZWU5YTNiMzU4ZDg3YzQwYzY2YmY1YTFjNDQ0OTE4YjIxNzk5MGI=
12
12
  data.tar.gz: !binary |-
13
- ZWMxM2U5Y2JiMTc5NDlhNzgxMTQ4ZDFhYjRlOGQzMDFmNDgyZjEwZjY2MjQw
14
- MThhOTMxZTc4NTM0NjgzOTQ5MTIwNDNmNTk5MGM3ODE0OTdhMjE3YmUxZTAz
15
- MTc1MTFkMThlOGY1NjI3OGYwNDY4ZjRlMzE1ZTEyMTRmYTc0OWY=
13
+ ZmFmYmRmODNhOGFjY2I3N2M5ZWJkY2NmNDJiYmM3Yzc5NWYzZTA1ZDU4MGQ3
14
+ NzczOTllMTA4NjU3MDVlZjQ5MTJjNDBjYzA2NDNhNTJhZTA5ZGY1OTkwODBi
15
+ NTMyOGVhOWMwZWZlZjVlYTIzMWU5NTY5YjJkYzJmNzQ2NjViNTk=
data/lib/wpa_cli_web.rb CHANGED
@@ -6,10 +6,12 @@ class WpaCliWeb < Sinatra::Base
6
6
  include WpaCliRuby
7
7
 
8
8
  def self.wpa_cli_client
9
- if settings.development?
10
- WpaCli.new(DummyWpaCliWrapper.new)
11
- else
9
+ raise 'wpa_cli not available' if settings.production? && !WpaCliWrapper.available?
10
+
11
+ if WpaCliWrapper.available?
12
12
  WpaCli.new
13
+ else
14
+ WpaCli.new(DummyWpaCliWrapper.new)
13
15
  end
14
16
  end
15
17
 
@@ -69,10 +71,10 @@ class WpaCliWeb < Sinatra::Base
69
71
  ssid = params[:ssid]
70
72
  password = params[:password]
71
73
  wpa_cli_client.set_network(id, "ssid", ssid)
72
- if password
73
- wpa_cli_client.set_network(id, "psk", password)
74
+ if password.empty?
75
+ wpa_cli_client.set_network(id, "key_mgmt", :NONE)
74
76
  else
75
- wpa_cli_client.set_network(id, "key_mgmt", "NONE")
77
+ wpa_cli_client.set_network(id, "psk", password)
76
78
  end
77
79
  wpa_cli_client.set_network(id, "disabled", 0)
78
80
  wpa_cli_client.save_config
data/wpa_cli_web.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "wpa_cli_web"
7
- spec.version = "0.0.13"
7
+ spec.version = "0.0.14"
8
8
  spec.authors = ["Chris Lowis", "Andrew Nicolaou"]
9
9
  spec.email = ["chris.lowis@gmail.com"]
10
10
  spec.description = %q{Web interface for configuring wifi using wpa_cli}
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "sinatra"
22
- spec.add_dependency "wpa_cli_ruby"
22
+ spec.add_dependency "wpa_cli_ruby", ">= 0.0.2"
23
23
  spec.add_dependency "thin"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wpa_cli_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lowis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-16 00:00:00.000000000 Z
12
+ date: 2013-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
- version: '0'
34
+ version: 0.0.2
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ! '>='
40
40
  - !ruby/object:Gem::Version
41
- version: '0'
41
+ version: 0.0.2
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: thin
44
44
  requirement: !ruby/object:Gem::Requirement