duty-git 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 89edb7cb3a4c035010fd6de5a583a8ea1b45fac7
4
+ data.tar.gz: 5ab8379ff5f955a160cbd818522872c546e2b0c5
5
+ SHA512:
6
+ metadata.gz: 7bca4714bc928126ba3bb7746fb795cf72423b810c632e5fa8d11fabd555cc11ea4406864913437b85698356a814ec3d2ae7e40154cda11d672ce7c377904736
7
+ data.tar.gz: 0ded350eff57f60f991bfbd42616e6ff3cc698792bdb7bffd8f02dc7d6979cb53eb7fcc57105d9c7b10376a20bd55b77ca5e762a77122a56ff7b327566a79af6
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1 @@
1
+ duty-git
@@ -0,0 +1 @@
1
+ 2.2.3
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.6
4
+ before_install: gem install bundler -v 1.10.2
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in duty-git.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Jan Owiesniak
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,61 @@
1
+ # Duty::Git
2
+
3
+ git specific tasks for the duty task manager
4
+
5
+ ## Installation
6
+
7
+ 1. Clone this repo to your local system
8
+ 2. Add following lines to your your `.duty` file.
9
+
10
+ ```
11
+ tasks:
12
+ git: path/to/duty-git/lib/duty/git.rb
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```
18
+ $ duty
19
+ ```
20
+
21
+ ## Tasks
22
+
23
+ ### StartFeature
24
+
25
+ Start a new feature
26
+
27
+ ```
28
+ $ duty start-feature <feature-name>
29
+ ```
30
+
31
+ ### ContinueFeature
32
+
33
+ Continue on an already existing feature
34
+
35
+ ```
36
+ $ duty continue-feature <feature-name>
37
+ ```
38
+
39
+ ### DeleteFeature
40
+
41
+ Delete a feature
42
+
43
+ ```
44
+ $ duty delete-feature <feature-name>
45
+ ```
46
+
47
+ ### MergeFeature
48
+
49
+ Merge a feature into `master`
50
+
51
+ ```
52
+ $ duty merge-feature <feature-name>
53
+ ```
54
+
55
+ ## Contributing
56
+
57
+ 1. [Fork](http://github.com/JanOwiesniak/duty-git/fork)
58
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
59
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
60
+ 4. Push to the branch (`git push origin my-new-feature`)
61
+ 5. Create new Pull Request
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "duty/git"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'duty/git/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "duty-git"
8
+ spec.version = Duty::Git::VERSION
9
+ spec.authors = ["Jan Owiesniak"]
10
+ spec.email = ["owiesniak@mailbox.org"]
11
+
12
+ spec.summary = %q{git specific tasks for the duty task manager}
13
+ spec.description = %q{git specific tasks for the duty task manager}
14
+ spec.homepage = "https://github.com/JanOwiesniak/duty-git"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency "duty", "~> 0.4"
23
+ spec.add_development_dependency "bundler", "~> 1.10"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "minitest"
26
+ end
@@ -0,0 +1,114 @@
1
+ require 'duty'
2
+
3
+ module Duty
4
+ module Git
5
+ def self.namespace
6
+ 'git'
7
+ end
8
+
9
+ def self.tasks
10
+ [
11
+ Tasks::StartFeature,
12
+ Tasks::ContinueFeature,
13
+ Tasks::DeleteFeature,
14
+ Tasks::MergeFeature
15
+ ]
16
+ end
17
+
18
+ module Commands
19
+ def checkout_master
20
+ sh("Checkout `master` branch") { 'git checkout master' }
21
+ end
22
+ end
23
+
24
+ module Tasks
25
+ class BaseTask < ::Duty::Tasks::Base
26
+ end
27
+
28
+ class StartFeature < BaseTask
29
+ include Duty::Git::Commands
30
+
31
+ def self.description
32
+ "Start a new feature"
33
+ end
34
+
35
+ def self.usage
36
+ "duty start-feature <feature-name>"
37
+ end
38
+
39
+ def valid?
40
+ @feature_name = @arguments.first
41
+ end
42
+
43
+ def execute
44
+ checkout_master
45
+ sh("Create `feature/#{@feature_name}` branch") { "git checkout -b feature/#{@feature_name}" }
46
+ sh("Push `feature/#{@feature_name}` branch to `origin`") { "git push -u origin feature/#{@feature_name}" }
47
+ end
48
+ end
49
+
50
+ class ContinueFeature < BaseTask
51
+ def self.description
52
+ "Continue on an already existing feature"
53
+ end
54
+
55
+ def self.usage
56
+ "duty continue-feature <feature-name>"
57
+ end
58
+
59
+ def valid?
60
+ @feature_name = @arguments.first
61
+ end
62
+
63
+ def execute
64
+ sh("Checkout `feature/#{@feature_name}` branch") { "git checkout feature/#{@feature_name}" }
65
+ end
66
+ end
67
+
68
+ class DeleteFeature < BaseTask
69
+ include Duty::Git::Commands
70
+
71
+ def self.description
72
+ "Delete a feature"
73
+ end
74
+
75
+ def self.usage
76
+ "duty delete-feature <feature-name>"
77
+ end
78
+
79
+ def valid?
80
+ @feature_name = @arguments.first
81
+ end
82
+
83
+ def execute
84
+ checkout_master
85
+ sh("Delete `feature/#{@feature_name}` branch on `origin`") { "git push origin --delete remotes/origin/feature/#{@feature_name}" }
86
+ sh("Delete `feature/#{@feature_name}` branch") { "git branch -d feature/#{@feature_name}" }
87
+ end
88
+ end
89
+
90
+ class MergeFeature < BaseTask
91
+ include Duty::Git::Commands
92
+
93
+ def self.description
94
+ "Merge a feature into `master`"
95
+ end
96
+
97
+ def self.usage
98
+ "duty merge-feature <feature-name>"
99
+ end
100
+
101
+ def valid?
102
+ @feature_name = @arguments.first
103
+ end
104
+
105
+ def execute
106
+ checkout_master
107
+ sh("Merge feature/#{@feature_name} into `master`") { "git merge --no-ff feature/#{@feature_name}" }
108
+ end
109
+ end
110
+ end
111
+ end
112
+ end
113
+
114
+ Duty::Registry.register(Duty::Git)
File without changes
@@ -0,0 +1,5 @@
1
+ module Duty
2
+ module Git
3
+ VERSION = "0.3.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: duty-git
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Jan Owiesniak
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: duty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
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
+ description: git specific tasks for the duty task manager
70
+ email:
71
+ - owiesniak@mailbox.org
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".ruby-gemset"
78
+ - ".ruby-version"
79
+ - ".travis.yml"
80
+ - CODE_OF_CONDUCT.md
81
+ - Gemfile
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - bin/console
86
+ - bin/setup
87
+ - duty-git.gemspec
88
+ - lib/duty/git.rb
89
+ - lib/duty/git/tasks.rb
90
+ - lib/duty/git/version.rb
91
+ homepage: https://github.com/JanOwiesniak/duty-git
92
+ licenses:
93
+ - MIT
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.4.8
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: git specific tasks for the duty task manager
115
+ test_files: []