vls 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fb8fe6dd16265afd16a80dc8e247f38c1af14749
4
+ data.tar.gz: 08ca63f18aff58296f241af031c092e9461bc476
5
+ SHA512:
6
+ metadata.gz: df438ac82ba7e11e032dd31c94cf2a317fc3a5b7909b63093eb9487d886d9598915b29ca405aafec0ef89c4df36d48c69217765b18800d85ecfb6e63f28e14cf
7
+ data.tar.gz: 1fd6664a183cf0afd143d53f0796ef5e4f30909b910147ec3116ab4c2ae49e02184a0337ca6d7cb98ab81be23ebc98ec40298b208760b2bc6ada55f53ffe5183
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vls.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Peter Camilleri
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,86 @@
1
+ # VersionLS
2
+
3
+ A utility for producing a list of classes/modules with version info, that are
4
+ present in an application, gem, or ruby program file.
5
+
6
+ ## Installation
7
+
8
+ The vls gem is normally used as a stand-alone utility. However, its
9
+ functionality may be added to any Ruby application. To do so you can add this
10
+ line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'vls'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Far more likely however, install it yourself as:
21
+
22
+ $ gem install vls
23
+
24
+ The vls gem itself is found at: ( https://rubygems.org/gems/vls )
25
+
26
+ ## Usage
27
+
28
+ The vls utility is normally used at the command line. The basic usage template
29
+ is:
30
+
31
+ $ vls <names>
32
+
33
+ where names is a list of gems and/or files to be required before the
34
+ module/classes are displayed with their VERSION information. For example:
35
+
36
+ C:\Sites\vls>vls fOOrth
37
+ vls (VersionLS): 0.1.0
38
+
39
+ Bignum, 0.0.5
40
+ Complex, 0.0.5
41
+ Date::Infinity, 0.0.5
42
+ FalseClass, 0.0.5
43
+ Fixnum, 0.0.5
44
+ Float, 0.0.5
45
+ FormatEngine, 0.7.2
46
+ FullClone, 0.0.5
47
+ Gem, 2.2.2
48
+ InArray, 0.1.5
49
+ Integer, 0.0.5
50
+ MiniReadline, 0.4.8
51
+ NilClass, 0.0.5
52
+ Numeric, 0.0.5
53
+ Rational, 0.0.5
54
+ Regexp, 0.0.5
55
+ RubySscanf, 0.2.1
56
+ SafeClone, 0.0.3
57
+ Symbol, 0.0.5
58
+ TrueClass, 0.0.5
59
+ XfOOrth, 0.6.1
60
+
61
+ The vls utility is also available for use within an application. It may be
62
+ accessed with:
63
+ ```ruby
64
+ module_version_list = VersionLS.vls
65
+ ```
66
+ This returns an array of entries, sorted by module name, consisting of an
67
+ array with the module and a string with its version.
68
+
69
+ Note that the vls method does not accept a list of modules to be required. It
70
+ is assumed that when embedded within an application, the needed facilities
71
+ would have already been loaded.
72
+
73
+ ## Contributing
74
+
75
+ #### Plan A
76
+
77
+ 1. Fork it ( https://github.com/PeterCamilleri/vls/fork )
78
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
79
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
80
+ 4. Push to the branch (`git push origin my-new-feature`)
81
+ 5. Create new Pull Request
82
+
83
+ #### Plan B
84
+
85
+ Go to the GitHub repository and raise an issue calling attention to some
86
+ aspect that could use some TLC or a suggestion or an idea.
data/bin/vls ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Standalone execution of the fOOrth environment.
4
+ #
5
+
6
+ require 'vls'
7
+
8
+ puts "vls (VersionLS): #{VersionLS::VERSION}"
9
+ puts
10
+
11
+ if ARGV.empty?
12
+ puts "Usage template:"
13
+ puts "$ vls <names>"
14
+ puts " <names> are gems/files to be required before modules are listed."
15
+ else
16
+ no_good = false
17
+
18
+ ARGV.each do |pkg|
19
+ begin
20
+ require pkg
21
+ rescue LoadError, StandardError => error
22
+ puts "Error loading #{pkg}, #{error.message}"
23
+ no_good = true
24
+ end
25
+ end
26
+
27
+ exit if no_good
28
+
29
+ VersionLS.vls.each do |mod|
30
+ puts "#{mod[0]}, #{mod[1]}"
31
+ end
32
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+
3
+ require_relative "vls/version"
4
+
5
+ module VersionLS
6
+
7
+ #Execute the core of the vls command and return an array of
8
+ #[module, version] arrays.
9
+ def self.vls
10
+ modules.map { |mod| [mod, mod.const_get(:VERSION)] }
11
+ end
12
+
13
+ #Get a list of modules that have VERSION info.
14
+ def self.modules
15
+ mods = ObjectSpace.each_object(Module).select do
16
+ |c| c.const_defined?("VERSION")
17
+ end.sort { |a,b| a.name <=> b.name }
18
+
19
+ mods - [VersionLS]
20
+ end
21
+
22
+ end
@@ -0,0 +1,3 @@
1
+ module VersionLS
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ # coding: utf-8
3
+
4
+ require 'rake/testtask'
5
+ require 'rdoc/task'
6
+ require "bundler/gem_tasks"
7
+
8
+ #Generate internal documentation with rdoc.
9
+ RDoc::Task.new do |rdoc|
10
+ rdoc.rdoc_dir = "rdoc"
11
+
12
+ #List out all the files to be documented.
13
+ rdoc.rdoc_files.include("lib/**/*.rb", "license.txt", "README.md")
14
+
15
+ #Make all access levels visible.
16
+ rdoc.options << '--visibility' << 'private'
17
+ #rdoc.options << '--verbose'
18
+ #rdoc.options << '--coverage-report'
19
+
20
+ #Set a title.
21
+ rdoc.options << '--title' << 'vls Gem'
22
+ end
23
+
24
+ #Run the mini_readline unit test suite.
25
+ Rake::TestTask.new do |t|
26
+ #List out all the test files.
27
+ t.test_files = FileList['tests/**/*.rb']
28
+ t.verbose = false
29
+ end
30
+
31
+ desc "Run a scan for smelly code!"
32
+ task :reek do |t|
33
+ `reek --no-color lib > reek.txt`
34
+ end
35
+
36
+ desc "What version of vls is this?"
37
+ task :vers do |t|
38
+ puts
39
+ puts "vls (VersionLS) version = #{VersionLS::VERSION}"
40
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vls/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vls"
8
+ spec.version = VersionLS::VERSION
9
+ spec.authors = ["Peter Camilleri"]
10
+ spec.email = ["peter.c.camilleri@gmail.com"]
11
+
12
+ spec.summary = "List the versions of modules active within a gem or application."
13
+ spec.description = "A version listing utility"
14
+ spec.homepage = "http://teuthida-technologies.com/"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(tests)/}) }
18
+ spec.bindir = "bin"
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.required_ruby_version = '>=1.9.3'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.11"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vls
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Peter Camilleri
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-10 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.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
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: A version listing utility
42
+ email:
43
+ - peter.c.camilleri@gmail.com
44
+ executables:
45
+ - vls
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - bin/vls
54
+ - lib/vls.rb
55
+ - lib/vls/version.rb
56
+ - rakefile.rb
57
+ - vls.gemspec
58
+ homepage: http://teuthida-technologies.com/
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 1.9.3
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.2.2
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: List the versions of modules active within a gem or application.
82
+ test_files: []
83
+ has_rdoc: