gh-diff 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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b8d67bafa82796ac797c651eec6009dbf118f36
4
- data.tar.gz: d011146f7d0602cfb86607d2b07f8c2ee8627a72
3
+ metadata.gz: 8f0ca5acb8cb4b38f633229ea7a43fa0b803ab7a
4
+ data.tar.gz: 6975c4a9e86f67f8b147998b7b8c2b2fb1a16b17
5
5
  SHA512:
6
- metadata.gz: 4522295017af75cbd678a20409edece4758d162f06686e6744e92ad627ef5813653e17e184ddb60d3690be5fbd63d00b733b18786754642628fe2b74c1a6ad6e
7
- data.tar.gz: 2230b38da8a00b8bdc183a4d4af8ab9b1f526e923d7ec29c0baf0e203451e66d58e1725f69e2f4aebc8fa9779e60f093a117dd42fe359de5513073a9ea5fb577
6
+ metadata.gz: 7bac507888d8dcbd305173ac5593328813d22725cf622bf5494f79f4fa86c6e690a56b66bea056a2077d19150e0905d5ed38615453325294db2f808f53037be9
7
+ data.tar.gz: ec3fc3cfb2d0d7bd1aafdb83a2afc8f5fc1e392f41279bc98254fbe58610aa7ec9b1b37d857075815f16b3745877ad247805d79464bfd1b44e7abe51f2af3b13
data/lib/gh-diff/cli.rb CHANGED
@@ -30,9 +30,10 @@ module GhDiff
30
30
  github_auth(opts[:username], opts[:password], opts[:token])
31
31
 
32
32
  gh = Diff.new(opts[:repo], revision:opts[:revision], dir:opts[:dir])
33
- ref = gh.ref(opts[:revision], repo:opts[:repo])
34
-
35
- print "Base revision: #{ref[:object][:sha]}[#{ref[:ref]}]\n"
33
+ if opts[:ref]
34
+ ref = gh.ref(opts[:revision], repo:opts[:repo])
35
+ print "Base revision: #{ref[:object][:sha]}[#{ref[:ref]}]\n"
36
+ end
36
37
  print gh.get(file)
37
38
  rescue ::Octokit::NotFound
38
39
  path = (dir=opts[:dir]) ? "#{dir}/#{file}" : file
@@ -1,3 +1,3 @@
1
1
  module GhDiff
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -38,6 +38,7 @@ describe GhDiff::CLI do
38
38
  --repo=jekyll/jekyll --dir=site)
39
39
  GhDiff::CLI.start
40
40
  expect($stdout.string).to match(/title: Quick-start guide/)
41
+ expect($stdout.string).not_to match(/Base revision: .*master/)
41
42
  end
42
43
  end
43
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh-diff
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
  - kyoendo