eclectica 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/bin/ec +3 -0
  3. data/extconf.rb +28 -0
  4. data/install.sh +56 -0
  5. metadata +49 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 777cc99aea937c7bfd45a7816cd9684a81c17aa2
4
+ data.tar.gz: 7c3882c602f1c6236e5ef10a86e5f626bbc1e20e
5
+ SHA512:
6
+ metadata.gz: 550cabe1c6bb74d4e50d23c1fe7ac69a7a6976c0e4750aa82cfae003c372648ad885b3234751f1b7ec0b3097764c7a16f83fce3f3cea00be4f74a4904fd0c68e
7
+ data.tar.gz: ba10dfedb9546ce84dd247d6d1970066a7b085518e9508644994782227cf2e53fd025458591dd8c904eb013c10aab926801c5347d82913e62af06d5bce47ec20
data/bin/ec ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # dummy
data/extconf.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'mkmf'
2
+ require 'tmpdir'
3
+
4
+ # Since this is an explicit hack
5
+ create_makefile ''
6
+
7
+ bin = Gem.bindir()
8
+ temp = Dir.tmpdir()
9
+
10
+ # Place real binary in tmp path,
11
+ # if we put to bin path immediately, install process will try to use a dummy one
12
+ `EC_DEST=#{temp} EC_VERSION=0.0.1 sh install.sh`
13
+
14
+ # Execute in subprocess so post install would think we are finished
15
+ pid = fork do
16
+
17
+ # Need to do this in order to trick post install that we are done
18
+ $stdin.reopen "/dev/null"
19
+ $stdout.reopen "/dev/null"
20
+ $stderr.reopen "/dev/null"
21
+
22
+ # Replace dummy bin with a real one
23
+ # "sleep" is need to give time for parent process to finish up
24
+ exec("sleep 1 && mv #{temp}/ec #{bin}")
25
+ end
26
+
27
+ # Do it zombie style
28
+ Process.detach(pid)
data/install.sh ADDED
@@ -0,0 +1,56 @@
1
+ #!/bin/sh
2
+
3
+ install () {
4
+
5
+ set -eu
6
+
7
+ UNAME=$(uname)
8
+ if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
9
+ echo "Sorry, OS not supported: ${UNAME}. Download binary from https://github.com/markelog/eclectica/releases"
10
+ exit 1
11
+ fi
12
+
13
+ if [ "$UNAME" = "Darwin" ] ; then
14
+ OSX_ARCH=$(uname -m)
15
+ if [ "${OSX_ARCH}" = "x86_64" ] ; then
16
+ PLATFORM="darwin_amd64"
17
+ else
18
+ echo "Sorry, architecture not supported: ${OSX_ARCH}. Download binary from https://github.com/markelog/eclectica/releases"
19
+ exit 1
20
+ fi
21
+ elif [ "$UNAME" = "Linux" ] ; then
22
+ LINUX_ARCH=$(uname -m)
23
+ if [ "${LINUX_ARCH}" = "x86_64" ] ; then
24
+ PLATFORM="linux_amd64"
25
+ else
26
+ echo "Sorry, architecture not supported: ${LINUX_ARCH}. Download binary from https://github.com/markelog/eclectica/releases"
27
+ exit 1
28
+ fi
29
+ fi
30
+
31
+ if [ -n "${EC_VERSION+set}" ] ; then
32
+ VERSION=v$EC_VERSION
33
+ else
34
+ VERSION=$(curl -s https://api.github.com/repos/markelog/eclectica/tags | grep -Eo '"name":.*?[^\\]",' | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2)
35
+ fi
36
+
37
+ if [ -n "${EC_DEST+set}" ] ; then
38
+ DEST=$EC_DEST
39
+ else
40
+ DEST=/usr/local/bin
41
+ fi
42
+
43
+ DEST="$DEST/ec"
44
+ URL="https://github.com/markelog/eclectica/releases/download/$VERSION/eclectica_$PLATFORM"
45
+
46
+ if [ -z $VERSION ] ; then
47
+ echo "Error requesting. Download binary from https://github.com/markelog/eclectica/releases"
48
+ exit 1
49
+ else
50
+ curl -L https://github.com/markelog/eclectica/releases/download/$VERSION/ec_$PLATFORM -o $DEST
51
+ chmod +x $DEST
52
+ fi
53
+
54
+ }
55
+
56
+ install
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: eclectica
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Oleg Gaidarenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Cool and eclectic version manager for any language (ruby, rust, node.js,
14
+ golang)
15
+ email: markelog@gmail.com
16
+ executables:
17
+ - ec
18
+ extensions:
19
+ - extconf.rb
20
+ extra_rdoc_files: []
21
+ files:
22
+ - bin/ec
23
+ - extconf.rb
24
+ - install.sh
25
+ homepage: https://github.com/markelog/eclectica#readme
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 2.4.5.1
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Cool and eclectic version manager for any language
49
+ test_files: []