c0_setup 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 002018b1b3177d7f303ad7eb0c35db70f8a23c4d
4
- data.tar.gz: c2204473ddde76fbfdcb805b49ebee003bfcf74a
3
+ metadata.gz: 9194b29571e83db5e180db0266f7f06849f59ddd
4
+ data.tar.gz: d220d752f970500775088eafa41ef046ccd99c68
5
5
  SHA512:
6
- metadata.gz: 153e8f3e9e18b225f28ae3f51c5813a0acf7877e64d3a7c4639e1056888b694a05e2aaa30cc1a096c7b390e7f2a18b543f06a76d401fb16ebad93709bbde0b7a
7
- data.tar.gz: 5ca62af343d469037e340d03eadc2c3d4322cd50ea76d39a7a536c4d6103aba4c02c1670d499c5d38f1a56d38aca2b6f4422e4b1f43c726963cf8a70e8f87d71
6
+ metadata.gz: 43cf2c15b6b671a240f8d976baf127447984e38b3fff7b68447f4183cf589530b5c01af5f257ce90306f36a410d35a7bd2d14ffde13121fbec0676800964f903
7
+ data.tar.gz: 1e5b981f1b056a8b22c6e89a83304549caecef7b45ca05a08e5ac9704eb28c134dc461a9a7cc5b4327ebbfc48fffbf7a38fdc414777d33dc680c3a2aa44c8d66
File without changes
data/cc0_mac ADDED
Binary file
File without changes
Binary file
@@ -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
- FileUtils.cp("./cc0", "#{user}/.c0")
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
- FileUtils.cp("./coin", "#{user}/.c0")
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.1
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
- - cc0
22
- - coin
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: []