micro_install 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 73772e22f8a70c25d0b3c60b72d3cc848c76e25d
4
- data.tar.gz: f92fd421d2b608dcbc5b00a2e2654ba750d3ecd4
2
+ SHA256:
3
+ metadata.gz: 3bdfab0ba1343a04ef459905ab5852809ed1fc587976276cef3dde398b02bf5a
4
+ data.tar.gz: b7d89275371dfa1a727709d54d7b2d25d7f775c9320810a81f8b6df37bf54fdd
5
5
  SHA512:
6
- metadata.gz: 11fd730903fd7a5bc2ea89febb00fa64b35f65a0cad3fcce619f0d2eece4022e008ade2d87dc0ec594717f7b1ec4506a5765d38ad0feaa422fea5322b3d19b5e
7
- data.tar.gz: d642294d099bbce5ff4157e42b974d233f236c63da381787376a0312c2bf02616f7cda1d1b07c620734fa0b1ac5040cec88fb5c2a31a053a7b9248e00c52bf40
6
+ metadata.gz: bf82303873615204f7c3c86cfbbc1e19a8474b3142b97a79636a7209a32cfec5345767efcadab102f28510889b582986e97df2ab15004958bcbf5cc4a59b4a03
7
+ data.tar.gz: b1d4929342663a985dedc97cda643fb63981d5e54ba31a15b142634bffee975f485af88562b69562507ec1666c93493d019f3c117ca4dfd8b8ed10caad2d66cc
data/bin/micro-install CHANGED
@@ -17,7 +17,7 @@ require 'micro_install'
17
17
  # - Micro, of course: https://micro-editor.github.io/
18
18
  # - Loosely based on the Chef curl|bash: https://docs.chef.io/install_omnibus.html
19
19
  # - ASCII art courtesy of figlet: http://www.figlet.org/
20
- hl = HighLine.new($stdin, $stderr)
20
+ hl = HighLine.new($stdin, $stderr)
21
21
  installer = MicroInstall::Installer.new
22
22
  installer.latesttag
23
23
  installer.get_arch
@@ -26,18 +26,17 @@ installer.download_micro_tar
26
26
  installer.extract_micro
27
27
  installer.install_micro
28
28
 
29
- puts <<-EOM
30
- Micro has been installed to your ~/.local/bin/ directory. You can run it with:
31
- 'micro'
32
- EOM
33
- paths = []
29
+ paths = []
34
30
  path_env = ENV['PATH'].split(':').each do |path|
35
31
  paths << path if path.include? 'bin'
36
32
  end
37
33
  if paths.include? Pathname(Dir.home).join('.local/bin').to_path
38
34
  hl.say "Environment Variable 'PATH' already includes #{Dir.home}/.local/bin"
39
35
  hl.say Paint["You're all set!", 'green']
36
+ installer.is_installed
40
37
  else
41
38
  hl.say "#{Paint['Warning', 'orange']}: #{Dir.home}/.local/bin is not in $PATH,"
42
- hl.say "Either add '#{Dir.home}/.local/bin' to the PATH variable, or give the full path to the executable"
39
+ installer.is_installed_but_no_bin
43
40
  end
41
+
42
+
data/lib/micro_install.rb CHANGED
@@ -39,7 +39,7 @@ module MicroInstall
39
39
  @arch = 'linux32'
40
40
  end
41
41
  when "linux-arm"
42
- raise self.LookupError 'ARM (mobile devices) are not supported'
42
+ raise self.LookupError.new 'ARM (mobile devices) are not supported'
43
43
  when "darwin"
44
44
  @arch = 'osx'
45
45
  when "freebsd"
@@ -61,7 +61,7 @@ module MicroInstall
61
61
  @arch = 'netbsd32'
62
62
  end
63
63
  else
64
- raise self.LookupError 'unable to determine your system'
64
+ raise self.LookupError.new 'unable to determine your system'
65
65
  end
66
66
  rescue MicroInstall::LookupError => e
67
67
  hl.say "#{Paint['Error', 'red']}: #{e}"
@@ -146,5 +146,18 @@ module MicroInstall
146
146
  hl.say "#{Paint['Error', 'red']}: #{e}"
147
147
  end
148
148
  end
149
+ def is_installed(hl = @hl)
150
+ hl.say [
151
+ "Micro has been installed to your ~/.local/bin/ directory. You can run it with:",
152
+ "'micro'"
153
+ ].join
154
+ end
155
+ def is_installed_but_no_bin(hl = @hl)
156
+ hl.say [
157
+ "Micro is installed to ~/.local/bin/, but can't run,",
158
+ "Please check your ~/.bashrc and/or ~/.profile and see",
159
+ "if '~/.local/bin/' is being added to the PATH variable"
160
+ ]
161
+ end
149
162
  end
150
163
  end
@@ -1,3 +1,3 @@
1
1
  module MicroInstall
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -53,6 +53,7 @@ Gem::Specification.new do |spec|
53
53
  spec.add_runtime_dependency 'unirest', '~> 1.1'
54
54
  spec.add_development_dependency 'bundler', '~> 1.16'
55
55
  spec.add_development_dependency 'pry', '~> 0.11'
56
+ spec.add_development_dependency 'rake', '~> 10.5'
56
57
 
57
58
  spec.post_install_message = <<-POSTINSTALL
58
59
  Thanks for installing micro_install!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_install
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.11'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '10.5'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '10.5'
111
125
  description: |2
112
126
  micro_install is a gem that installs a removable script
113
127
  that lets you install 'micro' a terminal text editor,
@@ -127,9 +141,7 @@ files:
127
141
  - LICENSE.txt
128
142
  - README.md
129
143
  - Rakefile
130
- - bin/console
131
144
  - bin/micro-install
132
- - bin/setup
133
145
  - lib/micro_install.rb
134
146
  - lib/micro_install/spinner.rb
135
147
  - lib/micro_install/version.rb
@@ -159,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
171
  version: '0'
160
172
  requirements: []
161
173
  rubyforge_project:
162
- rubygems_version: 2.5.2.1
174
+ rubygems_version: 2.7.6
163
175
  signing_key:
164
176
  specification_version: 4
165
177
  summary: A quick gem to install a script for installing micro, used by https://github.com/IotaSpencer/mkmatter
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "micro_install"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- require "pry"
11
- Pry.start
12
-
13
- #require "irb"
14
- #IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here