miko 0.0.5 → 0.0.6
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 +4 -4
- data/README.md +1 -1
- data/bin/miko +5 -1
- data/lib/miko.rb +42 -29
- data/lib/miko/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ac248b2ba97d2d9957c7f30b626d0344de3a8e8
|
4
|
+
data.tar.gz: 8c498939cce18f2b2d67cf1b7c0588bbf716e2ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2bcf73556fa3f2ba5ebb43aa4864614bba3ac2959534ec0724eac91b8101cec3a1b9bcf1a5fd9161a71a93d02d2c6c903e573c04c7e077ccda03dd277f2c320
|
7
|
+
data.tar.gz: d551393581a0efe23a2cd6714b08747a7640e5544437ca5486485a91a4050b58656e9c4922cd3fba73465bb5bf78a0b4b68588624b58b1625af69e8b61f40c75
|
data/README.md
CHANGED
data/bin/miko
CHANGED
@@ -8,7 +8,7 @@ require 'optparse'
|
|
8
8
|
|
9
9
|
options = {}
|
10
10
|
optparse = OptionParser.new do |opts|
|
11
|
-
opts.banner = "Usage: miko [
|
11
|
+
opts.banner = "Usage: miko [options]"
|
12
12
|
|
13
13
|
opts.on( "-u user", "--user USER", "Username - translates into /home/USER/") do |user|
|
14
14
|
options[:user] = user
|
@@ -18,6 +18,10 @@ optparse = OptionParser.new do |opts|
|
|
18
18
|
options[:directory] = dir
|
19
19
|
end
|
20
20
|
|
21
|
+
opts.on("-v", "--verbose", "Be verbose and display errors" ) do |ver|
|
22
|
+
options[:verbose] = ver
|
23
|
+
end
|
24
|
+
|
21
25
|
opts.on( "-h", "--help", "Display Help") do
|
22
26
|
puts opts
|
23
27
|
exit
|
data/lib/miko.rb
CHANGED
@@ -4,6 +4,7 @@ class Miko
|
|
4
4
|
attr_accessor :directory
|
5
5
|
attr_accessor :found
|
6
6
|
attr_accessor :path
|
7
|
+
attr_accessor :verbose
|
7
8
|
|
8
9
|
def initialize( option )
|
9
10
|
unless option[:user].nil?
|
@@ -14,40 +15,54 @@ class Miko
|
|
14
15
|
unless option[:directory].nil?
|
15
16
|
@directory = option[:directory]
|
16
17
|
end
|
18
|
+
|
19
|
+
unless option[:verbose]
|
20
|
+
@verbose = option[:verbose]
|
21
|
+
end
|
22
|
+
|
17
23
|
@found = []
|
18
24
|
end
|
19
25
|
|
20
26
|
def run
|
21
|
-
if File.directory?(@directory )
|
27
|
+
if File.directory?(@directory ) and File.readable?(@directory)
|
22
28
|
find_installs
|
29
|
+
|
23
30
|
else
|
24
|
-
|
31
|
+
unless defined?(@verbose).nil?
|
32
|
+
raise "Problem accessing directory"
|
33
|
+
end
|
25
34
|
end
|
26
35
|
end
|
27
36
|
|
28
37
|
private
|
38
|
+
##
|
39
|
+
## Skip /home/virtfs
|
29
40
|
def find_installs
|
30
41
|
Find.find( @directory ) do |path|
|
31
42
|
@path = path
|
32
|
-
if File.
|
33
|
-
if path
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
if File.readable_real?(path)
|
44
|
+
if path[/virtfs/].nil?
|
45
|
+
if path =~ /.*\/version\.php$/
|
46
|
+
find_wordpress_joomla
|
47
|
+
find_moodle
|
48
|
+
elsif path =~ /.*\/bootstrap.inc$/
|
49
|
+
find_drupal
|
50
|
+
elsif path =~ /.*\/modules\/system\/system.module$/
|
51
|
+
find_drupal
|
52
|
+
elsif path =~ /.*\/index.php$/
|
53
|
+
find_smf_version
|
54
|
+
elsif path =~ /.*\/app\/Mage.php$/
|
55
|
+
find_magento_version
|
56
|
+
elsif path =~ /.*\/styles\/prosilver\/template\/template.cfg$/
|
57
|
+
find_phpbb_version
|
58
|
+
elsif path =~/.*\/inc\/class_core.php$/
|
59
|
+
find_mybb_version
|
60
|
+
end
|
48
61
|
end
|
49
62
|
else
|
50
|
-
|
63
|
+
unless defined?( @verbose).nil?
|
64
|
+
puts "Problem accessing #{path}"
|
65
|
+
end
|
51
66
|
end
|
52
67
|
end
|
53
68
|
end
|
@@ -67,14 +82,12 @@ class Miko
|
|
67
82
|
version = line.split(" ")[2][/([\d.]+)/]
|
68
83
|
acct_home = path.gsub("/wp-includes/version.php", "")
|
69
84
|
script = "Wordpress"
|
70
|
-
elsif ( line["
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
acct_home = path.gsub("libraries/joomla/version.php", "")
|
77
|
-
script = "Joomla"
|
85
|
+
elsif ( line["$RELEASE"] )
|
86
|
+
if @path =~ /.*\/libraries\/cms\/version\/version.php$/ || @path =~ /.*\/libraries\/joomla\/version.php$/
|
87
|
+
version = line[/([\d.]+)/]+ "."+ joomla_devlevel
|
88
|
+
acct_home = path.split("libraries")[0]
|
89
|
+
script = "Joomla"
|
90
|
+
end
|
78
91
|
end
|
79
92
|
# Output ony when we has a defined variable
|
80
93
|
unless defined?(version).nil?
|
@@ -84,9 +97,9 @@ class Miko
|
|
84
97
|
end
|
85
98
|
|
86
99
|
def joomla_devlevel
|
87
|
-
|
88
|
-
fi[/DEV_LEVEL.*'/][/\d+/]
|
100
|
+
File.read( @path )[/DEV_LEVEL.*'/][/\d+/]
|
89
101
|
end
|
102
|
+
|
90
103
|
## Find Drupal version
|
91
104
|
def find_drupal
|
92
105
|
File.open( @path, "r").each_line do |line|
|
data/lib/miko/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miko
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antun Krasic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|