eac_launcher 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +12 -0
- data/lib/eac_launcher/context.rb +28 -12
- data/lib/eac_launcher/instances/base.rb +2 -3
- data/lib/eac_launcher/ruby/gem/build.rb +19 -4
- data/lib/eac_launcher/ruby/gem/specification.rb +4 -0
- data/lib/eac_launcher/stereotypes/git_subrepo/warp.rb +1 -0
- data/lib/eac_launcher/stereotypes/ruby_gem/publish.rb +6 -6
- data/lib/eac_launcher/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9fb76da2d6b0eac4f82442cce2b34da22a3da89
|
4
|
+
data.tar.gz: 97646bf8c08b58bd6370bdd3b8df96c088bf15bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a84f54221b8c79f7a64d358f8d86ce667d022f8de5fcfae06b505fb243963891c1d711cff5b0b66d8d1cb36ea27bec736e48fbc76117234efb1acd74a7d72875
|
7
|
+
data.tar.gz: 8c022f63cc330882484d8638921d82c42a61d920068cbd4865319d2b63e346a0fcae8da244aaf390692f2c995ded283a85c8bbbc4bb36b97583a46f9e4ba4daa
|
data/README.rdoc
CHANGED
@@ -1,3 +1,15 @@
|
|
1
1
|
= E.A.C. Launcher
|
2
|
+
{<img src="https://badge.fury.io/rb/eac_launcher.svg" alt="Gem Version" />
|
3
|
+
}[https://badge.fury.io/rb/eac_launcher]
|
4
|
+
{<img src="https://travis-ci.org/eduardobogoni/eac_launcher.svg?branch=master" alt="Build Status" />
|
5
|
+
}[https://travis-ci.org/eduardobogoni/eac_launcher]
|
6
|
+
{<img src="https://api.codeclimate.com/v1/badges/261ff5dcb535b743f468/maintainability" />
|
7
|
+
}[https://codeclimate.com/github/eduardobogoni/eac_launcher/maintainability]
|
8
|
+
{<img src="https://api.codeclimate.com/v1/badges/261ff5dcb535b743f468/test_coverage" />
|
9
|
+
}[https://codeclimate.com/github/eduardobogoni/eac_launcher/test_coverage]
|
10
|
+
{<img src="https://beta.gemnasium.com/badges/github.com/eduardobogoni/eac_launcher.svg"
|
11
|
+
alt="Dependency Status" />}[https://beta.gemnasium.com/projects/github.com/eduardobogoni/eac_launcher]
|
12
|
+
{<img src="http://inch-ci.org/github/eduardobogoni/eac_launcher.svg?branch=master" alt="Inline docs" />
|
13
|
+
}[http://inch-ci.org/github/eduardobogoni/eac_launcher]
|
2
14
|
|
3
15
|
Utilities to deploy applications and libraries.
|
data/lib/eac_launcher/context.rb
CHANGED
@@ -2,35 +2,51 @@ module EacLauncher
|
|
2
2
|
class Context
|
3
3
|
include ::Eac::SimpleCache
|
4
4
|
|
5
|
+
DEFAULT_PROJECTS_ROOT = '.'.freeze
|
6
|
+
DEFAULT_SETTINGS_FILE = ::File.join(ENV['HOME'], '.config', 'eac_launcher', 'settings.yml')
|
7
|
+
DEFAULT_CACHE_ROOT = ::File.join(ENV['HOME'], '.cache', 'eac_launcher')
|
8
|
+
|
5
9
|
class << self
|
10
|
+
attr_writer :current
|
11
|
+
|
6
12
|
def current
|
7
|
-
default
|
13
|
+
@current ||= default
|
8
14
|
end
|
9
15
|
|
10
16
|
def default
|
11
|
-
@default ||= Context.new
|
12
|
-
ENV['EAC_LAUNCHER_PROJECTS_ROOT'] || '.',
|
13
|
-
ENV['EAC_LAUNCHER_SETTINGS_FILE'] ||
|
14
|
-
::File.join(ENV['HOME'], '.config', 'eac_launcher', 'settings.yml')
|
15
|
-
)
|
17
|
+
@default ||= Context.new
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
|
-
attr_reader :root, :settings
|
21
|
+
attr_reader :root, :settings, :cache_root
|
20
22
|
attr_accessor :publish_options
|
21
23
|
|
22
|
-
def initialize(
|
23
|
-
@
|
24
|
-
@
|
24
|
+
def initialize(options = {})
|
25
|
+
@options = options.with_indifferent_access
|
26
|
+
@root = ::EacLauncher::Instances::Base.new(build_option(:projects_root), nil)
|
27
|
+
@settings = ::EacLauncher::Context::Settings.new(build_option(:settings_file))
|
28
|
+
@cache_root = build_option(:cache_root)
|
25
29
|
@publish_options = { new: false, confirm: false, stereotype: nil }
|
26
30
|
end
|
27
31
|
|
28
|
-
def
|
29
|
-
|
32
|
+
def instance(to_root_path)
|
33
|
+
instances.find { |i| i.to_root_path == to_root_path }
|
30
34
|
end
|
31
35
|
|
32
36
|
private
|
33
37
|
|
38
|
+
def build_option(key)
|
39
|
+
@options[key] || env_option(key) || default_option(key)
|
40
|
+
end
|
41
|
+
|
42
|
+
def env_option(key)
|
43
|
+
ENV["EAC_LAUNCHER_#{key}".underscore.upcase]
|
44
|
+
end
|
45
|
+
|
46
|
+
def default_option(key)
|
47
|
+
self.class.const_get("DEFAULT_#{key}".underscore.upcase)
|
48
|
+
end
|
49
|
+
|
34
50
|
def projects_uncached
|
35
51
|
r = {}
|
36
52
|
instances.each do |i|
|
@@ -63,8 +63,7 @@ module EacLauncher
|
|
63
63
|
stereotypes.each do |s|
|
64
64
|
return s.warp_class.new(self) if s.warp_class
|
65
65
|
end
|
66
|
-
|
67
|
-
"subclass \"CurrentCache\" (#{stereotypes.join(', ')})"
|
66
|
+
self
|
68
67
|
end
|
69
68
|
|
70
69
|
private
|
@@ -99,7 +98,7 @@ module EacLauncher
|
|
99
98
|
|
100
99
|
def scan_subdirectories(path)
|
101
100
|
Dir.entries(path).each do |basename|
|
102
|
-
next if
|
101
|
+
next if %w[. ..].include?(basename)
|
103
102
|
sp = path.subpath(basename)
|
104
103
|
next unless File.directory?(sp)
|
105
104
|
yield(sp)
|
@@ -21,11 +21,12 @@ module EacLauncher
|
|
21
21
|
return if builded?
|
22
22
|
copy_gem_files
|
23
23
|
build_gem
|
24
|
-
|
24
|
+
check_gem_empty_size
|
25
|
+
check_gem_version
|
25
26
|
end
|
26
27
|
|
27
28
|
def close
|
28
|
-
::FileUtils.remove_entry(@gem_root) if ::File.directory?(@gem_root)
|
29
|
+
::FileUtils.remove_entry(@gem_root) if @gem_root && ::File.directory?(@gem_root)
|
29
30
|
@gem_root = nil
|
30
31
|
end
|
31
32
|
|
@@ -40,11 +41,19 @@ module EacLauncher
|
|
40
41
|
info("Building gemspec #{gemspec_file}...")
|
41
42
|
clear_gems
|
42
43
|
Dir.chdir @gem_root do
|
43
|
-
|
44
|
+
isolated_build_gem
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
|
-
def
|
48
|
+
def isolated_build_gem
|
49
|
+
old_bundle_gemfile = ENV['BUNDLE_GEMFILE']
|
50
|
+
ENV['BUNDLE_GEMFILE'] = nil
|
51
|
+
EacRubyUtils::Envs.local.command('gem', 'build', gemspec_file).execute!
|
52
|
+
ensure
|
53
|
+
ENV['BUNDLE_GEMFILE'] = old_bundle_gemfile
|
54
|
+
end
|
55
|
+
|
56
|
+
def check_gem_empty_size
|
48
57
|
Dir.mktmpdir do |dir|
|
49
58
|
Dir.chdir dir do
|
50
59
|
EacRubyUtils::Envs.local.command('gem', 'unpack', gem).system
|
@@ -69,6 +78,12 @@ module EacLauncher
|
|
69
78
|
def gem
|
70
79
|
@gem_root.find_file_with_extension('.gem')
|
71
80
|
end
|
81
|
+
|
82
|
+
def check_gem_version
|
83
|
+
spec = ::EacLauncher::Ruby::Gem::Specification.new(gemspec_file)
|
84
|
+
return if ::File.basename(output_file, '.gem') == spec.full_name
|
85
|
+
raise("Builded gem is not the same version of gemspec (#{spec}, #{output_file})")
|
86
|
+
end
|
72
87
|
end
|
73
88
|
end
|
74
89
|
end
|
@@ -39,7 +39,7 @@ module EacLauncher
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def publish
|
42
|
-
gem_build.
|
42
|
+
gem_build.build
|
43
43
|
push_gem
|
44
44
|
ensure
|
45
45
|
gem_build.close
|
@@ -66,12 +66,12 @@ module EacLauncher
|
|
66
66
|
|
67
67
|
def push_gem
|
68
68
|
info("Pushing gem #{gem_spec}...")
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
else
|
73
|
-
warn('Not pushed because not confirmed')
|
69
|
+
command = ['gem', 'push', gem_build.output_file]
|
70
|
+
unless ::EacLauncher::Context.current.publish_options[:confirm]
|
71
|
+
command = %w[echo] + command + %w[(Dry-run)]
|
74
72
|
end
|
73
|
+
EacRubyUtils::Envs.local.command(command).system
|
74
|
+
info('Pushed!')
|
75
75
|
end
|
76
76
|
|
77
77
|
def gemspec_uncached
|
data/lib/eac_launcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_launcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -126,14 +126,14 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 0.
|
129
|
+
version: 0.49.1
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 0.
|
136
|
+
version: 0.49.1
|
137
137
|
description:
|
138
138
|
email:
|
139
139
|
executables:
|