octo_merge 0.1.2 → 0.1.3

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: 5ad3acce22d996c8dbd70fb5044771b918acfbfc
4
- data.tar.gz: 476c5956699b9c2309dc30be9a3ce92574f7c03d
3
+ metadata.gz: a7b9a5819e11f475b2e7676343592c274f4a17ac
4
+ data.tar.gz: 4a5f04d70abfbacc7718ab84143e7e68000762b7
5
5
  SHA512:
6
- metadata.gz: 0a05928307fd1f68f050267584d6c30503c79ef4eb63bc65bdda1d359c8156bbd97e44abe671fd20b8f131f2f7ccc200a926644ebb8af99e1a1cf108295991e4
7
- data.tar.gz: 58e7f0dbef7ba0a1bd6c3892285271126df4ec9628f4c9b7be90a4332a73e6311ed8324a88546f071a422b0c13d1f8aee95696a1b8e61383fc4dc8485517acc3
6
+ metadata.gz: 96bb75ccc5a91b4b9009b0e9bbb6dc888b6a49ff59917c85bada93f6fcd9c293035b5b03a1d1d806715ca4cf5b2c0a44439a4a8abb05ab3563399038bd6d270d
7
+ data.tar.gz: 13ff3e0eaa02942eb16cd998257b4501b34fdb798b12edd029f5d44e5959e620ed0562ded954f4121c006485b2ef87aedd88d4fdd01407e2dee28e7557772686
data/README.md CHANGED
@@ -28,6 +28,8 @@ Or install it yourself as:
28
28
  ## Examples
29
29
 
30
30
  ```
31
+ # Within your shell
32
+
31
33
  octo-merge \
32
34
  --repo=rails/rails \
33
35
  --dir=~/Dev/Rails/rails \
@@ -80,7 +82,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
80
82
 
81
83
  ## Contributing
82
84
 
83
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/octo_merge. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
85
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Deradon/octo_merge. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
84
86
 
85
87
 
86
88
  ## License
data/exe/octo-merge CHANGED
@@ -1,9 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'optparse'
3
+ require "optparse"
4
4
  require "octo_merge"
5
+ require "yaml"
6
+
7
+ options = if File.exist?(".octo-merge.yml")
8
+ body = File.read(".octo-merge.yml")
9
+ YAML.load(body)
10
+ else
11
+ {}
12
+ end
13
+
14
+ # Symbolize keys
15
+ options = options.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
5
16
 
6
- options = {}
7
17
  OptionParser.new do |opts|
8
18
  opts.banner = "Usage: octo-merge [options]"
9
19
 
@@ -12,11 +22,11 @@ OptionParser.new do |opts|
12
22
  end
13
23
 
14
24
  opts.on("--dir=DIR", "Working directory (e.g.: '~/Dev/Rails/rails')") do |dir|
15
- options[:working_directory] = File.expand_path(dir)
25
+ options[:dir] = dir
16
26
  end
17
27
 
18
28
  opts.on("--pull_requests=PULL_REQUESTS", "Pull requests (e.g.: '23,42,66')") do |pull_requests|
19
- options[:pull_requests] = pull_requests.split(",")
29
+ options[:pull_requests] = pull_requests
20
30
  end
21
31
 
22
32
  opts.on("--login=login", "Login (Your GitHub username)") do |login|
@@ -28,15 +38,24 @@ OptionParser.new do |opts|
28
38
  end
29
39
 
30
40
  opts.on("--strategy=STRATEGY", "Merge strategy (e.g.: 'MergeWithoutRebase')") do |strategy|
31
- options[:strategy] = Object.const_get("OctoMerge::#{strategy}")
41
+ options[:strategy] = strategy
32
42
  end
33
43
 
34
44
  opts.on('-h', '--help', 'Display this screen') do
35
45
  puts opts
36
46
  exit
37
47
  end
48
+
49
+ opts.on('-v', '--version', 'Display the version') do
50
+ puts OctoMerge::VERSION
51
+ exit
52
+ end
38
53
  end.parse!
39
54
 
55
+ options[:dir] = File.expand_path(options[:dir])
56
+ options[:pull_requests] = options[:pull_requests].split(",")
57
+ options[:strategy] = Object.const_get("OctoMerge::#{options[:strategy]}")
58
+
40
59
  OctoMerge.configure do |config|
41
60
  config.login = options[:login]
42
61
  config.password = options[:password]
@@ -45,6 +64,6 @@ end
45
64
  OctoMerge.run(
46
65
  repo: options[:repo],
47
66
  pull_request_numbers: options[:pull_requests],
48
- working_directory: options[:working_directory],
67
+ working_directory: options[:dir],
49
68
  strategy: options[:strategy]
50
69
  )
@@ -1,3 +1,3 @@
1
1
  module OctoMerge
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octo_merge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Helm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-29 00:00:00.000000000 Z
11
+ date: 2016-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit