factor 0.0.91 → 0.0.92

Sign up to get free protection for your applications and to get access to all the features.
data/bin/factor CHANGED
@@ -1,5 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "rubygems"
3
- require "factor"
4
3
 
5
- Factor::CLI::Factor.start
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
@@ -5,7 +5,7 @@ require 'zip/zipfilesystem'
5
5
 
6
6
  module Factor
7
7
  module CLI
8
- class Channel < Command
8
+ class ChannelTask < Command
9
9
 
10
10
  desc "call CHANNEL METHOD TARGET","start a workflow"
11
11
  method_option :parameters, :type=>:hash, :default=>{}, :required=>false
@@ -3,7 +3,7 @@ require 'cli/command'
3
3
 
4
4
  module Factor
5
5
  module CLI
6
- class Credential < Command
6
+ class CredentialTask < Command
7
7
 
8
8
  desc "list [KEY]", "list all the credentials"
9
9
  #method_option :key, :alias=>"-k", :type=>:string, :desc=>"key reference"
@@ -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 Server < Command
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"
@@ -3,7 +3,7 @@ require 'cli/command'
3
3
 
4
4
  module Factor
5
5
  module CLI
6
- class Workflow < Command
6
+ class WorkflowTask < Command
7
7
 
8
8
  desc "call WORKFLOW","start a workflow"
9
9
  method_option :parameters, :type=>:hash, :default=>{}, :required=>false
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.to_s.gsub(/\W+/,'-'), '.zip'], :encoding => 'ascii-8bit')
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.91
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/channel.rb
153
+ - lib/cli/channel_task.rb
154
154
  - lib/cli/command.rb
155
- - lib/cli/credential.rb
156
- - lib/cli/factor.rb
157
- - lib/cli/server.rb
158
- - lib/cli/workflow.rb
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")