modulorails 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 92b2390033b3083f0829661ac44665f58f8eb438fb095d32c803ae5cea51c488
4
- data.tar.gz: 5e13ccdb0a64f7b32ac594601f4f2415f081a16284e9c73cb1953c3e5cc47497
3
+ metadata.gz: 265c1a8a801aa9cd51479b23756c2b2631e9ac0d6fbd7634ce2fa572e0489ac9
4
+ data.tar.gz: 251ec334d918a84982b3573e0ad610dc28eca31b77250ea2305caa46c5792951
5
5
  SHA512:
6
- metadata.gz: 1e9e8885a9c648e7de6af49c3fa66ab59243714eda2449cd8398f4c09efa2fa5f744d71db7aa68f91a8f9912282c416e6e91f8c665b1035ea376974702251924
7
- data.tar.gz: c15837070582d0a901fdfeee1c1d0be86a67f5fe69efbcca39fb14921e2ee1c527dadca48ab0c89691679d8bcc9144586a2ab4309773b4a8e8771369cb8ef5c7
6
+ metadata.gz: 3dc837963f657c14c3ee2541fc7778de4ead2d2cb8216feb8908897b3c26400331ea07020c348ee88d11167f02c52ef8334bf6a4e9934cdcf3f22951a51f31d3
7
+ data.tar.gz: 724b94a6b281027be0e5c36a9d93b66e1c8207e24e31d165f10ca04bf828461f019f689c29c983f377145d589a5dc90069ad9dda8bc1633f51e1ad25a1e13653
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This file is used to list changes made in each version of the gem.
4
4
 
5
+ # 0.2.1
6
+
7
+ Minor fixes.
8
+
9
+ - Fixes some errors occuring on a project where database can not be accessed.
10
+
5
11
  # 0.2.0
6
12
 
7
13
  Auto-update release.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- modulorails (0.2.0)
4
+ modulorails (0.2.1)
5
5
  git (~> 1.7, >= 1.7.0)
6
6
  httparty
7
7
  i18n
@@ -38,21 +38,21 @@ GEM
38
38
  concurrent-ruby (1.1.7)
39
39
  crass (1.0.6)
40
40
  diff-lcs (1.4.4)
41
- erubi (1.9.0)
42
- git (1.7.0)
41
+ erubi (1.10.0)
42
+ git (1.8.1)
43
43
  rchardet (~> 1.8)
44
44
  httparty (0.18.1)
45
45
  mime-types (~> 3.0)
46
46
  multi_xml (>= 0.5.2)
47
47
  i18n (1.8.5)
48
48
  concurrent-ruby (~> 1.0)
49
- loofah (2.7.0)
49
+ loofah (2.8.0)
50
50
  crass (~> 1.0.2)
51
51
  nokogiri (>= 1.5.9)
52
52
  method_source (1.0.0)
53
53
  mime-types (3.3.1)
54
54
  mime-types-data (~> 3.2015)
55
- mime-types-data (3.2020.0512)
55
+ mime-types-data (3.2020.1104)
56
56
  mini_portile2 (2.4.0)
57
57
  minitest (5.14.1)
58
58
  multi_xml (0.6.0)
@@ -50,6 +50,8 @@ class GitlabciGenerator < Rails::Generators::Base
50
50
 
51
51
  # Create file to avoid this generator on next modulorails launch
52
52
  create_keep_file
53
+ rescue StandardError => e
54
+ $stderr.puts("[Modulorails] Error: cannot generate CI configuration: #{e.message}")
53
55
  end
54
56
 
55
57
  private
@@ -106,7 +108,7 @@ class GitlabciGenerator < Rails::Generators::Base
106
108
  when 'postgres', 'postgresql'
107
109
  { header: POSTGRES_DOCKER_DB, host: 'postgres', adapter: 'postgresql' }
108
110
  else
109
- raise 'Unknown database: either mysql or postgres'
111
+ raise "Unknown database adapter `#{database}`: either mysql or postgres"
110
112
  end
111
113
  end
112
114
 
data/lib/modulorails.rb CHANGED
@@ -84,7 +84,7 @@ module Modulorails
84
84
  # went wrong with an `errors` field. We do not want to raise since the gem's user is not
85
85
  # (necessarily) responsible for the error but we still need to display it somewhere to warn
86
86
  # the user something went wrong.
87
- puts("Modulorails errors: #{response['errors'].join(', ')}") if response.code == 400
87
+ puts("[Modulorails] Error: #{response['errors'].join(', ')}") if response.code == 400
88
88
 
89
89
  # Return the response to allow users to do some more
90
90
  response
@@ -23,7 +23,8 @@ module Modulorails
23
23
  # or return nil if the database does not exist
24
24
  db_connection = begin
25
25
  ActiveRecord::Base.connection
26
- rescue ActiveRecord::NoDatabaseError
26
+ rescue ActiveRecord::NoDatabaseError => e
27
+ $stderr.puts("[Modulorails] Error: #{e.message}")
27
28
  nil
28
29
  end
29
30
  # Get the gem's specifications to fetch the versions of critical gems
@@ -1,3 +1,3 @@
1
1
  module Modulorails
2
- VERSION = "0.2.0"
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulorails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Ciappara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-30 00:00:00.000000000 Z
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties