factor 0.0.91 → 0.0.92
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.
- data/bin/factor +9 -2
- data/lib/cli/{channel.rb → channel_task.rb} +1 -1
- data/lib/cli/{credential.rb → credential_task.rb} +1 -1
- data/lib/cli/factor_task.rb +27 -0
- data/lib/cli/{server.rb → server_task.rb} +1 -1
- data/lib/cli/{workflow.rb → workflow_task.rb} +1 -1
- data/lib/client/client.rb +1 -1
- metadata +6 -6
- data/lib/cli/factor.rb +0 -28
data/bin/factor
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "rubygems"
|
3
|
-
require "factor"
|
4
3
|
|
5
|
-
|
4
|
+
require "pathname"
|
5
|
+
bin_file = Pathname.new(__FILE__).realpath
|
6
|
+
|
7
|
+
# add self to libpath
|
8
|
+
$:.unshift File.expand_path("../../lib", bin_file)
|
9
|
+
require 'factor'
|
10
|
+
|
11
|
+
|
12
|
+
Factor::CLI::FactorTask.start
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'cli/command'
|
3
|
+
require 'cli/server_task'
|
4
|
+
require 'cli/workflow_task'
|
5
|
+
require 'cli/credential_task'
|
6
|
+
|
7
|
+
module Factor
|
8
|
+
module CLI
|
9
|
+
class FactorTask < Command
|
10
|
+
|
11
|
+
desc "login EMAIL TOKEN", "login with token"
|
12
|
+
# method_option :email, :alias=>"-e", :type=>:string, :desc=>"Email address for Factor account", :required=>true
|
13
|
+
# method_option :token, :alias=>"-t", :type=>:string, :desc=>"Token value to set", :required=>true
|
14
|
+
def login(email,token)
|
15
|
+
config = get_config
|
16
|
+
config[:email]=email
|
17
|
+
config[:token]=token
|
18
|
+
save_config(config)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
Factor::CLI::FactorTask.register(Factor::CLI::ServerTask, "server","server","start and list servers")
|
25
|
+
Factor::CLI::FactorTask.register(Factor::CLI::WorkflowTask,"workflow","workflow","start and list workflows")
|
26
|
+
Factor::CLI::FactorTask.register(Factor::CLI::ChannelTask,"channel","channel","install,uninstall, list channels")
|
27
|
+
Factor::CLI::FactorTask.register(Factor::CLI::CredentialTask,"credential","credential","manage remote credential store")
|
@@ -3,7 +3,7 @@ require 'cli/command'
|
|
3
3
|
|
4
4
|
module Factor
|
5
5
|
module CLI
|
6
|
-
class
|
6
|
+
class ServerTask < Command
|
7
7
|
desc "start", "start the server"
|
8
8
|
method_option :tags, :alias=>"-t", :type=>:hash, :desc=>"Optional tags to identify from workflow"
|
9
9
|
method_option :channels, :type=>:array, :desc=>"Optional channel ruby file list for development"
|
data/lib/client/client.rb
CHANGED
@@ -61,7 +61,7 @@ module Factor
|
|
61
61
|
uri = URI.parse(channel['zip_url'])
|
62
62
|
|
63
63
|
# temp file to store the zip for download
|
64
|
-
temp_file = Tempfile.new([uri.
|
64
|
+
temp_file = Tempfile.new([uri.path.gsub(/\W+/,'-'), '.zip'], :encoding => 'ascii-8bit')
|
65
65
|
|
66
66
|
# temp directory where zip will be decompressed
|
67
67
|
unzip_dir=temp_file.path[0..-5]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.92
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -150,12 +150,12 @@ files:
|
|
150
150
|
- lib/channel/channel.rb
|
151
151
|
- lib/channel/event.rb
|
152
152
|
- lib/channel/trigger.rb
|
153
|
-
- lib/cli/
|
153
|
+
- lib/cli/channel_task.rb
|
154
154
|
- lib/cli/command.rb
|
155
|
-
- lib/cli/
|
156
|
-
- lib/cli/
|
157
|
-
- lib/cli/
|
158
|
-
- lib/cli/
|
155
|
+
- lib/cli/credential_task.rb
|
156
|
+
- lib/cli/factor_task.rb
|
157
|
+
- lib/cli/server_task.rb
|
158
|
+
- lib/cli/workflow_task.rb
|
159
159
|
- lib/client/client.rb
|
160
160
|
- lib/factor.rb
|
161
161
|
- lib/runtime/attributes.rb
|
data/lib/cli/factor.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'cli/command'
|
3
|
-
require 'cli/server'
|
4
|
-
require 'cli/workflow'
|
5
|
-
require 'cli/credential'
|
6
|
-
require 'cli/channel'
|
7
|
-
|
8
|
-
module Factor
|
9
|
-
module CLI
|
10
|
-
class Factor < Command
|
11
|
-
|
12
|
-
desc "login EMAIL TOKEN", "login with token"
|
13
|
-
# method_option :email, :alias=>"-e", :type=>:string, :desc=>"Email address for Factor account", :required=>true
|
14
|
-
# method_option :token, :alias=>"-t", :type=>:string, :desc=>"Token value to set", :required=>true
|
15
|
-
def login(email,token)
|
16
|
-
config = get_config
|
17
|
-
config[:email]=email
|
18
|
-
config[:token]=token
|
19
|
-
save_config(config)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
Factor::CLI::Factor.register(Factor::CLI::Server, "server","server","start and list servers")
|
26
|
-
Factor::CLI::Factor.register(Factor::CLI::Workflow,"workflow","workflow","start and list workflows")
|
27
|
-
Factor::CLI::Factor.register(Factor::CLI::Channel,"channel","channel","install,uninstall, list channels")
|
28
|
-
Factor::CLI::Factor.register(Factor::CLI::Credential,"credential","credential","manage remote credential store")
|