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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pinfo-rails.rb +24 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b069c4a9b9d772a1b5672c8d9ca82c3fb4a7480b
4
- data.tar.gz: c308bb87695bd33649dd54383cdc941659d3c935
3
+ metadata.gz: d32f4f86d43b53c23b4f271b8ec372c9539d12d4
4
+ data.tar.gz: 99f0fb1c4a2781070aeb23a489cebd05e38aa703
5
5
  SHA512:
6
- metadata.gz: 5bac0cf986f950a141341d24c4a24b6dd29f7008593f2e8da6496851dfe4a208eb3c7bb44628a2f8bd069c7225a8fff030f881225050fc5f215b741e89def02a
7
- data.tar.gz: d1deee3864ecc9f80b8903f9117eccd81cb3e3e378d099fdef41ebf166495f7947dcd2338a45f319b1cacfaca7bf49adddedf6beebf25b9cf5327ab546ce0885
6
+ metadata.gz: 13f61c9cc6619dc7dcfd5b4faec6716f000acd0336b5cfa2c2926d7680948ab8bd169d25c65efc8c63b5345ba791f21dc792e06661f0504fb7c3ef538c75ef72
7
+ data.tar.gz: a726048235f50ab13fdc896b72da2be5dce4b36d71dd2276a6bc3c98a2bab64447c8666d390aa3f2bc3886e9177d955ea2c2a02cf5eca3108b19bc626c592e75
@@ -6,11 +6,11 @@ require 'yaml'
6
6
 
7
7
  module PinfoRails
8
8
  NAME = 'pinfo-rails'.freeze
9
- DATE = '2016-10-10'.freeze
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, 5 ].freeze
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
- printline( 'Ruby', { color: :green, mode: :bold }, RUBY_VERSION, @options[:verbose] ? 'p' + RUBY_PATCHLEVEL.to_s : nil )
53
- printline( 'Rails', { color: :green, mode: :bold }, grep( FILES[:gemfile], PATTERNS[:rails] ) )
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.5
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-10 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize