isaac_toolbelt 0.1.0 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40358e002bf9fe9c20944a4e8c2ec5f1bec045c7
4
- data.tar.gz: 8f57377a2edb23046216096fcc974729fdfad333
3
+ metadata.gz: 4e6bb69e65eea2e2f88827361f2eea151685d55a
4
+ data.tar.gz: c429107dfcbeb6e428a766cd505bee8707c19f4f
5
5
  SHA512:
6
- metadata.gz: ee3a5322e9b329e1bd8634026e5f39d208315b7b2302c346f226fb317c8f2f00ea5f24de3f030c4f3dfeb53888afcd04b8cb03e795daf3520b684ef94465d859
7
- data.tar.gz: 446643e8c4e3fc45bb20070abc0a86cd7ae666175df41617e5060204cb3a530159396b75bf1960475870886cb7d8ce4c0bee0a54490eb629577cec23c3e128a9
6
+ metadata.gz: bb0a9e82c4aa19532b8e6857b9210670b37631392c17a4862eb0f54fa6eff5f5f8b00473541c3b5ceff62a4b903b3c258d66a68eb009a372400e2325666a6001
7
+ data.tar.gz: ba5d61d3f67e203d6a90775f8fc84b217f100befa4939f930e738ec648f3fd7e8770543c5d8ceff47a56f6ce0b2d9fcf52b3e477ddc33dd6b03d5fcc0a493db4
@@ -82,6 +82,7 @@ module IsaacToolbelt
82
82
  ISAAC_CONF_PATH = '/etc/isaac.conf'
83
83
  ISAAC_EDISON_IMAGE_URL='https://s3-ap-northeast-1.amazonaws.com/isaac-os-images/edison/toFlash.tar.bz2'
84
84
 
85
+
85
86
  module Helper
86
87
  def check_file(filename)
87
88
  unless File.exist?(File.join(Dir.pwd, filename))
@@ -99,7 +100,7 @@ module IsaacToolbelt
99
100
  end
100
101
 
101
102
  def mkdir_if_not(destination_path)
102
- on host do
103
+ SSHKit::Coordinator.new(host).each do
103
104
  unless test("[ -d #{destination_path} ]")
104
105
  execute :mkdir, '-p', destination_path
105
106
  end
@@ -107,7 +108,7 @@ module IsaacToolbelt
107
108
  end
108
109
 
109
110
  def upload_string_as_file(string, dst)
110
- on host do
111
+ SSHKit::Coordinator.new(host).each do
111
112
  io = StringIO.new(string)
112
113
  upload! io, dst
113
114
  end
@@ -123,7 +124,7 @@ module IsaacToolbelt
123
124
  end
124
125
 
125
126
  def config_network
126
- on host do
127
+ SSHKit::Coordinator.new(host).each do
127
128
  dns_settings = StringIO.new("nameserver 8.8.8.8\n")
128
129
  upload! dns_settings, '/etc/resolv.conf'
129
130
  execute :ip, *%w(route replace default via 192.168.2.1)
@@ -138,7 +139,7 @@ module IsaacToolbelt
138
139
  end
139
140
 
140
141
  def waitfor_network
141
- on host do
142
+ SSHKit::Coordinator.new(host).each do
142
143
  until test(:ping, *%w(-c 1 8.8.8.8)) do
143
144
  puts 'The board waiting network...'
144
145
  sleep 1
@@ -260,7 +261,7 @@ module IsaacToolbelt
260
261
  waitfor_network
261
262
 
262
263
  # install pip dependencies for isaacd : hacky
263
- on host do
264
+ SSHKit::Coordinator.new(host).each do
264
265
  execute :pip, *%w(install --upgrade pip)
265
266
  execute :pip, *%w(install --upgrade setuptools)
266
267
  execute :rm, *%w(-rf /usr/lib/python2.7/site-packages/distribute*)
@@ -282,7 +283,7 @@ module IsaacToolbelt
282
283
  # init isaacd
283
284
  if options[:access_key]
284
285
  set_conf({'access_key' => options[:access_key]})
285
- on host do
286
+ SSHKit::Coordinator.new(host).each do
286
287
  execute :systemctl, *%w(enable isaacd)
287
288
  end
288
289
  end
@@ -331,7 +332,7 @@ module IsaacToolbelt
331
332
 
332
333
  desc 'mode', 'Set modes whether production mode or development mode.'
333
334
  def mode(state)
334
- on host do
335
+ SSHKit::Coordinator.new(host).each do
335
336
  if state == "development" then
336
337
  execute :systemctl, *%w(stop isaacd)
337
338
  execute :systemctl, *%w(disable isaacd)
@@ -496,7 +497,7 @@ module IsaacToolbelt
496
497
  end
497
498
 
498
499
  def configure_wifi(ssid, wpa_key)
499
- on host do
500
+ SSHKit::Coordinator.new(host).each do
500
501
  execute :wpa_passphrase, ssid, wpa_key, '>>', '/etc/wpa_supplicant/wpa_supplicant.conf'
501
502
  execute :systemctl, *%w(restart wpa_supplicant.service)
502
503
  execute :systemctl, *%w(enable wpa_supplicant.service)
@@ -511,7 +512,7 @@ module IsaacToolbelt
511
512
 
512
513
  def get_conf
513
514
  conf = nil
514
- on host do
515
+ SSHKit::Coordinator.new(host).each do
515
516
  conf = YAML.load(capture(:cat, ISAAC_CONF_PATH))
516
517
  end
517
518
  return conf
@@ -520,7 +521,7 @@ module IsaacToolbelt
520
521
  def set_conf(conf)
521
522
  y = YAML.dump(conf)
522
523
  upload_io = StringIO.new(y)
523
- on host do
524
+ SSHKit::Coordinator.new(host).each do
524
525
  upload! upload_io, ISAAC_CONF_PATH
525
526
  end
526
527
  return nil
@@ -528,7 +529,7 @@ module IsaacToolbelt
528
529
 
529
530
  def get_uname
530
531
  uname = nil
531
- on host do
532
+ SSHKit::Coordinator.new(host).each do
532
533
  uname = capture(:uname, '-a')
533
534
  end
534
535
  return uname
@@ -1,3 +1,3 @@
1
1
  module IsaacToolbelt
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isaac_toolbelt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - xshell inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-11 00:00:00.000000000 Z
11
+ date: 2016-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -174,9 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.4.5.1
177
+ rubygems_version: 2.5.1
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Isaac CLI tool
181
181
  test_files: []
182
- has_rdoc: