adb-peco 0.1.0 → 2.0.0
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/.gitignore +1 -1
- data/README.md +21 -9
- data/lib/adb/peco.rb +34 -2
- data/lib/adb/peco/version.rb +1 -1
- data/static/command-with-adb-peco.gif +0 -0
- data/static/command-with-adb.gif +0 -0
- metadata +5 -5
- data/static/adbpshell.gif +0 -0
- data/static/adbshell.gif +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20061fdb131ecf29c3dd3affd517af4374018999
|
4
|
+
data.tar.gz: 3b93c7d02fd7da23743f73d8c1afc8574aa03cb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d6a5133f4a9c2998ebc7bc32663e9ae7689c7a27da3db6e4ce1182f30c1bd81e725023c9fecbdc184eed41f944c379fd401cdb329d991ed802e31b085e492d9
|
7
|
+
data.tar.gz: 09d1358e2625f31dfae1e5a672a7a8bcb60ec0be9294ada6325527023774099bc10302141e0c65670637f8ac2e9e70092b6d7f34a42527f7b82c54ccf79a8497
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -3,20 +3,32 @@ adb-peco
|
|
3
3
|
|
4
4
|
adb-peco is a extension for adb.
|
5
5
|
|
6
|
-
When you command `adb shell` on
|
6
|
+
When you command `adb shell` on a terminal with several device and emulator are connected, the terminal said like following.
|
7
7
|
|
8
|
-

|
9
9
|
|
10
|
-
adb-peco make available to choose device
|
10
|
+
adb-peco make available to choose a device before run the command.
|
11
11
|
|
12
|
-

|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
### Peco is available on your environment?
|
17
|
+
|
18
|
+
`adb-peco` require [peco](https://github.com/peco/peco). So install [peco](https://github.com/peco/peco) at first.
|
19
|
+
|
20
|
+
### Installation gem
|
21
|
+
|
22
|
+
```bash
|
23
|
+
gem install adb-peco
|
24
|
+
```
|
25
|
+
|
26
|
+
## Tips
|
27
|
+
|
28
|
+
Replace adb command to use adb-peco always.
|
13
29
|
|
14
|
-
## Quick start
|
15
|
-
`adb-peco` require [peco](https://github.com/peco/peco) so install [peco](https://github.com/peco/peco) at first.
|
16
30
|
```bash
|
17
|
-
|
18
|
-
cd adb-peco/bin
|
19
|
-
adbp shell
|
31
|
+
alias adb='adb-peco'
|
20
32
|
```
|
21
33
|
|
22
34
|
## Lincense
|
data/lib/adb/peco.rb
CHANGED
@@ -4,6 +4,8 @@ require 'peco_selector'
|
|
4
4
|
|
5
5
|
module Adb
|
6
6
|
module Peco
|
7
|
+
AdbUnavailableError = Class.new(StandardError)
|
8
|
+
|
7
9
|
def self.serial_option
|
8
10
|
return nil unless adb_action
|
9
11
|
return nil unless need_serial_option?
|
@@ -15,6 +17,20 @@ module Adb
|
|
15
17
|
["#{device.model} (#{device.serial})", device]
|
16
18
|
}).first
|
17
19
|
"-s #{device.serial}"
|
20
|
+
|
21
|
+
rescue PecoSelector::PecoUnavailableError => e
|
22
|
+
puts e.message
|
23
|
+
exit 1
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.adb_available?
|
27
|
+
system('which', 'adb', out: File::NULL)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.ensure_adb_available
|
31
|
+
unless adb_available?
|
32
|
+
raise AdbUnavailableError, 'adb command is not available.'
|
33
|
+
end
|
18
34
|
end
|
19
35
|
|
20
36
|
def self.adb_action
|
@@ -30,7 +46,23 @@ module Adb
|
|
30
46
|
].include?(adb_action)
|
31
47
|
end
|
32
48
|
|
33
|
-
|
34
|
-
|
49
|
+
def self.quote(args)
|
50
|
+
args.map{|a| a.include?(' ') ? %Q{"#{a}"} : a }
|
51
|
+
end
|
52
|
+
|
53
|
+
begin
|
54
|
+
ensure_adb_available
|
55
|
+
rescue AdbUnavailableError => e
|
56
|
+
puts e.message
|
57
|
+
exit 1
|
58
|
+
end
|
59
|
+
|
60
|
+
command = ['adb', serial_option, quote(ARGV)].flatten.join(' ')
|
61
|
+
begin
|
62
|
+
puts "+ #{command}"
|
63
|
+
system(command)
|
64
|
+
rescue Interrupt
|
65
|
+
# Ignore
|
66
|
+
end
|
35
67
|
end
|
36
68
|
end
|
data/lib/adb/peco/version.rb
CHANGED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adb-peco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomoki Yamashita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: device_api-android
|
@@ -114,8 +114,8 @@ files:
|
|
114
114
|
- exe/adb-peco
|
115
115
|
- lib/adb/peco.rb
|
116
116
|
- lib/adb/peco/version.rb
|
117
|
-
- static/
|
118
|
-
- static/
|
117
|
+
- static/command-with-adb-peco.gif
|
118
|
+
- static/command-with-adb.gif
|
119
119
|
homepage: http://github.com/tomorrowkey/adb-peco
|
120
120
|
licenses:
|
121
121
|
- Apache License 2.0
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
138
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.5.1
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: Run adb command with peco
|
data/static/adbpshell.gif
DELETED
Binary file
|
data/static/adbshell.gif
DELETED
Binary file
|