shortlook 0.1.4 → 0.1.5
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/.rubocop.yml +4 -39
- data/Gemfile.lock +38 -54
- data/README.md +1 -1
- data/Rakefile +0 -5
- data/lib/shortlook/cli.rb +8 -35
- data/lib/shortlook/command.rb +1 -13
- data/lib/shortlook/commands/provider.rb +21 -50
- data/lib/shortlook/config.rb +34 -0
- data/lib/shortlook/provider_helpers.rb +33 -0
- data/lib/shortlook/services/app_store.rb +23 -0
- data/lib/shortlook/types.rb +14 -0
- data/lib/shortlook/version.rb +1 -1
- data/shortlook.gemspec +4 -4
- metadata +17 -34
- data/.rspec +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d34939d08e248583825eb0913f975ffa0e76a86810680fc5b96d633cc22963b
|
|
4
|
+
data.tar.gz: 91be8b30834987830ed031242b990eaf9f535e6eceb0c059cd93483fd74017fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e49eed7c0c95db152de38fa17312bd0bd544ee4f68d522811e35e1391c9615d4eec95009b73ace3e1a267302000113f27ead5362b60f081a3b44ac22435e6120
|
|
7
|
+
data.tar.gz: aaf78332d70b1ad1768bce2575f6c68a7112b839e11d7eab0dca44ee87a5cf624c7466bcacfed88a1c8e76214b6852e47227c9c2b91c2a2ab80818fd4828cc80
|
data/.rubocop.yml
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
+
NewCops: enable
|
|
3
|
+
SuggestExtensions: false
|
|
2
4
|
Exclude:
|
|
3
5
|
- bin/*
|
|
4
|
-
- spec/**/*
|
|
5
6
|
|
|
6
7
|
Metrics/AbcSize:
|
|
7
8
|
Max: 45
|
|
@@ -24,47 +25,11 @@ Metrics/PerceivedComplexity:
|
|
|
24
25
|
Layout/LineLength:
|
|
25
26
|
Max: 200
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
Enabled:
|
|
29
|
-
|
|
30
|
-
Layout/SpaceAroundMethodCallOperator:
|
|
31
|
-
Enabled: true
|
|
32
|
-
|
|
33
|
-
Lint/RaiseException:
|
|
34
|
-
Enabled: true
|
|
35
|
-
|
|
36
|
-
Lint/StructNewOverride:
|
|
37
|
-
Enabled: true
|
|
38
|
-
|
|
39
|
-
Lint/DeprecatedOpenSSLConstant:
|
|
40
|
-
Enabled: true
|
|
41
|
-
|
|
42
|
-
Lint/MixedRegexpCaptureTypes:
|
|
43
|
-
Enabled: true
|
|
28
|
+
Lint/MissingSuper:
|
|
29
|
+
Enabled: false
|
|
44
30
|
|
|
45
31
|
Style/Documentation:
|
|
46
32
|
Enabled: false
|
|
47
33
|
|
|
48
|
-
Style/HashEachMethods:
|
|
49
|
-
Enabled: true
|
|
50
|
-
|
|
51
|
-
Style/HashTransformKeys:
|
|
52
|
-
Enabled: true
|
|
53
|
-
|
|
54
|
-
Style/HashTransformValues:
|
|
55
|
-
Enabled: true
|
|
56
|
-
|
|
57
|
-
Style/ExponentialNotation:
|
|
58
|
-
Enabled: true
|
|
59
|
-
|
|
60
|
-
Style/SlicingWithRange:
|
|
61
|
-
Enabled: true
|
|
62
|
-
|
|
63
34
|
Style/SymbolArray:
|
|
64
35
|
Enabled: false
|
|
65
|
-
|
|
66
|
-
Style/RedundantRegexpCharacterClass:
|
|
67
|
-
Enabled: true
|
|
68
|
-
|
|
69
|
-
Style/RedundantRegexpEscape:
|
|
70
|
-
Enabled: true
|
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
shortlook (0.1.
|
|
5
|
-
lhc (>=
|
|
4
|
+
shortlook (0.1.5)
|
|
5
|
+
lhc (>= 13.0)
|
|
6
6
|
pastel (~> 0.7.2)
|
|
7
|
-
thor (>= 0.20, < 1.
|
|
7
|
+
thor (>= 0.20, < 1.2)
|
|
8
8
|
tty-command (>= 0.8, < 0.10)
|
|
9
9
|
tty-config (>= 0.3, < 0.5)
|
|
10
10
|
tty-prompt (>= 0.18, < 0.22)
|
|
@@ -13,68 +13,53 @@ PATH
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://rubygems.org/
|
|
15
15
|
specs:
|
|
16
|
-
activesupport (6.
|
|
16
|
+
activesupport (6.1.1)
|
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
|
-
i18n (>=
|
|
19
|
-
minitest (
|
|
20
|
-
tzinfo (~>
|
|
21
|
-
zeitwerk (~> 2.
|
|
18
|
+
i18n (>= 1.6, < 2)
|
|
19
|
+
minitest (>= 5.1)
|
|
20
|
+
tzinfo (~> 2.0)
|
|
21
|
+
zeitwerk (~> 2.3)
|
|
22
22
|
addressable (2.7.0)
|
|
23
23
|
public_suffix (>= 2.0.2, < 5.0)
|
|
24
|
-
ast (2.4.
|
|
25
|
-
concurrent-ruby (1.1.
|
|
26
|
-
diff-lcs (1.3)
|
|
24
|
+
ast (2.4.2)
|
|
25
|
+
concurrent-ruby (1.1.8)
|
|
27
26
|
equatable (0.6.1)
|
|
28
27
|
ethon (0.12.0)
|
|
29
28
|
ffi (>= 1.3.0)
|
|
30
|
-
ffi (1.
|
|
31
|
-
i18n (1.8.
|
|
29
|
+
ffi (1.14.2)
|
|
30
|
+
i18n (1.8.7)
|
|
32
31
|
concurrent-ruby (~> 1.0)
|
|
33
|
-
lhc (
|
|
34
|
-
activesupport (>=
|
|
32
|
+
lhc (13.1.0)
|
|
33
|
+
activesupport (>= 5.2)
|
|
35
34
|
addressable
|
|
36
35
|
typhoeus (>= 0.11)
|
|
37
|
-
minitest (5.14.
|
|
36
|
+
minitest (5.14.3)
|
|
38
37
|
necromancer (0.5.1)
|
|
39
|
-
parallel (1.
|
|
40
|
-
parser (
|
|
41
|
-
ast (~> 2.4.
|
|
38
|
+
parallel (1.20.1)
|
|
39
|
+
parser (3.0.0.0)
|
|
40
|
+
ast (~> 2.4.1)
|
|
42
41
|
pastel (0.7.4)
|
|
43
42
|
equatable (~> 0.6)
|
|
44
43
|
tty-color (~> 0.5)
|
|
45
|
-
public_suffix (4.0.
|
|
44
|
+
public_suffix (4.0.6)
|
|
46
45
|
rainbow (3.0.0)
|
|
47
|
-
rake (13.0.
|
|
48
|
-
regexp_parser (
|
|
46
|
+
rake (13.0.3)
|
|
47
|
+
regexp_parser (2.0.3)
|
|
49
48
|
rexml (3.2.4)
|
|
50
|
-
|
|
51
|
-
rspec-core (~> 3.9.0)
|
|
52
|
-
rspec-expectations (~> 3.9.0)
|
|
53
|
-
rspec-mocks (~> 3.9.0)
|
|
54
|
-
rspec-core (3.9.0)
|
|
55
|
-
rspec-support (~> 3.9.0)
|
|
56
|
-
rspec-expectations (3.9.0)
|
|
57
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
58
|
-
rspec-support (~> 3.9.0)
|
|
59
|
-
rspec-mocks (3.9.0)
|
|
60
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
61
|
-
rspec-support (~> 3.9.0)
|
|
62
|
-
rspec-support (3.9.0)
|
|
63
|
-
rubocop (0.85.0)
|
|
49
|
+
rubocop (1.9.1)
|
|
64
50
|
parallel (~> 1.10)
|
|
65
|
-
parser (>=
|
|
51
|
+
parser (>= 3.0.0.0)
|
|
66
52
|
rainbow (>= 2.2.2, < 4.0)
|
|
67
|
-
regexp_parser (>= 1.
|
|
53
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
68
54
|
rexml
|
|
69
|
-
rubocop-ast (>= 0.0
|
|
55
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
|
70
56
|
ruby-progressbar (~> 1.7)
|
|
71
|
-
unicode-display_width (>= 1.4.0, <
|
|
72
|
-
rubocop-ast (
|
|
73
|
-
parser (>= 2.7.
|
|
74
|
-
ruby-progressbar (1.
|
|
75
|
-
thor (1.0
|
|
76
|
-
|
|
77
|
-
tty-color (0.5.1)
|
|
57
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
58
|
+
rubocop-ast (1.4.1)
|
|
59
|
+
parser (>= 2.7.1.5)
|
|
60
|
+
ruby-progressbar (1.11.0)
|
|
61
|
+
thor (1.1.0)
|
|
62
|
+
tty-color (0.6.0)
|
|
78
63
|
tty-command (0.9.0)
|
|
79
64
|
pastel (~> 0.7.0)
|
|
80
65
|
tty-config (0.4.0)
|
|
@@ -87,16 +72,16 @@ GEM
|
|
|
87
72
|
tty-cursor (~> 0.7)
|
|
88
73
|
tty-screen (~> 0.7)
|
|
89
74
|
wisper (~> 2.0.0)
|
|
90
|
-
tty-screen (0.
|
|
75
|
+
tty-screen (0.8.1)
|
|
91
76
|
tty-spinner (0.9.3)
|
|
92
77
|
tty-cursor (~> 0.7)
|
|
93
|
-
typhoeus (1.
|
|
78
|
+
typhoeus (1.4.0)
|
|
94
79
|
ethon (>= 0.9.0)
|
|
95
|
-
tzinfo (
|
|
96
|
-
|
|
97
|
-
unicode-display_width (
|
|
80
|
+
tzinfo (2.0.4)
|
|
81
|
+
concurrent-ruby (~> 1.0)
|
|
82
|
+
unicode-display_width (2.0.0)
|
|
98
83
|
wisper (2.0.1)
|
|
99
|
-
zeitwerk (2.
|
|
84
|
+
zeitwerk (2.4.2)
|
|
100
85
|
|
|
101
86
|
PLATFORMS
|
|
102
87
|
ruby
|
|
@@ -104,8 +89,7 @@ PLATFORMS
|
|
|
104
89
|
DEPENDENCIES
|
|
105
90
|
bundler (~> 2.0)
|
|
106
91
|
rake (~> 13.0)
|
|
107
|
-
|
|
108
|
-
rubocop (~> 0.85.0)
|
|
92
|
+
rubocop (~> 1.9.1)
|
|
109
93
|
shortlook!
|
|
110
94
|
|
|
111
95
|
BUNDLED WITH
|
data/README.md
CHANGED
|
@@ -73,7 +73,7 @@ create ShortLook-WhatsAppMessenger/control
|
|
|
73
73
|
|
|
74
74
|
## Development
|
|
75
75
|
|
|
76
|
-
After checking out the repo, run `bin/setup` to install dependencies.
|
|
76
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
77
77
|
|
|
78
78
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
79
79
|
|
data/Rakefile
CHANGED
data/lib/shortlook/cli.rb
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'thor'
|
|
4
|
+
require_relative 'provider_helpers'
|
|
4
5
|
|
|
5
6
|
module Shortlook
|
|
6
7
|
class CLI < Thor
|
|
7
8
|
include Thor::Actions
|
|
8
9
|
|
|
9
|
-
Error = Class.new(StandardError)
|
|
10
|
-
|
|
11
|
-
desc 'version', 'shortlook version'
|
|
12
|
-
def version
|
|
13
|
-
require_relative 'version'
|
|
14
|
-
puts "v#{Shortlook::VERSION}"
|
|
15
|
-
end
|
|
16
|
-
map %w[--version -v] => :version
|
|
17
|
-
|
|
18
10
|
def self.source_root
|
|
19
11
|
File.dirname(__FILE__)
|
|
20
12
|
end
|
|
@@ -24,34 +16,15 @@ module Shortlook
|
|
|
24
16
|
end
|
|
25
17
|
|
|
26
18
|
no_commands do
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def bundle_id
|
|
32
|
-
@config[:bundle_id]
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def provider_bundle_id
|
|
36
|
-
@config[:provider_bundle_id]
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def name
|
|
40
|
-
@config[:name]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def type
|
|
44
|
-
@config[:type]
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def author
|
|
48
|
-
@config[:author]
|
|
49
|
-
end
|
|
19
|
+
include ProviderHelpers
|
|
20
|
+
end
|
|
50
21
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
22
|
+
desc 'version', 'shortlook version'
|
|
23
|
+
def version
|
|
24
|
+
require_relative 'version'
|
|
25
|
+
puts "v#{Shortlook::VERSION}"
|
|
54
26
|
end
|
|
27
|
+
map %w[--version -v] => :version
|
|
55
28
|
|
|
56
29
|
desc 'provider NAME', 'Generate a scaffold ShortLook Provider'
|
|
57
30
|
def provider(name)
|
data/lib/shortlook/command.rb
CHANGED
|
@@ -5,24 +5,12 @@ require 'forwardable'
|
|
|
5
5
|
module Shortlook
|
|
6
6
|
class Command
|
|
7
7
|
extend Forwardable
|
|
8
|
-
|
|
9
8
|
def_delegators :command, :run
|
|
10
9
|
|
|
11
|
-
# Execute this command
|
|
12
|
-
#
|
|
13
|
-
# @api public
|
|
14
10
|
def execute(*)
|
|
15
|
-
raise(
|
|
16
|
-
NotImplementedError,
|
|
17
|
-
"#{self.class}##{__method__} must be implemented"
|
|
18
|
-
)
|
|
11
|
+
raise(NotImplementedError, "#{self.class}##{__method__} must be implemented")
|
|
19
12
|
end
|
|
20
13
|
|
|
21
|
-
# The interactive prompt
|
|
22
|
-
#
|
|
23
|
-
# @see http://www.rubydoc.info/gems/tty-prompt
|
|
24
|
-
#
|
|
25
|
-
# @api public
|
|
26
14
|
def prompt(**options)
|
|
27
15
|
require 'tty-prompt'
|
|
28
16
|
TTY::Prompt.new(options)
|
|
@@ -1,84 +1,55 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'lhc'
|
|
4
|
-
require 'json'
|
|
5
3
|
require 'thor'
|
|
6
|
-
|
|
7
4
|
require 'tty-spinner'
|
|
8
|
-
require 'tty-config'
|
|
9
5
|
|
|
10
6
|
require_relative '../command'
|
|
7
|
+
require_relative '../types'
|
|
8
|
+
require_relative '../config'
|
|
9
|
+
require_relative '../services/app_store'
|
|
11
10
|
|
|
12
11
|
module Shortlook
|
|
13
12
|
module Commands
|
|
14
13
|
class Provider < Shortlook::Command
|
|
15
14
|
include Thor::Actions
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{ name: 'Photo', value: { name: 'Photo', display: 'Photos', key: 'photos' } },
|
|
21
|
-
{ name: 'Cover', value: { name: 'Cover', display: 'Covers', key: 'covers' } }
|
|
22
|
-
].freeze
|
|
16
|
+
def config
|
|
17
|
+
@config ||= Config.new
|
|
18
|
+
end
|
|
23
19
|
|
|
24
20
|
def initialize(name)
|
|
25
|
-
|
|
26
|
-
@config = TTY::Config.new
|
|
27
|
-
@config.append_path(Dir.home)
|
|
28
|
-
|
|
29
|
-
begin
|
|
30
|
-
@config.read("#{Dir.home}/.shortlook.yml")
|
|
31
|
-
@author = @config.fetch(:author)
|
|
32
|
-
@bundle_prefix = @config.fetch(:bundle_prefix)
|
|
33
|
-
rescue TTY::Config::ReadError
|
|
34
|
-
@config.filename = '.shortlook'
|
|
35
|
-
@author = ENV['USER']
|
|
36
|
-
@bundle_prefix = 'ch.marcoroth'
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
spinner = TTY::Spinner.new(":spinner Fetching Apps for '#{@name}'", format: :bouncing_ball)
|
|
21
|
+
spinner = TTY::Spinner.new(":spinner Fetching Apps for '#{name}'", format: :bouncing_ball)
|
|
40
22
|
spinner.auto_spin
|
|
41
|
-
|
|
42
|
-
url = "https://itunes.apple.com/search?limit=10&media=software&term=#{@name}"
|
|
43
|
-
results = JSON.parse(LHC.get(url).body)['results']
|
|
44
|
-
@choices = results.map { |r| { name: "#{r['trackName']} (#{r['bundleId']})", value: r } }
|
|
23
|
+
@choices = Services::AppStore.search(name)
|
|
45
24
|
spinner.stop
|
|
46
25
|
end
|
|
47
26
|
|
|
48
27
|
def execute(*)
|
|
49
28
|
selected = prompt.select('Select the App you want to create a Provider for:', @choices)
|
|
50
|
-
full_name = prompt.ask(
|
|
51
|
-
type = prompt.select('Select the type of the provider:',
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
full_name = prompt.ask("What's the name of your provider:", default: selected['trackName'])
|
|
30
|
+
type = prompt.select('Select the type of the provider:', Types.all)
|
|
31
|
+
author = prompt.ask("What's your name?", default: config.fetch(:author))
|
|
32
|
+
bundle_prefix = prompt.ask("What's your bundle identifier prefix:", default: config.fetch(:bundle_prefix))
|
|
54
33
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class_name = "#{name}#{type[:name]}Provider"
|
|
59
|
-
provider_bundle_id = "#{@bundle_prefix}.shortlook.plugin.#{type[:key]}.#{name.downcase}"
|
|
34
|
+
config.set(:author, value: author)
|
|
35
|
+
config.set(:bundle_prefix, value: bundle_prefix)
|
|
36
|
+
config.save!
|
|
60
37
|
|
|
61
|
-
|
|
38
|
+
name = full_name.gsub(' ', '')
|
|
62
39
|
|
|
63
40
|
{
|
|
64
41
|
name: full_name,
|
|
65
|
-
provider_name:
|
|
66
|
-
class_name:
|
|
67
|
-
author:
|
|
42
|
+
provider_name: "ShortLook-#{name}",
|
|
43
|
+
class_name: "#{name}#{type[:name]}Provider",
|
|
44
|
+
author: author,
|
|
68
45
|
type: type,
|
|
69
|
-
bundle_id:
|
|
70
|
-
provider_bundle_id:
|
|
46
|
+
bundle_id: selected['bundleId'],
|
|
47
|
+
provider_bundle_id: "#{bundle_prefix}.shortlook.plugin.#{type[:key]}.#{name.downcase}"
|
|
71
48
|
}
|
|
72
49
|
rescue TTY::Reader::InputInterrupt
|
|
73
50
|
puts "\nAborting..."
|
|
74
51
|
exit(0)
|
|
75
52
|
end
|
|
76
|
-
|
|
77
|
-
def save_config
|
|
78
|
-
@config.set(:author, value: @author)
|
|
79
|
-
@config.set(:bundle_prefix, value: @bundle_prefix)
|
|
80
|
-
@config.write(force: true)
|
|
81
|
-
end
|
|
82
53
|
end
|
|
83
54
|
end
|
|
84
55
|
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
CONFIG_PATH = "#{Dir.home}/.shortlook.yml"
|
|
4
|
+
|
|
5
|
+
require 'forwardable'
|
|
6
|
+
require 'tty-config'
|
|
7
|
+
|
|
8
|
+
module Shortlook
|
|
9
|
+
class Config
|
|
10
|
+
extend Forwardable
|
|
11
|
+
|
|
12
|
+
def_delegators :@config, :fetch, :set
|
|
13
|
+
|
|
14
|
+
def initialize
|
|
15
|
+
config.append_path(Dir.home)
|
|
16
|
+
|
|
17
|
+
begin
|
|
18
|
+
config.read("#{Dir.home}/.shortlook.yml")
|
|
19
|
+
rescue TTY::Config::ReadError
|
|
20
|
+
config.filename = '.shortlook'
|
|
21
|
+
config.set(:author, value: ENV['USER'])
|
|
22
|
+
config.set(:bundle_prefix, value: 'ch.marcoroth')
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def config
|
|
27
|
+
@config ||= TTY::Config.new
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def save!
|
|
31
|
+
config.write(force: true)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Shortlook
|
|
4
|
+
module ProviderHelpers
|
|
5
|
+
def class_name
|
|
6
|
+
@config[:class_name]
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def bundle_id
|
|
10
|
+
@config[:bundle_id]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def provider_bundle_id
|
|
14
|
+
@config[:provider_bundle_id]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def name
|
|
18
|
+
@config[:name]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def type
|
|
22
|
+
@config[:type]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def author
|
|
26
|
+
@config[:author]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def provider_name
|
|
30
|
+
@config[:provider_name]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'lhc'
|
|
4
|
+
require 'json'
|
|
5
|
+
|
|
6
|
+
module Shortlook
|
|
7
|
+
module Services
|
|
8
|
+
class AppStore
|
|
9
|
+
URL = 'https://itunes.apple.com/search'
|
|
10
|
+
|
|
11
|
+
def self.search(name)
|
|
12
|
+
params = { limit: 10, media: 'software', term: name }
|
|
13
|
+
|
|
14
|
+
LHC.get(URL, params: params).data.results.map do |r|
|
|
15
|
+
{
|
|
16
|
+
name: "#{r['trackName']} (#{r['bundleId']})",
|
|
17
|
+
value: r
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Shortlook
|
|
4
|
+
class Types
|
|
5
|
+
def self.all
|
|
6
|
+
[
|
|
7
|
+
{ name: 'Contact Photo', value: { name: 'ContactPhoto', display: 'Contact Photos', key: 'contact-photo' } },
|
|
8
|
+
{ name: 'Profile Picture', value: { name: 'ProfilePicture', display: 'Profile Pictures', key: 'profile-picture' } },
|
|
9
|
+
{ name: 'Photo', value: { name: 'Photo', display: 'Photos', key: 'photos' } },
|
|
10
|
+
{ name: 'Cover', value: { name: 'Cover', display: 'Covers', key: 'covers' } }
|
|
11
|
+
]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/shortlook/version.rb
CHANGED
data/shortlook.gemspec
CHANGED
|
@@ -22,10 +22,11 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.bindir = 'exe'
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
24
24
|
spec.require_paths = ['lib']
|
|
25
|
+
spec.required_ruby_version = '>= 2.6'
|
|
25
26
|
|
|
26
|
-
spec.add_dependency 'lhc', '>=
|
|
27
|
+
spec.add_dependency 'lhc', '>= 13.0'
|
|
27
28
|
spec.add_dependency 'pastel', '~> 0.7.2'
|
|
28
|
-
spec.add_dependency 'thor', '>= 0.20', '< 1.
|
|
29
|
+
spec.add_dependency 'thor', '>= 0.20', '< 1.2'
|
|
29
30
|
spec.add_dependency 'tty-command', '>= 0.8', '< 0.10'
|
|
30
31
|
spec.add_dependency 'tty-config', '>= 0.3', '< 0.5'
|
|
31
32
|
spec.add_dependency 'tty-prompt', '>= 0.18', '< 0.22'
|
|
@@ -33,6 +34,5 @@ Gem::Specification.new do |spec|
|
|
|
33
34
|
|
|
34
35
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
35
36
|
spec.add_development_dependency 'rake', '~> 13.0'
|
|
36
|
-
spec.add_development_dependency '
|
|
37
|
-
spec.add_development_dependency 'rubocop', '~> 0.85.0'
|
|
37
|
+
spec.add_development_dependency 'rubocop', '~> 1.9.1'
|
|
38
38
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shortlook
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marco Roth
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lhc
|
|
@@ -16,20 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
20
|
-
- - "<"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: '12.0'
|
|
19
|
+
version: '13.0'
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
24
|
- - ">="
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '
|
|
30
|
-
- - "<"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '12.0'
|
|
26
|
+
version: '13.0'
|
|
33
27
|
- !ruby/object:Gem::Dependency
|
|
34
28
|
name: pastel
|
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -53,7 +47,7 @@ dependencies:
|
|
|
53
47
|
version: '0.20'
|
|
54
48
|
- - "<"
|
|
55
49
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '1.
|
|
50
|
+
version: '1.2'
|
|
57
51
|
type: :runtime
|
|
58
52
|
prerelease: false
|
|
59
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -63,7 +57,7 @@ dependencies:
|
|
|
63
57
|
version: '0.20'
|
|
64
58
|
- - "<"
|
|
65
59
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '1.
|
|
60
|
+
version: '1.2'
|
|
67
61
|
- !ruby/object:Gem::Dependency
|
|
68
62
|
name: tty-command
|
|
69
63
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -166,34 +160,20 @@ dependencies:
|
|
|
166
160
|
- - "~>"
|
|
167
161
|
- !ruby/object:Gem::Version
|
|
168
162
|
version: '13.0'
|
|
169
|
-
- !ruby/object:Gem::Dependency
|
|
170
|
-
name: rspec
|
|
171
|
-
requirement: !ruby/object:Gem::Requirement
|
|
172
|
-
requirements:
|
|
173
|
-
- - "~>"
|
|
174
|
-
- !ruby/object:Gem::Version
|
|
175
|
-
version: '3.0'
|
|
176
|
-
type: :development
|
|
177
|
-
prerelease: false
|
|
178
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
179
|
-
requirements:
|
|
180
|
-
- - "~>"
|
|
181
|
-
- !ruby/object:Gem::Version
|
|
182
|
-
version: '3.0'
|
|
183
163
|
- !ruby/object:Gem::Dependency
|
|
184
164
|
name: rubocop
|
|
185
165
|
requirement: !ruby/object:Gem::Requirement
|
|
186
166
|
requirements:
|
|
187
167
|
- - "~>"
|
|
188
168
|
- !ruby/object:Gem::Version
|
|
189
|
-
version:
|
|
169
|
+
version: 1.9.1
|
|
190
170
|
type: :development
|
|
191
171
|
prerelease: false
|
|
192
172
|
version_requirements: !ruby/object:Gem::Requirement
|
|
193
173
|
requirements:
|
|
194
174
|
- - "~>"
|
|
195
175
|
- !ruby/object:Gem::Version
|
|
196
|
-
version:
|
|
176
|
+
version: 1.9.1
|
|
197
177
|
description: ShortLook CLI for scaffoling a ShortLook Provider
|
|
198
178
|
email:
|
|
199
179
|
- marco.roth@intergga.ch
|
|
@@ -203,7 +183,6 @@ extensions: []
|
|
|
203
183
|
extra_rdoc_files: []
|
|
204
184
|
files:
|
|
205
185
|
- ".gitignore"
|
|
206
|
-
- ".rspec"
|
|
207
186
|
- ".rubocop.yml"
|
|
208
187
|
- Gemfile
|
|
209
188
|
- Gemfile.lock
|
|
@@ -217,6 +196,9 @@ files:
|
|
|
217
196
|
- lib/shortlook/cli.rb
|
|
218
197
|
- lib/shortlook/command.rb
|
|
219
198
|
- lib/shortlook/commands/provider.rb
|
|
199
|
+
- lib/shortlook/config.rb
|
|
200
|
+
- lib/shortlook/provider_helpers.rb
|
|
201
|
+
- lib/shortlook/services/app_store.rb
|
|
220
202
|
- lib/shortlook/templates/provider/%class_name%.h.tt
|
|
221
203
|
- lib/shortlook/templates/provider/%class_name%.m.tt
|
|
222
204
|
- lib/shortlook/templates/provider/.gitignore
|
|
@@ -225,13 +207,14 @@ files:
|
|
|
225
207
|
- lib/shortlook/templates/provider/README.md.tt
|
|
226
208
|
- lib/shortlook/templates/provider/ShortLook-API.h
|
|
227
209
|
- lib/shortlook/templates/provider/control.tt
|
|
210
|
+
- lib/shortlook/types.rb
|
|
228
211
|
- lib/shortlook/version.rb
|
|
229
212
|
- shortlook.gemspec
|
|
230
213
|
homepage: https://github.com/marcoroth/shortlook-cli
|
|
231
214
|
licenses:
|
|
232
215
|
- MIT
|
|
233
216
|
metadata: {}
|
|
234
|
-
post_install_message:
|
|
217
|
+
post_install_message:
|
|
235
218
|
rdoc_options: []
|
|
236
219
|
require_paths:
|
|
237
220
|
- lib
|
|
@@ -239,15 +222,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
239
222
|
requirements:
|
|
240
223
|
- - ">="
|
|
241
224
|
- !ruby/object:Gem::Version
|
|
242
|
-
version: '
|
|
225
|
+
version: '2.6'
|
|
243
226
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
227
|
requirements:
|
|
245
228
|
- - ">="
|
|
246
229
|
- !ruby/object:Gem::Version
|
|
247
230
|
version: '0'
|
|
248
231
|
requirements: []
|
|
249
|
-
rubygems_version: 3.
|
|
250
|
-
signing_key:
|
|
232
|
+
rubygems_version: 3.0.3
|
|
233
|
+
signing_key:
|
|
251
234
|
specification_version: 4
|
|
252
235
|
summary: ShortLook CLI for scaffoling a ShortLook Provider
|
|
253
236
|
test_files: []
|
data/.rspec
DELETED