fuel-cli 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDBlMjU0MmNiZjIyOTc2NWYzZjQwYjNkNDBiNzBlYjgyMDMxN2MzNQ==
4
+ NjlhODk3OGRiMzZiNjMwMjg0N2ZmYjU5YmQxNWU1YTY4ODNhYTFhNQ==
5
5
  data.tar.gz: !binary |-
6
- ZWZkMDVmMjZkOTRiZjRiMTk1MmViY2YxZjRhZDNiMjIwNThjMjUxZA==
6
+ NGNmNTA0YWFmY2NmMzYxYTk1YmU5MTJjM2ZhZDMyZDQ2OTJmYmM5Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDFjYWRjYzIyMjlhOGJmOGRmZDlmZGY1M2M1M2E0MzI1MDNkOGIwYzQxYjNl
10
- YTY2MmZmMzcyOWFkNTY1YWQ1NzgxZTYwNmQ0NmY0NjY5ZDkwMGIwZDVmNDIz
11
- MGZkN2VhM2IyNGQ0ZGRmNTJlZDU3MWViNTE2ZjE2YzAzOWY2ODM=
9
+ OTYxMzEyMDJiNWIzYjc0ZmI2YmYxMDFkNzg0MzZjYTZlNDg0YjNlMDg2YzIw
10
+ Mjc4M2RmN2EyZDA5Y2Q0MmQyYjdhMGFlOThjYTFmZWFmOWFiZWVlZjE0NTBh
11
+ NWY4N2FiYzBjZTNhZjZhY2FmNTg5MjJiNWQ4ZjkwZDgyNzJiNDk=
12
12
  data.tar.gz: !binary |-
13
- Mjg2YWIyYjVmZDMxOTRmMzRmZDUxNmQyMWI2MTA1MzZhNGNlMzNkMzgzMjgz
14
- M2QwNThlMzkwMTNkNGJhZTM5OWQ1M2UxNGNjZjE3MDIwN2I0Y2Y3NzQ4OTY0
15
- MWRkOTIxNDFiNjY2YzlmOTA5MDE5NWY0OTZmNjI4Y2ZiNGEzZjQ=
13
+ YjRjNjczMzAyODIwMmE2NGZkMjY0ZmViMTZkYzE3MzI2NjlkZTZmZTJhNjg4
14
+ NzQwZmRmNDA1YTU5ZGFjMTY4ZjliMmRhZDIyMjNiNzdiNTNkYjU5ZGNiYmQ3
15
+ NmRmM2EwN2JhMDcxYTkxZDJjYzI2YWIxYjRkMDFkYzFlNTk2Y2E=
@@ -5,7 +5,8 @@ require 'fuel/cli/version'
5
5
  require 'fuel/util/config'
6
6
  require 'fuel/util/json_parser'
7
7
  require 'fuel/cli/gerrit_common'
8
- require 'fuel/cli/patches'
8
+ require 'fuel/util/jenkins_client'
9
+ require 'fuel/util/patches'
9
10
  require 'fuel/cli/base'
10
11
  require 'fuel/cli/gerrit'
11
12
  require 'fuel/cli/jira'
@@ -1,3 +1,5 @@
1
+ require 'base64'
2
+
1
3
  module Fuel
2
4
  module CLI
3
5
  class Base < Thor
@@ -19,7 +21,7 @@ module Fuel
19
21
  def set_credentials(user, user_keys, password_keys)
20
22
  password = ask("Password:", echo: false)
21
23
  Config.set(*user_keys, user)
22
- Config.set(*password_keys, password)
24
+ Config.set64(*password_keys, password)
23
25
  puts
24
26
  end
25
27
  end
@@ -11,7 +11,7 @@ module Fuel
11
11
  package_name "gerrit"
12
12
 
13
13
  headers "Content-Type" => "application/json"
14
- digest_auth Config.get('gerrit', 'user'), Config.get('gerrit', 'password')
14
+ digest_auth Config.get('gerrit', 'user'), Config.get64('gerrit', 'password')
15
15
  parser GerritJsonParser
16
16
 
17
17
  desc "status", "Show a brief overview of the current gerrit status"
@@ -4,7 +4,7 @@ module Fuel
4
4
  include GerritCommon
5
5
 
6
6
  headers "Content-Type" => "application/json"
7
- digest_auth Config.get('gerrit', 'user'), Config.get('gerrit', 'password')
7
+ digest_auth Config.get('gerrit', 'user'), Config.get64('gerrit', 'password')
8
8
  parser GerritJsonParser
9
9
 
10
10
  package_name "jenkins"
@@ -72,7 +72,7 @@ module Fuel
72
72
  end
73
73
 
74
74
  def create_client
75
- @client ||= JenkinsApi::Client.new(Config.get('jenkins'))
75
+ @client ||= Fuel::Util::JenkinsClient.new(Config.get('jenkins'))
76
76
  end
77
77
 
78
78
  def build_link_or_fail
@@ -4,7 +4,7 @@ module Fuel
4
4
  package_name "jira"
5
5
 
6
6
  headers "Content-Type" => "application/json"
7
- basic_auth Config.get('jira', 'user'), Config.get('jira', 'password')
7
+ basic_auth Config.get('jira', 'user'), Config.get64('jira', 'password')
8
8
 
9
9
  desc "status [JIRA]", "View a brief summary of the jira"
10
10
  def status(jira = nil)
@@ -7,7 +7,7 @@ module Fuel
7
7
 
8
8
  desc "setup", "Set up the CLI interactively"
9
9
  def setup
10
- say flame, :cyan
10
+ say flame, [:cyan, :bold]
11
11
  say "\nWelcome to Fuel-CLI!\n\n", :bold
12
12
 
13
13
  setup_gerrit
@@ -1,5 +1,5 @@
1
1
  module Fuel
2
2
  module CLI
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -17,6 +17,10 @@ module Fuel
17
17
  save(config)
18
18
  end
19
19
 
20
+ def self.set64(*keys, value)
21
+ self.set(*keys, Base64::encode64(value))
22
+ end
23
+
20
24
  def self.get(*keys)
21
25
  ensure_config_exists
22
26
 
@@ -26,6 +30,11 @@ module Fuel
26
30
  nil
27
31
  end
28
32
 
33
+ def self.get64(*keys)
34
+ value = self.get(*keys)
35
+ value && Base64::decode64(value)
36
+ end
37
+
29
38
  def self.add(key, value)
30
39
  ensure_config_exists
31
40
 
@@ -0,0 +1,12 @@
1
+ require 'base64'
2
+
3
+ module Fuel
4
+ module Util
5
+ class JenkinsClient < ::JenkinsApi::Client
6
+ def initialize(args)
7
+ args[:password] = Base64::decode64(args[:password])
8
+ super(args)
9
+ end
10
+ end
11
+ end
12
+ end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuel-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Zherdev
@@ -122,10 +122,11 @@ files:
122
122
  - lib/fuel/cli/jenkins.rb
123
123
  - lib/fuel/cli/jira.rb
124
124
  - lib/fuel/cli/main.rb
125
- - lib/fuel/cli/patches.rb
126
125
  - lib/fuel/cli/version.rb
127
126
  - lib/fuel/util/config.rb
127
+ - lib/fuel/util/jenkins_client.rb
128
128
  - lib/fuel/util/json_parser.rb
129
+ - lib/fuel/util/patches.rb
129
130
  homepage: ''
130
131
  licenses:
131
132
  - MIT