anticuado 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0a654f19a82077dc3131cf16acc8487f046d9ef
4
- data.tar.gz: 4ae6db0f9d00609de171af9cb957ca016e8c1b92
3
+ metadata.gz: ad73735c727cc7c436a9c7d957979c9452877908
4
+ data.tar.gz: f78b81e89008e4748e95ade108af0e20c89c3589
5
5
  SHA512:
6
- metadata.gz: 98542b15b59bff2ca1405e70dd8ef64fd9cfe5a75b8815eb3af2c2180e2cc42390d66aae2b080f3b3d320e8c14d32e210deda3c3ff5475b87d29829ef3229037
7
- data.tar.gz: c966d6bae2ee914506542c312ea9353647d4e991aea826cd9ec0c0f98d32452a6f08fcbd7948f39f7239d201e487da40ae4d829e3f7122189e7b57277276be71
6
+ metadata.gz: 2b8c6d6be86210ba900013f47338bf3a51baf3b218c7222a6ce95165223f9830385ebf3c1d276bb34629fce38afa283bfc2a6ee27e95ac90ac394eee097b4a94
7
+ data.tar.gz: 21253f25b4e640943d5448d6ef4be133e595ac5acb1893993cd7691ddaa9e6874115c7c9256046464b62775366e9eefb2d8d930ae6a63bda2cc2065d993e7764
@@ -16,7 +16,7 @@ module Anticuado
16
16
  else
17
17
  ::Octokit::Client.new(:access_token => ENV['GITHUB_TOKEN'])
18
18
  end
19
- @repo_uri = "git@#{URI.parse(@client.web_endpoint).host}:#{@repo_name}.git"
19
+ @repo_uri = "git@#{URI.parse(enterprise ? @client.api_endpoint : @client.web_endpoint).host}:#{@repo_name}.git"
20
20
  end
21
21
 
22
22
  def clone_or_open_to(target_path)
@@ -32,9 +32,7 @@ module Anticuado
32
32
  def create_a_new_pull_request(base_branch:, head_branch: (Time.now.strftime '%Y%m%d-%H%M%S'), update_libraries: nil)
33
33
  remote_name = 'origin'
34
34
 
35
- @git.checkout base_branch
36
-
37
- if !@git.status.changed.empty?
35
+ begin
38
36
  create_a_branch_local head_branch
39
37
  commit_all_changes
40
38
 
@@ -42,8 +40,8 @@ module Anticuado
42
40
  create_pull_request(base_branch: base_branch, head_branch: head_branch, title: github_pr_title(head_branch), body: github_pr_body(update_libraries))
43
41
 
44
42
  delete_a_branch_local head_branch
45
- else
46
- puts "no changes"
43
+ rescue Git::GitExecuteError => e
44
+ puts "no changes: #{e}, #{e.message}"
47
45
  end
48
46
  end
49
47
 
@@ -73,7 +71,7 @@ module Anticuado
73
71
  end
74
72
 
75
73
  def delete_a_branch_local(branch_name)
76
- @git.branch(branch_name).checkout # We should change current branch first
74
+ @git.checkout # We should change current branch first
77
75
  @git.branch(branch_name).delete
78
76
  end
79
77
 
@@ -85,4 +83,4 @@ module Anticuado
85
83
  @client.create_pull_request @repo_name, base_branch, head_branch, title, body
86
84
  end
87
85
  end
88
- end # module Anticuado
86
+ end # module Anticuado
@@ -56,10 +56,10 @@ module Anticuado
56
56
  def do_update_lock(target_names = nil)
57
57
  if target_names.nil?
58
58
  `carthage update --project-directory=#{@project_dir}`
59
+ else
60
+ raise ArgumentError, "An argument should be Array like ['Result']" unless target_names.is_a? Array
61
+ `carthage update #{target_names.join(' ')} --project-directory=#{@project_dir}`
59
62
  end
60
-
61
- raise ArgumentError, "An argument should be Array like ['Result']" unless target_names.is_a? Array
62
- `carthage update #{target_names.join(' ')} --project-directory=#{@project_dir}`
63
63
  end
64
64
  end # class Carthage
65
65
  end # module IOS
@@ -60,10 +60,10 @@ module Anticuado
60
60
  def do_update_lock(target_names = nil)
61
61
  if target_names.nil?
62
62
  `pod update --project-directory=#{@project_dir}`
63
+ else
64
+ raise ArgumentError, "An argument should be Array like ['PromisesObjC']" unless target_names.is_a? Array
65
+ `pod update #{target_names.join(' ')} --project-directory=#{@project_dir}`
63
66
  end
64
-
65
- raise ArgumentError, "An argument should be Array like ['PromisesObjC']" unless target_names.is_a? Array
66
- `pod update #{target_names.join(' ')} --project-directory=#{@project_dir}`
67
67
  end
68
68
 
69
69
  def update_with_prefix(pod_file_in:, pod_file_out: nil, libraries:, prefix:)
@@ -1,16 +1,15 @@
1
1
  module Anticuado
2
2
  module Ruby
3
3
  class Bundler < Anticuado::Base
4
- def outdated
4
+ def outdated(option = '')
5
5
  return puts "have no bundle command" if `which bundle`.empty?
6
6
 
7
7
  if @project_dir
8
- current_dir = Anticuado.current_dir
9
- Dir.chdir Anticuado.project_dir(@project_dir)
10
- @outdated_libraries = run_outdated
11
- Dir.chdir current_dir
8
+ Dir.chdir(@project_dir) do
9
+ @outdated_libraries = run_outdated option
10
+ end
12
11
  else
13
- @outdated_libraries = run_outdated
12
+ @outdated_libraries = run_outdated option
14
13
  end
15
14
  @outdated_libraries
16
15
  end
@@ -54,15 +53,14 @@ module Anticuado
54
53
  def do_update_lock(target_names = nil)
55
54
  if target_names.nil?
56
55
  `bundle update`
56
+ else
57
+ raise ArgumentError, "An argument should be Array like ['cocoapod']" unless target_names.is_a? Array
58
+ `bundle update #{target_names.join(' ')}`
57
59
  end
58
-
59
- raise ArgumentError, "An argument should be Array like ['cocoapod']" unless target_names.is_a? Array
60
-
61
- `bundle update #{target_names.join(' ')}`
62
60
  end
63
61
 
64
- def run_outdated
65
- `bundle install`
62
+ def run_outdated(option)
63
+ `bundle install #{option}`
66
64
  `bundle outdated`
67
65
  end
68
66
  end # class Bundler
@@ -1,3 +1,3 @@
1
1
  module Anticuado
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anticuado
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git