vls 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ddf99496065f624a2b98d4bdf73233b619e3e42d
4
- data.tar.gz: 8eecdac22d3507bfffd0364aa20ee96a17f9bbe2
3
+ metadata.gz: 17db29744dbbccea1c7827ffdb8ae7949c7e9995
4
+ data.tar.gz: a958d743642683678a760339c8c8240721ae5e93
5
5
  SHA512:
6
- metadata.gz: 78608e23c2555a9f291c39a212868d8ff1eba1993064c5ccd8776b518826aea6aceff463d488c56fcbc66cce4e9e3b1143d8ac0e361daad174d805f7f4ec3b54
7
- data.tar.gz: 503caa9869416aa4a34497ec745f026c2cd22e1379e05cece281689b1b76bfa298ae59158ce335a2b394ab8a8f1753a494e049a90f845f628bc1622dbb0a8530
6
+ metadata.gz: 2b9b80c584773aa52d4dac99761c254f66a66bed1b5516922d9f1cabf7d4d7bb3d7e1a2154d1bf7f09a7fe6d299c2133dccd6003196293b5eae6a96d8a846228
7
+ data.tar.gz: 02f4781c24339dd1323489353d383be4b2f81ebd7a5ec868c90660bd8dae843e4328c2d9f4959fecb43bdb505558487ffaca2d42bcc6b98a68295a26ec6e084c
data/README.md CHANGED
@@ -65,23 +65,31 @@ accessed with:
65
65
  module_version_list = VersionLS.vls
66
66
  ```
67
67
  This returns an array of entries, sorted by module name, consisting of an
68
- array with the module and a string with its version.
68
+ array with the module and a string with its version. Also, the Object class
69
+ is monkey patched with the vls method that outputs the information to the
70
+ console.
69
71
 
70
- Note that the vls method does not accept a list of modules to be required. It
72
+ ```ruby
73
+ vls
74
+ ```
75
+
76
+ Note that these methods do not accept a list of modules to be required. It
71
77
  is assumed that when embedded within an application, the needed facilities
72
- would have already been loaded.
78
+ would have already been loaded. In addition, the vls listing to the console
79
+ has no header information. If this is desired, the application should do a
80
+ puts of the appropriate descriptive text.
73
81
 
74
82
  ## The Rails Console
75
83
 
76
- If the vls gem has been added to a rails project, its functionality is also
77
- easily accessed via the rails console:
84
+ If the vls gem has been added to a rails project (in its Gemfile), its
85
+ functionality is also easily accessed via the rails console:
78
86
 
79
87
  $ rails console
80
88
 
81
89
  followed by
82
90
 
83
91
  ```ruby
84
- VersionLS.ls
92
+ vls
85
93
  ```
86
94
 
87
95
  will create a formatted listing of the modules with version info of the module
@@ -89,7 +97,7 @@ load out of the web site. For example:
89
97
 
90
98
  $ rails console
91
99
  Loading development environment (Rails 4.2.6)
92
- irb(main):001:0> VersionLS.ls
100
+ irb(main):001:0> vls
93
101
  ActionDispatch::Journey::Router, 2.0.0
94
102
  ActionMailer, 4.2.6
95
103
  ActionPack, 4.2.6
@@ -162,13 +170,12 @@ load out of the web site. For example:
162
170
 
163
171
  ## Usage in Rails Views
164
172
 
165
- It is also possible to incorporate vls data into a view using the vls method
166
- in a controller and passing the resultant array of data to a view for
173
+ It is also possible to incorporate vls data into a view using the VersionLS.vls
174
+ method in a controller and passing the resultant array of data to a view for
167
175
  rendering in a web page. This may be useful for a diagnostic or informational
168
- page in the web site.
169
-
170
- A detailed examination of this task is beyond the scope of this document and
171
- readers are advised to consult Ruby on Rails tutorials for more information.
176
+ page in a web site. However, a detailed examination of this task is beyond the
177
+ scope of this document and readers are advised to consult Ruby on Rails
178
+ tutorials for more information.
172
179
 
173
180
  ## Contributing
174
181
 
data/bin/vls CHANGED
@@ -4,16 +4,13 @@
4
4
  require_relative '../lib/vls'
5
5
 
6
6
  def vls_show_header
7
- puts "vls (VersionLS): #{VersionLS::VERSION}"
8
- puts
7
+ print "vls (VersionLS): #{VersionLS::VERSION}\n\n"
9
8
  end
10
9
 
11
10
  def vls_show_help
12
11
  vls_show_header
13
12
  puts VersionLS::DESCRIPTION
14
- puts
15
- puts "Usage template:"
16
- puts "$ vls <options> <names>"
13
+ puts "\nUsage: $ vls <options> <names>"
17
14
  puts "\n<options>"
18
15
  puts " --help, -h, -? = Display this text and exit."
19
16
  puts " --raw, -r = Display results with no header text."
@@ -25,6 +22,7 @@ end
25
22
 
26
23
  load_list, no_header = [], false
27
24
 
25
+ #Process the script argument list.
28
26
  ARGV.each do |arg|
29
27
  case arg
30
28
  when "--help", "-h", "-?"
@@ -40,6 +38,7 @@ vls_show_help if load_list.empty?
40
38
  vls_show_header unless no_header
41
39
  errors_found = false
42
40
 
41
+ #Require the specified gems and ruby files.
43
42
  load_list.each do |pkg|
44
43
  begin
45
44
  if pkg.downcase.end_with?('.rb')
@@ -6,6 +6,11 @@ class Object
6
6
  def to_vls_version_string
7
7
  "version #{self.class} ???"
8
8
  end
9
+
10
+ #A simple shortcut method for ease of use in irb and rails console.
11
+ def vls
12
+ VersionLS.ls
13
+ end
9
14
  end
10
15
 
11
16
  #An addition to the String class for vls support.
@@ -1,5 +1,5 @@
1
1
  module VersionLS
2
- STRING = VERSION = "0.3.4"
2
+ STRING = VERSION = "0.3.5"
3
3
 
4
4
  DESCRIPTION = "A command line utility that lists the versions of " +
5
5
  "modules used by the specified gems/ruby files."
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.4
4
+ version: 0.3.5
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-27 00:00:00.000000000 Z
11
+ date: 2016-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler