wpa_cli_ruby 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzdlMDNkNGI4NzczYmEwZTVmNjc4ODgxYjVkMGVlOTYyZTFkNGNkMA==
5
+ data.tar.gz: !binary |-
6
+ YTI2ZWE0ZWJmMzRlMjYyYWU4NTlmYjU3ZWM5NDUzMDg4NDAxYmZiOA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDYxM2Y1ZTcxYWJmMzM1ZDVlZjRkZDY1NTgzYmZhZTE0NDJkM2ZjMGNjZTM1
10
+ MjY2NTkxMTFlMGU5NTI5MGU5YWRlZGM2MmU1MDhkOWM1YmU4NmJlMGU2Zjk3
11
+ MDEyZTg4ZGI4YzA5N2ZjNDVjNzljZDZiMmMxODhhMzIzMGViYzM=
12
+ data.tar.gz: !binary |-
13
+ MzI0NzNlOTVkMTZkMjk3MTRkMDViNGY5MGI5N2I1NGJiNzg0OTNlMjE4MzJh
14
+ MmQ1ZGQwMmM1ZjI3YzU5NDgzZmVmMmUxZWJjMmJkOGQ5ZGFlMTdhYWJmMWIx
15
+ NjUzZDc4MWJiMDZlNjhjNzdkZDg0ZGJmZjFkZDNiNWYyZTQxODc=
data/README.md CHANGED
@@ -31,6 +31,9 @@ Or install it yourself as:
31
31
  wpa_cli.set_network(network_id, "ssid", scan_results.first.ssid)
32
32
  wpa_cli.set_network(network_id, "psk", "password")
33
33
 
34
+ # You can pass tokens to wpa supplicant using symbols
35
+ wpa_cli.set_network(network_id, "key_mgmt", :NONE)
36
+
34
37
  # Enable the network to connect immediately
35
38
  wpa_cli.enable_network(network_id)
36
39
 
@@ -3,6 +3,11 @@
3
3
  # environments that do not have/support wpa_cli
4
4
  module WpaCliRuby
5
5
  class DummyWpaCliWrapper
6
+
7
+ def self.available?
8
+ true
9
+ end
10
+
6
11
  def scan
7
12
  "Selected interface 'wlan0'\nOK\n"
8
13
  end
@@ -1,3 +1,3 @@
1
1
  module WpaCliRuby
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -4,6 +4,10 @@ module WpaCliRuby
4
4
  %x[#{cmd}]
5
5
  end
6
6
 
7
+ def self.available?
8
+ system("which wpa_cli > /dev/null 2>&1")
9
+ end
10
+
7
11
  def scan
8
12
  cmd = "wpa_cli scan"
9
13
  execute(cmd)
@@ -20,7 +24,8 @@ module WpaCliRuby
20
24
  end
21
25
 
22
26
  def set_network(network_id, key, value)
23
- cmd = "wpa_cli set_network #{network_id} #{key} '\"#{value}\"'"
27
+ value = "\"#{value}\"" unless value.is_a? Symbol
28
+ cmd = "wpa_cli set_network #{network_id} #{key} '#{value}'"
24
29
  execute(cmd)
25
30
  end
26
31
 
@@ -31,6 +31,10 @@ describe WpaCliRuby do
31
31
  @wrapper.expects(:execute).with("wpa_cli set_network 0 ssid '\"network_ssid\"'")
32
32
  @wrapper.set_network(0, 'ssid', 'network_ssid')
33
33
  end
34
+ it "treats symbols as unquoted values" do
35
+ @wrapper.expects(:execute).with("wpa_cli set_network 0 key_mgmt 'NONE'")
36
+ @wrapper.set_network(0, 'key_mgmt', :NONE)
37
+ end
34
38
  end
35
39
 
36
40
  describe "get_network" do
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wpa_cli_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Chris Lowis
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: mocha
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -85,30 +78,30 @@ files:
85
78
  homepage: ''
86
79
  licenses:
87
80
  - Apache
81
+ metadata: {}
88
82
  post_install_message:
89
83
  rdoc_options: []
90
84
  require_paths:
91
85
  - lib
92
86
  required_ruby_version: !ruby/object:Gem::Requirement
93
- none: false
94
87
  requirements:
95
88
  - - ! '>='
96
89
  - !ruby/object:Gem::Version
97
90
  version: '0'
98
91
  required_rubygems_version: !ruby/object:Gem::Requirement
99
- none: false
100
92
  requirements:
101
93
  - - ! '>='
102
94
  - !ruby/object:Gem::Version
103
95
  version: '0'
104
96
  requirements: []
105
97
  rubyforge_project:
106
- rubygems_version: 1.8.23
98
+ rubygems_version: 2.1.10
107
99
  signing_key:
108
- specification_version: 3
100
+ specification_version: 4
109
101
  summary: A ruby wrapper for the wpa_cli command line utility
110
102
  test_files:
111
103
  - test/lib/wpa_cli_ruby/version_test.rb
112
104
  - test/lib/wpa_cli_ruby/wpa_cli_test.rb
113
105
  - test/lib/wpa_cli_ruby/wpa_cli_wrapper_test.rb
114
106
  - test/test_helper.rb
107
+ has_rdoc: