claide-plugins 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +41 -12
- data/Rakefile +3 -1
- data/lib/claide/command/plugins/create.rb +5 -45
- data/lib/claide/command/template_runner.rb +51 -0
- data/lib/claide_plugins.rb +1 -1
- data/spec/command/plugins/create_spec.rb +5 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 062f959abe324c5726fd6cf97d621dddd0906313
|
4
|
+
data.tar.gz: a5f8a85a4543db6f099daf5eeccf503d9244284c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e56726dd288585396189349599cad7fd11d47e26f85c8f2992f1772d28b8fe8761ec48e7f8eeda322ae40074e7d169fca98ce33e07d669546d9e3f06090c093
|
7
|
+
data.tar.gz: d825a6f0928a6a3ca588b974e53c14176e8bb2086eb788cd8c5c0a1982867abd5d7fba91d480c5a021bc098aa67dd98f14e6ff1bd59ab6dd585ec8ae9b35fdf0
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ GIT
|
|
8
8
|
PATH
|
9
9
|
remote: .
|
10
10
|
specs:
|
11
|
-
claide-plugins (0.9.
|
11
|
+
claide-plugins (0.9.1)
|
12
12
|
cork
|
13
13
|
nap
|
14
14
|
open4 (~> 1.3)
|
@@ -25,7 +25,7 @@ GEM
|
|
25
25
|
simplecov (>= 0.7.1, < 1.0.0)
|
26
26
|
coderay (1.1.1)
|
27
27
|
colored (1.2)
|
28
|
-
cork (0.
|
28
|
+
cork (0.2.0)
|
29
29
|
colored (~> 1.2)
|
30
30
|
crack (0.4.2)
|
31
31
|
safe_yaml (~> 1.0.0)
|
@@ -87,4 +87,4 @@ DEPENDENCIES
|
|
87
87
|
webmock
|
88
88
|
|
89
89
|
BUNDLED WITH
|
90
|
-
1.
|
90
|
+
1.13.1
|
data/README.md
CHANGED
@@ -1,44 +1,73 @@
|
|
1
|
-
#
|
1
|
+
# CLAide plugins
|
2
2
|
|
3
3
|
[![Build Status](https://img.shields.io/travis/CocoaPods/cocoapods-plugins/master.svg?style=flat)](https://travis-ci.org/CocoaPods/cocoapods-plugins)
|
4
4
|
[![Coverage](https://img.shields.io/codeclimate/coverage/github/CocoaPods/cocoapods-plugins.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-plugins)
|
5
5
|
[![Code Climate](https://img.shields.io/codeclimate/github/CocoaPods/cocoapods-plugins.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-plugins)
|
6
6
|
|
7
|
-
|
7
|
+
CLAide plugin which shows info about available CLAide plugins or helps you get started developing a new plugin. Yeah, it's very meta.
|
8
|
+
|
9
|
+
It provides the foundations for CocoaPods and Danger's plugin infrastructure.
|
8
10
|
|
9
11
|
## Installation
|
10
12
|
|
11
|
-
|
13
|
+
This isn't really a user-facing gem, you need to add it to your library.
|
14
|
+
|
15
|
+
Here is how it is added into Danger:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
module Danger
|
19
|
+
class Runner < CLAide::Command
|
20
|
+
require "danger/commands/init"
|
21
|
+
require "danger/commands/local"
|
22
|
+
require "danger/commands/systems"
|
23
|
+
|
24
|
+
# manually add claide plugins as subcommands
|
25
|
+
require "claide_plugin"
|
26
|
+
@subcommands << CLAide::Command::Plugins
|
27
|
+
CLAide::Plugins.config =
|
28
|
+
CLAide::Plugins::Configuration.new(
|
29
|
+
"Danger",
|
30
|
+
"danger",
|
31
|
+
"https://raw.githubusercontent.com/danger/danger.systems/master/plugins-search-generated.json",
|
32
|
+
"https://github.com/danger/danger-plugin-template"
|
33
|
+
)
|
34
|
+
|
35
|
+
require "danger/commands/plugins/plugin_lint"
|
36
|
+
require "danger/commands/plugins/plugin_json"
|
37
|
+
require "danger/commands/plugins/plugin_readme"
|
38
|
+
|
39
|
+
```
|
12
40
|
|
13
41
|
## Usage
|
14
42
|
|
15
43
|
##### List installed plugins
|
16
44
|
|
17
|
-
$
|
45
|
+
$ [your tool] plugins installed
|
18
46
|
|
19
|
-
List all installed
|
47
|
+
List all installed plugins with their respective version
|
20
48
|
|
21
49
|
##### List known plugins
|
22
50
|
|
23
|
-
$
|
51
|
+
$ [your tool] plugins list
|
24
52
|
|
25
|
-
List all known
|
53
|
+
List all known plugins (according to the list hosted on `http://github.com/CocoaPods/cocoapods-plugins`)
|
26
54
|
|
27
55
|
##### Search plugins
|
28
56
|
|
29
|
-
$
|
57
|
+
$ [your tool] plugins search QUERY
|
30
58
|
|
31
59
|
Search plugins whose name contains the given text (ignoring case). With --full, it searches by name but also by author and description.
|
32
60
|
|
33
61
|
##### Create a new plugin
|
34
62
|
|
35
|
-
$
|
63
|
+
$ [your tool] plugins create NAME [TEMPLATE_URL]
|
64
|
+
|
65
|
+
Create a scaffold for the development of a new plugin according to the your tool's best practices.
|
36
66
|
|
37
|
-
Create a scaffold for the development of a new plugin according to the CocoaPods best practices.
|
38
67
|
If a `TEMPLATE_URL`, pointing to a git repo containing a compatible template, is specified, it will be used in place of the default one.
|
39
68
|
|
40
69
|
## Get your plugin listed
|
41
70
|
|
42
|
-
$
|
71
|
+
$ [your tool] plugins publish
|
43
72
|
|
44
|
-
Create an issue in the
|
73
|
+
Create an issue in the plugins search GitHub repository to ask for your plugin to be added to the official list (with the proper JSON fragment to be added to `plugins.json` so we just have to copy/paste it).
|
data/Rakefile
CHANGED
@@ -29,7 +29,9 @@ begin
|
|
29
29
|
duration = Time.now - start_time
|
30
30
|
puts "Tests completed in #{duration}s"
|
31
31
|
Rake::Task['rubocop'].invoke
|
32
|
-
|
32
|
+
|
33
|
+
# This is not used in this library
|
34
|
+
# Rake::Task['validate_json'].invoke
|
33
35
|
end
|
34
36
|
|
35
37
|
def specs(dir)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'claide/command/plugins_helper'
|
2
|
-
require 'claide/
|
2
|
+
require 'claide/command/gem_helper'
|
3
|
+
require 'claide/command/template_runner'
|
3
4
|
|
4
5
|
module CLAide
|
5
6
|
class Command
|
@@ -46,8 +47,9 @@ module CLAide
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def run
|
49
|
-
|
50
|
-
|
50
|
+
runner = TemplateRunner.new @name, @template_url
|
51
|
+
runner.clone_template
|
52
|
+
runner.configure_template
|
51
53
|
show_reminder
|
52
54
|
end
|
53
55
|
|
@@ -55,48 +57,6 @@ module CLAide
|
|
55
57
|
|
56
58
|
private
|
57
59
|
|
58
|
-
# !@group Private helpers
|
59
|
-
|
60
|
-
extend CLAide::Executable
|
61
|
-
executable :git
|
62
|
-
|
63
|
-
# Clones the template from the remote in the working directory using
|
64
|
-
# the name of the plugin.
|
65
|
-
#
|
66
|
-
# @return [void]
|
67
|
-
#
|
68
|
-
def clone_template
|
69
|
-
UI.section("-> Creating `#{@name}` plugin") do
|
70
|
-
UI.notice "using template '#{template_repo_url}'"
|
71
|
-
command = ['clone', template_repo_url, @name]
|
72
|
-
git! command
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
# Runs the template configuration utilities.
|
77
|
-
#
|
78
|
-
# @return [void]
|
79
|
-
#
|
80
|
-
def configure_template
|
81
|
-
UI.section('-> Configuring template') do
|
82
|
-
Dir.chdir(@name) do
|
83
|
-
if File.file? 'configure'
|
84
|
-
system "./configure #{@name}"
|
85
|
-
else
|
86
|
-
UI.warn 'Template does not have a configure file.'
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
# Checks if a template URL is given else returns the Plugins.config URL
|
93
|
-
#
|
94
|
-
# @return String
|
95
|
-
#
|
96
|
-
def template_repo_url
|
97
|
-
@template_url || CLAide::Plugins.config.plugin_template_url
|
98
|
-
end
|
99
|
-
|
100
60
|
# Shows a reminder to the plugin author to make a Pull Request
|
101
61
|
# in order to update plugins.json once the plugin is released
|
102
62
|
#
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'claide/command/plugins_helper'
|
2
|
+
require 'claide/executable'
|
3
|
+
|
4
|
+
module CLAide
|
5
|
+
class TemplateRunner
|
6
|
+
extend CLAide::Executable
|
7
|
+
executable :git
|
8
|
+
|
9
|
+
def initialize(name, template_url)
|
10
|
+
@name = name
|
11
|
+
@template_url = template_url
|
12
|
+
end
|
13
|
+
|
14
|
+
# Clones the template from the remote in the working directory using
|
15
|
+
# the name of the plugin.
|
16
|
+
#
|
17
|
+
# @return [void]
|
18
|
+
#
|
19
|
+
def clone_template
|
20
|
+
UI.section("-> Creating `#{@name}` plugin") do
|
21
|
+
UI.notice "using template '#{template_repo_url}'"
|
22
|
+
command = ['clone', template_repo_url, @name]
|
23
|
+
git! command
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Runs the template configuration utilities.
|
28
|
+
#
|
29
|
+
# @return [void]
|
30
|
+
#
|
31
|
+
def configure_template
|
32
|
+
UI.section('-> Configuring template') do
|
33
|
+
Dir.chdir(@name) do
|
34
|
+
if File.file? 'configure'
|
35
|
+
system "./configure #{@name}"
|
36
|
+
else
|
37
|
+
UI.warn 'Template does not have a configure file.'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Checks if a template URL is given else returns the Plugins.config URL
|
44
|
+
#
|
45
|
+
# @return String
|
46
|
+
#
|
47
|
+
def template_repo_url
|
48
|
+
@template_url || CLAide::Plugins.config.plugin_template_url
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/claide_plugins.rb
CHANGED
@@ -84,8 +84,8 @@ module CLAide
|
|
84
84
|
template_repo = 'https://github.com/danger/' \
|
85
85
|
'danger-plugin-template'
|
86
86
|
git_command = ['clone', template_repo, 'danger-banana']
|
87
|
-
|
88
|
-
|
87
|
+
CLAide::TemplateRunner.any_instance.expects(:git!).with(git_command)
|
88
|
+
CLAide::TemplateRunner.any_instance.expects(:configure_template)
|
89
89
|
@command.run
|
90
90
|
UI_OUT.string.should.include('Creating `danger-banana` plugin')
|
91
91
|
end
|
@@ -95,8 +95,9 @@ module CLAide
|
|
95
95
|
'danger-banana-plugin-template'
|
96
96
|
@command = create_command('danger-banana', alt_repo)
|
97
97
|
|
98
|
-
|
99
|
-
|
98
|
+
git_command = ['clone', alt_repo, 'danger-banana']
|
99
|
+
CLAide::TemplateRunner.any_instance.expects(:git!).with(git_command)
|
100
|
+
CLAide::TemplateRunner.any_instance.expects(:configure_template)
|
100
101
|
@command.run
|
101
102
|
UI_OUT.string.should.include('Creating `danger-banana` plugin')
|
102
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: claide-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Grandinetti
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nap
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- lib/claide/command/plugins/search.rb
|
126
126
|
- lib/claide/command/plugins_config.rb
|
127
127
|
- lib/claide/command/plugins_helper.rb
|
128
|
+
- lib/claide/command/template_runner.rb
|
128
129
|
- lib/claide/executable.rb
|
129
130
|
- lib/claide_plugin.rb
|
130
131
|
- lib/claide_plugins.rb
|
@@ -160,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
161
|
version: '0'
|
161
162
|
requirements: []
|
162
163
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.2.2
|
164
165
|
signing_key:
|
165
166
|
specification_version: 4
|
166
167
|
summary: CLAide plugin which shows info about available CLAide plugins.
|