c0_setup 0.0.1 → 0.0.2
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 +4 -4
- data/{cc0 → cc0_linux} +0 -0
- data/cc0_mac +0 -0
- data/{coin → coin_linux} +0 -0
- data/coin_mac +0 -0
- data/lib/c0_setup.rb +23 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9194b29571e83db5e180db0266f7f06849f59ddd
|
4
|
+
data.tar.gz: d220d752f970500775088eafa41ef046ccd99c68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43cf2c15b6b671a240f8d976baf127447984e38b3fff7b68447f4183cf589530b5c01af5f257ce90306f36a410d35a7bd2d14ffde13121fbec0676800964f903
|
7
|
+
data.tar.gz: 1e5b981f1b056a8b22c6e89a83304549caecef7b45ca05a08e5ac9704eb28c134dc461a9a7cc5b4327ebbfc48fffbf7a38fdc414777d33dc680c3a2aa44c8d66
|
data/{cc0 → cc0_linux}
RENAMED
File without changes
|
data/cc0_mac
ADDED
Binary file
|
data/{coin → coin_linux}
RENAMED
File without changes
|
data/coin_mac
ADDED
Binary file
|
data/lib/c0_setup.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# should work on unix/bsd (linux/mac)
|
3
3
|
|
4
4
|
require 'fileutils'
|
5
|
+
require 'rbconfig'
|
5
6
|
|
6
7
|
class C0Setup
|
7
8
|
|
@@ -75,7 +76,11 @@ class C0Setup
|
|
75
76
|
# copy the cc0 binary to "~/.c0"
|
76
77
|
user = File.expand_path("~")
|
77
78
|
Dir.chdir(File.dirname __dir__) do
|
78
|
-
|
79
|
+
if get_os == "darwin"
|
80
|
+
FileUtils.cp("./cc0_mac", "#{user}/.c0/cc0")
|
81
|
+
elsif get_os == "linux"
|
82
|
+
FileUtils.cp("./cc0_linux", "#{user}/.c0/cc0")
|
83
|
+
end
|
79
84
|
end
|
80
85
|
return File.exist?("#{user}/.c0/cc0")
|
81
86
|
end
|
@@ -84,7 +89,11 @@ class C0Setup
|
|
84
89
|
# copy the coin binary to "~/.c0"
|
85
90
|
user = File.expand_path("~")
|
86
91
|
Dir.chdir(File.dirname __dir__) do
|
87
|
-
|
92
|
+
if get_os == "darwin"
|
93
|
+
FileUtils.cp("./coin_mac", "#{user}/.c0/coin")
|
94
|
+
elsif get_os == "linux"
|
95
|
+
FileUtils.cp("./coin_linux", "#{user}/.c0/coin")
|
96
|
+
end
|
88
97
|
end
|
89
98
|
return File.exist?("#{user}/.c0/coin")
|
90
99
|
end
|
@@ -101,5 +110,17 @@ class C0Setup
|
|
101
110
|
return nil
|
102
111
|
end
|
103
112
|
|
113
|
+
|
114
|
+
def get_os
|
115
|
+
result = ""
|
116
|
+
os = RbConfig::CONFIG['host_os']
|
117
|
+
if os.downcase.include?('linux')
|
118
|
+
result = 'linux'
|
119
|
+
elsif os.downcase.include?('darwin')
|
120
|
+
result = 'darwin'
|
121
|
+
end
|
122
|
+
return result
|
123
|
+
end
|
124
|
+
|
104
125
|
end
|
105
126
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c0_setup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brigden
|
@@ -18,8 +18,10 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- bin/c0_setup
|
21
|
-
-
|
22
|
-
-
|
21
|
+
- cc0_linux
|
22
|
+
- cc0_mac
|
23
|
+
- coin_linux
|
24
|
+
- coin_mac
|
23
25
|
- lib/c0_setup.rb
|
24
26
|
homepage: https://github.com/rbrigden
|
25
27
|
licenses: []
|