vls 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81d673c1c6e738320a8e6646567125284428f281
4
- data.tar.gz: 542f4e44b0343e72221aa51682ecdc2757da2ae3
3
+ metadata.gz: 56829e5ca3f1738854377aa261fa31007f842727
4
+ data.tar.gz: 7a1deb11651e1af6796f395415e3a12f1eb7ea67
5
5
  SHA512:
6
- metadata.gz: 24247c19e7e81287520c072aac8eff9d5b7ad989d1960937fab71e2a4e624a3fa000112e1b64a17b461a38e47a19dcad00013c58113090c96519388bd3dbd92b
7
- data.tar.gz: 2947a4d7bc1e6c23a629f7a2efeef3f0035adc3d5fdea662370973badf092024fe9fd84eb8a654b2501029491ac90a3c4a3ed77bcf1fd01dd4aed01cd7713770
6
+ metadata.gz: 2e99b53ea8c68227b63d95d13ac0033fd0550a23c021db21ae3e45bfad9ea220727726ffba23e84d283ab49eeb0b26065e24d9d2dc7a81f306e2be1a2dc24f61
7
+ data.tar.gz: 4fe67b80c4143e4446b03d0075cd364d3a2fe5140cc6db5fb4c350d8d3086328efec570508d9636bf40751aa4a56beaace39099ee6789c685df4b8ae06b07f0e
data/README.md CHANGED
@@ -33,30 +33,31 @@ is:
33
33
  where names is a list of gems and/or files to be required before the
34
34
  module/classes are displayed with their VERSION information. For example:
35
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
36
+ $ vls rails
37
+ vls (VersionLS): 0.3.0
38
+
39
+ ActionPack, 4.2.6
40
+ ActiveSupport, 4.2.6
41
+ ActiveSupport::Logger, 1.2.7
42
+ Gem, 2.2.2
43
+ I18n, 0.7.0
44
+ JSON, 1.8.3
45
+ Logger, 1.2.7
46
+ OpenSSL, 1.1.0
47
+ Psych, 2.0.5
48
+ Rack, [1, 3]
49
+ Rails, 4.2.6
50
+ ThreadSafe, 0.3.5
51
+
52
+ In order to use relative paths instead of the gem search path, the .rb extension
53
+ needs to be specified on the target file.
54
+
55
+ $ vls ruby_sscanf.rb
56
+ vls (VersionLS): 0.3.0
57
+
45
58
  FormatEngine, 0.7.2
46
- FullClone, 0.0.5
47
59
  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
+ RubySscanf, 0.2.3
60
61
 
61
62
  The vls utility is also available for use within an application. It may be
62
63
  accessed with:
data/bin/vls CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Standalone execution of the fOOrth environment.
3
+ # The vls command line utility script.
4
4
  #
5
5
 
6
6
  require 'vls'
data/lib/vls.rb CHANGED
@@ -2,26 +2,66 @@
2
2
 
3
3
  require_relative "vls/version"
4
4
 
5
- module VersionLS
5
+ #An addition to the Object class for vls support.
6
+ class Object
7
+ #Get the vls version string from this module.
8
+ def to_vls_version_string
9
+ "version #{self.class} ???"
10
+ end
11
+ end
12
+
13
+ #An addition to the String class for vls support.
14
+ class String
15
+ #Get this string as a vls version string.
16
+ def to_vls_version_string
17
+ self
18
+ end
19
+ end
6
20
 
21
+ #An addition to the Module class for vls support.
22
+ class Module
23
+ #Get the vls version string from this module.
24
+ def to_vls_version_string
25
+ self::STRING
26
+ rescue
27
+ "version module ???"
28
+ end
29
+ end
30
+
31
+ #An addition to the Array class for vls support.
32
+ class Array
33
+ #Get the vls version string from this array.
34
+ def to_vls_version_string
35
+ self.join('.')
36
+ rescue
37
+ "version array ???"
38
+ end
39
+ end
40
+
41
+ # The Version LiSt utility module.
42
+ module VersionLS
7
43
  #Execute the core of the vls command and return an array of
8
44
  #[module, version] arrays.
9
45
  def self.vls
10
46
  modules.map do |mod|
11
- version = mod.const_get(:VERSION)
12
- version = version::STRING if version.is_a?(Module)
47
+ begin
48
+ version = mod::VERSION
49
+ rescue
50
+ version = 'version ???'
51
+ end
13
52
 
14
- [mod, version]
53
+ [mod, version.to_vls_version_string]
15
54
  end
16
55
  end
17
56
 
18
57
  #Get a list of modules that have VERSION info.
19
58
  def self.modules
20
- mods = ObjectSpace.each_object(Module).select do
21
- |c| c.const_defined?("VERSION")
22
- end.sort { |a,b| a.name <=> b.name }
59
+ mods = ObjectSpace.each_object(Module).select do |mod|
60
+ mod.const_defined?("VERSION")
61
+ end.sort do
62
+ |first, second| first.name <=> second.name
63
+ end
23
64
 
24
65
  mods - [VersionLS]
25
66
  end
26
-
27
67
  end
@@ -1,3 +1,3 @@
1
1
  module VersionLS
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -30,7 +30,7 @@ end
30
30
 
31
31
  desc "Run a scan for smelly code!"
32
32
  task :reek do |t|
33
- `reek --no-color lib > reek.txt`
33
+ `reek --no-color lib bin > reek.txt`
34
34
  end
35
35
 
36
36
  desc "What version of vls is this?"
@@ -0,0 +1 @@
1
+ 0 total warnings
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,7 @@ files:
54
54
  - lib/vls.rb
55
55
  - lib/vls/version.rb
56
56
  - rakefile.rb
57
+ - reek.txt
57
58
  - vls.gemspec
58
59
  homepage: http://teuthida-technologies.com/
59
60
  licenses: