lono 7.4.2 → 7.4.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5fb2024cd3b5206340c2c55347cda9af53f17fc8e165c0c72d5e03397fee376
4
- data.tar.gz: 588801a14d28f01a374f0e9e906739d4872ad78ae98e760c1d03d0633ed1d435
3
+ metadata.gz: e7a001c358dbf937c901b77fff338512c2052e76882b54c77de5048e5e400c07
4
+ data.tar.gz: 71ab52b2e5af1533524c81e036b412017754db18f59a85da9e9a2b97cf9d14e7
5
5
  SHA512:
6
- metadata.gz: 18d3f263e75e822bbaa8ae3e8a098a2d775fde0ead210082b38b0447f1c1ebaacd23458543f9114f7663efeb0d0616425a61aec16903b3b91bed5df2db01acc9
7
- data.tar.gz: d72a837f16c0cfe93b0331fbad13bd88f3442901bf589357917612f44b35218f0f4a02b35de802a30ed9ed6a3d3bac2488271f00458ea3338ddeb2ffa306ac5d
6
+ metadata.gz: b062a87dc0476db11d5fe02f8866d5da0455549727015eb7d98a50dfe16802ea01ba5b9fa0efa3a2f3dc304a68d89cc6ee9747cf8e33a6e44cfb877ca3036489
7
+ data.tar.gz: 39919280a8d06fdb119018fe4fa173f9ab52ecb8979ff210bfd307c8362146cb446aedeadcdaccf86c6f22b207826b6a3a6a58f8f72098c2abb8de412933f579
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [7.4.3]
7
+ - #61 clean install fixes
8
+ - improve tree detection
9
+ - improve colordiff detection
10
+ - improve AWS setup detection
11
+ - remove bundler install for blueprint, extension, and configsets
12
+
6
13
  ## [7.4.2]
7
14
  - #60 fix edge case when cached materialized Gemfile.lock breaks finder
8
15
 
@@ -1,6 +1,7 @@
1
1
  class Lono::Blueprint
2
2
  class New < Lono::Sequence
3
3
  include Helper
4
+ include Lono::Utils::Generators::Tree
4
5
 
5
6
  argument :blueprint_name
6
7
 
@@ -95,17 +96,6 @@ class Lono::Blueprint
95
96
  FileUtils.cd(self.destination_root)
96
97
  end
97
98
 
98
- def bundle_install
99
- return if options[:from_new] || options[:import]
100
-
101
- return unless options[:bundle]
102
-
103
- puts "=> Installing dependencies with: bundle install"
104
- Bundler.with_unbundled_env do
105
- system("BUNDLE_IGNORE_CONFIG=1 bundle install")
106
- end
107
- end
108
-
109
99
  def welcome_message
110
100
  return if options[:from_new] || options[:import]
111
101
  puts <<~EOL
@@ -122,17 +112,7 @@ class Lono::Blueprint
122
112
  end
123
113
 
124
114
  def tree
125
- return if options[:from_new] || options[:import]
126
-
127
- tree_installed = system("type tree > /dev/null")
128
- return unless tree_installed
129
-
130
- structure = `tree .`
131
- puts <<~EOL
132
- Here is the structure of your blueprint:
133
-
134
- #{structure}
135
- EOL
115
+ tree_structure("blueprint")
136
116
  end
137
117
 
138
118
  # Reason: So `lono code import` prints out the params values with relative paths
@@ -13,7 +13,11 @@ module Lono::Cfn::Preview
13
13
 
14
14
  def diff_viewer
15
15
  return ENV['LONO_DIFF'] if ENV['LONO_DIFF']
16
- system("type colordiff > /dev/null") ? "colordiff" : "diff"
16
+ colordiff_installed = system("type colordiff > /dev/null 2>&1")
17
+ unless colordiff_installed
18
+ puts "INFO: colordiff it not available. Recommend installing it."
19
+ end
20
+ colordiff_installed ? "colordiff" : "diff"
17
21
  end
18
22
  end
19
23
  end
@@ -1,6 +1,7 @@
1
1
  class Lono::Configset
2
2
  class New < Lono::Sequence
3
3
  include Lono::Blueprint::Helper
4
+ include Lono::Utils::Generators::Tree
4
5
 
5
6
  argument :configset_name
6
7
 
@@ -70,15 +71,7 @@ class Lono::Configset
70
71
  end
71
72
 
72
73
  def tree
73
- tree_installed = system("type tree > /dev/null")
74
- return unless tree_installed
75
-
76
- structure = `tree .`
77
- puts <<~EOL
78
- Here is the structure of your configset:
79
-
80
- #{structure}
81
- EOL
74
+ tree_structure("configset")
82
75
  end
83
76
  end
84
77
  end
@@ -2,6 +2,7 @@ class Lono::Extension
2
2
  class New < Lono::Sequence
3
3
  include Lono::Blueprint::Helper # for user_info
4
4
  include Lono::Extension::Helper
5
+ include Lono::Utils::Generators::Tree
5
6
 
6
7
  argument :extension_name
7
8
 
@@ -58,15 +59,7 @@ class Lono::Extension
58
59
  end
59
60
 
60
61
  def tree
61
- tree_installed = system("type tree > /dev/null")
62
- return unless tree_installed
63
-
64
- structure = `tree .`
65
- puts <<~EOL
66
- Here is the structure of your extension:
67
-
68
- #{structure}
69
- EOL
62
+ tree_structure("extension")
70
63
  end
71
64
  end
72
65
  end
@@ -38,7 +38,7 @@ class Lono::Registration
38
38
 
39
39
  More info: https://lono.cloud/docs/register/
40
40
 
41
- Continue temporarily without registration? (y/N)
41
+ Continue without registration? (y/N)
42
42
  EOL
43
43
 
44
44
  answer = $stdin.gets.to_s.strip # nil on CI
@@ -0,0 +1,16 @@
1
+ class Lono::S3
2
+ class AwsSetup
3
+ include Lono::AwsServices
4
+
5
+ def check!
6
+ s3.config.region
7
+ rescue Aws::Errors::MissingRegionError => e
8
+ puts "ERROR: #{e.class}: #{e.message}".color(:red)
9
+ puts <<~EOL
10
+ Unable to detect the AWS_REGION to make AWS API calls. This is might be because the AWS access
11
+ has not been set up yet. Please either your ~/.aws files.
12
+ EOL
13
+ exit 1
14
+ end
15
+ end
16
+ end
@@ -10,6 +10,8 @@ class Lono::S3
10
10
  def name
11
11
  return @@name if @@name # only memoize once bucket has been created
12
12
 
13
+ check_aws_setup!
14
+
13
15
  stack = new.find_stack
14
16
  return unless stack
15
17
 
@@ -17,6 +19,10 @@ class Lono::S3
17
19
  bucket = resp.stack_resources.find { |r| r.logical_resource_id == "Bucket" }
18
20
  @@name = bucket.physical_resource_id # actual bucket name
19
21
  end
22
+
23
+ def check_aws_setup!
24
+ AwsSetup.new.check!
25
+ end
20
26
  end
21
27
 
22
28
  def initialize(options={})
@@ -0,0 +1,18 @@
1
+ module Lono::Utils::Generators
2
+ module Tree
3
+ private
4
+ def tree_structure(name)
5
+ return if options[:from_new] || options[:import] # only for lono new
6
+
7
+ tree_installed = system("type tree > /dev/null 2>&1")
8
+ return unless tree_installed
9
+
10
+ structure = `tree .`
11
+ puts <<~EOL
12
+ Here is the structure of your #{name}:
13
+
14
+ #{structure}
15
+ EOL
16
+ end
17
+ end
18
+ end
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "7.4.2"
2
+ VERSION = "7.4.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.2
4
+ version: 7.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -628,6 +628,7 @@ files:
628
628
  - lib/lono/registration/temp.rb
629
629
  - lib/lono/registration/user.rb
630
630
  - lib/lono/s3.rb
631
+ - lib/lono/s3/aws_setup.rb
631
632
  - lib/lono/s3/bucket.rb
632
633
  - lib/lono/s3/uploader.rb
633
634
  - lib/lono/script.rb
@@ -713,6 +714,7 @@ files:
713
714
  - lib/lono/template/util.rb
714
715
  - lib/lono/upgrade.rb
715
716
  - lib/lono/user_data.rb
717
+ - lib/lono/utils/generators/tree.rb
716
718
  - lib/lono/utils/item/file_methods.rb
717
719
  - lib/lono/utils/item/zip.rb
718
720
  - lib/lono/utils/pretty_time.rb