ruby_connman 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b449ae2874c0191e8f4887fa84e7b08607463aef
4
+ data.tar.gz: d4de99b0332718484e0849acdf8d740217115a06
5
+ SHA512:
6
+ metadata.gz: 79ed2bec429b84a675bc9d1cdbba16c903e19e45c90bc0d2a470e4269a4d7e1bc57d63bed72e1edd56f48f8b7e6632fb928446c5654e234c8c9ce92c305c9d87
7
+ data.tar.gz: c3edf79e19f908982e84ca98125d51e023e11eef4e1aed3969f848c66b695189061b57b7557a83cb8e2d8c29f3a3328f4729c7b39b163707f82f2241cd65c10c
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.idea/.rakeTasks ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build ruby_connman-0.0.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install ruby_connman-0.0.1.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.0.1 and build and push ruby_connman-0.0.1.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
data/.idea/misc.xml ADDED
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.1.2 [aquaticmesh]" project-jdk-type="RUBY_SDK" />
4
+ </project>
5
+
data/.idea/modules.xml ADDED
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/ruby_connman.iml" filepath="$PROJECT_DIR$/.idea/ruby_connman.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="CompassSettings">
4
+ <option name="compassSupportEnabled" value="true" />
5
+ </component>
6
+ <component name="FacetManager">
7
+ <facet type="gem" name="Ruby Gem">
8
+ <configuration>
9
+ <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
10
+ <option name="GEM_APP_TEST_PATH" value="$MODULE_DIR$/test" />
11
+ <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
12
+ </configuration>
13
+ </facet>
14
+ </component>
15
+ <component name="NewModuleRootManager">
16
+ <content url="file://$MODULE_DIR$">
17
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
18
+ </content>
19
+ <orderEntry type="inheritedJdk" />
20
+ <orderEntry type="sourceFolder" forTests="false" />
21
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.3.2, RVM: ruby-2.1.2 [aquaticmesh]) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="ruby-dbus (v0.11.0, RVM: ruby-2.1.2 [aquaticmesh]) [gem]" level="application" />
23
+ </component>
24
+ </module>
25
+
@@ -0,0 +1,5 @@
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
+ </component>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="" />
5
+ </component>
6
+ </project>
7
+
@@ -0,0 +1,56 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <option name="TRACKING_ENABLED" value="true" />
5
+ <option name="SHOW_DIALOG" value="false" />
6
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
7
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
8
+ <option name="LAST_RESOLUTION" value="IGNORE" />
9
+ </component>
10
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
11
+ <component name="CreatePatchCommitExecutor">
12
+ <option name="PATCH_PATH" value="" />
13
+ </component>
14
+ <component name="DaemonCodeAnalyzer">
15
+ <disable_hints />
16
+ </component>
17
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
18
+ <OptionsSetting value="true" id="Add" />
19
+ <OptionsSetting value="true" id="Remove" />
20
+ <OptionsSetting value="true" id="Checkout" />
21
+ <OptionsSetting value="true" id="Update" />
22
+ <OptionsSetting value="true" id="Status" />
23
+ <OptionsSetting value="true" id="Edit" />
24
+ <ConfirmationsSetting value="0" id="Add" />
25
+ <ConfirmationsSetting value="0" id="Remove" />
26
+ </component>
27
+ <component name="ProjectReloadState">
28
+ <option name="STATE" value="0" />
29
+ </component>
30
+ <component name="PropertiesComponent">
31
+ <property name="options.lastSelected" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
32
+ <property name="options.splitter.main.proportions" value="0.3" />
33
+ <property name="options.splitter.details.proportions" value="0.2" />
34
+ <property name="options.searchVisible" value="true" />
35
+ </component>
36
+ <component name="RunManager">
37
+ <list size="0" />
38
+ </component>
39
+ <component name="ShelveChangesManager" show_recycled="false" />
40
+ <component name="TaskManager">
41
+ <task active="true" id="Default" summary="Default task" />
42
+ <servers />
43
+ </component>
44
+ <component name="VcsContentAnnotationSettings">
45
+ <option name="myLimit" value="2678400000" />
46
+ </component>
47
+ <component name="VcsManagerConfiguration">
48
+ <option name="myTodoPanelSettings">
49
+ <TodoPanelSettings />
50
+ </option>
51
+ </component>
52
+ <component name="XDebuggerManager">
53
+ <breakpoint-manager />
54
+ </component>
55
+ </project>
56
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruby_connman.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Dustin Ward
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # RubyConnman
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'ruby_connman'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install ruby_connman
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/ruby_connman/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ desc 'Open an irb session preloaded with this library'
4
+ task :console do
5
+ sh 'irb -rubygems -I lib -r ruby_connman.rb'
6
+ end
7
+
@@ -0,0 +1,10 @@
1
+ module RubyConnman
2
+ class Bus
3
+ include Singleton
4
+ attr_accessor :service
5
+
6
+ def initialize
7
+ @service = DBus::SystemBus.instance.service('net.connman')
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,28 @@
1
+ module RubyConnman
2
+ class Manager
3
+ attr_accessor :service_interface
4
+
5
+ def initialize
6
+ @service_interface = RubyConnman::Bus.instance.service.object('/')
7
+ @service_interface.introspect
8
+ @service_interface = @service_interface['net.connman.Manager']
9
+ end
10
+
11
+ def scan
12
+ interfaces = @service_interface.GetTechnologies.first.select { |a| a[1]['Type'] == 'wifi' }
13
+ interfaces.each do |interface|
14
+ RubyConnman::Technology.new(interface[0]).service_interface.Scan
15
+ end
16
+ end
17
+
18
+ def wifi_services
19
+ temp = {}
20
+ interfaces = @service_interface.GetServices.first.select { |a| a[1]['Type'] == 'wifi' }
21
+ interfaces.each do |interface|
22
+ RubyConnman::Service.new(interface[0])
23
+ temp[interface[0]] = interface[1]
24
+ end
25
+ temp
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,10 @@
1
+ module RubyConnman
2
+ class Service
3
+ attr_accessor :service_interface
4
+
5
+ def initialize(path = nil)
6
+ @service_interface = RubyConnman::Bus.instance.service.object(path)
7
+ @service_interface.introspect
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module RubyConnman
2
+ class Technology
3
+ attr_accessor :service_interface
4
+
5
+ def initialize(path = nil)
6
+ @service_interface = RubyConnman::Bus.instance.service.object(path)
7
+ @service_interface.introspect
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module RubyConnman
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,10 @@
1
+ require 'dbus'
2
+ require 'singleton'
3
+ require 'ruby_connman/bus'
4
+ require 'ruby_connman/service'
5
+ require 'ruby_connman/technology'
6
+ require 'ruby_connman/manager'
7
+ require 'ruby_connman/version'
8
+
9
+ module RubyConnman
10
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruby_connman/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'ruby_connman'
8
+ spec.version = RubyConnman::VERSION
9
+ spec.authors = ['Dustin Ward']
10
+ spec.email = ['dustin.n.ward@gmail.com']
11
+ spec.summary = 'RubyConnman Gem'
12
+ spec.description = 'RubyConnman Gem'
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.6'
22
+ spec.add_development_dependency 'rake'
23
+
24
+ spec.add_dependency 'ruby-dbus'
25
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_connman
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dustin Ward
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-dbus
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: RubyConnman Gem
56
+ email:
57
+ - dustin.n.ward@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".idea/.rakeTasks"
64
+ - ".idea/encodings.xml"
65
+ - ".idea/misc.xml"
66
+ - ".idea/modules.xml"
67
+ - ".idea/ruby_connman.iml"
68
+ - ".idea/scopes/scope_settings.xml"
69
+ - ".idea/vcs.xml"
70
+ - ".idea/workspace.xml"
71
+ - Gemfile
72
+ - LICENSE.txt
73
+ - README.md
74
+ - Rakefile
75
+ - lib/ruby_connman.rb
76
+ - lib/ruby_connman/bus.rb
77
+ - lib/ruby_connman/manager.rb
78
+ - lib/ruby_connman/service.rb
79
+ - lib/ruby_connman/technology.rb
80
+ - lib/ruby_connman/version.rb
81
+ - ruby_connman.gemspec
82
+ homepage: ''
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.2.2
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: RubyConnman Gem
106
+ test_files: []