pinfo-rails 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pinfo-rails.rb +24 -6
- 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: d32f4f86d43b53c23b4f271b8ec372c9539d12d4
|
4
|
+
data.tar.gz: 99f0fb1c4a2781070aeb23a489cebd05e38aa703
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13f61c9cc6619dc7dcfd5b4faec6716f000acd0336b5cfa2c2926d7680948ab8bd169d25c65efc8c63b5345ba791f21dc792e06661f0504fb7c3ef538c75ef72
|
7
|
+
data.tar.gz: a726048235f50ab13fdc896b72da2be5dce4b36d71dd2276a6bc3c98a2bab64447c8666d390aa3f2bc3886e9177d955ea2c2a02cf5eca3108b19bc626c592e75
|
data/lib/pinfo-rails.rb
CHANGED
@@ -6,11 +6,11 @@ require 'yaml'
|
|
6
6
|
|
7
7
|
module PinfoRails
|
8
8
|
NAME = 'pinfo-rails'.freeze
|
9
|
-
DATE = '2016-10-
|
9
|
+
DATE = '2016-10-12'.freeze
|
10
10
|
INFO = 'Rails project info'.freeze
|
11
11
|
DESC = 'A gem to collect informations from a Rails project'.freeze
|
12
12
|
AUTHORS = [ [ 'Mattia Roccoberton', 'mat@blocknot.es', 'http://blocknot.es' ] ].freeze
|
13
|
-
VERSION = [ 0, 1,
|
13
|
+
VERSION = [ 0, 1, 6 ].freeze
|
14
14
|
|
15
15
|
FILES = {
|
16
16
|
conf_db: 'config/database.yml',
|
@@ -20,14 +20,18 @@ module PinfoRails
|
|
20
20
|
conf_dep: 'config/deploy.rb',
|
21
21
|
conf_dep_stag: 'config/deploy/staging.rb',
|
22
22
|
conf_dep_prod: 'config/deploy/production.rb',
|
23
|
-
gemfile: 'Gemfile'
|
23
|
+
gemfile: 'Gemfile',
|
24
|
+
ruby_ver: '.ruby-version',
|
25
|
+
rvmrc: '.rvmrc'
|
24
26
|
}.freeze
|
25
27
|
PATTERNS = {
|
26
28
|
cache: /\A\s*config.cache_classes.*|\A\s*config.action_controller.perform_caching.*/,
|
27
29
|
deploy_info: /branch\s*,.*|user\s*,.*|domain\s*,.*|server.*/,
|
28
30
|
deploy_tool: /'capistrano'|"capistrano|'capistrano-rails'|"capistrano-rails"|'mina'|"mina"/,
|
29
31
|
deploy_user: /user.*/,
|
30
|
-
rails: /'rails'.*|"rails"
|
32
|
+
rails: /'rails'.*|"rails".*/,
|
33
|
+
ruby: /ruby\s+.*/,
|
34
|
+
rvmrc: /rvm\s+use.*/
|
31
35
|
}.freeze
|
32
36
|
|
33
37
|
# pinfo-rails: A gem to collect informations from a Rails project
|
@@ -49,8 +53,8 @@ module PinfoRails
|
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
52
|
-
|
53
|
-
|
56
|
+
check_ruby
|
57
|
+
check_rails
|
54
58
|
check_requirements
|
55
59
|
check_database
|
56
60
|
check_cache
|
@@ -121,6 +125,20 @@ module PinfoRails
|
|
121
125
|
end
|
122
126
|
end
|
123
127
|
|
128
|
+
def self.check_rails
|
129
|
+
printline( 'Rails', { color: :green, mode: :bold }, grep( FILES[:gemfile], PATTERNS[:rails] ) )
|
130
|
+
end
|
131
|
+
|
132
|
+
def self.check_ruby
|
133
|
+
printline( 'Ruby (current)', { color: :green, mode: :bold }, RUBY_VERSION + ' p' + RUBY_PATCHLEVEL.to_s )
|
134
|
+
printline( 'Ruby (.rvmrc)', :green, grep( FILES[:rvmrc], PATTERNS[:rvmrc] ) )
|
135
|
+
ruby_ver = cat( FILES[:ruby_ver] ).strip
|
136
|
+
printline( 'Ruby (.ruby-version)', :green, ruby_ver )
|
137
|
+
printline( 'Ruby (Gemfile)', :green, grep( FILES[:gemfile], PATTERNS[:ruby] ) )
|
138
|
+
end
|
139
|
+
|
140
|
+
###
|
141
|
+
|
124
142
|
def self.cat( file )
|
125
143
|
lines = []
|
126
144
|
if File.exist? file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinfo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Roccoberton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|