socotra-build 0.0.10 → 0.1.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/socotra-build.rb +1 -19
  3. data/lib/update.rb +21 -0
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5800ed96b06fdab5e0be836599fb5df2db61cad1
4
- data.tar.gz: b88b791099a4b0dbfd62679b51d1051712f75f8a
3
+ metadata.gz: e5862c2b702a2b16ea0ceebebd7b3233229015b9
4
+ data.tar.gz: 5e6e066a348b0937699049e46b50420714dd4bfc
5
5
  SHA512:
6
- metadata.gz: 70fe1dbb9435569e2d5b9f1d5cc0b434ef2ed0db974d82bc6b30a4f31e8d61591ca0aea349a72455eb31b6f88dd47f6620e79421876a3a0f114f177d101a7aa2
7
- data.tar.gz: 7ca31f1c3a34c05c40ecb05e2f20b74bf8972f7d0ca6151b3f9dd66b5af55f7fb9d8c66ec35224969037ba2efe45c2dd93a678ac7cc127d8f9e7d3a4eb02ab4f
6
+ metadata.gz: 3daedf43c6253403e1e9c0a82c6f03afaad5022881da6281a9f96ea543fc043525871057c04bf380b34220907bdf72be5f40ea17f19085cec5a24f3979640386
7
+ data.tar.gz: b98815816cbd993b3890fa657b88491a485c0c7415c47ffac8df770e6606c253cf33b51ac4b98bc95bc874102c6955b9f2a6c745ab20d3c29ed084ca0bce49be
data/lib/socotra-build.rb CHANGED
@@ -1,23 +1,5 @@
1
1
  require 'open3'
2
2
 
3
- BEGIN {
4
- version_to_install = ENV["SOCOTRA_BUILD_VERSION"]
5
- output = `gem list |grep socotra-build`
6
- version_installed = output.split('(')[1].split()[0].split(',')[0]
7
-
8
- puts "version_to_install: #{version_to_install}"
9
- puts "version_installed: #{version_installed}"
10
-
11
- if not version_to_install.nil? and (version_installed != version_to_install)
12
- output = `gem install socotra-build -v #{version_to_install}`
13
- installed_socotra_build = `gem contents socotra-build`
14
- load installed_socotra_build
15
- reload!
16
- else
17
- puts "Not upgrading socotra-build"
18
- end
19
- }
20
-
21
3
  def self.safe_retry(cmd, description, error_message="command failed", raise_on_fail=true, tries=3)
22
4
  begin
23
5
  status, output = system_safe(cmd, description, error_message, raise_on_fail=raise_on_fail, log_level="WARNING")
@@ -57,7 +39,7 @@ def self.system_safe(cmd, cmd_description, error_message, raise_on_fail=true, lo
57
39
  return [status.success?, stdout]
58
40
  end
59
41
 
60
- def self.system_yars()
42
+ def self.system_yarss()
61
43
  puts "this shit is so safe"
62
44
  end
63
45
 
data/lib/update.rb ADDED
@@ -0,0 +1,21 @@
1
+ BEGIN {
2
+ version_to_install = ENV["SOCOTRA_BUILD_VERSION"]
3
+ output = `gem list |grep socotra-build`
4
+ version_installed = output.split('(')[1].split()[0].split(',')[0]
5
+
6
+ puts "version_to_install: #{version_to_install}"
7
+ puts "version_installed: #{version_installed}"
8
+
9
+ if version_installed != version_to_install
10
+ system('gem install socotra-build -v #{version_to_install}')
11
+ files_in_module = `gem contents socotra-build`.split
12
+ files_in_module.each do |file|
13
+ unless file.include? "update.rb"
14
+ load file
15
+ reload!
16
+ end
17
+ end
18
+ else
19
+ puts "Not upgrading socotra-build"
20
+ end
21
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socotra-build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Antenesse
@@ -17,6 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/socotra-build.rb
20
+ - lib/update.rb
20
21
  homepage: http://rubygems.org/gems/socotra
21
22
  licenses:
22
23
  - MIT