fuel-cli 0.0.3 → 0.0.4

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
- NjlhODk3OGRiMzZiNjMwMjg0N2ZmYjU5YmQxNWU1YTY4ODNhYTFhNQ==
4
+ NDkwYzI5YWYwOGQ1YTBjYWNiYTc1NWE5ODM3ZTdjNDVlNWRkMDNjYw==
5
5
  data.tar.gz: !binary |-
6
- NGNmNTA0YWFmY2NmMzYxYTk1YmU5MTJjM2ZhZDMyZDQ2OTJmYmM5Mg==
6
+ NmE0OTZhNjhmYWNiMmNiMTkwYjk2YzJkN2EyYjcxYmI0ZWY1NjkyNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTYxMzEyMDJiNWIzYjc0ZmI2YmYxMDFkNzg0MzZjYTZlNDg0YjNlMDg2YzIw
10
- Mjc4M2RmN2EyZDA5Y2Q0MmQyYjdhMGFlOThjYTFmZWFmOWFiZWVlZjE0NTBh
11
- NWY4N2FiYzBjZTNhZjZhY2FmNTg5MjJiNWQ4ZjkwZDgyNzJiNDk=
9
+ NmQ3MTAxM2YwZWNjMzM1MjM1NzE0Y2FlN2EzM2E1YmI2NTc5ZjM0MjUzZWU4
10
+ ZWMwZWZjYTAwODgzY2RjNWYxZmJmOWU1NmE4MzQyYjI0YjViZWUwYTNmOTE3
11
+ MjJmMjEyZDc1NDQyYTFlYzdiNGUzOTM0MGFjNmYwNjgyMjdhOTM=
12
12
  data.tar.gz: !binary |-
13
- YjRjNjczMzAyODIwMmE2NGZkMjY0ZmViMTZkYzE3MzI2NjlkZTZmZTJhNjg4
14
- NzQwZmRmNDA1YTU5ZGFjMTY4ZjliMmRhZDIyMjNiNzdiNTNkYjU5ZGNiYmQ3
15
- NmRmM2EwN2JhMDcxYTkxZDJjYzI2YWIxYjRkMDFkYzFlNTk2Y2E=
13
+ ODM0NmFmOTM1OWI2NDI5OTRjYjlmMDllMTE0MGNkZTMzMjc2ZTg4NDMwOTVj
14
+ Yzc4YzA1OTNjNmMyN2Y0M2YxZWJiMGEzN2YyMDdhN2RhMjc2NGZmNDc4M2Vl
15
+ ZjM0MDdiN2IyYzNiZWYwYTA3Zjc3MjgwODZkZTI1NDc0NTMyMWY=
data/lib/fuel/cli/base.rb CHANGED
@@ -13,11 +13,6 @@ module Fuel
13
13
  `git log -1 --pretty=%B`
14
14
  end
15
15
 
16
- def fetch_change_id_or_fail
17
- change_id = commit_message =~ /Change-Id: (.*)/ && $1
18
- change_id or raise Thor::Error, set_color("No appropriate commit found at HEAD", :red)
19
- end
20
-
21
16
  def set_credentials(user, user_keys, password_keys)
22
17
  password = ask("Password:", echo: false)
23
18
  Config.set(*user_keys, user)
@@ -16,7 +16,7 @@ module Fuel
16
16
 
17
17
  desc "status", "Show a brief overview of the current gerrit status"
18
18
  def status
19
- change_id = 'Ia8b172edcedcef7856b4d5fa7aee9e58649abe75'#fetch_change_id_or_fail
19
+ change_id = fetch_change_id_or_fail
20
20
 
21
21
  result = self.class.get(changes_endpoint(change_id, "?o=CURRENT_REVISION")).parsed_response
22
22
  current_rev = result['current_revision']
@@ -62,7 +62,7 @@ module Fuel
62
62
  if alias_name
63
63
  Config.set('gerrit', 'aliases', alias_name, email)
64
64
  else
65
- aliases = Config.get('gerrit-aliases') || {}
65
+ aliases = Config.get('gerrit', 'aliases') || {}
66
66
  aliases_found = aliases.map { |k, v| v == email ? k : nil }.compact
67
67
  if aliases_found.empty?
68
68
  say "No aliases created for #{email}", :yellow
@@ -137,6 +137,12 @@ module Fuel
137
137
  submit_review('Code-Review', vote)
138
138
  end
139
139
 
140
+ option :message, :aliases => '-m'
141
+ desc "verified VOTE", "Put a Verified mark on the patch currently checked out"
142
+ def verified(vote)
143
+ submit_review('Verified', vote)
144
+ end
145
+
140
146
  desc "comments FILE", "View the file with comments"
141
147
  def comments(file)
142
148
  comments, lines = comments_for_file(file)
@@ -228,7 +234,7 @@ module Fuel
228
234
  end
229
235
 
230
236
  def emails_for_alias(alias_name)
231
- aliases = Config.get('gerrit-aliases', alias_name)
237
+ aliases = Config.get('gerrit', 'aliases', alias_name)
232
238
  end
233
239
 
234
240
  def format_row(row)
@@ -1,6 +1,11 @@
1
1
  module Fuel
2
2
  module CLI
3
3
  module GerritCommon
4
+ def fetch_change_id_or_fail
5
+ change_id = commit_message =~ /Change-Id: (.*)/ && $1
6
+ change_id or raise Thor::Error, set_color("No appropriate commit found at HEAD", :red)
7
+ end
8
+
4
9
  def gerrit_url
5
10
  Fuel::Util::Config.get('gerrit', 'url').chomp('/')
6
11
  end
@@ -18,7 +18,7 @@ module Fuel
18
18
 
19
19
  desc "deploy", "Deploy the latest patchset to your QA server"
20
20
  def deploy
21
- change_id = 'Ia8b172edcedcef7856b4d5fa7aee9e58649abe75'#fetch_change_id_or_fail
21
+ change_id = fetch_change_id_or_fail
22
22
  result = self.class.get(changes_endpoint(change_id, "?o=CURRENT_REVISION")).parsed_response
23
23
  current_rev = result['current_revision']
24
24
 
@@ -76,7 +76,7 @@ module Fuel
76
76
  end
77
77
 
78
78
  def build_link_or_fail
79
- change_id = 'I89fe9b251904fb929adf61605438fcc6fdbf534d'#fetch_change_id_or_fail
79
+ change_id = fetch_change_id_or_fail
80
80
  result = self.class.get(changes_endpoint(change_id, "detail")).parsed_response
81
81
  build_message = result['messages'].reverse.find { |m| m['author']['username'] == 'hbuilduser' }
82
82
  build_message &&= build_message['message']
@@ -1,5 +1,5 @@
1
1
  module Fuel
2
2
  module CLI
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -47,7 +47,7 @@ module Fuel
47
47
  private
48
48
 
49
49
  def self.load
50
- YAML.load_file(CONFIG_FILENAME) || {}
50
+ @config ||= (YAML.load_file(CONFIG_FILENAME) || {})
51
51
  end
52
52
 
53
53
  def self.save(config)
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Zherdev