fanforce-cli 2.0.0.rc4 → 2.0.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/README.md +25 -25
- data/fanforce-cli.gemspec +2 -1
- data/lib/fanforce/cli/_load.rb +8 -8
- data/lib/fanforce/cli/{app.rb → plugin.rb} +4 -4
- data/lib/fanforce/cli/{apps.rb → plugins.rb} +4 -4
- data/lib/fanforce/cli/utils.rb +7 -7
- data/lib/fanforce/cli/version.rb +1 -1
- data/lib/fanforce/cli.rb +3 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abae45ed8082304869567fe2dfc36b2268bc4005
|
4
|
+
data.tar.gz: 4db198a443bc3aa427d175bc286613e1086c8715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a178375af3d2110de2cdf2fd1b90b01f13931bd3327da8eb6d62bc77eb0f920bec438ebf566e65c43e3fc0b037c868d28359e1c60b280a13669620a9231b05a
|
7
|
+
data.tar.gz: 899e5019cc0d84c77f05c3dc422d27f13d98c2649d755802cd3a0a4ab74957aae89e26e1271ea0ea25f6597b9f20bdec356abbb236d6ac4e3d3e40abb08c7302
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fanforce-cli (2.0.0.
|
4
|
+
fanforce-cli (2.0.0.rc5)
|
5
5
|
activesupport
|
6
|
-
fanforce-base (~> 1.
|
6
|
+
fanforce-base (~> 1.6.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -14,14 +14,14 @@ GEM
|
|
14
14
|
minitest (~> 5.1)
|
15
15
|
thread_safe (~> 0.1)
|
16
16
|
tzinfo (~> 1.1)
|
17
|
-
addressable (2.3.
|
18
|
-
fanforce-base (1.
|
17
|
+
addressable (2.3.7)
|
18
|
+
fanforce-base (1.6.0)
|
19
19
|
addressable (~> 2.3.6)
|
20
20
|
rack
|
21
|
-
i18n (0.
|
21
|
+
i18n (0.7.0)
|
22
22
|
json (1.8.1)
|
23
|
-
minitest (5.
|
24
|
-
rack (1.
|
23
|
+
minitest (5.5.1)
|
24
|
+
rack (1.6.0)
|
25
25
|
thread_safe (0.3.4)
|
26
26
|
tzinfo (1.2.2)
|
27
27
|
thread_safe (~> 0.1)
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# fanforce-cli
|
2
|
-
The simplest way to create and manage a folder of Fanforce
|
2
|
+
The simplest way to create and manage a folder of Fanforce plugins. This gem provides
|
3
3
|
bulk commands that you can run against your entire list.
|
4
4
|
|
5
5
|
## Installation
|
@@ -16,26 +16,26 @@ Run this command to view usage instructions
|
|
16
16
|
|
17
17
|
|
18
18
|
## Customizing Your Fanforce CLI Setup with .fanforce-cli
|
19
|
-
You can add a .fanforce-cli to any fanforce folder you've setup for your
|
20
|
-
Below is a example file that sets a custom local path for the fanforce-
|
19
|
+
You can add a .fanforce-cli to any fanforce folder you've setup for your plugins. It accepts any valid YAML markup.
|
20
|
+
Below is a example file that sets a custom local path for the fanforce-plugin-factory gem, plus a version:
|
21
21
|
|
22
22
|
```yaml
|
23
|
-
|
24
|
-
path: '../../fanforce-
|
25
|
-
version: '
|
23
|
+
plugin_factory_gem:
|
24
|
+
path: '../../fanforce-plugin-factory'
|
25
|
+
version: '>= 1.6.0'
|
26
26
|
```
|
27
27
|
For more options see BitBucket and Heroku below.
|
28
28
|
|
29
29
|
|
30
|
-
## Run Fanforce CLI Inside of
|
30
|
+
## Run Fanforce CLI Inside of a Plugin
|
31
31
|
|
32
|
-
Sometimes you'll want to use cli commands inside a specific
|
33
|
-
file, and the
|
32
|
+
Sometimes you'll want to use cli commands inside a specific plugin. You can as long as the folder contains a config.ru
|
33
|
+
file, and the plugin is a subdirectory of a fanforce folder containing a .fanforce-cli file.
|
34
34
|
|
35
35
|
|
36
36
|
## Supercharge Your Fanforce CLI
|
37
37
|
|
38
|
-
Fanforce-cli comes with a special application when you're running commands on a long list of
|
38
|
+
Fanforce-cli comes with a special application when you're running commands on a long list of plugins and
|
39
39
|
each command is taking a long time to run. It forks each command and runs them in parallel. Only a subset of the full
|
40
40
|
cli commands are available with fanforce-supercharge. Run the following from your terminal to see your available
|
41
41
|
options:
|
@@ -45,17 +45,17 @@ fanforce-supercharge
|
|
45
45
|
```
|
46
46
|
|
47
47
|
## BitBucket: Creating Repositories and Pushing
|
48
|
-
A BitBucket repository will be automatically setup for each new
|
48
|
+
A BitBucket repository will be automatically setup for each new plugin if a bitbucket object is defined in your .fanforce-cli file:
|
49
49
|
|
50
50
|
```yaml
|
51
51
|
bitbucket:
|
52
|
-
user:
|
52
|
+
user: plugins-by-me
|
53
53
|
password: password
|
54
54
|
```
|
55
55
|
|
56
56
|
## Heroku Apps: Creating and Updating
|
57
|
-
A heroku app will be automatically setup for each new
|
58
|
-
one for each environment (staging|production) you want
|
57
|
+
A heroku app will be automatically setup for each new plugin if a heroku object is defined in your .fanforce-cli file. You'll need
|
58
|
+
one for each environment (staging|production) you want plugins setup for.
|
59
59
|
|
60
60
|
```yaml
|
61
61
|
heroku:
|
@@ -63,7 +63,7 @@ heroku:
|
|
63
63
|
user: technical@fanforce.com
|
64
64
|
git_ssh_domain: heroku_fanforce
|
65
65
|
password: password
|
66
|
-
app_domain:
|
66
|
+
app_domain: ffplugin.io
|
67
67
|
short_domain: fanforce.io
|
68
68
|
```
|
69
69
|
The git_ssh_domain variable listed above is needed if you're pushing to multiple Heroku accounts as you'll need to specify
|
@@ -80,7 +80,7 @@ Host heroku_fanforce
|
|
80
80
|
See http://www.springloops.com/blog/git-config-for-mutiply-ssh-keys/ for more info.
|
81
81
|
|
82
82
|
## Environment Variables
|
83
|
-
Fanforce CLI allows you to setup a list of env variables that can be loaded by your
|
83
|
+
Fanforce CLI allows you to setup a list of env variables that can be loaded by your plugin it's running in your local
|
84
84
|
development environment, pushed to Heroku, or tasks setup on IronWorker.
|
85
85
|
|
86
86
|
First, you need to setup a folder called ".env" in your fanforce folder with a series of YAML files inside. The only required
|
@@ -88,20 +88,20 @@ file is _bind.yaml:
|
|
88
88
|
|
89
89
|
```yaml
|
90
90
|
constantcontact:
|
91
|
-
-
|
92
|
-
-
|
91
|
+
- constantcontact
|
92
|
+
- constantcontact-subscribers
|
93
93
|
|
94
94
|
facebook:
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
95
|
+
- facebook
|
96
|
+
- facebook-friends
|
97
|
+
- facebook-posts
|
98
98
|
|
99
99
|
iron: ALL
|
100
100
|
```
|
101
101
|
|
102
|
-
Each key is the filename (minus .yaml) of the YAML file holding a list of ENV variables. The array underneath is the folder names of
|
102
|
+
Each key is the filename (minus .yaml) of the YAML file holding a list of ENV variables. The array underneath is the folder names of plugins
|
103
103
|
that these ENV variables will be loaded into. Alternatively, you can specify the keyword ALL if those ENV variables should
|
104
|
-
be loaded into all
|
104
|
+
be loaded into all plugins.
|
105
105
|
|
106
106
|
Second, you'll need to setup the filenames references in _bind.yaml. Each file contains a hash of ENV key/values organized
|
107
107
|
by RACK_ENV. Here's is an example of facebook.yaml (of course, you'll need to provide legit facebook api_keys and api_secrets):
|
@@ -118,10 +118,10 @@ staging:
|
|
118
118
|
|
119
119
|
## Using IronWorker
|
120
120
|
|
121
|
-
Fanforce CLI comes with built in support for using IronWorker in your
|
121
|
+
Fanforce CLI comes with built in support for using IronWorker in your plugins:
|
122
122
|
|
123
123
|
```
|
124
|
-
fanforce
|
124
|
+
fanforce push development iron
|
125
125
|
```
|
126
126
|
|
127
127
|
There are a couple things you'll want to setup first:
|
data/fanforce-cli.gemspec
CHANGED
data/lib/fanforce/cli/_load.rb
CHANGED
@@ -49,19 +49,19 @@ class Fanforce::CLI
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def load_cli_commands
|
52
|
-
if TYPE == :
|
52
|
+
if TYPE == :directory_of_plugins
|
53
53
|
begin
|
54
|
-
require 'fanforce/
|
54
|
+
require 'fanforce/plugin_factory/cli_directory_of_plugins'
|
55
55
|
rescue LoadError => e
|
56
|
-
raise if !e.message.include?('fanforce/
|
57
|
-
error('You must install the fanforce-
|
56
|
+
raise if !e.message.include?('fanforce/plugin_factory/cli_directory_of_plugins')
|
57
|
+
error('You must install the fanforce-plugin-factory gem (>= 1.6.0) for use in this folder')
|
58
58
|
end
|
59
|
-
elsif TYPE == :
|
59
|
+
elsif TYPE == :single_plugin
|
60
60
|
begin
|
61
|
-
require 'fanforce/
|
61
|
+
require 'fanforce/plugin_factory/cli_single_plugin'
|
62
62
|
rescue LoadError => e
|
63
|
-
raise if !e.message.include?('fanforce/
|
64
|
-
error('You must install the fanforce-
|
63
|
+
raise if !e.message.include?('fanforce/plugin_factory/cli_single_plugin')
|
64
|
+
error('You must install the fanforce-plugin-factory gem (>= 1.6.0) for use in a plugin folder')
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
class Fanforce::CLI::
|
1
|
+
class Fanforce::CLI::Plugin
|
2
2
|
|
3
3
|
attr_reader :_id, :dir, :dir_name, :dir_root, :root_domain, :name
|
4
4
|
|
5
5
|
def self.parse_dir_name(dir_name)
|
6
|
-
return if dir_name !~ /^(
|
6
|
+
return if dir_name !~ /^(plugin-([a-z0-9-]+))\/?$/
|
7
7
|
{_id: $2, dir_name: $1}
|
8
8
|
end
|
9
9
|
|
@@ -18,7 +18,7 @@ class Fanforce::CLI::App
|
|
18
18
|
@dir_root = $1
|
19
19
|
@dir_name = $2
|
20
20
|
@dir_relative = @dir.gsub(Fanforce::CLI::DIR, '')
|
21
|
-
@root_domain = Fanforce.
|
21
|
+
@root_domain = Fanforce.plugins_base_domain
|
22
22
|
@name = @_id.gsub('-', ' ').titleize
|
23
23
|
end
|
24
24
|
|
@@ -45,4 +45,4 @@ class Fanforce::CLI::App
|
|
45
45
|
to_hash.to_json
|
46
46
|
end
|
47
47
|
|
48
|
-
end
|
48
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Fanforce::CLI::
|
1
|
+
class Fanforce::CLI::Plugins
|
2
2
|
|
3
3
|
@@dirs = nil
|
4
4
|
|
@@ -20,8 +20,8 @@ class Fanforce::CLI::Apps
|
|
20
20
|
total_count = dir_names.size
|
21
21
|
dir_names.each do |d|
|
22
22
|
processed_count += 1
|
23
|
-
|
24
|
-
Dir.chdir(
|
23
|
+
plugin = Fanforce::CLI::Plugin.load("#{Fanforce::CLI::DIR}/#{d}")
|
24
|
+
Dir.chdir(plugin.dir) { block.call(plugin, processed_count, total_count) }
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -29,4 +29,4 @@ class Fanforce::CLI::Apps
|
|
29
29
|
dir_names.size
|
30
30
|
end
|
31
31
|
|
32
|
-
end
|
32
|
+
end
|
data/lib/fanforce/cli/utils.rb
CHANGED
@@ -65,18 +65,18 @@ module Fanforce::CLI::Utils
|
|
65
65
|
types = {
|
66
66
|
directory_of_internals: false,
|
67
67
|
single_internal: false,
|
68
|
-
|
69
|
-
|
68
|
+
directory_of_plugins: false,
|
69
|
+
single_plugin: false
|
70
70
|
}
|
71
71
|
|
72
|
-
types[:
|
73
|
-
types[:
|
72
|
+
types[:single_plugin] = true if File.exists?("#{home_dir}/config.json") and File.exists?("#{home_dir}/../.fanforce-plugin-factory")
|
73
|
+
types[:directory_of_plugins] = true if File.exists?("#{home_dir}/.fanforce-plugin-factory")
|
74
74
|
|
75
|
-
if [dir_names[-1],dir_names[-2]].include?('Fanforce') && !File.exists?("#{home_dir}/.git") && !File.exists?("#{home_dir}/.fanforce-
|
75
|
+
if [dir_names[-1],dir_names[-2]].include?('Fanforce') && !File.exists?("#{home_dir}/.git") && !File.exists?("#{home_dir}/.fanforce-plugin-factory")
|
76
76
|
types[:directory_of_internals] = true
|
77
77
|
end
|
78
78
|
|
79
|
-
if [dir_names[-1],dir_names[-2],dir_names[-
|
79
|
+
if [dir_names[-1],dir_names[-2],dir_names[-3]].include?('Fanforce') and File.exists?("#{home_dir}/.git") and !File.exists?("#{home_dir}/../.fanforce-plugin-factory")
|
80
80
|
types[:single_internal] = true
|
81
81
|
end
|
82
82
|
|
@@ -98,4 +98,4 @@ class String
|
|
98
98
|
def format(*args)
|
99
99
|
Fanforce::CLI::Utils.fmt(self, *args)
|
100
100
|
end
|
101
|
-
end
|
101
|
+
end
|
data/lib/fanforce/cli/version.rb
CHANGED
data/lib/fanforce/cli.rb
CHANGED
@@ -2,6 +2,6 @@ require 'fanforce/base'
|
|
2
2
|
|
3
3
|
require_relative 'cli/version'
|
4
4
|
require_relative 'cli/utils'
|
5
|
-
require_relative 'cli/
|
6
|
-
require_relative 'cli/
|
7
|
-
require_relative 'cli/_load'
|
5
|
+
require_relative 'cli/plugin'
|
6
|
+
require_relative 'cli/plugins'
|
7
|
+
require_relative 'cli/_load'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanforce-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: fanforce-base
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.6.0.rc2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.6.0.rc2
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- cclark@mobilizationlabs.com
|
@@ -57,8 +57,8 @@ files:
|
|
57
57
|
- fanforce-cli.gemspec
|
58
58
|
- lib/fanforce/cli.rb
|
59
59
|
- lib/fanforce/cli/_load.rb
|
60
|
-
- lib/fanforce/cli/
|
61
|
-
- lib/fanforce/cli/
|
60
|
+
- lib/fanforce/cli/plugin.rb
|
61
|
+
- lib/fanforce/cli/plugins.rb
|
62
62
|
- lib/fanforce/cli/scripts/version.rb
|
63
63
|
- lib/fanforce/cli/utils.rb
|
64
64
|
- lib/fanforce/cli/version.rb
|