ignition-ign 0.0.4

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c8a07b32e27c9e851f0b1fb5159cc77024553f69
4
+ data.tar.gz: 67a9618f1584b6f873b16155cfaab851609fb174
5
+ SHA512:
6
+ metadata.gz: b3be4528be3e46b049d1a131f6884420950f2d343bf58ab0b593d8abb15e4e281d5ece20198b0412881ddb0336077a1cbdd8ea6591770262f3693a99f7652f16
7
+ data.tar.gz: d0a17847fba3eedaf7170806858dedbef8285cbc927ccb23065675870008088e9cb4998f107db69e1457a79f7720d84b5cd396048a0444af60bc685e0fffe22f
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ignition-ign.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,17 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ignition-ign (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.3.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.7)
16
+ ignition-ign!
17
+ rake (~> 10.0)
data/LICENSE.txt ADDED
@@ -0,0 +1,15 @@
1
+ Software License Agreement (Apache License)
2
+
3
+ Copyright (C) 2014 Open Source Robotics Foundation
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Ignition::Ign
2
+
3
+ A command line interface to the ignition tools.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ignition-ign'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ignition-ign
20
+
21
+ ## Usage
22
+
23
+ Just type `ign --help` for a detailed list of commands.
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/osrf/ignition-ign/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/ign ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ignition/ign'
4
+
5
+ Ign.execute(ARGV.size, ARGV.pack('p**'))
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ignition/ign/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ignition-ign"
8
+ spec.version = Ignition::Ign::VERSION
9
+ spec.authors = ["Carlos Agüero"]
10
+ spec.email = ["caguero@osrfoundation.org"]
11
+ spec.summary = %q{A command line interface to the ignition tools.}
12
+ spec.description = %q{This module provides the 'ign' command line tool. This
13
+ command will allow you to use the functionality provided
14
+ by the ignition libraries installed in your system. For
15
+ example, if libignition-transport is installed in your
16
+ system, you should be able to run `ign topic -l` to
17
+ print the list of available topics.}
18
+ spec.homepage = "http://ignitionrobotics.org/"
19
+ spec.license = "Apache 2.0"
20
+
21
+ spec.files = `git ls-files -z`.split("\x0")
22
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
24
+ spec.require_paths = ["lib"]
25
+
26
+ # Declare that the Gem is compatible with version 1.8 or greater.
27
+ spec.required_ruby_version = ">= 1.8"
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.7"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ end
@@ -0,0 +1,73 @@
1
+ require 'dl/import'
2
+ require 'optparse'
3
+ require 'yaml'
4
+ require "ignition/ign/version"
5
+
6
+ module Ignition
7
+ module Ign
8
+ commands = {}
9
+
10
+ conf_directory = '/usr/share/ignition/'
11
+ conf_directory = ENV['IGN_CONFIG_PATH'] if ENV.key?('IGN_CONFIG_PATH')
12
+
13
+ # Check that we have at least one configuration file with ign commands.
14
+ if Dir.glob(conf_directory + '/*.yaml').empty?
15
+ puts 'I cannot find any available "ign" command:'
16
+ puts "\t* Did you install any ignition library?"
17
+ puts "\t* Did you set the IGN_CONFIG_PATH environment variable?"
18
+ exit(-1)
19
+ end
20
+
21
+ # Iterate over the list of configuration files.
22
+ Dir.glob(conf_directory + '/*.yaml') do |conf_file|
23
+ next if conf_file == '.' || conf_file == '..'
24
+
25
+ # Read the configuration file.
26
+ yml = YAML.load_file(conf_file)
27
+ yml['commands'].each do |cmd|
28
+ cmd.each do |key, value|
29
+ commands[key] = { 'library' => yml['library'], 'description' => value }
30
+ end
31
+ end
32
+ end
33
+
34
+ # Debug: show the list of available commands.
35
+ # puts commands
36
+
37
+ # Read the command line arguments.
38
+ usage = 'The ign command provides a command line interface to the ignition '\
39
+ "tools.\n\n"\
40
+ " Usage: ign [options] command\n\n"\
41
+ "List of available commands:\n\n"
42
+
43
+ commands.each do |cmd, value|
44
+ usage += cmd + "\t" + value['description'] + "\n"
45
+ end
46
+
47
+ usage += "\nUse \"ign help <command>\" to print help for a command"
48
+
49
+ OptionParser.new do |opts|
50
+ opts.banner = usage
51
+
52
+ opts.on('-h', '--help', 'Show this message') do
53
+ puts opts
54
+ exit(0)
55
+ end
56
+ end.parse!
57
+
58
+ # Check that there is at least one command and there is a plugin that knows
59
+ # how to handle it.
60
+ if ARGV.empty? || !commands.key?(ARGV[0])
61
+ puts usage
62
+ exit(-1)
63
+ end
64
+
65
+ # Read the plugin that handles the command.
66
+ plugin = commands[ARGV[0]]['library']
67
+
68
+ ARGV.insert(0, 'ign')
69
+
70
+ dlload plugin
71
+ extern 'void execute(int, char**)'
72
+ end
73
+ end
@@ -0,0 +1,5 @@
1
+ module Ignition
2
+ module Ign
3
+ VERSION = "0.0.4"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ignition-ign
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Carlos Agüero
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-12 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.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: |-
42
+ This module provides the 'ign' command line tool. This
43
+ command will allow you to use the functionality provided
44
+ by the ignition libraries installed in your system. For
45
+ example, if libignition-transport is installed in your
46
+ system, you should be able to run `ign topic -l` to
47
+ print the list of available topics.
48
+ email:
49
+ - caguero@osrfoundation.org
50
+ executables:
51
+ - ign
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - Gemfile
56
+ - Gemfile.lock
57
+ - LICENSE.txt
58
+ - README.md
59
+ - Rakefile
60
+ - bin/ign
61
+ - ignition-ign.gemspec
62
+ - lib/ignition/ign.rb
63
+ - lib/ignition/ign/version.rb
64
+ homepage: http://ignitionrobotics.org/
65
+ licenses:
66
+ - Apache 2.0
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '1.8'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.2.2
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: A command line interface to the ignition tools.
88
+ test_files: []