pully-cli 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 40f2d88dd79739e33f5963e986fc02ede9f3290a
4
+ data.tar.gz: 244df5f5d66a29b0f4a4faed26ad8eaeb9ac5657
5
+ SHA512:
6
+ metadata.gz: 43c42626ee4d816157b02bd7a6d86d1d2c1b5fa54df641698abf7ea95f47840d52cfd186021e83186cab77804a94d3219551ae501c5858d457247cc8b181cc6d
7
+ data.tar.gz: c95b3db50e5c51451ac976af0841fbe61403685bc2074dc1e636eb04eb9813c8ba896d5b52e1134e2fa26d712c3c5fdd0a46e9f6a904f9c94f2483c29b3e4fd5
data/.gitignore ADDED
@@ -0,0 +1,36 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+ /target/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalisation:
25
+ /.bundle/
26
+ /vendor/bundle
27
+ /lib/bundler/man/
28
+
29
+ # for a library or gem, you might want to ignore these files since the code is
30
+ # intended to run in multiple environments; otherwise, check them in:
31
+ # Gemfile.lock
32
+ # .ruby-version
33
+ # .ruby-gemset
34
+
35
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
+ .rvmrc
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --require spec_helper
2
+ --order random
3
+ --color true
4
+ --format progress
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ Style/Documentation:
2
+ Enabled: false
3
+
4
+ Metrics/LineLength:
5
+ Max: 120
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.0
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.2.0"
7
+ - "2.2.1"
8
+ deploy:
9
+ provider: rubygems
10
+ api_key:
11
+ secure: GBnhPCF3UiTHXVjmVl/U4LOtRYKBg3iluB2YYWZuBt8LPRSdi41VI6TEVhJ9S7XpJQhmt9Nq3PGr2b74fqmBGAmSAaCKfnHHLrc5SqKdzc0zd9h5VORHGmUJWp/w1Qq/96fnpMfbNqlBIdAs1JaXVuwV0H8KAeTRASzLNjfahoeZR1uWzKLsvgHmJ17qAC/v3mZBfaYY6nnf1GBOs9N6WebaR/MC8SvTxmiLldl/QVuMUdiSJURlJ0dJnHMLq9P1LB0t4ECNLmC7hNKfnTJ3+CPq5Ow7go3Yt1/46liaa0edkXja05VHaBijEQColQqNkjfxL/Xb/n/QnHGIcZ4Au961Nw57/CZLmJ/U6bRXjamtkodKI8eYAS/3bAdVHr/266ZAHXj5jGqzjpIPqDueuOAR+b1iNlyCw5kKEcm2plPLIxslUmrZIPH4VHcPHvXcal46AX6BH399Mv2RZ9iyxyTZlrPQErl+urN8Gu+Zp2kmjtaA5QrUwaS50uj8eRL/tSz7mtrQn/2lw6JPcB1tzla5LpslDD39OZFa5Ejs8vNzbrYpSda5IY1bBjpqZ+O/3T1s54bqVNxWTLiGLXwWnexLldc6L5u+fgsUK0saQ8KlUQtSIVW+iVcVcWBhgkFN522S8EofF79AX2MtVJkw7679YywuLAplPbLyreunIsk=
12
+ gem: pully-cli
13
+ gemspec: pully-cli.gemspec
14
+ on:
15
+ tags: true
16
+ repo: robert2d/pully
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pully (0.0.1)
5
+ git
6
+ uri-ssh_git
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.0.0)
12
+ astrolabe (1.3.1)
13
+ parser (~> 2.2)
14
+ codeclimate-test-reporter (0.4.7)
15
+ simplecov (>= 0.7.1, < 1.0.0)
16
+ coderay (1.1.0)
17
+ diff-lcs (1.2.5)
18
+ docile (1.1.5)
19
+ git (1.2.9.1)
20
+ json (1.8.3)
21
+ method_source (0.8.2)
22
+ parser (2.2.2.6)
23
+ ast (>= 1.1, < 3.0)
24
+ powerpack (0.1.1)
25
+ pry (0.10.1)
26
+ coderay (~> 1.1.0)
27
+ method_source (~> 0.8.1)
28
+ slop (~> 3.4)
29
+ rainbow (2.0.0)
30
+ rake (10.4.2)
31
+ rspec (3.3.0)
32
+ rspec-core (~> 3.3.0)
33
+ rspec-expectations (~> 3.3.0)
34
+ rspec-mocks (~> 3.3.0)
35
+ rspec-core (3.3.2)
36
+ rspec-support (~> 3.3.0)
37
+ rspec-expectations (3.3.1)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.3.0)
40
+ rspec-mocks (3.3.2)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.3.0)
43
+ rspec-support (3.3.0)
44
+ rubocop (0.32.1)
45
+ astrolabe (~> 1.3)
46
+ parser (>= 2.2.2.5, < 3.0)
47
+ powerpack (~> 0.1)
48
+ rainbow (>= 1.99.1, < 3.0)
49
+ ruby-progressbar (~> 1.4)
50
+ ruby-progressbar (1.7.5)
51
+ simplecov (0.10.0)
52
+ docile (~> 1.1.0)
53
+ json (~> 1.8)
54
+ simplecov-html (~> 0.10.0)
55
+ simplecov-html (0.10.0)
56
+ slop (3.6.0)
57
+ uri-ssh_git (0.1.1)
58
+
59
+ PLATFORMS
60
+ ruby
61
+
62
+ DEPENDENCIES
63
+ codeclimate-test-reporter
64
+ pry
65
+ pully!
66
+ rake
67
+ rspec
68
+ rubocop
69
+ simplecov
70
+
71
+ BUNDLED WITH
72
+ 1.10.5
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Dave Robertson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # pully
2
+ Pull request creator on github
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ # Don't want to expose task that pushes to rubygems
2
+ # so load gem_helper functions instead
3
+ require 'bundler'
4
+
5
+ require 'rspec/core'
6
+ require 'rspec/core/rake_task'
7
+ require 'rubocop/rake_task'
8
+
9
+ Dir.glob('lib/tasks/*.rake').each { |r| load r }
10
+
11
+ RuboCop::RakeTask.new do |t|
12
+ t.formatters = %w(progress json)
13
+ t.options = %w(--out target/rubocop.json)
14
+ end
15
+
16
+ RSpec::Core::RakeTask.new(:spec) do |spec|
17
+ spec.pattern = FileList['spec/**/*_spec.rb']
18
+ end
19
+
20
+ task default: [:spec, :rubocop]
data/bin/pully ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pully'
4
+
5
+ Pully.open
@@ -0,0 +1,3 @@
1
+ class Pully
2
+ VERSION = '0.0.1'
3
+ end
data/lib/pully.rb ADDED
@@ -0,0 +1,40 @@
1
+ require 'git'
2
+ require 'uri'
3
+ require 'uri/ssh_git'
4
+
5
+ class Pully
6
+ attr_reader :git, :branch, :remote
7
+
8
+ def self.open
9
+ new.open
10
+ end
11
+
12
+ def initialize
13
+ dir = '.'
14
+ dir += '/..' until File.directory?("#{dir}/.git")
15
+ @git = Git.open(dir)
16
+ @branch = Git::Lib.new.send(:command, 'rev-parse --abbrev-ref HEAD')
17
+ @remote = process_remote(git.config['remote.origin.url'])
18
+ end
19
+
20
+ def open
21
+ link = "#{remote.gsub('.git', '')}/compare/#{branch}?expand=1"
22
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
23
+ system "start #{link}"
24
+ elsif RbConfig::CONFIG['host_os'] =~ /darwin/
25
+ system "open #{link}"
26
+ elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/
27
+ system "xdg-open #{link}"
28
+ end
29
+ end
30
+
31
+ private
32
+
33
+ def process_remote(remote)
34
+ URI.parse(remote)
35
+ return remote
36
+ rescue URI::InvalidURIError
37
+ uri = URI::SshGit.parse(remote)
38
+ return "https://#{uri.host}#{uri.path}"
39
+ end
40
+ end
data/pully-cli.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pully/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'pully-cli'
8
+ gem.version = Pully::VERSION
9
+ gem.version = "#{gem.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
10
+ gem.authors = ['Dave Robertson']
11
+ gem.email = ['david.andrew.robertson.nz@gmail.com']
12
+ gem.description = 'Consumer Data EMR Tool'
13
+ gem.summary = 'Pull request creator on github or enterprise github'
14
+ gem.homepage = 'https://github.com/robert2d/pully'
15
+ gem.license = 'MIT'
16
+
17
+ gem.add_runtime_dependency 'git'
18
+ gem.add_runtime_dependency 'uri-ssh_git'
19
+
20
+ gem.add_development_dependency 'rspec'
21
+ gem.add_development_dependency 'rake'
22
+ gem.add_development_dependency 'rubocop'
23
+ gem.add_development_dependency 'pry'
24
+ gem.add_development_dependency 'simplecov'
25
+ gem.add_development_dependency 'codeclimate-test-reporter'
26
+
27
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
28
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
29
+ gem.test_files = gem.files.grep(%r{^(?:test|spec|features)/})
30
+ gem.require_paths = %w(lib)
31
+ end
@@ -0,0 +1,70 @@
1
+ describe Pully do
2
+ subject { described_class }
3
+
4
+ before do
5
+ allow_any_instance_of(Git::Lib).to receive(:command).and_return('master')
6
+ allow(RbConfig::CONFIG).to receive(:[]).and_return(os)
7
+ end
8
+
9
+ context 'https URL' do
10
+ describe '#open' do
11
+ let(:os) { 'darwin' }
12
+
13
+ it 'opens the url on OSX' do
14
+ expect_any_instance_of(subject).to receive(:system).with(
15
+ 'open https://github.com/robert2d/pully/compare/master?expand=1'
16
+ )
17
+ expect_any_instance_of(Git::Base).to receive(:config).and_return(
18
+ 'remote.origin.url' => 'git@github.com:robert2d/pully.git'
19
+ )
20
+ subject.open
21
+ end
22
+ end
23
+ end
24
+
25
+ context 'git URL' do
26
+ describe '#open' do
27
+ let(:os) { 'darwin' }
28
+
29
+ it 'opens the url on OSX' do
30
+ expect_any_instance_of(subject).to receive(:system).with(
31
+ 'open https://github.com/robert2d/pully/compare/master?expand=1'
32
+ )
33
+ expect_any_instance_of(Git::Base).to receive(:config).and_return(
34
+ 'remote.origin.url' => 'https://github.com/robert2d/pully.git'
35
+ )
36
+ subject.open
37
+ end
38
+ end
39
+ end
40
+
41
+ describe 'other OS' do
42
+ before do
43
+ allow_any_instance_of(Git::Base).to receive(:config).and_return(
44
+ 'remote.origin.url' => 'https://github.com/robert2d/pully.git'
45
+ )
46
+ end
47
+
48
+ context 'windows' do
49
+ let(:os) { 'mswin' }
50
+
51
+ it 'opens correctly' do
52
+ expect_any_instance_of(subject).to receive(:system).with(
53
+ 'start https://github.com/robert2d/pully/compare/master?expand=1'
54
+ )
55
+ subject.open
56
+ end
57
+ end
58
+
59
+ context 'linux' do
60
+ let(:os) { 'bsd' }
61
+
62
+ it 'opens correctly' do
63
+ expect_any_instance_of(subject).to receive(:system).with(
64
+ 'xdg-open https://github.com/robert2d/pully/compare/master?expand=1'
65
+ )
66
+ subject.open
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,19 @@
1
+ require 'rspec'
2
+ require 'pry'
3
+ require 'simplecov'
4
+ require 'codeclimate-test-reporter'
5
+ CodeClimate::TestReporter.start
6
+
7
+ SimpleCov.coverage_dir('target/coverage')
8
+
9
+ SimpleCov.start do
10
+ add_filter 'spec'
11
+ end
12
+
13
+ require 'pully'
14
+
15
+ RSpec.configure do |config|
16
+ config.disable_monkey_patching!
17
+ config.expose_dsl_globally = true
18
+ config.order = :random
19
+ end
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pully-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dave Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: git
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: uri-ssh_git
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: codeclimate-test-reporter
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Consumer Data EMR Tool
126
+ email:
127
+ - david.andrew.robertson.nz@gmail.com
128
+ executables:
129
+ - pully
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".rubocop.yml"
136
+ - ".ruby-version"
137
+ - ".travis.yml"
138
+ - Gemfile
139
+ - Gemfile.lock
140
+ - LICENSE
141
+ - README.md
142
+ - Rakefile
143
+ - bin/pully
144
+ - lib/pully.rb
145
+ - lib/pully/version.rb
146
+ - pully-cli.gemspec
147
+ - spec/lib/pully_spec.rb
148
+ - spec/spec_helper.rb
149
+ homepage: https://github.com/robert2d/pully
150
+ licenses:
151
+ - MIT
152
+ metadata: {}
153
+ post_install_message:
154
+ rdoc_options: []
155
+ require_paths:
156
+ - lib
157
+ required_ruby_version: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ required_rubygems_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ requirements: []
168
+ rubyforge_project:
169
+ rubygems_version: 2.4.5
170
+ signing_key:
171
+ specification_version: 4
172
+ summary: Pull request creator on github or enterprise github
173
+ test_files:
174
+ - spec/lib/pully_spec.rb
175
+ - spec/spec_helper.rb
176
+ has_rdoc: